| | |
| | | import com.java110.po.owner.OwnerRoomRelPo; |
| | | import com.java110.po.user.UserPo; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.constant.UserLevelConstant; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.lock.DistributedLock; |
| | |
| | | url = "http://{ip}:{port}/app/owner.saveOwner", |
| | | resource = "userDoc", |
| | | author = "吴学文", |
| | | serviceCode = "owner.saveOwner" |
| | | serviceCode = "owner.saveOwner", |
| | | seq = 9 |
| | | ) |
| | | |
| | | @Java110ParamsDoc(params = { |
| | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IAccountInnerServiceSMO accountInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | |
| | | smsDto.setTel(reqJson.getString("link")); |
| | | smsDto.setCode(reqJson.getString("msgCode")); |
| | | smsDto = smsInnerServiceSMOImpl.validateCode(smsDto); |
| | | if (!smsDto.isSuccess() && "ON".equals(MappingCache.getValue(SendSmsFactory.SMS_SEND_SWITCH))) { |
| | | if (!smsDto.isSuccess() && "ON".equals(MappingCache.getValue(MappingConstant.SMS_DOMAIN,SendSmsFactory.SMS_SEND_SWITCH))) { |
| | | throw new IllegalArgumentException(smsDto.getMsg()); |
| | | } |
| | | } |
| | |
| | | } |
| | | //生成memberId |
| | | generateMemberId(reqJson); |
| | | |
| | | JSONObject businessOwner = new JSONObject(); |
| | | businessOwner.putAll(reqJson); |
| | | businessOwner.put("state", "2000"); |
| | |
| | | reqJson.getString("memberId"), |
| | | reqJson.getString("communityId"), |
| | | "10000"); |
| | | |
| | | dealOwnerAttr(reqJson, cmdDataFlowContext); |
| | | |
| | | //业主 开通 现金账户,不然配合商城 会存在bug |
| | | addAccountDto(ownerPo.getMemberId(),ownerPo.getCommunityId()); |
| | | |
| | | |
| | | String autoUser = MappingCache.getValue("OWNER", "AUTO_GENERATOR_OWNER_USER"); |
| | | String autoUser = MappingCache.getValue(MappingConstant.DOMAIN_SYSTEM_SWITCH, "AUTO_GENERATOR_OWNER_USER"); |
| | | |
| | | if (!"ON".equals(autoUser)) { |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | private void addAccountDto(String ownerId,String communityId) { |
| | | if (StringUtil.isEmpty(ownerId)) { |
| | | return ; |
| | | } |
| | | //开始锁代码 |
| | | String requestId = DistributedLock.getLockUUID(); |
| | | String key = this.getClass().getSimpleName() + "AddCountDto" +ownerId; |
| | | try { |
| | | DistributedLock.waitGetDistributedLock(key, requestId); |
| | | AccountPo accountPo = new AccountPo(); |
| | | accountPo.setAmount("0"); |
| | | accountPo.setAcctId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_acctId)); |
| | | accountPo.setObjId(ownerId); |
| | | accountPo.setObjType(AccountDto.OBJ_TYPE_PERSON); |
| | | accountPo.setAcctType(AccountDto.ACCT_TYPE_CASH); |
| | | OwnerDto tmpOwnerDto = new OwnerDto(); |
| | | tmpOwnerDto.setMemberId(ownerId); |
| | | tmpOwnerDto.setCommunityId(communityId); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(tmpOwnerDto); |
| | | Assert.listOnlyOne(ownerDtos, "业主不存在"); |
| | | accountPo.setAcctName(ownerDtos.get(0).getName()); |
| | | accountPo.setPartId(communityId); |
| | | accountInnerServiceSMOImpl.saveAccount(accountPo); |
| | | } finally { |
| | | DistributedLock.releaseDistributedLock(requestId, key); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成小区楼ID |