wangzaijun 7 meses atrás
pai
commit
b83a0eca78
28 arquivos alterados com 367 adições e 47 exclusões
  1. 1 1
      service-base/src/main/java/com/simuwang/base/common/util/ExcelUtil.java
  2. 12 4
      service-base/src/main/java/com/simuwang/base/common/util/NavDataUtil.java
  3. 1 1
      service-base/src/main/java/com/simuwang/base/mapper/ValuationTableMapper.java
  4. 12 0
      service-base/src/main/java/com/simuwang/base/mapper/system/SysLogMapper.java
  5. 48 0
      service-base/src/main/java/com/simuwang/base/pojo/dos/LoggingDO.java
  6. 37 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/query/LogPageQuery.java
  7. 1 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/report/ReportParserParams.java
  8. 49 0
      service-base/src/main/java/com/simuwang/base/pojo/vo/LoggingVO.java
  9. 9 0
      service-base/src/main/java/com/simuwang/logging/LoggingService.java
  10. 2 2
      service-base/src/main/resources/mapper/AssetMapper.xml
  11. 1 1
      service-base/src/main/resources/mapper/EmailTemplateMappingMapper.xml
  12. 4 4
      service-base/src/main/resources/mapper/FundPositionDetailMapper.xml
  13. 2 2
      service-base/src/main/resources/mapper/NavMapper.xml
  14. 1 2
      service-base/src/main/resources/mapper/ValuationTableMapper.xml
  15. 54 0
      service-base/src/main/resources/mapper/system/SysLogMapper.xml
  16. 20 8
      service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java
  17. 17 9
      service-daq/src/main/java/com/simuwang/daq/service/EmailTemplateService.java
  18. 11 1
      service-deploy/src/main/java/com/simuwang/deploy/components/LoggingAspect.java
  19. 1 1
      service-deploy/src/main/resources/application.yml
  20. 2 2
      service-manage/src/main/java/com/simuwang/manage/api/deletion/DeletionController.java
  21. 1 1
      service-manage/src/main/java/com/simuwang/manage/api/distribution/DistributionController.java
  22. 1 1
      service-manage/src/main/java/com/simuwang/manage/api/email/EmailAssetDetailController.java
  23. 2 2
      service-manage/src/main/java/com/simuwang/manage/api/email/EmailConfigController.java
  24. 1 0
      service-manage/src/main/java/com/simuwang/manage/api/email/ParseEmailController.java
  25. 50 0
      service-manage/src/main/java/com/simuwang/manage/api/log/LogController.java
  26. 3 3
      service-manage/src/main/java/com/simuwang/manage/api/template/TemplateController.java
  27. 2 2
      service-manage/src/main/java/com/simuwang/manage/api/template/TemplateSettingController.java
  28. 22 0
      service-manage/src/main/java/com/simuwang/manage/service/impl/system/SysLogServiceImpl.java

+ 1 - 1
service-base/src/main/java/com/simuwang/base/common/util/ExcelUtil.java

@@ -210,7 +210,7 @@ public class ExcelUtil {
                 break;
         }
         // 去掉换行符号
-        cellValue = StrUtil.isNotBlank(cellValue) ? cellValue.replaceAll("[\\r\\n]+", "").trim() : "";
+        cellValue = StrUtil.isNotBlank(cellValue) ? cellValue.replaceAll("[\\r\\n]+", "").replaceAll(",","").trim() : "";
         return cellValue;
     }
 

+ 12 - 4
service-base/src/main/java/com/simuwang/base/common/util/NavDataUtil.java

