mdf:入库兼容混料
This commit is contained in:
@@ -53,6 +53,8 @@ import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.ToIntFunction;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -375,7 +377,8 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
struct_id = struct.getStruct_id();
|
||||
struct_code = struct.getStruct_code();
|
||||
struct_name = struct.getStruct_name();
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
Structattr structattr = iStructattrService.findById(map.get("struct_id"));
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = mdPbStoragevehicleinfoMapper.selectOne(new LambdaQueryWrapper<>(MdPbStoragevehicleinfo.class)
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, map.get("storagevehicle_code"))
|
||||
@@ -419,13 +422,16 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
.eq(IOStorInvDis::getIostorinv_id,iostorinvId)
|
||||
.eq(IOStorInvDis::getStoragevehicle_code,storagevehicleCode)
|
||||
);
|
||||
//维护单据明细表里 分配数量
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("iostorinvdtl_id",map.get("iostorinvdtl_id"));
|
||||
jsonObject.put("bill_status",IOSEnum.BILL_STATUS.code("分配完"));
|
||||
jsonObject.put("assign_qty",map.get("plan_qty"));
|
||||
jsonObject.put("unassign_qty","0");
|
||||
ioStorInvDtlMapper.updateById(jsonObject.toJavaObject(IOStorInvDtl.class));
|
||||
//维护单据明细表里分配数量
|
||||
List<String> dtlCollect = disList.stream().map(IOStorInvDis::getIostorinvdtl_id).collect(Collectors.toList());
|
||||
List<IOStorInvDtl> dtls = ioStorInvDtlMapper.selectList(new LambdaQueryWrapper<IOStorInvDtl>().in(IOStorInvDtl::getIostorinvdtl_id, dtlCollect));
|
||||
for (IOStorInvDtl dtl : dtls) {
|
||||
int disQtySum = disList.stream().filter(dis -> dis.getIostorinvdtl_id().equals(dtl.getIostorinvdtl_id())).mapToInt(value -> value.getPlan_qty().intValue()).sum();
|
||||
dtl.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
|
||||
dtl.setAssign_qty(BigDecimal.valueOf(disQtySum));
|
||||
dtl.setUnassign_qty(BigDecimal.valueOf(0));
|
||||
ioStorInvDtlMapper.updateById(dtl);
|
||||
}
|
||||
//根据单据标识判断分配明细是否都已经分配完成
|
||||
int disCount = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinv_id, iostorinvId)
|
||||
|
||||
@@ -370,6 +370,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
mater.setQty(unassign_qty);
|
||||
mater.setPcsn(pcsn);
|
||||
mater.setMaterial_code(material_code);
|
||||
mater.setMaterial_id(material_id);
|
||||
List<StrategyMater> list = new ArrayList<>();
|
||||
list.add(mater);
|
||||
List<StrategyStructMaterialVO> structMaterials = iStructattrService.outBoundSectDiv(
|
||||
|
||||
Reference in New Issue
Block a user