From 0572af1b231f95ade951d851bae5e5634b645993 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期一, 01 六月 2020 10:17:23 +0800
Subject: [PATCH] 优化删除巡检路线巡检点
---
Api/src/main/java/com/java110/api/bmo/inspection/impl/InspectionBMOImpl.java | 195 +++++++++++++++---------------------------------
1 files changed, 60 insertions(+), 135 deletions(-)
diff --git a/Api/src/main/java/com/java110/api/bmo/inspection/impl/InspectionBMOImpl.java b/Api/src/main/java/com/java110/api/bmo/inspection/impl/InspectionBMOImpl.java
index 904d262..2486d69 100644
--- a/Api/src/main/java/com/java110/api/bmo/inspection/impl/InspectionBMOImpl.java
+++ b/Api/src/main/java/com/java110/api/bmo/inspection/impl/InspectionBMOImpl.java
@@ -8,6 +8,10 @@
import com.java110.core.smo.inspectionRoute.IInspectionRoutePointRelInnerServiceSMO;
import com.java110.dto.inspectionPlan.InspectionPlanDto;
import com.java110.dto.inspectionRoute.InspectionRoutePointRelDto;
+import com.java110.po.inspection.InspectionPlanPo;
+import com.java110.po.inspection.InspectionPointPo;
+import com.java110.po.inspection.InspectionRoutePo;
+import com.java110.po.inspection.InspectionRoutePointRelPo;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.util.Assert;
@@ -42,19 +46,14 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject deleteInspectionPlan(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void deleteInspectionPlan(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ InspectionPlanPo inspectionPlanPo = BeanConvertUtil.covertBean(paramInJson, InspectionPlanPo.class);
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_PLAN);
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
- JSONObject businessInspectionPlan = new JSONObject();
- businessInspectionPlan.putAll(paramInJson);
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPlan", businessInspectionPlan);
- return business;
+ super.delete(dataFlowContext, inspectionPlanPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_PLAN);
+
}
+
/**
* 娣诲姞灏忓尯淇℃伅
*
@@ -62,19 +61,14 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject addInspectionPlan(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void addInspectionPlan(JSONObject paramInJson, DataFlowContext dataFlowContext) {
-
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_PLAN);
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
JSONObject businessInspectionPlan = new JSONObject();
businessInspectionPlan.putAll(paramInJson);
businessInspectionPlan.put("inspectionPlanId", "-1");
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPlan", businessInspectionPlan);
- return business;
+ InspectionPlanPo inspectionPlanPo = BeanConvertUtil.covertBean(businessInspectionPlan, InspectionPlanPo.class);
+
+ super.insert(dataFlowContext, inspectionPlanPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_PLAN);
}
/**
@@ -84,18 +78,9 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject updateInspectionPlan(JSONObject paramInJson, DataFlowContext dataFlowContext) {
-
-
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION_PLAN);
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
- JSONObject businessInspectionPlan = new JSONObject();
- businessInspectionPlan.putAll(paramInJson);
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPlan", businessInspectionPlan);
- return business;
+ public void updateInspectionPlan(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ InspectionPlanPo inspectionPlanPo = BeanConvertUtil.covertBean(paramInJson, InspectionPlanPo.class);
+ super.update(dataFlowContext, inspectionPlanPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION_PLAN);
}
/**
@@ -105,7 +90,7 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject updateInspectionPlanState(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void updateInspectionPlanState(JSONObject paramInJson, DataFlowContext dataFlowContext) {
InspectionPlanDto inspectionPlanDto = new InspectionPlanDto();
inspectionPlanDto.setCommunityId(paramInJson.getString("communityId"));
@@ -113,16 +98,11 @@
List<InspectionPlanDto> inspectionPlanDtos = inspectionPlanInnerServiceSMOImpl.queryInspectionPlans(inspectionPlanDto);
Assert.listOnlyOne(inspectionPlanDtos, "鏍规嵁璁″垝ID鏌ヨ鍒板鏉¤褰曪紝璇锋鏌ユ暟鎹�");
-
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION_PLAN);
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
JSONObject businessInspectionPlan = new JSONObject();
businessInspectionPlan.putAll(BeanConvertUtil.beanCovertMap(inspectionPlanDtos.get(0)));
businessInspectionPlan.put("state", paramInJson.getString("state"));
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPlan", businessInspectionPlan);
- return business;
+ InspectionPlanPo inspectionPlanPo = BeanConvertUtil.covertBean(businessInspectionPlan, InspectionPlanPo.class);
+ super.update(dataFlowContext, inspectionPlanPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION_PLAN);
}
/**
@@ -132,19 +112,12 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject deleteInspectionPoint(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void deleteInspectionPoint(JSONObject paramInJson, DataFlowContext dataFlowContext) {
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+ InspectionPointPo inspectionPointPo = BeanConvertUtil.covertBean(paramInJson, InspectionPointPo.class);
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION);
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
- JSONObject businessInspectionPoint = new JSONObject();
- businessInspectionPoint.putAll(paramInJson);
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPoint", businessInspectionPoint);
- return business;
+ super.delete(dataFlowContext, inspectionPointPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION);
}
/**
@@ -154,17 +127,12 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject addInspectionPoint(JSONObject paramInJson, DataFlowContext dataFlowContext) {
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION);
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
- JSONObject businessInspectionPoint = new JSONObject();
- businessInspectionPoint.putAll(paramInJson);
- businessInspectionPoint.put("inspectionId", "-1");
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPoint", businessInspectionPoint);
- return business;
+ public void addInspectionPoint(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+ paramInJson.put("inspectionId", "-1");
+ InspectionPointPo inspectionPointPo = BeanConvertUtil.covertBean(paramInJson, InspectionPointPo.class);
+
+ super.insert(dataFlowContext, inspectionPointPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION);
}
/**
@@ -174,38 +142,10 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject updateInspectionPoint(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void updateInspectionPoint(JSONObject paramInJson, DataFlowContext dataFlowContext) {
-
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION);
- business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
- business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
- JSONObject businessInspectionPoint = new JSONObject();
- businessInspectionPoint.putAll(paramInJson);
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPoint", businessInspectionPoint);
- return business;
- }
- /**
- * 娣诲姞灏忓尯淇℃伅
- *
- * @param paramInJson 鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
- * @param dataFlowContext 鏁版嵁涓婁笅鏂�
- * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
- */
- public JSONObject deleteInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
-
-
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_ROUTE);
- 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);
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoute", businessInspectionRoute);
- return business;
+ InspectionPointPo inspectionPointPo = BeanConvertUtil.covertBean(paramInJson, InspectionPointPo.class);
+ super.update(dataFlowContext, inspectionPointPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION);
}
/**
@@ -215,7 +155,20 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject deleteInspectionRoutePoint(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void deleteInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ InspectionRoutePo inspectionRoutePo = BeanConvertUtil.covertBean(paramInJson, InspectionRoutePo.class);
+ super.delete(dataFlowContext, inspectionRoutePo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_ROUTE);
+
+ }
+
+ /**
+ * 娣诲姞灏忓尯淇℃伅
+ *
+ * @param paramInJson 鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
+ * @param dataFlowContext 鏁版嵁涓婁笅鏂�
+ * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
+ */
+ public void deleteInspectionRoutePoint(JSONObject paramInJson, DataFlowContext dataFlowContext) {
InspectionRoutePointRelDto inspectionRoutePointRelDto = new InspectionRoutePointRelDto();
inspectionRoutePointRelDto.setCommunityId(paramInJson.getString("communityId"));
inspectionRoutePointRelDto.setInspectionId(paramInJson.getString("inspectionId"));
@@ -223,16 +176,11 @@
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(BeanConvertUtil.beanCovertMap(inspectionRoutePointRelDtos.get(0)));
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoutePointRel", businessInspectionRoute);
- return business;
+
+ InspectionRoutePointRelPo inspectionRoutePointRelPo = BeanConvertUtil.covertBean(businessInspectionRoute, InspectionRoutePointRelPo.class);
+ super.delete(dataFlowContext, inspectionRoutePointRelPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_ROUTE_POINT_REL);
}
/**
@@ -242,19 +190,13 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject addInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void addInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_ROUTE);
- 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.put("inspectionRouteId", "-1");
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoute", businessInspectionRoute);
- return business;
+ paramInJson.put("inspectionRouteId", "-1");
+ InspectionRoutePo inspectionRoutePo = BeanConvertUtil.covertBean(paramInJson, InspectionRoutePo.class);
+ super.insert(dataFlowContext, inspectionRoutePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_ROUTE);
+
}
/**
@@ -264,19 +206,11 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject addInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext, int index) {
+ public void addInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext, int index) {
-
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_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.put("irpRelId", "-" + index);
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoutePointRel", businessInspectionRoute);
- return business;
+ paramInJson.put("irpRelId", "-" + index);
+ InspectionRoutePointRelPo inspectionRoutePointRelPo = BeanConvertUtil.covertBean(paramInJson, InspectionRoutePointRelPo.class);
+ super.insert(dataFlowContext, inspectionRoutePointRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_ROUTE_POINT_REL);
}
/**
@@ -286,18 +220,9 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public JSONObject updateInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
-
-
- JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
- business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION_ROUTE);
- 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);
- //璁$畻 搴旀敹閲戦
- business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoute", businessInspectionRoute);
- return business;
+ public void updateInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ InspectionRoutePo inspectionRoutePo = BeanConvertUtil.covertBean(paramInJson, InspectionRoutePo.class);
+ super.insert(dataFlowContext, inspectionRoutePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION_ROUTE);
}
}
--
Gitblit v1.8.0