| | |
| | | import doumeemes.core.utils.excel.EasyExcelUtil; |
| | | import doumeemes.core.utils.redis.RedisUtil; |
| | | import doumeemes.dao.business.PlansMapper; |
| | | import doumeemes.dao.business.WorkorderMapper; |
| | | import doumeemes.dao.business.dto.*; |
| | | import doumeemes.dao.business.model.*; |
| | | import doumeemes.dao.ext.*; |
| | |
| | | private WorkorderHistoryExtMapper workorderHistoryExtMapper; |
| | | @Autowired |
| | | private WorkorderRecordExtMapper workorderRecordExtMapper; |
| | | |
| | | @Autowired |
| | | private WorkorderMapper workorderMapper; |
| | | @Autowired |
| | | private RouteProcedureExtMapper routeProcedureExtMapper; |
| | | @Autowired |
| | |
| | | // //统计已完工数量 |
| | | // param.setStatus(Constants.WORKORDER_STATUS.done); |
| | | // plan.setDoneNum(workorderExtMapper.sumOrderNum(param)); |
| | | QueryBomExtDTO bb = new QueryBomExtDTO(); |
| | | bb.setDepartId(plan.getDepartId()); |
| | | bb.setDeleted(Constants.ZERO); |
| | | bb.setRootDepartId(user.getRootDepartment().getId()); |
| | | bb.setMaterialId(plan.getMaterialId()); |
| | | bb.setProcedureId(plan.getProcedureId()); |
| | | BomExtListVO versionBom = bomExtMapper.selectByModel( bb); |
| | | if(versionBom == null || StringUtils.isBlank(versionBom.getVersion()) || versionBom.getBomVersionId() == null){ |
| | | plan.setHasBom(Constants.ZERO); |
| | | }else { |
| | | plan.setBomType(Constants.formatIntegerNum(versionBom.getType())); |
| | | plan.setHasBom(Constants.ONE); |
| | | } |
| | | return plan; |
| | | } |
| | | |
| | |
| | | if(Constants.equalsInteger(mp.getPaused(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,计划已暂停!"); |
| | | } |
| | | if(Constants.formatIntegerNum(mp.getDistributNum())+thisPlanNum > Constants.formatIntegerNum(mp.getNum())){ |
| | | if(Constants.formatIntegerNum(mp.getWorkorderDistributNum())+thisPlanNum > Constants.formatIntegerNum(mp.getNum())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,累计分配数量大于计划数量!"); |
| | | } |
| | | if(!Constants.equalsInteger(mp.getStatus(),Constants.PLAN_STATUS.publish)&&!Constants.equalsInteger(mp.getStatus(),Constants.PLAN_STATUS.distribute)){ |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误:产出数据"); |
| | | } |
| | | //查询工序计划已分配数量 |
| | | List<Workorder> workorderList = workorderExtMapper.selectList(new QueryWrapper<Workorder>().eq("PLAN_ID",plans.getId()).notIn("STATUS",7,8)); |
| | | List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().eq("PLAN_ID",plans.getId()) |
| | | .notIn("STATUS",7,8)); |
| | | //本次产出数量 |
| | | BigDecimal num = autoWorkReportDTO.getCreateWorkorderRecordDTO().getQualifiedNum().add(autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum()); |
| | | if(num.compareTo(BigDecimal.ZERO)<=Constants.ZERO){ |
| | |
| | | workorderRecordStandardService.createMaterialStandard(createMaterialDTO); |
| | | } |
| | | //工单产出记录 |
| | | autoWorkReportDTO.getCreateWorkorderRecordDTO().setWorkorderId(workorder.getId()); |
| | | workorderRecordStandardService.createWorkorderRecord(autoWorkReportDTO.getCreateWorkorderRecordDTO(),user); |
| | | //工单报工 |
| | | workorderRecordStandardService.comfirmDone(workorder); |