From 64a6bc364f490806f694cd308f1952dbe574e503 Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Wed, 20 Dec 2023 16:21:42 +0800 Subject: [PATCH] 12/20 --- .../yyth/api/empcardgift/EmpGiftAppletVo.java | 2 +- .../api/lpkreserveorder/LpkReserveOrder.java | 1 + .../lpkreserveorder/LpkReserveOrderDto.java | 2 + .../yxt/yyth/biz/empcard/EmpCardService.java | 15 ++-- .../biz/empcardgift/EmpCardGiftMapper.xml | 4 - .../yyth/biz/empcardgift/EmpCardGiftRest.java | 6 +- .../biz/empcardgift/EmpCardGiftService.java | 27 +++++-- .../empreserveorder/EmpReserveOrderRest.java | 2 +- .../EmpReserveOrderService.java | 31 +++++++- .../EmpReserveOrderGoodsService.java | 48 ++++++++++-- .../LpkCardBuildRecordMapper.xml | 3 +- .../biz/lpkgiftcard/LpkGiftCardService.java | 27 +++---- .../lpkreserveorder/LpkReserveOrderMapper.xml | 20 ----- .../yxt/yyth/biz/scheduled/scheduledRest.java | 77 +++++++++---------- .../yyth/config/SaTokenGloableException.java | 40 +++++++++- 15 files changed, 198 insertions(+), 107 deletions(-) diff --git a/src/main/java/com/yxt/yyth/api/empcardgift/EmpGiftAppletVo.java b/src/main/java/com/yxt/yyth/api/empcardgift/EmpGiftAppletVo.java index 6add52a..8d4f52c 100644 --- a/src/main/java/com/yxt/yyth/api/empcardgift/EmpGiftAppletVo.java +++ b/src/main/java/com/yxt/yyth/api/empcardgift/EmpGiftAppletVo.java @@ -47,7 +47,7 @@ public class EmpGiftAppletVo { private String addressName; private String isReservation;//是否超过预约时间 0 否 1是 private boolean notRese = true; //是否能预约 - private List orderCardVoList; + private List orderCardVoList; private String value; private String serialNumber; private String isEnable; diff --git a/src/main/java/com/yxt/yyth/api/lpkreserveorder/LpkReserveOrder.java b/src/main/java/com/yxt/yyth/api/lpkreserveorder/LpkReserveOrder.java index 25732e1..6e05185 100644 --- a/src/main/java/com/yxt/yyth/api/lpkreserveorder/LpkReserveOrder.java +++ b/src/main/java/com/yxt/yyth/api/lpkreserveorder/LpkReserveOrder.java @@ -27,5 +27,6 @@ public class LpkReserveOrder{ private String userAddress; private String storeSid; private String reserveDate; + private String cardType;//提货类型,1=提货卡;2=福利卡 } diff --git a/src/main/java/com/yxt/yyth/api/lpkreserveorder/LpkReserveOrderDto.java b/src/main/java/com/yxt/yyth/api/lpkreserveorder/LpkReserveOrderDto.java index 80f38b3..44af102 100644 --- a/src/main/java/com/yxt/yyth/api/lpkreserveorder/LpkReserveOrderDto.java +++ b/src/main/java/com/yxt/yyth/api/lpkreserveorder/LpkReserveOrderDto.java @@ -23,4 +23,6 @@ public class LpkReserveOrderDto implements Dto { private List goodsVos; private String orderSid; private String addressName; + private String cardType;//提货类型,1=提货卡;2=福利卡 + } diff --git a/src/main/java/com/yxt/yyth/biz/empcard/EmpCardService.java b/src/main/java/com/yxt/yyth/biz/empcard/EmpCardService.java index 70e0472..e7ce415 100644 --- a/src/main/java/com/yxt/yyth/biz/empcard/EmpCardService.java +++ b/src/main/java/com/yxt/yyth/biz/empcard/EmpCardService.java @@ -58,6 +58,8 @@ public class EmpCardService extends MybatisBaseService { private HttpServletResponse response; @Value("${image.url.prefix:http://127.0.0.1:8080/upload/}") private String urlPrefix; + @Value("${weixin.qrcode.empCard}") + String qrUrl; @@ -208,7 +210,8 @@ public class EmpCardService extends MybatisBaseService { } public void exportExcel(LpkGiftCardListQuery query) { - String finUrl = "https://supervise.yxtsoft.com/lpkapi?qy="; +// String finUrl = "https://supervise.yxtsoft.com/lpkapi?qy="; + String finUrl = qrUrl; QueryWrapper qw = new QueryWrapper<>(); qw.eq("1", "1"); if (StringUtils.isNotBlank(query.getState())) { @@ -306,10 +309,10 @@ public class EmpCardService extends MybatisBaseService { List l=empCardGiftGoodsService.getGoodsByEmpCardGiftSid(s.getSid()).getData(); if(StringUtils.isNotBlank(s.getCustomerSid())){ EmpCardGift empCardGift=new EmpCardGift(); - BeanUtil.copyProperties(EmpCardGiftVos, empCardGift, "id", "sid"); +// BeanUtil.copyProperties(EmpCardGiftVos, empCardGift, "id", "sid"); s.setShare("3"); - empCardGift.setIsShare("3"); - empCardGiftService.updateById(empCardGift); +// empCardGift.setIsShare("3"); +// empCardGiftService.updateById(empCardGift); } l.forEach(c->{ if (StringUtils.isBlank(s.getGoods())) { @@ -326,7 +329,9 @@ public class EmpCardService extends MybatisBaseService { vo.setGiftCodeKey(String.valueOf(randomNumber)); vo.setGiftCode("99"+uuid.substring(2)); - vo.setQrCode("https://supervise.yxtsoft.com/lpkapi?qy="+vo.getGiftCode()); +// vo.setQrCode("https://supervise.yxtsoft.com/lpkapi?qy="+vo.getGiftCode()); + + vo.setQrCode(qrUrl+vo.getGiftCode()); return rb.success().setData(vo); } public ResultBean changState(String cardSid, String state) { diff --git a/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftMapper.xml b/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftMapper.xml index 69abddd..ad07072 100644 --- a/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftMapper.xml +++ b/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftMapper.xml @@ -10,7 +10,6 @@ gi.*, gi.state AS states, gi.serialNumber AS serialNumber, - go.goodsNumber, gif.dateStart, gif.dateEnd, CASE @@ -24,7 +23,6 @@ END stateValue FROM emp_card_gift gi - LEFT JOIN emp_card_gift_goods go ON go.empCardGiftSid = gi.sid LEFT JOIN emp_card emp ON emp.sid = gi.empCardSid LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid @@ -37,7 +35,6 @@ gi.*, gi.state AS states, gi.serialNumber AS serialNumber, - go.goodsNumber, gif.dateStart, gif.dateEnd, CASE @@ -51,7 +48,6 @@ END stateValue FROM emp_card_gift gi - LEFT JOIN emp_card_gift_goods go ON go.empCardGiftSid = gi.sid LEFT JOIN emp_card emp ON emp.sid = gi.empCardSid LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid WHERE diff --git a/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftRest.java b/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftRest.java index 9863926..fcccdf6 100644 --- a/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftRest.java +++ b/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftRest.java @@ -10,6 +10,7 @@ import com.yxt.yyth.api.lpkgiftcard.BindCardDto; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.web.bind.annotation.*; /** @@ -108,5 +109,8 @@ public class EmpCardGiftRest { // public ResultBean cardGrant(@RequestBody CardGrantDto dto) { // return EmpCardGiftService.cardGrant(dto); // } - +//@Scheduled(cron = "0/1 * * * * ?") +//public void test() { +// System.out.println("执行"); +//} } diff --git a/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftService.java b/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftService.java index da06802..f15d17b 100644 --- a/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftService.java +++ b/src/main/java/com/yxt/yyth/biz/empcardgift/EmpCardGiftService.java @@ -27,6 +27,7 @@ import com.yxt.yyth.api.lpkgiftcard.AppletVo; import com.yxt.yyth.api.lpkgiftcard.BindCardDto; import com.yxt.yyth.api.lpkgoods.LpkGoods; import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo; +import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo; import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods; import com.yxt.yyth.api.lpkstore.LpkStoreDetailsVo; import com.yxt.yyth.biz.empcard.EmpCardService; @@ -36,6 +37,8 @@ import com.yxt.yyth.biz.empreserveorder.EmpReserveOrderService; import com.yxt.yyth.biz.empreserveordergoods.EmpReserveOrderGoodsService; import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator; import com.yxt.yyth.biz.lpkgoods.LpkGoodsService; +import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderService; +import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService; import com.yxt.yyth.biz.lpkstore.LpkStoreService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -70,10 +73,14 @@ public class EmpCardGiftService extends MybatisBaseService list = empCardGiftGoodsService.getGoodsByEmpCardGiftSid(vo.getSid()).getData(); List goodsVos = new ArrayList<>(); list.forEach(s -> { - EmpReserveOrderGoods goods = empReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData(); +// EmpReserveOrderGoods goods = empReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData(); + LpkReserveOrderGoods goods = lpkReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData(); GoodsVo goodsVo = new GoodsVo(); goodsVo.setGoods(s.getName()); goodsVo.setNum(s.getGoodsNumber()); @@ -207,10 +216,11 @@ public class EmpCardGiftService extends MybatisBaseService empReserveOrderCardVos = empReserveOrderService.selOrderByCardSid(sid).getData(); - for (EmpReserveOrderCardVo vo2 : empReserveOrderCardVos) { - List goods = empReserveOrderGoodsService.selByOrderSids(vo2.getSid()); - for (EmpReserveOrderGoods goods1 : goods) { +// List empReserveOrderCardVos = empReserveOrderService.selOrderByCardSid(sid).getData(); + List empReserveOrderCardVos = lpkReserveOrderService.selOrderByCardSid(sid).getData(); + for (LpkReserveOrderCardVo vo2 : empReserveOrderCardVos) { + List goods = lpkReserveOrderGoodsService.selByOrderSids(vo2.getSid()); + for (LpkReserveOrderGoods goods1 : goods) { LpkGoods lpkGoods = lpkGoodsService.getOne(new QueryWrapper().eq("sid", goods1.getGoodsSid())); if (StringUtils.isBlank(vo2.getGoods())) { vo2.setGoods(lpkGoods.getName() + ":" + goods1.getNum() + lpkGoods.getUnitName()); @@ -219,7 +229,8 @@ public class EmpCardGiftService extends MybatisBaseService { @Autowired EmpCardGiftService empCardGiftService; + @Autowired + LpkReserveOrderGoodsMapper lpkReserveOrderGoodsMapper; public ResultBean getReserveByCardSid(String carSid, String goodsSid) { ResultBean rb = new ResultBean(); EmpReserveOrderGoods goods = baseMapper.getReserveByCardSid(carSid, goodsSid); return rb.success().setData(goods); } - - public ResultBean submissionDetail(EmpReserveOrderDto dto) { + public ResultBean submissionDetail(LpkReserveOrderDto dto) { ResultBean rb = new ResultBean(); - EmpReserveOrderGoods goods = new EmpReserveOrderGoods(); + LpkReserveOrderGoods goods = new LpkReserveOrderGoods(); BeanUtil.copyProperties(dto, goods, "id", "sid"); goods.setCardSid(dto.getSid()); - for (GoodsVo goods1 : dto.getGoodsVos()) { + for (com.yxt.yyth.api.lpkgiftcard.GoodsVo goods1 : dto.getGoodsVos()) { if (goods1.getSelect() != 0) { goods.setCardSid(dto.getSid()); goods.setGoodsSid(goods1.getGoodsSid()); goods.setGoodsNumber(goods1.getSelect()); goods.setCreateTime(new DateTime()); - baseMapper.insert(goods); + lpkReserveOrderGoodsMapper.insert(goods); } } EmpGiftAppletVo vo = empCardGiftService.getGifCardBySid(dto.getSid()).getData(); int i = 0; for (GoodsVo vo1 : vo.getGoodsVos()) { - EmpReserveOrderGoods goods1 = baseMapper.getReserveByCardSid(dto.getSid(), vo1.getGoodsSid()); + LpkReserveOrderGoods goods1 = lpkReserveOrderGoodsMapper.getReserveByCardSid(dto.getSid(), vo1.getGoodsSid()); if (null != goods1) { if (vo1.getNum() <= goods1.getGoodsNumber()) { i++; @@ -62,6 +66,38 @@ public class EmpReserveOrderGoodsService extends MybatisBaseService select r.sid, - date_format(r.buildDate, '%Y-%m-%d') as buildDate, +-- date_format(r.buildDate, '%Y-%m-%d') as buildDate, + r.buildDate as buildDate, r.countNumber, r.startNumber, r.endNumber, diff --git a/src/main/java/com/yxt/yyth/biz/lpkgiftcard/LpkGiftCardService.java b/src/main/java/com/yxt/yyth/biz/lpkgiftcard/LpkGiftCardService.java index d936cd2..65f62f1 100644 --- a/src/main/java/com/yxt/yyth/biz/lpkgiftcard/LpkGiftCardService.java +++ b/src/main/java/com/yxt/yyth/biz/lpkgiftcard/LpkGiftCardService.java @@ -84,6 +84,8 @@ import java.util.regex.Pattern; public class LpkGiftCardService extends MybatisBaseService { @Value("${image.url.prefix:http://127.0.0.1:8080/upload/}") private String urlPrefix; + @Value("${weixin.qrcode.giftCard}") + String giftCardQrUrl; @Autowired com.yxt.yyth.biz.lpkgiftbaggoods.LpkGiftBagGoodsService LpkGiftBagGoodsService; @Autowired @@ -146,7 +148,6 @@ public class LpkGiftCardService extends MybatisBaseService qw = new QueryWrapper<>(); -// updateIsItInvalid(query.getCustomerSid()); if (StringUtils.isNotBlank(query.getCustomerSid())) { qw.eq("customerSid", query.getCustomerSid()); } @@ -157,20 +158,6 @@ public class LpkGiftCardService extends MybatisBaseService lpkGiftBags = lpkGiftBagService.list(new QueryWrapper().lt("dateEnd", sdf.format(new Date()))); -// for (LpkGiftBag lpkGiftBag : lpkGiftBags) { -// Integer i = baseMapper.selectCount(new QueryWrapper().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5")); -// if (i != 0) { -// baseMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5"); -// } -// } -// return rb.success(); -// } - - public ResultBean getGifCardBySid(String sid) { ResultBean rb = new ResultBean().fail(); AppletVo vo = baseMapper.getGifCardBySid(sid); @@ -444,7 +431,8 @@ public class LpkGiftCardService extends MybatisBaseService page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selGiftCard(page, qw); pagging.getRecords().forEach(s -> { - s.setQrCode("https://supervise.yxtsoft.com/lpkapi?code=" + s.getCode()); +// s.setQrCode("https://supervise.yxtsoft.com/lpkapi?code=" + s.getCode()); + s.setQrCode(giftCardQrUrl + s.getCode()); }); PagerVo p = PagerUtil.pageToVo(pagging, null); // System.out.println(a); @@ -503,7 +491,8 @@ public class LpkGiftCardService extends MybatisBaseService qw = new QueryWrapper<>(); qw.eq("1", "1"); if (StringUtils.isNotBlank(query.getState())) { @@ -1203,6 +1192,10 @@ public class LpkGiftCardService extends MybatisBaseService ${ew.sqlSegment} - UNION - SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate, - c.`code`, - case - when o.reserveDate IS NOT NULL then 2 - end as type, - s.`name` as store, - b.`name` as bagName, - o.cardSid as cardSid, - o.sid as orderSid, - o.userName, - o.userPhone,c.serialNumber as serialNumber, - o.sid - FROM emp_reserve_order AS o - LEFT JOIN lpk_store AS s ON o.storeSid = s.sid - LEFT JOIN emp_card_gift AS c ON o.cardSid = c.sid - LEFT JOIN lpk_giftbag AS b ON c.sid = b.sid - - ${ew.sqlSegment} - ORDER BY reserveDate DESC