Commit ffb1e537 authored by 张永's avatar 张永

需求 #16542

parent b91e88ff
...@@ -51,6 +51,7 @@ public class CartController { ...@@ -51,6 +51,7 @@ public class CartController {
@ApiOperation("购物车信息") @ApiOperation("购物车信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true), @ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name = "agentID", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name="shopNO", dataType = "String", required = true, value = "店铺编号", defaultValue = ""), @ApiImplicitParam(paramType = "query", name="shopNO", dataType = "String", required = true, value = "店铺编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name="isCalcPromo", dataType = "String", required = true, value = "是否计算汇总 0为不计算,1为计算", defaultValue = ""), @ApiImplicitParam(paramType = "query", name="isCalcPromo", dataType = "String", required = true, value = "是否计算汇总 0为不计算,1为计算", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"), @ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"),
...@@ -73,6 +74,7 @@ public class CartController { ...@@ -73,6 +74,7 @@ public class CartController {
params.put("shopNO",request.getParameter("shopNO")); params.put("shopNO",request.getParameter("shopNO"));
params.put("terminal",request.getParameter("terminal")); params.put("terminal",request.getParameter("terminal"));
params.put("langID",request.getParameter("langID")); params.put("langID",request.getParameter("langID"));
params.put("agentID",request.getParameter("agentID"));
params.put("isCalcPromo",isCaclPromo); params.put("isCalcPromo",isCaclPromo);
return cartService.query(params); return cartService.query(params);
......
...@@ -91,6 +91,7 @@ public class CommonController { ...@@ -91,6 +91,7 @@ public class CommonController {
@ApiOperation("获取付款方式") @ApiOperation("获取付款方式")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "shopNo", dataType = "String", required = false, value = "参数名"), @ApiImplicitParam(paramType = "query", name = "shopNo", dataType = "String", required = false, value = "参数名"),
@ApiImplicitParam(paramType = "query", name = "agentID", dataType = "String", required = false, value = "参数名"),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"), @ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = false, value = "语言", defaultValue = "936"), @ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = false, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
...@@ -101,13 +102,14 @@ public class CommonController { ...@@ -101,13 +102,14 @@ public class CommonController {
public String getPayTypeList(HttpServletRequest request) { public String getPayTypeList(HttpServletRequest request) {
String langID = request.getParameter("langID"); String langID = request.getParameter("langID");
String shopNo = request.getParameter("shopNo"); String shopNo = request.getParameter("shopNo");
if(!StringUtil.isNotEmpty(shopNo)) { String agentID = request.getParameter("agentID");
if(!StringUtil.isNotEmpty(shopNo,agentID)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(shopNo, "Msg_Parameter_empty")).toJson(); return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(shopNo, "Msg_Parameter_empty")).toJson();
} }
String sql = "SELECT Ord = b.nOrd, PayTypeID=b.sPayTypeID, PayType = b.sPayType, PayTypeDesc = b.sPayTypeDesc,PayTypeLogoUrl = b.sUrl " String sql = "SELECT Ord = b.nOrd, PayTypeID=b.sPayTypeID, PayType = b.sPayType, PayTypeDesc = b.sPayTypeDesc,PayTypeLogoUrl = b.sUrl "
+ " FROM tShopPayType a,tPayType b,tShop s WHERE a.sPayTypeID = b.sPayTypeID AND a.nShopID = s.nShopID AND s.sShopNO = ? ORDER BY b.nOrd"; + " FROM tShopPayType a,tPayType b,tShop s WHERE a.sPayTypeID = b.sPayTypeID AND a.nShopID = s.nShopID AND s.sShopNO = ? and s.nAgentID = ? ORDER BY b.nOrd";
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql,shopNo); List<Map<String, Object>> list = jdbcTemplate.queryForList(sql,shopNo,agentID);
return Rjx.jsonOk().set("list", list).toJson(); return Rjx.jsonOk().set("list", list).toJson();
} }
......
...@@ -3,5 +3,5 @@ package com.egolm.shop.api.service; ...@@ -3,5 +3,5 @@ package com.egolm.shop.api.service;
import java.util.Map; import java.util.Map;
public interface CartQueryService { public interface CartQueryService {
public Map<String, Object> query(String orgNo, String shopNo, String terminal,String isCalcPromo) ; public Map<String, Object> query(String orgNo, String shopNo, String terminal,String isCalcPromo,String agentID) ;
} }
...@@ -48,7 +48,7 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -48,7 +48,7 @@ public class CartQueryServiceImpl implements CartQueryService {
@Qualifier("readonly") @Qualifier("readonly")
private JdbcTemplate readJdbcTemplate; private JdbcTemplate readJdbcTemplate;
public Map<String, Object> query(String orgNo, String shopNo, String terminal,String isCalcPromo) { public Map<String, Object> query(String orgNo, String shopNo, String terminal,String isCalcPromo,String agentID) {
Rjx rjx = Rjx.json().set("IsValid", true); Rjx rjx = Rjx.json().set("IsValid", true);
jdbcTemplate.executeUpdate("EXEC up_RestorePromoGiftRec ? ",shopNo); jdbcTemplate.executeUpdate("EXEC up_RestorePromoGiftRec ? ",shopNo);
...@@ -90,7 +90,7 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -90,7 +90,7 @@ public class CartQueryServiceImpl implements CartQueryService {
List<Map<String, Object>> datas = this.getGoodsList(orgNo, shopNo, terminal); List<Map<String, Object>> datas = this.getGoodsList(orgNo, shopNo, terminal,agentID);
System.out.println("datas: " + GsonUtil.toJson(datas)); System.out.println("datas: " + GsonUtil.toJson(datas));
Set<String> chooseGroups = new HashSet<String>(); Set<String> chooseGroups = new HashSet<String>();
Set<String> chooseGifts = new HashSet<String>(); Set<String> chooseGifts = new HashSet<String>();
...@@ -930,13 +930,35 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -930,13 +930,35 @@ public class CartQueryServiceImpl implements CartQueryService {
return wmsList; return wmsList;
} }
private List<Map<String, Object>> getGoodsList(String orgNo, String shopNo, String terminal) { private List<Map<String, Object>> getGoodsList(String orgNo, String shopNo, String terminal,String agentID) {
String sCustTypeID; /*String sCustTypeID;
try { try {
sCustTypeID = readJdbcTemplate.queryForString("select c.sCustTypeID from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ?", shopNo); sCustTypeID = readJdbcTemplate.queryForString("select c.sCustTypeID from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ?", shopNo);
} catch (Exception e) { } catch (Exception e) {
throw new XException("未查到用户信息"); throw new XException("未查到用户信息");
} }
*/
String sCustTypeID = "99999999999999";
String sShopTypeID = "99999999999999";
try {
String sqll = "select c.sCustTypeID,s.sPriceTypeID from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ? ";
Map<String,Object> qM = new HashMap<String,Object>();
if(StringUtil.isNotBlank(agentID)) {
sqll += " and s.nAgentID = ?";
qM = readJdbcTemplate.queryForMap(sqll, shopNo,agentID);
}else {
qM = readJdbcTemplate.queryForMap(sqll, shopNo);
}
if(!qM.isEmpty()) {
sCustTypeID = qM.get("sCustTypeID")+"";
sShopTypeID = qM.get("sPriceTypeID")+"";
}
} catch (Exception e) {
//shopNo为空,没有登陆
}
String sqlCustBwList = "select bw.sPromoPaperNO from tPromoCustBWList bw, tCustomer c, tShop s where bw.sShopNO = c.sCustTypeID and c.sCustNO = s.sCustNO and s.sShopNO = '" + shopNo + "'"; String sqlCustBwList = "select bw.sPromoPaperNO from tPromoCustBWList bw, tCustomer c, tShop s where bw.sShopNO = c.sCustTypeID and c.sCustNO = s.sCustNO and s.sShopNO = '" + shopNo + "'";
String sqlPromoTag = String sqlPromoTag =
"SELECT c.sPromoPaperNO, p.nTag, p.dPromoBeginDate, p.dPromoEndDate " "SELECT c.sPromoPaperNO, p.nTag, p.dPromoBeginDate, p.dPromoEndDate "
...@@ -960,7 +982,8 @@ public class CartQueryServiceImpl implements CartQueryService { ...@@ -960,7 +982,8 @@ public class CartQueryServiceImpl implements CartQueryService {
//+ "DELETE tCart WHERE sShopNO = '" + shopNo + "' AND nTag = 1 AND sPromoPaperNO IN (" + sqlClearPromoNo + ")" + Util.LINE_SEPARATOR //+ "DELETE tCart WHERE sShopNO = '" + shopNo + "' AND nTag = 1 AND sPromoPaperNO IN (" + sqlClearPromoNo + ")" + Util.LINE_SEPARATOR
//+ "UPDATE tCart SET sPromoGroupNO = NULL, sPromoPaperNO = NULL WHERE sShopNO = '" + shopNo + "' AND sPromoPaperNO IN (" + sqlClearPromoNo + ")" + Util.LINE_SEPARATOR //+ "UPDATE tCart SET sPromoGroupNO = NULL, sPromoPaperNO = NULL WHERE sShopNO = '" + shopNo + "' AND sPromoPaperNO IN (" + sqlClearPromoNo + ")" + Util.LINE_SEPARATOR
//+ "UPDATE tCart SET sPromoGroupNO = NULL, sPromoPaperNO = NULL WHERE sShopNO = '" + shopNo + "' AND sPromoPaperNO NOT IN (" + sqlCustBwList + ")"; //+ "UPDATE tCart SET sPromoGroupNO = NULL, sPromoPaperNO = NULL WHERE sShopNO = '" + shopNo + "' AND sPromoPaperNO NOT IN (" + sqlCustBwList + ")";
String sqlACart = "select t.*, ap.nRealSalePrice nApSalePrice from V_Cart t left join tAgentCustTypePrice ap on ap.sCustTypeID = '" + sCustTypeID + "' and ap.sAgentContractNO = t.sAgentContractNO and ap.nGoodsID = t.nGoodsID where t.sOrgNO = '" + orgNo + "' and t.sShopNO = '" + shopNo + "' order by t.nIdx"; String sqlACart = "select t.*, ap.nRealSalePrice nApSalePrice from V_Cart t left join tAgentCustTypePrice ap on ap.sCustTypeID = '" + sCustTypeID + "'"
+ " and ap.sAgentContractNO = t.sAgentContractNO and ap.nGoodsID = t.nGoodsID where t.sOrgNO = '" + orgNo + "' and t.sShopNO = '" + shopNo + "' and ap.sShopTypeID = '" + sShopTypeID + "' and ap.sUnitTypeID = '' order by t.nIdx";
String sqlp = "" String sqlp = ""
+ " SELECT " + " SELECT "
......
...@@ -266,9 +266,10 @@ public class CartServiceImpl implements CartService { ...@@ -266,9 +266,10 @@ public class CartServiceImpl implements CartService {
public String query(Map<String, Object> params) { public String query(Map<String, Object> params) {
String orgNo = (String)params.get("orgNo"); String orgNo = (String)params.get("orgNo");
String shopNO = params.get("shopNO")+""; String shopNO = params.get("shopNO")+"";
String agentID = params.get("agentID")+"";
String terminal = params.get("terminal")+""; String terminal = params.get("terminal")+"";
String isCalcPromo = params.get("isCalcPromo")+""; //"是否计算汇总 0为不计算,1为计算" String isCalcPromo = params.get("isCalcPromo")+""; //"是否计算汇总 0为不计算,1为计算"
Map<String, Object> queryMap = cartRedisService.query(orgNo, shopNO, terminal,isCalcPromo); Map<String, Object> queryMap = cartRedisService.query(orgNo, shopNO, terminal,isCalcPromo,agentID);
/*Map<String, Object> countMap = this.count(orgNo, shopNO); /*Map<String, Object> countMap = this.count(orgNo, shopNO);
queryMap.putAll(countMap);*/ queryMap.putAll(countMap);*/
return Rjx.jsonOk().setData(queryMap).toJson(); return Rjx.jsonOk().setData(queryMap).toJson();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment