2 文件已重命名
8个文件已修改
3个文件已添加
1 文件已复制
| New file |
| | |
| | | package com.java110.api.listener.community; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.community.ICommunityInnerServiceSMO; |
| | | import com.java110.dto.CommunityMemberDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("auditEnterCommunity") |
| | | public class AuditEnterCommunityListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private ICommunityInnerServiceSMO communityInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "communityMemberId", "小区成员ID不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "state", "必填,请填写小区审核状态"); |
| | | Assert.hasKeyAndValue(reqJson, "remark", "必填,请填写小区审核原因"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //修改小区成员 |
| | | businesses.add(updateCommunityMember(reqJson, context)); |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, context.getRequestCurrentHeaders()); |
| | | |
| | | ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_AUDIT_ENTER_COMMUNITY; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject updateCommunityMember(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | CommunityMemberDto communityMemberDto = new CommunityMemberDto(); |
| | | communityMemberDto.setCommunityMemberId(paramInJson.getString("communityMemberId")); |
| | | List<CommunityMemberDto> communityMemberDtos = communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto); |
| | | Assert.listOnlyOne(communityMemberDtos, "未查询到该小区成员信息【" + communityMemberDto.getCommunityMemberId() + "】"); |
| | | communityMemberDto = communityMemberDtos.get(0); |
| | | |
| | | Map oldCommunityInfo = BeanConvertUtil.beanCovertMap(communityMemberDto); |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_AUDIT_COMMUNITY_MEMBER_STATE); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessCommunity = new JSONObject(); |
| | | businessCommunity.putAll(oldCommunityInfo); |
| | | businessCommunity.put("auditStatusCd", paramInJson.getString("state")); |
| | | |
| | | //审核未通过原因未记录,后期存储在工作流框架中 |
| | | |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessCommunityMember", businessCommunity); |
| | | return business; |
| | | } |
| | | |
| | | |
| | | public ICommunityInnerServiceSMO getCommunityInnerServiceSMOImpl() { |
| | | return communityInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setCommunityInnerServiceSMOImpl(ICommunityInnerServiceSMO communityInnerServiceSMOImpl) { |
| | | this.communityInnerServiceSMOImpl = communityInnerServiceSMOImpl; |
| | | } |
| | | } |
copy from CommunityService/src/main/java/com/java110/community/listener/MemberQuitCommunityListener.java
copy to CommunityService/src/main/java/com/java110/community/listener/communityMember/AuditCommunityMemberStateListener.java
| File was copied from CommunityService/src/main/java/com/java110/community/listener/MemberQuitCommunityListener.java |
| | |
| | | package com.java110.community.listener; |
| | | package com.java110.community.listener.communityMember; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.community.dao.ICommunityServiceDao; |
| | | import com.java110.community.listener.AbstractCommunityBusinessServiceDataFlowListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | |
| | | * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("memberQuitCommunityListener") |
| | | @Java110Listener("auditCommunityMemberStateListener") |
| | | @Transactional |
| | | public class MemberQuitCommunityListener extends AbstractCommunityBusinessServiceDataFlowListener { |
| | | public class AuditCommunityMemberStateListener extends AbstractCommunityBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(MemberQuitCommunityListener.class); |
| | | private final static Logger logger = LoggerFactory.getLogger(AuditCommunityMemberStateListener.class); |
| | | @Autowired |
| | | ICommunityServiceDao communityServiceDaoImpl; |
| | | |
| | |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_MEMBER_QUIT_COMMUNITY; |
| | | return BusinessTypeConstant.BUSINESS_TYPE_AUDIT_COMMUNITY_MEMBER_STATE; |
| | | } |
| | | |
| | | /** |
| | |
| | | //小区信息 |
| | | Map info = new HashMap(); |
| | | info.put("bId", business.getbId()); |
| | | info.put("operate", StatusConstant.OPERATE_DEL); |
| | | info.put("operate", StatusConstant.OPERATE_ADD); |
| | | |
| | | |
| | | //小区信息 |
| | | Map businessCommunityMember = communityServiceDaoImpl.getBusinessCommunityMember(info); |
| | | if (businessCommunityMember != null && !businessCommunityMember.isEmpty()) { |
| | | flushBusinessCommunityMember(businessCommunityMember, StatusConstant.STATUS_CD_INVALID); |
| | | flushBusinessCommunityMember(businessCommunityMember, StatusConstant.STATUS_CD_VALID); |
| | | communityServiceDaoImpl.updateCommunityMemberInstance(businessCommunityMember); |
| | | dataFlowContext.addParamOut("communityMemberId", businessCommunityMember.get("member_community_id")); |
| | | } |
| | |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId", bId); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_INVALID); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId", business.getbId()); |
| | |
| | | |
| | | Assert.jsonObjectHaveKey(businessCommunity, "communityMemberId", "doBusinessCommunityMember 节点下没有包含 communityMemberId 节点"); |
| | | |
| | | if (businessCommunity.getString("communityMemberId").startsWith("-")) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "communityMemberId 错误,不能自动生成(必须已经存在的communityMemberId)" + businessCommunity); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessCommunityMember(business, businessCommunity); |
| | | |
| | | businessCommunity.put("bId",business.getbId()); |
| | | businessCommunity.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存小区信息 |
| | | communityServiceDaoImpl.saveBusinessCommunityMember(businessCommunity); |
| | | } |
| | | |
| | | |
| File was renamed from CommunityService/src/main/java/com/java110/community/listener/MemberJoinedCommunityListener.java |
| | |
| | | package com.java110.community.listener; |
| | | package com.java110.community.listener.communityMember; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.community.dao.ICommunityServiceDao; |
| | | import com.java110.community.listener.AbstractCommunityBusinessServiceDataFlowListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| File was renamed from CommunityService/src/main/java/com/java110/community/listener/MemberQuitCommunityListener.java |
| | |
| | | package com.java110.community.listener; |
| | | package com.java110.community.listener.communityMember; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.community.dao.ICommunityServiceDao; |
| | | import com.java110.community.listener.AbstractCommunityBusinessServiceDataFlowListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | |
| | | public ResponseEntity<String> list(IPageData pd) { |
| | | |
| | | JSONObject reqParam = JSONObject.parseObject(pd.getReqData()); |
| | | reqParam.put("state", StateConstant.NO_AUDIT); |
| | | reqParam.put("auditStatusCd", StateConstant.NO_AUDIT); |
| | | |
| | | IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getToken(), |
| | | reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId()); |
| New file |
| | |
| | | package com.java110.web.smo.community; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 审核入驻小区接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IAuditEnterCommunitySMO { |
| | | |
| | | /** |
| | | * 审核小区 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> auditEnterCommunity(IPageData pd); |
| | | } |
| | |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | Assert.hasKeyAndValue(paramIn, "communityId", "小区ID不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "communityMemberId", "小区ID不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "state", "必填,请填写小区审核状态"); |
| | | Assert.hasKeyAndValue(paramIn, "remark", "必填,请填写小区审核原因"); |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AUDIT_COMMUNITY); |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AUDIT_ENTER_COMMUNITY); |
| | | |
| | | } |
| | | |
| | |
| | | super.validateStoreStaffRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/community.auditCommunity", |
| | | ServiceConstant.SERVICE_API_URL + "/api/community.auditEnterCommunity", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.community.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import com.java110.web.smo.community.IAuditCommunitySMO; |
| | | import com.java110.web.smo.community.IAuditEnterCommunitySMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 审核小区服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("auditEnterCommunitySMOImpl") |
| | | public class AuditEnterCommunitySMOImpl extends AbstractComponentSMO implements IAuditEnterCommunitySMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | Assert.hasKeyAndValue(paramIn, "communityMemberId", "小区ID不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "state", "必填,请填写小区审核状态"); |
| | | Assert.hasKeyAndValue(paramIn, "remark", "必填,请填写小区审核原因"); |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AUDIT_COMMUNITY); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | //super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | super.validateStoreStaffRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/community.auditEnterCommunity", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> auditEnterCommunity(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| | |
| | | communitys:[], |
| | | total:0, |
| | | records:1, |
| | | currentCommunityId:'' |
| | | currentCommunityMemberId:'' |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | |
| | | ); |
| | | }, |
| | | _openEnterAuditCommunityModal:function(_community){ |
| | | vc.component.auditEnterCommunityManageInfo.currentCommunityId = _community.communityId; |
| | | vc.component.auditEnterCommunityManageInfo.currentCommunityMemberId = _community.communityMemberId; |
| | | vc.emit('audit','openAuditModal',{}); |
| | | }, |
| | | _auditEnterCommunityState:function(_auditInfo){ |
| | | _auditInfo.communityId = vc.component.auditEnterCommunityManageInfo.currentCommunityId; |
| | | _auditInfo.communityMemberId = vc.component.auditEnterCommunityManageInfo.currentCommunityMemberId; |
| | | vc.http.post( |
| | | 'auditEnterCommunityManage', |
| | | 'audit', |
| | |
| | | |
| | | public class ApiCommunityDataVo implements Serializable { |
| | | |
| | | private String communityMemberId; |
| | | private String communityId; |
| | | private String name; |
| | | private String address; |
| | |
| | | public void setTel(String tel) { |
| | | this.tel = tel; |
| | | } |
| | | |
| | | public String getCommunityMemberId() { |
| | | return communityMemberId; |
| | | } |
| | | |
| | | public void setCommunityMemberId(String communityMemberId) { |
| | | this.communityMemberId = communityMemberId; |
| | | } |
| | | } |
| | |
| | | public static final String BUSINESS_TYPE_MEMBER_QUIT_COMMUNITY = "500100040002"; |
| | | |
| | | /** |
| | | * 审核 小区成员 |
| | | */ |
| | | public static final String BUSINESS_TYPE_AUDIT_COMMUNITY_MEMBER_STATE = "500100040003"; |
| | | |
| | | /** |
| | | * 删除商户信息 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_COMMUNITY_INFO = "500100050001"; |
| | |
| | | //审核权限编码 |
| | | public static final String AUDIT_COMMUNITY = "502019091773700003"; |
| | | |
| | | public static final String AUDIT_ENTER_COMMUNITY = "502019091978690002"; |
| | | |
| | | |
| | | } |
| | |
| | | public static final String SERVICE_CODE_DELETE_COMMUNITY = "community.deleteCommunity"; |
| | | |
| | | public static final String SERVICE_CODE_AUDIT_COMMUNITY = "community.auditCommunity"; |
| | | public static final String SERVICE_CODE_AUDIT_ENTER_COMMUNITY = "community.auditEnterCommunity"; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | <!-- 查询小区成员 add by wuxw 2018-07-03 --> |
| | | <select id="getCommunityMember" parameterType="Map" resultType="Map"> |
| | | select ms.community_member_id ,ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.status_cd,ms.audit_status_cd, |
| | | select ms.community_member_id , ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.status_cd,ms.audit_status_cd, |
| | | ms.community_member_id communityMemberId ,ms.b_id bId,ms.community_id communityId,ms.member_id memberId,ms.member_type_cd memberTypeCd,ms.status_cd statusCd, |
| | | ms.audit_status_cd auditStatusCd, |
| | | (CASE |
| | |
| | | </if> |
| | | from s_community_member ms |
| | | <if test="needCommunityInfo == true"> |
| | | ,s_community sc |
| | | ,s_community sc, |
| | | s_community_member msc |
| | | </if> |
| | | where 1=1 |
| | | <if test="needCommunityInfo == true"> |
| | |
| | | <if test="communityMemberId != null and communityMemberId !=''"> |
| | | and ms.community_member_id = #{communityMemberId} |
| | | </if> |
| | | <if test="memberId != null and memberId != ''"> |
| | | <if test="memberId != null and memberId != '' and needCommunityInfo == true"> |
| | | AND ms.`community_id` = msc.`community_id` |
| | | and msc.member_id = #{memberId} |
| | | </if> |
| | | <if test="memberId != null and memberId != '' and needCommunityInfo == false"> |
| | | and ms.member_id = #{memberId} |
| | | </if> |
| | | <if test="memberTypeCd != null and memberTypeCd != ''"> |
| | |
| | | select count(1) count |
| | | from s_community_member ms |
| | | <if test="needCommunityInfo == true"> |
| | | ,s_community sc |
| | | ,s_community sc, |
| | | s_community_member msc |
| | | </if> |
| | | where 1=1 |
| | | <if test="needCommunityInfo == true"> |
| | |
| | | <if test="communityMemberId != null and communityMemberId !=''"> |
| | | and ms.community_member_id = #{communityMemberId} |
| | | </if> |
| | | <if test="memberId != null and memberId != ''"> |
| | | and ms.member_id = #{memberId} |
| | | <if test="memberId != null and memberId != '' and needCommunityInfo == true"> |
| | | AND ms.`community_id` = msc.`community_id` |
| | | and msc.member_id = #{memberId} |
| | | </if> |
| | | <if test="memberId != null andull |
| | | <if test="memberTypeCd != null and memberTypeCd != ''"> |
| | | and ms.member_type_cd = #{memberTypeCd} |
| | | </if> |