Commit f9b01ef5 authored by Quxl's avatar Quxl

x

parent a8fc9e9d
package com.egolm.shop.controller; package com.egolm.shop.controller;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -58,7 +59,16 @@ public class PromoController { ...@@ -58,7 +59,16 @@ public class PromoController {
}) })
@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) {
Integer status = 0;
Date now = new Date();
Map<String, Object> promoMap = service.getPromoDetail(promoPaperNO); Map<String, Object> promoMap = service.getPromoDetail(promoPaperNO);
Date dPromoBeginDate = (Date)promoMap.get("dPromoBeginDate");
Date dPromoEndDate = (Date)promoMap.get("dPromoEndDate");
if(now.compareTo(dPromoBeginDate) < 0) {
status = 1;
} else if(now.compareTo(dPromoEndDate) > 0) {
status = 2;
}
List<Map<String, Object>> list = service.getGroupGoodsDetail(orgNo, shopNo, promoPaperNO, promoGroupNO); List<Map<String, Object>> list = service.getGroupGoodsDetail(orgNo, shopNo, promoPaperNO, promoGroupNO);
BigDecimal nTotalRealAmount = BigDecimal.ZERO; BigDecimal nTotalRealAmount = BigDecimal.ZERO;
BigDecimal nTotalPayAmount = BigDecimal.ZERO; BigDecimal nTotalPayAmount = BigDecimal.ZERO;
...@@ -74,6 +84,7 @@ public class PromoController { ...@@ -74,6 +84,7 @@ public class PromoController {
promoMap.put("nTotalRealAmount", nTotalRealAmount); promoMap.put("nTotalRealAmount", nTotalRealAmount);
promoMap.put("nTotalPayAmount", nTotalPayAmount); promoMap.put("nTotalPayAmount", nTotalPayAmount);
promoMap.put("nTotalQty", nTotalQty); promoMap.put("nTotalQty", nTotalQty);
promoMap.put("status", status);
promoMap.put("sPromoGrouoNO", promoGroupNO); promoMap.put("sPromoGrouoNO", promoGroupNO);
List<Map<String, Object>> DLPicList = service.getGroupPicList("DL", promoPaperNO, promoGroupNO); List<Map<String, Object>> DLPicList = service.getGroupPicList("DL", promoPaperNO, promoGroupNO);
List<Map<String, Object>> BNPicList = service.getGroupPicList("BN", promoPaperNO, promoGroupNO); List<Map<String, Object>> BNPicList = service.getGroupPicList("BN", promoPaperNO, promoGroupNO);
......
...@@ -50,8 +50,6 @@ public class PromoServiceImpl implements PromoService { ...@@ -50,8 +50,6 @@ 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) {
Map<String, Object> custMap = jdbcTemplate.queryForMap("select c.* from tCustomer c, tShop s where c.sCustNO = s.sCustNO and s.sShopNO = ? and s.sOrgNO = ?", shopNo, orgNo);
String sCustTypeID = (String)custMap.get("sCustTypeID");
String sql = "" + String sql = "" +
" SELECT DISTINCT " + " SELECT DISTINCT " +
" nGoodsID = b.nGoodsID, " + " nGoodsID = b.nGoodsID, " +
...@@ -82,18 +80,17 @@ public class PromoServiceImpl implements PromoService { ...@@ -82,18 +80,17 @@ public class PromoServiceImpl implements PromoService {
" AND a.sPromoActionTypeID = '3' " + " AND a.sPromoActionTypeID = '3' " +
" 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 " +
" AND CASE WHEN nUseCycle&1 = 1 THEN '1,' ELSE '' END + " + // " AND CASE WHEN nUseCycle&1 = 1 THEN '1,' ELSE '' END + " +
" CASE WHEN nUseCycle&2 = 2 THEN '2,' ELSE '' END + " + // " CASE WHEN nUseCycle&2 = 2 THEN '2,' ELSE '' END + " +
" CASE WHEN nUseCycle&4 = 4 THEN '3,' ELSE '' END + " + // " CASE WHEN nUseCycle&4 = 4 THEN '3,' ELSE '' END + " +
" CASE WHEN nUseCycle&8 = 8 THEN '4,' ELSE '' END + " + // " CASE WHEN nUseCycle&8 = 8 THEN '4,' ELSE '' END + " +
" CASE WHEN nUseCycle&16 = 16 THEN '5,' ELSE '' END + " + // " CASE WHEN nUseCycle&16 = 16 THEN '5,' ELSE '' END + " +
" CASE WHEN nUseCycle&32 = 32 THEN '6,' ELSE '' END + " + // " CASE WHEN nUseCycle&32 = 32 THEN '6,' ELSE '' END + " +
" 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 = ? ";
//" AND c.sShopNO = ? "; List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.replaceAll("\\s+", " "), sPromoPaperNO, sPromoGroupNO);
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.replaceAll("\\s+", " "), sPromoPaperNO, sPromoGroupNO, sCustTypeID);
return list; return list;
} }
......
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