| | |
| | | }); |
| | | } |
| | | map.put("Detail",details ); |
| | | // }else { |
| | | // //不是第一道工序,查询报工数据 |
| | | // List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMpReview(processIdStr, technologyStr, process,previousProcess,laminating); |
| | | // if(process.equals("中空")){ |
| | | // String orderId = reportingWorkMapper.selectOrderid(processIdStr); |
| | | // details.forEach( detail -> { |
| | | // Integer glassId = orderGlassDetailMapper. |
| | | // getMinIdByGroup(orderId, |
| | | // String.valueOf(detail.get("order_number")), |
| | | // String.valueOf(detail.get("group"))); |
| | | // int listGlassId = Integer.parseInt(String.valueOf(detail.get("glassId"))); |
| | | // if(listGlassId !=glassId){ |
| | | // detail.put("rowClass","latter"); |
| | | // } |
| | | // }); |
| | | // } |
| | | // map.put("Detail",details ); |
| | | // } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | JSONObject.toJSONString(stringRedisTemplate.opsForHash().entries(detailKey)) |
| | | , ReportingWorkDetail.class |
| | | ); |
| | | |
| | | //判断流程卡是否报满 |
| | | FlowCard flowCard = flowCardMapper.selectOne(new LambdaQueryWrapper<FlowCard>() |
| | | .eq(FlowCard::getProcessId, reportingWork.getProcessId()) |
| | | .eq(FlowCard::getOrderNumber, reportingWorkDetail.getOrderNumber()) |
| | | .eq(FlowCard::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber()) |
| | | ); |
| | | //生产数量= 流程卡数量-终止数量 |
| | | int flowCardReportingWorkNum = flowCard.getQuantity()-flowCard.getTerminationQuantity(); |
| | | OrderProcessDetail orderProcessDetail = orderProcessDetailMapper |
| | | .selectOne(new LambdaQueryWrapper<OrderProcessDetail>() |
| | | .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId()) |
| | | .eq(OrderProcessDetail::getOrderNumber, reportingWorkDetail.getOrderNumber()) |
| | | .eq(OrderProcessDetail::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber()) |
| | | .eq(OrderProcessDetail::getProcess, reportingWork.getThisProcess()) |
| | | ); |
| | | //报工数量 |
| | | int completedQuantity = reportingWorkDetail.getCompletedQuantity(); |
| | | //已报数量 |
| | | int finishReportingWorkNum = orderProcessDetail.getReportingWorkNum(); |
| | | |
| | | //若报工数量+已报数量>流程卡数量 则报工数量为流程卡数量-已报数量 |
| | | if((completedQuantity+finishReportingWorkNum)>flowCardReportingWorkNum){ |
| | | completedQuantity = flowCardReportingWorkNum - finishReportingWorkNum; |
| | | reportingWorkDetail.setCompletedQuantity(completedQuantity); |
| | | //若报工数量小于0 则报工数量为0 |
| | | if(completedQuantity<0){ |
| | | reportingWorkDetail.setCompletedQuantity(0); |
| | | } |
| | | } |
| | | |
| | | |
| | | reportingWorkDetail.setReportingWorkId(reportingWorkId); |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | |
| | |
| | | |
| | | orderProcessDetailMapper.update(null, updateWrapper); |
| | | }); |
| | | |
| | | //获取完工明细数量总和 |
| | | int num = reportingWorkDetailMapper.selectFinishQuantity(reportingWorkId); |
| | | reportingWorkMapper.update(null, |
| | | new LambdaUpdateWrapper<ReportingWork>() |
| | | .eq(ReportingWork::getReportingWorkId, reportingWorkId) |
| | | .setSql("this_completed_quantity = " + num) |
| | | ); |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result addWorkInProgress(Map<String, Object> object) { |
| | | List<Map<String,Object>> list = (List<Map<String,Object>>) object.get("reportingWorks"); |
| | | |
| | | list.forEach(item -> { |
| | | ReportingWork reportingWork = JSONObject.parseObject( |
| | | JSONObject.toJSONString(item.get("processTitle")), ReportingWork.class); |
| | | Map<String, String> mapTitle = new HashMap<>(); |
| | | String[] processIdStr = reportingWork.getProcessId() != null |
| | | ? reportingWork.getProcessId().split("/") |
| | | : new String[]{""}; |
| | | mapTitle.put("process", reportingWork.getPreviousProcess()); |
| | | mapTitle.put("processId", reportingWork.getProcessId()); |
| | | mapTitle.put("thisProcess", reportingWork.getThisProcess()); |
| | | mapTitle.put("technologyStr", processIdStr[1]); |
| | | mapTitle.put("userName", object.get("userName").toString()); |
| | | ReviewReportingWorkSv(mapTitle); |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("detail", item.get("processList")); |
| | | map.put("title", item.get("processTitle")); |
| | | map.put("type", object.get("type")); |
| | | map.put("userId", object.get("userId")); |
| | | map.put("userName", object.get("userName")); |
| | | map.put("qualityInsStatus", object.get("qualityInsStatus")); |
| | | map.put("class", object.get("class")); |
| | | SaveReportingWorkSv(map); |
| | | }); |
| | | |
| | | return Result.success(true); |
| | | } |
| | | } |