| | |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.owner.OwnerAppUserDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.intf.common.ISmsInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.store.IStoreInnerServiceSMO; |
| | | import com.java110.intf.user.*; |
| | | import com.java110.po.owner.OwnerAppUserPo; |
| | | import com.java110.utils.exception.CmdException; |
| | |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | * 服务注册功能迁移 |
| | | */ |
| | | @Java110Cmd(serviceCode = "owner.ownerCommunity") |
| | | public class OwnerCommunityCmd extends AbstractServiceCmdListener { |
| | | public class OwnerCommunityCmd extends Cmd { |
| | | private final static Logger logger = LoggerFactory.getLogger(OwnerCommunityCmd.class); |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "link", "未包含联系电话"); |
| | | // Assert.hasKeyAndValue(reqJson, "link", "未包含联系电话"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setLink(reqJson.getString("link")); |
| | | if (reqJson.containsKey("ownerId")) { |
| | | ownerDto.setOwnerId(reqJson.getString("ownerId")); |
| | | } |
| | | if(reqJson.containsKey("link")){ |
| | | ownerDto.setLink(reqJson.getString("link")); |
| | | } |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | |
| | | if (ownerDtos == null || ownerDtos.size() < 1) { |
| | |
| | | communityDto.setState("1100"); |
| | | communityDto.setCommunityIds(communityIds.toArray(new String[communityIds.size()])); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | if(communityDtos == null || communityDtos.size()<1){ |
| | | if (communityDtos == null || communityDtos.size() < 1) { |
| | | cmdDataFlowContext.setResponseEntity(ResultVo.success()); |
| | | return ; |
| | | return; |
| | | } |
| | | for (OwnerDto tmpOwnerDto : ownerDtos) { |
| | | for (CommunityDto tmpCommunityDto : communityDtos) { |
| | |
| | | continue; |
| | | } |
| | | tmpOwnerDto.setCommunityName(tmpCommunityDto.getName()); |
| | | tmpOwnerDto.setsCommunityTel(tmpCommunityDto.getTel()); |
| | | tmpOwnerDto.setCommunityQrCode(tmpCommunityDto.getQrCode()); |
| | | } |
| | | } |
| | | |
| | |
| | | private void addOwnerAppUser(OwnerDto ownerDto, OwnerAppUserDto ownerAppUserDto) { |
| | | |
| | | OwnerAppUserPo ownerAppUserPo = BeanConvertUtil.covertBean(ownerAppUserDto, OwnerAppUserPo.class); |
| | | //状态类型,10000 审核中,12000 审核成功,13000 审核失败 |
| | | //状态类型,10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败 |
| | | ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId)); |
| | | ownerAppUserPo.setMemberId(ownerDto.getMemberId()); |
| | | ownerAppUserPo.setCommunityName(ownerDto.getCommunityName()); |
| | | ownerAppUserPo.setCommunityId(ownerDto.getCommunityId()); |
| | | ownerAppUserPo.setAppUserName(ownerDto.getName()); |
| | | ownerAppUserPo.setIdCard(ownerDto.getIdCard()); |
| | | ownerAppUserPo.setOwnerTypeCd(ownerDto.getOwnerTypeCd()); |
| | | int flag = ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("添加用户业主关系失败"); |