main-business/src/main/java/com/ruoyi/business/controller/ReceiptPaymentController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
main-business/src/main/java/com/ruoyi/business/dto/ReceiptPaymentDto.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
main-business/src/main/java/com/ruoyi/business/entity/ReceiptPayment.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
main-business/src/main/java/com/ruoyi/business/mapper/ReceiptPaymentMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
main-business/src/main/java/com/ruoyi/business/other/service/impl/TempFileServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
main-business/src/main/java/com/ruoyi/business/service/ReceiptPaymentService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
main-business/src/main/java/com/ruoyi/business/service/impl/ReceiptPaymentServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
main-business/src/main/resources/mapper/ReceiptPaymentMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
main-business/src/main/java/com/ruoyi/business/controller/ReceiptPaymentController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,83 @@ package com.ruoyi.business.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.business.dto.ReceiptPaymentDto; import com.ruoyi.business.entity.ReceiptPayment; import com.ruoyi.business.service.ReceiptPaymentService; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @RestController @RequestMapping("/receiptPayment") public class ReceiptPaymentController extends BaseController { @Autowired private ReceiptPaymentService receiptPaymentService; /** * åºæ¶å°è´¦æ°å¢ * @param receiptPayment * @return */ @PostMapping("/saveOrUpdate") public AjaxResult receiptPaymentSaveOrUpdate (@RequestBody ReceiptPayment receiptPayment) { receiptPaymentService.receiptPaymentSaveOrUpdate(receiptPayment); return AjaxResult.success(); } /** * åºæ¶å°è´¦ä¿®æ¹ * @param receiptPayment * @return */ @PostMapping("/update") public AjaxResult receiptPaymentUpdate (@RequestBody ReceiptPayment receiptPayment) { return AjaxResult.success(receiptPaymentService.receiptPaymentUpdate(receiptPayment)); } /** * åºæ¶å°è´¦å é¤ * @param ids * @return */ @DeleteMapping("/del") public AjaxResult receiptPaymentDel (@RequestBody List<Integer> ids) { return AjaxResult.success(receiptPaymentService.receiptPaymentDel(ids)); } /** * åºæ¶å°è´¦è¯¦æ * @param id * @return */ @GetMapping("/invoiceInfo") public AjaxResult invoiceInfo (Integer id) { return AjaxResult.success(receiptPaymentService.invoiceInfo(id)); } /** * æ¥è¯¢åºæ¶è®°å½ */ @GetMapping("/receiptPaymentHistoryListPage") public IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto) { return receiptPaymentService.receiptPaymentHistoryListPage(page,receiptPaymentDto); } /** * æ¥è¯¢åºæ¶è®°å½ä¸å页 */ @GetMapping("/receiptPaymentHistoryListNoPage") public List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage(ReceiptPaymentDto receiptPaymentDto) { return receiptPaymentService.receiptPaymentHistoryListNoPage(receiptPaymentDto); } } main-business/src/main/java/com/ruoyi/business/dto/ReceiptPaymentDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ package com.ruoyi.business.dto; import com.baomidou.mybatisplus.annotation.TableField; import com.ruoyi.business.entity.ReceiptPayment; import com.ruoyi.common.annotation.Excel; import lombok.Data; @Data public class ReceiptPaymentDto extends ReceiptPayment { @Excel(name = "客æ·") private String customer; @Excel(name = "ç ¤ç§") private String coal; @TableField(exist = false) @Excel(isExport = false) private String receiptPaymentDateStart; @TableField(exist = false) @Excel(isExport = false) private String receiptPaymentDateEnd; } main-business/src/main/java/com/ruoyi/business/entity/ReceiptPayment.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,64 @@ package com.ruoyi.business.entity; import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; @Data @TableName("receipt_payment") public class ReceiptPayment { /** * åºå· */ @TableId(type = IdType.AUTO) private Integer id; @ApiModelProperty(value = "忬¾å½¢å¼ 0çµæ±1æ¿å ") private String receiptPaymentType; @ApiModelProperty(value = "åºæ¶éé¢") private BigDecimal receiptPaymentAmount; @ApiModelProperty(value = "ç»è®°äºº") private String registrant; @ApiModelProperty(value = "éå®è®°å½è¡¨ä¸»é®ID") private Integer salesRecordId; @ApiModelProperty(value = "æ¥æ¬¾æ¥æ") @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDate receiptPaymentDate; @ApiModelProperty(value = "å建æ¶é´") @TableField(fill = FieldFill.INSERT) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; @ApiModelProperty(value = "åå»ºç¨æ·") @TableField(fill = FieldFill.INSERT) private Integer createUser; @ApiModelProperty(value = "ä¿®æ¹æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateTime; @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") @TableField(fill = FieldFill.INSERT_UPDATE) private Integer updateUser; @ApiModelProperty(value = "ç§æ·ID") @TableField(fill = FieldFill.INSERT) private Long tenantId; } main-business/src/main/java/com/ruoyi/business/mapper/ReceiptPaymentMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,39 @@ package com.ruoyi.business.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.business.dto.ReceiptPaymentDto; import com.ruoyi.business.dto.SalesRecordDto; import com.ruoyi.business.entity.ReceiptPayment; import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.util.List; public interface ReceiptPaymentMapper extends BaseMapper<ReceiptPayment> { /** * æ¥è¯¢å·²ç»ç»å®å票çå¼ç¥¨å°è´¦ * @param page * @param receiptPaymentDto * @return */ IPage<ReceiptPaymentDto> bindInvoiceNoRegPage(Page page, @Param("receiptPaymentDto") ReceiptPaymentDto receiptPaymentDto); /** * å¼ç¥¨å°è´¦è¯¦æ * @param id * @return */ SalesRecordDto invoiceInfo(Integer id); /** * æ¥è¯¢å款记å½ä¸å页 */ List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage( @Param("params") ReceiptPaymentDto receiptPaymentDto); } main-business/src/main/java/com/ruoyi/business/other/service/impl/TempFileServiceImpl.java
@@ -38,10 +38,10 @@ @Autowired private CommonFileMapper commonFileMapper; @Value("${file.upload-dir}") // @Value("${file.upload-dir}") private String uploadDir; @Value("${file.temp-dir}") // @Value("${file.temp-dir}") private String tempDir; // ä¸ä¼ å°ä¸´æ¶ç®å½ main-business/src/main/java/com/ruoyi/business/service/ReceiptPaymentService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,54 @@ package com.ruoyi.business.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.business.dto.ReceiptPaymentDto; import com.ruoyi.business.dto.SalesRecordDto; import com.ruoyi.business.entity.ReceiptPayment; import jakarta.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.util.List; import java.util.Map; public interface ReceiptPaymentService { /** * 忬¾ç»è®°æ°å¢ * @param receiptPayment * @return */ int receiptPaymentSaveOrUpdate(ReceiptPayment receiptPayment); /** * 忬¾ç»è®°ä¿®æ¹ * @param receiptPayment * @return */ int receiptPaymentUpdate(ReceiptPayment receiptPayment); /** * 忬¾ç»è®°å é¤ * @param ids * @return */ int receiptPaymentDel(List<Integer> ids); /** * å¼ç¥¨å°è´¦è¯¦æ * @param id * @return */ SalesRecordDto invoiceInfo(Integer id); /** * æ¥è¯¢å款记å½å页 */ IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto); /** * æ¥è¯¢å款记å½ä¸å页 */ List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage(ReceiptPaymentDto receiptPaymentDto); } main-business/src/main/java/com/ruoyi/business/service/impl/ReceiptPaymentServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,87 @@ package com.ruoyi.business.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.business.dto.ReceiptPaymentDto; import com.ruoyi.business.dto.SalesRecordDto; import com.ruoyi.business.entity.ReceiptPayment; import com.ruoyi.business.entity.SalesRecord; import com.ruoyi.business.mapper.ReceiptPaymentMapper; import com.ruoyi.business.mapper.SalesRecordMapper; import com.ruoyi.business.service.ReceiptPaymentService; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import java.math.BigDecimal; import java.time.LocalDate; import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; @Service public class ReceiptPaymentServiceImpl extends ServiceImpl<ReceiptPaymentMapper, ReceiptPayment> implements ReceiptPaymentService { @Autowired private ReceiptPaymentMapper receiptPaymentMapper; @Autowired private SalesRecordMapper salesRecordMapper; /** * 忬¾ç»è®°æ°å¢ * @param receiptPayment * @return */ @Override public int receiptPaymentSaveOrUpdate(ReceiptPayment receiptPayment) { SalesRecord salesRecord = salesRecordMapper.selectById(receiptPayment.getSalesRecordId()); if (ObjectUtils.isEmpty(salesRecord)){ throw new RuntimeException("éå®è®°å½ä¸åå¨"); } return receiptPaymentMapper.insert(receiptPayment); } /** * 忬¾ç»è®°ä¿®æ¹ * @param receiptPayment * @return */ @Override public int receiptPaymentUpdate(ReceiptPayment receiptPayment) { return receiptPaymentMapper.updateById(receiptPayment); } /** * 忬¾ç»è®°å é¤ * @param ids * @return */ @Override public int receiptPaymentDel(List<Integer> ids) { LambdaQueryWrapper<ReceiptPayment> delQuery = new LambdaQueryWrapper<>(); delQuery.in(ReceiptPayment::getId, ids); return receiptPaymentMapper.delete(delQuery); } @Override public SalesRecordDto invoiceInfo(Integer id) { return receiptPaymentMapper.invoiceInfo(id); } @Override public IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto) { return receiptPaymentMapper.bindInvoiceNoRegPage(page, receiptPaymentDto); } @Override public List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage(ReceiptPaymentDto receiptPaymentDto) { return receiptPaymentMapper.receiptPaymentHistoryListNoPage(receiptPaymentDto); } } main-business/src/main/resources/mapper/ReceiptPaymentMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,61 @@ <?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.ruoyi.business.mapper.ReceiptPaymentMapper"> <select id="invoiceInfo" resultType="com.ruoyi.business.dto.SalesRecordDto"> SELECT T1.*, T3.coal FROM sales_record T1 LEFT JOIN customer T2 ON T1.customer_id = T2.id LEFT JOIN coal_info T3 ON T1.coal_id = T3.id WHERE T1.id = #{id} </select> <select id="bindInvoiceNoRegPage" resultType="com.ruoyi.business.dto.ReceiptPaymentDto"> SELECT T1.*, T2.customer, T3.coal FROM receipt_payment T1 LEFT JOIN sales_record T2 ON T1.sales_record_id = T2.id LEFT JOIN coal_info T3 ON T2.coal_id = T3.id where 1=1 <if test="receiptPaymentDto.customer != null and receiptPaymentDto.customer != ''"> and T2.customer like concat('%',#{receiptPaymentDto.customer},'%') </if> <if test="receiptPaymentDto.coal != null and receiptPaymentDto.coal != ''"> and T3.coal like concat('%',#{receiptPaymentDto.coal},'%') </if> <if test="receiptPaymentDto.receiptPaymentDateStart != null and receiptPaymentDto.receiptPaymentDateEnd != ''"> and T1.receipt_payment_date between to_timestamp(#{receiptPaymentDto.receiptPaymentDateStart}, 'yyyy-MM-dd HH24:mi:ss') AND to_timestamp(#{receiptPaymentDto.receiptPaymentDateEnd}, 'yyyy-MM-dd HH24:mi:ss') </if> </select> <select id="receiptPaymentHistoryListNoPage" resultType="com.ruoyi.business.dto.ReceiptPaymentDto"> SELECT T1.*, T2.customer, T3.coal FROM receipt_payment T1 LEFT JOIN sales_record T2 ON T1.sales_record_id = T2.id LEFT JOIN coal_info T3 ON T2.coal_id = T3.id where 1=1 <if test="receiptPaymentDto.customer != null and receiptPaymentDto.customer != ''"> and T2.customer like concat('%',#{receiptPaymentDto.customer},'%') </if> <if test="receiptPaymentDto.coal != null and receiptPaymentDto.coal != ''"> and T3.coal like concat('%',#{receiptPaymentDto.coal},'%') </if> <if test="receiptPaymentDto.receiptPaymentDateStart != null and receiptPaymentDto.receiptPaymentDateEnd != ''"> and T1.receipt_payment_date between to_timestamp(#{receiptPaymentDto.receiptPaymentDateStart}, 'yyyy-MM-dd HH24:mi:ss') AND to_timestamp(#{receiptPaymentDto.receiptPaymentDateEnd}, 'yyyy-MM-dd HH24:mi:ss') </if> </select> </mapper>