Browse Source

列表与详情更换省市区获取方式

Signed-off-by: anderx <312518615@qq.com>
anderx 5 years ago
parent
commit
f05e7f2ede

+ 4 - 0
src/main/java/com/goafanti/admin/service/AdminService.java

@@ -7,6 +7,9 @@ import com.goafanti.admin.bo.AdminCustomerBo;
 import com.goafanti.admin.bo.AdminCustomerDetailBo;
 import com.goafanti.admin.bo.AdminDetail;
 import com.goafanti.admin.bo.AdminListBo;
+import com.goafanti.common.bo.AreaBo;
+import com.goafanti.common.bo.CityBo;
+import com.goafanti.common.bo.ProvinceBo;
 import com.goafanti.common.model.Admin;
 import com.goafanti.core.mybatis.page.Pagination;
 
@@ -85,4 +88,5 @@ public interface AdminService {
 
 	int updatePrivateBusinessTransfer(String inputId, String uid, String pid);
 
+
 }

+ 8 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -19,9 +19,13 @@ import com.goafanti.admin.bo.AdminCustomerDetailBo;
 import com.goafanti.admin.bo.AdminDetail;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.service.AdminService;
+import com.goafanti.common.bo.AreaBo;
+import com.goafanti.common.bo.CityBo;
+import com.goafanti.common.bo.ProvinceBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminLocationMapper;
 import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.DistrictGlossoryMapper;
 import com.goafanti.common.dao.UserBusinessMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserRoleMapper;
@@ -49,6 +53,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	private UserBusinessMapper	userBusinessMapper;
 	@Resource(name = "passwordUtil")
 	private PasswordUtil					passwordUtil;
+	@Autowired
+	private DistrictGlossoryMapper	districtGlossoryMapper;
+	
 	@Override
 	public List<Admin> selectAllAdmin() {
 		return adminMapper.selectAllAdmin(null);
@@ -392,5 +399,5 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		}
 		return i;
 	}
-
+	
 }

+ 17 - 7
src/main/java/com/goafanti/common/mapper/PersonnelDossierMapper.xml

@@ -827,15 +827,20 @@
 	d.school,d.major,d.title,pm.promotion_remarks promotionRemarks,a.mobile,a.fixed_tel fixedTel,
 	date_format(pm.promotion_time,'%Y-%m-%d') promotionTime,a.id_card idCard,a.birthday,a.employee_id employeeId,
 	date_format(pm.contract_start_time, '%Y-%m-%d') contractStart,date_format(pm.contract_end_time,'%Y-%m-%d')contractEnd,
-	a.certification_authority certificationAuthority, a.residence_province residenceProvince,
-	a.residence_city residenceCity,a.residence_area residenceArea, a.residence_address residenceAddress,
-	a.native_place_province nativePlaceProvince, a.native_place_city nativePlaceCity,a.now_province nowProvince,
-	a.now_city nowCity,a.now_area nowArea, a.now_address nowAddress,date_format(pm.quit_time,'%Y-%m-%d') quitTime,
+	a.certification_authority certificationAuthority,  a.residence_address residenceAddress,a.now_address nowAddress,
+	a.residence_province residenceProvince, a.residence_city residenceCity,a.residence_area residenceArea,
+	da1.name rpName,da2.name rcName,da3.name raName,db1.name nppName,db2.name npcName,dc1.name npName,dc2.name ncName,
+	dc3.name naName,a.native_place_province nativePlaceProvince, a.native_place_city nativePlaceCity,
+	a.now_province nowProvince, a.now_city nowCity,a.now_area nowArea, date_format(pm.quit_time,'%Y-%m-%d') quitTime,
 	pm.emergency_contact emergencyContact,pm.emergency_mobile emergencyMobile,
 	date_format(pm.insurance_start_time,'%Y-%m-%d') insuranceStartTimes,date_format(pm.insurance_end_time,'%Y-%m-%d') insuranceEndTimes,
 	date_format(pm.fund_start_time,'%Y-%m-%d') fundStartTimes,date_format(pm.fund_end_time,'%Y-%m-%d') fundEndTimes
 	from personnel_dossier a left join  admin_level b  on a.jobs=b.jobs and a.star=b.lvl left join department dep on a.company = dep.id
