三七 2 недель назад
Родитель
Сommit
4bc023dcc6

+ 1 - 1
fs-admin/src/main/java/com/fs/his/task/userIntegralTask.java

@@ -22,7 +22,7 @@ public class userIntegralTask {
     @Autowired
     private IFsIntegralCountService integralCountService;
 
-    public void UserIntegralCount(){
+    public void userIntegralCount(){
         log.info("=====用户积分每日消耗统计开始=====");
         try {
             List<FsIntegralCount> list = integralLogsService.selectYesterdayIntegralGroupByLogType();

+ 17 - 7
fs-service/src/main/java/com/fs/his/domain/FsIntegralCount.java

@@ -1,12 +1,13 @@
 package com.fs.his.domain;
 
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.baomidou.mybatisplus.annotation.TableId;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fs.common.annotation.Excel;
 import lombok.Data;
-import com.fs.common.core.domain.BaseEntity;
-import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+import java.util.Date;
 
 /**
  * 通用积分消耗退还统计(不含看课领的积分)对象 fs_integral_count
@@ -21,9 +22,17 @@ public class FsIntegralCount{
     private Long id;
 
     /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @Excel(name = "时间",dateFormat = "yyyy-MM-dd")
     private Date consumptionDate;
 
+    @TableField(exist = false)
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private String beginDate;
+
+    @TableField(exist = false)
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private String endDate;
+
     /** 通用的积分消耗 */
     @Excel(name = "通用的积分消耗")
     private String integralConsume;
@@ -35,5 +44,6 @@ public class FsIntegralCount{
     @Excel(name = "积分类型",dictType="sys_integral_log_type")
     private Integer logType;
 
-
+    @Excel(name = "时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
 }

+ 1 - 2
fs-service/src/main/java/com/fs/his/mapper/FsUserIntegralLogsMapper.java

@@ -169,8 +169,7 @@ public interface FsUserIntegralLogsMapper
             "SUM(CASE WHEN integral < 0 THEN ABS(integral) ELSE 0 END) AS integral_refund, " +
             "DATE(create_time) AS consumption_date " +
             "FROM fs_user_integral_logs " +
-            "WHERE log_type != 17 " +
-            "AND create_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)\n" +
+            "WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)\n" +
             "  AND create_time < CURDATE() " +
             "GROUP BY log_type, DATE(create_time)")
     List<FsIntegralCount> selectYesterdayIntegralGroupByLogType();

+ 2 - 0
fs-service/src/main/resources/mapper/his/FsIntegralCountMapper.xml

@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="integralConsume != null  and integralConsume != ''"> and integral_consume = #{integralConsume}</if>
             <if test="integralRefund != null  and integralRefund != ''"> and integral_refund = #{integralRefund}</if>
             <if test="logType != null  and logType != ''"> and log_type = #{logType}</if>
+            <if test="beginDate != null  and beginDate != ''"> and consumption_date >= #{beginDate}</if>
+            <if test="endDate != null  and endDate != ''"> and consumption_date &lt;= #{endDate}</if>
         </where>
     </select>