From 2e5800855a7fd8c81acaf5989782bf61aaf57c30 Mon Sep 17 00:00:00 2001
From: shiyj1101 <1098226878@qq.com>
Date: 星期三, 16 六月 2021 16:44:56 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 service-acct/src/main/java/com/java110/acct/api/AccountApi.java |   62 +++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/service-acct/src/main/java/com/java110/acct/api/AccountApi.java b/service-acct/src/main/java/com/java110/acct/api/AccountApi.java
index 085e4f5..2182c13 100644
--- a/service-acct/src/main/java/com/java110/acct/api/AccountApi.java
+++ b/service-acct/src/main/java/com/java110/acct/api/AccountApi.java
@@ -1,8 +1,14 @@
 package com.java110.acct.api;
 
+import com.alibaba.fastjson.JSONObject;
 import com.java110.acct.bmo.account.IGetAccountBMO;
+import com.java110.acct.bmo.account.IOwnerPrestoreAccountBMO;
+import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.account.AccountDto;
 import com.java110.dto.accountDetail.AccountDetailDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.po.accountDetail.AccountDetailPo;
+import com.java110.utils.util.Assert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
@@ -22,6 +28,9 @@
 
     @Autowired
     private IGetAccountBMO getAccountBMOImpl;
+
+    @Autowired
+    private IOwnerPrestoreAccountBMO ownerPrestoreAccountBMOImpl;
 
     /**
      * 寰俊鍒犻櫎娑堟伅妯℃澘
@@ -43,6 +52,38 @@
     }
 
     /**
+     * 鏌ヨ涓氫富璐︽埛
+     *
+     * @param communityId 灏忓尯ID
+     * @return
+     * @serviceCode /account/queryOwnerAccount
+     * @path /app/account/queryOwnerAccount
+     */
+    @RequestMapping(value = "/queryOwnerAccount", method = RequestMethod.GET)
+    public ResponseEntity<String> queryOwnerAccount(
+            @RequestParam(value = "communityId") String communityId,
+            @RequestParam(value = "ownerId",required = false) String ownerId,
+            @RequestParam(value = "ownerName",required = false) String ownerName,
+            @RequestParam(value = "tel",required = false) String tel,
+            @RequestParam(value = "idCard",required = false) String idCard,
+            @RequestParam(value = "page") int page,
+            @RequestParam(value = "row") int row) {
+        AccountDto accountDto = new AccountDto();
+        accountDto.setPage(page);
+        accountDto.setRow(row);
+        accountDto.setObjId(ownerId);
+        accountDto.setObjType(AccountDto.OBJ_TYPE_PERSON);
+        accountDto.setAcctName(ownerName);
+        accountDto.setPartId(communityId);
+        OwnerDto ownerDto = new OwnerDto();
+        ownerDto.setOwnerId(ownerId);
+        ownerDto.setCommunityId(communityId);
+        ownerDto.setLink(tel);
+        ownerDto.setIdCard(idCard);
+        return getAccountBMOImpl.queryOwnerAccount(accountDto,ownerDto);
+    }
+
+    /**
      * 鏌ヨ璐︽埛鏄庣粏
      *
      * @param storeId 灏忓尯ID
@@ -62,4 +103,25 @@
         accountDto.setAcctId(acctId);
         return getAccountBMOImpl.getDetail(accountDto);
     }
+
+    /**
+     * 涓氫富璐︽埛棰勫瓨
+     *
+     * @param reqJson 灏忓尯ID
+     * @return
+     * @serviceCode /account/ownerPrestoreAccount
+     * @path /app/account/ownerPrestoreAccount
+     */
+    @RequestMapping(value = "/ownerPrestoreAccount", method = RequestMethod.POST)
+    public ResponseEntity<String> queryAccountDetail(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "灏忓尯ID涓嶈兘涓虹┖");
+        Assert.hasKeyAndValue(reqJson, "ownerId", "涓氫富涓嶈兘涓虹┖");
+        Assert.hasKeyAndValue(reqJson, "amount", "閲戦涓嶈兘涓虹┖");
+
+        AccountDetailPo accountDetailPo = new AccountDetailPo();
+        accountDetailPo.setRemark(reqJson.getString("remark"));
+        accountDetailPo.setObjId(reqJson.getString("ownerId"));
+        accountDetailPo.setAmount(reqJson.getString("amount"));
+        return ownerPrestoreAccountBMOImpl.prestore(accountDetailPo,reqJson);
+    }
 }

--
Gitblit v1.8.0