-	left join personnel_entry d on a.id=d.id  	left join personnel_mid pm on a.id=pm.id
+	left join personnel_entry d on a.id=d.id  	left join personnel_mid pm on a.id=pm.id left join district_glossory da1 on a.residence_province=da1.id  
+	left join district_glossory da2 on a.residence_city=da2.id	left join district_glossory da3 on a.residence_area=da3.id
+	left join district_glossory db1 on a.native_place_province=db1.id	left join district_glossory db2 on a.native_place_city=db2.id
+ 	left join district_glossory dc1 on a.now_province=dc1.id left join district_glossory dc2 on a.now_city=dc2.id	
+ 	left join district_glossory dc3 on a.now_area=dc3.id
 	<if test="aid !=null">
 		left join admin ad on dep.id=ad.department_id
 	</if>
@@ -968,7 +973,8 @@
 	a.job_nature_remarks jobNatureRemarks, b.jobs_name jobsName,a.lvl,b.lvl_name starName,date_format(a.entry_time,'%Y-%m-%d')entryTimes,
 	date_format(a.promotion_time,'%Y-%m-%d')promotionTimes,date_format(a.birthday,'%Y-%m-%d')birthdays,a.star,a.jobs,
 	a.entry_time entryTime, a.sex,a.son,a.girl,a.political_outlook politicalOutlook,d.education,a.employee_id employeeId,
-	d.school,d.major,d.title,m.promotion_remarks promotionRemarks,a.mobile,a.fixed_tel fixedTel,
+	d.school,d.major,d.title,m.promotion_remarks promotionRemarks,a.mobile,a.fixed_tel fixedTel,da1.name rpName,da2.name rcName,
+	da3.name raName,db1.name nppName,db2.name npcName,dc1.name npName,dc2.name ncName, dc3.name naName,
 	date_format(m.promotion_time,'%Y-%m-%d') promotionTime,a.id_card idCard,a.birthday,a.allowance,m.welfare_remarks welfareRemarks,
 	a.certification_authority certificationAuthority, a.residence_province residenceProvince,m.welfare_annex_name welfareAnnexName,
 	a.residence_city residenceCity,a.residence_area residenceArea, a.residence_address residenceAddress,
@@ -976,7 +982,11 @@
 	a.now_city nowCity,a.now_area nowArea, a.now_address nowAddress,m.welfare_annex_url welfareAnnexUrl
 	from personnel_dossier a left join  admin_level b  on a.jobs=b.jobs and a.star=b.lvl 
 	left join department dep on a.company = dep.id left join personnel_mid m on a.id=m.id
-	left join personnel_entry d on a.id=d.id  
+	left join personnel_entry d on a.id=d.id  left join district_glossory da1 on a.residence_province=da1.id  
+	left join district_glossory da2 on a.residence_city=da2.id	left join district_glossory da3 on a.residence_area=da3.id
+	left join district_glossory db1 on a.native_place_province=db1.id	left join district_glossory db2 on a.native_place_city=db2.id
+ 	left join district_glossory dc1 on a.now_province=dc1.id left join district_glossory dc2 on a.now_city=dc2.id	
+ 	left join district_glossory dc3 on a.now_area=dc3.id
 	where 1=1
 	and a.id= #{id}
   </select>

