| | |
| | | import com.example.erp.service.userInfo.LogService; |
| | | import com.example.erp.service.userInfo.SysErrorService; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | |
| | | //是第一道工序,查询流程卡数据 |
| | | map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr, technologyStr, process,reportType)); |
| | | } else { |
| | | //不是第一道工序,查询报工数据 |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process,previousProcess); |
| | | if(process.equals("中空")){ |
| | | String orderId = processIdStr.substring(0,10); |
| | | 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"); |
| | | ReportingWork retrievedData = (ReportingWork) map.get("data"); |
| | | if (retrievedData!=null){ |
| | | Integer reviewedState = retrievedData.getReviewedState(); |
| | | //根据审核状态查询未审核数据 |
| | | if (reviewedState==1){//已审核 |
| | | //不是第一道工序,查询报工数据 |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process,previousProcess); |
| | | if(process.equals("中空")){ |
| | | String orderId = processIdStr.substring(0,10); |
| | | 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 ); |
| | | }else { |
| | | //不是第一道工序,查询报工数据 |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMpReview(processIdStr, technologyStr, process,previousProcess); |
| | | if(process.equals("中空")){ |
| | | String orderId = processIdStr.substring(0,10); |
| | | 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 ); |
| | | } |
| | | } |
| | | |
| | | |
| | | map.put("Detail",details ); |
| | | } |
| | | |
| | | // 第一道工序(流程卡数+补片数量-完工数-次破数-返工未完成数-禁用数量) |
| | |
| | | } |
| | | |
| | | //查询工序 |
| | | public Map<String, Object> SelectProcessSv() { |
| | | public Map<String, Object> SelectProcessSv(String userId) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("process", reportingWorkMapper.SelectProcessMp()); |
| | | String process = reportingWorkMapper.selectUserProcess(userId); |
| | | if (process==null) { |
| | | map.put("process", reportingWorkMapper.SelectProcessMp()); |
| | | } |
| | | else { |
| | | if (process.equals("夹胶")){ |
| | | map.put("process",reportingWorkMapper.getSelectProcessJiajiao() ); |
| | | } |
| | | if (process.equals("技术部多曲")){ |
| | | map.put("process",reportingWorkMapper.getSelectProcessDuoqu() ); |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | String formattedDate = dateFormat.format(currentDate); |
| | | String reportingWorkId = "BG" + formattedDate + formattedNumber; |
| | | reportingWork.setReportingWorkId(reportingWorkId); |
| | | reportingWork.setProcessId(reportingWork.getProcessId().substring(0, 14)); |
| | | String[] processIdStr = reportingWork.getProcessId().split("/"); |
| | | reportingWork.setProcessId(processIdStr[0]); |
| | | |
| | | int reviewState = (int) reportingWorkJson.get("type"); |
| | | if (reviewState == 1) { |
| | |
| | | } else { |
| | | reportingWork.setReviewedState(0); |
| | | } |
| | | |
| | | reportingWork.setNextProcess(orderProcessDetailMapper.selectNextProcess(processIdStr[0],processIdStr[1],reportingWork.getThisProcess())); |
| | | //主表插入 |
| | | reportingWorkMapper.insert(reportingWork); |
| | | //副表循环插入,并且插入次破信息表。再根据次破信息修改订单玻璃流程表的完工数量与刺破数量 |
| | |
| | | |
| | | //判断是否大于当前数量并且抛出异常 |
| | | if (processNum < (reportingWorkDetail.getBreakageQuantity() + reportingWorkDetail.getCompletedQuantity())) { |
| | | System.out.println(processNum+"--"+reportingWorkDetail.getBreakageQuantity()+"--"+reportingWorkDetail.getCompletedQuantity()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderNumber", reportingWorkDetail.getOrderNumber()); |
| | | map.put("technologyNumber", reportingWorkDetail.getOrderNumber()); |
| | |
| | | } |
| | | |
| | | //更新流程卡表的报工数量 |
| | | if (Objects.equals(reportingWork.getNextProcess(), "")) { |
| | | if (Objects.equals(reportingWork.getNextProcess(), "")|| Objects.equals(reportingWork.getNextProcess(), null)) { |
| | | LambdaUpdateWrapper<FlowCard> flowCardLambdaUpdateWrapper = |
| | | new LambdaUpdateWrapper<>(); |
| | | flowCardLambdaUpdateWrapper |
| | |
| | | |
| | | String processId = reportingWork.get("processId"); |
| | | String thisProcess = reportingWork.get("thisProcess"); |
| | | String userName=reportingWork.get("userName"); |
| | | int index = processId.lastIndexOf("/") + 1; |
| | | String result = processId.substring(index); |
| | | String technologyStr = reportingWork.get("technologyStr"); |
| | |
| | | .eq(ReportingWork::getProcessId, processId.substring(0, 14)) |
| | | .eq(ReportingWork::getThisProcess, reportingWork.get("process")) |
| | | .eq(ReportingWork::getReviewedState, 0) |
| | | .setSql("reviewed_state =1"); |
| | | .setSql("reviewed_state =1") |
| | | .set(ReportingWork::getReviewed, userName); |
| | | reportingWorkMapper.update(null, updateWrapper); |
| | | }else { |
| | | reportingWorkMapper.ReviewReportingWorkMp(processId.substring(0, 14),reportingWork.get("process"),technologyStr); |
| | | reportingWorkMapper.ReviewReportingWorkMp(processId.substring(0, 14),reportingWork.get("process"),technologyStr,userName); |
| | | |
| | | } |
| | | return true; |
| | |
| | | //根据报工编号获取层 |
| | | map.put("layer", reportingWorkMapper.selectLayerByReportingWorkId(reportingWorkId)); |
| | | map.put("numberList", flowCardMapper.getGlassNumber(reportingWorkMapper.selectLayerByReportingWorkId(reportingWorkId),reportingWork.getProcessId())); |
| | | |
| | | map.put("title", "补片状态"); |
| | | return map; |
| | | |
| | | } |