浏览代码

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

java110 4 年之前
父节点
当前提交
3c1579e284

+ 3 - 7
service-acct/src/main/java/com/java110/acct/api/AccountWithdrawalApplyApi.java

@@ -35,18 +35,14 @@ public class AccountWithdrawalApplyApi {
      * @return
      */
     @RequestMapping(value = "/saveAccountWithdrawalApply", method = RequestMethod.POST)
-    public ResponseEntity<String> saveAccountWithdrawalApply(@RequestBody JSONObject reqJson) {
+    public ResponseEntity<String> saveAccountWithdrawalApply(@RequestBody JSONObject reqJson,
+                                                             @RequestHeader(value="user-id") String userId ) {
 
         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");
-
 
         AccountWithdrawalApplyPo accountWithdrawalApplyPo = BeanConvertUtil.covertBean(reqJson, AccountWithdrawalApplyPo.class);
-        return saveAccountWithdrawalApplyBMOImpl.save(accountWithdrawalApplyPo);
+        return saveAccountWithdrawalApplyBMOImpl.save(accountWithdrawalApplyPo,userId);
     }
 
     /**

+ 1 - 1
service-acct/src/main/java/com/java110/acct/bmo/accountWithdrawalApply/ISaveAccountWithdrawalApplyBMO.java

@@ -11,7 +11,7 @@ public interface ISaveAccountWithdrawalApplyBMO {
      * @param accountWithdrawalApplyPo
      * @return
      */
-    ResponseEntity<String> save(AccountWithdrawalApplyPo accountWithdrawalApplyPo);
+    ResponseEntity<String> save(AccountWithdrawalApplyPo accountWithdrawalApplyPo,String userId);
 
 
 }

+ 23 - 7
service-acct/src/main/java/com/java110/acct/bmo/accountWithdrawalApply/impl/SaveAccountWithdrawalApplyBMOImpl.java

@@ -4,7 +4,9 @@ import com.java110.acct.bmo.accountWithdrawalApply.ISaveAccountWithdrawalApplyBM
 import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.factory.GenerateCodeFactory;
 
+import com.java110.dto.user.UserDto;
 import com.java110.intf.acct.IAccountWithdrawalApplyInnerServiceSMO;
+import com.java110.intf.user.IUserInnerServiceSMO;
 import com.java110.po.accountWithdrawalApply.AccountWithdrawalApplyPo;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +19,8 @@ public class SaveAccountWithdrawalApplyBMOImpl implements ISaveAccountWithdrawal
 
     @Autowired
     private IAccountWithdrawalApplyInnerServiceSMO accountWithdrawalApplyInnerServiceSMOImpl;
-
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
     /**
      * 添加小区信息
      *
@@ -25,16 +28,29 @@ public class SaveAccountWithdrawalApplyBMOImpl implements ISaveAccountWithdrawal
      * @return 订单服务能够接受的报文
      */
     @Java110Transactional
-    public ResponseEntity<String> save(AccountWithdrawalApplyPo accountWithdrawalApplyPo) {
+    public ResponseEntity<String> save(AccountWithdrawalApplyPo accountWithdrawalApplyPo,String userId) {
+
 
-        accountWithdrawalApplyPo.setApplyId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyId));
-        int flag = accountWithdrawalApplyInnerServiceSMOImpl.saveAccountWithdrawalApply(accountWithdrawalApplyPo);
+        UserDto userDto = new UserDto();
+        userDto.setUserId( userId );
+        //根据登录用户查询用户详细信息
+        List<UserDto> userDtoList = userInnerServiceSMOImpl.getUsers( userDto );
+        if(null != userDtoList && userDtoList.size() > 0){
 
-        if (flag > 0) {
-        return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+            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, "保存成功");
+            }
         }
 
-        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败,检查用户信息是否完整");
     }
 
 }