|
|
@@ -6,17 +6,22 @@ import com.java110.api.bmo.inspection.IInspectionBMO;
|
|
|
import com.java110.api.listener.AbstractServiceApiListener;
|
|
|
import com.java110.core.annotation.Java110Listener;
|
|
|
import com.java110.core.context.DataFlowContext;
|
|
|
+import com.java110.core.smo.inspectionRoute.IInspectionRoutePointRelInnerServiceSMO;
|
|
|
+import com.java110.dto.inspectionRoute.InspectionRoutePointRelDto;
|
|
|
import com.java110.entity.center.AppService;
|
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
|
import com.java110.utils.constant.BusinessTypeConstant;
|
|
|
import com.java110.utils.constant.CommonConstant;
|
|
|
import com.java110.utils.constant.ServiceCodeInspectionRouteConstant;
|
|
|
import com.java110.utils.util.Assert;
|
|
|
+import com.java110.utils.util.BeanConvertUtil;
|
|
|
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;
|
|
|
+
|
|
|
/**
|
|
|
* 保存小区侦听
|
|
|
* add by wuxw 2019-06-30
|
|
|
@@ -25,11 +30,16 @@ import org.springframework.http.ResponseEntity;
|
|
|
public class DeleteInspectionRoutePointListener extends AbstractServiceApiListener {
|
|
|
@Autowired
|
|
|
private IInspectionBMO inspectionBMOImpl;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IInspectionRoutePointRelInnerServiceSMO inspectionRoutePointRelInnerServiceSMOImpl;
|
|
|
+
|
|
|
@Override
|
|
|
protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
|
|
|
//Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
|
|
|
|
|
|
- Assert.hasKeyAndValue(reqJson, "irpRelId", "路线巡检点关系ID不能为空");
|
|
|
+ Assert.hasKeyAndValue(reqJson, "inspectionRouteId", "路线巡检路线不能为空");
|
|
|
+ Assert.hasKeyAndValue(reqJson, "inspectionId", "路线巡检点不能为空");
|
|
|
Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
|
|
|
|
|
|
}
|
|
|
@@ -47,7 +57,6 @@ public class DeleteInspectionRoutePointListener extends AbstractServiceApiListen
|
|
|
businesses.add(deleteInspectionRoute(reqJson, context));
|
|
|
|
|
|
|
|
|
-
|
|
|
ResponseEntity<String> responseEntity = inspectionBMOImpl.callService(context, service.getServiceCode(), businesses);
|
|
|
|
|
|
context.setResponseEntity(responseEntity);
|
|
|
@@ -77,14 +86,20 @@ public class DeleteInspectionRoutePointListener extends AbstractServiceApiListen
|
|
|
* @return 订单服务能够接受的报文
|
|
|
*/
|
|
|
private JSONObject deleteInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
|
|
|
+ InspectionRoutePointRelDto inspectionRoutePointRelDto = new InspectionRoutePointRelDto();
|
|
|
+ inspectionRoutePointRelDto.setCommunityId(paramInJson.getString("communityId"));
|
|
|
+ inspectionRoutePointRelDto.setInspectionId(paramInJson.getString("inspectionId"));
|
|
|
+ inspectionRoutePointRelDto.setInspectionRouteId(paramInJson.getString("inspectionRouteId"));
|
|
|
+ List<InspectionRoutePointRelDto> inspectionRoutePointRelDtos = inspectionRoutePointRelInnerServiceSMOImpl.queryInspectionRoutePointRels(inspectionRoutePointRelDto);
|
|
|
|
|
|
+ Assert.listOnlyOne(inspectionRoutePointRelDtos, "未查询到(或多条)要删除的 巡检路线下的巡检点");
|
|
|
|
|
|
JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
|
|
|
business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_ROUTE_POINT_REL);
|
|
|
business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
|
|
|
business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
|
|
|
JSONObject businessInspectionRoute = new JSONObject();
|
|
|
- businessInspectionRoute.putAll(paramInJson);
|
|
|
+ businessInspectionRoute.putAll(BeanConvertUtil.beanCovertMap(inspectionRoutePointRelDtos.get(0)));
|
|
|
//计算 应收金额
|
|
|
business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoutePointRel", businessInspectionRoute);
|
|
|
return business;
|