|
@@ -6,16 +6,21 @@ import com.java110.api.listener.AbstractServiceApiDataFlowListener;
|
|
|
import com.java110.common.constant.BusinessTypeConstant;
|
|
import com.java110.common.constant.BusinessTypeConstant;
|
|
|
import com.java110.common.constant.CommonConstant;
|
|
import com.java110.common.constant.CommonConstant;
|
|
|
import com.java110.common.constant.CommunityMemberTypeConstant;
|
|
import com.java110.common.constant.CommunityMemberTypeConstant;
|
|
|
|
|
+import com.java110.common.constant.ResponseConstant;
|
|
|
import com.java110.common.constant.ServiceCodeConstant;
|
|
import com.java110.common.constant.ServiceCodeConstant;
|
|
|
import com.java110.common.constant.StatusConstant;
|
|
import com.java110.common.constant.StatusConstant;
|
|
|
|
|
+import com.java110.common.exception.ListenerExecuteException;
|
|
|
import com.java110.common.util.Assert;
|
|
import com.java110.common.util.Assert;
|
|
|
import com.java110.core.annotation.Java110Listener;
|
|
import com.java110.core.annotation.Java110Listener;
|
|
|
import com.java110.core.context.DataFlowContext;
|
|
import com.java110.core.context.DataFlowContext;
|
|
|
import com.java110.core.factory.GenerateCodeFactory;
|
|
import com.java110.core.factory.GenerateCodeFactory;
|
|
|
|
|
+import com.java110.core.smo.floor.IFloorInnerServiceSMO;
|
|
|
|
|
+import com.java110.dto.FloorDto;
|
|
|
import com.java110.entity.center.AppService;
|
|
import com.java110.entity.center.AppService;
|
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.HttpMethod;
|
|
import org.springframework.http.HttpMethod;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -33,6 +38,9 @@ import org.springframework.http.ResponseEntity;
|
|
|
public class SaveFloorListener extends AbstractServiceApiDataFlowListener {
|
|
public class SaveFloorListener extends AbstractServiceApiDataFlowListener {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFloorInnerServiceSMO floorInnerServiceSMOImpl;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
private static final int DEFAULT_SEQ_COMMUNITY_MEMBER = 2;
|
|
private static final int DEFAULT_SEQ_COMMUNITY_MEMBER = 2;
|
|
|
|
|
|
|
@@ -160,6 +168,19 @@ public class SaveFloorListener extends AbstractServiceApiDataFlowListener {
|
|
|
Assert.jsonObjectHaveKey(paramIn, "userId", "请求报文中未包含userId");
|
|
Assert.jsonObjectHaveKey(paramIn, "userId", "请求报文中未包含userId");
|
|
|
Assert.jsonObjectHaveKey(paramIn, "floorNum", "请求报文中未包含floorNum");
|
|
Assert.jsonObjectHaveKey(paramIn, "floorNum", "请求报文中未包含floorNum");
|
|
|
Assert.jsonObjectHaveKey(paramIn, "communityId", "请求报文中未包含communityId");
|
|
Assert.jsonObjectHaveKey(paramIn, "communityId", "请求报文中未包含communityId");
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject paramObj = JSONObject.parseObject(paramIn);
|
|
|
|
|
+
|
|
|
|
|
+ FloorDto floorDto = new FloorDto();
|
|
|
|
|
+ floorDto.setFloorNum(paramObj.getString("floorNum"));
|
|
|
|
|
+ floorDto.setCommunityId(paramObj.getString("communityId"));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ int floorCount = floorInnerServiceSMOImpl.queryFloorsCount(floorDto);
|
|
|
|
|
+
|
|
|
|
|
+ if (floorCount > 0) {
|
|
|
|
|
+ throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "楼栋编号已经存在");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -168,4 +189,11 @@ public class SaveFloorListener extends AbstractServiceApiDataFlowListener {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public IFloorInnerServiceSMO getFloorInnerServiceSMOImpl() {
|
|
|
|
|
+ return floorInnerServiceSMOImpl;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setFloorInnerServiceSMOImpl(IFloorInnerServiceSMO floorInnerServiceSMOImpl) {
|
|
|
|
|
+ this.floorInnerServiceSMOImpl = floorInnerServiceSMOImpl;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|