From be1b426b7d765a546f4a26b60e80aa49a57079b9 Mon Sep 17 00:00:00 2001
From: xiaogang <905166056@qq.com>
Date: 星期六, 13 一月 2024 16:25:11 +0800
Subject: [PATCH] 1、优化采购模块数量不能为小数点问题2、新增客服巡查巡楼记录功能模块3、新增页面导出功能4、优化记录查询条件新增时间段查询条件5、其他界面性调整

---
 service-user/src/main/java/com/java110/user/cmd/owner/DeleteOwnerCmd.java |   60 +++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/service-user/src/main/java/com/java110/user/cmd/owner/DeleteOwnerCmd.java b/service-user/src/main/java/com/java110/user/cmd/owner/DeleteOwnerCmd.java
index 687ee23..a9e2390 100644
--- a/service-user/src/main/java/com/java110/user/cmd/owner/DeleteOwnerCmd.java
+++ b/service-user/src/main/java/com/java110/user/cmd/owner/DeleteOwnerCmd.java
@@ -1,6 +1,5 @@
 package com.java110.user.cmd.owner;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.annotation.Java110Transactional;
@@ -9,15 +8,19 @@
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.doc.annotation.*;
+import com.java110.dto.account.AccountDto;
+import com.java110.dto.owner.OwnerAttrDto;
 import com.java110.dto.room.RoomDto;
 import com.java110.dto.owner.OwnerAppUserDto;
 import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.owner.OwnerDto;
+import com.java110.intf.acct.IAccountInnerServiceSMO;
 import com.java110.intf.user.*;
 import com.java110.intf.community.IRoomInnerServiceSMO;
+import com.java110.po.account.AccountPo;
 import com.java110.po.owner.OwnerAppUserPo;
+import com.java110.po.owner.OwnerAttrPo;
 import com.java110.po.owner.OwnerPo;
-import com.java110.po.user.UserPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -32,8 +35,7 @@
         resource = "userDoc",
         author = "鍚村鏂�",
         serviceCode = "owner.deleteOwner",
-        seq = 11
-)
+        seq = 11)
 
 @Java110ParamsDoc(params = {
         @Java110ParamDoc(name = "communityId", length = 30, remark = "灏忓尯ID"),
@@ -76,14 +78,16 @@
     private IOwnerAppUserV1InnerServiceSMO ownerAppUserV1InnerServiceSMOImpl;
 
     @Autowired
-    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
+    private IOwnerAttrInnerServiceSMO ownerAttrInnerServiceSMOImpl;
+
+    @Autowired
+    private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
 
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
         Environment.isDevEnv();
         Assert.jsonObjectHaveKey(reqJson, "memberId", "璇锋眰鎶ユ枃涓湭鍖呭惈memberId");
         Assert.jsonObjectHaveKey(reqJson, "communityId", "璇锋眰鎶ユ枃涓湭鍖呭惈communityId");
-
         //todo 濡傛灉鏄笟涓�
         if (OwnerDto.OWNER_TYPE_CD_OWNER.equals(reqJson.getString("ownerTypeCd"))) {
             //ownerId 鍐欎负 memberId
@@ -104,42 +108,35 @@
             //灏忓尯妤兼坊鍔犲埌灏忓尯涓�
             //ownerBMOImpl.exitCommunityMember(reqJson, context);
         }
-
         if (!OwnerDto.OWNER_TYPE_CD_OWNER.equals(reqJson.getString("ownerTypeCd"))) { //涓嶆槸涓氫富鎴愬憳涓嶇
             return;
         }
-
         OwnerDto ownerDto = new OwnerDto();
         ownerDto.setOwnerId(reqJson.getString("memberId"));
         ownerDto.setCommunityId(reqJson.getString("communityId"));
         ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING});
-
         List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
-
         if (ownerDtos != null && ownerDtos.size() > 0) {
             throw new IllegalArgumentException("璇峰厛鍒犻櫎涓氫富涓嬬殑鎴愬憳");
         }
