Просмотр исходного кода

调整 商户小区实现过程

java110 лет назад: 4
Родитель
Сommit
d2fe2226f8

+ 19 - 0
java110-bean/src/main/java/com/java110/dto/CommunityMemberDto.java

@@ -34,6 +34,9 @@ public class CommunityMemberDto extends CommunityDto implements Serializable {
 
     private boolean noAuditEnterCommunity;
 
+    private String startTime;
+    private String endTime;
+
     public String getCommunityMemberId() {
         return communityMemberId;
     }
@@ -121,4 +124,20 @@ public class CommunityMemberDto extends CommunityDto implements Serializable {
     public void setSubMemberId(String subMemberId) {
         this.subMemberId = subMemberId;
     }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
 }

+ 3 - 1
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml

@@ -638,10 +638,12 @@
         scm.`member_type_cd` memberTypeCd,
         scm.audit_status_cd auditStatusCd,
         scm.`status_cd` statusCd,
+        scm.`start_time` startTime,
+        scm.`end_time` endTime,
         ca.area_name areaName,
         ca.parent_area_name cityName,
         ca1.parent_area_name provName,
-        sc.community_area communityArea
+        sc.community_area communityArea,
         FROM
         s_community sc,
         s_community_member scm,

+ 0 - 66
service-community/src/main/java/com/java110/community/api/CommunitysApi.java

@@ -1,66 +0,0 @@
-/*
- * Copyright 2017-2020 吴学文 and java110 team.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.java110.community.api;
-
-import com.java110.community.bmo.community.IQueryStoreCommunitys;
-import com.java110.dto.CommunityMemberDto;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 小区相关对外提供接口类
- * <p>
- * 功能包括:
- * 商户小区查询接口
- *
- * @desc add by 吴学文 8:30
- * <p>
- * 文档参考 : http://www.homecommunity.cn/
- */
-@RestController
-@RequestMapping(value = "/communitys")
-public class CommunitysApi {
-
-    @Autowired
-    private IQueryStoreCommunitys queryStoreCommunitysImpl;
-
-
-    /**
-     * 查询商户入驻小区
-     *
-     * @param memberId
-     * @param memberTypeCd
-     * @param auditStatusCd
-     * @return
-     * @ServiceCode /communitys/queryStoreCommunitys
-     * @Path /app/communitys/queryStoreCommunitys
-     */
-    @RequestMapping(value = "/queryStoreCommunitys", method = RequestMethod.GET)
-    public ResponseEntity<String> queryStoreCommunitys(@RequestParam(value = "memberId") String memberId,
-                                                       @RequestParam(value = "memberTypeCd") String memberTypeCd,
-                                                       @RequestParam(value = "auditStatusCd", required = false) String auditStatusCd) {
-
-        CommunityMemberDto communityMemberDto = new CommunityMemberDto();
-        communityMemberDto.setMemberId(memberId);
-        communityMemberDto.setMemberTypeCd(memberTypeCd);
-        communityMemberDto.setAuditStatusCd(auditStatusCd);
-        return queryStoreCommunitysImpl.query(communityMemberDto);
-    }
-}

+ 43 - 0
service-community/src/main/java/com/java110/community/cmd/communitys/QueryStoreCommunitys.java

@@ -0,0 +1,43 @@
+package com.java110.community.cmd.communitys;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+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.dto.community.CommunityDto;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
+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 org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/**
+ * 查询商户小区
+ * add by 吴学文 2021-09-18
+ */
+@Java110Cmd(serviceCode = "/communitys/queryStoreCommunitys")
+public class QueryStoreCommunitys extends AbstractServiceCmdListener {
+    private final static Logger logger = LoggerFactory.getLogger(QueryStoreCommunitys.class);
+
+
+    @Autowired
+    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+        CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(reqJson, CommunityMemberDto.class);
+        List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.getStoreCommunitys(communityMemberDto);
+        cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(communityDtos));
+    }
+}