| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.ReportingWork; |
| | | import com.example.erp.entity.pp.ReportingWorkDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.mapper.pp.BasicDateProduceMapper; |
| | | import com.example.erp.mapper.pp.DamageDetailsMapper; |
| | | import com.example.erp.mapper.pp.ReportingWorkDetailMapper; |
| | |
| | | } |
| | | else { |
| | | //不是第一道工序,查询报工数据 |
| | | map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,previousProcess)); |
| | | map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,process)); |
| | | } |
| | | |
| | | // 第一道工序(流程卡数+补片数量-完工数-次破数-返工未完成数-禁用数量) |
| | |
| | | } |
| | | |
| | | //报工新增 |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean SaveReportingWorkSv(Map<String, Object> reportingWorkMap) { |
| | | //接收解析主附表信息 |
| | | JSONObject reportingWorkJson = new JSONObject(reportingWorkMap); |
| | |
| | | damageDetailsMapper.insert(damageDetail); |
| | | }); |
| | | } |
| | | //System.out.println(reportingWorkDetail); |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(reportingWork.getProcessId()); |
| | | |
| | | int index = technologicalProcess.indexOf("-"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = technologicalProcess.substring(0, index); |
| | | |
| | | //判断当前工序是否为第一道工序工序,使用流程卡表数量或者小片流程表上工序数量 |
| | | int processNum = 0; |
| | | if (interceptProcess.equals(reportingWork.getThisProcess())) { |
| | | processNum = reportingWorkMapper.selectFlowCardNum( |
| | | reportingWorkDetail.getOrderNumber(), |
| | | reportingWorkDetail.getTechnologyNumber(), |
| | | reportingWork.getProcessId(), |
| | | reportingWork.getThisProcess() |
| | | ); |
| | | }else{ |
| | | processNum = reportingWorkMapper.selectGlassProcessNum( |
| | | reportingWorkDetail.getOrderNumber(), |
| | | reportingWorkDetail.getTechnologyNumber(), |
| | | reportingWork.getProcessId(), |
| | | reportingWork.getThisProcess() |
| | | ); |
| | | } |
| | | |
| | | |
| | | //判断是否大于当前数量并且抛出异常 |
| | | if(processNum<(reportingWorkDetail.getBreakageQuantity()+reportingWorkDetail.getCompletedQuantity())){ |
| | | // System.out.println(processNum); |
| | | // System.out.println(reportingWorkDetail.getBreakageQuantity()); |
| | | // System.out.println(reportingWorkDetail.getCompletedQuantity()); |
| | | throw new ServiceException(Constants.Code_600,"当前工序数量大于流程卡表数量"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | OrderProcessDetail orderProcessDetail = new OrderProcessDetail(); |
| | | orderProcessDetail.setBrokenNum(reportingWorkDetail.getBreakageQuantity()); |
| | | orderProcessDetail.setReportingWorkNum(reportingWorkDetail.getCompletedQuantity()); |
| | | orderProcessDetail.setReportingWorkNumCount(reportingWorkDetail.getCompletedQuantity()); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //根据订单id,订单序号,以及小片序号 更新小片流程的完工数量以及刺破数量 |
| | | LambdaUpdateWrapper<OrderProcessDetail> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(OrderProcessDetail::getOrderNumber, reportingWorkDetail.getOrderNumber()) |
| | | .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId().substring(0,13)) |
| | | .eq(OrderProcessDetail::getOrderId, reportingWork.getOrderId()) |
| | | .eq(OrderProcessDetail::getProcess, reportingWork.getThisProcess()) |
| | | .eq(OrderProcessDetail::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber()) |
| | | .setSql("reporting_work_num_count =reporting_work_num_count +"+orderProcessDetail.getReportingWorkNumCount()) |
| | | .setSql("reporting_work_num_count =reporting_work_num_count +"+orderProcessDetail.getReportingWorkNum()) |
| | | .setSql("reporting_work_num =reporting_work_num +"+orderProcessDetail.getReportingWorkNum()) |
| | | .setSql("broken_num =broken_num +"+orderProcessDetail.getBrokenNum()); |
| | | |