34 changed files with 664 additions and 19 deletions
@ -0,0 +1,25 @@ |
|||
package com.yxt.yyth.api.lpkbank; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class LpkBank { |
|||
|
|||
private String id; |
|||
private String sid= UUID.randomUUID().toString(); |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String name; |
|||
private String shortName; |
|||
private String linker; |
|||
private String linkPhone; |
|||
private String address; |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.yxt.yyth.api.lpkbank; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class LpkBankDto implements Dto { |
|||
private String sid; |
|||
private String id; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String name;//姓名
|
|||
private String shortName;//简称
|
|||
private String linker;//联系人
|
|||
private String linkPhone;//联系电话
|
|||
private String address;//地址
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.yxt.yyth.api.lpkbank; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class LpkBankQuery implements Query { |
|||
private String shortName; |
|||
private String name; |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.yyth.api.lpkbank; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class LpkBankVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String name; |
|||
private String shortName; |
|||
private String linker; |
|||
private String linkPhone; |
|||
private String address; |
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.yxt.yyth.api.lpkcardgrantrecord; |
|||
|
|||
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_grant_record") |
|||
public class LpkCardGrantRecord { |
|||
|
|||
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 giftcardSid; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date buildDate; |
|||
private String countNumber; |
|||
private String startNumber; |
|||
private String endNumber; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.yxt.yyth.api.lpkcardgrantrecord; |
|||
|
|||
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 LpkCardGrantRecordDto 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; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date buildDate; |
|||
private String countNumber; |
|||
private String startNumber; |
|||
private String endNumber; |
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.yyth.api.lpkcardgrantrecord; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
|
|||
|
|||
@ApiModel(value = "礼品卡生成记录表 查询条件", description = "礼品卡生成记录表 查询条件") |
|||
@Data |
|||
public class LpkCardGrantRecordQuery implements Query { |
|||
|
|||
private String startDate; //开始时间
|
|||
private String endDate; //结束时间
|
|||
private String countNumber; //总数
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.yyth.api.lpkcardgrantrecord; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
|
|||
@Data |
|||
@ApiModel(value = "礼品卡生成记录表 视图数据对象", description = "礼品卡生成记录表 视图数据对象") |
|||
@NoArgsConstructor |
|||
public class LpkCardGrantRecordVo implements Vo { |
|||
|
|||
private String sid; |
|||
private String buildDate; //创建时间
|
|||
private String countNumber; //总数
|
|||
private String startNumber; //起始号
|
|||
private String endNumber; //结束号
|
|||
private String bagName; |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.yyth.api.lpkgiftcard; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 13:50 |
|||
*/ |
|||
@Data |
|||
public class CardGrantDto { |
|||
private String start;//开始序列号
|
|||
private String end;//结束序列号
|
|||
private String bankSid;//网点sid
|
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.yyth.biz.lpkbank; |
|||
|
|||
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.lpkbank.LpkBank; |
|||
import com.yxt.yyth.api.lpkbank.LpkBankVo; |
|||
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 LpkBankMapper extends BaseMapper<LpkBank> { |
|||
|
|||
IPage<LpkBankVo> ListPageVo(IPage<LpkBank> page, @Param(Constants.WRAPPER) QueryWrapper<LpkBank> qw); |
|||
@Select("select * from lpk_bank") |
|||
List<LpkBankVo> listAll(); |
|||
|
|||
@Select("select * from lpk_bank where sid=#{sid}") |
|||
LpkBankVo getLpkBankBySid( @Param("sid") String sid); |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
<?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.lpkbank.LpkBankMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
|
|||
<select id="ListPageVo" resultType="com.yxt.yyth.api.lpkbank.LpkBankVo"> |
|||
select |
|||
* |
|||
from lpk_bank |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,62 @@ |
|||
package com.yxt.yyth.biz.lpkbank; |
|||
|
|||
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.lpkbank.LpkBankDto; |
|||
import com.yxt.yyth.api.lpkbank.LpkBankQuery; |
|||
import com.yxt.yyth.api.lpkbank.LpkBankVo; |
|||
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("lpkbank") |
|||
public class LpkBankRest { |
|||
|
|||
@Autowired |
|||
LpkBankService lpkBankService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<LpkBankVo>> ListPageVo(@RequestBody PagerQuery<LpkBankQuery> pq) { |
|||
return lpkBankService.ListPageVo(pq); |
|||
} |
|||
@ApiOperation("全部网点") |
|||
@GetMapping("/listAll") |
|||
public ResultBean listAll() { |
|||
return lpkBankService.listAll(); |
|||
} |
|||
@ApiOperation("保存") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody LpkBankDto dto) { |
|||
return lpkBankService.save(dto); |
|||
} |
|||
@ApiOperation("修改") |
|||
@PostMapping("/update") |
|||
public ResultBean update(@RequestBody LpkBankDto dto) { |
|||
return lpkBankService.update(dto); |
|||
} |
|||
|
|||
@ApiOperation("根据sid查询") |
|||
@GetMapping("/getLpkBankBySid/{sid}") |
|||
public ResultBean getLpkBankBySid(@PathVariable String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
LpkBankVo lpkBankVo=lpkBankService.getLpkBankBySid(sid); |
|||
return rb.success().setData(lpkBankVo); |
|||
} |
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable String sid) { |
|||
return lpkBankService.delete(sid); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.yxt.yyth.biz.lpkbank; |
|||
|
|||
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.lpkbank.LpkBank; |
|||
import com.yxt.yyth.api.lpkbank.LpkBankDto; |
|||
import com.yxt.yyth.api.lpkbank.LpkBankQuery; |
|||
import com.yxt.yyth.api.lpkbank.LpkBankVo; |
|||
import com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecord; |
|||
import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Service |
|||
public class LpkBankService extends MybatisBaseService<LpkBankMapper, LpkBank> { |
|||
|
|||
|
|||
public ResultBean<PagerVo<LpkBankVo>> ListPageVo(PagerQuery<LpkBankQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
LpkBankQuery query = pq.getParams(); |
|||
QueryWrapper<LpkBank> qw = new QueryWrapper<>(); |
|||
if (StringUtils.isNotBlank(query.getName())) { |
|||
qw.like("name", query.getName()); |
|||
} |
|||
IPage<LpkBank> page = PagerUtil.queryToPage(pq); |
|||
IPage<LpkBankVo> pagging = baseMapper.ListPageVo(page, qw); |
|||
PagerVo<LpkBankVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
public ResultBean listAll() { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<LpkBankVo> pagging = baseMapper.listAll(); |
|||
return rb.success().setData(pagging); |
|||
} |
|||
|
|||
public ResultBean save(LpkBankDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
LpkBank entity=new LpkBank(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg("添加成功"); |
|||
} |
|||
public ResultBean update(LpkBankDto dto) { |
|||
ResultBean rb=new ResultBean(); |
|||
String dtoSid = dto.getSid(); |
|||
LpkBank entity=fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
return rb.success().setMsg("修改成功"); |
|||
} |
|||
public LpkBankVo getLpkBankBySid(String sid){ |
|||
return baseMapper.getLpkBankBySid(sid); |
|||
} |
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb=new ResultBean(); |
|||
baseMapper.delete(new QueryWrapper<LpkBank>().eq("sid",sid)); |
|||
return rb.success().setMsg("删除成功"); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.yyth.biz.lpkcardgrantrecord; |
|||
|
|||
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.lpkcardgrantrecord.LpkCardGrantRecord; |
|||
import com.yxt.yyth.api.lpkcardgrantrecord.LpkCardGrantRecordVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Mapper |
|||
public interface LpkCardGrantRecordMapper extends BaseMapper<LpkCardGrantRecord> { |
|||
|
|||
IPage<LpkCardGrantRecordVo> recordListPage(IPage<LpkCardGrantRecord> page, @Param(Constants.WRAPPER) QueryWrapper<LpkCardGrantRecord> 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.lpkcardgrantrecord.LpkCardGrantRecordMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
|
|||
<select id="recordListPage" resultType="com.yxt.yyth.api.lpkcardbuildrecord.LpkCardBuildRecordVo"> |
|||
select |
|||
r.sid, |
|||
date_format(r.buildDate, '%Y-%m-%d') as buildDate, |
|||
r.countNumber, |
|||
r.startNumber, |
|||
r.endNumber, |
|||
from lpk_card_grant_record as r |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,41 @@ |
|||
package com.yxt.yyth.biz.lpkcardgrantrecord; |
|||
|
|||
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.lpkcardgrantrecord.LpkCardGrantRecordDto; |
|||
import com.yxt.yyth.api.lpkcardgrantrecord.LpkCardGrantRecordQuery; |
|||
import com.yxt.yyth.api.lpkcardgrantrecord.LpkCardGrantRecordVo; |
|||
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("lpkcardgrantrecord") |
|||
public class LpkCardGrantRecordRest { |
|||
|
|||
@Autowired |
|||
LpkCardGrantRecordService lpkCardGrantRecordService; |
|||
|
|||
@ApiOperation("发放记录列表") |
|||
@PostMapping("/recordListPage") |
|||
public ResultBean<PagerVo<LpkCardGrantRecordVo>> recordListPage(@RequestBody PagerQuery<LpkCardGrantRecordQuery> pq) { |
|||
return lpkCardGrantRecordService.recordListPage(pq); |
|||
} |
|||
|
|||
@ApiOperation("保存") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody LpkCardGrantRecordDto dto) { |
|||
return lpkCardGrantRecordService.save(dto); |
|||
} |
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.yxt.yyth.biz.lpkcardgrantrecord; |
|||
|
|||
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.lpkcardgrantrecord.LpkCardGrantRecord; |
|||
import com.yxt.yyth.api.lpkcardgrantrecord.LpkCardGrantRecordDto; |
|||
import com.yxt.yyth.api.lpkcardgrantrecord.LpkCardGrantRecordQuery; |
|||
import com.yxt.yyth.api.lpkcardgrantrecord.LpkCardGrantRecordVo; |
|||
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 LpkCardGrantRecordService extends MybatisBaseService<LpkCardGrantRecordMapper, LpkCardGrantRecord> { |
|||
|
|||
@Autowired |
|||
private LpkGiftCardService lpkGiftCardService; |
|||
|
|||
public ResultBean<PagerVo<LpkCardGrantRecordVo>> recordListPage(PagerQuery<LpkCardGrantRecordQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
LpkCardGrantRecordQuery query = pq.getParams(); |
|||
QueryWrapper<LpkCardGrantRecord> 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<LpkCardGrantRecord> page = PagerUtil.queryToPage(pq); |
|||
IPage<LpkCardGrantRecordVo> pagging = baseMapper.recordListPage(page, qw); |
|||
PagerVo<LpkCardGrantRecordVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
public ResultBean save(LpkCardGrantRecordDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
LpkCardGrantRecord entity=new LpkCardGrantRecord(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
String sid=entity.getSid(); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg(sid); |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue