Bläddra i källkod

Merge branch 'refs/heads/GB-local'

guobing 2 veckor sedan
förälder
incheckning
041259e9e7

+ 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 40
 import com.unis.module.coding.dal.mysql.kqxx.KqxxMapper;
41 41
 import com.unis.module.coding.dal.mysql.province.ProvinceMapper;
42 42
 import com.unis.module.coding.dal.mysql.users.UsersMapper;
43
+import com.unis.module.core.enums.CityConstants;
43 44
 import com.unis.module.core.enums.XZQHLEVEL;
44 45
 import com.unis.module.core.enums.YXZT;
45 46
 import com.unis.module.system.dal.dataobject.arealevel.AreaLevelDO;
@@ -235,6 +236,10 @@ public class DwxxServiceImpl implements DwxxService {
235 236
                      s.setCfzt(pageReqVO.getCfzt());
236 237
                      s.setCfEnd(pageReqVO.getCfEnd());
237 238
                      s.setCfStart(pageReqVO.getCfStart());
239
+                    if (Arrays.asList(CityConstants.CITY).contains(s.getSheng())) {
240
+                        s.setShi(s.getXian());
241
+                        s.setXian(null);
242
+                    }
238 243
                 });
239 244
             }
240 245
         }
@@ -713,11 +718,17 @@ public class DwxxServiceImpl implements DwxxService {
713 718
                 if (parts.length != 0) {
714 719
                     province = parts[0];
715 720
                     if (parts.length == 3) {
716
-                        city = parts[1];
717
-                        county = parts[2];
721
+                        if (Arrays.asList(CityConstants.CITY).contains(province)) {
722
+                            city = parts[2];
723
+                        }else {
724
+                            city = parts[1];
725
+                            county = parts[2];
726
+                        }
718 727
                     }
719 728
                     if (parts.length == 2) {
720
-                        city = parts[1];
729
+                        if (!Arrays.asList(CityConstants.CITY).contains(province)) {
730
+                            city = parts[1];
731
+                        }
721 732
                     }
722 733
                 }
723 734
                 List<AreaLevelDO> areaLevelDOS = areaLevelMapper.selectListByName(Arrays.asList(province, city, county));