| | |
| | | recordList.add(getWorkrecordModel(user,wStock,mp,materialListDTO.getNum())); |
| | | } |
| | | } |
| | | |
| | | //批量插入投料记录 |
| | | workorderRecordExtMapper.insertBatch(recordList); |
| | | //单添加历史记录(不更新状态) |
| | | //单添加历史记录(判断更新为生产中) |
| | | updateOrderInfo(user,mp,Constants.WORKORDER_HISTORY_STATUS.material); |
| | | return param.getId(); |
| | | } |
| | |
| | | order.setStatus(Constants.WORKORDER_STATUS.material); |
| | | }else if(status ==Constants.WORKORDER_HISTORY_STATUS.done){ |
| | | order.setStatus(Constants.WORKORDER_STATUS.done); |
| | | }else if(status ==Constants.WORKORDER_HISTORY_STATUS.material){ |
| | | //投料操作 |
| | | if(Constants.equalsInteger(mp.getStatus(),Constants.WORKORDER_STATUS.create) |
| | | ||Constants.equalsInteger(mp.getStatus(),Constants.WORKORDER_STATUS.material)){ |
| | | //如果是已创建或者已备料状态的工单,修改其状态为【生产中】 |
| | | order.setStatus(Constants.WORKORDER_STATUS.producing); |
| | | } |
| | | } |
| | | workorderExtMapper.updateById(order); |
| | | workorderHistoryExtMapper.insertBatch(whList); |
| | |
| | | dealAppliancePro(mp,user,allRecordList,updateApplianceList,updateApplianceProList, outboundDetailList,stockList); |
| | | } |
| | | |
| | | if(1==1){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"123"); |
| | | } |
| | | |
| | | //如果有没bom配置,检查产出(包含检验的不良和报废品)和投料数量是否相等匹配,不一致提示错误 |
| | | if(bdparam==null){ |
| | |
| | | //如果需要投料的物料集合,在库存中寻找投料来源 |
| | | for(WStock model : materialList){ |
| | | for(WStock ts : allList){ |
| | | |
| | | if(Constants.equalsInteger(model.getMaterialId(),ts.getMaterialId())){ |
| | | //还需要投料数量 |
| | | BigDecimal actNum = Constants.formatBigdecimal(model.getNum()).subtract(Constants.formatBigdecimal(model.getTNum())); |
| | |
| | | //如果已经满足剩余需求量 |
| | | isfull =true; |
| | | } |
| | | |
| | | //添加投料记录 |
| | | workorderRecordExtMapper.insert(getWorkrecordModel(user,ts,mp,actNum)); |
| | | |
| | | //更新已经投料数量 |
| | | model.setTNum(Constants.formatBigdecimal(model.getTNum()).add(actNum)); |
| | | WOutbound outbound = getFromOutboundList(ts.getWarehouseId(),outboundList); |