| | |
| | | if (bomDetailList == null || bomDetailList.size() == 0) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,该生产物料的bom配置有误,请联系管理员!"); |
| | | } |
| | | for (BomDetailExtListVO i :bomDetailList) { |
| | | //查询是否投料 |
| | | if(workorderRecordExtMapper.selectCount(new QueryWrapper<WorkorderRecord>() |
| | | .eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",i.getMaterialId()).eq("TYPE",Constants.ZERO))<=0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未投料BOM物料,无法进行报工"); |
| | | } |
| | | } |
| | | // for (BomDetailExtListVO i :bomDetailList) { |
| | | // //查询是否投料 |
| | | // if(workorderRecordExtMapper.selectCount(new QueryWrapper<WorkorderRecord>() |
| | | // .eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",i.getMaterialId()).eq("TYPE",Constants.ZERO))<=0){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未投料BOM物料,无法进行报工"); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | WOutbound outbound = new WOutbound(); |
| | |
| | | } |
| | | //如果是产出 |
| | | mp.setHasProduceNum(Constants.formatBigdecimal(tModel.getNum()).intValue()+Constants.formatIntegerNum(mp.getHasProduceNum())); |
| | | if(tModel.getDoneType() == null){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工装器具【"+tModel.getAmodel().getCode()+"】产出质量属性为空,无法报工!"); |
| | | } |
| | | if(!Constants.equalsInteger(tModel.getDoneType(),Constants.ZERO)){ |
| | | //如果不良,累计工单的不良产出 |
| | | mp.setUnqualifiedNum(Constants.formatIntegerNum(mp.getUnqualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue())); |
| | | }else{ |
| | | //如果是合格,累计工单的合格数量 |
| | | mp.setQualifiedNum(Constants.formatIntegerNum(mp.getQualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue())); |
| | | } |
| | | // if(tModel.getDoneType() == null){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工装器具【"+tModel.getAmodel().getCode()+"】产出质量属性为空,无法报工!"); |
| | | // } |
| | | // if(!Constants.equalsInteger(tModel.getDoneType(),Constants.ZERO)){ |
| | | // //如果不良,累计工单的不良产出 |
| | | // mp.setUnqualifiedNum(Constants.formatIntegerNum(mp.getUnqualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue())); |
| | | // }else{ |
| | | // //如果是合格,累计工单的合格数量 |
| | | // mp.setQualifiedNum(Constants.formatIntegerNum(mp.getQualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue())); |
| | | // } |
| | | |
| | | //物料+批次+工序+质量属性去重 |
| | | WOutboundDetail detail =getWoutbondDetailByList(tModel,detailList); |