|
|
@ -16,6 +16,7 @@ import com.ruoyi.erp.mapper.ErpDevelopModifyorderDetailMapper; |
|
|
|
import com.ruoyi.erp.mapper.ErpDevelopModifyorderPickingDetailMapper; |
|
|
|
import com.ruoyi.erp.mapper.ErpDevelopModifyorderPickingMapper; |
|
|
|
import com.ruoyi.system.domain.*; |
|
|
|
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO; |
|
|
|
import com.ruoyi.system.mapper.*; |
|
|
|
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; |
|
|
|
import com.ruoyi.warehouse.domain.WarehouseStorageOrder; |
|
|
@ -833,9 +834,76 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService |
|
|
|
return new ArrayList<>(aggregatedMap.values()); |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
* 员工领料单审核通过后生成出库单 |
|
|
|
* */ |
|
|
|
@Override |
|
|
|
public int generateWarehouseOutOrderByBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) { |
|
|
|
WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder(); |
|
|
|
String outOrderCode = redisCache.generateBillNo("CK"); |
|
|
|
warehouseOutOrder.setOutOrderCode(outOrderCode); |
|
|
|
String empRequisiteCode = baseEmpRequisiteOrderVO.getRequisitieCode(); |
|
|
|
if (StringUtils.isEmpty(empRequisiteCode)){ |
|
|
|
log.warn("员工领料单编号为空:{}",empRequisiteCode); |
|
|
|
}else { |
|
|
|
warehouseOutOrder.setRelatedOrderCode(empRequisiteCode); |
|
|
|
} |
|
|
|
String relatedCode = baseEmpRequisiteOrderVO.getCorrelationCode(); |
|
|
|
if (StringUtils.isEmpty(relatedCode)){ |
|
|
|
log.warn("关联订单号为空:{}",relatedCode); |
|
|
|
} |
|
|
|
|
|
|
|
//出库状态为 待仓库准备物料
|
|
|
|
warehouseOutOrder.setWarehouseOutStatus("0"); |
|
|
|
//订单类型设置为 请购订单
|
|
|
|
warehouseOutOrder.setWarehouseOrderType("2"); |
|
|
|
//出库类型设置为 员工领料
|
|
|
|
warehouseOutOrder.setWarehouseOutType("2"); |
|
|
|
|
|
|
|
//物料合计
|
|
|
|
warehouseOutOrder.setMaterialSum(Math.toIntExact(baseEmpRequisiteOrderVO.getMaterialAmount())); |
|
|
|
//数量合计
|
|
|
|
warehouseOutOrder.setEnterpriseSum(Math.toIntExact(baseEmpRequisiteOrderVO.getMaterialSum())); |
|
|
|
|
|
|
|
|
|
|
|
warehouseOutOrder.setBusinessName(baseEmpRequisiteOrderVO.getApplyUser()); |
|
|
|
warehouseOutOrder.setApplyName(baseEmpRequisiteOrderVO.getApplyUser()); |
|
|
|
warehouseOutOrder.setCreateTime(DateUtils.getNowDate()); |
|
|
|
warehouseOutOrder.setCreateBy(baseEmpRequisiteOrderVO.getApplyUser()); |
|
|
|
//新增出库单明细
|
|
|
|
CreateOutOrderDetailByRequisiteOrderChildList(baseEmpRequisiteOrderVO,outOrderCode); |
|
|
|
return warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder); |
|
|
|
} |
|
|
|
|
|
|
|
//新增出库单明细
|
|
|
|
private void CreateOutOrderDetailByRequisiteOrderChildList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO, String outOrderCode) { |
|
|
|
List<BaseEmpRequisiteOrderChild> childList = baseEmpRequisiteOrderVO.getBaseEmpRequisiteOrderChildList(); |
|
|
|
String requisiteCode = baseEmpRequisiteOrderVO.getRequisitieCode(); |
|
|
|
if(childList!=null){ |
|
|
|
for (BaseEmpRequisiteOrderChild child : childList) { |
|
|
|
WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail(); |
|
|
|
warehouseOutOrderDetail.setOutOrderCode(outOrderCode); |
|
|
|
warehouseOutOrderDetail.setRelatedOrderCode(requisiteCode); |
|
|
|
warehouseOutOrderDetail.setMaterialNo(child.getMaterialCode()); |
|
|
|
warehouseOutOrderDetail.setMaterialName(child.getMaterialName()); |
|
|
|
warehouseOutOrderDetail.setMaterialType(child.getMaterialType()); |
|
|
|
warehouseOutOrderDetail.setMaterialBrand(child.getBrand()); |
|
|
|
warehouseOutOrderDetail.setMaterialPhotourl(child.getPhotoUrl()); |
|
|
|
// warehouseOutOrderDetail.setMaterialUnit(child.getUnit());
|
|
|
|
warehouseOutOrderDetail.setMaterialDescribe(child.getDescribe()); |
|
|
|
// warehouseOutOrderDetail.setMaterialProcessMethod(child.getProcessMethod());
|
|
|
|
warehouseOutOrderDetail.setEnterpriseSum(Math.toIntExact(child.getMaterialNum())); |
|
|
|
warehouseOutOrderDetail.setMakeNum(Math.toIntExact(child.getMaterialNum())); |
|
|
|
warehouseOutOrderDetail.setCreateTime(DateUtils.getNowDate()); |
|
|
|
warehouseOutOrderDetail.setCreateBy(child.getCreateBy()); |
|
|
|
int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail); |
|
|
|
if (insertOutOrderDetailResult <= 0){ |
|
|
|
throw new BusinessException("新增出库单明细数据失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 仓库出库单通用修改保持方法 |
|
|
|
* */ |
|
|
|