1/3
This commit is contained in:
@@ -52,9 +52,7 @@ public class AppletVo {
|
|||||||
private String serialNumber;
|
private String serialNumber;
|
||||||
private String isEnable;
|
private String isEnable;
|
||||||
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
private String isTransfer;//是否转增 0 未转赠 1 转赠
|
||||||
|
private String type;//是否转增 1亲情卡 2家庭 3 企业
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getStart() {
|
public String getStart() {
|
||||||
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|||||||
@@ -396,6 +396,7 @@ public class EmpCardService extends MybatisBaseService<EmpCardMapper, EmpCard> {
|
|||||||
vo.setValue(vo2.getSid());
|
vo.setValue(vo2.getSid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
vo.setPName("企业菜窖");
|
||||||
vo.setOrderCardVoList(empReserveOrderCardVos);
|
vo.setOrderCardVoList(empReserveOrderCardVos);
|
||||||
return rb.success().setData(vo);
|
return rb.success().setData(vo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.yxt.yyth.biz.empcardgift;
|
package com.yxt.yyth.biz.empcardgift;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -59,9 +60,7 @@ import java.io.File;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.DayOfWeek;
|
import java.time.*;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.Period;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -258,6 +257,7 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
vo.setEmpCardGift(empCardGift);
|
vo.setEmpCardGift(empCardGift);
|
||||||
vo.setOrderCardVoList(empReserveOrderCardVos);
|
vo.setOrderCardVoList(empReserveOrderCardVos);
|
||||||
vo.setGoodsVos(goodsVos);
|
vo.setGoodsVos(goodsVos);
|
||||||
|
vo.setPName("亲情菜窖");
|
||||||
return rb.success().setData(vo);
|
return rb.success().setData(vo);
|
||||||
}
|
}
|
||||||
public ResultBean<List<EmpCardGiftVo>> recordList(String empCardSid) {
|
public ResultBean<List<EmpCardGiftVo>> recordList(String empCardSid) {
|
||||||
@@ -362,7 +362,6 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
LpkGiftBag bag=lpkGiftBagService.getOne(new QueryWrapper<LpkGiftBag>().eq("sid",empCard.getGiftbagSid()));
|
LpkGiftBag bag=lpkGiftBagService.getOne(new QueryWrapper<LpkGiftBag>().eq("sid",empCard.getGiftbagSid()));
|
||||||
for (int k = 0; k < count; k++) {
|
for (int k = 0; k < count; k++) {
|
||||||
@@ -475,6 +474,16 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
if (null == empCard) {
|
if (null == empCard) {
|
||||||
return rb.setMsg("请选择正确的提货卡");
|
return rb.setMsg("请选择正确的提货卡");
|
||||||
}
|
}
|
||||||
|
// EmpAppletVo empAppletVo =empCardService.getEmpCardBySid(dto.getEmpCardSid()).getData();
|
||||||
|
// for(com.yxt.yyth.api.lpkgiftcard.GoodsVo goodsVo:empAppletVo.getGoodsVos()){
|
||||||
|
// for(GoodsVo gv :dto.getGoodsVoList()){
|
||||||
|
// if(goodsVo.getGoodsSid().equals(gv.getGoodsSid())){
|
||||||
|
// if(goodsVo.getSelect()*count>goodsVo.getLNum()){
|
||||||
|
// return rb.setMsg("商品数量不足,请重新选择");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
LpkGiftBag bag=lpkGiftBagService.getOne(new QueryWrapper<LpkGiftBag>().eq("sid",empCard.getGiftbagSid()));
|
LpkGiftBag bag=lpkGiftBagService.getOne(new QueryWrapper<LpkGiftBag>().eq("sid",empCard.getGiftbagSid()));
|
||||||
EmpCardGift card = new EmpCardGift();
|
EmpCardGift card = new EmpCardGift();
|
||||||
card.setCardType("3");
|
card.setCardType("3");
|
||||||
@@ -909,14 +918,43 @@ public class EmpCardGiftService extends MybatisBaseService<EmpCardGiftMapper, Em
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// public static void main(String[] args) {
|
public EmpGiftAppletVo getDate(EmpGiftAppletVo vo) {
|
||||||
// LocalDate start = LocalDate.of(2021, Month.JANUARY, 1); // 设置起始日期为2021年1月1日
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
|
||||||
// LocalDate end = LocalDate.now(); // 设置结束日期为当前日期
|
SimpleDateFormat sdf1 =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
//
|
LocalDate today = LocalDate.now(); // 获取今天的日期
|
||||||
// Stream<LocalDate> dates = start.datesUntil(end).filter(date -> date.getDayOfWeek() == DayOfWeek.SATURDAY || date.getDayOfWeek() == DayOfWeek.SUNDAY);
|
LocalTime timeOfDay = LocalTime.of(15, 0); // 设置下午3点的小时数为15,分钟数为0
|
||||||
//
|
LocalDateTime dateAndTime = LocalDateTime.of(today, timeOfDay); // 将日期和时间合并成完整的日期时间对象
|
||||||
// for (LocalDate date : dates) {
|
|
||||||
// System.out.println(date);
|
ZoneId zoneId = ZoneId.systemDefault();
|
||||||
// }
|
Date date = Date.from(dateAndTime.atZone(zoneId).toInstant());
|
||||||
// }
|
// System.out.println(date);
|
||||||
|
//1>2 1 、1<2 -1 、1=2 0
|
||||||
|
int k=DateUtil.parse(sdf1.format(DateUtil.parse(sdf1.format(new Date())))).compareTo(DateUtil.parse(sdf1.format(DateUtil.parse(sdf1.format(date)))));
|
||||||
|
if(String.valueOf(k).equals("1")){
|
||||||
|
vo.setStart(sdf.format(DateUtil.offsetDay(new Date(),+2)));
|
||||||
|
}else{
|
||||||
|
vo.setStart(sdf.format(DateUtil.offsetDay(new Date(),+1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(vo.getDateStart())){
|
||||||
|
int i=DateUtil.parse(sdf.format(DateUtil.parse(vo.getStart()))).compareTo(DateUtil.parse(sdf.format(DateUtil.parse(vo.getDateEnd()))));
|
||||||
|
if(String.valueOf(i).equals("-1")){
|
||||||
|
long o=DateUtil.between(DateUtil.parse(vo.getStart()),DateUtil.parse(vo.getDateEnd()), DateUnit.DAY);
|
||||||
|
if(o<10){
|
||||||
|
vo.setEnd(sdf.format(DateUtil.offsetDay(DateUtil.parse(vo.getDateEnd()),10)));
|
||||||
|
}else{
|
||||||
|
// end=sdf.format(DateUtil.parse(dateEnd));
|
||||||
|
vo.setEnd(sdf.format(DateUtil.offsetDay(DateUtil.parse(vo.getStart()),4)));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(String.valueOf(k).equals("1")){
|
||||||
|
vo.setEnd(sdf.format(DateUtil.offsetDay(DateUtil.parse(vo.getDateEnd()),2)));
|
||||||
|
}else{
|
||||||
|
vo.setEnd(sdf.format(DateUtil.offsetDay(DateUtil.parse(vo.getDateEnd()),1)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setReserveDate(vo.getStart());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import java.util.List;
|
|||||||
public interface LpkGiftCardMapper extends BaseMapper<LpkGiftCard> {
|
public interface LpkGiftCardMapper extends BaseMapper<LpkGiftCard> {
|
||||||
|
|
||||||
IPage<AppletVo> getGifCardByCustomerSid(IPage<LpkGiftCard> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
IPage<AppletVo> getGifCardByCustomerSid(IPage<LpkGiftCard> page, @Param(Constants.WRAPPER) QueryWrapper<LpkGiftCard> qw);
|
||||||
|
IPage<AppletVo> getGifCardsByCustomerSid(IPage<LpkGiftCard> page, @Param("customerSid") String customerSid);
|
||||||
|
|
||||||
@Select(" SELECT\n" +
|
@Select(" SELECT\n" +
|
||||||
" card.*,\n" +
|
" card.*,\n" +
|
||||||
|
|||||||
@@ -16,6 +16,96 @@
|
|||||||
<!-- ${ew.customSqlSegment} -->
|
<!-- ${ew.customSqlSegment} -->
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getGifCardsByCustomerSid" resultType="com.yxt.yyth.api.lpkgiftcard.AppletVo">
|
||||||
|
SELECT
|
||||||
|
card.sid as sid,
|
||||||
|
card.state AS state,
|
||||||
|
CASE
|
||||||
|
card.state
|
||||||
|
WHEN 3 THEN '未提货'
|
||||||
|
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||||
|
WHEN 5 THEN '已经提取完成'
|
||||||
|
END stateValue,
|
||||||
|
CASE
|
||||||
|
WHEN card.sid IS NOT NULL THEN '1'
|
||||||
|
END type,
|
||||||
|
CASE
|
||||||
|
WHEN card.sid IS NOT NULL THEN '家庭卡'
|
||||||
|
END pName,
|
||||||
|
bag.dateStart AS dateStart,
|
||||||
|
bag.dateEnd AS dateEnd,
|
||||||
|
card.state AS states,
|
||||||
|
card.serialNumber AS serialNumber,
|
||||||
|
card.isItInvalid,
|
||||||
|
card.bindDate,
|
||||||
|
card.isTransfer,
|
||||||
|
card.isEnable,
|
||||||
|
card.`code`,
|
||||||
|
card.isReservation
|
||||||
|
FROM lpk_giftcard card
|
||||||
|
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
||||||
|
WHERE card.customerSid = #{customerSid}
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
card.sid as sid,
|
||||||
|
card.state AS state,
|
||||||
|
CASE card.state
|
||||||
|
WHEN 3 THEN '未提货'
|
||||||
|
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||||
|
WHEN 5 THEN '已经提取完成'
|
||||||
|
END stateValue,
|
||||||
|
CASE
|
||||||
|
WHEN card.sid IS NOT NULL THEN '2'
|
||||||
|
END type,
|
||||||
|
CASE
|
||||||
|
WHEN card.sid IS NOT NULL THEN '亲情卡'
|
||||||
|
END pName,
|
||||||
|
card.startDate AS dateStart,
|
||||||
|
card.endDate AS dateEnd,
|
||||||
|
card.state AS states,
|
||||||
|
card.serialNumber AS serialNumber,
|
||||||
|
card.isItInvalid,
|
||||||
|
card.bindDate,
|
||||||
|
card.isTransfer,
|
||||||
|
card.isEnable,
|
||||||
|
card.`code`,
|
||||||
|
card.isReservation
|
||||||
|
FROM emp_card_gift card
|
||||||
|
LEFT JOIN emp_card emp ON emp.sid = card.empCardSid
|
||||||
|
LEFT JOIN lpk_giftbag gif ON gif.sid = emp.giftbagSid
|
||||||
|
WHERE card.customerSid = #{customerSid}
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
card.sid as sid,
|
||||||
|
card.state AS state,
|
||||||
|
CASE
|
||||||
|
card.state
|
||||||
|
WHEN 3 THEN '未提货'
|
||||||
|
WHEN 4 THEN '已经预约提货(预约部分提货)'
|
||||||
|
WHEN 5 THEN '已经提取完成'
|
||||||
|
END stateValue,
|
||||||
|
CASE
|
||||||
|
WHEN card.sid IS NOT NULL THEN '3'
|
||||||
|
END type,
|
||||||
|
CASE
|
||||||
|
WHEN card.sid IS NOT NULL THEN '企业卡'
|
||||||
|
END pName,
|
||||||
|
bag.dateStart AS dateStart,
|
||||||
|
bag.dateEnd AS dateEnd,
|
||||||
|
card.state AS states,
|
||||||
|
card.serialNumber AS serialNumber,
|
||||||
|
card.isItInvalid,
|
||||||
|
card.bindDate,
|
||||||
|
card.isTransfer,
|
||||||
|
card.isEnable,
|
||||||
|
card.`code`,
|
||||||
|
card.isReservation
|
||||||
|
FROM emp_card card
|
||||||
|
LEFT JOIN lpk_giftbag bag ON card.giftbagSid = bag.sid
|
||||||
|
WHERE card.customerSid = #{customerSid}
|
||||||
|
ORDER BY isItInvalid ASC,
|
||||||
|
bindDate DESC
|
||||||
|
</select>
|
||||||
<select id="getGifCardByCustomerSid" resultType="com.yxt.yyth.api.lpkgiftcard.AppletVo">
|
<select id="getGifCardByCustomerSid" resultType="com.yxt.yyth.api.lpkgiftcard.AppletVo">
|
||||||
SELECT
|
SELECT
|
||||||
card.*,
|
card.*,
|
||||||
@@ -154,36 +244,36 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="cardStatisticsList" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardVo">
|
<select id="cardStatisticsList" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardVo">
|
||||||
SELECT
|
SELECT
|
||||||
a.serialNumber as serialNumber,
|
a.serialNumber as serialNumber,
|
||||||
a.CODE AS code,
|
a.CODE AS code,
|
||||||
a.createTime AS createTime,
|
a.createTime AS createTime,
|
||||||
a.isEnable as isEnable,
|
a.isEnable as isEnable,
|
||||||
CASE
|
CASE
|
||||||
WHEN a.CODE IS NOT NULL THEN
|
WHEN a.CODE IS NOT NULL THEN
|
||||||
'提货卡'
|
'提货卡'
|
||||||
END cardType,
|
END cardType,
|
||||||
CASE
|
CASE
|
||||||
a.state
|
a.state
|
||||||
WHEN 1 THEN
|
WHEN 1 THEN
|
||||||
'未绑卡'
|
'未绑卡'
|
||||||
WHEN 2 THEN
|
WHEN 2 THEN
|
||||||
'未绑卡'
|
'未绑卡'
|
||||||
WHEN 3 THEN
|
WHEN 3 THEN
|
||||||
'未预约'
|
'未预约'
|
||||||
WHEN 4 THEN
|
WHEN 4 THEN
|
||||||
'已预约'
|
'已预约'
|
||||||
WHEN 5 THEN
|
WHEN 5 THEN
|
||||||
'已完成'
|
'已完成'
|
||||||
END stateValue,
|
END stateValue,
|
||||||
a.customerSid AS bind,
|
a.customerSid AS bind,
|
||||||
a.bindDate AS bindDate,
|
a.bindDate AS bindDate,
|
||||||
d.NAME AS goodsName,
|
d.NAME AS goodsName,
|
||||||
c.goodsNumber AS goodsNumber
|
c.goodsNumber AS goodsNumber
|
||||||
FROM
|
FROM
|
||||||
lpk_giftcard a
|
lpk_giftcard a
|
||||||
LEFT JOIN lpk_giftbag b ON b.sid = a.giftbagSid
|
LEFT JOIN lpk_giftbag b ON b.sid = a.giftbagSid
|
||||||
LEFT JOIN lpk_giftbag_goods c ON c.giftbagSid = a.giftbagSid
|
LEFT JOIN lpk_giftbag_goods c ON c.giftbagSid = a.giftbagSid
|
||||||
LEFT JOIN lpk_goods d ON d.sid = c.goodsSid
|
LEFT JOIN lpk_goods d ON d.sid = c.goodsSid
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
@@ -216,10 +306,10 @@
|
|||||||
d.NAME AS goodsName,
|
d.NAME AS goodsName,
|
||||||
c.goodsNumber AS goodsNumber
|
c.goodsNumber AS goodsNumber
|
||||||
FROM
|
FROM
|
||||||
lpk_giftcard a
|
lpk_giftcard a
|
||||||
LEFT JOIN lpk_giftbag b ON b.sid = a.giftbagSid
|
LEFT JOIN lpk_giftbag b ON b.sid = a.giftbagSid
|
||||||
LEFT JOIN lpk_giftbag_goods c ON c.giftbagSid = a.giftbagSid
|
LEFT JOIN lpk_giftbag_goods c ON c.giftbagSid = a.giftbagSid
|
||||||
LEFT JOIN lpk_goods d ON d.sid = c.goodsSid
|
LEFT JOIN lpk_goods d ON d.sid = c.goodsSid
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -38,12 +38,21 @@ public class LpkGiftCardRest {
|
|||||||
public ResultBean wxBindMobile(@RequestBody BindCardDto bindCardDto) {
|
public ResultBean wxBindMobile(@RequestBody BindCardDto bindCardDto) {
|
||||||
return lpkGiftCardService.bindCard(bindCardDto);
|
return lpkGiftCardService.bindCard(bindCardDto);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/bindAllCard")
|
||||||
|
@ApiOperation(value = "客户绑定礼包卡")
|
||||||
|
public ResultBean bindAllCard(@RequestBody BindCardDto bindCardDto) {
|
||||||
|
return lpkGiftCardService.bindAllCard(bindCardDto);
|
||||||
|
}
|
||||||
@PostMapping("/gifCardByCustomerSid")
|
@PostMapping("/gifCardByCustomerSid")
|
||||||
@ApiOperation(value = "获取客户绑定的礼包卡")
|
@ApiOperation(value = "获取客户绑定的礼包卡")
|
||||||
public ResultBean gifCardByCustomerSid(@RequestBody PagerQuery<LpkGiftCardQuery> query) {
|
public ResultBean gifCardByCustomerSid(@RequestBody PagerQuery<LpkGiftCardQuery> query) {
|
||||||
return lpkGiftCardService.getGifCardByCustomerSid(query);
|
return lpkGiftCardService.getGifCardByCustomerSid(query);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/gifCardsByCustomerSid")
|
||||||
|
@ApiOperation(value = "获取客户绑定的礼包卡")
|
||||||
|
public ResultBean gifCardsByCustomerSid(@RequestBody PagerQuery<LpkGiftCardQuery> query) {
|
||||||
|
return lpkGiftCardService.getGifCardsByCustomerSid(query);
|
||||||
|
}
|
||||||
@GetMapping("/isSaturAndSun/{cardSid}")
|
@GetMapping("/isSaturAndSun/{cardSid}")
|
||||||
@ApiOperation(value = "获取时间段的周六日")
|
@ApiOperation(value = "获取时间段的周六日")
|
||||||
public ResultBean isSaturAndSun(@PathVariable("cardSid") String cardSid) {
|
public ResultBean isSaturAndSun(@PathVariable("cardSid") String cardSid) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|||||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||||
import com.yxt.common.base.service.MybatisBaseService;
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
import com.yxt.common.base.utils.ExportExcelUtils;
|
import com.yxt.common.base.utils.ExportExcelUtils;
|
||||||
@@ -143,6 +144,46 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
return rb.success().setMsg("绑定成功");
|
return rb.success().setMsg("绑定成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String a="99231229101555309170";
|
||||||
|
;
|
||||||
|
System.out.println(a.substring(0,2));
|
||||||
|
}
|
||||||
|
public ResultBean bindAllCard(BindCardDto bindCardDto) {
|
||||||
|
ResultBean rb = new ResultBean().fail();
|
||||||
|
|
||||||
|
if(bindCardDto.getCode().substring(0,2).equals("99")){
|
||||||
|
ResultBean rb2=empCardGiftService.bindCard(bindCardDto);
|
||||||
|
return rb2;
|
||||||
|
|
||||||
|
}
|
||||||
|
LpkGiftCard lpkGiftCard1 = baseMapper.selectOne(new QueryWrapper<LpkGiftCard>().eq("code", bindCardDto.getCode()));
|
||||||
|
if (null == lpkGiftCard1) {
|
||||||
|
ResultBean rb1 = empCardGiftService.bindCard(bindCardDto);
|
||||||
|
return rb1;
|
||||||
|
}
|
||||||
|
LpkGiftCard lpkGiftCard = baseMapper.selectOne(new QueryWrapper<LpkGiftCard>().eq("code", bindCardDto.getCode())
|
||||||
|
.eq("codeKey", bindCardDto.getCodeKey()));
|
||||||
|
if (null == lpkGiftCard) {
|
||||||
|
return rb.setMsg("请核对卡号和密钥");
|
||||||
|
}
|
||||||
|
if (lpkGiftCard.getIsEnable().equals("2")) {
|
||||||
|
return rb.setMsg("此卡已作废");
|
||||||
|
}
|
||||||
|
|
||||||
|
AppletVo vo = baseMapper.getGifCardBySid(lpkGiftCard.getSid());
|
||||||
|
if (vo.getState().equals("已过期")) {
|
||||||
|
return rb.setMsg("该卡已过期");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(lpkGiftCard.getCustomerSid())) {
|
||||||
|
return rb.setMsg("该卡已绑定");
|
||||||
|
}
|
||||||
|
lpkGiftCard.setCustomerSid(bindCardDto.getCustomerSid());
|
||||||
|
lpkGiftCard.setState("3");
|
||||||
|
lpkGiftCard.setBindDate(new Date());
|
||||||
|
baseMapper.updateById(lpkGiftCard);
|
||||||
|
return rb.success().setMsg("绑定成功");
|
||||||
|
}
|
||||||
public ResultBean getGifCardByCustomerSid(PagerQuery<LpkGiftCardQuery> pq) {
|
public ResultBean getGifCardByCustomerSid(PagerQuery<LpkGiftCardQuery> pq) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
LpkGiftCardQuery query = pq.getParams();
|
LpkGiftCardQuery query = pq.getParams();
|
||||||
@@ -159,6 +200,22 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
|
public ResultBean getGifCardsByCustomerSid(PagerQuery<LpkGiftCardQuery> pq) {
|
||||||
|
ResultBean rb = new ResultBean().fail();
|
||||||
|
LpkGiftCardQuery query = pq.getParams();
|
||||||
|
if (StringUtils.isBlank(query.getCustomerSid())) {
|
||||||
|
return rb.setMsg("参数不能为空");
|
||||||
|
}
|
||||||
|
QueryWrapper<LpkGiftCard> qw = new QueryWrapper<>();
|
||||||
|
if (StringUtils.isNotBlank(query.getCustomerSid())) {
|
||||||
|
qw.eq("customerSid", query.getCustomerSid());
|
||||||
|
}
|
||||||
|
IPage<LpkGiftCard> page = PagerUtil.queryToPage(pq);
|
||||||
|
IPage<AppletVo> list = baseMapper.getGifCardsByCustomerSid(page, query.getCustomerSid());
|
||||||
|
PagerVo<AppletVo> p = PagerUtil.pageToVo(list, null);
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
return rb.success().setData(p);
|
||||||
|
}
|
||||||
|
|
||||||
public ResultBean<AppletVo> getGifCardBySid(String sid) {
|
public ResultBean<AppletVo> getGifCardBySid(String sid) {
|
||||||
ResultBean rb = new ResultBean().fail();
|
ResultBean rb = new ResultBean().fail();
|
||||||
@@ -219,6 +276,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
vo.setEmpCardGift(empCardGift);
|
vo.setEmpCardGift(empCardGift);
|
||||||
vo.setOrderCardVoList(lpkReserveOrderCardVos);
|
vo.setOrderCardVoList(lpkReserveOrderCardVos);
|
||||||
vo.setGoodsVos(goodsVos);
|
vo.setGoodsVos(goodsVos);
|
||||||
|
vo.setPName("家庭菜窖");
|
||||||
return rb.success().setData(vo);
|
return rb.success().setData(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -628,8 +686,6 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
return rb.success().setData(array);
|
return rb.success().setData(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String getCardByExcel(LpkGiftCardDto dto) {
|
public String getCardByExcel(LpkGiftCardDto dto) {
|
||||||
|
|||||||
@@ -186,7 +186,9 @@
|
|||||||
c.`code`,
|
c.`code`,
|
||||||
o.cardType as type,
|
o.cardType as type,
|
||||||
s.`name` as store,
|
s.`name` as store,
|
||||||
b.`name` as bagName,
|
case
|
||||||
|
when o.sid is not null then '家庭卡'
|
||||||
|
end as bagName,
|
||||||
o.cardSid as cardSid,
|
o.cardSid as cardSid,
|
||||||
o.sid as orderSid,
|
o.sid as orderSid,
|
||||||
o.userName,
|
o.userName,
|
||||||
@@ -204,7 +206,9 @@
|
|||||||
c.`code`,
|
c.`code`,
|
||||||
o.cardType as type,
|
o.cardType as type,
|
||||||
s.`name` as store,
|
s.`name` as store,
|
||||||
b.`name` as bagName,
|
case
|
||||||
|
when o.sid is not null then '亲情卡'
|
||||||
|
end as bagName,
|
||||||
o.cardSid as cardSid,
|
o.cardSid as cardSid,
|
||||||
o.sid as orderSid,
|
o.sid as orderSid,
|
||||||
o.userName,
|
o.userName,
|
||||||
@@ -222,7 +226,9 @@
|
|||||||
c.`code`,
|
c.`code`,
|
||||||
o.cardType as type,
|
o.cardType as type,
|
||||||
s.`name` as store,
|
s.`name` as store,
|
||||||
b.`name` as bagName,
|
case
|
||||||
|
when o.sid is not null then '企业卡'
|
||||||
|
end as bagName,
|
||||||
o.cardSid as cardSid,
|
o.cardSid as cardSid,
|
||||||
o.sid as orderSid,
|
o.sid as orderSid,
|
||||||
o.userName,
|
o.userName,
|
||||||
|
|||||||
Reference in New Issue
Block a user