+ 0 - 1
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -61,7 +61,6 @@ public class PatentTask {
 	
 	
 	
-	
 	@Scheduled(cron = "0 0 0  * * ?") 
 	@RequestMapping(value = "/open/patentRemind", method = RequestMethod.GET)
 	public void patentRemind() {

+ 75 - 15
src/main/java/com/goafanti/personnel/bo/OutPersonnelListBo.java

@@ -54,16 +54,69 @@ public class OutPersonnelListBo {
 	private Integer workingYear;
 	private Integer age;
 	private Integer month;
-	private String residenceName;
-	private String nativePlaceName;
-	private String nowName;
 	private String insuranceStartTimes;
 	private String insuranceEndTimes;
 	private String fundStartTimes;
 	private String fundEndTimes;
 	private Integer employeeId;
+	private String rpName;
+	private String rcName;
+	private String raName;
+	private String nppName;
+	private String npcName;
+	private String npName;
+	private String ncName;
+	private String  naName;
 	
 	
+	public String getRpName() {
+		return rpName;
+	}
+	public void setRpName(String rpName) {
+		this.rpName = rpName;
+	}
+	public String getRcName() {
+		return rcName;
+	}
+	public void setRcName(String rcName) {
+		this.rcName = rcName;
+	}
+	public String getRaName() {
+		return raName;
+	}
+	public void setRaName(String raName) {
+		this.raName = raName;
+	}
+	public String getNppName() {
+		return nppName;
+	}
+	public void setNppName(String nppName) {
+		this.nppName = nppName;
+	}
+	public String getNpcName() {
+		return npcName;
+	}
+	public void setNpcName(String npcName) {
+		this.npcName = npcName;
+	}
+	public String getNpName() {
+		return npName;
+	}
+	public void setNpName(String npName) {
+		this.npName = npName;
+	}
+	public String getNcName() {
+		return ncName;
+	}
+	public void setNcName(String ncName) {
+		this.ncName = ncName;
+	}
+	public String getNaName() {
+		return naName;
+	}
+	public void setNaName(String naName) {
+		this.naName = naName;
+	}
 	public String getInsuranceStartTimes() {
 		return insuranceStartTimes;
 	}
@@ -507,23 +560,30 @@ public class OutPersonnelListBo {
 		this.emergencyMobile = emergencyMobile;
 	}
 	public String getResidenceName() {
-		return residenceName;
-	}
-	public void setResidenceName(String residenceName) {
-		this.residenceName = residenceName;
+		String str="";
+		if(rpName!=null)str=str+rpName.trim()+"省";
+		if(rcName!=null)str=str+rcName.trim();
+		if(raName!=null)str=str+raName.trim();
+		if (residenceAddress!=null)str=str+residenceAddress; 
+		return str;
 	}
+	
 	public String getNativePlaceName() {
-		return nativePlaceName;
-	}
-	public void setNativePlaceName(String nativePlaceName) {
-		this.nativePlaceName = nativePlaceName;
+		String str="";
+		if(nppName!=null)str=str+nppName.trim()+"省";
+		if(npcName!=null)str=str+npcName.trim();
+		return str;
 	}
+	
 	public String getNowName() {
-		return nowName;
-	}
-	public void setNowName(String nowName) {
-		this.nowName = nowName;
+		String str="";
+		if(npName!=null)str=str+npName.trim()+"省";
+		if(ncName!=null)str=str+ncName.trim();
+		if(naName!=null)str=str+naName.trim();
+		if (nowAddress!=null)str=str+nowAddress; 
+		return str;
 	}
+	
 	public String getJobNature() {
 		return jobNature;
 	}

+ 1 - 68
src/main/java/com/goafanti/personnel/service/impl/PersonnelServiceImpl.java

@@ -20,13 +20,9 @@ import org.springframework.stereotype.Service;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
-import com.goafanti.common.bo.AreaBo;
-import com.goafanti.common.bo.CityBo;
 import com.goafanti.common.bo.Error;
-import com.goafanti.common.bo.ProvinceBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.DistrictGlossoryMapper;
 import com.goafanti.common.dao.PersonnelChooseMapper;
 import com.goafanti.common.dao.PersonnelContactMapper;
 import com.goafanti.common.dao.PersonnelContractMapper;
@@ -86,8 +82,6 @@ public class PersonnelServiceImpl  extends BaseMybatisDao<PersonnelDossierMapper
 	@Autowired
 	private PersonnelMidMapper	personnelMidMapper;
 	@Autowired
-	private DistrictGlossoryMapper	districtGlossoryMapper;
-	@Autowired
 	private AdminMapper	adminMapper;
 	
 	@Override
@@ -252,32 +246,12 @@ public class PersonnelServiceImpl  extends BaseMybatisDao<PersonnelDossierMapper
 		}
 		Pagination<OutPersonnelListBo>p=(Pagination<OutPersonnelListBo>) findPage("selectPersonnelByList", "selectPersonnelByCount",
 				params, i.getPageNo(), i.getPageSize());
-		//处理省市区的转换
-		for (OutPersonnelListBo ob : (List<OutPersonnelListBo>)p.getList()) {
-			String residenceName=districtTransformation(ob.getResidenceProvince(),ob.getResidenceCity(),ob.getResidenceArea(),
-					ob.getResidenceAddress());
-			String nativePlaceName =districtTransformation(ob.getNativePlaceProvince(),ob.getNativePlaceCity(),null,null);
-			String nowName=districtTransformation(ob.getNowProvince(),ob.getNowCity(),ob.getNowArea(),
-					ob.getNowAddress());
-			ob.setResidenceName(residenceName);
-			ob.setNativePlaceName(nativePlaceName);
-			ob.setNowName(nowName);
-		}
-			
 		return p;
 	}
 
 	@Override
 	public OutPersonnelBo selectBypdId(Integer id) {
 		OutPersonnelBo op=	personnelDossierMapper.selectBypdId(id);
-		String residenceName=districtTransformation(op.getResidenceProvince(),op.getResidenceCity(),op.getResidenceArea(),
-				op.getResidenceAddress());
-		String nativePlaceName =districtTransformation(op.getNativePlaceProvince(),op.getNativePlaceCity(),null,null);
-		String nowName=districtTransformation(op.getNowProvince(),op.getNowCity(),op.getNowArea(),
-				op.getNowAddress());
-		op.setResidenceName(residenceName);
-		op.setNativePlaceName(nativePlaceName);
-		op.setNowName(nowName);
 		op.setContactList(personnelContactMapper.selectBypdId(id));
 		PersonnelEntry pe=personnelEntryMapper.selectByPrimaryKey(id);
 		op.setPersonnelEntry(pe);
@@ -381,48 +355,7 @@ public class PersonnelServiceImpl  extends BaseMybatisDao<PersonnelDossierMapper
 		}
 	}
 	
