备件信息-库存

highway
wws 1 year ago
parent 3262f842a3
commit 8874da06bc

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

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

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

@ -123,7 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0' and del_flag = '0'
and storage_tpye = 'SP' and storage_tpye = 'SP'
</select> </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 id="insertSparePartsLedger" parameterType="SparePartsLedger">
insert into wms_ods_mate_storage_news insert into wms_ods_mate_storage_news
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save