| | |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr); |
| | | |
| | | int index = technologicalProcess.indexOf("-"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = technologicalProcess.substring(0, index); |
| | | |
| | | |
| | | String[] processList = technologicalProcess.split("->"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = processList[0]; |
| | | int length = processList.length; |
| | | |
| | | //定义当前工序上下工序 |
| | |
| | | map.put("historyTeams", reportingWorkMapper.historyTeamsMp(processIdStr, process)); |
| | | //历史工序 |
| | | map.put("historyProcess", reportingWorkMapper.SelectHistoryProcessMp(historyProcess, process)); |
| | | |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | String formattedDate = dateFormat.format(currentDate); |
| | | String reportingWorkId = "BG" + formattedDate + formattedNumber; |
| | | reportingWork.setReportingWorkId(reportingWorkId); |
| | | reportingWork.setProcessId(reportingWork.getProcessId().substring(0, 13)); |
| | | reportingWork.setProcessId(reportingWork.getProcessId().substring(0, 14)); |
| | | |
| | | int reviewState = (int) reportingWorkJson.get("type"); |
| | | if (reviewState == 1) { |
| | |
| | | //根据订单id,订单序号,以及小片序号 更新小片流程的完工数量以及刺破数量 |
| | | LambdaUpdateWrapper<OrderProcessDetail> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(OrderProcessDetail::getOrderNumber, reportingWorkDetail.getOrderNumber()) |
| | | .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId().substring(0, 13)) |
| | | .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId().substring(0, 14)) |
| | | .eq(OrderProcessDetail::getOrderId, reportingWork.getOrderId()) |
| | | .eq(OrderProcessDetail::getProcess, reportingWork.getThisProcess()) |
| | | .eq(OrderProcessDetail::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber()) |
| | |
| | | LambdaUpdateWrapper |
| | | <ReportingWork> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper |
| | | .eq(ReportingWork::getProcessId, processId.substring(0, 13)) |
| | | .eq(ReportingWork::getProcessId, processId.substring(0, 14)) |
| | | .eq(ReportingWork::getThisProcess, reportingWork.get("process")) |
| | | .eq(ReportingWork::getReviewedState, 0) |
| | | .setSql("reviewed_state =1"); |
| | |
| | | JSONObject reportingWorkJson = new JSONObject(reportingWorkMap); |
| | | ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class); |
| | | List<ReportingWorkDetail> reportingWorkDetails = JSONArray.parseArray(JSONObject.toJSONString(reportingWorkJson.get("detail")), ReportingWorkDetail.class); |
| | | |
| | | //删除刺破明细表刺破数据 |
| | | damageDetailsMapper.delete( |
| | | new LambdaQueryWrapper<DamageDetails>() |
| | |
| | | //更细报工主表 |
| | | reportingWorkMapper.updateById(reportingWork); |
| | | reportingWorkDetails.forEach(reportingWorkDetail -> { |
| | | reportingWorkDetail.setReportingWorkId(reportingWork.getReportingWorkId()); |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | | //每一条报工数据循环插入次破明细表 |
| | | if (damageDetails != null && !damageDetails.isEmpty()) { |
| | |
| | | } |
| | | //插入报工数据 |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | orderProcessDetailMapper.insertByReportingWorkDetail(reportingWorkDetail,reportingWork.getProcessId(),reportingWork.getThisProcess()); |
| | | //修改包装时修改库存数量 |
| | | if (reportingWork.getNextProcess()==null || reportingWork.getNextProcess().isEmpty()){ |
| | | //获取该报工修改后的可入库数量 |
| | | Integer inventory = reportingWorkDetailMapper.selectInventory(reportingWork.getProcessId(),Integer.parseInt(reportingWorkDetail.getOrderNumber()),Integer.parseInt(reportingWorkDetail.getTechnologyNumber())); |
| | | //修改流程卡表库存数量 |
| | | flowCardMapper.updateInventory(reportingWork.getProcessId(),reportingWorkDetail.getOrderNumber(),reportingWorkDetail.getTechnologyNumber(),inventory); |
| | | } |
| | | }); |
| | | //获取质检时间 |
| | | if (Objects.equals(reviewState, "review")) { |
| | |
| | | } |
| | | |
| | | //修改小片流程表数量为报工明细表数量 |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add"); |
| | | //orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add"); |
| | | return true; |
| | | } |
| | | |
| | | //报工管理查询 |
| | | public Map<String, Object> selectReportingWorkSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, String orderId, ReportingWork reportingWork) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | if (orderId.equals("null")) { |
| | | if ("null".equals(orderId)) { |
| | | orderId = ""; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList = reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | |
| | | //更新流程卡可入库数量 |
| | | reportingWorkMapper.updateInventoryQuantity(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity")); |
| | | //更新报工流程表数据 |
| | |
| | | //查询质检审核 |
| | | public Map<String, Object> selectQualityTestingSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, Integer state, String processId, ReportingWork reportingWork) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | if (processId.equals("null")) { |
| | | if ("null".equals(processId)) { |
| | | processId = ""; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |