From d7d9b601b2e4fdb663375993e2cfbdbd363df421 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期二, 11 七月 2023 22:17:37 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity
---
service-user/src/main/java/com/java110/user/cmd/owner/EditOwnerCmd.java | 79 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 76 insertions(+), 3 deletions(-)
diff --git a/service-user/src/main/java/com/java110/user/cmd/owner/EditOwnerCmd.java b/service-user/src/main/java/com/java110/user/cmd/owner/EditOwnerCmd.java
index 765a6eb..e4d806d 100644
--- a/service-user/src/main/java/com/java110/user/cmd/owner/EditOwnerCmd.java
+++ b/service-user/src/main/java/com/java110/user/cmd/owner/EditOwnerCmd.java
@@ -8,10 +8,13 @@
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.doc.annotation.*;
+import com.java110.dto.account.AccountDto;
import com.java110.dto.file.FileDto;
import com.java110.dto.file.FileRelDto;
import com.java110.dto.owner.OwnerAppUserDto;
import com.java110.dto.owner.OwnerDto;
+import com.java110.intf.acct.IAccountInnerServiceSMO;
import com.java110.intf.common.IFileInnerServiceSMO;
import com.java110.intf.common.IFileRelInnerServiceSMO;
import com.java110.intf.user.IOwnerV1InnerServiceSMO;
@@ -19,6 +22,7 @@
import com.java110.intf.user.IOwnerAppUserV1InnerServiceSMO;
import com.java110.intf.user.IOwnerAttrInnerServiceSMO;
import com.java110.intf.user.IOwnerInnerServiceSMO;
+import com.java110.po.account.AccountPo;
import com.java110.po.file.FileRelPo;
import com.java110.po.owner.OwnerAppUserPo;
import com.java110.po.owner.OwnerAttrPo;
@@ -33,6 +37,52 @@
import java.util.List;
+@Java110CmdDoc(title = "淇敼涓氫富",
+ description = "绗笁鏂圭郴缁燂紝姣斿鎷涘晢绯荤粺鍚屾涓氫富淇℃伅",
+ httpMethod = "post",
+ url = "http://{ip}:{port}/app/owner.editOwner",
+ resource = "userDoc",
+ author = "鍚村鏂�",
+ serviceCode = "owner.editOwner",
+ seq = 10
+)
+
+@Java110ParamsDoc(params = {
+ @Java110ParamDoc(name = "communityId", length = 30, remark = "灏忓尯ID"),
+ @Java110ParamDoc(name = "name", length = 64, remark = "涓氫富鍚嶇О"),
+ @Java110ParamDoc(name = "link", length = 11, remark = "涓氫富鎵嬫満鍙�"),
+ @Java110ParamDoc(name = "idCard", length = 30, remark = "涓氫富韬唤璇佸彿"),
+ @Java110ParamDoc(name = "address", length = 512, remark = "鍦板潃"),
+ @Java110ParamDoc(name = "sex", length = 12, remark = "鎬у埆 鐢� 1 濂� 0"),
+ @Java110ParamDoc(name = "ownerTypeCd", length = 12, remark = "涓氫富绫诲瀷 1001 涓氫富 2002 瀹跺涵鎴愬憳 瀹跺涵鎴愬憳 闇�瑕佷紶涓氫富鐨刼wnerId"),
+ @Java110ParamDoc(name = "remark", length = 512, remark = "澶囨敞"),
+ @Java110ParamDoc(name = "memberId", length = 30, remark = "涓氫富ID"),
+ @Java110ParamDoc(name = "ownerPhoto", length = -1, remark = "涓氫富浜鸿劯 鐢ㄤ簬鍚屾闂ㄧ 浜鸿劯寮�闂�"),
+})
+
+@Java110ResponseDoc(
+ params = {
+ @Java110ParamDoc(name = "code", type = "int", length = 11, defaultValue = "0", remark = "杩斿洖缂栧彿锛�0 鎴愬姛 鍏朵粬澶辫触"),
+ @Java110ParamDoc(name = "msg", type = "String", length = 250, defaultValue = "鎴愬姛", remark = "鎻忚堪"),
+ }
+)
+
+@Java110ExampleDoc(
+ reqBody="{\n" +
+ "\t\"name\": \"鐜嬬帇\",\n" +
+ "\t\"age\": \"\",\n" +
+ "\t\"link\": \"18909718888\",\n" +
+ "\t\"address\": \"寮犱笁\",\n" +
+ "\t\"sex\": \"0\",\n" +
+ "\t\"ownerTypeCd\": \"1001\",\n" +
+ "\t\"remark\": \"\",\n" +
+ "\t\"memberId\": 123123123,\n" +
+ "\t\"ownerPhoto\": \"\",\n" +
+ "\t\"idCard\": \"\",\n" +
+ "\t\"communityId\": \"2022121921870161\"\n" +
+ "}",
+ resBody="{\"code\":0,\"msg\":\"鎴愬姛\"}"
+)
@Java110Cmd(serviceCode = "owner.editOwner")
public class EditOwnerCmd extends Cmd {
@@ -56,6 +106,9 @@
@Autowired
private IFileInnerServiceSMO fileInnerServiceSMOImpl;
+
+ @Autowired
+ private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
@Override
public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
@@ -145,9 +198,13 @@
if (reqJson.containsKey("ownerPhoto") && !StringUtils.isEmpty(reqJson.getString("ownerPhoto"))) {
editOwnerPhoto(reqJson);
}
+ //todo 淇敼 涓氫富淇℃伅
editOwner(reqJson);
+
+
+
JSONArray attrs = reqJson.getJSONArray("attrs");
- if (attrs.size() < 1) {
+ if (attrs == null || attrs.size() < 1) {
return;
}
JSONObject attr = null;
@@ -156,7 +213,7 @@
attr = attrs.getJSONObject(attrIndex);
attr.put("memberId", reqJson.getString("memberId"));
attr.put("communityId", reqJson.getString("communityId"));
- if (!attr.containsKey("attrId") || attr.getString("attrId").startsWith("-") || StringUtil.isEmpty(attr.getString("attrId"))) {
+ if (!attr.containsKey("attrId") || StringUtil.isEmpty(attr.getString("attrId")) || attr.getString("attrId").startsWith("-")) {
attr.put("attrId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
OwnerAttrPo ownerAttrPo = BeanConvertUtil.covertBean(attr, OwnerAttrPo.class);
flag = ownerAttrInnerServiceSMOImpl.saveOwnerAttr(ownerAttrPo);
@@ -200,7 +257,7 @@
OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
ownerAppUserDto.setMemberId(paramInJson.getString("ownerId"));
- //鏌ヨapp鐢ㄦ埛琛�
+ //todo 鏌ヨapp鐢ㄦ埛琛�
List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) {
for (OwnerAppUserDto ownerAppUser : ownerAppUserDtos) {
@@ -213,6 +270,22 @@
}
}
}
+ //todo 鍒ゆ柇涓氫富鎵嬫満鍙峰拰璐︽埛鎵嬫満鍙锋槸鍚︾浉鍚岋紝涓嶇浉鍚屼慨鏀硅处鎴锋墜鏈哄彿
+ AccountDto accountDto = new AccountDto();
+ accountDto.setObjId(ownerDtos.get(0).getMemberId());
+ accountDto.setPartId(ownerDtos.get(0).getCommunityId());
+ List<AccountDto> accountDtos = accountInnerServiceSMOImpl.queryAccounts(accountDto);
+ if(accountDtos == null || accountDtos.size()< 1){
+ return ;
+ }
+ if(accountDtos.get(0).getLink().equals(ownerDtos.get(0).getLink())){
+ return;
+ }
+
+ AccountPo accountPo = new AccountPo();
+ accountPo.setLink(ownerDtos.get(0).getLink());
+ accountPo.setAcctId(accountDtos.get(0).getAcctId());
+ accountInnerServiceSMOImpl.updateAccount(accountPo);
}
public void editOwnerPhoto(JSONObject paramInJson) {
--
Gitblit v1.8.0