| | |
| | | if(Objects.equals(type, "补片")){ |
| | | alias="BP"; |
| | | } |
| | | //查询当天的最大数量 |
| | | Integer maximum=patchMapper.getMaximum(); |
| | | //查询当天最新的编号 |
| | | String str=patchMapper.getMaximum(); |
| | | if (str == null){ |
| | | str="00"; |
| | | } |
| | | String maximum = str.substring(str.length() - 2); |
| | | int lastTwoInteger = Integer.parseInt(maximum); |
| | | //设置两位不够补0 |
| | | String formattedNumber = String.format("%02d", maximum+1); |
| | | String formattedNumber = String.format("%02d", lastTwoInteger+1); |
| | | //格式化当前日期 |
| | | Date currentDate = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd"); |
| | |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | if (lableType != 2){ |
| | | if (lableType != 2){//成品标签 |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getRepairPrintCustomData(flowCard.getProcessId(),flowCard.getTechnologyNumber(),flowCard.getReportingWorkId())); |
| | | itemmap.put("data", flowCardMapper.getRepairPrintCustomData(flowCard.getProcessId(),flowCard.getTechnologyNumber(),flowCard.getReportingWorkId(),flowCard.getOrderNumber())); |
| | | list.add(itemmap); |
| | | } |
| | | else{ |
| | | else{//小片标签 |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getRepairPrintCustomDataSemi(flowCard.getProcessId(),flowCard.getTechnologyNumber(),flowCard.getReportingWorkId())); |
| | | itemmap.put("data", flowCardMapper.getRepairPrintCustomDataSemi(flowCard.getProcessId(),flowCard.getTechnologyNumber(),flowCard.getReportingWorkId(),flowCard.getOrderNumber())); |
| | | list.add(itemmap); |
| | | } |
| | | |
| | |
| | | List<PatchLog> patchLoglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("patchLog")), PatchLog.class); |
| | | if (!patchLoglist.isEmpty()){ |
| | | for (PatchLog patchLog : patchLoglist) { |
| | | //查询是否已生成工程号 |
| | | Integer projectCount = patchMapper.selectProjectCount(patchLog.getProcessId(),patchLog.getPatchId(),patchLog.getTechnologyNumber()); |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(patchLog.getProcessId(), String.valueOf(patchLog.getTechnologyNumber())); |
| | | if (technologicalProcess!=null || !technologicalProcess.equals("")) { |
| | | String[] processList = technologicalProcess.split("->"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = processList[0]; |
| | | Integer firstStep=reportingWorkMapper.getFirstStep(patchLog.getProcessId(),patchLog.getOrderSort(),patchLog.getTechnologyNumber(),interceptProcess); |
| | | if (firstStep>=patchLog.getPatchNum()){ |
| | | ReportingWork reportingWork = reportingWorkMapper |
| | | .selectOne(new QueryWrapper<ReportingWork>().eq("reporting_work_id",patchLog.getReportingWorkId())); |
| | | //修改小片流程卡数量 |
| | | patchMapper.updateOrderProcessDetailCancel(patchLog,reportingWork); |
| | | //审核 |
| | | patchMapper.updateReplenishCancel(patchLog); |
| | | } |
| | | else { |
| | | saveState = false; |
| | | } |
| | | }else{ |
| | | if (projectCount == 0){ |
| | | if (technologicalProcess!=null || !technologicalProcess.equals("")) { |
| | | String[] processList = technologicalProcess.split("->"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = processList[0]; |
| | | Integer firstStep=reportingWorkMapper.getFirstStep(patchLog.getProcessId(),patchLog.getOrderSort(),patchLog.getTechnologyNumber(),interceptProcess); |
| | | if (firstStep>=patchLog.getPatchNum()){ |
| | | ReportingWork reportingWork = reportingWorkMapper |
| | | .selectOne(new QueryWrapper<ReportingWork>().eq("reporting_work_id",patchLog.getReportingWorkId())); |
| | | //修改小片流程卡数量 |
| | | patchMapper.updateOrderProcessDetailCancel(patchLog,reportingWork); |
| | | //审核 |
| | | patchMapper.updateReplenishCancel(patchLog); |
| | | } |
| | | else { |
| | | saveState = false; |
| | | } |
| | | }else{ |
| | | saveState = false; |
| | | } |
| | | |
| | | Log log = new Log(); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("updateCancelReviewSv补片反审"); |
| | | log.setOperatorId((String) object.get("userId")); |
| | | log.setOperator((String) object.get("userName")); |
| | | logService.saveLog(log); |
| | | } else { |
| | | saveState = false; |
| | | } |
| | | |
| | | Log log = new Log(); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("updateCancelReviewSv补片反审"); |
| | | log.setOperatorId((String) object.get("userId")); |
| | | log.setOperator((String) object.get("userName")); |
| | | logService.saveLog(log); |
| | | } |
| | | } |
| | | |
| | | // } catch (Exception e) { |
| | | // TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | // //将异常传入数据库 |
| | | // SysError sysError = new SysError(); |
| | | // sysError.setError(e.toString()); |
| | | // sysError.setFunc("updateCancelReviewSv"); |
| | | // sysErrorService.insert(sysError); |
| | | // saveState = false; |
| | | // |
| | | // } |
| | | |
| | | return saveState; |
| | | } |