|
|
@ -311,7 +311,7 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService |
|
|
|
throw new BusinessException("添加出库单信息失败"); |
|
|
|
} |
|
|
|
//生成出库单详情相关信息
|
|
|
|
generateWarehouseOutOrder(sysMakeorderPickVo, tempSysMakeorderPickVo, outOrderCode,mergeMakeorderPickDetails); |
|
|
|
generateWarehouseOutOrder(sysMakeorderPickVo, tempSysMakeorderPickVo, outOrderCode,sysMakeorderPickDetails); |
|
|
|
return insertResult; |
|
|
|
} |
|
|
|
|
|
|
@ -343,44 +343,59 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService |
|
|
|
|
|
|
|
|
|
|
|
//生成出库单详情相关信息
|
|
|
|
private void generateWarehouseOutOrder(SysMakeorderPickVo sysMakeorderPickVo, SysMakeorderPickVo tempSysMakeorderPickVo, String outOrderCode,List<SysMakeorderPickDetail> mergeMakeorderPickDetails) { |
|
|
|
private void generateWarehouseOutOrder(SysMakeorderPickVo sysMakeorderPickVo, SysMakeorderPickVo tempSysMakeorderPickVo, String outOrderCode,List<SysMakeorderPickDetail> sysMakeorderPickDetails) { |
|
|
|
|
|
|
|
for (SysMakeorderPickDetail sysMakeorderPickDetail : mergeMakeorderPickDetails) { |
|
|
|
for (SysMakeorderPickDetail sysMakeorderPickDetail : sysMakeorderPickDetails) { |
|
|
|
WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail(); |
|
|
|
warehouseOutOrderDetail.setOutOrderCode(outOrderCode); |
|
|
|
warehouseOutOrderDetail.setWarehouseOutStatus("4"); |
|
|
|
warehouseOutOrderDetail.setRelatedOrderCode(tempSysMakeorderPickVo.getMakeNo()); |
|
|
|
warehouseOutOrderDetail.setMakeNo(tempSysMakeorderPickVo.getMakeNo()); |
|
|
|
//标明来源是生产订单
|
|
|
|
warehouseOutOrderDetail.setWarehouseOrderType("1"); |
|
|
|
warehouseOutOrderDetail.setWarehouseOutType("1"); |
|
|
|
warehouseOutOrderDetail.setMaterialSum(tempSysMakeorderPickVo.getMaterialSum()); |
|
|
|
warehouseOutOrderDetail.setEnterpriseSum(tempSysMakeorderPickVo.getEnterpriseSum()); |
|
|
|
|
|
|
|
warehouseOutOrderDetail.setCreateBy(ShiroUtils.getLoginName()); |
|
|
|
warehouseOutOrderDetail.setCreateTime(new Date()); |
|
|
|
warehouseOutOrderDetail.setApplyName(sysMakeorderPickVo.getApplyUser()); |
|
|
|
//物料相关信息
|
|
|
|
warehouseOutOrderDetail.setMaterialNo(sysMakeorderPickDetail.getMaterialNo()); |
|
|
|
warehouseOutOrderDetail.setMaterialName(sysMakeorderPickDetail.getMaterialName()); |
|
|
|
warehouseOutOrderDetail.setMaterialDescribe(sysMakeorderPickDetail.getDescribe()); |
|
|
|
warehouseOutOrderDetail.setMaterialUnit(sysMakeorderPickDetail.getUnit()); |
|
|
|
warehouseOutOrderDetail.setMaterialBrand(sysMakeorderPickDetail.getBrand()); |
|
|
|
warehouseOutOrderDetail.setMaterialProcessMethod(sysMakeorderPickDetail.getProcessMethod()); |
|
|
|
warehouseOutOrderDetail.setMakeNum(tempSysMakeorderPickVo.getMaterialSum()); |
|
|
|
//根据出库单号和关联单号以及物料号查找出库单详情数据
|
|
|
|
WarehouseOutOrderDetail tempWarehouseOutOrderDetail = outOrderDetailMapper.selectOutOrderDetailListByThreeCode(warehouseOutOrderDetail); |
|
|
|
if (tempWarehouseOutOrderDetail != null){ |
|
|
|
warehouseOutOrderDetail.setOutOrderDetailId(tempWarehouseOutOrderDetail.getOutOrderDetailId()); |
|
|
|
Integer applyOutOrderSum = (int) (sysMakeorderPickDetail.getPickNum()+tempWarehouseOutOrderDetail.getApplyOutOrderSum()); |
|
|
|
Integer makeNum = (int) (sysMakeorderPickDetail.getPickNum() + tempWarehouseOutOrderDetail.getMakeNum()); |
|
|
|
warehouseOutOrderDetail.setApplyOutOrderSum(applyOutOrderSum); |
|
|
|
warehouseOutOrderDetail.setMakeNum(makeNum); |
|
|
|
int updateWarehouseOutOrderDetailResult = outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); |
|
|
|
if (updateWarehouseOutOrderDetailResult <= 0){ |
|
|
|
throw new BusinessException("更新出库单详情失败"); |
|
|
|
} |
|
|
|
}else { |
|
|
|
warehouseOutOrderDetail.setWarehouseOutStatus("4"); |
|
|
|
warehouseOutOrderDetail.setMakeNo(tempSysMakeorderPickVo.getMakeNo()); |
|
|
|
//标明来源是生产订单
|
|
|
|
warehouseOutOrderDetail.setWarehouseOrderType("1"); |
|
|
|
warehouseOutOrderDetail.setWarehouseOutType("1"); |
|
|
|
warehouseOutOrderDetail.setMaterialSum(tempSysMakeorderPickVo.getMaterialSum()); |
|
|
|
warehouseOutOrderDetail.setEnterpriseSum(tempSysMakeorderPickVo.getEnterpriseSum()); |
|
|
|
|
|
|
|
warehouseOutOrderDetail.setCreateBy(ShiroUtils.getLoginName()); |
|
|
|
warehouseOutOrderDetail.setCreateTime(new Date()); |
|
|
|
warehouseOutOrderDetail.setApplyName(sysMakeorderPickVo.getApplyUser()); |
|
|
|
warehouseOutOrderDetail.setMaterialName(sysMakeorderPickDetail.getMaterialName()); |
|
|
|
warehouseOutOrderDetail.setMaterialDescribe(sysMakeorderPickDetail.getDescribe()); |
|
|
|
warehouseOutOrderDetail.setMaterialUnit(sysMakeorderPickDetail.getUnit()); |
|
|
|
warehouseOutOrderDetail.setMaterialBrand(sysMakeorderPickDetail.getBrand()); |
|
|
|
warehouseOutOrderDetail.setMaterialProcessMethod(sysMakeorderPickDetail.getProcessMethod()); |
|
|
|
//订单数量为本次领料数量
|
|
|
|
warehouseOutOrderDetail.setMakeNum(Math.toIntExact(sysMakeorderPickDetail.getPickNum())); |
|
|
|
//添加申请出库数量
|
|
|
|
warehouseOutOrderDetail.setApplyOutOrderSum(Math.toIntExact(sysMakeorderPickDetail.getPickNum())); |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(sysMakeorderPickDetail.getDescribe())) { |
|
|
|
String[] splitDescribe = sysMakeorderPickDetail.getDescribe().split(","); |
|
|
|
if (splitDescribe.length >= 2) { |
|
|
|
warehouseOutOrderDetail.setMaterialModel(splitDescribe[0]); |
|
|
|
warehouseOutOrderDetail.setMaterialSpecification(splitDescribe[1]); |
|
|
|
warehouseOutOrderDetail.setApplyOutOrderSum(Math.toIntExact(sysMakeorderPickDetail.getPickNum())); |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(sysMakeorderPickDetail.getDescribe())) { |
|
|
|
String[] splitDescribe = sysMakeorderPickDetail.getDescribe().split(","); |
|
|
|
if (splitDescribe.length >= 2) { |
|
|
|
warehouseOutOrderDetail.setMaterialModel(splitDescribe[0]); |
|
|
|
warehouseOutOrderDetail.setMaterialSpecification(splitDescribe[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail); |
|
|
|
if (insertOutOrderDetailResult <= 0){ |
|
|
|
throw new BusinessException("新增出库单详情数据失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail); |
|
|
|
if (insertOutOrderDetailResult <= 0){ |
|
|
|
throw new BusinessException("新增出库单详情数据失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|