12/6
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.yxt.yyth.api.lpkcardqrcode;
|
||||
|
||||
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 Fan
|
||||
* @description
|
||||
* @date 2023/11/24 16:03
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "礼品卡二维码表", description = "礼品卡二维码表")
|
||||
@TableName("lpk_card_qrcode")
|
||||
public class LpkCardQrcode {
|
||||
|
||||
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 cardSid;
|
||||
private String file;
|
||||
private String fileName;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yxt.yyth.api.lpkcardqrcode;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
@ApiModel(value = "礼品卡二维码表 数据传输对象", description = "礼品卡二维码表 数据传输对象")
|
||||
@Data
|
||||
public class LpkCardQrcodeDto implements Dto {
|
||||
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 cardSid;
|
||||
private String file;
|
||||
private String fileName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yxt.yyth.api.lpkcardqrcode;
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@ApiModel(value = "礼品卡二维码表 查询条件", description = "礼品卡二维码表 查询条件")
|
||||
@Data
|
||||
public class LpkCardQrcodeQuery implements Query {
|
||||
|
||||
private String startDate; //开始时间
|
||||
private String endDate; //结束时间
|
||||
private String countNumber; //总数
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.yxt.yyth.api.lpkcardqrcode;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "礼品卡二维码表 视图数据对象", description = "礼品卡二维码表 视图数据对象")
|
||||
@NoArgsConstructor
|
||||
public class LpkCardQrcodeVo implements Vo {
|
||||
|
||||
private String id;
|
||||
private String sid;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String remarks;
|
||||
private String cardSid;
|
||||
private String file;
|
||||
private String fileName;
|
||||
}
|
||||
@@ -30,4 +30,5 @@ public class LpkGiftCardListVo implements Vo {
|
||||
private String name;
|
||||
private String buildDate;
|
||||
private String countNumber;
|
||||
private String qrCode;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.yxt.yyth.api.lpkgiftcard;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/12/6 15:49
|
||||
*/
|
||||
@Data
|
||||
public class LpkGiftCardWordVo {
|
||||
private String qrCode;//二维码
|
||||
private String bagName;//礼包名
|
||||
private String serialNumber;//序列号
|
||||
private String code;//卡号
|
||||
private String codeKey;//密码
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.yxt.yyth.biz.lpkcardqrcode;
|
||||
|
||||
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.lpkcardqrcode.LpkCardQrcode;
|
||||
import com.yxt.yyth.api.lpkcardqrcode.LpkCardQrcodeVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Mapper
|
||||
public interface LpkCardQrcodeMapper extends BaseMapper<LpkCardQrcode> {
|
||||
|
||||
IPage<LpkCardQrcodeVo> recordListPage(IPage<LpkCardQrcode> page, @Param(Constants.WRAPPER) QueryWrapper<LpkCardQrcode> qw);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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.lpkcardqrcode.LpkCardQrcodeMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
|
||||
<select id="recordListPage" resultType="com.yxt.yyth.api.lpkcardqrcode.LpkCardQrcodeVo">
|
||||
select
|
||||
r.sid,
|
||||
date_format(r.buildDate, '%Y-%m-%d') as buildDate,
|
||||
r.countNumber,
|
||||
r.startNumber,
|
||||
r.endNumber,
|
||||
from lpk_card_qrcode as r
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yxt.yyth.biz.lpkcardqrcode;
|
||||
|
||||
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.lpkcardqrcode.LpkCardQrcodeDto;
|
||||
import com.yxt.yyth.api.lpkcardqrcode.LpkCardQrcodeQuery;
|
||||
import com.yxt.yyth.api.lpkcardqrcode.LpkCardQrcodeVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
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("lpkcardqrcode")
|
||||
public class LpkCardQrcodeRest {
|
||||
|
||||
@Autowired
|
||||
LpkCardQrcodeService LpkCardQrcodeService;
|
||||
|
||||
@ApiOperation("发放记录列表")
|
||||
@PostMapping("/recordListPage")
|
||||
public ResultBean<PagerVo<LpkCardQrcodeVo>> recordListPage(@RequestBody PagerQuery<LpkCardQrcodeQuery> pq) {
|
||||
return LpkCardQrcodeService.recordListPage(pq);
|
||||
}
|
||||
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("/save")
|
||||
public ResultBean save(@RequestBody LpkCardQrcodeDto dto) {
|
||||
return LpkCardQrcodeService.save(dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.yxt.yyth.biz.lpkcardqrcode;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.lpkcardqrcode.LpkCardQrcode;
|
||||
import com.yxt.yyth.api.lpkcardqrcode.LpkCardQrcodeDto;
|
||||
import com.yxt.yyth.api.lpkcardqrcode.LpkCardQrcodeQuery;
|
||||
import com.yxt.yyth.api.lpkcardqrcode.LpkCardQrcodeVo;
|
||||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2023/11/21 15:03
|
||||
*/
|
||||
@Service
|
||||
public class LpkCardQrcodeService extends MybatisBaseService<LpkCardQrcodeMapper, LpkCardQrcode> {
|
||||
|
||||
@Autowired
|
||||
private LpkGiftCardService lpkGiftCardService;
|
||||
|
||||
public ResultBean<PagerVo<LpkCardQrcodeVo>> recordListPage(PagerQuery<LpkCardQrcodeQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkCardQrcodeQuery query = pq.getParams();
|
||||
QueryWrapper<LpkCardQrcode> qw = new QueryWrapper<>();
|
||||
qw.eq("1", "1");
|
||||
if (StringUtils.isNotBlank(query.getCountNumber())) {
|
||||
qw.eq("r.countNumber", query.getCountNumber());
|
||||
}
|
||||
// String startDate = query.getStartDate();
|
||||
// String effEndTime = query.getEndDate();
|
||||
// qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (r.buildDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')").
|
||||
// apply(org.apache.commons.lang3.StringUtils.isNotEmpty(effEndTime), "date_format (r.buildDate,'%Y-%m-%d') <= date_format('" + effEndTime + "','%Y-%m-%d')"
|
||||
// );
|
||||
qw.orderByDesc("r.createTime");
|
||||
IPage<LpkCardQrcode> page = PagerUtil.queryToPage(pq);
|
||||
IPage<LpkCardQrcodeVo> pagging = baseMapper.recordListPage(page, qw);
|
||||
PagerVo<LpkCardQrcodeVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
public ResultBean save(LpkCardQrcodeDto dto) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
LpkCardQrcode entity=new LpkCardQrcode();
|
||||
BeanUtil.copyProperties(dto, entity, "id", "sid");
|
||||
String sid=entity.getSid();
|
||||
baseMapper.insert(entity);
|
||||
return rb.success().setMsg(sid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,4 +53,7 @@ public interface LpkGiftCardMapper extends BaseMapper<LpkGiftCard> {
|
||||
Integer cardGrantCount(@Param("recordSid") String recordSid);
|
||||
@Select("update lpk_giftcard set isItInvalid='1' where giftbagSid=#{giftbagSid} and state!=#{state} ")
|
||||
Integer updateIsItInvalid(@Param("giftbagSid") String giftbagSid,@Param("state")String state);
|
||||
|
||||
// List<LpkGiftCardWordVo> selGiftCard(@Param("serialNumbers") List<Integer> serialNumbers);
|
||||
List<LpkGiftCardWordVo> selGiftCard();
|
||||
}
|
||||
|
||||
@@ -121,5 +121,14 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- <select id="selGiftCard" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardWordVo">-->
|
||||
<!-- select card.*,bag.name as bagName from lpk_giftcard card left join lpk_giftbag bag on bag.sid =card.giftbagSid where card.serialNumber in-->
|
||||
<!-- <foreach collection="serialNumbers" item="item" index="index" open="(" close=")" separator=",">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </select>-->
|
||||
<select id="selGiftCard" resultType="com.yxt.yyth.api.lpkgiftcard.LpkGiftCardWordVo">
|
||||
select card.*,bag.name as bagName from lpk_giftcard card left join lpk_giftbag bag on bag.sid =card.giftbagSid
|
||||
limit 8
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -60,6 +60,11 @@ public class LpkGiftCardRest {
|
||||
public ResultBean generateCard(@RequestBody LpkGiftCardDto dto) {
|
||||
return lpkGiftCardService.generateCard(dto);
|
||||
}
|
||||
@GetMapping("/getCardByBank")
|
||||
@ApiOperation(value = "生成礼包卡信息")
|
||||
public ResultBean getCardByBank() {
|
||||
return lpkGiftCardService.getCardByBank();
|
||||
}
|
||||
|
||||
@PostMapping("/cardList")
|
||||
@ApiOperation(value = "礼包卡信息列表")
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user