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/AllocationStorehouseApplyServiceDaoImpl.java | 58 +++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseApplyServiceDaoImpl.java b/service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseApplyServiceDaoImpl.java
index a2ef615..e89c5d9 100644
--- a/service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseApplyServiceDaoImpl.java
+++ b/service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseApplyServiceDaoImpl.java
@@ -7,7 +7,7 @@
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
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 businessAllocationStorehouseApplyInfo 璋冩嫧鐢宠淇℃伅 灏佽
* @throws DAOException DAO寮傚父
*/
@@ -33,17 +34,18 @@
public void saveBusinessAllocationStorehouseApplyInfo(Map businessAllocationStorehouseApplyInfo) throws DAOException {
businessAllocationStorehouseApplyInfo.put("month", DateUtil.getCurrentMonth());
// 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨璋冩嫧鐢宠淇℃伅 鍏ュ弬 businessAllocationStorehouseApplyInfo : {}",businessAllocationStorehouseApplyInfo);
- int saveFlag = sqlSessionTemplate.insert("allocationStorehouseApplyServiceDaoImpl.saveBusinessAllocationStorehouseApplyInfo",businessAllocationStorehouseApplyInfo);
+ logger.debug("淇濆瓨璋冩嫧鐢宠淇℃伅 鍏ュ弬 businessAllocationStorehouseApplyInfo : {}", businessAllocationStorehouseApplyInfo);
+ int saveFlag = sqlSessionTemplate.insert("allocationStorehouseApplyServiceDaoImpl.saveBusinessAllocationStorehouseApplyInfo", businessAllocationStorehouseApplyInfo);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璋冩嫧鐢宠鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessAllocationStorehouseApplyInfo));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨璋冩嫧鐢宠鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessAllocationStorehouseApplyInfo));
}
}
/**
* 鏌ヨ璋冩嫧鐢宠淇℃伅
+ *
* @param info bId 淇℃伅
* @return 璋冩嫧鐢宠淇℃伅
* @throws DAOException DAO寮傚父
@@ -51,43 +53,55 @@
@Override
public List<Map> getBusinessAllocationStorehouseApplyInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ璋冩嫧鐢宠淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ璋冩嫧鐢宠淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> businessAllocationStorehouseApplyInfos = sqlSessionTemplate.selectList("allocationStorehouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo",info);
+ List<Map> businessAllocationStorehouseApplyInfos = sqlSessionTemplate.selectList("allocationStorehouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo", info);
return businessAllocationStorehouseApplyInfos;
}
-
/**
* 淇濆瓨璋冩嫧鐢宠淇℃伅 鍒� instance
- * @param info bId 淇℃伅
+ *
+ * @param info bId 淇℃伅
* @throws DAOException DAO寮傚父
*/
@Override
public void saveAllocationStorehouseApplyInfoInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨璋冩嫧鐢宠淇℃伅Instance 鍏ュ弬 info : {}",info);
+ logger.debug("淇濆瓨璋冩嫧鐢宠淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("allocationStorehouseApplyServiceDaoImpl.saveAllocationStorehouseApplyInfoInstance",info);
+ int saveFlag = sqlSessionTemplate.insert("allocationStorehouseApplyServiceDaoImpl.saveAllocationStorehouseApplyInfoInstance", 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));
+ }
+ }
+
+ @Override
+ public void saveAllocationStorehouseApplyInfo(Map info) throws DAOException {
+ logger.debug("淇濆瓨璋冩嫧鐢宠淇℃伅鍏ュ弬: {}", info);
+
+ int saveFlag = sqlSessionTemplate.insert("allocationStorehouseApplyServiceDaoImpl.saveAllocationStorehouseApplyInfo", info);
+
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨璋冩嫧鐢宠淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 鏌ヨ璋冩嫧鐢宠淇℃伅锛坕nstance锛�
+ *
* @param info bId 淇℃伅
* @return List<Map>
* @throws DAOException DAO寮傚父
*/
@Override
public List<Map> getAllocationStorehouseApplyInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ璋冩嫧鐢宠淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ璋冩嫧鐢宠淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> businessAllocationStorehouseApplyInfos = sqlSessionTemplate.selectList("allocationStorehouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo",info);
+ List<Map> businessAllocationStorehouseApplyInfos = sqlSessionTemplate.selectList("allocationStorehouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo", info);
return businessAllocationStorehouseApplyInfos;
}
@@ -95,28 +109,30 @@
/**
* 淇敼璋冩嫧鐢宠淇℃伅
+ *
* @param info 淇敼淇℃伅
* @throws DAOException DAO寮傚父
*/
@Override
public void updateAllocationStorehouseApplyInfoInstance(Map info) throws DAOException {
- logger.debug("淇敼璋冩嫧鐢宠淇℃伅Instance 鍏ュ弬 info : {}",info);
+ logger.debug("淇敼璋冩嫧鐢宠淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.update("allocationStorehouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance",info);
+ int saveFlag = sqlSessionTemplate.update("allocationStorehouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance", 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 queryAllocationStorehouseApplysCount(Map info) {
- logger.debug("鏌ヨ璋冩嫧鐢宠鏁版嵁 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ璋冩嫧鐢宠鏁版嵁 鍏ュ弬 info : {}", info);
List<Map> businessAllocationStorehouseApplyInfos = sqlSessionTemplate.selectList("allocationStorehouseApplyServiceDaoImpl.queryAllocationStorehouseApplysCount", info);
if (businessAllocationStorehouseApplyInfos.size() < 1) {
--
Gitblit v1.8.0