12/4
This commit is contained in:
@@ -2,6 +2,7 @@ package com.yxt.yyth.api.lpkgiftcard;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.yxt.common.base.utils.StringUtils;
|
import com.yxt.common.base.utils.StringUtils;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
||||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -37,6 +38,8 @@ public class AppletVo {
|
|||||||
private String storeSid;//上次提货地点
|
private String storeSid;//上次提货地点
|
||||||
private String addressName;
|
private String addressName;
|
||||||
private String isReservation;//是否超过预约时间 0 否 1是
|
private String isReservation;//是否超过预约时间 0 否 1是
|
||||||
|
private boolean notRese=true; //是否能预约
|
||||||
|
private List<LpkReserveOrderCardVo> orderCardVoList;
|
||||||
|
|
||||||
|
|
||||||
public String getStart() {
|
public String getStart() {
|
||||||
@@ -90,6 +93,7 @@ public class AppletVo {
|
|||||||
if(states.equals("5")){
|
if(states.equals("5")){
|
||||||
if(isReservation.equals("0")){
|
if(isReservation.equals("0")){
|
||||||
this.state="已预约";
|
this.state="已预约";
|
||||||
|
this.notRese=false;
|
||||||
}else{
|
}else{
|
||||||
this.state="已完成";
|
this.state="已完成";
|
||||||
showBtn=false;
|
showBtn=false;
|
||||||
|
|||||||
@@ -3,10 +3,12 @@ package com.yxt.yyth.api.lpkreserveorder;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.yxt.common.core.vo.Vo;
|
import com.yxt.common.core.vo.Vo;
|
||||||
|
import com.yxt.yyth.api.lpkgiftcard.GoodsVo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Fan
|
* @author Fan
|
||||||
@@ -16,16 +18,20 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
public class LpkReserveOrderCardVo implements Vo {
|
public class LpkReserveOrderCardVo implements Vo {
|
||||||
private String code; //卡号
|
private String code; //卡号
|
||||||
|
private String sid;
|
||||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||||
private Date reserveDate; //预约时间
|
private Date reserveDate; //预约时间
|
||||||
private String store; //提货门店
|
private String store; //提货门店
|
||||||
|
private String storeSid; //提货门店
|
||||||
private String bagName; //礼包
|
private String bagName; //礼包
|
||||||
private String cardSid; // 提货卡sid
|
private String cardSid; // 提货卡sid
|
||||||
private String orderSid; //预约订单sid
|
private String orderSid; //预约订单sid
|
||||||
private String userName;
|
private String userName;
|
||||||
private String userPhone;
|
private String userPhone;
|
||||||
private String state;//提货状态
|
private String state;//提货状态
|
||||||
|
private List<GoodsVo> goodsVos;
|
||||||
|
private String goods;
|
||||||
|
|
||||||
public String getState() {
|
public String getState() {
|
||||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|||||||
@@ -20,5 +20,6 @@ public class LpkReserveOrderGoods {
|
|||||||
private String cardSid;
|
private String cardSid;
|
||||||
private String goodsSid;
|
private String goodsSid;
|
||||||
private double goodsNumber;
|
private double goodsNumber;
|
||||||
|
private String num;
|
||||||
private String orderSid;
|
private String orderSid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ import com.yxt.yyth.api.lpkcardgrantrecord.LpkCardGrantRecordDto;
|
|||||||
import com.yxt.yyth.api.lpkgiftbag.LpkGiftBag;
|
import com.yxt.yyth.api.lpkgiftbag.LpkGiftBag;
|
||||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoodsVo;
|
||||||
import com.yxt.yyth.api.lpkgiftcard.*;
|
import com.yxt.yyth.api.lpkgiftcard.*;
|
||||||
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrder;
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrder;
|
||||||
|
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
||||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo;
|
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;
|
||||||
@@ -28,6 +30,7 @@ import com.yxt.yyth.biz.lpkcardbuildrecord.LpkCardBuildRecordService;
|
|||||||
import com.yxt.yyth.biz.lpkcardgrantrecord.LpkCardGrantRecordService;
|
import com.yxt.yyth.biz.lpkcardgrantrecord.LpkCardGrantRecordService;
|
||||||
import com.yxt.yyth.biz.lpkgiftbag.LpkGiftBagService;
|
import com.yxt.yyth.biz.lpkgiftbag.LpkGiftBagService;
|
||||||
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.lpkreserveorder.LpkReserveOrderService;
|
import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderService;
|
||||||
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||||
import com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
import com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
||||||
@@ -70,6 +73,8 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
LpkReserveOrderService lpkReserveOrderService;
|
LpkReserveOrderService lpkReserveOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
LpkGiftBagService lpkGiftBagService;
|
LpkGiftBagService lpkGiftBagService;
|
||||||
|
@Autowired
|
||||||
|
LpkGoodsService lpkGoodsService;
|
||||||
|
|
||||||
public ResultBean bindCard(BindCardDto bindCardDto) {
|
public ResultBean bindCard(BindCardDto bindCardDto) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
@@ -163,31 +168,19 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
List<GoodsVo> goodsVos = new ArrayList<>();
|
List<GoodsVo> goodsVos = new ArrayList<>();
|
||||||
list.forEach(s -> {
|
list.forEach(s -> {
|
||||||
LpkReserveOrderGoods goods = lpkReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
LpkReserveOrderGoods goods = lpkReserveOrderGoodsService.getReserveByCardSid(vo.getSid(), s.getGoodsSid()).getData();
|
||||||
|
GoodsVo goodsVo = new GoodsVo();
|
||||||
|
goodsVo.setGoods(s.getGoodsName());
|
||||||
|
goodsVo.setNum(s.getGoodsNumber());
|
||||||
|
goodsVo.setGoodsSid(s.getGoodsSid());
|
||||||
|
goodsVo.setRemarks(s.getRemarks());
|
||||||
|
goodsVo.setPic(urlPrefix + s.getPicUrl());
|
||||||
if (vo.getState().equals("已过期")) {
|
if (vo.getState().equals("已过期")) {
|
||||||
GoodsVo goodsVo = new GoodsVo();
|
|
||||||
goodsVo.setGoods(s.getGoodsName());
|
|
||||||
goodsVo.setNum(s.getGoodsNumber());
|
|
||||||
goodsVo.setGoodsSid(s.getGoodsSid());
|
|
||||||
goodsVo.setRemarks(s.getRemarks());
|
|
||||||
goodsVo.setPic(urlPrefix + s.getPicUrl());
|
|
||||||
goodsVo.setLNum(0);
|
goodsVo.setLNum(0);
|
||||||
goodsVos.add(goodsVo);
|
goodsVos.add(goodsVo);
|
||||||
} else if (!vo.isShowBtn()) {
|
} else if (!vo.isShowBtn()) {
|
||||||
GoodsVo goodsVo = new GoodsVo();
|
|
||||||
goodsVo.setGoods(s.getGoodsName());
|
|
||||||
goodsVo.setNum(s.getGoodsNumber());
|
|
||||||
goodsVo.setGoodsSid(s.getGoodsSid());
|
|
||||||
goodsVo.setRemarks(s.getRemarks());
|
|
||||||
goodsVo.setPic(urlPrefix + s.getPicUrl());
|
|
||||||
goodsVo.setLNum(0);
|
goodsVo.setLNum(0);
|
||||||
goodsVos.add(goodsVo);
|
goodsVos.add(goodsVo);
|
||||||
} else {
|
} else {
|
||||||
GoodsVo goodsVo = new GoodsVo();
|
|
||||||
goodsVo.setGoods(s.getGoodsName());
|
|
||||||
goodsVo.setNum(s.getGoodsNumber());
|
|
||||||
goodsVo.setGoodsSid(s.getGoodsSid());
|
|
||||||
goodsVo.setRemarks(s.getRemarks());
|
|
||||||
goodsVo.setPic(urlPrefix + s.getPicUrl());
|
|
||||||
if (null != goods) {
|
if (null != goods) {
|
||||||
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
if (goods.getGoodsNumber() != s.getGoodsNumber()) {
|
||||||
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
goodsVo.setLNum(s.getGoodsNumber() - goods.getGoodsNumber());
|
||||||
@@ -200,6 +193,26 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
goodsVos.add(goodsVo);
|
goodsVos.add(goodsVo);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
List<LpkReserveOrderCardVo>lpkReserveOrderCardVos=lpkReserveOrderService.selOrderByCardSid(sid).getData();
|
||||||
|
for(LpkReserveOrderCardVo vo2:lpkReserveOrderCardVos){
|
||||||
|
List<GoodsVo> goodsVos1=new ArrayList<>();
|
||||||
|
List<LpkReserveOrderGoods> goods =lpkReserveOrderGoodsService.selByOrderSid(vo2.getSid());
|
||||||
|
for(LpkReserveOrderGoods goods1:goods){
|
||||||
|
GoodsVo goodsVo=new GoodsVo();
|
||||||
|
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods1.getGoodsSid()));
|
||||||
|
goodsVo.setNum(goods1.getGoodsNumber());
|
||||||
|
goodsVo.setGoods(lpkGoods.getName());
|
||||||
|
goodsVo.setRemarks(lpkGoods.getRemarks());
|
||||||
|
goodsVos1.add(goodsVo);
|
||||||
|
// if(StringUtils.isBlank(vo.getGoods())){
|
||||||
|
// vo.setGoods(lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName());
|
||||||
|
// }else{
|
||||||
|
// vo.setGoods(vo.getGoods()+" "+lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName());
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
vo2.setGoodsVos(goodsVos1);
|
||||||
|
}
|
||||||
|
vo.setOrderCardVoList(lpkReserveOrderCardVos);
|
||||||
vo.setGoodsVos(goodsVos);
|
vo.setGoodsVos(goodsVos);
|
||||||
return rb.success().setData(vo);
|
return rb.success().setData(vo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,8 @@
|
|||||||
typeCode,
|
typeCode,
|
||||||
price,
|
price,
|
||||||
picUrl,
|
picUrl,
|
||||||
remarks
|
remarks,
|
||||||
|
appContent
|
||||||
from lpk_goods
|
from lpk_goods
|
||||||
where sid=#{sid}
|
where sid=#{sid}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -28,4 +28,7 @@ public interface LpkReserveOrderMapper extends BaseMapper<LpkReserveOrder> {
|
|||||||
LpkReserveOrderVo getStoreByCustomerSid(@Param("sid") String sid);
|
LpkReserveOrderVo getStoreByCustomerSid(@Param("sid") String sid);
|
||||||
@Select("select * from lpk_reserve_order where cardSid =#{sid} order by reserveDate desc limit 1")
|
@Select("select * from lpk_reserve_order where cardSid =#{sid} order by reserveDate desc limit 1")
|
||||||
LpkReserveOrderVo selByCardSid(@Param("sid") String sid);
|
LpkReserveOrderVo selByCardSid(@Param("sid") String sid);
|
||||||
|
@Select("SELECT o.*,st.`name` AS store FROM lpk_reserve_order o LEFT JOIN lpk_store st ON o.storeSid = st.sid where o.cardSid =#{sid} ORDER BY o.reserveDate desc")
|
||||||
|
List<LpkReserveOrderCardVo> selOrderByCardSid(@Param("sid") String sid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,8 @@
|
|||||||
o.cardSid as cardSid,
|
o.cardSid as cardSid,
|
||||||
o.sid as orderSid,
|
o.sid as orderSid,
|
||||||
o.userName,
|
o.userName,
|
||||||
o.userPhone
|
o.userPhone,
|
||||||
|
o.sid
|
||||||
FROM lpk_reserve_order AS o
|
FROM lpk_reserve_order AS o
|
||||||
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
|
|||||||
@@ -137,6 +137,17 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
qw.orderByDesc("o.reserveDate");
|
qw.orderByDesc("o.reserveDate");
|
||||||
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<LpkReserveOrderCardVo> pagging = baseMapper.orderListByUserSid(page, qw);
|
IPage<LpkReserveOrderCardVo> pagging = baseMapper.orderListByUserSid(page, qw);
|
||||||
|
for(LpkReserveOrderCardVo vo:pagging.getRecords()){
|
||||||
|
List<LpkReserveOrderGoods> goods =lpkReserveOrderGoodsService.selByOrderSids(vo.getSid());
|
||||||
|
for(LpkReserveOrderGoods goods1:goods){
|
||||||
|
LpkGoods lpkGoods=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods1.getGoodsSid()));
|
||||||
|
if(StringUtils.isBlank(vo.getGoods())){
|
||||||
|
vo.setGoods(lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName());
|
||||||
|
}else{
|
||||||
|
vo.setGoods(vo.getGoods()+" "+lpkGoods.getName()+":"+goods1.getNum()+lpkGoods.getUnitName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
PagerVo<LpkReserveOrderCardVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<LpkReserveOrderCardVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
@@ -269,5 +280,7 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
public ResultBean<LpkReserveOrderVo> selByCardSid(String sid) {
|
public ResultBean<LpkReserveOrderVo> selByCardSid(String sid) {
|
||||||
return new ResultBean().success().setData(baseMapper.selByCardSid(sid));
|
return new ResultBean().success().setData(baseMapper.selByCardSid(sid));
|
||||||
}
|
}
|
||||||
|
public ResultBean<List<LpkReserveOrderCardVo>> selOrderByCardSid(String sid) {
|
||||||
|
return new ResultBean().success().setData(baseMapper.selOrderByCardSid(sid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,6 @@ public interface LpkReserveOrderGoodsMapper extends BaseMapper<LpkReserveOrderGo
|
|||||||
|
|
||||||
@Select("select * from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
@Select("select * from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||||
List<LpkReserveOrderGoods> selByOrderSid(String orderSid);
|
List<LpkReserveOrderGoods> selByOrderSid(String orderSid);
|
||||||
|
@Select("select *,goodsNumber as num from lpk_reserve_order_goods where orderSid=#{orderSid}")
|
||||||
|
List<LpkReserveOrderGoods> selByOrderSids(String orderSid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,4 +71,7 @@ public class LpkReserveOrderGoodsService extends MybatisBaseService<LpkReserveOr
|
|||||||
public List<LpkReserveOrderGoods> selByOrderSid(String orderSid) {
|
public List<LpkReserveOrderGoods> selByOrderSid(String orderSid) {
|
||||||
return baseMapper.selByOrderSid(orderSid);
|
return baseMapper.selByOrderSid(orderSid);
|
||||||
}
|
}
|
||||||
|
public List<LpkReserveOrderGoods> selByOrderSids(String orderSid) {
|
||||||
|
return baseMapper.selByOrderSids(orderSid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user