From 4ee86eb0f4984bf3ede3196ad8c5fe95e8c5a504 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 15 六月 2022 19:05:02 +0800
Subject: [PATCH] 优化代码

---
 service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseServiceDaoImpl.java |   64 +++++++++++++++++++++----------
 1 files changed, 43 insertions(+), 21 deletions(-)

diff --git a/service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseServiceDaoImpl.java b/service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseServiceDaoImpl.java
index 969195a..80ef33c 100644
--- a/service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseServiceDaoImpl.java
+++ b/service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseServiceDaoImpl.java
@@ -7,7 +7,7 @@
 import com.java110.core.base.dao.BaseServiceDao;
 import com.java110.store.dao.IAllocationStorehouseServiceDao;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.java110.core.log.LoggerFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -26,6 +26,7 @@
 
     /**
      * 浠撳簱璋冩嫧淇℃伅灏佽
+     *
      * @param businessAllocationStorehouseInfo 浠撳簱璋冩嫧淇℃伅 灏佽
      * @throws DAOException DAO寮傚父
      */
@@ -33,17 +34,18 @@
     public void saveBusinessAllocationStorehouseInfo(Map businessAllocationStorehouseInfo) throws DAOException {
         businessAllocationStorehouseInfo.put("month", DateUtil.getCurrentMonth());
         // 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
-        logger.debug("淇濆瓨浠撳簱璋冩嫧淇℃伅 鍏ュ弬 businessAllocationStorehouseInfo : {}",businessAllocationStorehouseInfo);
-        int saveFlag = sqlSessionTemplate.insert("allocationStorehouseServiceDaoImpl.saveBusinessAllocationStorehouseInfo",businessAllocationStorehouseInfo);
+        logger.debug("淇濆瓨浠撳簱璋冩嫧淇℃伅 鍏ュ弬 businessAllocationStorehouseInfo : {}", businessAllocationStorehouseInfo);
+        int saveFlag = sqlSessionTemplate.insert("allocationStorehouseServiceDaoImpl.saveBusinessAllocationStorehouseInfo", businessAllocationStorehouseInfo);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨浠撳簱璋冩嫧鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessAllocationStorehouseInfo));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨浠撳簱璋冩嫧鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessAllocationStorehouseInfo));
         }
     }
 
 
     /**
      * 鏌ヨ浠撳簱璋冩嫧淇℃伅
+     *
      * @param info bId 淇℃伅
      * @return 浠撳簱璋冩嫧淇℃伅
      * @throws DAOException DAO寮傚父
@@ -51,43 +53,61 @@
     @Override
     public List<Map> getBusinessAllocationStorehouseInfo(Map info) throws DAOException {
 
-        logger.debug("鏌ヨ浠撳簱璋冩嫧淇℃伅 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ浠撳簱璋冩嫧淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> businessAllocationStorehouseInfos = sqlSessionTemplate.selectList("allocationStorehouseServiceDaoImpl.getBusinessAllocationStorehouseInfo",info);
+        List<Map> businessAllocationStorehouseInfos = sqlSessionTemplate.selectList("allocationStorehouseServiceDaoImpl.getBusinessAllocationStorehouseInfo", info);
 
         return businessAllocationStorehouseInfos;
     }
 
 
-
     /**
      * 淇濆瓨浠撳簱璋冩嫧淇℃伅 鍒� instance
-     * @param info   bId 淇℃伅
+     *
+     * @param info bId 淇℃伅
      * @throws DAOException DAO寮傚父
      */
     @Override
     public void saveAllocationStorehouseInfoInstance(Map info) throws DAOException {
-        logger.debug("淇濆瓨浠撳簱璋冩嫧淇℃伅Instance 鍏ュ弬 info : {}",info);
+        logger.debug("淇濆瓨浠撳簱璋冩嫧淇℃伅Instance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.insert("allocationStorehouseServiceDaoImpl.saveAllocationStorehouseInfoInstance",info);
+        int saveFlag = sqlSessionTemplate.insert("allocationStorehouseServiceDaoImpl.saveAllocationStorehouseInfoInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨浠撳簱璋冩嫧淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨浠撳簱璋冩嫧淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 淇濆瓨璋冩嫧璁板綍
+     *
+     * @param info
+     * @throws DAOException
+     */
+    @Override
+    public void saveAllocationStorehouseInfo(Map info) throws DAOException {
+        logger.debug("淇濆瓨璋冩嫧璁板綍鍏ュ弬 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("allocationStorehouseServiceDaoImpl.saveAllocationStorehouseInfo", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨璋冩嫧璁板綍鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
 
     /**
      * 鏌ヨ浠撳簱璋冩嫧淇℃伅锛坕nstance锛�
+     *
      * @param info bId 淇℃伅
      * @return List<Map>
      * @throws DAOException DAO寮傚父
      */
     @Override
     public List<Map> getAllocationStorehouseInfo(Map info) throws DAOException {
-        logger.debug("鏌ヨ浠撳簱璋冩嫧淇℃伅 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ浠撳簱璋冩嫧淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> businessAllocationStorehouseInfos = sqlSessionTemplate.selectList("allocationStorehouseServiceDaoImpl.getAllocationStorehouseInfo",info);
+        List<Map> businessAllocationStorehouseInfos = sqlSessionTemplate.selectList("allocationStorehouseServiceDaoImpl.getAllocationStorehouseInfo", info);
 
         return businessAllocationStorehouseInfos;
     }
@@ -95,28 +115,30 @@
 
     /**
      * 淇敼浠撳簱璋冩嫧淇℃伅
+     *
      * @param info 淇敼淇℃伅
      * @throws DAOException DAO寮傚父
      */
     @Override
     public void updateAllocationStorehouseInfoInstance(Map info) throws DAOException {
-        logger.debug("淇敼浠撳簱璋冩嫧淇℃伅Instance 鍏ュ弬 info : {}",info);
+        logger.debug("淇敼浠撳簱璋冩嫧淇℃伅Instance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.update("allocationStorehouseServiceDaoImpl.updateAllocationStorehouseInfoInstance",info);
+        int saveFlag = sqlSessionTemplate.update("allocationStorehouseServiceDaoImpl.updateAllocationStorehouseInfoInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼浠撳簱璋冩嫧淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼浠撳簱璋冩嫧淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
-     /**
+    /**
      * 鏌ヨ浠撳簱璋冩嫧鏁伴噺
+     *
      * @param info 浠撳簱璋冩嫧淇℃伅
      * @return 浠撳簱璋冩嫧鏁伴噺
      */
     @Override
     public int queryAllocationStorehousesCount(Map info) {
-        logger.debug("鏌ヨ浠撳簱璋冩嫧鏁版嵁 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ浠撳簱璋冩嫧鏁版嵁 鍏ュ弬 info : {}", info);
 
         List<Map> businessAllocationStorehouseInfos = sqlSessionTemplate.selectList("allocationStorehouseServiceDaoImpl.queryAllocationStorehousesCount", info);
         if (businessAllocationStorehouseInfos.size() < 1) {

--
Gitblit v1.8.0