-
-
     }
 
     @Override
     @Java110Transactional
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
         JSONObject businessOwner = new JSONObject();
         businessOwner.put("memberId", reqJson.getString("memberId"));
         businessOwner.put("communityId", reqJson.getString("communityId"));
-
         OwnerPo ownerPo = BeanConvertUtil.covertBean(businessOwner, OwnerPo.class);
         int flag = ownerV1InnerServiceSMOImpl.deleteOwner(ownerPo);
-
         if (flag < 1) {
             throw new CmdException("鍒犻櫎澶辫触");
         }
 //        if (!OwnerDto.OWNER_TYPE_CD_OWNER.equals(reqJson.getString("ownerTypeCd"))) {
 //            return;
 //        }
+
+        //鍒犻櫎缁戝畾涓氫富淇℃伅
         OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto();
         ownerAppUserDto.setMemberId(reqJson.getString("memberId"));
         ownerAppUserDto.setCommunityId(reqJson.getString("communityId"));
@@ -148,19 +145,48 @@
         if (ownerAppUserDtos == null && ownerAppUserDtos.size() < 1) {
             return;
         }
-
         for (OwnerAppUserDto ownerAppUser : ownerAppUserDtos) {
             OwnerAppUserPo ownerAppUserPo = BeanConvertUtil.covertBean(ownerAppUser, OwnerAppUserPo.class);
             flag = ownerAppUserV1InnerServiceSMOImpl.deleteOwnerAppUser(ownerAppUserPo);
             if (flag < 1) {
                 throw new CmdException("鍒犻櫎澶辫触");
             }
-
             //todo 搴旇鍒犻櫎鐢ㄦ埛
 //            UserPo userPo = new UserPo();
 //            userPo.setUserId(ownerAppUser.getUserId());
 //            userV1InnerServiceSMOImpl.deleteUser(userPo);
         }
 
+        //鍒犻櫎涓氫富灞炴�ц〃淇℃伅
+        OwnerAttrDto ownerAttrDto = new OwnerAttrDto();
+        ownerAttrDto.setMemberId(reqJson.getString("memberId"));
+        List<OwnerAttrDto> ownerAttrDtos = ownerAttrInnerServiceSMOImpl.queryOwnerAttrs(ownerAttrDto);
+        if (ownerAttrDtos != null && ownerAttrDtos.size() > 0) {
+            for (OwnerAttrDto ownerAttr : ownerAttrDtos) {
+                OwnerAttrPo ownerAttrPo = new OwnerAttrPo();
+                ownerAttrPo.setAttrId(ownerAttr.getAttrId());
+                ownerAttrPo.setStatusCd("1"); //0 鍙敤锛�1 涓嶅彲鐢�
+                int i = ownerAttrInnerServiceSMOImpl.updateOwnerAttrInfoInstance(ownerAttrPo);
+                if (i < 1) {
+                    throw new CmdException("鍒犻櫎涓氫富灞炴�ц〃澶辫触");
+                }
+            }
+        }
+
+        //鍒犻櫎涓氫富璐︽埛淇℃伅
+        AccountDto accountDto = new AccountDto();
+        accountDto.setObjId(reqJson.getString("memberId"));
+        List<AccountDto> accountDtos = accountInnerServiceSMOImpl.queryAccounts(accountDto);
+        if (accountDtos != null && accountDtos.size() > 0) {
+            for (AccountDto account : accountDtos) {
+                AccountPo accountPo = new AccountPo();
+                accountPo.setAcctId(account.getAcctId());
+                accountPo.setStatusCd("1"); //0 鍙敤锛�1 涓嶅彲鐢�
+                int i = accountInnerServiceSMOImpl.updateAccount(accountPo);
+                if (i < 1) {
+                    throw new CmdException("鍒犻櫎涓氫富璐︽埛淇℃伅澶辫触");
+                }
+            }
+        }
     }
 }

--
Gitblit v1.8.0