12/28
This commit is contained in:
@@ -37,5 +37,11 @@ public class EmpCardGift {
|
||||
private String isItInvalid;
|
||||
private String isReservation;
|
||||
private String isShare;
|
||||
private String cardType; //1企业卡 2 福礼卡 3提货卡
|
||||
private String isTransfer; //是否转增 0 未转赠 1 转赠
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date endDate; //结束日期
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date startDate; //开始日期
|
||||
|
||||
}
|
||||
|
||||
@@ -40,4 +40,5 @@ public class EmpCardGiftDto implements Dto {
|
||||
private String iReservation;
|
||||
private List<GoodsVo> goodsVoList;
|
||||
private String count;
|
||||
private String cardType;
|
||||
}
|
||||
|
||||
@@ -48,9 +48,12 @@ public class EmpGiftAppletVo {
|
||||
private String isReservation;//是否超过预约时间 0 否 1是
|
||||
private boolean notRese = true; //是否能预约
|
||||
private List<LpkReserveOrderCardVo> orderCardVoList;
|
||||
private EmpCardGift empCardGift;
|
||||
private String value;
|
||||
private String serialNumber;
|
||||
private String isEnable;
|
||||
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
||||
|
||||
|
||||
|
||||
public String getStart() {
|
||||
@@ -128,7 +131,13 @@ public class EmpGiftAppletVo {
|
||||
}else if(isEnable.equals("2")){
|
||||
state="已作废";
|
||||
showBtn=false;
|
||||
}else{
|
||||
}
|
||||
else if(isTransfer.equals("1")){
|
||||
state="已转赠";
|
||||
// showBtn=false;
|
||||
this.notRese=false;
|
||||
}
|
||||
else{
|
||||
state="待提货";
|
||||
if(states.equals("5")){
|
||||
if(isReservation.equals("0")){
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.yxt.yyth.api.lpkgiftcard;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGift;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftVo;
|
||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||
import lombok.Data;
|
||||
@@ -45,9 +47,12 @@ public class AppletVo {
|
||||
private String isReservation;//是否超过预约时间 0 否 1是
|
||||
private boolean notRese=true; //是否能预约
|
||||
private List<LpkReserveOrderCardVo> orderCardVoList;
|
||||
private EmpCardGift empCardGift;
|
||||
private String value;
|
||||
private String serialNumber;
|
||||
private String isEnable;
|
||||
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +131,13 @@ public class AppletVo {
|
||||
}else if(isEnable.equals("2")){
|
||||
state="已作废";
|
||||
showBtn=false;
|
||||
}else{
|
||||
}
|
||||
else if(isTransfer.equals("1")){
|
||||
state="已转赠";
|
||||
// showBtn=false;
|
||||
this.notRese=false;
|
||||
}
|
||||
else{
|
||||
state="待提货";
|
||||
if(states.equals("5")){
|
||||
if(isReservation.equals("0")){
|
||||
|
||||
@@ -38,4 +38,5 @@ public class LpkGiftCard {
|
||||
private Date bindDate;
|
||||
private String isItInvalid;
|
||||
private String isReservation ;//是否超过预约时间 0 否 1是
|
||||
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
||||
}
|
||||
|
||||
@@ -326,22 +326,21 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
||||
// empCardGiftService.updateById(empCardGift);
|
||||
}
|
||||
l.forEach(c->{
|
||||
if(c.getGoodsNumber()!=0){
|
||||
if (StringUtils.isBlank(s.getGoods())) {
|
||||
s.setGoods(c.getName() + ":" + c.getGoodsNumber() + c.getUnitName());
|
||||
} else {
|
||||
s.setGoods(s.getGoods() + " " + c.getName() + ":" + c.getGoodsNumber() + c.getUnitName());
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
vo.setEmpCardGiftVos(EmpCardGiftVos);
|
||||
vo.setGoodsVos(goodsVos);
|
||||
String uuid = UniqueIdGenerator.generateUniqueID();
|
||||
int randomNumber = new Random().nextInt(900000) + 100000;
|
||||
|
||||
vo.setGiftCodeKey(String.valueOf(randomNumber));
|
||||
vo.setGiftCode("99"+uuid.substring(2));
|
||||
// vo.setQrCode("https://supervise.yxtsoft.com/lpkapi?qy="+vo.getGiftCode());
|
||||
|
||||
vo.setQrCode(qrUrl+vo.getGiftCode());
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
gi.*,
|
||||
gi.state AS states,
|
||||
gi.serialNumber AS serialNumber,
|
||||
gif.dateStart,
|
||||
gif.dateEnd,
|
||||
gi.startDate as dateStart,
|
||||
gi.endDate as dateEnd,
|
||||
CASE
|
||||
gi.state
|
||||
WHEN 3 THEN
|
||||
@@ -28,15 +28,15 @@
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
ORDER BY gi.isItInvalid desc,gi.bindDate desc
|
||||
ORDER BY gi.isItInvalid asc,gi.bindDate desc
|
||||
</select>
|
||||
<select id="getGifCardBySid" resultType="com.yxt.yyth.api.empcardgift.EmpGiftAppletVo">
|
||||
SELECT
|
||||
gi.*,
|
||||
gi.state AS states,
|
||||
gi.serialNumber AS serialNumber,
|
||||
gif.dateStart,
|
||||
gif.dateEnd,
|
||||
gi.startDate as dateStart,
|
||||
gi.endDate as dateEnd,
|
||||
CASE
|
||||
gi.state
|
||||
WHEN 3 THEN
|
||||
|
||||
@@ -57,10 +57,20 @@ public class EmpCardGiftRest {
|
||||
}
|
||||
|
||||
@PostMapping("/generateCard")
|
||||
@ApiOperation(value = "生成礼包卡信息")
|
||||
@ApiOperation(value = "企业卡生成福礼卡信息")
|
||||
public ResultBean generateCard(@RequestBody EmpCardGiftDto dto) {
|
||||
return EmpCardGiftService.generateCard(dto);
|
||||
}
|
||||
@PostMapping("/generateEmpCard")
|
||||
@ApiOperation(value = "提货卡生成福礼卡信息")
|
||||
public ResultBean generateEmpCard(@RequestBody EmpCardGiftDto dto) {
|
||||
return EmpCardGiftService.generateEmpCard(dto);
|
||||
}
|
||||
@PostMapping("/generateEmpCardGift")
|
||||
@ApiOperation(value = "福礼卡生成福礼卡信息")
|
||||
public ResultBean generateEmpCardGift(@RequestBody EmpCardGiftDto dto) {
|
||||
return EmpCardGiftService.generateEmpCardGift(dto);
|
||||
}
|
||||
// @GetMapping("/getCardByBank")
|
||||
// @ApiOperation(value = "生成礼包卡信息")
|
||||
// public JSONObject getCardByBank(@RequestParam(value = "pageNo",defaultValue = "1")Integer pageNo,
|
||||
|
||||
@@ -24,8 +24,10 @@ import com.yxt.yyth.api.empreserveorder.EmpReserveOrderCardVo;
|
||||
import com.yxt.yyth.api.empreserveorder.EmpReserveOrderVo;
|
||||
import com.yxt.yyth.api.empreserveordergoods.EmpReserveOrderGoods;
|
||||
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecord;
|
||||
import com.yxt.yyth.api.lpkgiftbag.LpkGiftBag;
|
||||
import com.yxt.yyth.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yyth.api.lpkgiftcard.BindCardDto;
|
||||
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCard;
|
||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo;
|
||||
import com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo;
|
||||
@@ -36,6 +38,9 @@ import com.yxt.yyth.biz.empcardgiftgoods.EmpCardGiftGoodsService;
|
||||
import com.yxt.yyth.biz.empcardgrantlog.EmpCardGrantLogService;
|
||||
import com.yxt.yyth.biz.empreserveorder.EmpReserveOrderService;
|
||||
import com.yxt.yyth.biz.empreserveordergoods.EmpReserveOrderGoodsService;
|
||||
import com.yxt.yyth.biz.lpkgiftbag.LpkGiftBagService;
|
||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardRest;
|
||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import com.yxt.yyth.biz.lpkgiftcard.generateRule.UniqueIdGenerator;
|
||||
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yyth.biz.lpkreserveorder.LpkReserveOrderService;
|
||||
@@ -87,6 +92,10 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
@Autowired
|
||||
LpkStoreService lpkStoreService;
|
||||
@Autowired
|
||||
LpkGiftCardService lpkGiftCardService;
|
||||
@Autowired
|
||||
LpkGiftBagService lpkGiftBagService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
|
||||
@Autowired
|
||||
@@ -241,6 +250,8 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
vo.setValue(vo2.getSid());
|
||||
}
|
||||
}
|
||||
EmpCardGift empCardGift=baseMapper.selectOne(new QueryWrapper<EmpCardGift>().eq("empCardSid",vo.getSid()).eq("cardType","2"));
|
||||
vo.setEmpCardGift(empCardGift);
|
||||
vo.setOrderCardVoList(empReserveOrderCardVos);
|
||||
vo.setGoodsVos(goodsVos);
|
||||
return rb.success().setData(vo);
|
||||
@@ -333,6 +344,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
return rb.setMsg("商品数量不足,请重新选择");
|
||||
}
|
||||
}
|
||||
LpkGiftBag bag=lpkGiftBagService.getOne(new QueryWrapper<LpkGiftBag>().eq("sid",empCard.getGiftbagSid()));
|
||||
for (int k = 0; k < Integer.valueOf(dto.getCount()); k++) {
|
||||
EmpCardGrantLog record = new EmpCardGrantLog();
|
||||
record.setCreateTime(new DateTime());
|
||||
@@ -350,6 +362,8 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
card.setState("1");
|
||||
card.setCreateTime(new DateTime());
|
||||
card.setGrantDate(new Date());
|
||||
card.setEndDate(bag.getDateEnd());
|
||||
card.setStartDate(bag.getDateStart());
|
||||
|
||||
String cardArea="9";
|
||||
String maxSerNum = baseMapper.selctMaxSerNum(cardArea);
|
||||
@@ -373,12 +387,13 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
}
|
||||
baseMapper.insert(card);
|
||||
for(GoodsVo vo:dto.getGoodsVoList()){
|
||||
if(vo.getSelect()!=0){
|
||||
EmpCardGiftGoodsDto dto1=new EmpCardGiftGoodsDto();
|
||||
dto1.setEmpCardGiftSid(card.getSid());
|
||||
dto1.setGoodsSid(vo.getGoodsSid());
|
||||
dto1.setGoodsNumber(vo.getSelect());
|
||||
empCardGiftGoodsService.save(dto1);
|
||||
|
||||
}
|
||||
}
|
||||
record.setSerialNumber(card.getSerialNumber());
|
||||
record.setEmpCardSid(dto.getEmpCardSid());
|
||||
@@ -401,6 +416,132 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean generateEmpCard(EmpCardGiftDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
if (StringUtils.isBlank(dto.getEmpCardSid())) {
|
||||
return rb.setMsg("请选择提货卡");
|
||||
}
|
||||
|
||||
LpkGiftCard empCard = lpkGiftCardService.fetchBySid(dto.getEmpCardSid());
|
||||
if (null == empCard) {
|
||||
return rb.setMsg("请选择正确的提货卡");
|
||||
}
|
||||
LpkGiftBag bag=lpkGiftBagService.getOne(new QueryWrapper<LpkGiftBag>().eq("sid",empCard.getGiftbagSid()));
|
||||
EmpCardGift card = new EmpCardGift();
|
||||
card.setCardType("3");
|
||||
card.setRemarks(dto.getRemarks());
|
||||
card.setEmpCardSid(dto.getEmpCardSid());
|
||||
card.setEmpCardSerialNumber(empCard.getSerialNumber());
|
||||
card.setEmpCardCode(empCard.getCode());
|
||||
card.setEmpCardCustomerSid(empCard.getCustomerSid());
|
||||
card.setState("1");
|
||||
card.setCreateTime(new DateTime());
|
||||
card.setGrantDate(new Date());
|
||||
card.setEndDate(bag.getDateEnd());
|
||||
card.setStartDate(bag.getDateStart());
|
||||
String cardArea = "9";
|
||||
String maxSerNum = baseMapper.selctMaxSerNum(cardArea);
|
||||
String uuid = UniqueIdGenerator.generateUniqueID();
|
||||
int randomNumber = new Random().nextInt(900000) + 100000;
|
||||
card.setCodeKey(String.valueOf(randomNumber));
|
||||
card.setCode("99" + uuid.substring(2));
|
||||
if (StringUtils.isBlank(maxSerNum)) {
|
||||
card.setSerialNumber(cardArea + "0000001");
|
||||
} else {
|
||||
String substringSer = maxSerNum.substring(cardArea.length());
|
||||
int i1 = Integer.parseInt(substringSer);
|
||||
int finNum = i1 + 1;
|
||||
int length = String.valueOf(finNum).length();
|
||||
int len = 7 - length;
|
||||
String num = String.valueOf(finNum);
|
||||
for (int a = 0; a < len; a++) {
|
||||
num = "0" + num;
|
||||
}
|
||||
card.setSerialNumber(cardArea + num);
|
||||
}
|
||||
baseMapper.insert(card);
|
||||
for (GoodsVo vo : dto.getGoodsVoList()) {
|
||||
if(vo.getLNum()!=0){
|
||||
EmpCardGiftGoodsDto dto1 = new EmpCardGiftGoodsDto();
|
||||
dto1.setEmpCardGiftSid(card.getSid());
|
||||
dto1.setGoodsSid(vo.getGoodsSid());
|
||||
dto1.setGoodsNumber(vo.getLNum());
|
||||
empCardGiftGoodsService.save(dto1);
|
||||
}
|
||||
}
|
||||
lpkGiftCardService.cardTransfer(dto.getEmpCardSid());
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean generateEmpCardGift(EmpCardGiftDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
if (StringUtils.isBlank(dto.getEmpCardSid())) {
|
||||
return rb.setMsg("请选择福礼卡");
|
||||
}
|
||||
EmpCardGift empCard=baseMapper.selectOne(new QueryWrapper<EmpCardGift>().eq("sid",dto.getEmpCardSid()));
|
||||
if (null == empCard) {
|
||||
return rb.setMsg("请选择正确的福礼卡");
|
||||
}
|
||||
EmpCardGift card = new EmpCardGift();
|
||||
card.setCardType("2");
|
||||
card.setRemarks(dto.getRemarks());
|
||||
card.setEmpCardSid(dto.getEmpCardSid());
|
||||
card.setEmpCardSerialNumber(empCard.getSerialNumber());
|
||||
card.setEmpCardCode(empCard.getCode());
|
||||
card.setEmpCardCustomerSid(empCard.getCustomerSid());
|
||||
card.setState("1");
|
||||
card.setCreateTime(new DateTime());
|
||||
card.setGrantDate(new Date());
|
||||
card.setEndDate(empCard.getEndDate());
|
||||
card.setStartDate(empCard.getStartDate());
|
||||
String cardArea = "9";
|
||||
String maxSerNum = baseMapper.selctMaxSerNum(cardArea);
|
||||
String uuid = UniqueIdGenerator.generateUniqueID();
|
||||
int randomNumber = new Random().nextInt(900000) + 100000;
|
||||
card.setCodeKey(String.valueOf(randomNumber));
|
||||
card.setCode("99" + uuid.substring(2));
|
||||
if (StringUtils.isBlank(maxSerNum)) {
|
||||
card.setSerialNumber(cardArea + "0000001");
|
||||
} else {
|
||||
String substringSer = maxSerNum.substring(cardArea.length());
|
||||
int i1 = Integer.parseInt(substringSer);
|
||||
int finNum = i1 + 1;
|
||||
int length = String.valueOf(finNum).length();
|
||||
int len = 7 - length;
|
||||
String num = String.valueOf(finNum);
|
||||
for (int a = 0; a < len; a++) {
|
||||
num = "0" + num;
|
||||
}
|
||||
card.setSerialNumber(cardArea + num);
|
||||
}
|
||||
baseMapper.insert(card);
|
||||
for (GoodsVo vo : dto.getGoodsVoList()) {
|
||||
if(vo.getLNum()!=0){
|
||||
EmpCardGiftGoodsDto dto1 = new EmpCardGiftGoodsDto();
|
||||
dto1.setEmpCardGiftSid(card.getSid());
|
||||
dto1.setGoodsSid(vo.getGoodsSid());
|
||||
dto1.setGoodsNumber(vo.getLNum());
|
||||
empCardGiftGoodsService.save(dto1);
|
||||
}
|
||||
}
|
||||
cardTransfer(dto.getEmpCardSid());
|
||||
return rb.success();
|
||||
}
|
||||
/**
|
||||
*是否转赠
|
||||
* @param sid
|
||||
* @return
|
||||
*/
|
||||
public ResultBean cardTransfer(String sid ) {
|
||||
ResultBean rb=new ResultBean();
|
||||
EmpCardGift card=baseMapper.selectOne(new QueryWrapper<EmpCardGift>().eq("sid",sid));
|
||||
card.setIsTransfer("1");
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
public ResultBean<EmpCardGiftVo> getEmpCardGoods(String empCardSid, String goodsSid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
return rb.success().setData(baseMapper.getEmpCardGoods(empCardSid,goodsSid));
|
||||
@@ -630,9 +771,9 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
||||
//
|
||||
public ResultBean<Object> isSaturAndSun(String cardSid) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
EmpGiftAppletVo vo = getGifCardBySid(cardSid).getData();
|
||||
LocalDate now = DateUtil.parse(vo.getStart()).toSqlDate().toLocalDate();
|
||||
LocalDate endD = DateUtil.parse(vo.getEnd()).toSqlDate().toLocalDate();
|
||||
EmpCardGift empCardGift=baseMapper.selectOne(new QueryWrapper<EmpCardGift>().eq("sid",cardSid));
|
||||
LocalDate now = DateUtil.parse(empCardGift.getStartDate().toString()).toSqlDate().toLocalDate();
|
||||
LocalDate endD = DateUtil.parse(empCardGift.getEndDate().toString()).toSqlDate().toLocalDate();
|
||||
List<String> weekMap = new ArrayList<>();
|
||||
// 第一个星期六
|
||||
// LocalDate saturday = now.with(firstInMonth(DayOfWeek.SATURDAY));
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
ORDER BY card.isItInvalid desc,card.bindDate desc
|
||||
ORDER BY card.isItInvalid asc,card.bindDate desc
|
||||
</select>
|
||||
<select id="selctMaxSerNum" resultType="java.lang.String">
|
||||
SELECT MAX(serialNumber) as sNo
|
||||
|
||||
@@ -154,4 +154,10 @@ public class LpkGiftCardRest {
|
||||
public ResultBean cancelCard(@PathVariable("sid")String sid) {
|
||||
return lpkGiftCardService.isEnable(sid);
|
||||
}
|
||||
|
||||
@ApiOperation("提货卡转赠福礼卡")
|
||||
@PostMapping("/cardTransfer")
|
||||
public ResultBean cardTransfer(String sid) {
|
||||
return lpkGiftCardService.cardTransfer(sid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGift;
|
||||
import com.yxt.yyth.api.empcardgift.EmpCardGiftDto;
|
||||
import com.yxt.yyth.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecord;
|
||||
import com.yxt.yyth.api.lpkcardgrantrecord.LpkCardGrantRecordDto;
|
||||
import com.yxt.yyth.api.lpkcardqrcode.LpkCardQrcode;
|
||||
@@ -43,6 +46,7 @@ import com.yxt.yyth.api.lpkreserveordergoods.LpkReserveOrderGoods;
|
||||
import com.yxt.yyth.api.lpkstore.LpkStoreDetailsVo;
|
||||
import com.yxt.yyth.api.lpkstore.StoreSelect;
|
||||
import com.yxt.yyth.biz.empcardgift.EmpCardGiftService;
|
||||
import com.yxt.yyth.biz.empcardgiftgoods.EmpCardGiftGoodsService;
|
||||
import com.yxt.yyth.biz.lpkcardbuildrecord.LpkCardBuildRecordService;
|
||||
import com.yxt.yyth.biz.lpkcardgrantrecord.LpkCardGrantRecordService;
|
||||
import com.yxt.yyth.biz.lpkcardqrcode.LpkCardQrcodeService;
|
||||
@@ -106,6 +110,8 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
EmpCardGiftService empCardGiftService;
|
||||
@Autowired
|
||||
LpkCardQrcodeService lpkCardQrcodeService;
|
||||
@Autowired
|
||||
EmpCardGiftGoodsService empCardGiftGoodsService;
|
||||
|
||||
public ResultBean bindCard(BindCardDto bindCardDto) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
@@ -209,6 +215,8 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
vo.setValue(vo2.getSid());
|
||||
}
|
||||
}
|
||||
EmpCardGift empCardGift=empCardGiftService.getOne(new QueryWrapper<EmpCardGift>().eq("empCardSid",vo.getSid()).eq("cardType","3"));
|
||||
vo.setEmpCardGift(empCardGift);
|
||||
vo.setOrderCardVoList(lpkReserveOrderCardVos);
|
||||
vo.setGoodsVos(goodsVos);
|
||||
return rb.success().setData(vo);
|
||||
@@ -1471,4 +1479,17 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
|
||||
/**
|
||||
*是否转赠
|
||||
* @param sid
|
||||
* @return
|
||||
*/
|
||||
public ResultBean cardTransfer(String sid ) {
|
||||
ResultBean rb=new ResultBean();
|
||||
LpkGiftCard card=baseMapper.selectOne(new QueryWrapper<LpkGiftCard>().eq("sid",sid));
|
||||
card.setIsTransfer("1");
|
||||
baseMapper.updateById(card);
|
||||
return rb.success().setData("成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ public interface LpkReserveOrderMapper extends BaseMapper<LpkReserveOrder> {
|
||||
IPage<LpkReserveOrderVo> orderListByZ(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||
List<LpkReserveOrderCardVo> orderByCardSid(String sid);
|
||||
|
||||
IPage<LpkReserveOrderCardVo> orderListByUserSid(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||
// IPage<LpkReserveOrderCardVo> orderListByUserSid(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||
IPage<LpkReserveOrderCardVo> orderListByUserSid(IPage<LpkReserveOrder> page, @Param("userSid")String userSid);
|
||||
|
||||
List<ReserveOrderExport> exportExcel(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||
List<ReserveOrderExportByStore> exportExcelByStore(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||
|
||||
@@ -110,12 +110,32 @@
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
WHERE o.cardSid = #{sid}
|
||||
</select>
|
||||
<!-- <select id="orderListByUserSid" resultType="com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo">-->
|
||||
<!-- SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,-->
|
||||
<!-- c.`code`,-->
|
||||
<!-- case-->
|
||||
<!-- when o.reserveDate IS NOT NULL then 1-->
|
||||
<!-- 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 lpk_reserve_order AS o-->
|
||||
<!-- 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_giftbag AS b ON c.giftbagSid = b.sid-->
|
||||
<!-- <where>-->
|
||||
<!-- ${ew.sqlSegment}-->
|
||||
<!-- </where>-->
|
||||
<!-- ORDER BY reserveDate DESC-->
|
||||
<!-- </select>-->
|
||||
<select id="orderListByUserSid" resultType="com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo">
|
||||
SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
c.`code`,
|
||||
case
|
||||
when o.reserveDate IS NOT NULL then 1
|
||||
end as type,
|
||||
o.cardType as type,
|
||||
s.`name` as store,
|
||||
b.`name` as bagName,
|
||||
o.cardSid as cardSid,
|
||||
@@ -128,7 +148,25 @@
|
||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
o.customerSid=#{userSid} and o.cardType='1'
|
||||
</where>
|
||||
union
|
||||
SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||
c.`code`,
|
||||
o.cardType 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 lpk_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>
|
||||
o.customerSid=#{userSid} and o.cardType='2'
|
||||
</where>
|
||||
ORDER BY reserveDate DESC
|
||||
</select>
|
||||
|
||||
@@ -409,9 +409,10 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
||||
return rb.setMsg("参数不全");
|
||||
}
|
||||
qw.eq("o.customerSid", query.getUserSid());
|
||||
qw.eq("o.cardType","1");
|
||||
// qw.orderByDesc("reserveDate");
|
||||
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||
IPage<LpkReserveOrderCardVo> pagging = baseMapper.orderListByUserSid(page, qw);
|
||||
IPage<LpkReserveOrderCardVo> pagging = baseMapper.orderListByUserSid(page, query.getUserSid());
|
||||
for(LpkReserveOrderCardVo vo:pagging.getRecords()){
|
||||
List<LpkReserveOrderGoods> goods =lpkReserveOrderGoodsService.selByOrderSids(vo.getSid());
|
||||
for(LpkReserveOrderGoods goods1:goods){
|
||||
|
||||
Reference in New Issue
Block a user