备件信息-库存

highway
wws 1 year ago
parent 3262f842a3
commit 8874da06bc

@ -65,6 +65,16 @@ public class EquPlanEquSpare extends BaseEntity {
/** 删除标识 */
private String delFlag;
private BigDecimal amount;
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public void setId(String id) {
this.id = id;
}

@ -1,5 +1,6 @@
package com.op.device.mapper;
import java.math.BigDecimal;
import java.util.List;
import com.op.device.domain.SparePartsLedger;
@ -58,4 +59,12 @@ public interface SparePartsLedgerMapper {
* @return
*/
public int deleteSparePartsLedgerByStorageIds(String[] storageIds);
/**
* -
* @param materialCode
* @return
*/
BigDecimal selectRealAmountByMaterialCode(String materialCode);
}

@ -1,5 +1,6 @@
package com.op.device.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@ -53,6 +54,9 @@ public class EquPlanServiceImpl implements IEquPlanService {
private EquPlanEquMapper equPlanEquMapper;
@Autowired
private EquPlanEquSpareMapper equPlanEquSpareMapper;
// 备件mapper
@Autowired
private SparePartsLedgerMapper sparePartsLedgerMapper;
/**
*
@ -362,8 +366,13 @@ public class EquPlanServiceImpl implements IEquPlanService {
EquPlanEquSpare spare = new EquPlanEquSpare();
spare.setParentCode(equipment.getCode());
// 备件信息
List<EquPlanEquSpare> spareList = equPlanEquSpareMapper.selectEquPlanEquSpareList(spare);
if (spareList.size() > 0) {
for (EquPlanEquSpare equSpare : spareList) {
// 通过备件编码查询备件库存信息(总量-冻结)
equSpare.setAmount(sparePartsLedgerMapper.selectRealAmountByMaterialCode(equSpare.getMaterialCode()));
}
equipment.setSpareList(spareList);
}

@ -123,7 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
and storage_tpye = 'SP'
</select>
<select id="selectRealAmountByMaterialCode" resultType="java.math.BigDecimal">
select (amount-storage_amount) AS 'amount' from wms_ods_mate_storage_news where material_code = #{materialCode}
</select>
<insert id="insertSparePartsLedger" parameterType="SparePartsLedger">
insert into wms_ods_mate_storage_news
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save