| New file |
| | |
| | | { |
| | | "orders": { |
| | | "appId": "外系统ID,分配得到", |
| | | "transactionId": "100000000020180409224736000001", |
| | | "userId": "用户ID", |
| | | "orderTypeCd": "订单类型,查询,受理", |
| | | "requestTime": "20180409224736", |
| | | "remark": "备注", |
| | | "sign": "这个服务是否要求MD5签名", |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }, |
| | | "business": [{ |
| | | "serviceCode": "buy.shop.info", |
| | | "serviceName": "购买", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessBuyShop": { |
| | | "shopId": "123", |
| | | "buyId": "-1", |
| | | "buyCount":"10" |
| | | }, |
| | | "businessBuyShopAttr": [{ |
| | | "buyId": "-1", |
| | | "attrId":"-1", |
| | | "specCd":"1001", |
| | | "value":"01" |
| | | }] |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }] |
| | | } |
| | |
| | | */ |
| | | public void saveBusinessShopCatalog(Map businessShopCatalog) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询商品信息(business过程) |
| | | * 根据bId 查询商品信息 |
| | |
| | | public void saveShopCatalogInstance(Map info) throws DAOException; |
| | | |
| | | /** |
| | | * 保存购买记录 |
| | | * @param businessBuyShop |
| | | * @throws DAOException |
| | | */ |
| | | public void saveBuyShopInstance(Map businessBuyShop) throws DAOException; |
| | | |
| | | /** |
| | | * 保存商品购买记录属性 |
| | | * @param businessBuyShopAttr |
| | | * @throws DAOException |
| | | */ |
| | | public void saveBuyShopAttrInstance(Map businessBuyShopAttr) throws DAOException; |
| | | |
| | | /** |
| | | * 查询商品信息(instance过程) |
| | | * 根据bId 查询商品信息 |
| | | * @param info bId 信息 |
| | |
| | | public Map getShopCatalog(Map info) throws DAOException; |
| | | |
| | | /** |
| | | * 商品购买查询(instance) |
| | | * @param info bId 信息 |
| | | * @return |
| | | * @throws DAOException |
| | | */ |
| | | public Map getBuyShop(Map info) throws DAOException; |
| | | |
| | | /** |
| | | * 商品属性查询(instance) |
| | | * @param info bId 信息 |
| | | * @return |
| | | * @throws DAOException |
| | | */ |
| | | public List<Map> getBuyShopAttrs(Map info) throws DAOException; |
| | | |
| | | /** |
| | | * 修改商品信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException |
| | |
| | | */ |
| | | public void updateShopCatalogInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 修改商品购买信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException |
| | | */ |
| | | public void updateBuyShopInstance(Map info) throws DAOException; |
| | | |
| | | /** |
| | | * 修改商品购买属性信息(instance) |
| | | * @param info 修改信息 |
| | | * @throws DAOException |
| | | */ |
| | | public void updateBuyShopAttrInstance(Map info) throws DAOException; |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 保存购买记录 |
| | | * @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)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询商品信息(instance) |
| | | * @param info bId 信息 |
| | | * @return |
| | |
| | | return shopCatalogs.get(0); |
| | | } |
| | | |
| | | /** |
| | | * 商品描述查询(instance) |
| | | * @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; |
| | | } |
| | | |
| | | /** |
| | | * 修改商品信息 |
| | |
| | | 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("修改商品购买属性信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateBuyShopAttrInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品购买属性信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.shop.listener; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.shop.dao.IShopServiceDao; |
| | | |
| | | /** |
| | | * 如果buyId buyAttrId 填写的值为-1,则重新生成 |
| | | * |
| | | * Created by wuxw on 2018/7/7. |
| | | */ |
| | | @Java110Listener(name="flushAboutBuyIdListener") |
| | | public class FlushAboutBuyIdListener extends AbstractShopBusinessServiceDataFlowListener { |
| | | @Override |
| | | public int getOrder() { |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_BUY_SHOP_INFO; |
| | | } |
| | | |
| | | @Override |
| | | public IShopServiceDao getShopServiceDaoImpl() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | //刷新shopId |
| | | if(data.containsKey("businessBuyShop")){ |
| | | JSONObject businessBuyShop = data.getJSONObject("businessBuyShop"); |
| | | if(!businessBuyShop.containsKey("buyId") || businessBuyShop.getString("buyId").startsWith("-")){ |
| | | flushShopBuyId(data); |
| | | } |
| | | } |
| | | |
| | | //刷新 attrId |
| | | if(data.containsKey("businessBuyShopAttr")){ |
| | | JSONArray businessBuyShopAttrs = data.getJSONArray("businessBuyShopAttr"); |
| | | for(int businessBuyShopAttrIndex = 0 ; businessBuyShopAttrIndex < businessBuyShopAttrs.size();businessBuyShopAttrIndex++){ |
| | | JSONObject attrObj = businessBuyShopAttrs.getJSONObject(businessBuyShopAttrIndex); |
| | | if(attrObj.containsKey("attrId") && !attrObj.getString("attrId").startsWith("-")){ |
| | | continue; |
| | | } |
| | | attrObj.put("attrId",GenerateCodeFactory.getShopBuyAttrId()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | // nothing to do |
| | | } |
| | | |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | // nothing to do |
| | | } |
| | | |
| | | /** |
| | | * 刷新 商品目录ID |
| | | * @param data |
| | | */ |
| | | private void flushShopBuyId(JSONObject data) { |
| | | |
| | | String buyId = GenerateCodeFactory.getShopBuyId(); |
| | | JSONObject businessBuyShop = data.getJSONObject("businessBuyShop"); |
| | | businessBuyShop.put("buyId",buyId); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.shop.listener; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.constant.StatusConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.shop.dao.IShopServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 处理节点 businessBuyShopAttr |
| | | * Created by wuxw on 2018/7/7. |
| | | */ |
| | | @Java110Listener(name = "saveBuyShopAttrListener") |
| | | @Transactional |
| | | public class SaveBuyShopAttrListener extends AbstractShopBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(SaveBuyShopAttrListener.class); |
| | | |
| | | @Autowired |
| | | IShopServiceDao shopServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_BUY_SHOP_INFO; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | //处理商品属性 |
| | | if(data.containsKey("businessBuyShopAttr")){ |
| | | JSONArray businessBuyShopAttrs = data.getJSONArray("businessBuyShopAttr"); |
| | | doBusinessBuyShopAttr(business,businessBuyShopAttrs); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | //todo buy 没有business过程,所以这里不做处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_VALID); |
| | | Map paramIn = new HashMap(); |
| | | paramIn.put("bId",bId); |
| | | paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID); |
| | | |
| | | //商品属性 |
| | | List<Map> buyShopAttrs = shopServiceDaoImpl.getBuyShopAttrs(info); |
| | | if(buyShopAttrs != null && buyShopAttrs.size()>0){ |
| | | shopServiceDaoImpl.updateBuyShopAttrInstance(paramIn); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理商品 属性 |
| | | * @param business 当前业务 |
| | | * @param businessBuyShopAttrs 商品属性 |
| | | */ |
| | | private void doBusinessBuyShopAttr(Business business, JSONArray businessBuyShopAttrs) { |
| | | |
| | | for(int shopAttrIndex = 0 ; shopAttrIndex < businessBuyShopAttrs.size();shopAttrIndex ++){ |
| | | JSONObject shopAttr = businessBuyShopAttrs.getJSONObject(shopAttrIndex); |
| | | Assert.jsonObjectHaveKey(shopAttr,"attrId","businessBuyShopAttr 节点下没有包含 attrId 节点"); |
| | | shopAttr.put("bId",business.getbId()); |
| | | //shopAttr.put("operate", StatusConstant.OPERATE_ADD); |
| | | shopServiceDaoImpl.saveBuyShopAttrInstance(shopAttr); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public IShopServiceDao getShopServiceDaoImpl() { |
| | | return shopServiceDaoImpl; |
| | | } |
| | | |
| | | public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) { |
| | | this.shopServiceDaoImpl = shopServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.shop.listener; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.constant.StatusConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.shop.dao.IShopServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 保存 商品信息 侦听 |
| | | * 处理 businessShop 节点 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("saveBuyShopListener") |
| | | @Transactional |
| | | public class SaveBuyShopListener extends AbstractShopBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(SaveBuyShopListener.class); |
| | | |
| | | @Autowired |
| | | IShopServiceDao shopServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_BUY_SHOP_INFO; |
| | | } |
| | | |
| | | /** |
| | | * 保存商户信息 business 表中 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessShop 节点 |
| | | if(data.containsKey("businessBuyShop")){ |
| | | JSONObject businessBuyShop = data.getJSONObject("businessBuyShop"); |
| | | doBusinessBuyShop(business,businessBuyShop); |
| | | dataFlowContext.addParamOut("buyId",businessBuyShop.getString("buyId")); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * business 数据转移到 instance |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | //todo buy 没有business过程,所以这里不做处理 |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_VALID); |
| | | Map paramIn = new HashMap(); |
| | | paramIn.put("bId",bId); |
| | | paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID); |
| | | //商户信息 |
| | | Map buyShop = shopServiceDaoImpl.getBuyShop(info); |
| | | if(buyShop != null && !buyShop.isEmpty()){ |
| | | paramIn.put("shopId",buyShop.get("shop_id").toString()); |
| | | shopServiceDaoImpl.updateBuyShopInstance(paramIn); |
| | | dataFlowContext.addParamOut("buyId",buyShop.get("buy_id")); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessShop 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessBuyShop 商品节点 |
| | | */ |
| | | private void doBusinessBuyShop(Business business,JSONObject businessBuyShop){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessBuyShop,"buyId","businessBuyShop 节点下没有包含 buyId 节点"); |
| | | |
| | | Assert.jsonObjectHaveKey(businessBuyShop,"shopId","businessBuyShop 节点下没有包含 shopId 节点"); |
| | | |
| | | businessBuyShop.put("bId",business.getbId()); |
| | | //businessBuyShop.put("operate", StatusConstant.OPERATE_ADD); |
| | | |
| | | //保存商户信息 |
| | | shopServiceDaoImpl.saveBuyShopInstance(businessBuyShop); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public IShopServiceDao getShopServiceDaoImpl() { |
| | | return shopServiceDaoImpl; |
| | | } |
| | | |
| | | public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) { |
| | | this.shopServiceDaoImpl = shopServiceDaoImpl; |
| | | } |
| | | } |
| | |
| | | values(#{catalogId},#{bId},#{storeId},#{name},#{level},#{parentCatalogId},#{month},#{operate}) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询商品信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessShopInfo" parameterType="Map" resultType="Map"> |
| | | select s.shop_id,s.b_id,s.catalog_id,s.store_id,s.name,s.hot_buy,s.sale_price,s.open_shop_count,s.shop_count,s.start_date,s.end_date,s.operate |
| | |
| | | where sc.operate = 'ADD' and sc.b_id=#{bId} |
| | | </insert> |
| | | |
| | | <!-- 商品购买记录 保存 add by wuxw 2018-07-08 --> |
| | | <insert id="saveBuyShopInstance" parameterType="Map"> |
| | | insert into s_buy_shop(buy_id,b_id,shop_id,buy_count,month,status_cd) |
| | | values(#{buyId},#{bId},#{shopId},#{buyCount},#{month},'0') |
| | | </insert> |
| | | |
| | | <!-- 保存购买记录属性 add by wuxw 2018-07-08 --> |
| | | <insert id="saveBuyShopAttrInstance" parameterType="Map"> |
| | | insert into s_buy_shop_attr(buy_id,b_id,attr_id,spec_cd,value,month,status_cd) |
| | | values(#{buyId},#{bId},#{attrId},#{specCd},#{value},#{month},'0') |
| | | </insert> |
| | | |
| | | <!-- 查询商品信息 add by wuxw 2018-07-03 --> |
| | | <select id="getShopInfo" parameterType="Map" resultType="Map"> |
| | | select s.shop_id,s.b_id,s.catalog_id,s.store_id,s.name,s.hot_buy,s.sale_price,s.open_shop_count,s.shop_count,s.start_date,s.end_date,s.status_cd |
| | |
| | | </if> |
| | | <if test="catalogId != null and catalogId !=''"> |
| | | and sd.catalog_id = #{catalogId} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询商品目录 instance add by wuxw 2018-07-08 --> |
| | | <select id="getBuyShop" parameterType="Map" resultType="Map"> |
| | | select bs.buy_id,bs.b_id,bs.shop_id,bs.buy_count,bs.month,bs.status_cd |
| | | from s_buy_shop bs |
| | | where 1=1 |
| | | <if test="statusCd != null and statusCd != ''"> |
| | | and bs.status_cd = #{statusCd} |
| | | </if> |
| | | <if test="bId != null and bId !=''"> |
| | | and bs.b_id = #{bId} |
| | | </if> |
| | | <if test="buyId != null and buyId !=''"> |
| | | and bs.buy_id = #{buyId} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询购买记录属性信息 add by wuxw 2018-07-03 --> |
| | | <select id="getBuyShopAttrs" parameterType="Map" resultType="Map"> |
| | | select bs.b_id,bs.attr_id,bs.buy_id,bs.spec_cd,bs.value,bs.status_cd |
| | | from s_buy_shop_attr bs |
| | | where |
| | | 1=1 |
| | | <if test="statusCd != null and statusCd != ''"> |
| | | and bs.status_cd = #{statusCd} |
| | | </if> |
| | | <if test="bId != null and bId !=''"> |
| | | and bs.b_id = #{bId} |
| | | </if> |
| | | <if test="buyId != null and buyId !=''"> |
| | | and bs.buy_id = #{buyId} |
| | | </if> |
| | | <if test="attrId != null and attrId != ''"> |
| | | and bs.attr_id = #{attrId} |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | and sc.catalog_id = #{catalogId} |
| | | </if> |
| | | </update> |
| | | |
| | | <!-- 修改 商品购买信息 add by wuxw 2018-07-08 --> |
| | | <update id="updateBuyShopInstance" parameterType="Map"> |
| | | update s_buy_shop bs set bs.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,bs.b_id = #{newBId} |
| | | </if> |
| | | <if test="buyCount != null and buyCount != ''"> |
| | | ,bs.buy_count = #{buy_count} |
| | | </if> |
| | | where 1=1 |
| | | <if test="bId != null and bId !=''"> |
| | | and bs.b_id = #{bId} |
| | | </if> |
| | | <if test="shopId != null and shopId !=''"> |
| | | and bs.shop_id = #{shopId} |
| | | </if> |
| | | <if test="buyId != null and buyId !=''"> |
| | | and bs.buy_id = #{buyId} |
| | | </if> |
| | | </update> |
| | | |
| | | <!-- 修改商品属性信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateBuyShopAttrInstance" parameterType="Map"> |
| | | update s_buy_shop_attr bsa set bsa.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,bsa.b_id = #{newBId} |
| | | </if> |
| | | <if test="value != null and value != ''"> |
| | | ,bsa.value = #{value} |
| | | </if> |
| | | where 1=1 |
| | | <if test="bId != null and bId !=''"> |
| | | and bsa.b_id = #{bId} |
| | | </if> |
| | | <if test="buyId != null and buyId !=''"> |
| | | and bsa.buy_id = #{buyId} |
| | | </if> |
| | | <if test="specCd != null and specCd !=''"> |
| | | and bsa.spec_cd = #{specCd} |
| | | </if> |
| | | <if test="attrId != null and attrId !=''"> |
| | | and bsa.attr_id = #{attrId} |
| | | </if> |
| | | </update> |
| | | </mapper> |
| | |
| | | prefixMap.put("shopPreferentialId","54"); |
| | | prefixMap.put("shopDescId","55"); |
| | | prefixMap.put("shopCatalogId","56"); |
| | | prefixMap.put("buyId","57"); |
| | | prefixMap.put("buyAttrId","58"); |
| | | } |
| | | |
| | | private static String PLATFORM_CODE = "0001"; |
| | |
| | | //调用服务 |
| | | return getCode(prefixMap.get("shopCatalogId")); |
| | | } |
| | | |
| | | /** |
| | | * 商品buyID生成 |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getShopBuyId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("buyId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("buyId")); |
| | | } |
| | | |
| | | /** |
| | | * 商品buyAttrID生成 |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getShopBuyAttrId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("buyAttrId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("buyAttrId")); |
| | | } |
| | | /** |
| | | * 获取restTemplate |
| | | * @return |