|
|
@@ -1,10 +1,12 @@
|
|
|
-package com.java110.api.listener.inspectionPoint;
|
|
|
+package com.java110.community.cmd.inspectionPoint;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.aliyuncs.utils.StringUtils;
|
|
|
-import com.java110.api.listener.AbstractServiceApiListener;
|
|
|
-import com.java110.core.annotation.Java110Listener;
|
|
|
+import com.java110.core.annotation.Java110Cmd;
|
|
|
import com.java110.core.context.DataFlowContext;
|
|
|
+import com.java110.core.context.ICmdDataFlowContext;
|
|
|
+import com.java110.core.event.cmd.Cmd;
|
|
|
+import com.java110.core.event.cmd.CmdEvent;
|
|
|
import com.java110.core.event.service.api.ServiceDataFlowEvent;
|
|
|
import com.java110.dto.RoomDto;
|
|
|
import com.java110.dto.community.CommunityDto;
|
|
|
@@ -15,25 +17,20 @@ import com.java110.intf.community.IInspectionInnerServiceSMO;
|
|
|
import com.java110.intf.community.IRoomInnerServiceSMO;
|
|
|
import com.java110.intf.community.IUnitInnerServiceSMO;
|
|
|
import com.java110.utils.cache.MappingCache;
|
|
|
-import com.java110.utils.constant.ServiceCodeInspectionPointConstant;
|
|
|
+import com.java110.utils.exception.CmdException;
|
|
|
import com.java110.utils.util.Assert;
|
|
|
import com.java110.utils.util.BeanConvertUtil;
|
|
|
import com.java110.vo.api.inspectionPoint.ApiInspectionPointDataVo;
|
|
|
import com.java110.vo.api.inspectionPoint.ApiInspectionPointVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.HttpMethod;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
-
|
|
|
-/**
|
|
|
- * 查询小区侦听类
|
|
|
- */
|
|
|
-@Java110Listener("listInspectionPointsListener")
|
|
|
-public class ListInspectionPointsListener extends AbstractServiceApiListener {
|
|
|
+@Java110Cmd(serviceCode = "inspectionPoint.listInspectionPoints")
|
|
|
+public class ListInspectionPointsCmd extends Cmd {
|
|
|
|
|
|
@Autowired
|
|
|
private IInspectionInnerServiceSMO inspectionPointInnerServiceSMOImpl;
|
|
|
@@ -48,39 +45,13 @@ public class ListInspectionPointsListener extends AbstractServiceApiListener {
|
|
|
private IUnitInnerServiceSMO unitInnerServiceSMOImpl;
|
|
|
|
|
|
@Override
|
|
|
- public String getServiceCode() {
|
|
|
- return ServiceCodeInspectionPointConstant.LIST_INSPECTIONPOINTS;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public HttpMethod getHttpMethod() {
|
|
|
- return HttpMethod.GET;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public int getOrder() {
|
|
|
- return DEFAULT_ORDER;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public IInspectionInnerServiceSMO getInspectionPointInnerServiceSMOImpl() {
|
|
|
- return inspectionPointInnerServiceSMOImpl;
|
|
|
- }
|
|
|
-
|
|
|
- public void setInspectionPointInnerServiceSMOImpl(IInspectionInnerServiceSMO inspectionPointInnerServiceSMOImpl) {
|
|
|
- this.inspectionPointInnerServiceSMOImpl = inspectionPointInnerServiceSMOImpl;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
|
|
|
+ public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
|
|
|
super.validatePageInfo(reqJson);
|
|
|
Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
|
|
|
-
|
|
|
+ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
|
|
|
if (reqJson.containsKey("relationship")) {
|
|
|
queryRelationship(event, context, reqJson);
|
|
|
} else {
|
|
|
@@ -96,7 +67,7 @@ public class ListInspectionPointsListener extends AbstractServiceApiListener {
|
|
|
* @param context
|
|
|
* @param reqJson
|
|
|
*/
|
|
|
- private void queryRelationship(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
|
|
|
+ private void queryRelationship(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) {
|
|
|
InspectionDto inspectionPointDto = BeanConvertUtil.covertBean(reqJson, InspectionDto.class);
|
|
|
|
|
|
int count = inspectionPointInnerServiceSMOImpl.queryInspectionsRelationShipCount(inspectionPointDto);
|
|
|
@@ -140,7 +111,7 @@ public class ListInspectionPointsListener extends AbstractServiceApiListener {
|
|
|
* @param context
|
|
|
* @param reqJson
|
|
|
*/
|
|
|
- private void queryCommon(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
|
|
|
+ private void queryCommon(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) {
|
|
|
InspectionDto inspectionPointDto = BeanConvertUtil.covertBean(reqJson, InspectionDto.class);
|
|
|
|
|
|
int count = inspectionPointInnerServiceSMOImpl.queryInspectionsCount(inspectionPointDto);
|