Просмотр исходного кода

更新企业档案与面谈接口修改

anderx месяцев назад: 9
Родитель
Сommit
ae23900f0d

+ 4 - 3
src/main/java/com/goafanti/common/dao/DistrictGlossoryMapper.java

@@ -1,12 +1,12 @@
 package com.goafanti.common.dao;
 
-import java.util.List;
-
 import com.goafanti.common.bo.AreaBo;
 import com.goafanti.common.bo.CityBo;
 import com.goafanti.common.bo.ProvinceBo;
 import com.goafanti.common.model.DistrictGlossory;
 
+import java.util.List;
+
 public interface DistrictGlossoryMapper {
     int deleteByPrimaryKey(Integer id);
 
@@ -30,5 +30,6 @@ public interface DistrictGlossoryMapper {
 	
 	List<AreaBo> getArea();
 
-	
+
+    List<DistrictGlossory> getAll();
 }

+ 5 - 0
src/main/java/com/goafanti/common/mapper/DistrictGlossoryMapper.xml

@@ -111,4 +111,9 @@
     from district_glossory
     where level=3
   </select>
+    <select id="getAll" resultType="com.goafanti.common.model.DistrictGlossory">
+      select
+        id,name,pid,level
+      from district_glossory
+    </select>
 </mapper>

+ 27 - 0
src/main/java/com/goafanti/customer/bo/UserArchivesDetails.java

@@ -20,6 +20,33 @@ public class UserArchivesDetails extends UserArchives {
     private Integer LocationProvince;
     private Integer LocationCity;
     private Integer LocationArea;
+    private String LocationProvinceName;
+    private String LocationCityName;
+    private String LocationAreaName;
+
+    public String getLocationProvinceName() {
+        return LocationProvinceName;
+    }
+
+    public void setLocationProvinceName(String locationProvinceName) {
+        LocationProvinceName = locationProvinceName;
+    }
+
+    public String getLocationCityName() {
+        return LocationCityName;
+    }
+
+    public void setLocationCityName(String locationCityName) {
+        LocationCityName = locationCityName;
+    }
+
+    public String getLocationAreaName() {
+        return LocationAreaName;
+    }
+
+    public void setLocationAreaName(String locationAreaName) {
+        LocationAreaName = locationAreaName;
+    }
 
     public Integer getLocationProvince() {
         return LocationProvince;

+ 28 - 0
src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

@@ -47,6 +47,8 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
     private UserFirstInterviewMapper userFirstInterviewMapper;
     @Resource
     private OrganizationIdentityMapper organizationIdentityMapper;
+    @Resource
+    private DistrictGlossoryMapper districtGlossoryMapper;
 
 
 
@@ -75,6 +77,7 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
         UserArchivesDetails user = customerService.selectUserByUid(id);
         User u = userMapper.queryById(id);
         OrganizationIdentity ori = organizationIdentityMapper.selectOrgIdentityByUserId(id);
+        pushProvincePlus(ori, user);
         user.setLocationProvince(ori.getLocationProvince());
         user.setLocationCity(ori.getLocationCity());
         user.setLocationArea(ori.getLocationArea());
@@ -107,6 +110,31 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
         return user;
     }
 
+    private void pushProvincePlus(OrganizationIdentity ori, UserArchivesDetails user) {
+        List<DistrictGlossory> all = districtGlossoryMapper.getAll();
+        if (ori.getLocationProvince()!=null){
+            all.stream().filter(e -> e.getLevel()==1).collect(Collectors.toList()).forEach(e -> {
+                if (ori.getLocationProvince().equals(e.getId())){
+                        user.setLocationProvinceName(e.getName());
+                }
+            });
+        }
+        if (ori.getLocationCity()!=null){
+            all.stream().filter(e -> e.getLevel()==2).collect(Collectors.toList()).forEach(e -> {
+                if (ori.getLocationCity().equals(e.getId())){
+                    user.setLocationCityName(e.getName());
+                }
+            });
+        }
+        if (ori.getLocationArea()!=null){
+            all.stream().filter(e -> e.getLevel()==3).collect(Collectors.toList()).forEach(e -> {
+                if (ori.getLocationArea().equals(e.getId())){
+                    user.setLocationAreaName(e.getName());
+                }
+            });
+        }
+    }
+
     @Override
     public boolean checkPermission(String id) {
         User user = userMapper.queryById(id);