From cbc1f9db3d796683d88d6d30df3659984dfbeda3 Mon Sep 17 00:00:00 2001
From: webapp <webapp@home-server.attdns.com>
Date: 星期一, 30 九月 2019 22:56:12 +0800
Subject: [PATCH] 取消java110-common jar包,提升为CommonService服务,将之前的Java110-common内容变更为Java110-utils包

---
 ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java |  191 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 188 insertions(+), 3 deletions(-)

diff --git a/ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java b/ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java
index 4b9a588..dbc2357 100644
--- a/ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java
+++ b/ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java
@@ -1,9 +1,9 @@
 package com.java110.shop.dao.impl;
 
 import com.alibaba.fastjson.JSONObject;
-import com.java110.common.constant.ResponseConstant;
-import com.java110.common.exception.DAOException;
-import com.java110.common.util.DateUtil;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
 import com.java110.core.base.dao.BaseServiceDao;
 import com.java110.shop.dao.IShopServiceDao;
 import org.slf4j.Logger;
@@ -128,6 +128,23 @@
     }
 
     /**
+     * 淇濆瓨鍟嗗搧鐩綍
+     * @param businessShopCatalog 鍟嗗搧鐩綍
+     * @throws DAOException
+     */
+    @Override
+    public void saveBusinessShopCatalog(Map businessShopCatalog) throws DAOException {
+        businessShopCatalog.put("month", DateUtil.getCurrentMonth());
+        logger.debug("淇濆瓨鍟嗗搧鐩綍淇℃伅 鍏ュ弬 businessShopCatalog : {}",businessShopCatalog);
+
+        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopCatalog",businessShopCatalog);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧鐩綍鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessShopCatalog));
+        }
+    }
+
+    /**
      * 鏌ヨ鍟嗗搧淇℃伅
      * @param info bId 淇℃伅
      * @return 鍟嗗搧淇℃伅
@@ -236,6 +253,26 @@
         return businessShopDesces.get(0);
     }
 
+    /**
+     * 鏌ヨ鍟嗗搧鐩綍
+     * @param info bId 淇℃伅
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public Map getBusinessShopCatalog(Map info) throws DAOException {
+        logger.debug("鏌ヨ鍟嗗搧璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
+
+        List<Map> businessShopCatalogs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopCatalog",info);
+        if(businessShopCatalogs == null){
+            return null;
+        }
+        if(businessShopCatalogs.size() >1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessShopCatalogs锛�"+ JSONObject.toJSONString(info));
+        }
+
+        return businessShopCatalogs.get(0);
+    }
 
     /**
      * 淇濆瓨鍟嗗搧淇℃伅 鍒� instance
@@ -310,6 +347,52 @@
 
         if(saveFlag < 1){
             throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧璇佷欢淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        }
+    }
+
+    @Override
+    public void saveShopCatalogInstance(Map info) throws DAOException {
+        logger.debug("淇濆瓨鍟嗗搧鐩綍淇℃伅Instance 鍏ュ弬 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopCatalogInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧鐩綍淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 淇濆瓨璐拱璁板綍
+     * @param businessBuyShop
+     * @throws DAOException
+     */
+    @Override
+    public void saveBuyShopInstance(Map businessBuyShop) throws DAOException {
+        businessBuyShop.put("month", DateUtil.getCurrentMonth());
+        logger.debug("淇濆瓨鍟嗗搧璐拱璁板綍淇℃伅 鍏ュ弬 businessBuyShop : {}",businessBuyShop);
+
+        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBuyShopInstance",businessBuyShop);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧璐拱璁板綍鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessBuyShop));
+        }
+    }
+
+    /**
+     * 璐拱鍟嗗搧灞炴�т繚瀛�
+     * @param businessBuyShopAttr
+     * @throws DAOException
+     */
+    @Override
+    public void saveBuyShopAttrInstance(Map businessBuyShopAttr) throws DAOException {
+        businessBuyShopAttr.put("month", DateUtil.getCurrentMonth());
+        logger.debug("淇濆瓨鍟嗗搧璐拱璁板綍灞炴�т俊鎭� 鍏ュ弬 businessBuyShopAttr : {}",businessBuyShopAttr);
+
+        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBuyShopAttrInstance",businessBuyShopAttr);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧璐拱璁板綍灞炴�ф暟鎹け璐ワ細"+ JSONObject.toJSONString(businessBuyShopAttr));
         }
     }
 
@@ -419,6 +502,60 @@
         return shopDesces.get(0);
     }
 
+    /**
+     * 鍟嗗搧鐩綍鏌ヨ锛坕nstance锛�
+     * @param info bId 淇℃伅
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public Map getShopCatalog(Map info) throws DAOException {
+        logger.debug("鏌ヨ鍟嗗搧鐩綍淇℃伅 鍏ュ弬 info : {}",info);
+
+        List<Map> shopCatalogs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopCatalog",info);
+        if(shopCatalogs == null || shopCatalogs.size() == 0){
+            return null;
+        }
+        if(shopCatalogs.size() >1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getShopCatalog锛�"+ JSONObject.toJSONString(info));
+        }
+        return shopCatalogs.get(0);
+    }
+
+    /**
+     * 鍟嗗搧鎻忚堪鏌ヨ锛坕nstance锛�
+     * @param info bId 淇℃伅
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public Map getBuyShop(Map info) throws DAOException {
+        logger.debug("鏌ヨ鍟嗗搧璐拱淇℃伅 鍏ュ弬 info : {}",info);
+
+        List<Map> getBuyShops = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBuyShop",info);
+        if(getBuyShops == null || getBuyShops.size() == 0){
+            return null;
+        }
+        if(getBuyShops.size() >1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getShopCatalog锛�"+ JSONObject.toJSONString(info));
+        }
+        return getBuyShops.get(0);
+    }
+
+    /**
+     * 鍟嗗搧灞炴�ф煡璇紙instance锛�
+     * @param info bId 淇℃伅
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getBuyShopAttrs(Map info) throws DAOException {
+        logger.debug("鏌ヨ鍟嗗搧璐拱灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
+
+        List<Map> buyShopAttrs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBuyShopAttrs",info);
+
+        return buyShopAttrs;
+    }
 
     /**
      * 淇敼鍟嗗搧淇℃伅
@@ -515,4 +652,52 @@
             throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧鎻忚堪淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
         }
     }
+
+    /**
+     * 淇敼鍟嗗搧鎻忚堪淇℃伅
+     * @param info 淇敼淇℃伅
+     * @throws DAOException
+     */
+    @Override
+    public void updateShopCatalogInstance(Map info) throws DAOException {
+        logger.debug("淇敼鍟嗗搧鐩綍淇℃伅Instance 鍏ュ弬 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopCatalogInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧鐩綍淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 淇敼鍟嗗搧璐拱淇℃伅
+     * @param info 淇敼淇℃伅
+     * @throws DAOException
+     */
+    @Override
+    public void updateBuyShopInstance(Map info) throws DAOException {
+        logger.debug("淇敼鍟嗗搧璐拱淇℃伅Instance 鍏ュ弬 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateBuyShopInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧璐拱淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 淇敼鍟嗗搧璐拱灞炴�т俊鎭紙instance锛�
+     * @param info 淇敼淇℃伅
+     * @throws DAOException
+     */
+    @Override
+    public void updateBuyShopAttrInstance(Map info) throws DAOException {
+        logger.debug("淇敼鍟嗗搧璐拱灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateBuyShopAttrInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧璐拱灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        }
+    }
 }

--
Gitblit v1.8.0