| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.Environment; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.CommunityMemberDto; |
| | | import com.java110.intf.community.ICommunityMemberV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IMenuGroupCommunityV1InnerServiceSMO; |
| | | import com.java110.po.community.CommunityMemberPo; |
| | | import com.java110.po.menuGroupCommunity.MenuGroupCommunityPo; |
| | | import com.java110.po.store.StorePo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 类表述:删除 |
| | |
| | | @Autowired |
| | | private IStoreV1InnerServiceSMO storeV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICommunityMemberV1InnerServiceSMO communityMemberV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IMenuGroupCommunityV1InnerServiceSMO menuGroupCommunityV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Environment.isDevEnv(); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "storeId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "storeTypeCd", "storeTypeCd不能为空"); |
| | | |
| | |
| | | throw new CmdException("删除数据失败"); |
| | | } |
| | | |
| | | CommunityMemberDto communityMemberDto = new CommunityMemberDto(); |
| | | communityMemberDto.setMemberId(storePo.getStoreId()); |
| | | List<CommunityMemberDto> communityMemberDtos = communityMemberV1InnerServiceSMOImpl.queryCommunityMembers(communityMemberDto); |
| | | |
| | | if (communityMemberDtos == null || communityMemberDtos.size() < 1) { |
| | | cmdDataFlowContext.setResponseEntity(ResultVo.success()); |
| | | return; |
| | | } |
| | | |
| | | //释放小区 |
| | | CommunityMemberPo communityMemberPo = new CommunityMemberPo(); |
| | | communityMemberPo.setMemberId(storePo.getStoreId()); |
| | | flag = communityMemberV1InnerServiceSMOImpl.deleteCommunityMember(communityMemberPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("释放小区失败"); |
| | | } |
| | | |
| | | //小区权限也踢掉 |
| | | for (CommunityMemberDto tmpCommunityMemberDto : communityMemberDtos) { |
| | | MenuGroupCommunityPo menuGroupCommunityPo = new MenuGroupCommunityPo(); |
| | | menuGroupCommunityPo.setCommunityId(tmpCommunityMemberDto.getCommunityId()); |
| | | flag = menuGroupCommunityV1InnerServiceSMOImpl.deleteMenuGroupCommunity(menuGroupCommunityPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("小区权限踢掉失败"); |
| | | } |
| | | } |
| | | |
| | | cmdDataFlowContext.setResponseEntity(ResultVo.success()); |
| | | } |
| | | } |