38 changed files with 962 additions and 36 deletions
@ -0,0 +1,39 @@ |
|||
package com.yxt.yythmall.api.customerinvoice; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class CustomerInvoice { |
|||
|
|||
private String id; |
|||
private String sid= UUID.randomUUID().toString(); |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String invoiceTypeSid;//发票类型sid
|
|||
private String invoiceType;//发票类型
|
|||
private String headingType;//发票类型
|
|||
private String invoiceHeader;//发票抬头
|
|||
private String dutyParagraph;//税号
|
|||
private String bankOfDeposit;//开户行
|
|||
private String bankAccount;//账号
|
|||
private String enterpriseAddress;//企业地址
|
|||
private String enterprisePhone;//企业电话
|
|||
private String isDefault;//是否默认 1 为默认
|
|||
private String customerSid; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.yxt.yythmall.api.customerinvoice; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class CustomerInvoiceDto implements Dto { |
|||
private String sid; |
|||
private String id; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String invoiceTypeSid;//发票类型sid
|
|||
private String invoiceType;//发票类型
|
|||
private String headingType;//发票类型
|
|||
private String invoiceHeader;//发票抬头
|
|||
private String dutyParagraph;//税号
|
|||
private String bankOfDeposit;//开户行
|
|||
private String bankAccount;//账号
|
|||
private String enterpriseAddress;//企业地址
|
|||
private String enterprisePhone;//企业电话
|
|||
private String isDefault;//是否默认 1 为默认
|
|||
private String customerSid; |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.yxt.yythmall.api.customerinvoice; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class CustomerInvoiceQuery implements Query { |
|||
private String shortName; |
|||
private String name; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.yxt.yythmall.api.customerinvoice; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class CustomerInvoiceVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String invoiceTypeSid;//发票类型sid
|
|||
private String invoiceType;//发票类型
|
|||
private String headingType;//发票类型
|
|||
private String invoiceHeader;//发票抬头
|
|||
private String dutyParagraph;//税号
|
|||
private String bankOfDeposit;//开户行
|
|||
private String bankAccount;//账号
|
|||
private String enterpriseAddress;//企业地址
|
|||
private String enterprisePhone;//企业电话
|
|||
private String isDefault;//是否默认 1 为默认
|
|||
private String customerSid; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.yythmall.api.invoiceapprovalrecords; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class InvoiceApprovalRecords { |
|||
|
|||
private String id; |
|||
private String sid= UUID.randomUUID().toString(); |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String orderSid; |
|||
private String approvalOpinions;//审核意见
|
|||
private String operator;//操作人
|
|||
private String operatorSid;//操作人sid
|
|||
private String approvalStatus;//审核状态
|
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.yythmall.api.invoiceapprovalrecords; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class InvoiceApprovalRecordsDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String orderSid; |
|||
private String approvalOpinions;//审核意见
|
|||
private String operator;//操作人
|
|||
private String operatorSid;//操作人sid
|
|||
private String approvalStatus;//审核状态
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.yythmall.api.invoiceapprovalrecords; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class InvoiceApprovalRecordsQuery implements Query { |
|||
private String shortName; |
|||
private String name; |
|||
private String reviewStatus; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.yxt.yythmall.api.invoiceapprovalrecords; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class InvoiceApprovalRecordsVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String orderSid; |
|||
private String approvalOpinions;//审核意见
|
|||
private String operator;//操作人
|
|||
private String operatorSid;//操作人sid
|
|||
private String approvalStatus;//审核状态
|
|||
private String customerName; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.yythmall.api.invoicetype; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class InvoiceType { |
|||
|
|||
private String id; |
|||
private String sid= UUID.randomUUID().toString(); |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String name; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.yythmall.api.invoicetype; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class InvoiceTypeDto implements Dto { |
|||
private String sid; |
|||
private String id; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String name;//
|
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.yxt.yythmall.api.invoicetype; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class InvoiceTypeQuery implements Query { |
|||
private String shortName; |
|||
private String name; |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.yxt.yythmall.api.invoicetype; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class InvoiceTypeVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String name; |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.yythmall.biz.customerinvoice; |
|||
|
|||
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.customerinvoice.CustomerInvoice; |
|||
import com.yxt.yythmall.api.customerinvoice.CustomerInvoiceVo; |
|||
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 CustomerInvoiceMapper extends BaseMapper<CustomerInvoice> { |
|||
|
|||
IPage<CustomerInvoiceVo> ListPageVo(IPage<CustomerInvoice> page, @Param(Constants.WRAPPER) QueryWrapper<CustomerInvoice> qw); |
|||
@Select("select * from customer_invoice where customerSid=#{customerSid} order by isDefault desc") |
|||
List<CustomerInvoiceVo> listInvoice(@Param("customerSid")String customerSid); |
|||
|
|||
@Select("select * from customer_invoice where sid=#{sid}") |
|||
CustomerInvoiceVo getCustomerInvoiceBySid( @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.yythmall.biz.customerinvoice.CustomerInvoiceMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
|
|||
<select id="ListPageVo" resultType="com.yxt.yythmall.api.customerinvoice.CustomerInvoiceVo"> |
|||
select |
|||
* |
|||
from customer_invoice |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,57 @@ |
|||
package com.yxt.yythmall.biz.customerinvoice; |
|||
|
|||
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.customerinvoice.CustomerInvoiceDto; |
|||
import com.yxt.yythmall.api.customerinvoice.CustomerInvoiceQuery; |
|||
import com.yxt.yythmall.api.customerinvoice.CustomerInvoiceVo; |
|||
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("customerinvoice") |
|||
public class CustomerInvoiceRest { |
|||
|
|||
@Autowired |
|||
CustomerInvoiceService customerInvoiceService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<CustomerInvoiceVo>> ListPageVo(@RequestBody PagerQuery<CustomerInvoiceQuery> pq) { |
|||
return customerInvoiceService.ListPageVo(pq); |
|||
} |
|||
@ApiOperation("根据客户sid查询所有的发票") |
|||
@GetMapping("/listInvoice/{customerSid}") |
|||
public ResultBean listInvoice(@PathVariable("customerSid")String customerSid) { |
|||
return customerInvoiceService.listInvoice(customerSid); |
|||
} |
|||
@ApiOperation("保存或者修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean saveOrUpdate(@RequestBody CustomerInvoiceDto dto) { |
|||
return customerInvoiceService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("根据sid查询") |
|||
@GetMapping("/getCustomerInvoiceBySid/{sid}") |
|||
public ResultBean getCustomerInvoiceBySid(@PathVariable String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
CustomerInvoiceVo CustomerInvoiceVo=customerInvoiceService.getCustomerInvoiceBySid(sid); |
|||
return rb.success().setData(CustomerInvoiceVo); |
|||
} |
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable String sid) { |
|||
return customerInvoiceService.delete(sid); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.yxt.yythmall.biz.customerinvoice; |
|||
|
|||
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.customerinvoice.CustomerInvoice; |
|||
import com.yxt.yythmall.api.customerinvoice.CustomerInvoiceDto; |
|||
import com.yxt.yythmall.api.customerinvoice.CustomerInvoiceQuery; |
|||
import com.yxt.yythmall.api.customerinvoice.CustomerInvoiceVo; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Service |
|||
public class CustomerInvoiceService extends MybatisBaseService<CustomerInvoiceMapper, CustomerInvoice> { |
|||
|
|||
|
|||
public ResultBean<PagerVo<CustomerInvoiceVo>> ListPageVo(PagerQuery<CustomerInvoiceQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
CustomerInvoiceQuery query = pq.getParams(); |
|||
QueryWrapper<CustomerInvoice> qw = new QueryWrapper<>(); |
|||
if (StringUtils.isNotBlank(query.getName())) { |
|||
qw.like("name", query.getName()); |
|||
} |
|||
IPage<CustomerInvoice> page = PagerUtil.queryToPage(pq); |
|||
IPage<CustomerInvoiceVo> pagging = baseMapper.ListPageVo(page, qw); |
|||
PagerVo<CustomerInvoiceVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
public ResultBean listInvoice(String customerSid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<CustomerInvoiceVo> pagging = baseMapper.listInvoice(customerSid); |
|||
return rb.success().setData(pagging); |
|||
} |
|||
|
|||
public ResultBean saveOrUpdate(CustomerInvoiceDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if(StringUtils.isBlank(dto.getCustomerSid())){ |
|||
return rb.setMsg("参数不全"); |
|||
} |
|||
if(dto.getIsDefault().equals("1")){ |
|||
CustomerInvoice customerInvoice = baseMapper.selectOne(new QueryWrapper<CustomerInvoice>().eq("customerSid",dto.getCustomerSid()) |
|||
.eq("isDefault","1")); |
|||
customerInvoice.setIsDefault("0"); |
|||
baseMapper.updateById(customerInvoice); |
|||
} |
|||
if (StringUtils.isNotBlank(dto.getSid())) { |
|||
String dtoSid = dto.getSid(); |
|||
CustomerInvoice entity=fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
return rb.success().setMsg("修改成功").setData(entity.getSid()); |
|||
}else{ |
|||
CustomerInvoice entity=new CustomerInvoice(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg("添加成功").setData(entity.getSid()); |
|||
} |
|||
} |
|||
|
|||
public CustomerInvoiceVo getCustomerInvoiceBySid(String sid){ |
|||
return baseMapper.getCustomerInvoiceBySid(sid); |
|||
} |
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb=new ResultBean(); |
|||
baseMapper.delete(new QueryWrapper<CustomerInvoice>().eq("sid",sid)); |
|||
return rb.success().setMsg("删除成功"); |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.yythmall.biz.invoiceapprovalrecords; |
|||
|
|||
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.invoiceapprovalrecords.InvoiceApprovalRecords; |
|||
import com.yxt.yythmall.api.invoiceapprovalrecords.InvoiceApprovalRecordsVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Mapper |
|||
public interface InvoiceApprovalRecordsMapper extends BaseMapper<InvoiceApprovalRecords> { |
|||
|
|||
IPage<InvoiceApprovalRecordsVo> ListPageVo(IPage<InvoiceApprovalRecords> page, @Param(Constants.WRAPPER) QueryWrapper<InvoiceApprovalRecords> qw); |
|||
|
|||
|
|||
} |
@ -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.yythmall.biz.invoiceapprovalrecords.InvoiceApprovalRecordsMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
|
|||
<select id="ListPageVo" resultType="com.yxt.yythmall.api.invoiceapprovalrecords.InvoiceApprovalRecordsVo"> |
|||
select |
|||
a.* |
|||
from invoice_approval_records a |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,48 @@ |
|||
package com.yxt.yythmall.biz.invoiceapprovalrecords; |
|||
|
|||
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.invoiceapprovalrecords.InvoiceApprovalRecordsDto; |
|||
import com.yxt.yythmall.api.invoiceapprovalrecords.InvoiceApprovalRecordsQuery; |
|||
import com.yxt.yythmall.api.invoiceapprovalrecords.InvoiceApprovalRecordsVo; |
|||
|
|||
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("invoiceapprovalrecords") |
|||
public class InvoiceApprovalRecordsRest { |
|||
|
|||
@Autowired |
|||
InvoiceApprovalRecordsService invoiceApprovalRecordsService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<InvoiceApprovalRecordsVo>> ListPageVo(@RequestBody PagerQuery<InvoiceApprovalRecordsQuery> pq) { |
|||
return invoiceApprovalRecordsService.ListPageVo(pq); |
|||
} |
|||
@ApiOperation("保存") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody InvoiceApprovalRecordsDto dto) { |
|||
return invoiceApprovalRecordsService.save(dto); |
|||
} |
|||
// @ApiOperation("修改")
|
|||
// @PostMapping("/update")
|
|||
// public ResultBean update(@RequestBody InvoiceApprovalRecordsDto dto) {
|
|||
// return InvoiceApprovalRecordsService.update(dto);
|
|||
// }
|
|||
|
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.yxt.yythmall.biz.invoiceapprovalrecords; |
|||
|
|||
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.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.yythmall.api.invoiceapprovalrecords.InvoiceApprovalRecords; |
|||
import com.yxt.yythmall.api.invoiceapprovalrecords.InvoiceApprovalRecordsDto; |
|||
import com.yxt.yythmall.api.invoiceapprovalrecords.InvoiceApprovalRecordsQuery; |
|||
import com.yxt.yythmall.api.invoiceapprovalrecords.InvoiceApprovalRecordsVo; |
|||
import com.yxt.yythmall.biz.invoiceapprovalrecords.InvoiceApprovalRecordsMapper; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Service |
|||
public class InvoiceApprovalRecordsService extends MybatisBaseService<InvoiceApprovalRecordsMapper, InvoiceApprovalRecords> { |
|||
|
|||
|
|||
public ResultBean<PagerVo<InvoiceApprovalRecordsVo>> ListPageVo(PagerQuery<InvoiceApprovalRecordsQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
InvoiceApprovalRecordsQuery query = pq.getParams(); |
|||
QueryWrapper<InvoiceApprovalRecords> qw = new QueryWrapper<>(); |
|||
qw.eq("reviewStatus","0"); |
|||
qw.orderByDesc("createTime"); |
|||
IPage<InvoiceApprovalRecords> page = PagerUtil.queryToPage(pq); |
|||
IPage<InvoiceApprovalRecordsVo> pagging = baseMapper.ListPageVo(page, qw); |
|||
PagerVo<InvoiceApprovalRecordsVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
|
|||
public ResultBean save(InvoiceApprovalRecordsDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
// baseMapper.delete(new QueryWrapper<InvoiceApprovalRecords>().eq("customerSid",dto.getCustomerSid()));
|
|||
InvoiceApprovalRecords entity=new InvoiceApprovalRecords(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg("添加成功"); |
|||
} |
|||
// public ResultBean update(InvoiceApprovalRecordsDto dto) {
|
|||
// ResultBean rb=new ResultBean();
|
|||
// InvoiceApprovalRecords entity=baseMapper.selectOne(new QueryWrapper<InvoiceApprovalRecords>().eq("customerSid",dto.getCustomerSid()));
|
|||
// BeanUtil.copyProperties(dto, entity, "id", "sid");
|
|||
// entity.setReviewStatus("0");
|
|||
// baseMapper.updateById(entity);
|
|||
// return rb.success().setMsg("修改成功");
|
|||
// }
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.yythmall.biz.invoicetype; |
|||
|
|||
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.invoicetype.InvoiceType; |
|||
import com.yxt.yythmall.api.invoicetype.InvoiceTypeVo; |
|||
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 InvoiceTypeMapper extends BaseMapper<InvoiceType> { |
|||
|
|||
IPage<InvoiceTypeVo> ListPageVo(IPage<InvoiceType> page, @Param(Constants.WRAPPER) QueryWrapper<InvoiceType> qw); |
|||
@Select("select * from invoice_type") |
|||
List<InvoiceTypeVo> listAll(); |
|||
|
|||
@Select("select * from invoice_type where sid=#{sid}") |
|||
InvoiceTypeVo getInvoiceTypeBySid( @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.yythmall.biz.invoicetype.InvoiceTypeMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
|
|||
<select id="ListPageVo" resultType="com.yxt.yythmall.api.invoicetype.InvoiceTypeVo"> |
|||
select |
|||
* |
|||
from invoice_type |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,58 @@ |
|||
package com.yxt.yythmall.biz.invoicetype; |
|||
|
|||
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.invoicetype.InvoiceTypeDto; |
|||
import com.yxt.yythmall.api.invoicetype.InvoiceTypeQuery; |
|||
import com.yxt.yythmall.api.invoicetype.InvoiceTypeVo; |
|||
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("invoicetype") |
|||
public class InvoiceTypeRest { |
|||
|
|||
@Autowired |
|||
InvoiceTypeService invoiceTypeService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<InvoiceTypeVo>> ListPageVo(@RequestBody PagerQuery<InvoiceTypeQuery> pq) { |
|||
return invoiceTypeService.ListPageVo(pq); |
|||
} |
|||
@ApiOperation("查询全部") |
|||
@GetMapping("/listAll") |
|||
public ResultBean listAll() { |
|||
return invoiceTypeService.listAll(); |
|||
} |
|||
@ApiOperation("保存或修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean saveOrUpdate(@RequestBody InvoiceTypeDto dto) { |
|||
return invoiceTypeService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
|
|||
@ApiOperation("根据sid查询") |
|||
@GetMapping("/getInvoiceTypeBySid/{sid}") |
|||
public ResultBean getInvoiceTypeBySid(@PathVariable String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
InvoiceTypeVo InvoiceTypeVo=invoiceTypeService.getInvoiceTypeBySid(sid); |
|||
return rb.success().setData(InvoiceTypeVo); |
|||
} |
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable String sid) { |
|||
return invoiceTypeService.delete(sid); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
package com.yxt.yythmall.biz.invoicetype; |
|||
|
|||
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.invoicetype.InvoiceType; |
|||
import com.yxt.yythmall.api.invoicetype.InvoiceTypeDto; |
|||
import com.yxt.yythmall.api.invoicetype.InvoiceTypeQuery; |
|||
import com.yxt.yythmall.api.invoicetype.InvoiceTypeVo; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Service |
|||
public class InvoiceTypeService extends MybatisBaseService<InvoiceTypeMapper, InvoiceType> { |
|||
|
|||
|
|||
public ResultBean<PagerVo<InvoiceTypeVo>> ListPageVo(PagerQuery<InvoiceTypeQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
InvoiceTypeQuery query = pq.getParams(); |
|||
QueryWrapper<InvoiceType> qw = new QueryWrapper<>(); |
|||
if (StringUtils.isNotBlank(query.getName())) { |
|||
qw.like("name", query.getName()); |
|||
} |
|||
IPage<InvoiceType> page = PagerUtil.queryToPage(pq); |
|||
IPage<InvoiceTypeVo> pagging = baseMapper.ListPageVo(page, qw); |
|||
PagerVo<InvoiceTypeVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
public ResultBean listAll() { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<InvoiceTypeVo> pagging = baseMapper.listAll(); |
|||
return rb.success().setData(pagging); |
|||
} |
|||
|
|||
public ResultBean saveOrUpdate(InvoiceTypeDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if(StringUtils.isNotBlank(dto.getSid())){ |
|||
String dtoSid = dto.getSid(); |
|||
InvoiceType entity=fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
return rb.success().setMsg("修改成功"); |
|||
}else{ |
|||
InvoiceType entity=new InvoiceType(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg("添加成功"); |
|||
} |
|||
|
|||
} |
|||
|
|||
public InvoiceTypeVo getInvoiceTypeBySid(String sid){ |
|||
return baseMapper.getInvoiceTypeBySid(sid); |
|||
} |
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb=new ResultBean(); |
|||
baseMapper.delete(new QueryWrapper<InvoiceType>().eq("sid",sid)); |
|||
return rb.success().setMsg("删除成功"); |
|||
} |
|||
|
|||
|
|||
public List<InvoiceType> listAllBank() { |
|||
return baseMapper.selectList(null); |
|||
} |
|||
} |
Loading…
Reference in new issue