| | |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.doc.annotation.*; |
| | | import com.java110.dto.account.AccountDto; |
| | | import com.java110.dto.integralConfig.IntegralConfigDto; |
| | | import com.java110.dto.integral.IntegralConfigDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.acct.IAccountInnerServiceSMO; |
| | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | |
| | | String createUserId = context.getReqHeaders().get("user-id"); |
| | | |
| | | //向积分账户中充值积分 |
| | | AccountDto accountDto = new AccountDto(); |
| | | accountDto.setLink(reqJson.getString("link")); |
| | |
| | | throw new CmdException("扣款失败"); |
| | | } |
| | | |
| | | doGiftIntegral(accountDtos.get(0), reqJson); |
| | | doGiftIntegral(accountDtos.get(0), reqJson,createUserId); |
| | | |
| | | |
| | | } |
| | |
| | | accountPo.setAcctId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_acctId)); |
| | | accountPo.setObjId(reqJson.getString("objId")); |
| | | accountPo.setObjType(AccountDto.OBJ_TYPE_PERSON); |
| | | accountPo.setAcctType(AccountDto.ACCT_TYPE_CASH); |
| | | accountPo.setAcctType(AccountDto.ACCT_TYPE_INTEGRAL); |
| | | accountPo.setAcctName(acctName); |
| | | accountPo.setPartId(reqJson.getString("communityId")); |
| | | accountPo.setLink(reqJson.getString("link")); |
| | |
| | | reqJson.put("objId", "-1"); |
| | | return userDtos.get(0).getName(); |
| | | } |
| | | return ""; |
| | | throw new CmdException("业主不存在"); |
| | | } |
| | | |
| | | private void doGiftIntegral(AccountDto accountDto, JSONObject reqJson) { |
| | | private void doGiftIntegral(AccountDto accountDto, JSONObject reqJson,String createUserId) { |
| | | |
| | | IntegralConfigDto integralConfigDto = new IntegralConfigDto(); |
| | | integralConfigDto.setCommunityId(reqJson.getString("communityId")); |
| | |
| | | throw new CmdException("积分规则不存在,请添加"); |
| | | } |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setTel(reqJson.getString("link")); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | Assert.listOnlyOne(userDtos, "用户不存在"); |
| | | // UserDto userDto = new UserDto(); |
| | | // userDto.setTel(reqJson.getString("link")); |
| | | // List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | // Assert.listOnlyOne(userDtos, "用户不存在"); |
| | | |
| | | OwnerDto tmpOwnerDto = new OwnerDto(); |
| | | tmpOwnerDto.setLink(reqJson.getString("link")); |
| | | tmpOwnerDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(tmpOwnerDto); |
| | | if (ownerDtos != null && ownerDtos.size() > 0) { |
| | | return; |
| | | } |
| | | //先加明细 |
| | | IntegralGiftDetailPo integralGiftDetailPo = new IntegralGiftDetailPo(); |
| | | integralGiftDetailPo.setCommunityId(reqJson.getString("communityId")); |
| | |
| | | integralGiftDetailPo.setRuleId("-1"); |
| | | integralGiftDetailPo.setRuleName(reqJson.getString("ruleName")); |
| | | integralGiftDetailPo.setQuantity(reqJson.getString("quantity")); |
| | | integralGiftDetailPo.setCreateUserId(userDtos.get(0).getUserId()); |
| | | integralGiftDetailPo.setUserName(userDtos.get(0).getName()); |
| | | integralGiftDetailPo.setTel(userDtos.get(0).getTel()); |
| | | integralGiftDetailPo.setCreateUserId(createUserId); |
| | | integralGiftDetailPo.setUserName(ownerDtos.get(0).getName()); |
| | | integralGiftDetailPo.setTel(ownerDtos.get(0).getLink()); |
| | | integralGiftDetailV1InnerServiceSMOImpl.saveIntegralGiftDetail(integralGiftDetailPo); |
| | | |
| | | } |