From 87241ea3d8e4abda05a404b6e353f45ec2b75764 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期日, 31 五月 2020 22:28:51 +0800
Subject: [PATCH] 修复修改物品搞为添加的问题

---
 Api/src/main/java/com/java110/api/bmo/resourceStore/impl/ResourceStoreBMOImpl.java |   40 +++++++++++-----------------------------
 1 files changed, 11 insertions(+), 29 deletions(-)

diff --git a/Api/src/main/java/com/java110/api/bmo/resourceStore/impl/ResourceStoreBMOImpl.java b/Api/src/main/java/com/java110/api/bmo/resourceStore/impl/ResourceStoreBMOImpl.java
index f99dcba..07f3a40 100644
--- a/Api/src/main/java/com/java110/api/bmo/resourceStore/impl/ResourceStoreBMOImpl.java
+++ b/Api/src/main/java/com/java110/api/bmo/resourceStore/impl/ResourceStoreBMOImpl.java
@@ -6,9 +6,10 @@
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.smo.resourceStore.IResourceStoreInnerServiceSMO;
 import com.java110.dto.resourceStore.ResourceStoreDto;
+import com.java110.po.purchase.ResourceStorePo;
 import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.CommonConstant;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -35,18 +36,11 @@
      * @param dataFlowContext 鏁版嵁涓婁笅鏂�
      * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
      */
-    public JSONObject deleteResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+    public void deleteResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) {
 
 
-        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
-        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_RESOURCE_STORE);
-        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
-        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
-        JSONObject businessResourceStore = new JSONObject();
-        businessResourceStore.putAll(paramInJson);
-        //璁$畻 搴旀敹閲戦
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessResourceStore", businessResourceStore);
-        return business;
+        ResourceStorePo resourceStorePo = BeanConvertUtil.covertBean(paramInJson, ResourceStorePo.class);
+        super.delete(dataFlowContext, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_RESOURCE_STORE);
     }
 
     /**
@@ -56,20 +50,14 @@
      * @param dataFlowContext 鏁版嵁涓婁笅鏂�
      * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
      */
-    public JSONObject addResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+    public void addResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) {
 
-
-        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
-        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_RESOURCE_STORE);
-        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
-        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONObject businessResourceStore = new JSONObject();
         businessResourceStore.putAll(paramInJson);
         businessResourceStore.put("resId", "-1");
         businessResourceStore.put("stock", "0");
-        //璁$畻 搴旀敹閲戦
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessResourceStore", businessResourceStore);
-        return business;
+        ResourceStorePo resourceStorePo = BeanConvertUtil.covertBean(businessResourceStore, ResourceStorePo.class);
+        super.insert(dataFlowContext, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_RESOURCE_STORE);
     }
 
     /**
@@ -79,7 +67,7 @@
      * @param dataFlowContext 鏁版嵁涓婁笅鏂�
      * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
      */
-    public JSONObject updateResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+    public void updateResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) {
 
         ResourceStoreDto resourceStoreDto = new ResourceStoreDto();
         resourceStoreDto.setResId(paramInJson.getString("resId"));
@@ -89,16 +77,10 @@
 
         Assert.isOne(resourceStoreDtos, "鏌ヨ鍒板鏉$墿鍝� 鎴栨湭鏌ュ埌鐗╁搧锛宺esId=" + resourceStoreDto.getResId());
 
-
-        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
-        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_RESOURCE_STORE);
-        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
-        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONObject businessResourceStore = new JSONObject();
         businessResourceStore.putAll(paramInJson);
         businessResourceStore.put("stock", resourceStoreDtos.get(0).getStock());
-        //璁$畻 搴旀敹閲戦
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessResourceStore", businessResourceStore);
-        return business;
+        ResourceStorePo resourceStorePo = BeanConvertUtil.covertBean(businessResourceStore, ResourceStorePo.class);
+        super.update(dataFlowContext, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_RESOURCE_STORE);
     }
 }

--
Gitblit v1.8.0