ソースを参照

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

java110 4 年 前
コミット
e613124398

+ 17 - 12
service-acct/src/main/java/com/java110/acct/api/AccountWithdrawalApplyApi.java

@@ -47,19 +47,16 @@ public class AccountWithdrawalApplyApi {
 
     /**
      * 微信修改消息模板
-     * @serviceCode /accountWithdrawalApply/updateAccountWithdrawalApply
-     * @path /app/accountWithdrawalApply/updateAccountWithdrawalApply
+     * @serviceCode /accountWithdrawalApply/upAccountWithdrawalApply
+     * @path /app/accountWithdrawalApply/upAccountWithdrawalApply
      * @param reqJson
      * @return
      */
-    @RequestMapping(value = "/updateAccountWithdrawalApply", method = RequestMethod.POST)
+    @RequestMapping(value = "/upAccountWithdrawalApply", method = RequestMethod.POST)
     public ResponseEntity<String> updateAccountWithdrawalApply(@RequestBody JSONObject reqJson) {
 
         Assert.hasKeyAndValue(reqJson, "acctId", "请求报文中未包含acctId");
         Assert.hasKeyAndValue(reqJson, "amount", "请求报文中未包含amount");
-        Assert.hasKeyAndValue(reqJson, "applyUserId", "请求报文中未包含applyUserId");
-        Assert.hasKeyAndValue(reqJson, "applyUserName", "请求报文中未包含applyUserName");
-        Assert.hasKeyAndValue(reqJson, "applyUserTel", "请求报文中未包含applyUserTel");
         Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含state");
         Assert.hasKeyAndValue(reqJson, "applyId", "applyId不能为空");
 
@@ -77,7 +74,7 @@ public class AccountWithdrawalApplyApi {
      */
     @RequestMapping(value = "/deleteAccountWithdrawalApply", method = RequestMethod.POST)
     public ResponseEntity<String> deleteAccountWithdrawalApply(@RequestBody JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+        Assert.hasKeyAndValue(reqJson, "acctId", "账户ID不能为空");
 
         Assert.hasKeyAndValue(reqJson, "applyId", "applyId不能为空");
 
@@ -88,17 +85,25 @@ public class AccountWithdrawalApplyApi {
 
     /**
      * 微信删除消息模板
-     * @serviceCode /accountWithdrawalApply/queryAccountWithdrawalApply
-     * @path /app/accountWithdrawalApply/queryAccountWithdrawalApply
-     * @param
+     * @serviceCode /accountWithdrawalApply/listAccountWithdrawalApply
+     * @path /app/accountWithdrawalApply/listAccountWithdrawalApply
+     * @param applyUserName: '',
+     *                     applyUserTel: '',
+     *                     state: '486'
      * @return
      */
-    @RequestMapping(value = "/queryAccountWithdrawalApply", method = RequestMethod.GET)
+    @RequestMapping(value = "/listAccountWithdrawalApply", method = RequestMethod.GET)
     public ResponseEntity<String> queryAccountWithdrawalApply(@RequestParam(value = "page") int page,
-                                                      @RequestParam(value = "row") int row) {
+                                                              @RequestParam(value = "row") int row,
+                                                              @RequestParam(value = "applyUserName",required = false) String applyUserName,
+                                                              @RequestParam(value = "applyUserTel",required = false) String applyUserTel,
+                                                              @RequestParam(value = "state",required = false) String state) {
         AccountWithdrawalApplyDto accountWithdrawalApplyDto = new AccountWithdrawalApplyDto();
         accountWithdrawalApplyDto.setPage(page);
         accountWithdrawalApplyDto.setRow(row);
+        accountWithdrawalApplyDto.setApplyUserName(applyUserName);
+        accountWithdrawalApplyDto.setApplyUserTel(applyUserTel);
+        accountWithdrawalApplyDto.setState(state);
         return getAccountWithdrawalApplyBMOImpl.get(accountWithdrawalApplyDto);
     }
 }

+ 21 - 4
service-acct/src/main/java/com/java110/acct/bmo/accountWithdrawalApply/impl/SaveAccountWithdrawalApplyBMOImpl.java

@@ -4,9 +4,12 @@ import com.java110.acct.bmo.accountWithdrawalApply.ISaveAccountWithdrawalApplyBM
 import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.factory.GenerateCodeFactory;
 
+import com.java110.dto.accountDetail.AccountDetailDto;
 import com.java110.dto.user.UserDto;
+import com.java110.intf.acct.IAccountInnerServiceSMO;
 import com.java110.intf.acct.IAccountWithdrawalApplyInnerServiceSMO;
 import com.java110.intf.user.IUserInnerServiceSMO;
+import com.java110.po.accountDetail.AccountDetailPo;
 import com.java110.po.accountWithdrawalApply.AccountWithdrawalApplyPo;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +24,8 @@ public class SaveAccountWithdrawalApplyBMOImpl implements ISaveAccountWithdrawal
     private IAccountWithdrawalApplyInnerServiceSMO accountWithdrawalApplyInnerServiceSMOImpl;
     @Autowired
     private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
     /**
      * 添加小区信息
      *
@@ -40,13 +45,25 @@ public class SaveAccountWithdrawalApplyBMOImpl implements ISaveAccountWithdrawal
             accountWithdrawalApplyPo.setApplyUserName( userDtoList.get( 0 ).getUserName() );
             accountWithdrawalApplyPo.setApplyUserTel( userDtoList.get( 0 ).getTel() );
             accountWithdrawalApplyPo.setApplyUserId( userDtoList.get( 0 ).getUserId() );
-
             accountWithdrawalApplyPo.setApplyId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyId));
-            int flag = accountWithdrawalApplyInnerServiceSMOImpl.saveAccountWithdrawalApply(accountWithdrawalApplyPo);
 
-            if (flag > 0) {
-                return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+            AccountDetailPo accountDetailPo = new AccountDetailPo();
+            accountDetailPo.setAcctId( accountWithdrawalApplyPo.getAcctId() );
+            accountDetailPo.setAmount( accountWithdrawalApplyPo.getAmount() );
+            accountDetailPo.setRemark( accountWithdrawalApplyPo.getContext() );
+            accountDetailPo.setObjId( accountWithdrawalApplyPo.getApplyId() );
+            //调用扣款接口进行扣款
+            int acctflag = accountInnerServiceSMOImpl.withholdAccount( accountDetailPo );
+            if (acctflag < 1) {
+                return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "扣款失败");
             }
+            //报存提现信息
+            int flag = accountWithdrawalApplyInnerServiceSMOImpl.saveAccountWithdrawalApply(accountWithdrawalApplyPo);
+            if (flag < 1) {
+                return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存提现失败");
+            }
+
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "提现成功");
         }