From 63b8c0f0d64b5501f482869ffcfde89efe126171 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期三, 27 八月 2025 09:05:16 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/service/CommonService.java | 129 +++++++++++++++++++++++++++++-------------- 1 files changed, 87 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java index 250bc28..e429c41 100644 --- a/src/main/java/com/zy/common/service/CommonService.java +++ b/src/main/java/com/zy/common/service/CommonService.java @@ -206,6 +206,9 @@ Config crnSearchDetectTaskCountConfig = configService.selectConfigByCode("crnSearchDetectTaskCount"); int crnSearchDetectTaskCount = Integer.parseInt(crnSearchDetectTaskCountConfig.getValue()); + Config applyInTaskTotalCountConfig = configService.selectConfigByCode("applyInTaskTotalCount"); + int applyInTaskTotalCount = Integer.parseInt(applyInTaskTotalCountConfig.getValue()); + Config crnSearchListConfig = configService.selectConfigByCode("123CrnSearchList"); int crnSearchList = Integer.parseInt(crnSearchListConfig.getValue()); @@ -224,11 +227,19 @@ continue; } + List<WrkMast> wrkMastsList = wrkMastService.selectList(new EntityWrapper<WrkMast>() + .eq("crn_no", crnNo) + .in("io_type", 1, 10, 53, 57, 101, 103, 107, 110) + ); + if (wrkMastsList.size() > applyInTaskTotalCount) { + log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒扮敵璇峰叆搴撴椂鎬讳换鍔℃暟閲忎笂闄�(鍏ュ簱銆佸嚭搴�)锛侊紒锛� 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMastsList.size(), applyInTaskTotalCount); + } + rowCount = locNecessaryParameters[0]; nearRow = locNecessaryParameters[3]; List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() .eq("row1", nearRow).eq("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue())); - int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100)); + int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).eq("io_type", 1)); if (locMasts.size() - crnCountO <= 2) { log.error(crnNo + "鍙峰爢鍨涙満娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times); nearRow = 0; @@ -244,16 +255,29 @@ //浼樺寲绯荤粺锛屾彁楂樻悳绱�1鍙峰爢鍨涙満娆℃暟 if (crnNo == 2 || crnNo == 3) { if (crnSearchList >= 2) { - //灏濊瘯鎵�1鍙峰集杞ㄥ爢鍨涙満搴撲綅 - crnNo = 1; - if (basCrnpService.checkSiteError(crnNo, true)) { + if (basCrnpService.checkSiteError(1, true)) { + boolean flag = true; + //灏濊瘯鎵�1鍙峰集杞ㄥ爢鍨涙満搴撲綅 + crnNo = 1; List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() .eq("crn_no", crnNo) .in("io_type", 1, 10, 53, 57) ); if(wrkMasts.size() > crnSearchDetectTaskCount){ log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒板叆搴撴帶鍒朵笂闄愶紒锛侊紒 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMasts.size(), crnSearchDetectTaskCount); - }else { + flag = false; + } + + List<WrkMast> wrkMastsList = wrkMastService.selectList(new EntityWrapper<WrkMast>() + .eq("crn_no", crnNo) + .in("io_type", 1, 10, 53, 57, 101, 103, 107, 110) + ); + if (wrkMastsList.size() > applyInTaskTotalCount) { + log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒扮敵璇峰叆搴撴椂鎬讳换鍔℃暟閲忎笂闄�(鍏ュ簱銆佸嚭搴�)锛侊紒锛� 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMastsList.size(), applyInTaskTotalCount); + flag = false; + } + + if (flag) { List<Integer> nearRowList = new ArrayList<Integer>() {{ add(4); add(6); @@ -268,7 +292,7 @@ .eq("loc_type1", locTypeDto.getLocType1()) .eq("loc_type2", locTypeDto.getLocType2()) ); - int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100)); + int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).eq("io_type", 1)); if (locMasts.size() - crnCountO <= 2) { log.error(crnNo + "鍙峰爢鍨涙満娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times); } else { @@ -286,26 +310,47 @@ //灏濊瘯鎵�1鍙峰集杞ㄥ爢鍨涙満搴撲綅 crnNo = 1; if (basCrnpService.checkSiteError(crnNo, true)) { - List<Integer> nearRowList = new ArrayList<Integer>() {{ - add(4); - add(6); - add(3); - add(1); - }}; - for (Integer near : nearRowList) { - List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() - .eq("row1", near) - .eq("loc_sts", "O") - .eq("whs_type", rowLastnoType.getType().longValue()) - .eq("loc_type1", locTypeDto.getLocType1()) - .eq("loc_type2", locTypeDto.getLocType2()) - ); - int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100)); - if (locMasts.size() - crnCountO <= 2) { - log.error(crnNo + "鍙峰爢鍨涙満娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times); - } else { - nearRow = near; - break; + boolean flag = true; + List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() + .eq("crn_no", crnNo) + .in("io_type", 1, 10, 53, 57) + ); + if(wrkMasts.size() > crnSearchDetectTaskCount){ + log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒板叆搴撴帶鍒朵笂闄愶紒锛侊紒 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMasts.size(), crnSearchDetectTaskCount); + flag = false; + } + + List<WrkMast> wrkMastsList = wrkMastService.selectList(new EntityWrapper<WrkMast>() + .eq("crn_no", crnNo) + .in("io_type", 1, 10, 53, 57, 101, 103, 107, 110) + ); + if (wrkMastsList.size() > applyInTaskTotalCount) { + log.error(crnNo + "鍙峰爢鍨涙満宸茶揪鍒扮敵璇峰叆搴撴椂鎬讳换鍔℃暟閲忎笂闄�(鍏ュ簱銆佸嚭搴�)锛侊紒锛� 浠诲姟鏁伴噺锛� {}锛� 鎺у埗鏁伴噺锛歿}", wrkMastsList.size(), applyInTaskTotalCount); + flag = false; + } + + if (flag) { + List<Integer> nearRowList = new ArrayList<Integer>() {{ + add(4); + add(6); + add(3); + add(1); + }}; + for (Integer near : nearRowList) { + List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>() + .eq("row1", near) + .eq("loc_sts", "O") + .eq("whs_type", rowLastnoType.getType().longValue()) + .eq("loc_type1", locTypeDto.getLocType1()) + .eq("loc_type2", locTypeDto.getLocType2()) + ); + int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).eq("io_type", 1)); + if (locMasts.size() - crnCountO <= 2) { + log.error(crnNo + "鍙峰爢鍨涙満娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times); + } else { + nearRow = near; + break; + } } } } @@ -579,24 +624,24 @@ - // 鑾峰彇鐩爣绔� - wrapper = new EntityWrapper<StaDesc>() - .eq("type_no", staDescId) - .eq("stn_no", sourceStaNo) - .eq("crn_no", locMast.getCrnNo()); - staDesc = staDescService.selectOne(wrapper); - if (Cools.isEmpty(staDesc)) { - log.error("type_no={},stn_no={},crn_no={}", staDescId, sourceStaNo, crnNo); + // 鑾峰彇鐩爣绔� + wrapper = new EntityWrapper<StaDesc>() + .eq("type_no", staDescId) + .eq("stn_no", sourceStaNo) + .eq("crn_no", locMast.getCrnNo()); + staDesc = staDescService.selectOne(wrapper); + if (Cools.isEmpty(staDesc)) { + log.error("type_no={},stn_no={},crn_no={}", staDescId, sourceStaNo, crnNo); // throw new CoolException("鍏ュ簱璺緞涓嶅瓨鍦�"); - crnNo = 0; - } else { - staNo = basDevpService.selectById(staDesc.getCrnStn()); - if (!staNo.getAutoing().equals("Y")) { - log.error("鐩爣绔�" + staDesc.getCrnStn() + "涓嶅彲鐢�"); + crnNo = 0; + } else { + staNo = basDevpService.selectById(staDesc.getCrnStn()); + if (!staNo.getAutoing().equals("Y")) { + log.error("鐩爣绔�" + staDesc.getCrnStn() + "涓嶅彲鐢�"); // throw new CoolException("鐩爣绔�"+staDesc.getCrnStn()+"涓嶅彲鐢�"); - crnNo = 0; - } - startupDto.setStaNo(staNo.getDevNo()); + crnNo = 0; + } + startupDto.setStaNo(staNo.getDevNo()); } String locNo = locMast.getLocNo(); // 鐢熸垚宸ヤ綔鍙� -- Gitblit v1.9.1