Browse Source

交收库列表直辖市优化

guobing 2 weeks ago
parent
commit
67b96d8c13

+ 14 - 0
delivery-module-core/delivery-module-core-api/src/main/java/com/unis/module/core/enums/CityConstants.java

@@ -0,0 +1,14 @@
1
+package com.unis.module.core.enums;
2
+
3
+/**
4
+ * Infra 城市枚举类
5
+ *
6
+ */
7
+public interface CityConstants {
8
+    String[] CITY = new String[]{
9
+            "北京市",  // 北京
10
+            "天津市",  // 天津
11
+            "上海市",  // 上海
12
+            "重庆市"   // 重庆
13
+    };
14
+}

+ 14 - 3
delivery-module-core/delivery-module-core-biz/src/main/java/com/unis/module/coding/service/dwxx/DwxxServiceImpl.java

@@ -40,6 +40,7 @@ import com.unis.module.coding.dal.mysql.fmxx.FmxxMapper;
40
 import com.unis.module.coding.dal.mysql.kqxx.KqxxMapper;
40
 import com.unis.module.coding.dal.mysql.kqxx.KqxxMapper;
41
 import com.unis.module.coding.dal.mysql.province.ProvinceMapper;
41
 import com.unis.module.coding.dal.mysql.province.ProvinceMapper;
42
 import com.unis.module.coding.dal.mysql.users.UsersMapper;
42
 import com.unis.module.coding.dal.mysql.users.UsersMapper;
43
+import com.unis.module.core.enums.CityConstants;
43
 import com.unis.module.core.enums.XZQHLEVEL;
44
 import com.unis.module.core.enums.XZQHLEVEL;
44
 import com.unis.module.core.enums.YXZT;
45
 import com.unis.module.core.enums.YXZT;
45
 import com.unis.module.system.dal.dataobject.arealevel.AreaLevelDO;
46
 import com.unis.module.system.dal.dataobject.arealevel.AreaLevelDO;
@@ -244,6 +245,10 @@ public class DwxxServiceImpl implements DwxxService {
244
                      s.setCfzt(pageReqVO.getCfzt());
245
                      s.setCfzt(pageReqVO.getCfzt());
245
                      s.setCfEnd(pageReqVO.getCfEnd());
246
                      s.setCfEnd(pageReqVO.getCfEnd());
246
                      s.setCfStart(pageReqVO.getCfStart());
247
                      s.setCfStart(pageReqVO.getCfStart());
248
+                    if (Arrays.asList(CityConstants.CITY).contains(s.getSheng())) {
249
+                        s.setShi(s.getXian());
250
+                        s.setXian(null);
251
+                    }
247
                 });
252
                 });
248
             }
253
             }
249
         }
254
         }
@@ -722,11 +727,17 @@ public class DwxxServiceImpl implements DwxxService {
722
                 if (parts.length != 0) {
727
                 if (parts.length != 0) {
723
                     province = parts[0];
728
                     province = parts[0];
724
                     if (parts.length == 3) {
729
                     if (parts.length == 3) {
725
-                        city = parts[1];
726
-                        county = parts[2];
730
+                        if (Arrays.asList(CityConstants.CITY).contains(province)) {
731
+                            city = parts[2];
732
+                        }else {
733
+                            city = parts[1];
734
+                            county = parts[2];
735
+                        }
727
                     }
736
                     }
728
                     if (parts.length == 2) {
737
                     if (parts.length == 2) {
729
-                        city = parts[1];
738
+                        if (!Arrays.asList(CityConstants.CITY).contains(province)) {
739
+                            city = parts[1];
740
+                        }
730
                     }
741
                     }
731
                 }
742
                 }
732
                 List<AreaLevelDO> areaLevelDOS = areaLevelMapper.selectListByName(Arrays.asList(province, city, county));
743
                 List<AreaLevelDO> areaLevelDOS = areaLevelMapper.selectListByName(Arrays.asList(province, city, county));