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 |  112 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 106 insertions(+), 6 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 09ef448..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;
@@ -363,6 +363,40 @@
 
 
     /**
+     * 淇濆瓨璐拱璁板綍
+     * @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));
+        }
+    }
+
+    /**
      * 鏌ヨ鍟嗗搧淇℃伅锛坕nstance锛�
      * @param info bId 淇℃伅
      * @return
@@ -469,14 +503,14 @@
     }
 
     /**
-     * 鍟嗗搧鎻忚堪鏌ヨ锛坕nstance锛�
+     * 鍟嗗搧鐩綍鏌ヨ锛坕nstance锛�
      * @param info bId 淇℃伅
      * @return
      * @throws DAOException
      */
     @Override
     public Map getShopCatalog(Map info) throws DAOException {
-        logger.debug("鏌ヨ鍟嗗搧璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ鍟嗗搧鐩綍淇℃伅 鍏ュ弬 info : {}",info);
 
         List<Map> shopCatalogs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopCatalog",info);
         if(shopCatalogs == null || shopCatalogs.size() == 0){
@@ -488,6 +522,40 @@
         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;
+    }
 
     /**
      * 淇敼鍟嗗搧淇℃伅
@@ -592,7 +660,7 @@
      */
     @Override
     public void updateShopCatalogInstance(Map info) throws DAOException {
-        logger.debug("淇敼鍟嗗搧鎻忚堪淇℃伅Instance 鍏ュ弬 info : {}",info);
+        logger.debug("淇敼鍟嗗搧鐩綍淇℃伅Instance 鍏ュ弬 info : {}",info);
 
         int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopCatalogInstance",info);
 
@@ -600,4 +668,36 @@
             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