@@ -12,11 +12,19 @@ public class NavDataUtil {
     public static boolean navDataFormatCheck(EmailFundNavDTO fundNavDTO) {
         // 净值日期格式校验
         if (StrUtil.isBlank(fundNavDTO.getPriceDate())) {
-            log.warn("净值日期为空 -> 解析到的数据:{}", fundNavDTO);
+            log.warn("净值日期为空 -> 数据:{}", fundNavDTO);
             return false;
         }
-        if(StrUtil.isBlank(fundNavDTO.getFundName()) && StrUtil.isBlank(fundNavDTO.getRegisterNumber())){
-            log.warn("备案编码和基金名称都为空-> 解析到的数据:{}", fundNavDTO);
+        if (StrUtil.isBlank(fundNavDTO.getFundName()) && StrUtil.isBlank(fundNavDTO.getRegisterNumber())) {
+            log.warn("备案编码和基金名称都为空-> 数据:{}", fundNavDTO);
+            return false;
+        }
+        if (StrUtil.isNotBlank(fundNavDTO.getFundName()) && fundNavDTO.getFundName().length() > 110) {
+            log.warn("基金名称长度超出限制(110个字符)-> 数据:{}", fundNavDTO);
+            return false;
+        }
+        if (StrUtil.isNotBlank(fundNavDTO.getRegisterNumber()) && fundNavDTO.getRegisterNumber().length() > 12) {
+            log.warn("备案编码长度超出限制(12个字符)-> 数据:{}", fundNavDTO);
             return false;
         }
         // 单位净值,累计单位净值,资产净值,资产份额数字格式校验
@@ -25,7 +33,7 @@ public class NavDataUtil {
                 && (StrUtil.isBlank(fundNavDTO.getAssetNet()) || StringUtil.isNumeric(fundNavDTO.getAssetNet()))
                 && (StrUtil.isBlank(fundNavDTO.getAssetShare()) || StringUtil.isNumeric(fundNavDTO.getAssetShare()));
         if (!isvalidNumericFormat) {
-            log.warn("单位净值或累计净值或资产净值或资产份额格式不正确 -> 解析到的数据:{}", fundNavDTO);
+            log.warn("单位净值或累计净值或资产净值或资产份额格式不正确 -> 数据:{}", fundNavDTO);
             return false;
         }
         log.info("数据格式验证通过 -> {}", fundNavDTO);

+ 1 - 1
service-base/src/main/java/com/simuwang/base/mapper/ValuationTableMapper.java

@@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Param;
 @Mapper
 public interface ValuationTableMapper {
 
-    void unValid(@Param("fundId") String fundId, @Param("valuationDate") String date);
+    void unValid(@Param("fileId") Integer fileId);
 
     int insert(ValuationTableDO record);
 

+ 12 - 0
service-base/src/main/java/com/simuwang/base/mapper/system/SysLogMapper.java

@@ -1,10 +1,16 @@
 package com.simuwang.base.mapper.system;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.simuwang.base.pojo.dos.LoggingDO;
 import com.simuwang.base.pojo.dos.sys.SysLogDO;
+import com.simuwang.base.pojo.dto.query.LogPageQuery;
+import com.simuwang.base.pojo.vo.IdListVO;
 import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 @Repository
 public interface SysLogMapper extends BaseMapper<SysLogDO> {
     /**
@@ -12,4 +18,10 @@ public interface SysLogMapper extends BaseMapper<SysLogDO> {
      */
     @Delete("truncate table sys_log")
     void truncateAll();
+
+    List<LoggingDO> searchLogList(LogPageQuery logPageQuery);
+
+    long countLogList(LogPageQuery logPageQuery);
+
+    void deleteLog(@Param("idList") List<Integer> idList);
 }

+ 48 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/LoggingDO.java

@@ -0,0 +1,48 @@
+package com.simuwang.base.pojo.dos;
+
+import com.simuwang.base.common.conts.Constants;
+import com.simuwang.base.common.util.DateUtils;
+import com.simuwang.base.pojo.vo.LoggingVO;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author wangzaijun
+ * @date 2024/9/14 14:04
+ * @description 系统操作日志记录
+ */
+@Data
+public class LoggingDO{
+
+    private Integer id;
+    private String title;
+    private Integer type;
+    private String requestUri;
+    private String method;
+    private String remoteAddr;
+    private Long executeTime;
+    private String params;
+    private String result;
+    private Boolean hasException;
+    private String exception;
+    private String userName;
+    private Date createTime;
+
+
+    public LoggingVO toVO() {
+        LoggingVO vo = new LoggingVO();
+        vo.setId(this.id);
+        vo.setTitle(this.title);
+        vo.setRequestUri(this.requestUri);
+        vo.setMethod(this.method);
+        vo.setParams(this.params);
+        vo.setRemoteAddr(this.remoteAddr);
+        vo.setUserName(this.userName);
+        vo.setExecuteTime(this.executeTime);
+        vo.setCreateTime(DateUtils.format(this.createTime,DateUtils.YYYY_MM_DD_HH_MM_SS));
+        return vo;
+    }
+}

+ 37 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/query/LogPageQuery.java

@@ -0,0 +1,37 @@
+package com.simuwang.base.pojo.dto.query;
+
+import com.simuwang.base.common.support.query.PageQuery;
+
+/**
+ * FileName: LogPageQuery
+ * Author:   chenjianhua
+ * Date:     2024/9/28 21:03
+ * Description: ${DESCRIPTION}
+ */
+public class LogPageQuery extends PageQuery {
+
+    /**
+     * 模块名称
+     */
+    private String title;
+    /**
+     * 操作人
+     */
+    private String userName;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+}

+ 1 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/report/ReportParserParams.java

@@ -6,6 +6,7 @@ import lombok.*;
 @Builder
 @NoArgsConstructor
 @AllArgsConstructor
+@ToString
 public class ReportParserParams {
     /**
      * 文件id

+ 49 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/LoggingVO.java

@@ -0,0 +1,49 @@
+package com.simuwang.base.pojo.vo;
+
+import lombok.Data;
+
+/**
+ * @author wangzaijun
+ * @date 2024/9/14 14:04
+ * @description 系统操作日志记录
+ */
+@Data
+public class LoggingVO {
+    /**
+     * 主键ID
+     */
+    private Integer id;
+    /**
+     * 模块名称
+     */
+    private String title;
+    /**
+     * 请求路径
+     */
+    private String requestUri;
+    /**
+     * 请求方法
+     */
+    private String method;
+    /**
+     * 调用IP
+     */
+    private String remoteAddr;
+    /**
+     * 执行时间
+     */
+    private Long executeTime;
+    /**
+     * 请求参数
+     */
+    private String params;
+    /**
+     * 用户名称
+     */
+    private String userName;
+
+    /**
+     * 创建时间
+     */
+    private String createTime;
+}

+ 9 - 0
service-base/src/main/java/com/simuwang/logging/LoggingService.java

@@ -1,5 +1,10 @@
 package com.simuwang.logging;
 
+import com.simuwang.base.common.support.MybatisPage;
+import com.simuwang.base.pojo.dto.query.LogPageQuery;
+import com.simuwang.base.pojo.vo.IdListVO;
+import com.simuwang.base.pojo.vo.LoggingVO;
+
 /**
  * @author wangzaijun
  * @date 2024/9/14 14:05
@@ -7,4 +12,8 @@ package com.simuwang.logging;
  */
 public interface LoggingService {
     void asyncSave(Logging logging);
+
+    MybatisPage<LoggingVO> searchLogList(LogPageQuery logPageQuery);
+
+    void deleteLog(IdListVO idListVO);
 }

+ 2 - 2
service-base/src/main/resources/mapper/AssetMapper.xml

@@ -38,10 +38,10 @@
         </foreach>
     </insert>
     <delete id="deleteAsset">
-        delete from PPW_EMAIL.asset where fund_id=#{fundId} and price_date=#{priceDate}
+        update PPW_EMAIL.asset set isvalid=0,updatetime=sysdate(),updaterid=#{updaterId}  where fund_id=#{fundId} and price_date=#{priceDate}
     </delete>
     <delete id="batchDeleteAsset">
-        delete from  PPW_EMAIL.asset where fund_id=#{FundId}
+        update PPW_EMAIL.asset set isvalid=0,updatetime=sysdate() where fund_id=#{FundId}
         and price_date in
         <foreach collection="priceDateList" index="index" item="priceDate" separator="," open="(" close=")">
             #{priceDate}

+ 1 - 1
service-base/src/main/resources/mapper/EmailTemplateMappingMapper.xml

@@ -45,7 +45,7 @@
         where t1.email = #{email}
           and t2.type = #{type}
           and t1.isvalid = 1
-          and t2.status = 1
+          and t1.status = 1
     </select>
     <select id="searchTemplateSettingList" resultMap="BaseResultMap">
         select mapping.id,mapping.template_id,mapping.title,mapping.email,mapping.company_name,mapping.company_id,mapping.status,

+ 4 - 4
service-base/src/main/resources/mapper/FundPositionDetailMapper.xml

@@ -30,21 +30,21 @@
     </resultMap>
 
     <delete id="deleteUnUsed">
-        delete
-        from PPW_EMAIL.fund_position_detail
+        update PPW_EMAIL.fund_position_detail
+        set isvalid    = 0
         where fund_id = #{fundId}
           and valuation_date = #{valuationDate}
     </delete>
 
     <insert id="insertMulti" parameterType="com.simuwang.base.pojo.dos.FundPositionDetailDO">
         INSERT INTO PPW_EMAIL.fund_position_detail (
-        fund_id,valuation_date,LEVEL,currency,exchange_rate,subject_code,
+        fund_id,valuation_id,valuation_date,LEVEL,currency,exchange_rate,subject_code,
         securities_amount, securities_code,securities_name, sec_type,market_value,
         market_value_ratio,nature,subject_type,increment,halt_info,net_cost,net_cost_ratio,market_price,
         unit_cost,isvalid,creatorid,createtime
         ) VALUES
         <foreach collection="details" index="index" item="detail" separator=",">
-            (#{detail.fundId},#{detail.valuationDate},#{detail.level}, #{detail.currency}, #{detail.exchangeRate}, #{detail.subjectCode},
+            (#{detail.fundId},#{detail.valuationId},#{detail.valuationDate},#{detail.level}, #{detail.currency}, #{detail.exchangeRate}, #{detail.subjectCode},
              #{detail.securitiesAmount},#{detail.securitiesCode}, #{detail.securitiesName}, #{detail.secType},#{detail.marketValue},
              #{detail.marketValueRatio}, #{detail.nature},
              #{detail.subjectType},#{detail.increment},#{detail.haltInfo},#{detail.netCost},#{detail.netCostRatio},#{detail.marketPrice},

+ 2 - 2
service-base/src/main/resources/mapper/NavMapper.xml

@@ -57,14 +57,14 @@
         and id=#{id}
     </update>
     <update id="batchDeleteNav">
-        delete from PPW_EMAIL.nav where fund_id=#{fundId}
+        update PPW_EMAIL.nav set isvalid=0,updatetime=sysdate() where fund_id=#{fundId}
         and price_date in
         <foreach collection="priceDateList" index="index" item="priceDate" separator="," open="(" close=")">
             #{priceDate}
         </foreach>
     </update>
     <delete id="deleteNav">
-        delete from  PPW_EMAIL.nav where fund_id=#{fundId} and price_date=#{priceDate}
+        update PPW_EMAIL.nav set isvalid=0,updatetime=sysdate(),updaterid=#{updaterId} where fund_id=#{fundId} and price_date=#{priceDate}
     </delete>
 
     <select id="queryFundNavByDate" resultType="java.lang.String">

+ 1 - 2
service-base/src/main/resources/mapper/ValuationTableMapper.xml

@@ -32,8 +32,7 @@
     <update id="unValid">
         update  PPW_EMAIL.valuation_table
         set isvalid = 0
-        where fund_id = #{fundId}
-          and valuation_date = #{valuationDate}
+        where file_id = #{fileId}
     </update>
 
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.simuwang.base.pojo.dos.ValuationTableDO" useGeneratedKeys="true">

+ 54 - 0
service-base/src/main/resources/mapper/system/SysLogMapper.xml

@@ -0,0 +1,54 @@
+<?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.simuwang.base.mapper.system.SysLogMapper">
+    <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.LoggingDO">
+        <id column="id" property="id"/>
+        <result column="title" property="title"/>
+        <result column="type" property="type"/>
+        <result column="request_uri" property="requestUri"/>
+        <result column="method" property="method"/>
+        <result column="remote_addr" property="remoteAddr"/>
+        <result column="execute_time" property="executeTime"/>
+        <result column="params" property="params"/>
+        <result column="user_name" property="userName"/>
+        <result column="createtime" property="createTime"/>
+    </resultMap>
+    <update id="deleteLog">
+        delete from  PPW_EMAIL.sys_log where id in
+        <foreach item="id" collection="idList" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+    <select id="searchLogList" resultMap="BaseResultMap">
+          select distinct log.id,log.title,log.type,log.request_uri,log.method,log.remote_addr,log.execute_time,log.params,log.params,log.createtime,u.user_name
+          from PPW_EMAIL.sys_log log
+          left join PPW_EMAIL.sys_user u
+          on log.creatorid=u.user_id and u.isvalid=1
+        <where>
+            <if test="title != null and title !=''">
+                and log.title like concat ('%',#{title},'%')
+            </if>
+            <if test="userName != null and userName !=''">
+                and u.user_name like concat ('%',#{userName},'%')
+            </if>
+        </where>
+        order by log.createtime desc
+        limit #{offset},#{pageSize}
+    </select>
+    <select id="countLogList" resultType="java.lang.Long">
+        select count(distinct log.id)
+        from PPW_EMAIL.sys_log log
+        left join PPW_EMAIL.sys_user u
+        on log.creatorid=u.user_id and u.isvalid=1
+        <where>
+            <if test="title != null and title !=''">
+                and log.title like concat ('%',#{title},'%')
+            </if>
+            <if test="userName != null and userName !=''">
+                and u.user_name like concat ('%',#{userName},'%')
+            </if>
+        </where>
+    </select>
+
+
+</mapper>

+ 20 - 8
service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java

@@ -12,6 +12,7 @@ import com.simuwang.base.common.conts.*;
 import com.simuwang.base.common.enums.ReportParserFileType;
 import com.simuwang.base.common.enums.ReportType;
 import com.simuwang.base.common.util.EmailUtil;
+import com.simuwang.base.common.util.ExcelUtil;
 import com.simuwang.base.common.util.FileUtil;
 import com.simuwang.base.config.DaqProperties;
 import com.simuwang.base.config.EmailRuleConfig;
@@ -28,6 +29,7 @@ import com.simuwang.daq.components.report.parser.ReportParserFactory;
 import com.simuwang.daq.components.report.writer.ReportWriter;
 import com.simuwang.daq.components.report.writer.ReportWriterFactory;
 import jakarta.mail.*;
+import jakarta.mail.internet.MimeMessage;
 import jakarta.mail.internet.MimeMultipart;
 import jakarta.mail.search.ComparisonTerm;
 import jakarta.mail.search.ReceivedDateTerm;
@@ -130,6 +132,10 @@ public class EmailParseService {
             log.info("采集邮件失败 -> 邮箱配置信息:{},堆栈信息:{}", mailboxInfoDTO, ExceptionUtil.stacktraceToString(e));
             return;
         }
+        if (MapUtil.isEmpty(emailContentMap)) {
+            log.info("未采集到邮件 -> 邮箱配置信息:{},开始时间:{},结束时间:{}", mailboxInfoDTO, DateUtil.format(startDate, DateConst.YYYY_MM_DD_HH_MM_SS), DateUtil.format(endDate, DateConst.YYYY_MM_DD_HH_MM_SS));
+            return;
+        }
         for (Map.Entry<String, List<EmailContentInfoDTO>> emailEntry : emailContentMap.entrySet()) {
             List<EmailContentInfoDTO> emailContentInfoDTOList = emailEntry.getValue();
             if (CollUtil.isEmpty(emailContentInfoDTOList)) {
@@ -217,6 +223,7 @@ public class EmailParseService {
         if (CollUtil.isEmpty(fundNavDTOList)) {
             return;
         }
+        valuationTableMapper.unValid(fileId);
         for (EmailFundNavDTO fundNavDTO : fundNavDTOList) {
             ValuationTableDO valuationTableDO = fundNavDTO.getValuationTableDO();
             if (valuationTableDO == null) {
@@ -228,21 +235,24 @@ public class EmailParseService {
             List<FundPositionDetailDO> fundPositionDetailDOList = fundNavDTO.getFundPositionDetailDOList();
             List<CmValuationTableAttribute> valuationTableAttributeList = fundNavDTO.getValuationTableAttributeList();
             if (CollUtil.isEmpty(fundIdList)) {
-                int valuationId = valuationTableMapper.insert(valuationTableDO);
+                valuationTableMapper.insert(valuationTableDO);
+                int valuationId = valuationTableDO.getId();
                 saveValuationTableAttribute(valuationId, valuationTableAttributeList);
                 fundPositionDetailDOList.forEach(e -> e.setValuationId(valuationId));
-                saveFundPositionDetail(fundPositionDetailDOList, null, fundNavDTO.getPriceDate());
+                // 不匹配基金的情况下 -> 不写fund_position_detail
+                // saveFundPositionDetail(fundPositionDetailDOList, null, fundNavDTO.getPriceDate());
                 continue;
             }
             for (String fundId : fundIdList) {
                 valuationTableDO.setFundId(fundId);
-                int valuationId = valuationTableMapper.insert(valuationTableDO);
+                valuationTableMapper.insert(valuationTableDO);
+                int valuationId = valuationTableDO.getId();
                 fundPositionDetailDOList.forEach(e -> {
                     e.setFundId(fundId);
                     e.setValuationId(valuationId);
                 });
                 saveValuationTableAttribute(valuationId, valuationTableAttributeList);
-                saveFundPositionDetail(fundPositionDetailDOList, null, fundNavDTO.getPriceDate());
+                saveFundPositionDetail(fundPositionDetailDOList, fundId, fundNavDTO.getPriceDate());
             }
         }
     }
@@ -545,9 +555,6 @@ public class EmailParseService {
         Date priceDate = DateUtil.parse(fundNavDTO.getPriceDate(), DateConst.YYYY_MM_DD);
         BigDecimal nav = StrUtil.isNotBlank(fundNavDTO.getNav()) ? new BigDecimal(fundNavDTO.getNav()) : null;
         BigDecimal cumulativeNavWithdrawal = StrUtil.isNotBlank(fundNavDTO.getCumulativeNavWithdrawal()) ? new BigDecimal(fundNavDTO.getCumulativeNavWithdrawal()) : null;
-        if (nav == null && cumulativeNavWithdrawal == null) {
-            return CollUtil.newArrayList();
-        }
         Integer isStored = fundNavDTO.getParseStatus() != null && !fundNavDTO.getParseStatus().equals(NavParseStatusConst.NAV_DEFICIENCY)
                 && !fundNavDTO.getParseStatus().equals(NavParseStatusConst.NOT_MATCH) ? 1 : 0;
         if (CollUtil.isNotEmpty(fundNavDTO.getFundIdList())) {
@@ -778,7 +785,8 @@ public class EmailParseService {
             return MapUtil.newHashMap();
         }
         Map<String, List<EmailContentInfoDTO>> emailMessageMap = MapUtil.newHashMap();
-        for (Message message : messages) {
+        for (Message message1 : messages) {
+            MimeMessage message = (MimeMessage) message1;
             List<EmailContentInfoDTO> emailContentInfoDTOList = CollUtil.newArrayList();
             String uuidKey = UUID.randomUUID().toString().replaceAll("-", "");
             Integer emailType;
@@ -824,6 +832,10 @@ public class EmailParseService {
                     emailContentInfoDTOList.add(emailContentInfoDTO);
                 }
                 if (CollUtil.isNotEmpty(emailContentInfoDTOList)) {
+                    // 估值表邮件不展示正文html文件
+                    if (emailType.equals(EmailTypeConst.VALUATION_EMAIL_TYPE)) {
+                        emailContentInfoDTOList = emailContentInfoDTOList.stream().filter(e -> !ExcelUtil.isHTML(e.getFilePath())).toList();
+                    }
                     emailContentInfoDTOList.forEach(e -> {
                         e.setEmailType(emailType);
                         e.setSenderEmail(senderEmail);

+ 17 - 9
service-daq/src/main/java/com/simuwang/daq/service/EmailTemplateService.java

@@ -95,11 +95,13 @@ public class EmailTemplateService {
                 try {
                     List<EmailFundNavDTO> fundNavDTOList = extraFundNav(filePath, textContent, templateDetailDTO);
                     fundNavDTOList = fundNavDTOList.stream().filter(NavDataUtil::navDataFormatCheck).toList();
-                    if (CollUtil.isNotEmpty(fundNavDTOList)) {
-                        fundNavDTOList.forEach(e -> e.setTemplateId(templateDetailDTO.getTemplateId()));
-                        emailFundNavDTOList.addAll(fundNavDTOList);
+                    if (CollUtil.isEmpty(fundNavDTOList)) {
+                        log.info("模板配置解析不到数据 -> 模板id:{}", templateDetailDTO.getTemplateId());
+                        continue;
                     }
-                    log.info("模板配置规则解析不到数据 -> 模板id:{}", templateDetailDTO.getTemplateId());
+                    fundNavDTOList.forEach(e -> e.setTemplateId(templateDetailDTO.getTemplateId()));
+                    emailFundNavDTOList.addAll(fundNavDTOList);
+                    log.info("模板配置解析成功 -> 模板id:{},数据:{}", templateDetailDTO.getTemplateId(), fundNavDTOList);
                 } catch (Exception e) {
                     log.error("净值模板解析报错 -> 模板id:{},文件:{},堆栈信息:{}", templateDetailDTO.getTemplateId(), filePath, ExceptionUtil.stacktraceToString(e));
                 }
@@ -213,7 +215,7 @@ public class EmailTemplateService {
                         continue;
                     }
                     Integer columnIndex = fieldEntry.getValue().getValue();
-                    Cell cell = row.getCell(columnIndex);
+                    Cell cell = row.getCell(columnIndex + 1);
                     String fieldRule = fieldPatternMap.get(fieldName);
                     String cellValue = getValueByPattern(ExcelUtil.getCellValue(cell), fieldRule);
 
@@ -377,14 +379,16 @@ public class EmailTemplateService {
             isMatch = iskeywordMatch(fileName, containKeyword, notContainKeyword);
         } else if (ApplicationRuleFileConst.EMAIL_EXCEL_CONTENT_FILE.equals(type)) {
             if (StrUtil.isNotBlank(fileName) && ExcelUtil.isExcel(fileName)) {
-                if (applicationRuleDO.getRow() == null || StrUtil.isBlank(applicationRuleDO.getColumn())) {
+                Integer rowIndex = applicationRuleDO.getRow();
+                if (rowIndex == null || StrUtil.isBlank(applicationRuleDO.getColumn())) {
                     return false;
                 }
                 Sheet sheet = ExcelUtil.getFirstSheet(filePath);
                 if (sheet == null) {
                     return false;
                 }
-                Row row = sheet.getRow(applicationRuleDO.getRow());
+                rowIndex = rowIndex - 1;
+                Row row = sheet.getRow(rowIndex);
                 if (row == null) {
                     return false;
                 }
@@ -456,8 +460,12 @@ public class EmailTemplateService {
         }
         Pattern pattern = Pattern.compile(fieldRule);
         Matcher matcher = pattern.matcher(text);
-        while (matcher.find()) {
-            return matcher.group(1);
+        try {
+            while (matcher.find()) {
+                return matcher.group(1);
+            }
+        } catch (Exception e) {
+            return null;
         }
         return null;
     }

+ 11 - 1
service-deploy/src/main/java/com/simuwang/deploy/components/LoggingAspect.java

@@ -1,5 +1,6 @@
 package com.simuwang.deploy.components;
 
+import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.exceptions.ExceptionUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.URLUtil;
@@ -20,6 +21,8 @@ import org.springframework.core.annotation.Order;
 import org.springframework.http.HttpMethod;
 import org.springframework.util.StopWatch;
 
+import java.util.Iterator;
+import java.util.List;
 import java.util.Objects;
 
 /**
@@ -81,7 +84,14 @@ public class LoggingAspect {
         boolean uploadRequest = isUploadRequest(request);
         StringBuilder params;
         if (request.getMethod().equalsIgnoreCase(HttpMethod.GET.name()) && !uploadRequest) {
-            params = new StringBuilder(Objects.toString(request.getParameterMap()));
+            List<String> tempList = ListUtil.list(false);
+            Iterator<String> paramNames = request.getParameterNames().asIterator();
+            while (paramNames.hasNext()) {
+                String param = paramNames.next();
+                String value = request.getParameter(param);
+                tempList.add(param + "=" + value);
+            }
+            params = new StringBuilder(String.join(",", tempList));
         } else {
             params = new StringBuilder();
             for (Object arg : args) {

+ 1 - 1
service-deploy/src/main/resources/application.yml

@@ -69,7 +69,7 @@ email-rule:
 
 email:
   file:
-    path: /data/file/nav
+    path: /home/wwwroot/shzq_dataapi/file/nav
   parse:
     force-template-enable: true
 

+ 2 - 2
service-manage/src/main/java/com/simuwang/manage/api/deletion/DeletionController.java

@@ -49,7 +49,7 @@ public class DeletionController {
      * @param deletionPageQuery
      * @return
      */
-    @SystemLog(value = "缺失管理查询")
+    @SystemLog(value = "缺失管理查询",type= SystemLog.Type.QUERY)
     @RequestMapping("search-deletion-list")
     public MybatisPage<DeletionInfoVO> searchDeletionList(DeletionPageQuery deletionPageQuery){
         MybatisPage<DeletionInfoVO> result = deletionService.searchDeletionList(deletionPageQuery);
@@ -61,7 +61,7 @@ public class DeletionController {
      * @param fundDeletionPageQuery
      * @return
      */
-    @SystemLog(value = "查询基金缺失明细")
+    @SystemLog(value = "查询基金缺失明细",type= SystemLog.Type.QUERY)
     @RequestMapping("search-fund-deletion")
     public MybatisPage<FundDeletionInfoVO> searchFundDeletionList(FundDeletionPageQuery fundDeletionPageQuery){
         MybatisPage<FundDeletionInfoVO> result = deletionService.searchFundDeletionList(fundDeletionPageQuery);

+ 1 - 1
service-manage/src/main/java/com/simuwang/manage/api/distribution/DistributionController.java

@@ -32,7 +32,7 @@ public class DistributionController {
      * @param distributionPageQuery
      * @return
      */
-    @SystemLog(value = "分红页面展示查询")
+    @SystemLog(value = "分红页面展示查询",type= SystemLog.Type.QUERY)
     @RequestMapping("search-distribution-list")
     public MybatisPage<DistributionTablePageVO> searchDistributionList(DistributionPageQuery distributionPageQuery) {
         MybatisPage<DistributionTablePageVO> result = distributionService.searchDistributionList(distributionPageQuery);

+ 1 - 1
service-manage/src/main/java/com/simuwang/manage/api/email/EmailAssetDetailController.java

@@ -29,7 +29,7 @@ public class EmailAssetDetailController{
      * @param parseDetailPageQuery
      * @return
      */
-    @SystemLog(value = "规模解析数据详情页面展示")
+    @SystemLog(value = "规模解析数据详情页面展示",type= SystemLog.Type.QUERY)
     @GetMapping("/search-asset-detail")
     public MybatisPage<EmailFundAssetVO> searchAssetDetail(ParseDetailPageQuery parseDetailPageQuery){
         MybatisPage<EmailFundAssetVO> result = parseEmailDetailService.searchAssetDetail(parseDetailPageQuery);

+ 2 - 2
service-manage/src/main/java/com/simuwang/manage/api/email/EmailConfigController.java

@@ -32,7 +32,7 @@ public class EmailConfigController{
      * @param emailPageQuery 邮箱
      * @return
      */
-    @SystemLog(value = "邮箱配置页面展示查询")
+    @SystemLog(value = "邮箱配置页面展示查询",type= SystemLog.Type.QUERY)
     @RequestMapping("search-email-list")
     public MybatisPage<MailboxInfoTableVO> searchEmailConfigList(EmailPageQuery emailPageQuery){
         MybatisPage<MailboxInfoTableVO> result = emailConfigService.searchEmailConfigList(emailPageQuery);
@@ -86,7 +86,7 @@ public class EmailConfigController{
      * @param idVO
      * @return
      */
-    @SystemLog(value = "根据ID查询邮箱配置")
+    @SystemLog(value = "根据ID查询邮箱配置",type= SystemLog.Type.QUERY)
     @GetMapping("search-email-config")
     public ResultVo searchEmailConfig(IdVO idVO){
         ResultVo vo = new ResultVo(ResultCode.SAVE_SUCCESS.getCode());

+ 1 - 0
service-manage/src/main/java/com/simuwang/manage/api/email/ParseEmailController.java

@@ -47,6 +47,7 @@ public class ParseEmailController{
      * @param emailTypeRuleVO
      * @return
      */
+    @SystemLog(value = "保存邮件类型识别配置",type = SystemLog.Type.INSERT)
     @PostMapping("/save-email-type")
     public boolean saveEmailType(@RequestBody EmailTypeRuleVO emailTypeRuleVO){
         parseEmailService.saveEmailType(emailTypeRuleVO);

+ 50 - 0
service-manage/src/main/java/com/simuwang/manage/api/log/LogController.java

@@ -0,0 +1,50 @@
+package com.simuwang.manage.api.log;
+
+import com.simuwang.base.common.support.MybatisPage;
+import com.simuwang.base.pojo.dto.query.LogPageQuery;
+import com.simuwang.base.pojo.vo.IdListVO;
+import com.simuwang.base.pojo.vo.LoggingVO;
+import com.simuwang.logging.LoggingService;
+import com.simuwang.logging.SystemLog;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 日志管理
+ * Author:   chenjianhua
+ * Date:     2024/9/28 20:51
+ * Description: ${DESCRIPTION}
+ */
+@SystemLog("日志管理")
+@RestController
+@RequestMapping("/v1/log")
+public class LogController {
+    @Autowired
+    private LoggingService loggingService;
+
+    /**
+     * 日志查询列表
+     * @param logPageQuery
+     * @return
+     */
+    @SystemLog(value = "查询日志列表")
+    @GetMapping("/search-log-list")
+    public MybatisPage<LoggingVO> searchLogList(LogPageQuery logPageQuery){
+        MybatisPage<LoggingVO> result = loggingService.searchLogList(logPageQuery);
+        return result;
+    }
+
+
+
+    /**
+     * 日志删除
+     * @param idListVO
+     * @return
+     */
+    @SystemLog(value = "删除日志",type = SystemLog.Type.DELETE)
+    @PostMapping("/delete-log")
+    public boolean deleteLog(@RequestBody IdListVO idListVO){
+        loggingService.deleteLog(idListVO);
+        return true;
+    }
+}

+ 3 - 3
service-manage/src/main/java/com/simuwang/manage/api/template/TemplateController.java

@@ -43,7 +43,7 @@ public class TemplateController {
      * @param idListVO
      * @return
      */
-    @SystemLog(value = "批量删除模版")
+    @SystemLog(value = "批量删除模版",type = SystemLog.Type.DELETE)
     @RequestMapping("delete-template-list")
     public boolean deleteTemplateList(@RequestBody IdListVO idListVO){
         emailTemplateInfoService.deleteTemplateList(idListVO);
@@ -73,7 +73,7 @@ public class TemplateController {
      * @param saveTemplateInfoVO
      * @return
      */
-    @SystemLog(value = "保存模版信息")
+    @SystemLog(value = "保存模版信息",type = SystemLog.Type.INSERT)
     @RequestMapping("save-template-list")
     public ResultVo saveTemplateList(@RequestBody SaveTemplateInfoVO saveTemplateInfoVO){
         ResultVo vo = new ResultVo(ResultCode.SAVE_SUCCESS.getCode());
@@ -92,7 +92,7 @@ public class TemplateController {
      * @param idListVO
      * @return
      */
-    @SystemLog(value = "批量删除适用规则")
+    @SystemLog(value = "批量删除适用规则",type = SystemLog.Type.DELETE)
     @RequestMapping("delete-application-rule")
     public boolean deleteApplicationRuleList(@RequestBody IdListVO idListVO){
         emailTemplateInfoService.deleteApplicationRuleList(idListVO);

+ 2 - 2
service-manage/src/main/java/com/simuwang/manage/api/template/TemplateSettingController.java

@@ -44,7 +44,7 @@ public class TemplateSettingController {
      * @param idListVO
      * @return
      */
-    @SystemLog(value = "批量删除模版设置")
+    @SystemLog(value = "批量删除模版设置",type = SystemLog.Type.DELETE)
     @RequestMapping("delete-template-setting")
     public boolean deleteTemplateSetting(@RequestBody IdListVO idListVO){
         emailTemplateMappingService.deleteTemplateSetting(idListVO);
@@ -57,7 +57,7 @@ public class TemplateSettingController {
      * @param emailTemplateMappingVO
      * @return
      */
-    @SystemLog(value = "保存模版设置")
+    @SystemLog(value = "保存模版设置",type = SystemLog.Type.INSERT)
     @RequestMapping("save-template-setting")
     public boolean saveTemplateSetting(@RequestBody EmailTemplateMappingVO emailTemplateMappingVO){
         emailTemplateMappingService.saveTemplateSetting(emailTemplateMappingVO);

+ 22 - 0
service-manage/src/main/java/com/simuwang/manage/service/impl/system/SysLogServiceImpl.java

@@ -8,13 +8,22 @@ import com.simuwang.base.common.support.MybatisPage;
 import com.simuwang.base.common.support.query.PageQuery;
 import com.simuwang.base.common.support.service.IService;
 import com.simuwang.base.mapper.system.SysLogMapper;
+import com.simuwang.base.pojo.dos.LoggingDO;
 import com.simuwang.base.pojo.dos.sys.SysLogDO;
+import com.simuwang.base.pojo.dto.query.LogPageQuery;
 import com.simuwang.base.pojo.dto.sys.LogQuery;
+import com.simuwang.base.pojo.vo.FundAliasVO;
+import com.simuwang.base.pojo.vo.IdListVO;
+import com.simuwang.base.pojo.vo.LoggingVO;
 import com.simuwang.base.pojo.vo.sys.SysLogVO;
 import com.simuwang.logging.Logging;
 import com.simuwang.manage.service.system.SysLogService;
+import com.simuwang.shiro.utils.UserUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+import java.util.stream.Collectors;
+
 @Service
 public class SysLogServiceImpl implements SysLogService {
     private final SysLogMapper mapper;
@@ -62,6 +71,19 @@ public class SysLogServiceImpl implements SysLogService {
     }
 
     @Override
+    public MybatisPage<LoggingVO> searchLogList(LogPageQuery logPageQuery) {
+        List<LoggingDO> loggingDOList = this.mapper.searchLogList(logPageQuery);
+        List<LoggingVO> loggingVOList = loggingDOList.stream().map(LoggingDO::toVO).collect(Collectors.toList());
+        long total = this.mapper.countLogList(logPageQuery);
+        return MybatisPage.of(total,loggingVOList);
+    }
+
+    @Override
+    public void deleteLog(IdListVO idListVO) {
+        this.mapper.deleteLog(idListVO.getIdList());
+    }
+
+    @Override
     public boolean truncate() {
         this.mapper.truncateAll();
         return true;