From e194fde722dd887f1ba8ed3875130d85787c6a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Sun, 26 Sep 2021 09:03:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anomaly/controller/ReportController.java | 6 +-- .../service/impl/ReportServiceImpl.java | 25 ++++++++---- .../main/resources/mapper/ReportMapper.xml | 40 +++++++++---------- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java index 61fe2894..0a435849 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/ReportController.java @@ -72,11 +72,7 @@ public class ReportController { */ @PostMapping("/resourceRepair") public R resourceRepair(@RequestBody(required = false)Map map){ - try{ - return R.ok(reportService.resourceRepair(map)); - }catch (Exception e){ - return R.failed(e.getMessage()); - } + return R.ok(reportService.resourceRepair(map)); } /** diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java index 44599005..bea15972 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/ReportServiceImpl.java @@ -114,7 +114,6 @@ public class ReportServiceImpl implements ReportService { userMap = nwaUserList.stream().collect(Collectors.groupingBy(NwaUser::getUserName)); } - List> maps = reportMapper.resourceRepair(site, locale, map); @@ -128,7 +127,9 @@ public class ReportServiceImpl implements ReportService { String []ncCodeArray = ncCodes.split(","); String ncCodeDesc = ""; for (int j = 0; j < ncCodeArray.length; j++) { - ncCodeDesc += ncCodeMap.get(ncCodeArray[j]).get(0).getDescription()+";"; + if(ncCodeMap.get(ncCodeArray[j]) != null){ + ncCodeDesc += ncCodeMap.get(ncCodeArray[j]).get(0).getDescription()+";"; + } } maps.get(i).put("NC_CODE_DESCRIPTION", ncCodeDesc); } @@ -144,7 +145,9 @@ public class ReportServiceImpl implements ReportService { String []repairUserArray = repairUser.split(","); String repairUserDescription = ""; for (int j = 0; j < repairUserArray.length; j++) { - repairUserDescription += userMap.get(repairUserArray[j]).get(0).getFullName()+";"; + if(userMap.get(repairUserArray[j]) != null){ + repairUserDescription += userMap.get(repairUserArray[j]).get(0).getFullName()+";"; + } } maps.get(i).put("REPAIR_USERS_DESCRIPTION", repairUserDescription); } @@ -193,7 +196,9 @@ public class ReportServiceImpl implements ReportService { String[] dutyCauseTypeSplit = dutyCauseType.split(","); StringBuilder dutyCauseTypeDescription = new StringBuilder(); for (int j = 0; j < dutyCauseTypeSplit.length; j++) { - dutyCauseTypeDescription.append(dataFieldListMap.get(dutyCauseTypeSplit[j]).get(0).getDescription()).append(";"); + if(dataFieldListMap.get(dutyCauseTypeSplit[j]) != null){ + dutyCauseTypeDescription.append(dataFieldListMap.get(dutyCauseTypeSplit[j]).get(0).getDescription()).append(";"); + } } qualityInspectionReport.get(i).put("DUTY_CAUSE_TYPE_DESCRIPTION", dutyCauseTypeDescription); } @@ -215,7 +220,9 @@ public class ReportServiceImpl implements ReportService { String[] dutyTypeSplit = dutyType.split(","); StringBuilder dutyTypeDescription = new StringBuilder(); for (int j = 0; j < dutyTypeSplit.length; j++) { - dutyTypeDescription.append(dataFieldListMap.get(dutyTypeSplit[j]).get(0).getDescription()).append(";"); + if(dataFieldListMap.get(dutyTypeSplit[j]) != null){ + dutyTypeDescription.append(dataFieldListMap.get(dutyTypeSplit[j]).get(0).getDescription()).append(";"); + } } qualityInspectionReport.get(i).put("DUTY_TYPE_DESCRIPTION", dutyTypeDescription); } @@ -237,7 +244,9 @@ public class ReportServiceImpl implements ReportService { String[] dutyDepartSplit = dutyDepart.split(","); StringBuilder dutyDepartDescription = new StringBuilder(); for (int j = 0; j < dutyDepartSplit.length; j++) { - dutyDepartDescription.append(dataFieldListMap.get(dutyDepartSplit[j]).get(0).getDescription()).append(";"); + if(dataFieldListMap.get(dutyDepartSplit[j]) != null){ + dutyDepartDescription.append(dataFieldListMap.get(dutyDepartSplit[j]).get(0).getDescription()).append(";"); + } } qualityInspectionReport.get(i).put("DUTY_DEPART_DESCRIPTION", dutyDepartDescription); } @@ -274,7 +283,9 @@ public class ReportServiceImpl implements ReportService { String[] dutyDepartSplit = dutyDepart.split(","); StringBuilder dutyDepartDescription = new StringBuilder(); for (int j = 0; j < dutyDepartSplit.length; j++) { - dutyDepartDescription.append(dataFieldListMap.get(dutyDepartSplit[j]).get(0).getDescription()).append(";"); + if(dataFieldListMap.get(dutyDepartSplit[j]) != null){ + dutyDepartDescription.append(dataFieldListMap.get(dutyDepartSplit[j]).get(0).getDescription()).append(";"); + } } findAbnormalRecord.get(i).put("DUTY_DEPART_DESCRIPTION", dutyDepartDescription); } diff --git a/anomaly/src/main/resources/mapper/ReportMapper.xml b/anomaly/src/main/resources/mapper/ReportMapper.xml index 7c3c2fa5..f1874dcc 100644 --- a/anomaly/src/main/resources/mapper/ReportMapper.xml +++ b/anomaly/src/main/resources/mapper/ReportMapper.xml @@ -119,7 +119,7 @@ - SELECT ZSR.INVENTORY INVENTORY,ZSR.ITEM_BO ITEM_BO,IT.DESCRIPTION ITEM_DESCRIPTION,ZSR.LENGHT LENGHT, ZSR.WIDTH WIDTH,ZSR.NUMBERS NUMBERS,ZSR.QTY QTY,ZSR.CREATED_DATE_TIME CREATED_DATE_TIME,I.ITEM ITEM FROM @@ -137,7 +137,7 @@ - SELECT ZRRT.HANDLE HANDLE, CASE WHEN WC2.WORK_CENTER != 'NULL' THEN WC2.WORK_CENTER @@ -154,15 +154,15 @@ END ITEM_DESCRIPTION, CF.VALUE ITEM_SPEC, ZRRT.ACTUAL_START_DATE ACTUAL_START_DATE,ZRRT.ACTUAL_COMPLETE_DATE ACTUAL_COMPLETE_DATE, - CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TRUNC(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME)*24),2) - WHEN ZRRT.STOP_MACHINE = 'N' THEN TRUNC(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME)*24),2) + CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TO_CHAR(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME)*24),'FM9999990.00') + WHEN ZRRT.STOP_MACHINE = 'N' THEN TO_CHAR(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME)*24),'FM9999990.00') END SHUT_DOWN_TIME, - CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TRUNC(TO_NUMBER((ZRRT.WAIT_END_DATE -ZRRT.WAIT_START_DATE)*24),2) - WHEN ZRRT.STOP_MACHINE = 'N' THEN TRUNC(TO_NUMBER((SYSDATE-ZRRT.WAIT_START_DATE)*24),2) + CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TO_CHAR(TO_NUMBER((ZRRT.WAIT_END_DATE -ZRRT.WAIT_START_DATE)*24),'FM9999990.00') + WHEN ZRRT.STOP_MACHINE = 'N' THEN TO_CHAR(TO_NUMBER((SYSDATE-ZRRT.WAIT_START_DATE)*24),'FM9999990.00') END REPAIR_WAIT_TIME, - CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TRUNC(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),2) - WHEN ZRRT.STOP_MACHINE = 'N' THEN TRUNC(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),2) + CASE WHEN ZRRT.STOP_MACHINE = 'Y' THEN TO_CHAR(TO_NUMBER((ZRRT.ACTUAL_COMPLETE_DATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),'FM9999990.00') + WHEN ZRRT.STOP_MACHINE = 'N' THEN TO_CHAR(TO_NUMBER((SYSDATE-ZRRT.CREATED_DATE_TIME-ZRRT.WAIT_TIME)*24),'FM9999990.00') END REPAIR_TIME, CASE WHEN ZRRT.STATUS = '401' THEN '待维修' WHEN ZRRT.STATUS = '501' THEN '维修中' @@ -177,7 +177,7 @@ Z_RESOURCE_REPAIR_TASK ZRRT INNER JOIN RESRCE R ON R.RESRCE = ZRRT.RESOURCE_NO AND R.SITE = ZRRT.SITE INNER JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE - LEFT JOIN WORK_CENTER WC ON WC.HANDLE = WCM.WORK_CENTER_BO AND WC.WC_CATEGORY ='LEVEL3' + LEFT JOIN WORK_CENTER WC ON WC.HANDLE = WCM.WORK_CENTER_BO AND WC.WC_CATEGORY ='LEVEL2' LEFT JOIN WORK_CENTER_MEMBER WCM2 ON WCM2.WORK_CENTER_OR_RESOURCE_GBO = WC.HANDLE LEFT JOIN WORK_CENTER WC2 ON WC2.HANDLE = WCM.WORK_CENTER_BO AND WC2.WC_CATEGORY = 'LEVEL4' @@ -255,12 +255,7 @@ @@ -389,7 +389,7 @@ znu4.FULL_NAME CANCEL_USER,zabd.RESOLVE_REMARK RESOLVE_REMARK, zabd.ABNORMAL_REASON ABNORMAL_REASON,zabd.BEFORE_MEASURE BEFORE_MEASURE, ug.DESCRIPTION RESOLVE_SEND_USER_GROUP, - TRUNC(TO_NUMBER(zabd.RESOLVE_DATE_TIME - zsr.CREATED_DATE_TIME)*24,2) RESOLVE_DURATION, + TO_CHAR(TO_NUMBER(zabd.RESOLVE_DATE_TIME - zsr.CREATED_DATE_TIME)*24,'FM9999990.00') RESOLVE_DURATION, zabd.DUTY_DEPART DUTY_DEPART FROM Z_ABNORMAL_BILL zab LEFT JOIN Z_ABNORMAL_NC_CODE zanc ON zanc.ABNORMAL_BILL_BO = zab.HANDLE @@ -458,7 +458,7 @@ CASE WHEN zab.HANDLE IS NOT NULL THEN '是' ELSE '否' END IS_ANOMALY, - CASE WHEN zsd.PLANNED_COMP_DATE IS NOT NULL THEN TRUNC(TO_NUMBER(zsd.PLANNED_COMP_DATE - SYSDATE),2) || '天' + CASE WHEN zsd.PLANNED_COMP_DATE IS NOT NULL THEN TO_CHAR(TO_NUMBER(zsd.PLANNED_COMP_DATE - SYSDATE),'FM9999990.00') ELSE '' END SURPLUS_DAY FROM Z_SFC_DISPATCH zsd From c01f7e67eab7fca534009a380f6efad190344bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Sun, 26 Sep 2021 10:28:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BB=B4=E4=BF=AE?= =?UTF-8?q?=E6=8F=90=E6=8A=A5bug=EF=BC=8C=EF=BC=88=E4=BB=8E=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=82=B9=E6=A3=80=E8=B7=B3=E8=BF=87=E6=9D=A5object?= =?UTF-8?q?=E4=B9=9F=E6=9C=89=E5=8F=AF=E8=83=BD=E4=B8=8D=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equip/controller/ResourceRepairTaskController.java | 2 +- .../equip/service/impl/ResourceRepairTaskServiceImpl.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java index d7e4daa3..e265342a 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java @@ -172,7 +172,7 @@ public class ResourceRepairTaskController { try{ resourceRepairTaskService.saveRepairTask(resourceRepairTask); }catch (Exception e){ - return R.failed("提报失败,"+e.getMessage()); + return R.failed("提报失败:"+e.getMessage()); } return R.ok(); } diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java index 4fcda511..3687afe2 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java @@ -15,7 +15,6 @@ import com.foreverwin.mesnac.equip.model.ResourceRepairTask; import com.foreverwin.mesnac.equip.service.ResourceInspectPlanService; import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService; import com.foreverwin.mesnac.equip.service.ResourceRepairTaskService; -import com.foreverwin.mesnac.meapi.dto.NcCodeDto; import com.foreverwin.mesnac.meapi.mapper.NcCodeMapper; import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper; import com.foreverwin.mesnac.meapi.model.DataField; @@ -27,8 +26,8 @@ import com.foreverwin.mesnac.meapi.service.ResrceService; import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -149,7 +148,7 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl Date: Sun, 26 Sep 2021 10:28:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=BB=B4=E4=BF=AE=E6=8F=90=E6=8A=A5bug=EF=BC=8C?= =?UTF-8?q?=EF=BC=88=E4=BB=8E=E8=AE=BE=E5=A4=87=E7=82=B9=E6=A3=80=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E6=9D=A5object=E4=B9=9F=E6=9C=89=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=B8=8D=E4=B8=BA=E7=A9=BA=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java | 3 +++ anomaly/src/main/resources/mapper/ReportMapper.xml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index 6b827b78..27b469f0 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -915,6 +915,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl AND (I.ITEM = #{param.item} OR IT.DESCRIPTION = #{param.item}) + + AND (OT2.DESCRIPTION LIKE '%${param.currentOperation}%' OR + O2.OPERATION LIKE '%${param.currentOperation}%') +