Commit f9b01ef5 authored by Quxl's avatar Quxl

x

parent a8fc9e9d
package com.egolm.shop.controller;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -58,7 +59,16 @@ public class PromoController {
})
@GetMapping("getGroupGoodsDetail")
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);
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);
BigDecimal nTotalRealAmount = BigDecimal.ZERO;
BigDecimal nTotalPayAmount = BigDecimal.ZERO;
......@@ -74,6 +84,7 @@ public class PromoController {
promoMap.put("nTotalRealAmount", nTotalRealAmount);
promoMap.put("nTotalPayAmount", nTotalPayAmount);
promoMap.put("nTotalQty", nTotalQty);
promoMap.put("status", status);
promoMap.put("sPromoGrouoNO", promoGroupNO);
List<Map<String, Object>> DLPicList = service.getGroupPicList("DL", promoPaperNO, promoGroupNO);
List<Map<String, Object>> BNPicList = service.getGroupPicList("BN", promoPaperNO, promoGroupNO);
......
......@@ -50,8 +50,6 @@ public class PromoServiceImpl implements PromoService {
@Override
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 = "" +
" SELECT DISTINCT " +
" nGoodsID = b.nGoodsID, " +
......@@ -82,18 +80,17 @@ public class PromoServiceImpl implements PromoService {
" AND a.sPromoActionTypeID = '3' " +
" AND a.nTag&3=2 " +
" AND b.nTag&3=2 " +
" AND getdate() BETWEEN a.dPromoBeginDate AND a.dPromoEndDate " +
" AND CASE WHEN nUseCycle&1 = 1 THEN '1,' ELSE '' END + " +
" CASE WHEN nUseCycle&2 = 2 THEN '2,' ELSE '' END + " +
" CASE WHEN nUseCycle&4 = 4 THEN '3,' ELSE '' END + " +
" CASE WHEN nUseCycle&8 = 8 THEN '4,' ELSE '' END + " +
" CASE WHEN nUseCycle&16 = 16 THEN '5,' 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())) + '%' " +
// " AND getdate() BETWEEN a.dPromoBeginDate AND a.dPromoEndDate " +
// " AND CASE WHEN nUseCycle&1 = 1 THEN '1,' ELSE '' END + " +
// " CASE WHEN nUseCycle&2 = 2 THEN '2,' ELSE '' END + " +
// " CASE WHEN nUseCycle&4 = 4 THEN '3,' ELSE '' END + " +
// " CASE WHEN nUseCycle&8 = 8 THEN '4,' ELSE '' END + " +
// " CASE WHEN nUseCycle&16 = 16 THEN '5,' 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())) + '%' " +
" AND a.sPromoPaperNO = ? " +
" AND b.sPromoGroupNO = ? ";
//" AND c.sShopNO = ? ";
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.replaceAll("\\s+", " "), sPromoPaperNO, sPromoGroupNO, sCustTypeID);
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.replaceAll("\\s+", " "), sPromoPaperNO, sPromoGroupNO);
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