Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -47,7 +47,7 @@ public class EmpGiftAppletVo {
|
|||||||
private String addressName;
|
private String addressName;
|
||||||
private String isReservation;//是否超过预约时间 0 否 1是
|
private String isReservation;//是否超过预约时间 0 否 1是
|
||||||
private boolean notRese = true; //是否能预约
|
private boolean notRese = true; //是否能预约
|
||||||
private List<EmpReserveOrderCardVo> orderCardVoList;
|
private List<LpkReserveOrderCardVo> orderCardVoList;
|
||||||
private String value;
|
private String value;
|
||||||
private String serialNumber;
|
private String serialNumber;
|
||||||
private String isEnable;
|
private String isEnable;
|
||||||
|
|||||||
@@ -32,4 +32,5 @@ public class LpkGiftBag {
|
|||||||
private String boundaryPrice;
|
private String boundaryPrice;
|
||||||
private String iconUrl;
|
private String iconUrl;
|
||||||
private String isGrounding;
|
private String isGrounding;
|
||||||
|
private String isSel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,15 +106,15 @@ public class AppletVo {
|
|||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isShowBtn() {
|
// public boolean isShowBtn() {
|
||||||
if(states.equals("5")){
|
// if(states.equals("5")){
|
||||||
if(isReservation.equals("1")){
|
// if(isReservation.equals("1")){
|
||||||
this.state="已完成";
|
// this.state="已完成";
|
||||||
showBtn=false;
|
// showBtn=false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return showBtn;
|
// return showBtn;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String getState() {
|
public String getState() {
|
||||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|||||||
@@ -36,5 +36,6 @@ public class LpkGiftCard {
|
|||||||
private String recordId;
|
private String recordId;
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date bindDate;
|
private Date bindDate;
|
||||||
|
private String isItInvalid;
|
||||||
private String isReservation ;//是否超过预约时间 0 否 1是
|
private String isReservation ;//是否超过预约时间 0 否 1是
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,5 +27,6 @@ public class LpkReserveOrder{
|
|||||||
private String userAddress;
|
private String userAddress;
|
||||||
private String storeSid;
|
private String storeSid;
|
||||||
private String reserveDate;
|
private String reserveDate;
|
||||||
|
private String cardType;//提货类型,1=提货卡;2=福利卡
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,4 +23,6 @@ public class LpkReserveOrderDto implements Dto {
|
|||||||
private List<GoodsVo> goodsVos;
|
private List<GoodsVo> goodsVos;
|
||||||
private String orderSid;
|
private String orderSid;
|
||||||
private String addressName;
|
private String addressName;
|
||||||
|
private String cardType;//提货类型,1=提货卡;2=福利卡
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
|||||||
private HttpServletResponse response;
|
private HttpServletResponse response;
|
||||||
@Value("${image.url.prefix:http://127.0.0.1:8080/upload/}")
|
@Value("${image.url.prefix:http://127.0.0.1:8080/upload/}")
|
||||||
private String urlPrefix;
|
private String urlPrefix;
|
||||||
|
@Value("${weixin.qrcode.empCard}")
|
||||||
|
String qrUrl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -208,7 +210,8 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
|||||||
}
|
}
|
||||||
public void exportExcel(LpkGiftCardListQuery query) {
|
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<LpkGiftCard> qw = new QueryWrapper<>();
|
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
||||||
qw.eq("1", "1");
|
qw.eq("1", "1");
|
||||||
if (StringUtils.isNotBlank(query.getState())) {
|
if (StringUtils.isNotBlank(query.getState())) {
|
||||||
@@ -306,10 +309,10 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
|||||||
List<EmpCardGiftGoodsVo> l=empCardGiftGoodsService.getGoodsByEmpCardGiftSid(s.getSid()).getData();
|
List<EmpCardGiftGoodsVo> l=empCardGiftGoodsService.getGoodsByEmpCardGiftSid(s.getSid()).getData();
|
||||||
if(StringUtils.isNotBlank(s.getCustomerSid())){
|
if(StringUtils.isNotBlank(s.getCustomerSid())){
|
||||||
EmpCardGift empCardGift=new EmpCardGift();
|
EmpCardGift empCardGift=new EmpCardGift();
|
||||||
BeanUtil.copyProperties(EmpCardGiftVos, empCardGift, "id", "sid");
|
// BeanUtil.copyProperties(EmpCardGiftVos, empCardGift, "id", "sid");
|
||||||
s.setShare("3");
|
s.setShare("3");
|
||||||
empCardGift.setIsShare("3");
|
// empCardGift.setIsShare("3");
|
||||||
empCardGiftService.updateById(empCardGift);
|
// empCardGiftService.updateById(empCardGift);
|
||||||
}
|
}
|
||||||
l.forEach(c->{
|
l.forEach(c->{
|
||||||
if (StringUtils.isBlank(s.getGoods())) {
|
if (StringUtils.isBlank(s.getGoods())) {
|
||||||
@@ -326,7 +329,9 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
|||||||
|
|
||||||
vo.setGiftCodeKey(String.valueOf(randomNumber));
|
vo.setGiftCodeKey(String.valueOf(randomNumber));
|
||||||
vo.setGiftCode("99"+uuid.substring(2));
|
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);
|
return rb.success().setData(vo);
|
||||||
}
|
}
|
||||||
public ResultBean changState(String cardSid, String state) {
|
public ResultBean changState(String cardSid, String state) {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
gi.*,
|
gi.*,
|
||||||
gi.state AS states,
|
gi.state AS states,
|
||||||
gi.serialNumber AS serialNumber,
|
gi.serialNumber AS serialNumber,
|
||||||
go.goodsNumber,
|
|
||||||
gif.dateStart,
|
gif.dateStart,
|
||||||
gif.dateEnd,
|
gif.dateEnd,
|
||||||
CASE
|
CASE
|
||||||
@@ -24,7 +23,6 @@
|
|||||||
END stateValue
|
END stateValue
|
||||||
FROM
|
FROM
|
||||||
emp_card_gift gi
|
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 emp_card emp ON emp.sid = gi.empCardSid
|
||||||
LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid
|
LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid
|
||||||
<where>
|
<where>
|
||||||
@@ -37,7 +35,6 @@
|
|||||||
gi.*,
|
gi.*,
|
||||||
gi.state AS states,
|
gi.state AS states,
|
||||||
gi.serialNumber AS serialNumber,
|
gi.serialNumber AS serialNumber,
|
||||||
go.goodsNumber,
|
|
||||||
gif.dateStart,
|
gif.dateStart,
|
||||||
gif.dateEnd,
|
gif.dateEnd,
|
||||||
CASE
|
CASE
|
||||||
@@ -51,7 +48,6 @@
|
|||||||
END stateValue
|
END stateValue
|
||||||
FROM
|
FROM
|
||||||
emp_card_gift gi
|
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 emp_card emp ON emp.sid = gi.empCardSid
|
||||||
LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid
|
LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid
|
||||||
WHERE
|
WHERE
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.yxt.yyth.api.lpkgiftcard.BindCardDto;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,5 +109,8 @@ public class EmpCardGiftRest {
|
|||||||
// public ResultBean cardGrant(@RequestBody CardGrantDto dto) {
|
// public ResultBean cardGrant(@RequestBody CardGrantDto dto) {
|
||||||
// return EmpCardGiftService.cardGrant(dto);
|
// return EmpCardGiftService.cardGrant(dto);
|
||||||
// }
|
// }
|
||||||
|
//@Scheduled(cron = "0/1 * * * * ?")
|
||||||
|
//public void test() {
|
||||||
|
// System.out.println("执行");
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
|||||||
import com.yxt.yyth.api.lpkgiftcard.BindCardDto;
|
import com.yxt.yyth.api.lpkgiftcard.BindCardDto;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
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.lpkreserveordergoods.LpkReserveOrderGoods;
|
||||||
import com.yxt.yyth.api.lpkstore.LpkStoreDetailsVo;
|
import com.yxt.yyth.api.lpkstore.LpkStoreDetailsVo;
|
||||||
import com.yxt.yyth.biz.empcard.EmpCardService;
|
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.empreserveordergoods.EmpReserveOrderGoodsService;
|
||||||
import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
||||||
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
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 com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -70,10 +73,14 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
EmpCardService empCardService;
|
EmpCardService empCardService;
|
||||||
@Autowired
|
@Autowired
|
||||||
EmpCardGiftGoodsService empCardGiftGoodsService;
|
EmpCardGiftGoodsService empCardGiftGoodsService;
|
||||||
|
// @Autowired
|
||||||
|
// EmpReserveOrderGoodsService empReserveOrderGoodsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
EmpReserveOrderGoodsService empReserveOrderGoodsService;
|
LpkReserveOrderGoodsService lpkReserveOrderGoodsService;
|
||||||
|
// @Autowired
|
||||||
|
// EmpReserveOrderService empReserveOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
EmpReserveOrderService empReserveOrderService;
|
LpkReserveOrderService lpkReserveOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
LpkGoodsService lpkGoodsService;
|
LpkGoodsService lpkGoodsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -101,6 +108,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
}
|
}
|
||||||
empCardGift.setCustomerSid(bindCardDto.getCustomerSid());
|
empCardGift.setCustomerSid(bindCardDto.getCustomerSid());
|
||||||
empCardGift.setState("2");
|
empCardGift.setState("2");
|
||||||
|
empCardGift.setIsShare("3");
|
||||||
empCardGift.setBindDate(new Date());
|
empCardGift.setBindDate(new Date());
|
||||||
baseMapper.updateById(empCardGift);
|
baseMapper.updateById(empCardGift);
|
||||||
return rb.success().setMsg("绑定成功");
|
return rb.success().setMsg("绑定成功");
|
||||||
@@ -180,7 +188,8 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
List<EmpCardGiftGoodsVo> list = empCardGiftGoodsService.getGoodsByEmpCardGiftSid(vo.getSid()).getData();
|
List<EmpCardGiftGoodsVo> list = empCardGiftGoodsService.getGoodsByEmpCardGiftSid(vo.getSid()).getData();
|
||||||
List<GoodsVo> goodsVos = new ArrayList<>();
|
List<GoodsVo> goodsVos = new ArrayList<>();
|
||||||
list.forEach(s -> {
|
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 goodsVo = new GoodsVo();
|
||||||
goodsVo.setGoods(s.getName());
|
goodsVo.setGoods(s.getName());
|
||||||
goodsVo.setNum(s.getGoodsNumber());
|
goodsVo.setNum(s.getGoodsNumber());
|
||||||
@@ -207,10 +216,11 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
goodsVos.add(goodsVo);
|
goodsVos.add(goodsVo);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
List<EmpReserveOrderCardVo> empReserveOrderCardVos = empReserveOrderService.selOrderByCardSid(sid).getData();
|
// List<EmpReserveOrderCardVo> empReserveOrderCardVos = empReserveOrderService.selOrderByCardSid(sid).getData();
|
||||||
for (EmpReserveOrderCardVo vo2 : empReserveOrderCardVos) {
|
List<LpkReserveOrderCardVo> empReserveOrderCardVos = lpkReserveOrderService.selOrderByCardSid(sid).getData();
|
||||||
List<EmpReserveOrderGoods> goods = empReserveOrderGoodsService.selByOrderSids(vo2.getSid());
|
for (LpkReserveOrderCardVo vo2 : empReserveOrderCardVos) {
|
||||||
for (EmpReserveOrderGoods goods1 : goods) {
|
List<LpkReserveOrderGoods> goods = lpkReserveOrderGoodsService.selByOrderSids(vo2.getSid());
|
||||||
|
for (LpkReserveOrderGoods goods1 : goods) {
|
||||||
LpkGoods lpkGoods = lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid", goods1.getGoodsSid()));
|
LpkGoods lpkGoods = lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid", goods1.getGoodsSid()));
|
||||||
if (StringUtils.isBlank(vo2.getGoods())) {
|
if (StringUtils.isBlank(vo2.getGoods())) {
|
||||||
vo2.setGoods(lpkGoods.getName() + ":" + goods1.getNum() + lpkGoods.getUnitName());
|
vo2.setGoods(lpkGoods.getName() + ":" + goods1.getNum() + lpkGoods.getUnitName());
|
||||||
@@ -219,7 +229,8 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EmpReserveOrderVo vo1 = empReserveOrderService.getStoreByCustomerSid(vo.getCustomerSid()).getData();
|
//上次取货点
|
||||||
|
LpkReserveOrderVo vo1 = lpkReserveOrderService.getStoreByCustomerSid(vo.getCustomerSid()).getData();
|
||||||
if (null != vo1) {
|
if (null != vo1) {
|
||||||
LpkStoreDetailsVo vo2 = lpkStoreService.storeInit(vo1.getStoreSid()).getData();
|
LpkStoreDetailsVo vo2 = lpkStoreService.storeInit(vo1.getStoreSid()).getData();
|
||||||
if (null != vo2) {
|
if (null != vo2) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class EmpReserveOrderRest {
|
|||||||
|
|
||||||
@ApiOperation("预约提交")
|
@ApiOperation("预约提交")
|
||||||
@PostMapping("/submission")
|
@PostMapping("/submission")
|
||||||
public ResultBean submission(@RequestBody EmpReserveOrderDto dto) {
|
public ResultBean submission(@RequestBody LpkReserveOrderDto dto) {
|
||||||
return empReserveOrderService.submission(dto);
|
return empReserveOrderService.submission(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,16 @@ import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
|||||||
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
||||||
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrder;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
||||||
import com.yxt.yyth.api.lpkstore.LpkStore;
|
import com.yxt.yyth.api.lpkstore.LpkStore;
|
||||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||||
import com.yxt.yyth.biz.empreserveordergoods.EmpReserveOrderGoodsService;
|
import com.yxt.yyth.biz.empreserveordergoods.EmpReserveOrderGoodsService;
|
||||||
import com.yxt.yyth.biz.lpkgiftbaggoods.LpkGiftBagGoodsService;
|
import com.yxt.yyth.biz.lpkgiftbaggoods.LpkGiftBagGoodsService;
|
||||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper;
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper;
|
||||||
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
||||||
|
import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderMapper;
|
||||||
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||||
import com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
import com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -57,23 +61,44 @@ public class EmpReserveOrderService extends MybatisBaseService<EmpReserveOrderMa
|
|||||||
private LpkGoodsService lpkGoodsService;
|
private LpkGoodsService lpkGoodsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletResponse response;
|
private HttpServletResponse response;
|
||||||
|
@Autowired
|
||||||
|
LpkReserveOrderMapper lpkReserveOrderMapper;
|
||||||
|
@Autowired
|
||||||
|
LpkReserveOrderGoodsService lpkReserveOrderGoodsService;
|
||||||
|
|
||||||
public ResultBean submission(EmpReserveOrderDto dto) {
|
public ResultBean submission(LpkReserveOrderDto dto) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
boolean b=isSatAndSun(dto.getReserveDate());
|
boolean b=isSatAndSun(dto.getReserveDate());
|
||||||
if(!b){
|
if(!b){
|
||||||
return rb.setMsg("周六、周日不能预约提货");
|
return rb.setMsg("周六、周日不能预约提货");
|
||||||
}
|
}
|
||||||
EmpReserveOrder order = new EmpReserveOrder();
|
LpkReserveOrder order = new LpkReserveOrder();
|
||||||
BeanUtil.copyProperties(dto, order, "id", "sid");
|
BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||||
order.setStoreSid(dto.getValue());
|
order.setStoreSid(dto.getValue());
|
||||||
order.setCardSid(dto.getSid());
|
order.setCardSid(dto.getSid());
|
||||||
order.setCreateTime(new DateTime());
|
order.setCreateTime(new DateTime());
|
||||||
baseMapper.insert(order);
|
order.setCardType("2");
|
||||||
|
lpkReserveOrderMapper.insert(order);
|
||||||
dto.setOrderSid(order.getSid());
|
dto.setOrderSid(order.getSid());
|
||||||
empReserveOrderGoodsService.submissionDetail(dto);
|
empReserveOrderGoodsService.submissionDetail(dto);
|
||||||
return rb.success().setData("预约成功");
|
return rb.success().setData("预约成功");
|
||||||
}
|
}
|
||||||
|
// public ResultBean submission(EmpReserveOrderDto dto) {
|
||||||
|
// ResultBean rb = new ResultBean().fail();
|
||||||
|
// boolean b=isSatAndSun(dto.getReserveDate());
|
||||||
|
// if(!b){
|
||||||
|
// return rb.setMsg("周六、周日不能预约提货");
|
||||||
|
// }
|
||||||
|
// EmpReserveOrder order = new EmpReserveOrder();
|
||||||
|
// BeanUtil.copyProperties(dto, order, "id", "sid");
|
||||||
|
// order.setStoreSid(dto.getValue());
|
||||||
|
// order.setCardSid(dto.getSid());
|
||||||
|
// order.setCreateTime(new DateTime());
|
||||||
|
// baseMapper.insert(order);
|
||||||
|
// dto.setOrderSid(order.getSid());
|
||||||
|
// empReserveOrderGoodsService.submissionDetail(dto);
|
||||||
|
// return rb.success().setData("预约成功");
|
||||||
|
// }
|
||||||
public boolean isSatAndSun(String date){
|
public boolean isSatAndSun(String date){
|
||||||
DateTime dateTime = DateUtil.parse(date);; // 获取当前时间
|
DateTime dateTime = DateUtil.parse(date);; // 获取当前时间
|
||||||
int dayOfWeek = dateTime.dayOfWeekEnum().getValue();// 获取星期几(1-7)
|
int dayOfWeek = dateTime.dayOfWeekEnum().getValue();// 获取星期几(1-7)
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ import com.yxt.yyth.api.empreserveordergoods.EmpReserveOrderGoods;
|
|||||||
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
||||||
import com.yxt.yyth.api.empcardgift.GoodsVo;
|
import com.yxt.yyth.api.empcardgift.GoodsVo;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderDto;
|
||||||
|
import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods;
|
||||||
import com.yxt.yyth.biz.empcardgift.EmpCardGiftService;
|
import com.yxt.yyth.biz.empcardgift.EmpCardGiftService;
|
||||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
||||||
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsMapper;
|
||||||
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -25,30 +28,31 @@ import java.util.List;
|
|||||||
public class EmpReserveOrderGoodsService extends MybatisBaseService<EmpReserveOrderGoodsMapper, EmpReserveOrderGoods> {
|
public class EmpReserveOrderGoodsService extends MybatisBaseService<EmpReserveOrderGoodsMapper, EmpReserveOrderGoods> {
|
||||||
@Autowired
|
@Autowired
|
||||||
EmpCardGiftService empCardGiftService;
|
EmpCardGiftService empCardGiftService;
|
||||||
|
@Autowired
|
||||||
|
LpkReserveOrderGoodsMapper lpkReserveOrderGoodsMapper;
|
||||||
public ResultBean<EmpReserveOrderGoods> getReserveByCardSid(String carSid, String goodsSid) {
|
public ResultBean<EmpReserveOrderGoods> getReserveByCardSid(String carSid, String goodsSid) {
|
||||||
ResultBean rb = new ResultBean();
|
ResultBean rb = new ResultBean();
|
||||||
EmpReserveOrderGoods goods = baseMapper.getReserveByCardSid(carSid, goodsSid);
|
EmpReserveOrderGoods goods = baseMapper.getReserveByCardSid(carSid, goodsSid);
|
||||||
return rb.success().setData(goods);
|
return rb.success().setData(goods);
|
||||||
}
|
}
|
||||||
|
public ResultBean submissionDetail(LpkReserveOrderDto dto) {
|
||||||
public ResultBean submissionDetail(EmpReserveOrderDto dto) {
|
|
||||||
ResultBean rb = new ResultBean();
|
ResultBean rb = new ResultBean();
|
||||||
EmpReserveOrderGoods goods = new EmpReserveOrderGoods();
|
LpkReserveOrderGoods goods = new LpkReserveOrderGoods();
|
||||||
BeanUtil.copyProperties(dto, goods, "id", "sid");
|
BeanUtil.copyProperties(dto, goods, "id", "sid");
|
||||||
goods.setCardSid(dto.getSid());
|
goods.setCardSid(dto.getSid());
|
||||||
for (GoodsVo goods1 : dto.getGoodsVos()) {
|
for (com.yxt.yyth.api.lpkgiftcard.GoodsVo goods1 : dto.getGoodsVos()) {
|
||||||
if (goods1.getSelect() != 0) {
|
if (goods1.getSelect() != 0) {
|
||||||
goods.setCardSid(dto.getSid());
|
goods.setCardSid(dto.getSid());
|
||||||
goods.setGoodsSid(goods1.getGoodsSid());
|
goods.setGoodsSid(goods1.getGoodsSid());
|
||||||
goods.setGoodsNumber(goods1.getSelect());
|
goods.setGoodsNumber(goods1.getSelect());
|
||||||
goods.setCreateTime(new DateTime());
|
goods.setCreateTime(new DateTime());
|
||||||
baseMapper.insert(goods);
|
lpkReserveOrderGoodsMapper.insert(goods);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EmpGiftAppletVo vo = empCardGiftService.getGifCardBySid(dto.getSid()).getData();
|
EmpGiftAppletVo vo = empCardGiftService.getGifCardBySid(dto.getSid()).getData();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (GoodsVo vo1 : vo.getGoodsVos()) {
|
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 (null != goods1) {
|
||||||
if (vo1.getNum() <= goods1.getGoodsNumber()) {
|
if (vo1.getNum() <= goods1.getGoodsNumber()) {
|
||||||
i++;
|
i++;
|
||||||
@@ -62,6 +66,38 @@ public class EmpReserveOrderGoodsService extends MybatisBaseService<EmpReserveOr
|
|||||||
}
|
}
|
||||||
return rb.success().setData("预约成功");
|
return rb.success().setData("预约成功");
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// public ResultBean submissionDetail(EmpReserveOrderDto dto) {
|
||||||
|
// ResultBean rb = new ResultBean();
|
||||||
|
// EmpReserveOrderGoods goods = new EmpReserveOrderGoods();
|
||||||
|
// BeanUtil.copyProperties(dto, goods, "id", "sid");
|
||||||
|
// goods.setCardSid(dto.getSid());
|
||||||
|
// for (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);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// EmpGiftAppletVo vo = empCardGiftService.getGifCardBySid(dto.getSid()).getData();
|
||||||
|
// int i = 0;
|
||||||
|
// for (GoodsVo vo1 : vo.getGoodsVos()) {
|
||||||
|
// EmpReserveOrderGoods goods1 = baseMapper.getReserveByCardSid(dto.getSid(), vo1.getGoodsSid());
|
||||||
|
// if (null != goods1) {
|
||||||
|
// if (vo1.getNum() <= goods1.getGoodsNumber()) {
|
||||||
|
// i++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (vo.getGoodsVos().size() == i) {
|
||||||
|
// empCardGiftService.changState(dto.getSid(), "5");
|
||||||
|
// } else {
|
||||||
|
// empCardGiftService.changState(dto.getSid(), "4");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return rb.success().setData("预约成功");
|
||||||
|
// }
|
||||||
|
|
||||||
public EmpReserveOrderGoods selByOrderSidAndGoodSid(String orderSid, String goodsSid) {
|
public EmpReserveOrderGoods selByOrderSidAndGoodSid(String orderSid, String goodsSid) {
|
||||||
return baseMapper.selByOrderSidAndGoodSid(orderSid,goodsSid);
|
return baseMapper.selByOrderSidAndGoodSid(orderSid,goodsSid);
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<select id="recordListPage" resultType="com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo">
|
<select id="recordListPage" resultType="com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo">
|
||||||
select
|
select
|
||||||
r.sid,
|
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.countNumber,
|
||||||
r.startNumber,
|
r.startNumber,
|
||||||
r.endNumber,
|
r.endNumber,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public interface LpkGiftCardMapper extends BaseMapper<LpkGiftCard> {
|
|||||||
@Select("select count(id) from lpk_giftcard where recordSid=#{recordSid} and grantRecordSid is not null")
|
@Select("select count(id) from lpk_giftcard where recordSid=#{recordSid} and grantRecordSid is not null")
|
||||||
Integer cardGrantCount(@Param("recordSid") String recordSid);
|
Integer cardGrantCount(@Param("recordSid") String recordSid);
|
||||||
|
|
||||||
@Select("update lpk_giftcard set isItInvalid='1' where giftbagSid=#{giftbagSid} and state!=#{state} ")
|
@Select("update lpk_giftcard set isItInvalid='1',state='5',isReservation='1' where giftbagSid=#{giftbagSid} and state!=#{state} ")
|
||||||
Integer updateIsItInvalid(@Param("giftbagSid") String giftbagSid, @Param("state") String state);
|
Integer updateIsItInvalid(@Param("giftbagSid") String giftbagSid, @Param("state") String state);
|
||||||
|
|
||||||
// List<LpkGiftCardWordVo> selGiftCard(@Param("serialNumbers") List<Integer> serialNumbers);
|
// List<LpkGiftCardWordVo> selGiftCard(@Param("serialNumbers") List<Integer> serialNumbers);
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ import java.util.regex.Pattern;
|
|||||||
public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, LpkGiftCard> {
|
public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, LpkGiftCard> {
|
||||||
@Value("${image.url.prefix:http://127.0.0.1:8080/upload/}")
|
@Value("${image.url.prefix:http://127.0.0.1:8080/upload/}")
|
||||||
private String urlPrefix;
|
private String urlPrefix;
|
||||||
|
@Value("${weixin.qrcode.giftCard}")
|
||||||
|
String giftCardQrUrl;
|
||||||
@Autowired
|
@Autowired
|
||||||
com.yxt.yyth.biz.lpkgiftbaggoods.LpkGiftBagGoodsService LpkGiftBagGoodsService;
|
com.yxt.yyth.biz.lpkgiftbaggoods.LpkGiftBagGoodsService LpkGiftBagGoodsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -146,7 +148,6 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
return rb.setMsg("参数不能为空");
|
return rb.setMsg("参数不能为空");
|
||||||
}
|
}
|
||||||
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
||||||
// updateIsItInvalid(query.getCustomerSid());
|
|
||||||
if (StringUtils.isNotBlank(query.getCustomerSid())) {
|
if (StringUtils.isNotBlank(query.getCustomerSid())) {
|
||||||
qw.eq("customerSid", query.getCustomerSid());
|
qw.eq("customerSid", query.getCustomerSid());
|
||||||
}
|
}
|
||||||
@@ -157,20 +158,6 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public ResultBean updateIsItInvalid() {
|
|
||||||
// ResultBean rb = new ResultBean();
|
|
||||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
||||||
// List<LpkGiftBag> lpkGiftBags = lpkGiftBagService.list(new QueryWrapper<LpkGiftBag>().lt("dateEnd", sdf.format(new Date())));
|
|
||||||
// for (LpkGiftBag lpkGiftBag : lpkGiftBags) {
|
|
||||||
// Integer i = baseMapper.selectCount(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5"));
|
|
||||||
// if (i != 0) {
|
|
||||||
// baseMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return rb.success();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
public ResultBean<AppletVo> getGifCardBySid(String sid) {
|
public ResultBean<AppletVo> getGifCardBySid(String sid) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
AppletVo vo = baseMapper.getGifCardBySid(sid);
|
AppletVo vo = baseMapper.getGifCardBySid(sid);
|
||||||
@@ -444,7 +431,8 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
IPage<LpkGiftCard> page = PagerUtil.queryToPage(pq);
|
IPage<LpkGiftCard> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<LpkGiftCardWordVo> pagging = baseMapper.selGiftCard(page, qw);
|
IPage<LpkGiftCardWordVo> pagging = baseMapper.selGiftCard(page, qw);
|
||||||
pagging.getRecords().forEach(s -> {
|
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<LpkGiftCardWordVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<LpkGiftCardWordVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
// System.out.println(a);
|
// System.out.println(a);
|
||||||
@@ -503,7 +491,8 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
|
|
||||||
public void exportExcel(LpkGiftCardListQuery query) {
|
public void exportExcel(LpkGiftCardListQuery query) {
|
||||||
|
|
||||||
String finUrl = "https://supervise.yxtsoft.com/lpkapi?code=";
|
// String finUrl = "https://supervise.yxtsoft.com/lpkapi?code=";
|
||||||
|
String finUrl = giftCardQrUrl;
|
||||||
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
||||||
qw.eq("1", "1");
|
qw.eq("1", "1");
|
||||||
if (StringUtils.isNotBlank(query.getState())) {
|
if (StringUtils.isNotBlank(query.getState())) {
|
||||||
@@ -1203,6 +1192,10 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
returnMsg.setInfos(voList);
|
returnMsg.setInfos(voList);
|
||||||
return returnMsg;
|
return returnMsg;
|
||||||
}
|
}
|
||||||
|
public ResultBean DownLoadTemplate(){
|
||||||
|
ResultBean rb=new ResultBean();
|
||||||
|
return rb.success().setData("");
|
||||||
|
}
|
||||||
// public static void main(String[] args) {
|
// public static void main(String[] args) {
|
||||||
// LocalDate start = LocalDate.of(2021, Month.JANUARY, 1); // 设置起始日期为2021年1月1日
|
// LocalDate start = LocalDate.of(2021, Month.JANUARY, 1); // 设置起始日期为2021年1月1日
|
||||||
// LocalDate end = LocalDate.now(); // 设置结束日期为当前日期
|
// LocalDate end = LocalDate.now(); // 设置结束日期为当前日期
|
||||||
|
|||||||
@@ -130,26 +130,6 @@
|
|||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
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
|
|
||||||
<where>
|
|
||||||
${ew.sqlSegment}
|
|
||||||
</where>
|
|
||||||
ORDER BY reserveDate DESC
|
ORDER BY reserveDate DESC
|
||||||
</select>
|
</select>
|
||||||
<select id="exportExcel" resultType="com.yxt.yyth.api.lpkreserveorder.ReserveOrderExport">
|
<select id="exportExcel" resultType="com.yxt.yyth.api.lpkreserveorder.ReserveOrderExport">
|
||||||
|
|||||||
@@ -7,9 +7,13 @@ import com.yxt.yyth.api.lpkgiftbag.LpkGiftBag;
|
|||||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCard;
|
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCard;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo;
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo;
|
||||||
import com.yxt.yyth.biz.lpkgiftbag.LpkGiftBagService;
|
import com.yxt.yyth.biz.lpkgiftbag.LpkGiftBagService;
|
||||||
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper;
|
||||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
||||||
|
import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderService;
|
||||||
|
import org.junit.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -19,48 +23,49 @@ import java.util.List;
|
|||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
* @date 2023/12/20 10:44
|
* @date 2023/12/20 10:44
|
||||||
*/
|
*/
|
||||||
|
@RestController
|
||||||
public class scheduledRest {
|
public class scheduledRest {
|
||||||
@Autowired
|
@Autowired
|
||||||
LpkGiftBagService lpkGiftBagService;
|
LpkGiftBagService lpkGiftBagService;
|
||||||
@Autowired
|
@Autowired
|
||||||
LpkGiftCardService lpkGiftCardService;
|
LpkGiftCardMapper lpkGiftCardMapper;
|
||||||
// @Scheduled(cron = "0 0 1 * * ? ")
|
@Autowired
|
||||||
public void updateIsItInvalid(String customerSid) {
|
LpkReserveOrderService lpkReserveOrderService;
|
||||||
// ResultBean rb = new ResultBean();
|
@Scheduled(cron = "0 0 1 * * ? ")
|
||||||
// List<LpkGiftBag> lpkGiftBags = lpkGiftBagService.list(new QueryWrapper<LpkGiftBag>());
|
public void updateIsItInvalid() {
|
||||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
List<LpkGiftBag> lpkGiftBags = lpkGiftBagService.list(new QueryWrapper<LpkGiftBag>().eq("isSel","1"));
|
||||||
// for (LpkGiftBag lpkGiftBag : lpkGiftBags) {
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
// int in = DateUtil.parse(sdf.format(lpkGiftBag.getDateEnd())).compareTo(DateUtil.parse(sdf.format(new Date())));
|
for (LpkGiftBag lpkGiftBag : lpkGiftBags) {
|
||||||
// if (String.valueOf(in).equals("-1")) {
|
//1>2 1 、1<2 -1 、1=2 0
|
||||||
// Integer i = baseMapper.selectCount(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5"));
|
int in = DateUtil.parse(sdf.format(lpkGiftBag.getDateEnd())).compareTo(DateUtil.parse(sdf.format(new Date())));
|
||||||
// if (i != 0) {
|
if (String.valueOf(in).equals("-1")) {
|
||||||
// baseMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5");
|
Integer i = lpkGiftCardMapper.selectCount(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5"));
|
||||||
// }
|
if (i != 0) {
|
||||||
// } else {
|
lpkGiftBag.setIsSel("2");
|
||||||
// List<LpkGiftCard> list = baseMapper.selectList(new QueryWrapper<LpkGiftCard>().eq("customerSid", customerSid).eq("giftbagSid", lpkGiftBag.getSid()));
|
lpkGiftBagService.updateById(lpkGiftBag);
|
||||||
// for (LpkGiftCard card : list) {
|
lpkGiftCardMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5");
|
||||||
// LpkReserveOrderVo LpkReserveOrderVo = lpkReserveOrderService.selByCardSid(card.getSid()).getData();
|
|
||||||
// if (null != LpkReserveOrderVo) {
|
|
||||||
// int c = DateUtil.parse(sdf.format(LpkReserveOrderVo.getReserveDate())).compareTo(DateUtil.parse(sdf.format(new Date())));
|
|
||||||
//// LpkGiftCard card1 = baseMapper.selectOne(new QueryWrapper<LpkGiftCard>().eq("sid", card.getSid()));
|
|
||||||
// if (String.valueOf(c).equals("-1")) {
|
|
||||||
// card.setIsReservation("1");
|
|
||||||
// baseMapper.updateById(card);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
||||||
//// List<LpkGiftBag> lpkGiftBags = lpkGiftBagService.list(new QueryWrapper<LpkGiftBag>().lt("dateEnd", sdf.format(new Date())));
|
|
||||||
//// for (LpkGiftBag lpkGiftBag : lpkGiftBags) {
|
|
||||||
//// Integer i = baseMapper.selectCount(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5"));
|
|
||||||
//// if (i != 0) {
|
|
||||||
//// baseMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5");
|
|
||||||
//// }
|
|
||||||
//// }
|
|
||||||
// return rb.success();
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// List<LpkGiftCard> list = lpkGiftCardMapper.selectList(new QueryWrapper<LpkGiftCard>().eq("customerSid", customerSid).eq("giftbagSid", lpkGiftBag.getSid()));
|
||||||
|
List<LpkGiftCard> list = lpkGiftCardMapper.selectList(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()));
|
||||||
|
for (LpkGiftCard card : list) {
|
||||||
|
LpkReserveOrderVo LpkReserveOrderVo = lpkReserveOrderService.selByCardSid(card.getSid()).getData();
|
||||||
|
if (null != LpkReserveOrderVo) {
|
||||||
|
int c = DateUtil.parse(sdf.format(LpkReserveOrderVo.getReserveDate())).compareTo(DateUtil.parse(sdf.format(new Date())));
|
||||||
|
if (String.valueOf(c).equals("-1")) {
|
||||||
|
if(card.getState().equals("5")){
|
||||||
|
card.setIsItInvalid("1");
|
||||||
|
}
|
||||||
|
card.setIsReservation("1");
|
||||||
|
lpkGiftCardMapper.updateById(card);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// @Scheduled(cron = "0/1 * * * * ?")
|
||||||
|
// public void test() {
|
||||||
|
// System.out.println("执行");
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
|||||||
.excludePathPatterns("/lpkgoods/goodsDetails/**")
|
.excludePathPatterns("/lpkgoods/goodsDetails/**")
|
||||||
.excludePathPatterns("/lpkstore/getAllStoreByQuery")
|
.excludePathPatterns("/lpkstore/getAllStoreByQuery")
|
||||||
.excludePathPatterns("/lpkgiftcard/getCardByBank")
|
.excludePathPatterns("/lpkgiftcard/getCardByBank")
|
||||||
|
.excludePathPatterns("/empcardgift/shareEmpCard/**")
|
||||||
.excludePathPatterns("/lpkcustomer/wxSilentLogin");
|
.excludePathPatterns("/lpkcustomer/wxSilentLogin");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,18 @@ package com.yxt.yyth.config;
|
|||||||
|
|
||||||
import com.yxt.common.base.config.handler.GlobalExceptionHandler;
|
import com.yxt.common.base.config.handler.GlobalExceptionHandler;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.validation.BindException;
|
import org.springframework.validation.BindException;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.validation.FieldError;
|
import org.springframework.validation.FieldError;
|
||||||
|
import org.springframework.validation.ObjectError;
|
||||||
|
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
import org.springframework.web.servlet.NoHandlerFoundException;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -18,12 +23,45 @@ import java.util.List;
|
|||||||
* @description 全局异常处理
|
* @description 全局异常处理
|
||||||
*/
|
*/
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class SaTokenGloableException {
|
public class SaTokenGloableException extends GlobalExceptionHandler {
|
||||||
|
|
||||||
|
private static final Logger L = LoggerFactory.getLogger(GlobalExceptionHandler.class);
|
||||||
|
|
||||||
|
public SaTokenGloableException() {
|
||||||
|
}
|
||||||
@ExceptionHandler({Exception.class})
|
@ExceptionHandler({Exception.class})
|
||||||
public ResultBean handleException(Exception e) {
|
public ResultBean handleException(Exception e) {
|
||||||
|
|
||||||
if(e.getMessage().contains("token 无效:")){
|
if(e.getMessage().contains("token 无效:")){
|
||||||
|
L.error(e.getMessage(), e);
|
||||||
return ResultBean.fireFail().setCode("5000").setMsg("系统异常::" + e.getMessage());
|
return ResultBean.fireFail().setCode("5000").setMsg("系统异常::" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
L.error(e.getMessage(), e);
|
||||||
return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage());
|
return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ExceptionHandler({NoHandlerFoundException.class})
|
||||||
|
public ResultBean handlerNoFoundException(Exception e) {
|
||||||
|
L.error(e.getMessage(), e);
|
||||||
|
return ResultBean.fireFail().setCode("404").setMsg("路径不存在,请检查路径是否正确");
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ExceptionHandler({Exception.class})
|
||||||
|
// public ResultBean handleException(Exception e) {
|
||||||
|
// L.error(e.getMessage(), e);
|
||||||
|
// return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage());
|
||||||
|
// }
|
||||||
|
|
||||||
|
@ExceptionHandler({BindException.class})
|
||||||
|
public ResultBean validatedBindException(BindException e) {
|
||||||
|
L.error(e.getMessage(), e);
|
||||||
|
String message = ((ObjectError)e.getAllErrors().get(0)).getDefaultMessage();
|
||||||
|
return ResultBean.fireFail().setCode("405").setMsg(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExceptionHandler({MethodArgumentNotValidException.class})
|
||||||
|
public ResultBean validExceptionHandler(MethodArgumentNotValidException e) {
|
||||||
|
L.error(e.getMessage(), e);
|
||||||
|
String message = e.getBindingResult().getFieldError().getDefaultMessage();
|
||||||
|
return ResultBean.fireFail().setCode("405").setMsg(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,3 +37,7 @@ weixin:
|
|||||||
miniprogram:
|
miniprogram:
|
||||||
appid: wx97c0a62c6d65207f
|
appid: wx97c0a62c6d65207f
|
||||||
secret: e4572da4407573213377cd00e422397d
|
secret: e4572da4407573213377cd00e422397d
|
||||||
|
qrcode:
|
||||||
|
giftCard: https://lpk.yyundong.com/lpkapi?code=
|
||||||
|
empCard: https://lpk.yyundong.com/lpkapi?qy=
|
||||||
|
empCardGift: https://lpk.yyundong.com/lpkapi?code=
|
||||||
@@ -32,3 +32,7 @@ weixin:
|
|||||||
miniprogram:
|
miniprogram:
|
||||||
appid: wx4724e3a3c27f36b5
|
appid: wx4724e3a3c27f36b5
|
||||||
secret: 971fd3b8aa7b08ce3e8a5f3e502b1a8d
|
secret: 971fd3b8aa7b08ce3e8a5f3e502b1a8d
|
||||||
|
qrcode:
|
||||||
|
giftCard: https://supervise.yxtsoft.com/lpkapi?code=
|
||||||
|
empCard: https://supervise.yxtsoft.com/lpkapi?qy=
|
||||||
|
empCardGift: https://supervise.yxtsoft.com/lpkapi?code=
|
||||||
@@ -37,3 +37,7 @@ weixin:
|
|||||||
miniprogram:
|
miniprogram:
|
||||||
appid: wx97c0a62c6d65207f
|
appid: wx97c0a62c6d65207f
|
||||||
secret: e4572da4407573213377cd00e422397d
|
secret: e4572da4407573213377cd00e422397d
|
||||||
|
qrcode:
|
||||||
|
giftCard: https://lpk.yyundong.com/lpkapi?code=
|
||||||
|
empCard: https://lpk.yyundong.com/lpkapi?qy=
|
||||||
|
empCardGift: https://lpk.yyundong.com/lpkapi?code=
|
||||||
Reference in New Issue
Block a user