From 29242c9ee8d8c6571b56a3271112157c85d2f14d Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Tue, 12 Mar 2024 18:00:20 +0800 Subject: [PATCH] 3/12 --- .../api/invoicerecords/InvoiceRecords.java | 27 ++++++++ .../api/invoicerecords/InvoiceRecordsDto.java | 24 +++++++ .../invoicerecords/InvoiceRecordsQuery.java | 14 +++++ .../api/invoicerecords/InvoiceRecordsVo.java | 24 +++++++ .../VegeCellarReserveOrderVo.java | 2 + .../invoicerecords/InvoiceRecordsMapper.java | 29 +++++++++ .../invoicerecords/InvoiceRecordsMapper.xml | 7 +++ .../invoicerecords/InvoiceRecordsRest.java | 58 +++++++++++++++++ .../invoicerecords/InvoiceRecordsService.java | 63 +++++++++++++++++++ .../VegeCellarReserveOrderMapper.xml | 3 +- .../VegeCellarReserveOrderRest.java | 2 +- .../VegeCellarReserveOrderService.java | 51 ++++++++------- .../yxt/yythmall/config/SaTokenConfigure.java | 1 + 13 files changed, 281 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecords.java create mode 100644 src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsDto.java create mode 100644 src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsQuery.java create mode 100644 src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsVo.java create mode 100644 src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsMapper.java create mode 100644 src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsMapper.xml create mode 100644 src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsRest.java create mode 100644 src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsService.java diff --git a/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecords.java b/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecords.java new file mode 100644 index 0000000..9e0d603 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecords.java @@ -0,0 +1,27 @@ +package com.yxt.yythmall.api.invoicerecords; + +import lombok.Data; + +import java.util.UUID; + +/** + * @author wangpengfei + * @date 2023/11/30 9:27 + */ +@Data +public class InvoiceRecords { + + private String id; + private String sid= UUID.randomUUID().toString(); + private String createTime; + private String remarks; + private String isEnable; + private String invoiceType;//发票类型 + private String invoiceHeader;//发票抬头 + private String dutyParagraph;//税号 + private String bankOfDeposit;//开户行 + private String bankAccount;//账号 + private String enterpriseAddress;//企业地址 + private String orderSid;//订单sid + +} diff --git a/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsDto.java b/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsDto.java new file mode 100644 index 0000000..4286836 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsDto.java @@ -0,0 +1,24 @@ +package com.yxt.yythmall.api.invoicerecords; + +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/11/30 9:27 + */ +@Data +public class InvoiceRecordsDto implements Dto { + private String sid; + private String id; + private String createTime; + private String remarks; + private String isEnable; + private String invoiceType;//发票类型 + private String invoiceHeader;//发票抬头 + private String dutyParagraph;//税号 + private String bankOfDeposit;//开户行 + private String bankAccount;//账号 + private String enterpriseAddress;//企业地址 + private String orderSid;//订单sid +} diff --git a/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsQuery.java b/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsQuery.java new file mode 100644 index 0000000..5f40ef7 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsQuery.java @@ -0,0 +1,14 @@ +package com.yxt.yythmall.api.invoicerecords; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/11/30 9:27 + */ +@Data +public class InvoiceRecordsQuery implements Query { + private String shortName; + private String name; +} diff --git a/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsVo.java b/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsVo.java new file mode 100644 index 0000000..27f4987 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/api/invoicerecords/InvoiceRecordsVo.java @@ -0,0 +1,24 @@ +package com.yxt.yythmall.api.invoicerecords; + +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/11/30 9:27 + */ +@Data +public class InvoiceRecordsVo implements Vo { + private String id; + private String sid; + private String createTime; + private String remarks; + private String isEnable; + private String invoiceType;//发票类型 + private String invoiceHeader;//发票抬头 + private String dutyParagraph;//税号 + private String bankOfDeposit;//开户行 + private String bankAccount;//账号 + private String enterpriseAddress;//企业地址 + private String orderSid;//订单sid +} diff --git a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderVo.java b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderVo.java index f4b5660..c1a8b92 100644 --- a/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderVo.java +++ b/src/main/java/com/yxt/yythmall/api/vegecallerreserveorder/VegeCellarReserveOrderVo.java @@ -45,4 +45,6 @@ public class VegeCellarReserveOrderVo implements Vo { private String reserveCode; private String newCode; private boolean showLsit=false; + private String state; + private boolean isCancel=false;//是否能取消 } diff --git a/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsMapper.java b/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsMapper.java new file mode 100644 index 0000000..5f1364b --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsMapper.java @@ -0,0 +1,29 @@ +package com.yxt.yythmall.biz.invoicerecords; + +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.yythmall.api.invoicerecords.InvoiceRecords; +import com.yxt.yythmall.api.invoicerecords.InvoiceRecordsVo; +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 InvoiceRecordsMapper extends BaseMapper { + + + @Select("select * from invoice_records") + List listAll(); + + @Select("select * from invoice_records where sid=#{sid}") + InvoiceRecordsVo getInvoiceRecordsBySid( @Param("sid") String sid); + +} diff --git a/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsMapper.xml b/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsMapper.xml new file mode 100644 index 0000000..885cbc8 --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsMapper.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsRest.java b/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsRest.java new file mode 100644 index 0000000..52eb5fe --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsRest.java @@ -0,0 +1,58 @@ +package com.yxt.yythmall.biz.invoicerecords; + +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.yythmall.api.invoicerecords.InvoiceRecordsDto; +import com.yxt.yythmall.api.invoicerecords.InvoiceRecordsQuery; +import com.yxt.yythmall.api.invoicerecords.InvoiceRecordsVo; +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("invoicerecords") +public class InvoiceRecordsRest { + + @Autowired + InvoiceRecordsService InvoiceRecordsService; + + + @ApiOperation("查询所有的发票信息") + @GetMapping("/listAll") + public ResultBean listAll() { + return InvoiceRecordsService.listAll(); + } + @ApiOperation("保存") + @PostMapping("/save") + public ResultBean save(@RequestBody InvoiceRecordsDto dto) { + return InvoiceRecordsService.save(dto); + } + @ApiOperation("修改") + @PostMapping("/update") + public ResultBean update(@RequestBody InvoiceRecordsDto dto) { + return InvoiceRecordsService.update(dto); + } + + @ApiOperation("根据sid查询") + @GetMapping("/getInvoiceRecordsBySid/{sid}") + public ResultBean getInvoiceRecordsBySid(@PathVariable String sid){ + ResultBean rb = ResultBean.fireFail(); + InvoiceRecordsVo InvoiceRecordsVo=InvoiceRecordsService.getInvoiceRecordsBySid(sid); + return rb.success().setData(InvoiceRecordsVo); + } + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable String sid) { + return InvoiceRecordsService.delete(sid); + } + + +} diff --git a/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsService.java b/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsService.java new file mode 100644 index 0000000..90de01f --- /dev/null +++ b/src/main/java/com/yxt/yythmall/biz/invoicerecords/InvoiceRecordsService.java @@ -0,0 +1,63 @@ +package com.yxt.yythmall.biz.invoicerecords; + +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.yythmall.api.invoicerecords.InvoiceRecords; +import com.yxt.yythmall.api.invoicerecords.InvoiceRecordsDto; +import com.yxt.yythmall.api.invoicerecords.InvoiceRecordsQuery; +import com.yxt.yythmall.api.invoicerecords.InvoiceRecordsVo; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/11/21 15:03 + */ +@Service +public class InvoiceRecordsService extends MybatisBaseService { + + + + public ResultBean listAll() { + ResultBean rb = ResultBean.fireFail(); + List pagging = baseMapper.listAll(); + return rb.success().setData(pagging); + } + + public ResultBean save(InvoiceRecordsDto dto) { + ResultBean rb = ResultBean.fireFail(); + InvoiceRecords entity=new InvoiceRecords(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + return rb.success().setMsg("添加成功"); + } + public ResultBean update(InvoiceRecordsDto dto) { + ResultBean rb=new ResultBean(); + String dtoSid = dto.getSid(); + InvoiceRecords entity=fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + return rb.success().setMsg("修改成功"); + } + public InvoiceRecordsVo getInvoiceRecordsBySid(String sid){ + return baseMapper.getInvoiceRecordsBySid(sid); + } + public ResultBean delete(String sid) { + ResultBean rb=new ResultBean(); + baseMapper.delete(new QueryWrapper().eq("sid",sid)); + return rb.success().setMsg("删除成功"); + } + + + public List listAllBank() { + return baseMapper.selectList(null); + } +} diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml index 4b24af0..e2472ae 100644 --- a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml @@ -24,7 +24,8 @@ end affiliationValue, s.name as storeName, s.address as address, - s.phone as linkPhone + s.phone as linkPhone, + o.state FROM vege_cellar_reserve_order AS o left join lpk_store s on s.sid=o.storeSid diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java index b795dfd..18311a7 100644 --- a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java @@ -29,7 +29,7 @@ public class VegeCellarReserveOrderRest { return vegeCellarReserveOrderService.submission(dto); } @ApiOperation("取消预约") - @PostMapping("/cancelReservation/{code}") + @GetMapping("/cancelReservation/{code}") public ResultBean cancelReservation(@PathVariable("code") String code) { return vegeCellarReserveOrderService.cancelReservation(code); } diff --git a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java index 7e9c8e2..61d8ba8 100644 --- a/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java +++ b/src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java @@ -195,10 +195,11 @@ public class VegeCellarReserveOrderService extends MybatisBaseService p = PagerUtil.pageToVo(pagging, null); return rb.success().setData(p); } @@ -216,15 +217,21 @@ public class VegeCellarReserveOrderService extends MybatisBaseService2 1 、1<2 -1 、1=2 0 +// int k=DateUtil.parse(sdf1.format(date)).compareTo(DateUtil.parse(sdf1.format(DateUtil.parse("2024-03-12 15:00:01")))); +// if(String.valueOf(k).equals("-1")){ +// System.out.println(false); +// } +// System.out.println(true); +// } private QueryWrapper buildQuery(LpkReserveOrderQuery query) { @@ -255,7 +262,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); IPage page = PagerUtil.queryToPage(pq); IPage pagerVo = baseMapper.pageOfCustomer(page, qw); return rb.success().setData(pagerVo); @@ -263,7 +270,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService> mapForExcelCustomer(LpkReserveOrderQuery query) { QueryWrapper qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); List list = baseMapper.pageOfCustomer(qw); Map> map = new HashMap<>(); list.forEach(vo -> { @@ -281,7 +288,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService listForExcelCustomer(LpkReserveOrderQuery query) { QueryWrapper qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); List list = baseMapper.pageOfCustomer(qw); List volist = new ArrayList<>(); list.forEach(vo -> { @@ -296,7 +303,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); IPage page = PagerUtil.queryToPage(pq); IPage pagerVo = baseMapper.pageOfStore(page, qw); return rb.success().setData(pagerVo); @@ -304,7 +311,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService> mapForExcelStore(LpkReserveOrderQuery query) { QueryWrapper qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); List list = baseMapper.pageOfStore(qw); Map> map = new HashMap<>(); list.forEach(vo -> { @@ -322,7 +329,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService listForExcelStore(LpkReserveOrderQuery query) { QueryWrapper qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); List list = baseMapper.pageOfStore(qw); List listRes = new ArrayList<>(); @@ -338,7 +345,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); IPage page = PagerUtil.queryToPage(pq); IPage pagerVo = baseMapper.pageOfBank(page, qw); return rb.success().setData(pagerVo); @@ -346,7 +353,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService> mapForExcelBank(LpkReserveOrderQuery query) { QueryWrapper qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); List list = baseMapper.pageOfBank(qw); Map> map = new HashMap<>(); list.forEach(vo -> { @@ -364,7 +371,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService listForExcelBank(LpkReserveOrderQuery query) { QueryWrapper qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); List list = baseMapper.pageOfBank(qw); List volist = new ArrayList<>(); list.forEach(vo -> { @@ -379,7 +386,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); IPage page = PagerUtil.queryToPage(pq); IPage pagerVo = baseMapper.pageOfAll(page, qw); return rb.success().setData(pagerVo); @@ -389,7 +396,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService qw = buildQuery(query); -// qw.ne("vo.state","2"); + qw.ne("vo.state","2"); List list = baseMapper.pageOfAll(qw); List listRes = new ArrayList<>(); diff --git a/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java b/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java index 02f6651..65f8884 100644 --- a/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java +++ b/src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java @@ -110,6 +110,7 @@ public class SaTokenConfigure implements WebMvcConfigurer { .excludePathPatterns("/lpkcustomer/updateCustomerBank") .excludePathPatterns("/lpkgoods/isEnterprise/**") .excludePathPatterns("/enterprisecertification/save") + .excludePathPatterns("/lpksreservoorders/cancelReservation/**") .excludePathPatterns("//wxapi/**") ; }