|
|
@@ -2,6 +2,7 @@ package com.finikes.oc.estate.controller;
|
|
|
|
|
|
import com.finikes.oc.BaseDTO;
|
|
|
import com.finikes.oc.Passports;
|
|
|
+import com.finikes.oc.base.dao.PassportDAO;
|
|
|
import com.finikes.oc.base.entity.Passport;
|
|
|
import com.finikes.oc.estate.dao.HouseDAO;
|
|
|
import com.finikes.oc.management.dao.HouseRelationDAO;
|
|
|
@@ -25,12 +26,16 @@ public class HouseController {
|
|
|
@Autowired
|
|
|
private HouseRelationDAO houseRelationDAO;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PassportDAO passportDAO;
|
|
|
+
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/passport", method = RequestMethod.PUT)
|
|
|
public BaseDTO bind(@RequestBody Map<String, Object> map, HttpServletRequest request) {
|
|
|
String certificateNo = (String) map.get("certificateNo");
|
|
|
String certificatePhoto = (String) map.get("certificatePhoto");
|
|
|
String houseId = (String) map.get("houseId");
|
|
|
+ String name = (String) map.get("name");
|
|
|
Passport passport = Passports.getPassport(request);
|
|
|
if (passport == null) {
|
|
|
return new BaseDTO("104", "需要登录");
|
|
|
@@ -45,6 +50,9 @@ public class HouseController {
|
|
|
relation.setCertificateNo(certificateNo);
|
|
|
relation.setCertificateUrl(certificatePhoto);
|
|
|
houseRelationDAO.update(relation);
|
|
|
+ if(name != null && !"".equals(name)) {
|
|
|
+ passportDAO.updateName(passport.getId(), name);
|
|
|
+ }
|
|
|
return new BaseDTO();
|
|
|
}
|
|
|
}
|
|
|
@@ -56,6 +64,9 @@ public class HouseController {
|
|
|
relation.setCertificateNo(certificateNo);
|
|
|
relation.setCertificateUrl(certificatePhoto);
|
|
|
houseRelationDAO.insert(relation);
|
|
|
+ if(name != null && !"".equals(name)) {
|
|
|
+ passportDAO.updateName(passport.getId(), name);
|
|
|
+ }
|
|
|
return new BaseDTO();
|
|
|
}
|
|
|
|