|
@@ -17,16 +17,13 @@ import com.java110.dto.owner.OwnerDto;
|
|
|
import com.java110.intf.acct.IAccountInnerServiceSMO;
|
|
import com.java110.intf.acct.IAccountInnerServiceSMO;
|
|
|
import com.java110.intf.common.IFileInnerServiceSMO;
|
|
import com.java110.intf.common.IFileInnerServiceSMO;
|
|
|
import com.java110.intf.common.IFileRelInnerServiceSMO;
|
|
import com.java110.intf.common.IFileRelInnerServiceSMO;
|
|
|
-import com.java110.intf.user.IOwnerV1InnerServiceSMO;
|
|
|
|
|
-import com.java110.intf.user.IOwnerAppUserInnerServiceSMO;
|
|
|
|
|
-import com.java110.intf.user.IOwnerAppUserV1InnerServiceSMO;
|
|
|
|
|
-import com.java110.intf.user.IOwnerAttrInnerServiceSMO;
|
|
|
|
|
-import com.java110.intf.user.IOwnerInnerServiceSMO;
|
|
|
|
|
|
|
+import com.java110.intf.user.*;
|
|
|
import com.java110.po.account.AccountPo;
|
|
import com.java110.po.account.AccountPo;
|
|
|
import com.java110.po.file.FileRelPo;
|
|
import com.java110.po.file.FileRelPo;
|
|
|
import com.java110.po.owner.OwnerAppUserPo;
|
|
import com.java110.po.owner.OwnerAppUserPo;
|
|
|
import com.java110.po.owner.OwnerAttrPo;
|
|
import com.java110.po.owner.OwnerAttrPo;
|
|
|
import com.java110.po.owner.OwnerPo;
|
|
import com.java110.po.owner.OwnerPo;
|
|
|
|
|
+import com.java110.po.user.UserPo;
|
|
|
import com.java110.utils.cache.MappingCache;
|
|
import com.java110.utils.cache.MappingCache;
|
|
|
import com.java110.utils.exception.CmdException;
|
|
import com.java110.utils.exception.CmdException;
|
|
|
import com.java110.utils.util.Assert;
|
|
import com.java110.utils.util.Assert;
|
|
@@ -110,6 +107,9 @@ public class EditOwnerCmd extends Cmd {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
|
|
private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
|
|
public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
|
|
|
Assert.jsonObjectHaveKey(reqJson, "memberId", "请求报文中未包含ownerId");
|
|
Assert.jsonObjectHaveKey(reqJson, "memberId", "请求报文中未包含ownerId");
|
|
@@ -201,8 +201,6 @@ public class EditOwnerCmd extends Cmd {
|
|
|
//todo 修改 业主信息
|
|
//todo 修改 业主信息
|
|
|
editOwner(reqJson);
|
|
editOwner(reqJson);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
JSONArray attrs = reqJson.getJSONArray("attrs");
|
|
JSONArray attrs = reqJson.getJSONArray("attrs");
|
|
|
if (attrs == null || attrs.size() < 1) {
|
|
if (attrs == null || attrs.size() < 1) {
|
|
|
return;
|
|
return;
|
|
@@ -228,8 +226,14 @@ public class EditOwnerCmd extends Cmd {
|
|
|
throw new CmdException("修改业主属性失败");
|
|
throw new CmdException("修改业主属性失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //todo 如果 业主做了绑定则修改绑定的手机号
|
|
|
|
|
+ updateOwnerAppUser(reqJson);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
public void editOwner(JSONObject paramInJson) {
|
|
public void editOwner(JSONObject paramInJson) {
|
|
|
|
|
|
|
|
OwnerDto ownerDto = new OwnerDto();
|
|
OwnerDto ownerDto = new OwnerDto();
|
|
@@ -254,22 +258,7 @@ public class EditOwnerCmd extends Cmd {
|
|
|
if (flag < 1) {
|
|
if (flag < 1) {
|
|
|
throw new CmdException("修改业主失败");
|
|
throw new CmdException("修改业主失败");
|
|
|
}
|
|
}
|
|
|
- OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
|
|
|
|
|
- ownerAppUserDto.setMemberId(paramInJson.getString("ownerId"));
|
|
|
|
|
|
|
|
|
|
- //todo 查询app用户表
|
|
|
|
|
- List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
|
|
|
|
|
- if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) {
|
|
|
|
|
- for (OwnerAppUserDto ownerAppUser : ownerAppUserDtos) {
|
|
|
|
|
- OwnerAppUserPo ownerAppUserPo = BeanConvertUtil.covertBean(ownerAppUser, OwnerAppUserPo.class);
|
|
|
|
|
- ownerAppUserPo.setLink(paramInJson.getString("link"));
|
|
|
|
|
- ownerAppUserPo.setIdCard(paramInJson.getString("idCard"));
|
|
|
|
|
- flag = ownerAppUserV1InnerServiceSMOImpl.updateOwnerAppUser(ownerAppUserPo);
|
|
|
|
|
- if (flag < 1) {
|
|
|
|
|
- throw new CmdException("修改业主失败");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
//todo 判断业主手机号和账户手机号是否相同,不相同修改账户手机号
|
|
//todo 判断业主手机号和账户手机号是否相同,不相同修改账户手机号
|
|
|
AccountDto accountDto = new AccountDto();
|
|
AccountDto accountDto = new AccountDto();
|
|
|
accountDto.setObjId(ownerDtos.get(0).getMemberId());
|
|
accountDto.setObjId(ownerDtos.get(0).getMemberId());
|
|
@@ -332,4 +321,40 @@ public class EditOwnerCmd extends Cmd {
|
|
|
throw new CmdException("保存文件失败");
|
|
throw new CmdException("保存文件失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 如果 业主做了绑定则修改绑定的手机号
|
|
|
|
|
+ * @param reqJson
|
|
|
|
|
+ */
|
|
|
|
|
+ private void updateOwnerAppUser(JSONObject reqJson) {
|
|
|
|
|
+
|
|
|
|
|
+ OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
|
|
|
|
|
+ ownerAppUserDto.setMemberId(reqJson.getString("memberId"));
|
|
|
|
|
+
|
|
|
|
|
+ //todo 查询app用户表
|
|
|
|
|
+ List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
|
|
|
|
|
+ if (ownerAppUserDtos == null || ownerAppUserDtos.size() < 1) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ for (OwnerAppUserDto ownerAppUser : ownerAppUserDtos) {
|
|
|
|
|
+ OwnerAppUserPo ownerAppUserPo = BeanConvertUtil.covertBean(ownerAppUser, OwnerAppUserPo.class);
|
|
|
|
|
+ ownerAppUserPo.setLink(reqJson.getString("link"));
|
|
|
|
|
+ ownerAppUserV1InnerServiceSMOImpl.updateOwnerAppUser(ownerAppUserPo);
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtil.isEmpty(ownerAppUser.getUserId())) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ownerAppUser.getUserId().startsWith("-")) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ // todo 删除用户信息
|
|
|
|
|
+ UserPo userPo = new UserPo();
|
|
|
|
|
+ userPo.setUserId(ownerAppUserDtos.get(0).getUserId());
|
|
|
|
|
+ userPo.setTel(reqJson.getString("link"));
|
|
|
|
|
+ userV1InnerServiceSMOImpl.updateUser(userPo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|