|
|
@@ -2,8 +2,10 @@ package com.jpsoft.employment.modules.base.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.employment.modules.base.dto.CompanyDTO;
|
|
|
+import com.jpsoft.employment.modules.base.entity.City;
|
|
|
import com.jpsoft.employment.modules.base.entity.Company;
|
|
|
import com.jpsoft.employment.modules.base.entity.EnterpriseCertificationApprove;
|
|
|
+import com.jpsoft.employment.modules.base.service.CityService;
|
|
|
import com.jpsoft.employment.modules.base.service.CompanyService;
|
|
|
import com.jpsoft.employment.modules.base.service.EnterpriseCertificationApproveService;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
@@ -40,6 +42,9 @@ public class EnterpriseCertificationApproveController {
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CityService cityService;
|
|
|
+
|
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
|
public MessageResult<Company> create(@RequestAttribute String subject){
|
|
|
@@ -55,15 +60,26 @@ public class EnterpriseCertificationApproveController {
|
|
|
company.setEnterpriseCertificationApproveId(enterpriseCertificationApprove.getId());
|
|
|
|
|
|
if(StringUtils.isNotEmpty(company.getArea())){
|
|
|
- JSONObject jsonObject = JSONObject.fromObject(company.getArea());
|
|
|
+ String area = company.getArea();
|
|
|
+
|
|
|
+ City zone = cityService.get(Integer.parseInt(area));
|
|
|
+
|
|
|
+ if(zone!=null){
|
|
|
+ company.setZone(zone.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ City city = cityService.get(zone.getPid());
|
|
|
+
|
|
|
+ if(city!=null){
|
|
|
+ company.setCity(city.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ City province = cityService.get(city.getPid());
|
|
|
|
|
|
- int province = Integer.parseInt(jsonObject.get("province").toString()) ;
|
|
|
- int city = Integer.parseInt(jsonObject.get("city").toString()) ;
|
|
|
- int zone = Integer.parseInt(jsonObject.get("zone").toString()) ;
|
|
|
+ if(province!=null){
|
|
|
+ company.setProvince(province.getId());
|
|
|
+ }
|
|
|
|
|
|
- company.setProvince(province);
|
|
|
- company.setCity(city);
|
|
|
- company.setZone(zone);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -87,12 +103,12 @@ public class EnterpriseCertificationApproveController {
|
|
|
company.setScale(dto.getScale());
|
|
|
company.setIndustry(dto.getIndustry());
|
|
|
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("province",dto.getProvince());
|
|
|
- jsonObject.put("city",dto.getCity());
|
|
|
- jsonObject.put("zone",dto.getZone());
|
|
|
+// JSONObject jsonObject = new JSONObject();
|
|
|
+// jsonObject.put("province",dto.getProvince());
|
|
|
+// jsonObject.put("city",dto.getCity());
|
|
|
+// jsonObject.put("zone",dto.getZone());
|
|
|
|
|
|
- company.setArea(jsonObject.toString());
|
|
|
+ company.setArea(dto.getZone().toString());
|
|
|
company.setAddress(dto.getAddress());
|
|
|
company.setTel(dto.getTel());
|
|
|
company.setCreditCode(dto.getCreditCode());
|