正式
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.yxt.yyth.api.appletgiftbag;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:06
|
||||
*/
|
||||
@ApiModel(value = "礼包信息", description = "礼包信息")
|
||||
@TableName("applet_giftbag")
|
||||
@Data
|
||||
public class AppletGiftBag {
|
||||
private String id;
|
||||
private String sid = UUID.randomUUID().toString();
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String isEnable;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dateStart;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dateEnd;
|
||||
private String name;
|
||||
private String price;
|
||||
private String iconUrl;
|
||||
private String isGrounding;
|
||||
private String isRecommend;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.yyth.api.appletgiftbag;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import com.yxt.yyth.api.appletgiftbag.GiftBagGoods;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:13
|
||||
*/
|
||||
@ApiModel(value = "礼包信息 数据传输对象", description = "礼包信息 数据传输对象")
|
||||
@Data
|
||||
public class AppletGiftBagDto implements Dto {
|
||||
|
||||
private String sid;
|
||||
private String remarks;
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String name;
|
||||
private String price;
|
||||
private String iconUrl;
|
||||
private String isGrounding;
|
||||
private String isRecommend;
|
||||
//商品sid
|
||||
private List<GiftBagGoods> goods = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yxt.yyth.api.appletgiftbag;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import com.yxt.yyth.api.appletgiftbag.GiftBagGoods;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description
|
||||
* @date 2023/11/22 11:15
|
||||
*/
|
||||
@Data
|
||||
public class AppletGiftBagInitVo implements Vo {
|
||||
private String sid;
|
||||
private String remarks;
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String name;
|
||||
private String price;
|
||||
private String iconUrl;
|
||||
private String isRecommend;
|
||||
//商品sid
|
||||
private List<GiftBagGoods> goods = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yyth.api.appletgiftbag;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:31
|
||||
*/
|
||||
@ApiModel(value = "礼包信息 查询条件", description = "礼包信息 查询条件")
|
||||
@Data
|
||||
public class AppletGiftBagQuery implements Query {
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yxt.yyth.api.appletgiftbag;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "礼包信息 视图数据对象", description = "礼包信息 视图数据对象")
|
||||
@NoArgsConstructor
|
||||
public class AppletGiftBagVo implements Vo {
|
||||
private String sid;
|
||||
private String name;
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
private String boundary;
|
||||
private String boundaryPrice;
|
||||
private String iconUrl;
|
||||
private String isEnable;
|
||||
private String isGrounding;
|
||||
private String isRecommend;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yxt.yyth.api.appletgiftbag;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description
|
||||
* @date 2023/11/22 11:08
|
||||
*/
|
||||
@Data
|
||||
public class GiftBagGoods {
|
||||
private String goodsSid;
|
||||
private String goodsNumber;
|
||||
private String name; //商品名
|
||||
private String unitName; //单位
|
||||
private String price; //商品单价
|
||||
// private String price; //商品单价
|
||||
// private String price; //商品单价
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yyth.api.appletgiftbaggoods;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:06
|
||||
*/
|
||||
@ApiModel(value = "礼包包含商品信息", description = "礼包包含商品信息")
|
||||
@TableName("applet_giftbag_goods")
|
||||
@Data
|
||||
public class AppletGiftBagGoods {
|
||||
private String id;
|
||||
private String sid = UUID.randomUUID().toString();
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String giftbagSid;
|
||||
private String goodsSid;
|
||||
private String goodsNumber;
|
||||
// private String isGrounding;
|
||||
private double price;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.yxt.yyth.api.appletgiftbaggoods;
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:13
|
||||
*/
|
||||
@ApiModel(value = "礼包包含商品信息 数据传输对象", description = "礼包包含商品信息 数据传输对象")
|
||||
@Data
|
||||
public class AppletGiftBagGoodsDto implements Dto {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yyth.api.appletgiftbaggoods;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:31
|
||||
*/
|
||||
@ApiModel(value = "礼包包含商品信息 查询条件", description = "礼包包含商品信息 查询条件")
|
||||
@Data
|
||||
public class AppletGiftBagGoodsQuery implements Query {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yxt.yyth.api.appletgiftbaggoods;
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "礼包包含商品信息 视图数据对象", description = "礼包包含商品信息 视图数据对象")
|
||||
@NoArgsConstructor
|
||||
public class AppletGiftBagGoodsVo implements Vo {
|
||||
private String goodsName;
|
||||
private double goodsNumber;
|
||||
private String picUrl;
|
||||
private String goodsSid;
|
||||
private String price;
|
||||
private String unitName;
|
||||
private String remarks;
|
||||
}
|
||||
@@ -42,4 +42,8 @@ public class EmpCardGiftVo implements Vo {
|
||||
private String qrCode;
|
||||
private String goods;
|
||||
private String share;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date startDate;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date endDate;
|
||||
}
|
||||
|
||||
@@ -30,5 +30,8 @@ public class LpkGoods {
|
||||
private String price;
|
||||
private String picUrl;
|
||||
private String appContent;
|
||||
private String specificationUnit;
|
||||
private String number;
|
||||
private String isAppletGrounding;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,4 +26,6 @@ public class LpkGoodsDetailsVo implements Vo {
|
||||
private String price;//商品价格
|
||||
private String picUrl;//图片
|
||||
private String appContent;
|
||||
private String specificationUnit;
|
||||
private double number;
|
||||
}
|
||||
|
||||
@@ -21,4 +21,6 @@ public class LpkGoodsDto implements Dto {
|
||||
private String price;
|
||||
private String picUrl;
|
||||
private String appContent;
|
||||
private String specificationUnit;
|
||||
private double number;
|
||||
}
|
||||
|
||||
@@ -30,5 +30,8 @@ public class LpkGoodsVo implements Vo {
|
||||
private String price;
|
||||
private String picUrl;
|
||||
private String appContent;
|
||||
private String specificationUnit;
|
||||
private double number;
|
||||
private String isAppletGrounding; //1 上架 2 下架
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yxt.yyth.biz.appletgiftbag;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.yyth.api.appletgiftbag.AppletGiftBag;
|
||||
import com.yxt.yyth.api.appletgiftbag.AppletGiftBagVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppletGiftBagMapper extends BaseMapper<AppletGiftBag> {
|
||||
|
||||
|
||||
IPage<AppletGiftBagVo> giftBagListPage(IPage<AppletGiftBag> page, @Param(Constants.WRAPPER) QueryWrapper<AppletGiftBag> qw);
|
||||
List<AppletGiftBagVo> giftBagList();
|
||||
|
||||
int saveBags(@Param("bags") List<AppletGiftBag> bags);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.yyth.biz.appletgiftbag.AppletGiftBagMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<insert id="saveBags" parameterType="java.util.List">
|
||||
insert into lpk_giftbag(sid,createTime,`name`,dateStart,dateEnd)
|
||||
values
|
||||
<foreach collection="bags" item="item" index="index" separator=",">
|
||||
(#{item.sid},#{item.createTime},#{item.name},#{item.dateStart},#{item.dateEnd})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="giftBagListPage" resultType="com.yxt.yyth.api.appletgiftbag.AppletGiftBagVo">
|
||||
select
|
||||
sid,
|
||||
`name`,
|
||||
date_format(dateStart, '%Y-%m-%d') as dateStart,
|
||||
date_format(dateEnd, '%Y-%m-%d') as dateEnd,
|
||||
price,
|
||||
iconUrl,
|
||||
isEnable,
|
||||
isGrounding,
|
||||
isRecommend
|
||||
from lpk_giftbag
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
<select id="giftBagList" resultType="com.yxt.yyth.api.appletgiftbag.AppletGiftBagVo">
|
||||
select
|
||||
*
|
||||
from lpk_giftbag
|
||||
where isGrounding=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.yxt.yyth.biz.appletgiftbag;
|
||||
|
||||
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.appletgiftbag.AppletGiftBagDto;
|
||||
import com.yxt.yyth.api.appletgiftbag.AppletGiftBagQuery;
|
||||
import com.yxt.yyth.api.appletgiftbag.AppletGiftBagVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
|
||||
@Api(tags = "小程序礼包信息")
|
||||
@RestController
|
||||
@RequestMapping("appletgiftbag")
|
||||
public class AppletGiftBagRest {
|
||||
|
||||
@Autowired
|
||||
AppletGiftBagService AppletGiftBagService;
|
||||
|
||||
|
||||
@ApiOperation("礼包信息列表")
|
||||
@PostMapping("/giftBagListPage")
|
||||
public ResultBean<PagerVo<AppletGiftBagVo>> giftBagListPage(@RequestBody PagerQuery<AppletGiftBagQuery> pq) {
|
||||
return AppletGiftBagService.giftBagListPage(pq);
|
||||
}
|
||||
|
||||
@ApiOperation("保存修改")
|
||||
@PostMapping("/saveGiftBag")
|
||||
public ResultBean<String> saveGiftBag(@RequestBody AppletGiftBagDto dto) {
|
||||
return AppletGiftBagService.saveGiftBag(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("礼包初始化")
|
||||
@GetMapping("/giftBagInit/{sid}")
|
||||
public ResultBean giftBagInit(@PathVariable String sid) {
|
||||
return AppletGiftBagService.giftBagInit(sid);
|
||||
}
|
||||
|
||||
@ApiOperation("删除礼包")
|
||||
@DeleteMapping("/deleteBag/{sid}")
|
||||
public ResultBean deleteBag(@PathVariable("sid") String sid) {
|
||||
return AppletGiftBagService.deleteBag(sid);
|
||||
}
|
||||
@ApiOperation("礼包信息列表")
|
||||
@GetMapping("/giftBagList")
|
||||
public ResultBean giftBagList() {
|
||||
return AppletGiftBagService.giftBagList();
|
||||
}
|
||||
@GetMapping("/isGrounding/{sid}/{state}")
|
||||
@ApiOperation(value = "设置是否上下架")
|
||||
public ResultBean isGrounding(@PathVariable("sid")String sid,@PathVariable("state") String state) {
|
||||
return AppletGiftBagService.isGrounding(sid, state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.yxt.yyth.biz.appletgiftbag;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
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.appletgiftbag.*;
|
||||
import com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoods;
|
||||
import com.yxt.yyth.api.appletgiftbag.GiftBagGoods;
|
||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yyth.biz.appletgiftbaggoods.AppletGiftBagGoodsService;
|
||||
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Service
|
||||
public class AppletGiftBagService extends MybatisBaseService<AppletGiftBagMapper, AppletGiftBag> {
|
||||
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private AppletGiftBagGoodsService appletGiftBagGoodsService;
|
||||
@Autowired
|
||||
private LpkGoodsService lpkGoodsService;
|
||||
|
||||
public ResultBean<PagerVo<AppletGiftBagVo>> giftBagListPage(PagerQuery<AppletGiftBagQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
AppletGiftBagQuery query = pq.getParams();
|
||||
QueryWrapper<AppletGiftBag> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getName())) {
|
||||
qw.like("name", query.getName());
|
||||
}
|
||||
qw.orderByDesc("isRecommend");
|
||||
qw.orderByDesc("createTime");
|
||||
IPage<AppletGiftBag> page = PagerUtil.queryToPage(pq);
|
||||
IPage<AppletGiftBagVo> pagging = baseMapper.giftBagListPage(page, qw);
|
||||
PagerVo<AppletGiftBagVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
List<AppletGiftBagVo> records = pagging.getRecords();
|
||||
records.removeAll(Collections.singleton(null));
|
||||
if (!records.isEmpty()) {
|
||||
for (AppletGiftBagVo record : records) {
|
||||
if (StringUtils.isNotBlank(record.getIconUrl())) {
|
||||
record.setIconUrl(fileUploadComponent.getUrlPrefix() + record.getIconUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean<String> saveGiftBag(AppletGiftBagDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
String sid = "";
|
||||
if (StringUtils.isNotBlank(dto.getSid())) {
|
||||
sid = dto.getSid();
|
||||
appletGiftBagGoodsService.deleteGoodsByBagSid(dto.getSid());
|
||||
AppletGiftBag AppletGiftBag = fetchBySid(dto.getSid());
|
||||
BeanUtil.copyProperties(dto, AppletGiftBag, "id", "sid");
|
||||
AppletGiftBag.setCreateTime(new DateTime());
|
||||
if (StringUtils.isNotBlank(dto.getIconUrl())) {
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
String path = dto.getIconUrl().substring(urlPrefix.length());
|
||||
AppletGiftBag.setIconUrl(path);
|
||||
}
|
||||
baseMapper.updateById(AppletGiftBag);
|
||||
if (!dto.getGoods().isEmpty()) {
|
||||
List<GiftBagGoods> goodsList = dto.getGoods();
|
||||
for (GiftBagGoods goods : goodsList) {
|
||||
AppletGiftBagGoods AppletGiftBagGoods = new AppletGiftBagGoods();
|
||||
AppletGiftBagGoods.setCreateTime(new DateTime());
|
||||
AppletGiftBagGoods.setGoodsSid(goods.getGoodsSid());
|
||||
AppletGiftBagGoods.setGiftbagSid(AppletGiftBag.getSid());
|
||||
AppletGiftBagGoods.setGoodsNumber(goods.getGoodsNumber());
|
||||
AppletGiftBagGoods.setPrice(0);
|
||||
appletGiftBagGoodsService.insert(AppletGiftBagGoods);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
AppletGiftBag AppletGiftBag = new AppletGiftBag();
|
||||
sid = AppletGiftBag.getSid();
|
||||
BeanUtil.copyProperties(dto, AppletGiftBag, "id", "sid");
|
||||
AppletGiftBag.setCreateTime(new DateTime());
|
||||
if (StringUtils.isNotBlank(dto.getIconUrl())) {
|
||||
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||
String path = dto.getIconUrl().substring(urlPrefix.length());
|
||||
AppletGiftBag.setIconUrl(path);
|
||||
}
|
||||
baseMapper.insert(AppletGiftBag);
|
||||
if (!dto.getGoods().isEmpty()) {
|
||||
List<GiftBagGoods> goodsList = dto.getGoods();
|
||||
for (GiftBagGoods goods : goodsList) {
|
||||
AppletGiftBagGoods AppletGiftBagGoods = new AppletGiftBagGoods();
|
||||
AppletGiftBagGoods.setCreateTime(new DateTime());
|
||||
AppletGiftBagGoods.setGoodsSid(goods.getGoodsSid());
|
||||
AppletGiftBagGoods.setGiftbagSid(AppletGiftBag.getSid());
|
||||
AppletGiftBagGoods.setGoodsNumber(goods.getGoodsNumber());
|
||||
appletGiftBagGoodsService.insert(AppletGiftBagGoods);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rb.success().setData(sid);
|
||||
}
|
||||
|
||||
public ResultBean giftBagInit(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
AppletGiftBagInitVo vo = new AppletGiftBagInitVo();
|
||||
AppletGiftBag entity = fetchBySid(sid);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (null != entity) {
|
||||
BeanUtil.copyProperties(entity, vo);
|
||||
if (null != entity.getDateStart()) {
|
||||
vo.setDateStart(sdf.format(entity.getDateStart()));
|
||||
}
|
||||
if (null != entity.getDateEnd()) {
|
||||
vo.setDateEnd(sdf.format(entity.getDateEnd()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(entity.getIconUrl())) {
|
||||
vo.setIconUrl(fileUploadComponent.getUrlPrefix() + entity.getIconUrl());
|
||||
}
|
||||
List<GiftBagGoods> goods = new ArrayList<>();
|
||||
List<AppletGiftBagGoods> records = appletGiftBagGoodsService.getRecordsByBagSid(sid);
|
||||
if (!records.isEmpty()) {
|
||||
for (AppletGiftBagGoods record : records) {
|
||||
GiftBagGoods bagGoods = new GiftBagGoods();
|
||||
if (StringUtils.isNotBlank(record.getGoodsNumber())) {
|
||||
bagGoods.setGoodsNumber(record.getGoodsNumber());
|
||||
}
|
||||
if (StringUtils.isNotBlank(record.getGoodsSid())) {
|
||||
bagGoods.setGoodsSid(record.getGoodsSid());
|
||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(record.getGoodsSid());
|
||||
if (null != lpkGoods) {
|
||||
if (StringUtils.isNotBlank(lpkGoods.getName())) {
|
||||
bagGoods.setName(lpkGoods.getName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||
bagGoods.setUnitName(lpkGoods.getUnitName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(lpkGoods.getPrice())) {
|
||||
bagGoods.setPrice(lpkGoods.getPrice());
|
||||
}
|
||||
}
|
||||
}
|
||||
goods.add(bagGoods);
|
||||
}
|
||||
}
|
||||
vo.setGoods(goods);
|
||||
}
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
public ResultBean deleteBag(String sid) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
AppletGiftBag AppletGiftBag = fetchBySid(sid);
|
||||
if (null != AppletGiftBag) {
|
||||
baseMapper.deleteById(AppletGiftBag.getId());
|
||||
appletGiftBagGoodsService.deleteGoodsByBagSid(sid);
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public ResultBean giftBagList() {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
List<AppletGiftBagVo> pagging = baseMapper.giftBagList();
|
||||
return rb.success().setData(pagging);
|
||||
}
|
||||
public ResultBean isGrounding(String sid,String state) {
|
||||
ResultBean rb = new ResultBean().fail();
|
||||
AppletGiftBag bag=baseMapper.selectOne(new QueryWrapper<AppletGiftBag>().eq("sid",sid));
|
||||
bag.setIsGrounding(state);
|
||||
baseMapper.updateById(bag);
|
||||
return rb.success().setMsg("修改成功");
|
||||
}
|
||||
|
||||
public int saveBags(List<AppletGiftBag> bags) {
|
||||
return baseMapper.saveBags(bags);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yyth.biz.appletgiftbaggoods;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoods;
|
||||
import com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoodsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppletGiftBagGoodsMapper extends BaseMapper<AppletGiftBagGoods> {
|
||||
|
||||
|
||||
int deleteGoodsByBagSid(@Param("sid") String sid);
|
||||
|
||||
@Select("select goods.name as goodsName,bads.goodsNumber ,bads.goodsSid,goods.picUrl,goods.price,goods.unitName,goods.remarks " +
|
||||
" from lpk_giftbag_goods bads left join lpk_goods goods on goods.sid =bads.goodsSid where bads.giftbagSid=#{sid}")
|
||||
List<AppletGiftBagGoodsVo> getGoodsByBagSid(String sid);
|
||||
|
||||
List<AppletGiftBagGoods> getRecordsByBagSid(@Param("sid") String sid);
|
||||
|
||||
int saveBagGoods(@Param("bagGoods") List<AppletGiftBagGoods> bagGoods);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.yyth.biz.appletgiftbaggoods.AppletGiftBagGoodsMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<delete id="deleteGoodsByBagSid">
|
||||
DELETE
|
||||
FROM lpk_giftbag_goods
|
||||
WHERE giftbagSid = #{sid}
|
||||
</delete>
|
||||
<select id="getRecordsByBagSid" resultType="com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoods">
|
||||
select *
|
||||
from lpk_giftbag_goods
|
||||
WHERE giftbagSid = #{sid}
|
||||
</select>
|
||||
<insert id="saveBagGoods" parameterType="java.util.List">
|
||||
insert into lpk_giftbag_goods(sid,createTime,giftbagSid,goodsSid,goodsNumber)
|
||||
values
|
||||
<foreach collection="bagGoods" item="item" index="index" separator=",">
|
||||
(#{item.sid},#{item.createTime},#{item.giftbagSid},#{item.goodsSid},#{item.goodsNumber})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yxt.yyth.biz.appletgiftbaggoods;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
|
||||
@Api(tags = "礼包包含商品信息")
|
||||
@RestController
|
||||
@RequestMapping("appletgiftbaggoods")
|
||||
public class AppletGiftBagGoodsRest {
|
||||
|
||||
@Autowired
|
||||
AppletGiftBagGoodsService appletGiftBagGoodsService;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yxt.yyth.biz.appletgiftbaggoods;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoods;
|
||||
import com.yxt.yyth.api.appletgiftbaggoods.AppletGiftBagGoodsVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Service
|
||||
public class AppletGiftBagGoodsService extends MybatisBaseService<AppletGiftBagGoodsMapper, AppletGiftBagGoods> {
|
||||
|
||||
public int deleteGoodsByBagSid(String sid) {
|
||||
return baseMapper.deleteGoodsByBagSid(sid);
|
||||
}
|
||||
|
||||
public List<AppletGiftBagGoods> getRecordsByBagSid(String sid) {
|
||||
return baseMapper.getRecordsByBagSid(sid);
|
||||
}
|
||||
|
||||
public List<AppletGiftBagGoodsVo> getGoodsByBagSid(String sid) {
|
||||
return baseMapper.getGoodsByBagSid(sid);
|
||||
}
|
||||
|
||||
|
||||
public int saveBagGoods(List<AppletGiftBagGoods> bagGoods) {
|
||||
return baseMapper.saveBagGoods(bagGoods);
|
||||
}
|
||||
}
|
||||
@@ -50,4 +50,7 @@ public interface EmpCardMapper extends BaseMapper<EmpCard> {
|
||||
" LEFT JOIN lpk_giftbag bag on card.giftbagSid=bag.sid" +
|
||||
" where card.sid=#{sid}")
|
||||
AppletVo getCardBySid(String cardSid);
|
||||
|
||||
@Select("update emp_card set isItInvalid='1',state='5',isReservation='1' where giftbagSid=#{giftbagSid} and state!=#{state} ")
|
||||
Integer updateIsItInvalid(@Param("giftbagSid") String giftbagSid, @Param("state") String state);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public interface EmpCardGiftMapper extends BaseMapper<EmpCardGift> {
|
||||
EmpCardGiftVo getEmpCardGoods(@Param("empCardSid")String empCardSid,@Param("goodsSid")String goodsSid);
|
||||
List<EmpCardGiftVo> recordList(@Param("empCardSid")String empCardSid);
|
||||
|
||||
List<EmpCardGiftVo> getEmpCardGiftByGiftbagSid(@Param("giftbagSid")String giftbagSid,@Param("state") String state);
|
||||
List<EmpCardGiftVo> getEmpCardGiftByGiftbagSid(@Param("endDate")String endDate,@Param("state") String state);
|
||||
|
||||
IPage<EmpCardGiftStatisticsVo> empCardGiftStatisticsList(IPage<EmpCardGiftStatisticsQuery> page, @Param(Constants.WRAPPER)QueryWrapper<EmpCardGift> qw);
|
||||
}
|
||||
|
||||
@@ -183,13 +183,14 @@
|
||||
SELECT
|
||||
gi.*
|
||||
FROM emp_card_gift gi
|
||||
left join emp_card c on c.sid =gi.empCardSid
|
||||
where c.giftbagSid=#{giftbagSid}
|
||||
where 1=1
|
||||
<if test="state!='' and state != null">
|
||||
and gi.state !=#{state}
|
||||
GROUP BY c.sid
|
||||
</if>
|
||||
|
||||
<if test="endDate !='' and endDate!=null">
|
||||
and date_format(endDate,'%Y-%m-%d') < date_format(#{endDate},'%Y-%m-%d')
|
||||
</if>
|
||||
and isItInvalid!=1
|
||||
</select>
|
||||
|
||||
<select id="empCardGiftStatisticsList" resultType="com.yxt.yyth.api.empcardgift.EmpCardGiftStatisticsVo">
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
unitName,
|
||||
typeCode,
|
||||
price,
|
||||
picUrl
|
||||
picUrl,
|
||||
specificationUnit,
|
||||
number,
|
||||
isAppletGrounding
|
||||
from lpk_goods
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
@@ -29,7 +32,10 @@
|
||||
unitName,
|
||||
typeCode,
|
||||
price,
|
||||
picUrl
|
||||
picUrl,
|
||||
specificationUnit,
|
||||
number,
|
||||
isAppletGrounding
|
||||
from lpk_goods
|
||||
</select>
|
||||
<select id="getGoodsDetails" resultType="com.yxt.yyth.api.lpkgoods.LpkGoodsVo">
|
||||
@@ -43,7 +49,10 @@
|
||||
price,
|
||||
picUrl,
|
||||
remarks,
|
||||
appContent
|
||||
appContent,
|
||||
specificationUnit,
|
||||
number,
|
||||
isAppletGrounding
|
||||
from lpk_goods
|
||||
where sid = #{sid}
|
||||
</select>
|
||||
|
||||
@@ -62,4 +62,9 @@ public class LpkGoodsRest {
|
||||
public ResultBean<LpkGoodsDetailsVo> goodsDetails(@PathVariable("sid") String sid) {
|
||||
return lpkGoodsService.goodsDetails(sid);
|
||||
}
|
||||
@ApiOperation("小程序商品上下架")
|
||||
@GetMapping("/appletGrounding/{sid}/{state}")
|
||||
public ResultBean<LpkGoodsDetailsVo> appletGrounding(@PathVariable("sid") String sid,@PathVariable("state") String state) {
|
||||
return lpkGoodsService.appletGrounding(sid,state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,4 +134,18 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
public LpkGoods getGoodsByName(String goodName) {
|
||||
return baseMapper.getGoodsByName(goodName);
|
||||
}
|
||||
|
||||
public ResultBean appletGrounding(String sid,String state) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkGoods lpkGoods = fetchBySid(sid);
|
||||
if (null != lpkGoods) {
|
||||
lpkGoods.setIsAppletGrounding(state);
|
||||
baseMapper.updateById(lpkGoods);
|
||||
|
||||
}else{
|
||||
return rb;
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,69 +49,137 @@ public class scheduledRest {
|
||||
public void updateIsItInvalid() {
|
||||
List<LpkGiftBag> lpkGiftBags = lpkGiftBagService.list(new QueryWrapper<LpkGiftBag>().eq("isSel","1"));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
//亲情卡过期状态
|
||||
empCardGiftState();
|
||||
//亲情卡预约提货状态
|
||||
empCardGiftReservationState();
|
||||
|
||||
for (LpkGiftBag lpkGiftBag : lpkGiftBags) {
|
||||
//1>2 1 、1<2 -1 、1=2 0
|
||||
int in = DateUtil.parse(sdf.format(lpkGiftBag.getDateEnd())).compareTo(DateUtil.parse(sdf.format(new Date())));
|
||||
if (String.valueOf(in).equals("-1")) {
|
||||
Integer i = lpkGiftCardMapper.selectCount(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5"));
|
||||
//提货卡 礼包过期处理
|
||||
List<EmpCardGiftVo> empCardGiftVos = empCardGiftMapper.getEmpCardGiftByGiftbagSid(lpkGiftBag.getSid(),"5");
|
||||
if (i != 0) {
|
||||
lpkGiftCardMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5");
|
||||
}
|
||||
//福礼卡 礼包过期处理
|
||||
if(empCardGiftVos.size()!=0){
|
||||
List<String> sids=new ArrayList<>();
|
||||
empCardGiftVos.forEach(s->{
|
||||
sids.add(s.getEmpCardSid()) ;
|
||||
});
|
||||
empCardGiftMapper.updateIsItInvalid(sids, "5");
|
||||
}
|
||||
//家庭卡
|
||||
lpkState(lpkGiftBag);
|
||||
//企业卡
|
||||
empCardState(lpkGiftBag);
|
||||
lpkGiftBag.setIsSel("2");
|
||||
lpkGiftBagService.updateById(lpkGiftBag);
|
||||
} else {
|
||||
List<LpkGiftCard> list = lpkGiftCardMapper.selectList(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()));
|
||||
List<EmpCardGiftVo> empCardGiftVos = empCardGiftMapper.getEmpCardGiftByGiftbagSid(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (EmpCardGiftVo card : empCardGiftVos) {
|
||||
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())));
|
||||
EmpCardGift entity=new EmpCardGift();
|
||||
BeanUtil.copyProperties(card, entity, "id", "sid");
|
||||
if (String.valueOf(c).equals("-1")) {
|
||||
if(card.getState().equals("5")){
|
||||
entity.setIsItInvalid("1");
|
||||
}
|
||||
entity.setIsReservation("1");
|
||||
empCardGiftMapper.updateById(entity);
|
||||
}
|
||||
//家庭卡
|
||||
lpkReservationState(lpkGiftBag);
|
||||
//企业卡
|
||||
empCardReservationState(lpkGiftBag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 家庭卡过期状态修改
|
||||
* @param lpkGiftBag
|
||||
*/
|
||||
public void lpkState(LpkGiftBag lpkGiftBag){
|
||||
Integer i = lpkGiftCardMapper.selectCount(new QueryWrapper<LpkGiftCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5"));
|
||||
//提货卡 礼包过期处理
|
||||
if (i != 0) {
|
||||
lpkGiftCardMapper.updateIsItInvalid(lpkGiftBag.getSid(), "5");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 亲情卡礼包过期修改
|
||||
*
|
||||
*/
|
||||
public void empCardGiftState(){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<EmpCardGiftVo> empCardGiftVos = empCardGiftMapper.getEmpCardGiftByGiftbagSid(sdf.format(new Date()),"5");
|
||||
if(empCardGiftVos.size()!=0){
|
||||
List<String> sids=new ArrayList<>();
|
||||
empCardGiftVos.forEach(s->{
|
||||
sids.add(s.getEmpCardSid()) ;
|
||||
});
|
||||
empCardGiftMapper.updateIsItInvalid(sids, "5");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业卡礼包状态修改
|
||||
* @param lpkGiftBag
|
||||
*/
|
||||
public void empCardState(LpkGiftBag lpkGiftBag){
|
||||
Integer i =empCardMapper.selectCount(new QueryWrapper<EmpCard>().eq("giftbagSid", lpkGiftBag.getSid()).ne("state", "5"));
|
||||
if(i!=0){
|
||||
empCardMapper.updateIsItInvalid(lpkGiftBag.getSid(),"5");
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* 家庭卡预约提货状态修改
|
||||
* @param lpkGiftBag
|
||||
*/
|
||||
public void lpkReservationState(LpkGiftBag lpkGiftBag){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* 亲情卡预约提货状态修改
|
||||
* @param lpkGiftBag
|
||||
*/
|
||||
public void empCardGiftReservationState(){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<EmpCardGiftVo> empCardGiftVos = empCardGiftMapper.getEmpCardGiftByGiftbagSid("","");
|
||||
for (EmpCardGiftVo card : empCardGiftVos) {
|
||||
LpkReserveOrderVo LpkReserveOrderVo = lpkReserveOrderService.selByCardSid(card.getSid()).getData();
|
||||
if (null != LpkReserveOrderVo) {
|
||||
// //1>2 1 、1<2 -1 、1=2 0
|
||||
int c = DateUtil.parse(sdf.format(LpkReserveOrderVo.getReserveDate())).compareTo(DateUtil.parse(sdf.format(new Date())));
|
||||
// EmpCardGift entity=new EmpCardGift();
|
||||
// BeanUtil.copyProperties(card, entity, "id", "sid");
|
||||
if (String.valueOf(c).equals("-1")) {
|
||||
EmpCardGift entity=empCardGiftMapper.selectOne(new QueryWrapper<EmpCardGift>().eq("sid",card.getSid()));
|
||||
if(card.getState().equals("5")){
|
||||
entity.setIsItInvalid("1");
|
||||
}
|
||||
entity.setIsReservation("1");
|
||||
empCardGiftMapper.update(entity,new QueryWrapper<EmpCardGift>().eq("sid",entity.getSid()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业卡预约提货状态修改
|
||||
* @param lpkGiftBag
|
||||
*/
|
||||
public void empCardReservationState(LpkGiftBag lpkGiftBag){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<EmpCard> list = empCardMapper.selectList(new QueryWrapper<EmpCard>().eq("giftbagSid", lpkGiftBag.getSid()));
|
||||
for (EmpCard 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");
|
||||
empCardMapper.updateById(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// @Scheduled(cron = "0 * * * * ? ")
|
||||
//public void aa(){
|
||||
// List<EmpCardGiftVo> empCardGiftVos = empCardGiftMapper.getEmpCardGiftByGiftbagSid("8e667618-63de-480c-ad1e-2747b76aa99b","5");
|
||||
// if(empCardGiftVos.size()!=0){
|
||||
// List<String> sids=new ArrayList<>();
|
||||
// empCardGiftVos.forEach(s->{
|
||||
// sids.add(s.getEmpCardSid()) ;
|
||||
// });
|
||||
// empCardGiftMapper.updateIsItInvalid(sids, "5");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user