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 ccd6611f..c337e4fe 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 @@ -22,12 +22,10 @@ import com.foreverwin.mesnac.common.service.MessageService; import com.foreverwin.mesnac.common.service.UserService; import com.foreverwin.mesnac.common.util.ActiveMQUtil; import com.foreverwin.mesnac.common.util.StringUtil; +import com.foreverwin.mesnac.meapi.dto.NcCodeDto; import com.foreverwin.mesnac.meapi.mapper.*; import com.foreverwin.mesnac.meapi.model.*; -import com.foreverwin.mesnac.meapi.service.DataFieldListService; -import com.foreverwin.mesnac.meapi.service.NwaUserService; -import com.foreverwin.mesnac.meapi.service.RouterService; -import com.foreverwin.mesnac.meapi.service.WorkCenterService; +import com.foreverwin.mesnac.meapi.service.*; import com.foreverwin.mesnac.meapi.util.StringUtils; import com.foreverwin.mesnac.quality.service.SelfReportService; import com.foreverwin.modular.core.exception.BaseException; @@ -129,6 +127,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl ncCodesAndNcGroups = ncCodeService.findNcCodeDescriptionByNcCode(abnormalBill.getNcCode()); + List abnormalNcCodes = new LinkedList<>(); + for(int i = 0; i < ncCodesAndNcGroups.size(); i ++){ + AbnormalNcCode abnormalNcCode = new AbnormalNcCode(); + String uuid = UUID.randomUUID().toString(); + abnormalNcCode.setHandle(uuid); + abnormalNcCode.setSite(abnormalBill.getSite()); + abnormalNcCode.setAbnormalBillBo(abnormalBill.getHandle()); + abnormalNcCode.setNcCodeGroup(ncCodesAndNcGroups.get(i).getNgGroup()); + abnormalNcCode.setNcCode(ncCodesAndNcGroups.get(i).getNcCode()); + abnormalNcCode.setNcQty(abnormalBill.getNcQty()); + abnormalNcCode.setCreatedUser(user); + abnormalNcCode.setCreatedDateTime(now); + abnormalNcCode.setModifiedUser(user); + abnormalNcCode.setModifiedDateTime(now); + abnormalNcCodes.add(abnormalNcCode); + } + abnormalNcCodeService.saveOrUpdateBatch(abnormalNcCodes); + abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose); this.saveOrUpdate(abnormalBill); //发送消息 diff --git a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml index ed396bbb..b2418d9f 100644 --- a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml +++ b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml @@ -973,11 +973,14 @@ ZAB.NC_CODE NC_CODE ,ZAB.PB_DESCRIPTION PB_DESCRIPTION ,ZAB.SHUT_DOWN SHUT_DOWN ,ZAB.RESPONSE_USER RESPONSE_USER,ZAB.RESPONSE_DATE_TIME RESPONSE_DATE_TIME, ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,ZNU3.FULL_NAME CONFIRM_USER,ZABD.RESOLVE_REMARK RESOLVE_REMARK, ZAB.CANCEL_CODE CANCEL_CODE,ZAB.CANCEL_DATE_TIME CANCEL_DATE_TIME,ZNU4.FULL_NAME CANCEL_USER,ZAB.CANCEL_REASON CANCEL_REASON, - ZAB.REPORT_SEND_USER_GROUP REPORT_SEND_USER_GROUP + ZAB.REPORT_SEND_USER_GROUP REPORT_SEND_USER_GROUP, + SUBSTR(LISTAGG(NCT.DESCRIPTION || ',') WITHIN GROUP(ORDER BY ZAB.ABNORMAL_NO),0,LENGTH(LISTAGG(NCT.DESCRIPTION || ',') WITHIN GROUP(ORDER BY ZAB.ABNORMAL_NO))-1) NC_CODE_DESCRIPTION FROM Z_ABNORMAL_BILL ZAB INNER JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZABD.ABNORMAL_BILL_BO = ZAB.HANDLE INNER JOIN RESRCE R ON R.RESRCE = ZAB.RESRCE AND R.SITE = ZAB.SITE + LEFT JOIN Z_ABNORMAL_NC_CODE zanc ON zanc.ABNORMAL_BILL_BO = ZAB.HANDLE + LEFT JOIN NC_CODE_T NCT ON NCT.NC_CODE_BO = 'NCCodeBO:'|| ZAB.SITE || ',' || ZANC.NC_CODE AND NCT.LOCALE = #{language} LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = ('WorkCenterBO:' || ZAB.SITE || ',' || ZAB.WORK_CENTER) AND WCT.LOCALE =#{language} LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZAB.CREATED_USER AND ZNU.SITE = ZAB.SITE LEFT JOIN Z_NWA_USER ZNU2 ON ZNU2.USER_NAME = ZAB.RESPONSE_USER AND ZNU2.SITE = ZAB.SITE @@ -993,6 +996,13 @@ + GROUP BY + ZAB.ABNORMAL_NO , ZAB.STATUS ,ZAB.REPORT_FROM ,WCT.DESCRIPTION , + ZAB.RESRCE ,R.DESCRIPTION ,ZNU.FULL_NAME ,ZAB.MESSAGE_TYPE , + ZAB.NC_CODE ,ZAB.PB_DESCRIPTION ,ZAB.SHUT_DOWN ,ZAB.RESPONSE_USER ,ZAB.RESPONSE_DATE_TIME , + ZABD.ABNORMAL_METHOD ,ZNU3.FULL_NAME ,ZABD.RESOLVE_REMARK , + ZAB.CANCEL_CODE ,ZAB.CANCEL_DATE_TIME ,ZNU4.FULL_NAME ,ZAB.CANCEL_REASON , + ZAB.REPORT_SEND_USER_GROUP + SELECT + FROM Z_INTEGRATION_LOG + + SITE = #{integration.site} + + AND INTEGRATION_TYPE = #{integration.integrationType} + + + AND INTEGRATION_WAY = #{integration.integrationWay} + + + AND STATUS = #{integration.status} + + + AND REQUEST_DATE_TIME >= #{integration.startDateTime} + + + AND REQUEST_DATE_TIME <= #{integration.endDateTime} + + +