-	/**
-	 * 省市区转换
-	 * @param p 省
-	 * @param c 市
-	 * @param a 区
-	 * @param address 地址
-	 * @param residenceName 
-	 * @return
-	 */
-	private String districtTransformation(Integer p,Integer c,Integer a,String address) {
-		List<ProvinceBo> plist= districtGlossoryMapper.getProvince();
-		List<CityBo>  clist= districtGlossoryMapper.getCity();
-		List<AreaBo>  alist= districtGlossoryMapper.getArea();
-		String residenceName="" ;
-		if (p!=null) {
-			for (ProvinceBo pb : plist) {
-				if (pb.getId().equals(p)) {
-					residenceName+=pb.getName().trim()+"省";
-					break;
-				}
-			}
-		}
-			if (c!=null) {
-			for (CityBo cb : clist) {
-				if (cb.getId().equals(c)) {
-					residenceName+=cb.getName().trim();
-					break;
-				}
-			}
-		}
-			if (a!=null) {
-			for (AreaBo ab : alist) {
-				if (ab.getId().equals(a)) {
-					residenceName+=ab.getName().replace(" ", "");
-					break;
-				}
-			}
-		}
-		if (address!=null) residenceName+=address;
-			
-		return residenceName;
-	}
+	
 
 	@Override
 	public List<OutPersonnelLvlBo> selectLvlList() {