Commit 9d5d3d2f authored by 张永's avatar 张永

需求 #14165

parent f57785b0
...@@ -138,6 +138,7 @@ public class GoodsController { ...@@ -138,6 +138,7 @@ public class GoodsController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "orgNO", dataType = "String", required = true, value = "区域编号", defaultValue = "SHBS"), @ApiImplicitParam(paramType = "query", name = "orgNO", dataType = "String", required = true, value = "区域编号", defaultValue = "SHBS"),
@ApiImplicitParam(paramType = "query", name = "shopNO", dataType = "String", required = false, value = "店铺编号", defaultValue = "00029997"), @ApiImplicitParam(paramType = "query", name = "shopNO", dataType = "String", required = false, value = "店铺编号", defaultValue = "00029997"),
@ApiImplicitParam(paramType = "query", name = "agentID", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name = "index", dataType = "String", required = false, value = "第几页", defaultValue = "1"), @ApiImplicitParam(paramType = "query", name = "index", dataType = "String", required = false, value = "第几页", defaultValue = "1"),
@ApiImplicitParam(paramType = "query", name = "limit", dataType = "String", required = false, value = "每页数量", defaultValue = "20"), @ApiImplicitParam(paramType = "query", name = "limit", dataType = "String", required = false, value = "每页数量", defaultValue = "20"),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"), @ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = false, value = "终端标识", defaultValue = "wechat"),
...@@ -147,9 +148,12 @@ public class GoodsController { ...@@ -147,9 +148,12 @@ public class GoodsController {
}) })
@RequestMapping(value = "/hotSearchKey",method=RequestMethod.GET) @RequestMapping(value = "/hotSearchKey",method=RequestMethod.GET)
public String hotSearchKey(HttpServletRequest request, HttpServletResponse response) { public String hotSearchKey(HttpServletRequest request, HttpServletResponse response) {
String agentID= request.getParameter("agentID");
XException.assertNotBlank(agentID, "agentID标识不能为空");
List<Map<String,Object>> listMap; List<Map<String,Object>> listMap;
Map<String,Object> params=new HashMap<>(); Map<String,Object> params=new HashMap<>();
params.put("orgNO", request.getParameter("orgNO")); params.put("orgNO", request.getParameter("orgNO"));
params.put("agentID", agentID);
params.put("shopNO", request.getParameter("shopNO")==null?"":request.getParameter("shopNO")); params.put("shopNO", request.getParameter("shopNO")==null?"":request.getParameter("shopNO"));
Page page=new Page(); Page page=new Page();
page.setIndex(Long.valueOf(request.getParameter("index")==null?"1":request.getParameter("index"))); page.setIndex(Long.valueOf(request.getParameter("index")==null?"1":request.getParameter("index")));
...@@ -162,6 +166,7 @@ public class GoodsController { ...@@ -162,6 +166,7 @@ public class GoodsController {
@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 = "goodsId", dataType = "String", required = true, value = "商品编号", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "goodsId", dataType = "String", required = true, value = "商品编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "contractNo", dataType = "String", required = true, value = "合同编号", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "contractNo", dataType = "String", required = true, value = "合同编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "custTypeId", dataType = "String", required = false, value = "合同编号", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "custTypeId", dataType = "String", required = false, value = "合同编号", defaultValue = ""),
...@@ -172,7 +177,9 @@ public class GoodsController { ...@@ -172,7 +177,9 @@ public class GoodsController {
}) })
@RequestMapping(value = "/goodsDetail",method=RequestMethod.GET) @RequestMapping(value = "/goodsDetail",method=RequestMethod.GET)
public String goodsDetail(String orgNo, String goodsId, String contractNo, String custTypeId, String terminal, String langID, HttpServletRequest request, HttpServletResponse response) { public String goodsDetail(String orgNo, String goodsId, String contractNo, String custTypeId, String terminal, String langID,String agentID, HttpServletRequest request, HttpServletResponse response) {
XException.assertNotBlank(agentID, "agentID标识不能为空");
Map<String,Object> params=new HashMap<>(); Map<String,Object> params=new HashMap<>();
params.put("orgNo", orgNo); params.put("orgNo", orgNo);
params.put("goodsId", goodsId); params.put("goodsId", goodsId);
...@@ -180,6 +187,7 @@ public class GoodsController { ...@@ -180,6 +187,7 @@ public class GoodsController {
params.put("custTypeId", custTypeId); params.put("custTypeId", custTypeId);
params.put("langID", langID); params.put("langID", langID);
params.put("terminal", terminal); params.put("terminal", terminal);
params.put("agentID", agentID);
return goodsService.goodsDetail(params); return goodsService.goodsDetail(params);
} }
...@@ -188,17 +196,19 @@ public class GoodsController { ...@@ -188,17 +196,19 @@ public class GoodsController {
@ApiImplicitParam(paramType = "query", name = "uid", dataType = "String", required = true, value = "商品唯一标识"), @ApiImplicitParam(paramType = "query", name = "uid", dataType = "String", required = true, value = "商品唯一标识"),
@ApiImplicitParam(paramType = "query", name = "shopNo", dataType = "String", required = true), @ApiImplicitParam(paramType = "query", name = "shopNo", dataType = "String", required = true),
@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 = "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 = ""),
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "") @ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
}) })
@RequestMapping(value = "/queryStockPrice",method=RequestMethod.GET) @RequestMapping(value = "/queryStockPrice",method=RequestMethod.GET)
public String queryStockPrice(String uid, String shopNo, String orgNo) { public String queryStockPrice(String uid, String shopNo, String orgNo,String agentID) {
XException.assertNotBlank(uid, "商品唯一标识不能为空"); XException.assertNotBlank(uid, "商品唯一标识不能为空");
XException.assertNotBlank(agentID, "agentID标识不能为空");
uid = uid.replaceAll("\\s+", ""); uid = uid.replaceAll("\\s+", "");
String[] uidAry = uid.split(","); String[] uidAry = uid.split(",");
Map<String, Map<String, Object>> map = goodsService.queryStockPrice(orgNo, shopNo, uidAry); Map<String, Map<String, Object>> map = goodsService.queryStockPrice(orgNo, shopNo, uidAry,agentID);
return Rjx.jsonOk().setData(map).toJson(); return Rjx.jsonOk().setData(map).toJson();
} }
......
...@@ -33,6 +33,7 @@ public class PageController { ...@@ -33,6 +33,7 @@ public class PageController {
@ApiOperation("查询banner") @ApiOperation("查询banner")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "custNo", dataType = "String", required = false),
@ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, value = "语言", defaultValue = "936"), @ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, 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 = ""),
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = ""),
...@@ -43,16 +44,18 @@ public class PageController { ...@@ -43,16 +44,18 @@ public class PageController {
}) })
@RequestMapping(value = "/queryBanner",method=RequestMethod.GET) @RequestMapping(value = "/queryBanner",method=RequestMethod.GET)
public String queryBanner(HttpServletRequest request) { public String queryBanner(HttpServletRequest request) {
String custNo = request.getParameter("custNo");
String orgNO = request.getParameter("orgNo"); String orgNO = request.getParameter("orgNo");
String adTypeID = request.getParameter("adTypeID"); String adTypeID = request.getParameter("adTypeID");
String index = request.getParameter("index"); String index = request.getParameter("index");
String limit = request.getParameter("limit"); String limit = request.getParameter("limit");
if(!StringUtil.isNotEmpty(orgNO,adTypeID,index,limit)) { if(!StringUtil.isNotEmpty(orgNO,adTypeID,custNo,index,limit)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,adTypeID, "Msg_Parameter_empty")).toJson(); return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,adTypeID, "Msg_Parameter_empty")).toJson();
} }
Map<String,Object> params = new HashMap<String,Object>(); Map<String,Object> params = new HashMap<String,Object>();
params.put("orgNO", orgNO); params.put("orgNO", orgNO);
params.put("adTypeID", adTypeID); params.put("adTypeID", adTypeID);
params.put("custNo", custNo);
Page page = new Page(); Page page = new Page();
page.setIndex(Long.valueOf(index)); page.setIndex(Long.valueOf(index));
...@@ -71,6 +74,7 @@ public class PageController { ...@@ -71,6 +74,7 @@ public class PageController {
@ApiOperation("查询快报") @ApiOperation("查询快报")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "agentID", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, value = "语言", defaultValue = "936"), @ApiImplicitParam(paramType = "query", name = "LangID", dataType = "String", required = true, 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 = ""),
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = ""),
...@@ -85,12 +89,14 @@ public class PageController { ...@@ -85,12 +89,14 @@ public class PageController {
String msgTypeID = request.getParameter("msgTypeID"); String msgTypeID = request.getParameter("msgTypeID");
String index = request.getParameter("index"); String index = request.getParameter("index");
String limit = request.getParameter("limit"); String limit = request.getParameter("limit");
if(!StringUtil.isNotEmpty(orgNO,msgTypeID,index,limit)) { String agentID = request.getParameter("agentID");
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,msgTypeID, "Msg_Parameter_empty")).toJson(); if(!StringUtil.isNotEmpty(orgNO,msgTypeID,index,limit,agentID)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,msgTypeID,agentID, "Msg_Parameter_empty")).toJson();
} }
Map<String,Object> params = new HashMap<String,Object>(); Map<String,Object> params = new HashMap<String,Object>();
params.put("orgNO", orgNO); params.put("orgNO", orgNO);
params.put("msgTypeID", msgTypeID); params.put("msgTypeID", msgTypeID);
params.put("agentID", agentID);
Page page = new Page(); Page page = new Page();
page.setIndex(Long.valueOf(index)); page.setIndex(Long.valueOf(index));
......
...@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.shop.api.service.PromoService; import com.egolm.shop.api.service.PromoService;
import com.egolm.shop.common.XException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -50,6 +51,7 @@ public class PromoController { ...@@ -50,6 +51,7 @@ public class PromoController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "shopNo", dataType = "String", required = true, defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "shopNo", dataType = "String", required = true, defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true, defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true, defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "agentID", dataType = "String", required = true),
@ApiImplicitParam(paramType = "query", name = "promoPaperNO", dataType = "String", required = true, defaultValue = "", value="活动单号"), @ApiImplicitParam(paramType = "query", name = "promoPaperNO", dataType = "String", required = true, defaultValue = "", value="活动单号"),
@ApiImplicitParam(paramType = "query", name = "promoGroupNO", dataType = "String", required = true, defaultValue = "", value="组合编号"), @ApiImplicitParam(paramType = "query", name = "promoGroupNO", dataType = "String", required = true, defaultValue = "", value="组合编号"),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = true, value = "终端标识", defaultValue = "wechat"), @ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = true, value = "终端标识", defaultValue = "wechat"),
...@@ -58,11 +60,12 @@ public class PromoController { ...@@ -58,11 +60,12 @@ public class PromoController {
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "") @ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
}) })
@GetMapping("getGroupGoodsDetail") @GetMapping("getGroupGoodsDetail")
public Object getGroupGoodsDetail(String orgNo, String shopNo, String promoPaperNO, String promoGroupNO) { public Object getGroupGoodsDetail(String orgNo, String shopNo, String promoPaperNO, String promoGroupNO,String agentID) {
XException.assertNotBlank(agentID, "agentID标识不能为空");
Integer status = 0; Integer status = 0;
String statusDesc = "正常活动"; String statusDesc = "正常活动";
Date now = new Date(); Date now = new Date();
Map<String, Object> promoMap = service.getPromoDetail(promoPaperNO); Map<String, Object> promoMap = service.getPromoDetail(promoPaperNO,agentID);
Date dPromoBeginDate = (Date)promoMap.get("dPromoBeginDate"); Date dPromoBeginDate = (Date)promoMap.get("dPromoBeginDate");
Date dPromoEndDate = (Date)promoMap.get("dPromoEndDate"); Date dPromoEndDate = (Date)promoMap.get("dPromoEndDate");
Integer nTag = ((Number)promoMap.get("nTag")).intValue(); Integer nTag = ((Number)promoMap.get("nTag")).intValue();
...@@ -79,7 +82,7 @@ public class PromoController { ...@@ -79,7 +82,7 @@ public class PromoController {
status = 4; status = 4;
statusDesc = "活动已删除"; statusDesc = "活动已删除";
} }
List<Map<String, Object>> list = service.getGroupGoodsDetail(orgNo, shopNo, promoPaperNO, promoGroupNO); List<Map<String, Object>> list = service.getGroupGoodsDetail(orgNo, shopNo, promoPaperNO, promoGroupNO,agentID);
BigDecimal nTotalRealAmount = BigDecimal.ZERO; BigDecimal nTotalRealAmount = BigDecimal.ZERO;
BigDecimal nTotalPayAmount = BigDecimal.ZERO; BigDecimal nTotalPayAmount = BigDecimal.ZERO;
BigDecimal nTotalQty = BigDecimal.ZERO; BigDecimal nTotalQty = BigDecimal.ZERO;
......
...@@ -316,6 +316,7 @@ public class UserController { ...@@ -316,6 +316,7 @@ public class UserController {
break; break;
} }
} }
customerMap.put("AgentID", customerMap.get("nAgentID"));
customerMap.put("nShopID", shopList.get(0).get("nShopID")); customerMap.put("nShopID", shopList.get(0).get("nShopID"));
customerMap.put("sEmail", shopList.get(0).get("sEmail")); customerMap.put("sEmail", shopList.get(0).get("sEmail"));
customerMap.put("sShopName", shopList.get(0).get("sShopName")); customerMap.put("sShopName", shopList.get(0).get("sShopName"));
......
...@@ -38,5 +38,5 @@ public interface GoodsService { ...@@ -38,5 +38,5 @@ public interface GoodsService {
*/ */
public String updateFlavor(Map<String,Object> params); public String updateFlavor(Map<String,Object> params);
public Map<String, Map<String, Object>> queryStockPrice(String orgNo, String shopNo, String[] uid); public Map<String, Map<String, Object>> queryStockPrice(String orgNo, String shopNo, String[] uid,String agentID);
} }
...@@ -9,10 +9,10 @@ public interface PromoService { ...@@ -9,10 +9,10 @@ public interface PromoService {
List<Map<String, Object>> getGroupList(String orgNo, String shopNo, Page page); List<Map<String, Object>> getGroupList(String orgNo, String shopNo, Page page);
List<Map<String, Object>> getGroupGoodsDetail(String orgNo, String shopNo, String sPromoPaperNO, String sPromoGroupNO); List<Map<String, Object>> getGroupGoodsDetail(String orgNo, String shopNo, String sPromoPaperNO, String sPromoGroupNO,String agentID);
List<Map<String, Object>> getGroupPicList(String sPictureTypeID, String sPromoPaperNO, String sPromoGroupNO); List<Map<String, Object>> getGroupPicList(String sPictureTypeID, String sPromoPaperNO, String sPromoGroupNO);
Map<String, Object> getPromoDetail(String promoPaperNO); Map<String, Object> getPromoDetail(String promoPaperNO,String agentID);
} }
...@@ -161,11 +161,12 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -161,11 +161,12 @@ public class GoodsServiceImpl implements GoodsService {
String goodsId=(String) map.get("goodsId"); String goodsId=(String) map.get("goodsId");
String contractNo=(String) map.get("contractNo"); String contractNo=(String) map.get("contractNo");
String custTypeId=(String) map.get("custTypeId"); String custTypeId=(String) map.get("custTypeId");
String agentID = map.get("agentID")+"";
String gSql = "select t.*, ap.nRealSalePrice nApSalePrice from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = ? and ap.sAgentContractNO = t.sAgentContractNO and ap.nGoodsID = t.nGoodsID where t.sOrgNO = ? and t.sAgentContractNO = ? and t.nGoodsID = ?"; String gSql = "select t.*, ap.nRealSalePrice nApSalePrice from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = ? and ap.sAgentContractNO = t.sAgentContractNO and ap.nGoodsID = t.nGoodsID where t.sOrgNO = ? and t.sAgentContractNO = ? and t.nGoodsID = ? and t.nAgentID = ? ";
Map<String, Object> detail = null; Map<String, Object> detail = null;
try { try {
detail = jdbcTemplate.queryForMap(gSql, custTypeId, orgNo, contractNo, goodsId); detail = jdbcTemplate.queryForMap(gSql, custTypeId, orgNo, contractNo, goodsId,agentID);
BigDecimal nApSalePrice = (BigDecimal) detail.get("nApSalePrice"); BigDecimal nApSalePrice = (BigDecimal) detail.get("nApSalePrice");
if(nApSalePrice != null) { if(nApSalePrice != null) {
detail.put("nRealSalePrice", nApSalePrice); detail.put("nRealSalePrice", nApSalePrice);
...@@ -173,8 +174,8 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -173,8 +174,8 @@ public class GoodsServiceImpl implements GoodsService {
} catch (EmptyResultDataAccessException e) { } catch (EmptyResultDataAccessException e) {
throw new XException("商品已下架"); throw new XException("商品已下架");
} }
String sql = "select t.nGoodsID, t.sSubCode, t.nParentID, t.sSpecName, t.sSpec, isnull(ap.nRealSalePrice, og.nRealSalePrice) nRealSalePrice, nStockQty = og.nRealStockQty, og.nLockedQty from tGoodsSubCode t left join V_OrgGoods og on og.sOrgNO = ? and og.sAgentContractNO = ? and og.nGoodsID = t.nGoodsID left join tAgentCustTypePrice ap on ap.sCustTypeID = ? and ap.sAgentContractNO = og.sAgentContractNO and ap.nGoodsID = og.nGoodsID where t.nParentID = ? and t.nTag&1 = 0"; String sql = "select t.nGoodsID, t.sSubCode, t.nParentID, t.sSpecName, t.sSpec, isnull(ap.nRealSalePrice, og.nRealSalePrice) nRealSalePrice, nStockQty = og.nRealStockQty, og.nLockedQty from tGoodsSubCode t left join V_OrgGoods og on og.sOrgNO = ? and og.sAgentContractNO = ? and og.nGoodsID = t.nGoodsID left join tAgentCustTypePrice ap on ap.sCustTypeID = ? and ap.sAgentContractNO = og.sAgentContractNO and ap.nGoodsID = og.nGoodsID where t.nParentID = ? and t.nTag&1 = 0 and og.nAgentID = ? ";
List<Map<String, Object>> specList = jdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, goodsId); List<Map<String, Object>> specList = jdbcTemplate.queryForList(sql, orgNo, contractNo, custTypeId, goodsId,agentID);
Map<String, Map<String, Object>> specMap = Util.listToMM(specList, ";", "sSpecName", "sSpec"); Map<String, Map<String, Object>> specMap = Util.listToMM(specList, ";", "sSpecName", "sSpec");
Set<String> specNames = specList.stream().map(o -> (String)o.get("sSpecName")).collect(Collectors.toSet()); Set<String> specNames = specList.stream().map(o -> (String)o.get("sSpecName")).collect(Collectors.toSet());
Set<String> specs = specList.stream().map(o -> (String)o.get("sSpec")).collect(Collectors.toSet()); Set<String> specs = specList.stream().map(o -> (String)o.get("sSpec")).collect(Collectors.toSet());
...@@ -186,8 +187,8 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -186,8 +187,8 @@ public class GoodsServiceImpl implements GoodsService {
} }
detail.put("nProfitMargin", nProfitMargin); detail.put("nProfitMargin", nProfitMargin);
Map<String, List<Map<String, Object>>> picList = goodsPicList(goodsId, contractNo); Map<String, List<Map<String, Object>>> picList = goodsPicList(goodsId, contractNo);
String promoSql = "select pm.* from tYWPromoMain pm, tYWPromoDtl pd, tPromoCustBWList bw where pm.sPromoPaperNO = bw.sPromoPaperNO and bw.sShopNO = ? and pm.sPromoActionTypeID != '3' and pm.sOrgNO = ? and pm.sPromoPaperNO = pd.sPromoPaperNO and pm.nTag&3 = 2 and (pd.sAgentContractNO = ?) and (pd.nGoodsID = ?)"; String promoSql = "select pm.* from tYWPromoMain pm, tYWPromoDtl pd, tPromoCustBWList bw ,tAgentContract ac where pd.sAgentContractNO = ac.sAgentContractNO and ac.nTag&3 = 2 and pm.sPromoPaperNO = bw.sPromoPaperNO and bw.sShopNO = ? and pm.sPromoActionTypeID != '3' and pm.sOrgNO = ? and pm.sPromoPaperNO = pd.sPromoPaperNO and pm.nTag&3 = 2 and (pd.sAgentContractNO = ?) and (pd.nGoodsID = ?) and ac.nAgentID = ? ";
Object[] args = new Object[] {custTypeId, orgNo, contractNo, goodsId}; Object[] args = new Object[] {custTypeId, orgNo, contractNo, goodsId,agentID};
List<Map<String, Object>> promoList = jdbcTemplate.queryForList(promoSql, args); List<Map<String, Object>> promoList = jdbcTemplate.queryForList(promoSql, args);
detail.put("promoList", promoList); detail.put("promoList", promoList);
Rjx rjx = Rjx.jsonOk().set("goodsDetail", detail).set("specList", specList).set("specMap", specMap).set("specNames", specNames).set("specs", specs); Rjx rjx = Rjx.jsonOk().set("goodsDetail", detail).set("specList", specList).set("specMap", specMap).set("specNames", specNames).set("specs", specs);
...@@ -259,7 +260,7 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -259,7 +260,7 @@ public class GoodsServiceImpl implements GoodsService {
} }
@Override @Override
public Map<String, Map<String, Object>> queryStockPrice(String orgNo, String shopNo, String[] uidAry) { public Map<String, Map<String, Object>> queryStockPrice(String orgNo, String shopNo, String[] uidAry,String agentID) {
List<String> args = new ArrayList<String>(); List<String> args = new ArrayList<String>();
for(String uid : uidAry) { for(String uid : uidAry) {
if(StringUtil.isBlank(uid)) { if(StringUtil.isBlank(uid)) {
...@@ -271,15 +272,15 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -271,15 +272,15 @@ public class GoodsServiceImpl implements GoodsService {
} }
String sCustTypeID = "99999999999999"; String sCustTypeID = "99999999999999";
try { try {
sCustTypeID = jdbcTemplate.queryForString("select c.sCustTypeID from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ?", shopNo); sCustTypeID = jdbcTemplate.queryForString("select c.sCustTypeID from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ? and c.nAgentID = ? ", shopNo,agentID);
} catch (Exception e) { } catch (Exception e) {
//shopNo为空,没有登陆 //shopNo为空,没有登陆
} }
String sql = "select t.sAgentContractNO, t.nGoodsID, nStockQty = t.nRealStockQty, t.nDefaultPrice, isnull(ap.nRealSalePrice, t.nRealSalePrice) nRealSalePrice from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = '" + sCustTypeID + "' and t.sAgentContractNO = ap.sAgentContractNO and t.nGoodsID = ap.nGoodsID where t.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args); String sql = "select t.sAgentContractNO, t.nGoodsID, nStockQty = t.nRealStockQty, t.nDefaultPrice, isnull(ap.nRealSalePrice, t.nRealSalePrice) nRealSalePrice from V_OrgGoods t left join tAgentCustTypePrice ap on ap.sCustTypeID = '" + sCustTypeID + "' and t.sAgentContractNO = ap.sAgentContractNO and t.nGoodsID = ap.nGoodsID where t.nAgentID = "+agentID+" and t.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args);
List<Map<String, Object>> datas = jdbcTemplate.queryForList(sql); List<Map<String, Object>> datas = jdbcTemplate.queryForList(sql);
Map<String, Map<String, Object>> mm = Util.listToMM(datas, ":", "sAgentContractNO", "nGoodsID"); Map<String, Map<String, Object>> mm = Util.listToMM(datas, ":", "sAgentContractNO", "nGoodsID");
String sql1 = "select t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO sPromoGroupNO from tYWPromoDtl t, tYWPromoMain p where p.sPromoActionTypeID != '3' and t.sPromoPaperNO = p.sPromoPaperNO and p.nTag&3 = 2 and p.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args) + " group by t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO"; String sql1 = "select t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO sPromoGroupNO from tYWPromoDtl t, tYWPromoMain p,tAgentContract a where t.sAgentContractNO = a.sAgentContractNO and a.nTag&3 = 2 and a.nAgentID = "+agentID+" and p.sPromoActionTypeID != '3' and t.sPromoPaperNO = p.sPromoPaperNO and p.nTag&3 = 2 and p.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args) + " group by t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO";
List<Map<String, Object>> plist = jdbcTemplate.queryForList(sql1); List<Map<String, Object>> plist = jdbcTemplate.queryForList(sql1);
Map<String, List<Map<String, Object>>> pmm = Util.listToML(plist, ":", "sAgentContractNO", "nGoodsID"); Map<String, List<Map<String, Object>>> pmm = Util.listToML(plist, ":", "sAgentContractNO", "nGoodsID");
for(String key : mm.keySet()) { for(String key : mm.keySet()) {
......
...@@ -64,15 +64,16 @@ public class PageServiceImpl implements PageService { ...@@ -64,15 +64,16 @@ public class PageServiceImpl implements PageService {
public List<Map<String, Object>> queryBanner(Map<String, Object> params, Page page) { public List<Map<String, Object>> queryBanner(Map<String, Object> params, Page page) {
String orgNO = params.get("orgNO")+""; String orgNO = params.get("orgNO")+"";
String adTypeID = params.get("adTypeID")+""; String adTypeID = params.get("adTypeID")+"";
String custNo = params.get("custNo")+"";
jdbcTemplate.setDialect(new SqlServerDialect()); jdbcTemplate.setDialect(new SqlServerDialect());
String sql = "SELECT BannerAdNO = b.sBannerAdNO, BannerAdTitle = b.sBannerAdTitle,OrgNO = b.sOrgNO,AdPostionTypeID = b.sAdPositionTypeID,AdPostionType = b.sAdPositionType," String sql = "SELECT BannerAdNO = b.sBannerAdNO, BannerAdTitle = b.sBannerAdTitle,OrgNO = b.sOrgNO,AdPostionTypeID = b.sAdPositionTypeID,AdPostionType = b.sAdPositionType,"
+ " LayoutTypeID = b.sLayoutTypeID,LayoutType = b.sLayoutType,JumpTypeID = b.sJumpTypeID,JumpType = b.sJumpType,JumpList = b.sJumpList,Idx = b.nIdx,ImagePath = b.sImagePath," + " LayoutTypeID = b.sLayoutTypeID,LayoutType = b.sLayoutType,JumpTypeID = b.sJumpTypeID,JumpType = b.sJumpType,JumpList = b.sJumpList,Idx = b.nIdx,ImagePath = b.sImagePath,"
+ " LinkPath = b.sLinkPath " + " LinkPath = b.sLinkPath "
+ " from tBannerAd b " + " from tBannerAd b , tCustomer c "
+ " WHERE sOrgNO = ? AND sAdPositionTypeID = ? AND b.dStartTime <=getdate() AND b.dEndTime >= getdate() AND b.nTag&2 = 2"; + " WHERE sOrgNO = ? AND sAdPositionTypeID = ? AND b.dStartTime <=getdate() AND b.dEndTime >= getdate() AND b.nTag&2 = 2 and b.nAgentID = c.nAgentID and c.nTag&2 = 2 and c.sCustNO = ? ";
return jdbcTemplate.limit(sql, page, orgNO, adTypeID); return jdbcTemplate.limit(sql, page, orgNO, adTypeID,custNo);
} }
/** /**
...@@ -88,13 +89,14 @@ public class PageServiceImpl implements PageService { ...@@ -88,13 +89,14 @@ public class PageServiceImpl implements PageService {
public List<Map<String, Object>> queryNews(Map<String, Object> params, Page page) { public List<Map<String, Object>> queryNews(Map<String, Object> params, Page page) {
String orgNO = params.get("orgNO")+""; String orgNO = params.get("orgNO")+"";
String msgTypeID = params.get("msgTypeID")+""; String msgTypeID = params.get("msgTypeID")+"";
String agentID = params.get("agentID")+"";
jdbcTemplate.setDialect(new SqlServerDialect()); jdbcTemplate.setDialect(new SqlServerDialect());
String sql = "SELECT BillBoardID = b.nBillboardID, MsgTypeID = b.sMsgTypeID,MsgType = b.sMsgType,Title = b.sTitle,Content = b.sText,Sort = b.nSort,TradeDate = b.dTradeDate" String sql = "SELECT BillBoardID = b.nBillboardID, MsgTypeID = b.sMsgTypeID,MsgType = b.sMsgType,Title = b.sTitle,Content = b.sText,Sort = b.nSort,TradeDate = b.dTradeDate"
+ " FROM tBillboard b " + " FROM tBillboard b "
+ " WHERE b.nTag&2=2 AND b.sMsgTypeID = ? and b.sOrgNO = ?"; + " WHERE b.nTag&2=2 AND b.sMsgTypeID = ? and b.sOrgNO = ? and b.nAgentID = ? ";
return jdbcTemplate.limit(sql, page, msgTypeID, orgNO); return jdbcTemplate.limit(sql, page, msgTypeID, orgNO,agentID);
} }
......
...@@ -49,7 +49,7 @@ public class PromoServiceImpl implements PromoService { ...@@ -49,7 +49,7 @@ public class PromoServiceImpl implements PromoService {
} }
@Override @Override
public List<Map<String, Object>> getGroupGoodsDetail(String orgNo, String shopNo, String sPromoPaperNO, String sPromoGroupNO) { public List<Map<String, Object>> getGroupGoodsDetail(String orgNo, String shopNo, String sPromoPaperNO, String sPromoGroupNO,String agentID) {
String sql = "" + String sql = "" +
" SELECT DISTINCT " + " SELECT DISTINCT " +
" nGoodsID = b.nGoodsID, " + " nGoodsID = b.nGoodsID, " +
...@@ -78,6 +78,7 @@ public class PromoServiceImpl implements PromoService { ...@@ -78,6 +78,7 @@ public class PromoServiceImpl implements PromoService {
" AND ag.nAgentID = at.nAgentID " + " AND ag.nAgentID = at.nAgentID " +
" AND b.nGoodsID = ag.nGoodsID " + " AND b.nGoodsID = ag.nGoodsID " +
" AND a.sPromoActionTypeID = '3' " + " AND a.sPromoActionTypeID = '3' " +
" AND at.nAgentID = ? " +
// " AND a.nTag&3=2 " + // " AND a.nTag&3=2 " +
// " AND b.nTag&3=2 " + // " AND b.nTag&3=2 " +
// " AND getdate() BETWEEN a.dPromoBeginDate AND a.dPromoEndDate " + // " AND getdate() BETWEEN a.dPromoBeginDate AND a.dPromoEndDate " +
...@@ -90,7 +91,7 @@ public class PromoServiceImpl implements PromoService { ...@@ -90,7 +91,7 @@ public class PromoServiceImpl implements PromoService {
// " CASE WHEN nUseCycle&64 = 64 THEN '7' ELSE '' END LIKE '%' + convert(VARCHAR,datepart(weekday,getdate())) + '%' " + // " CASE WHEN nUseCycle&64 = 64 THEN '7' ELSE '' END LIKE '%' + convert(VARCHAR,datepart(weekday,getdate())) + '%' " +
" AND a.sPromoPaperNO = ? " + " AND a.sPromoPaperNO = ? " +
" AND b.sPromoGroupNO = ? "; " AND b.sPromoGroupNO = ? ";
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.replaceAll("\\s+", " "), sPromoPaperNO, sPromoGroupNO); List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.replaceAll("\\s+", " "), agentID,sPromoPaperNO, sPromoGroupNO);
return list; return list;
} }
...@@ -109,8 +110,8 @@ public class PromoServiceImpl implements PromoService { ...@@ -109,8 +110,8 @@ public class PromoServiceImpl implements PromoService {
} }
@Override @Override
public Map<String, Object> getPromoDetail(String promoPaperNO) { public Map<String, Object> getPromoDetail(String promoPaperNO,String agentID) {
return jdbcTemplate.queryForMap("select * from tPromo where sPromoPaperNO = ? and nTag&3 = 2", promoPaperNO); return jdbcTemplate.queryForMap("select * from tPromo where sPromoPaperNO = ? and nTag&3 = 2 and nAgentID = ? ", promoPaperNO,agentID);
} }
} }
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