Browse Source

feat: 渠道管理后端接口开发

chenjianhua 1 month ago
parent
commit
fdd8ccf96f
36 changed files with 402 additions and 51 deletions
  1. 1 1
      service-base/src/main/java/com/simuwang/base/mapper/daq/AssetMapper.java
  2. 2 0
      service-base/src/main/java/com/simuwang/base/mapper/daq/ChannelMapper.java
  3. 9 0
      service-base/src/main/java/com/simuwang/base/mapper/daq/ImageMapper.java
  4. 2 2
      service-base/src/main/java/com/simuwang/base/mapper/daq/NavMapper.java
  5. 5 0
      service-base/src/main/java/com/simuwang/base/pojo/dos/AssetDO.java
  6. 1 1
      service-base/src/main/java/com/simuwang/base/pojo/dos/ChannelEmailInfoDO.java
  7. 14 0
      service-base/src/main/java/com/simuwang/base/pojo/dos/EmailFundAssetDO.java
  8. 12 0
      service-base/src/main/java/com/simuwang/base/pojo/dos/EmailFundNavDO.java
  9. 6 0
      service-base/src/main/java/com/simuwang/base/pojo/dos/FundNavAssetDO.java
  10. 46 0
      service-base/src/main/java/com/simuwang/base/pojo/dos/ImageInfoDO.java
  11. 5 0
      service-base/src/main/java/com/simuwang/base/pojo/dos/MailboxInfoDO.java
  12. 5 0
      service-base/src/main/java/com/simuwang/base/pojo/dos/NavDO.java
  13. 9 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/query/FundNavAssetPageQuery.java
  14. 20 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/query/ParseDetailPageQuery.java
  15. 1 1
      service-base/src/main/java/com/simuwang/base/pojo/vo/ChannelEmailInfoVO.java
  16. 7 0
      service-base/src/main/java/com/simuwang/base/pojo/vo/EmailFundAssetVO.java
  17. 6 0
      service-base/src/main/java/com/simuwang/base/pojo/vo/EmailFundNavVO.java
  18. 4 0
      service-base/src/main/java/com/simuwang/base/pojo/vo/FundNavAssetVO.java
  19. 5 0
      service-base/src/main/java/com/simuwang/base/pojo/vo/MailboxInfoVO.java
  20. 8 2
      service-base/src/main/resources/mapper/daq/AssetMapper.xml
  21. 4 1
      service-base/src/main/resources/mapper/daq/ChannelMapper.xml
  22. 17 3
      service-base/src/main/resources/mapper/daq/EmailFundAssetMapper.xml
  23. 25 3
      service-base/src/main/resources/mapper/daq/EmailFundNavMapper.xml
  24. 13 2
      service-base/src/main/resources/mapper/daq/FundNavAssetMapper.xml
  25. 21 5
      service-base/src/main/resources/mapper/daq/NavMapper.xml
  26. 25 12
      service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java
  27. 4 1
      service-manage/src/main/java/com/simuwang/manage/api/company/CompanyEmailSendHistoryController.java
  28. 1 1
      service-manage/src/main/java/com/simuwang/manage/api/email/EmailConfigController.java
  29. 43 0
      service-manage/src/main/java/com/simuwang/manage/api/image/ImageController.java
  30. 2 0
      service-manage/src/main/java/com/simuwang/manage/service/CompanyEmailConfigService.java
  31. 8 0
      service-manage/src/main/java/com/simuwang/manage/service/ImageSevice.java
  32. 8 11
      service-manage/src/main/java/com/simuwang/manage/service/impl/CompanyEmailConfigServiceImpl.java
  33. 2 0
      service-manage/src/main/java/com/simuwang/manage/service/impl/EmailConfigServiceImpl.java
  34. 58 0
      service-manage/src/main/java/com/simuwang/manage/service/impl/ImageSeviceImpl.java
  35. 1 3
      service-manage/src/main/java/com/simuwang/manage/service/impl/ParseEmailDetailServiceImpl.java
  36. 2 2
      service-manage/src/main/java/com/simuwang/manage/task/NavAmplitudeTask.java

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

@@ -14,7 +14,7 @@ public interface AssetMapper {
 
     void batchUpdate(@Param("itemDoList") List<AssetDO> assetDOList);
 
-    List<String> queryFundNavByDate(@Param("fundId") String fundId, @Param("priceDateList") List<String> priceDateList);
+    List<String> queryFundNavByDate(@Param("fundId") String fundId, @Param("priceDateList") List<String> priceDateList,@Param("channelId")Integer channelId);
 
     AssetDO queryFundAsset(AssetDO fundAssetVO);
 

+ 2 - 0
service-base/src/main/java/com/simuwang/base/mapper/daq/ChannelMapper.java

@@ -18,4 +18,6 @@ public interface ChannelMapper extends BaseMapper<ChannelInfoDO> {
     List<ChannelPageInfoDO> searchChannelList(ChannelPageQuery channelPageQuery);
 
     long countChannelInfo(ChannelPageQuery channelPageQuery);
+
+    Integer selectChannelIdByEmail(@Param("email") String emailAddress);
 }

+ 9 - 0
service-base/src/main/java/com/simuwang/base/mapper/daq/ImageMapper.java

@@ -0,0 +1,9 @@
+package com.simuwang.base.mapper.daq;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.simuwang.base.pojo.dos.ImageInfoDO;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ImageMapper extends BaseMapper<ImageInfoDO> {
+}

+ 2 - 2
service-base/src/main/java/com/simuwang/base/mapper/daq/NavMapper.java

@@ -31,7 +31,7 @@ public interface NavMapper {
 
     Long countNavTotal();
 
-    NavDO queryNavByFundIdDate(@Param("fundId")String fundId, @Param("priceDate")String priceDate);
+    NavDO queryNavByFundIdDate(@Param("fundId")String fundId, @Param("priceDate")String priceDate,@Param("channelId")Integer channelId);
 
-    NavDO queryLastNavByFundIdDate(@Param("fundId")String fundId, @Param("priceDate")String priceDate);
+    NavDO queryLastNavByFundIdDate(@Param("fundId")String fundId, @Param("priceDate")String priceDate,@Param("channelId")Integer channelId);
 }

+ 5 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/AssetDO.java

@@ -17,6 +17,11 @@ public class AssetDO {
     @TableId(value = "id")
     private Integer id;
     /**
+     * channel_id
+     */
+    @TableField(value = "channel_id")
+    private Integer channelId;
+    /**
      * 基金id
      */
     @TableField(value = "fund_id")

+ 1 - 1
service-base/src/main/java/com/simuwang/base/pojo/dos/ChannelEmailInfoDO.java

@@ -22,7 +22,7 @@ public class ChannelEmailInfoDO {
      * 渠道ID
      */
     @TableField("channel_id")
-    private String channelId;
+    private Integer channelId;
     /**
      * 邮箱地址
      */

+ 14 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/EmailFundAssetDO.java

@@ -18,6 +18,13 @@ public class EmailFundAssetDO {
      */
     @TableId(value = "id")
     private Integer id;
+
+    /**
+     * channel_id
+     */
+    @TableField(value = "channel_id")
+    private Integer channelId;
+
     /**
      * 文件id(email_file_info.id)
      */
@@ -102,10 +109,17 @@ public class EmailFundAssetDO {
 
     private String targetFundId;
 
+    private String channelName;
+
+    private String email;
+
     public EmailFundAssetVO toVo() {
         EmailFundAssetVO vo = new EmailFundAssetVO();
         vo.setId(this.id);
         vo.setFundId(this.fundId);
+        vo.setChannelId(this.channelId);
+        vo.setChannelName(this.channelName);
+        vo.setEmail(this.email);
         vo.setFundName(this.fundName);
         vo.setRegisterNumber(this.registerNumber);
         vo.setPriceDate(this.priceDate==null?null: DateUtils.format(this.priceDate, DateUtils.YYYY_MM_DD));

+ 12 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/EmailFundNavDO.java

@@ -20,6 +20,11 @@ public class EmailFundNavDO {
     @TableId(value = "id")
     private Integer id;
     /**
+     * channel_id
+     */
+    @TableField(value = "channel_id")
+    private Integer channelId;
+    /**
      * 邮件id(email_file_info.id)
      */
     @TableField(value = "file_id")
@@ -121,11 +126,18 @@ public class EmailFundNavDO {
      */
     private String targetFundId;
 
+    private String channelName;
+
+    private String email;
+
     public EmailFundNavVO toVo() {
         EmailFundNavVO vo = new EmailFundNavVO();
         vo.setId(this.id);
         vo.setFundId(this.fundId);
         vo.setFundName(this.fundName);
+        vo.setChannelId(this.channelId);
+        vo.setChannelName(this.channelName);
+        vo.setEmail(this.email);
         vo.setFileId(this.fileId);
         vo.setEmailTitle(this.emailTitle);
         vo.setRegisterNumber(this.registerNumber);

+ 6 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/FundNavAssetDO.java

@@ -52,10 +52,16 @@ public class FundNavAssetDO {
      */
     private Date updateTime;
 
+    private Integer channelId;
+
+    private String channelName;
+
     public FundNavAssetVO toVo() {
         FundNavAssetVO vo = new FundNavAssetVO();
         vo.setFundId(this.fundId);
         vo.setFundName(this.fundName);
+        vo.setChannelId(this.channelId);
+        vo.setChannelName(this.channelName);
         vo.setPriceDate(DateUtils.format(this.priceDate,DateUtils.YYYY_MM_DD));
         vo.setNav(this.nav);
         vo.setCumulativeNavWithdrawal(this.cumulativeNavWithdrawal);

+ 46 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/ImageInfoDO.java

@@ -0,0 +1,46 @@
+package com.simuwang.base.pojo.dos;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+@Data
+@TableName("image_info")
+public class ImageInfoDO {
+    @TableId(value = "id",type = IdType.AUTO)
+    private Integer id;
+
+    @TableField(value = "file_name")
+    private String fileName;
+
+    @TableField(value = "file_path")
+    private String filePath;
+    /**
+     * 记录的有效性;1-有效;0-无效;
+     */
+    @TableField(value = "isvalid")
+    private Integer isvalid;
+    /**
+     * 创建者Id;第一次创建时与Creator值相同,修改时与修改人值相同
+     */
+    @TableField(value = "creatorid")
+    private Integer creatorId;
+    /**
+     * 修改者Id;第一次创建时与Creator值相同,修改时与修改人值相同
+     */
+    @TableField(value = "updaterid")
+    private Integer updaterId;
+    /**
+     * 创建时间,默认第一次创建的getdate()时间
+     */
+    @TableField(value = "createtime")
+    private Date createTime;
+    /**
+     * 修改时间;第一次创建时与CreatTime值相同,修改时与修改时间相同
+     */
+    @TableField(value = "updatetime")
+    private Date updateTime;
+}

+ 5 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/MailboxInfoDO.java

@@ -94,6 +94,11 @@ public class MailboxInfoDO {
     @TableField(value = "updatetime")
     private Date updateTime;
 
+    /**
+     * 渠道ID
+     */
+    @TableField(value = "channel_id")
+    private Integer channelId;
 
     public MailboxInfoTableVO toTableVo() {
         MailboxInfoTableVO vo =new MailboxInfoTableVO();

+ 5 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/NavDO.java

@@ -17,6 +17,11 @@ public class NavDO {
     @TableId(value = "id")
     private Integer id;
     /**
+     * channel_id
+     */
+    @TableField(value = "channel_id")
+    private Integer channelId;
+    /**
      * 基金id
      */
     @TableField(value = "fund_id")

+ 9 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/query/FundNavAssetPageQuery.java

@@ -32,4 +32,13 @@ public class FundNavAssetPageQuery extends PageQuery {
      * 更新结束日期
      */
     private String updateEndDate;
+
+    /**
+     * 收件箱
+     */
+    private String email;
+    /**
+     * 渠道名称
+     */
+    private String channelName;
 }

+ 20 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/query/ParseDetailPageQuery.java

@@ -50,6 +50,26 @@ public class ParseDetailPageQuery extends PageQuery {
      */
     private String emailId;
 
+    private String email;
+
+    private String channelName;
+
+    public String getChannelName() {
+        return channelName;
+    }
+
+    public void setChannelName(String channelName) {
+        this.channelName = channelName;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
     public String getEmailId() {
         return emailId;
     }

+ 1 - 1
service-base/src/main/java/com/simuwang/base/pojo/vo/ChannelEmailInfoVO.java

@@ -17,7 +17,7 @@ public class ChannelEmailInfoVO {
     /**
      * 渠道ID
      */
-    private String channelId;
+    private Integer channelId;
     /**
      * 邮箱地址
      */

+ 7 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/EmailFundAssetVO.java

@@ -69,4 +69,11 @@ public class EmailFundAssetVO {
      * 邮件ID
      */
     private String emailId;
+
+
+    private Integer channelId;
+
+    private String channelName;
+
+    private String email;
 }

+ 6 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/EmailFundNavVO.java

@@ -75,4 +75,10 @@ public class EmailFundNavVO {
      * 审核备注
      */
     private String remark;
+
+    private Integer channelId;
+
+    private String channelName;
+
+    private String email;
 }

+ 4 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/FundNavAssetVO.java

@@ -48,4 +48,8 @@ public class FundNavAssetVO {
      * 更新时间
      */
     private String updateTime;
+
+    private Integer channelId;
+
+    private String channelName;
 }

+ 5 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/MailboxInfoVO.java

@@ -50,4 +50,9 @@ public class MailboxInfoVO {
      */
     private String description;
 
+    /**
+     * 渠道ID
+     */
+    private Integer channelId;
+
 }

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

@@ -16,11 +16,11 @@
 
     <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.AssetDO">
         insert into asset(fund_id,price_date,asset_net,asset_share,
-                                              isvalid, creatorid, createtime, updaterid, updatetime)
+                                              isvalid, creatorid, createtime, updaterid, updatetime,channel_id)
         values
         <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
             (#{itemDo.fundId},#{itemDo.priceDate},#{itemDo.assetNet},#{itemDo.assetShare},
-            #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
+            #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime}, #{itemDo.channelId})
         </foreach>
     </insert>
 
@@ -35,6 +35,9 @@
             where isvalid = 1
             and fund_id = #{itemDo.fundId}
             and price_date = #{itemDo.priceDate}
+            <if test="itemDo.channelId != null and itemDo.channelId !=''">
+                and channel_id = #{itemDo.channelId}
+            </if>
         </foreach>
     </insert>
     <delete id="deleteAsset">
@@ -53,6 +56,9 @@
         from asset
         where isvalid = 1
         and fund_id = #{fundId}
+        <if test="channelId != null and channelId !=''">
+            and channel_id=#{channelId}
+        </if>
         and price_date in
         <foreach collection="priceDateList" index="index" item="priceDate" separator="," open="(" close=")">
             #{priceDate}

+ 4 - 1
service-base/src/main/resources/mapper/daq/ChannelMapper.xml

@@ -53,9 +53,12 @@
         limit #{offset},#{pageSize}
     </select>
     <select id="countChannelInfo" resultType="java.lang.Long">
-        select count(*) from channel_email_info where isvalid=1
+        select count(*) from channel_info where isvalid=1
         <if test="channelName != null and channelName !=''">
             and  info.channel_name like concat('%',#{channelName},'%')
         </if>
     </select>
+    <select id="selectChannelIdByEmail" resultType="java.lang.Integer">
+        select channel_id from channel_email_info where isvalid=1 and email=#{email}
+    </select>
 </mapper>

+ 17 - 3
service-base/src/main/resources/mapper/daq/EmailFundAssetMapper.xml

@@ -21,15 +21,18 @@
         <result column="email_id" property="emailId"/>
         <result column="target_fund_name" property="targetFundName"/>
         <result column="target_fund_id" property="targetFundId"/>
+        <result column="channel_id" property="channelId"/>
+        <result column="channel_name" property="channelName"/>
+        <result column="email" property="email"/>
     </resultMap>
 
     <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.EmailFundAssetDO">
         insert into email_fund_asset(file_id, fund_id, fund_name,register_number,price_date,asset_net,asset_share,is_stored,exception_status,
-                                              isvalid, creatorid, createtime, updaterid, updatetime)
+                                              isvalid, creatorid, createtime, updaterid, updatetime,channel_id)
         values
         <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
             (#{itemDo.fileId},#{itemDo.fundId},#{itemDo.fundName},#{itemDo.registerNumber},#{itemDo.priceDate},#{itemDo.assetNet},#{itemDo.assetShare},#{itemDo.isStored},#{itemDo.exceptionStatus},
-            #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
+            #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime}, #{itemDo.channelId})
         </foreach>
 
     </insert>
@@ -61,7 +64,10 @@
                         asset.exception_status,
                         asset.updatetime,
                         parse.email_title,
-                        parse.id as email_id
+                        parse.id as email_id,
+                        parse.email as email,
+                        c.id as channel_id,
+                        c.channel_name as channel_name
         from email_fund_asset asset
         join email_file_info file
         on asset.file_id = file.id
@@ -69,6 +75,8 @@
         on file.email_id = parse.id
         left join pvn_fund_info info
         on asset.fund_id=info.fund_id and info.isvalid=1
+        left join channel_info c
+        on asset.channel_id=c.id and c.isvalid=1
         where asset.isvalid=1 and file.isvalid=1 and parse.isvalid=1
         <if test="fundName != null and fundName !=''">
             and (asset.fund_name like concat('%',#{fundName},'%') or asset.register_number like concat('%',#{fundName},'%'))
@@ -94,6 +102,12 @@
         <if test="emailId != null and emailId !=''">
             and parse.id =#{emailId}
         </if>
+        <if test="email != null and email !=''">
+            and parse.email like concat('%',#{email},'%')
+        </if>
+        <if test="channelName != null and channelName !=''">
+            and c.channel_name like concat('%',#{channelName},'%')
+        </if>
         <if test="exceptionStatusList != null">
             and asset.exception_status in
             <foreach collection="exceptionStatusList" index="index" item="exceptionStatus" separator="," open="(" close=")">

+ 25 - 3
service-base/src/main/resources/mapper/daq/EmailFundNavMapper.xml

@@ -22,17 +22,20 @@
         <result column="target_fund_name" property="targetFundName"/>
         <result column="target_fund_id" property="targetFundId"/>
         <result column="remark" property="remark"/>
+        <result column="channel_id" property="channelId"/>
+        <result column="channel_name" property="channelName"/>
+        <result column="email" property="email"/>
     </resultMap>
 
     <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.EmailFundNavDO">
         insert into email_fund_nav(file_id, fund_id, fund_name,register_number,price_date,
                                               nav,cumulative_nav_withdrawal,is_stored,exception_status,template_id,
-                                              isvalid, creatorid, createtime, updaterid, updatetime)
+                                              isvalid, creatorid, createtime, updaterid, updatetime,channel_id)
         values
         <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
             (#{itemDo.fileId},#{itemDo.fundId},#{itemDo.fundName},#{itemDo.registerNumber},#{itemDo.priceDate},
              #{itemDo.nav},#{itemDo.cumulativeNavWithdrawal},#{itemDo.isStored},#{itemDo.exceptionStatus},#{itemDo.templateId},
-            #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
+            #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime}, #{itemDo.channelId})
         </foreach>
     </insert>
     <update id="batchUpdate">
@@ -56,6 +59,9 @@
             is_stored=#{isStored}
         where isvalid = 1 and price_date = #{priceDate} and fund_id=#{fundId}
           and nav=#{nav} and cumulative_nav_withdrawal=#{cumulativeNavWithdrawal}
+        <if test="channelId != null and channelId !=''">
+            and channel_id = #{channelId}
+        </if>
         <if test="fileId != null and fileId !=''">
             and file_id = #{fileId}
         </if>
@@ -97,7 +103,13 @@
             nav.updatetime,
             nav.remark,
             parse.email_title,
-            parse.id as email_id
+            parse.email,
+            c.id as channel_id,
+            c.channel_name,
+            parse.id as email_id,
+            c.id as channel_id,
+            c.channel_name as channel_name,
+            parse.email as email
         FROM
             email_fund_nav nav
             join email_file_info file
@@ -106,6 +118,8 @@
                 on file.email_id = parse.id
             left join pvn_fund_info info
                 on nav.fund_id=info.fund_id and info.isvalid=1
+            left join channel_info c
+                on nav.channel_id=c.id and c.isvalid=1
         WHERE nav.isvalid = 1  and file.isvalid=1 and parse.isvalid=1
         <if test="fundName != null and fundName !=''">
             and (nav.fund_name like concat('%',#{fundName},'%') or nav.register_number like concat('%',#{fundName},'%'))
@@ -137,6 +151,12 @@
         <if test="emailId != null and emailId !=''">
             and parse.id =#{emailId}
         </if>
+        <if test="email != null and email !=''">
+            and parse.email like concat('%',#{email},'%')
+        </if>
+        <if test="channelName != null and channelName !=''">
+            and c.channel_name like concat('%',#{channelName},'%')
+        </if>
         <choose>
             <when test="sort != null and sort !='' and sort=='priceDate' and order != null and order !=''">
                 order by nav.price_date ${order}
@@ -170,6 +190,8 @@
         on file.email_id = parse.id
         left join pvn_fund_info info
         on nav.fund_id=info.fund_id and info.isvalid=1
+        left join channel_info c
+        on nav.channel_id=c.id and c.isvalid=1
         WHERE nav.isvalid = 1  and file.isvalid=1 and parse.isvalid=1
         <if test="fundName != null and fundName !=''">
             and (nav.fund_name like concat('%',#{fundName},'%') or nav.register_number like concat('%',#{fundName},'%'))

+ 13 - 2
service-base/src/main/resources/mapper/daq/FundNavAssetMapper.xml

@@ -11,6 +11,8 @@
         <result column="asset_share" property="assetShare"/>
         <result column="asset_net" property="assetNet"/>
         <result column="updatetime" property="updateTime"/>
+        <result column="channel_id" property="channelId"/>
+        <result column="channel_name" property="channelName"/>
     </resultMap>
     <select id="searchNavAssetList" resultMap="BaseResultMap"
             parameterType="com.simuwang.base.pojo.dto.query.FundNavAssetPageQuery">
@@ -23,7 +25,9 @@
         nav.cumulative_nav_withdrawal,
         asset.asset_share,
         asset.asset_net,
-        nav.updatetime
+        nav.updatetime,
+        c.id as channel_id,
+        c.channel_name
         FROM
         nav nav
         JOIN pvn_fund_info info
@@ -31,7 +35,8 @@
         LEFT JOIN asset asset
         ON nav.fund_id = asset.fund_id
         AND nav.price_date = asset.price_date
-        AND asset.isvalid = 1
+        AND asset.isvalid = 1 and nav.channel_id = asset.channel_id
+        left join channel_info c on c.id = nav.channel_id and c.isvalid=1
         WHERE info.isvalid = 1
         AND nav.isvalid = 1
         <if test="fundName != null and fundName !=''">
@@ -49,6 +54,12 @@
         <if test="updateEndDate != null and updateEndDate !=''">
             and (nav.updatetime <![CDATA[ <= ]]> #{updateEndDate} or asset.updatetime <![CDATA[ <= ]]> #{updateEndDate})
         </if>
+        <if test="email != null and email !=''">
+            and parse.email like concat('%',#{email},'%')
+        </if>
+        <if test="channelName != null and channelName !=''">
+            and c.channel_name like concat('%',#{channelName},'%')
+        </if>
         <choose>
             <when test="sort != null and sort !='' and sort=='priceDate' and order != null and order !=''">
                 order by price_date ${order}

+ 21 - 5
service-base/src/main/resources/mapper/daq/NavMapper.xml

@@ -13,15 +13,16 @@
         <result column="createtime" property="createTime"/>
         <result column="updaterid" property="updaterId"/>
         <result column="updatetime" property="updateTime"/>
+        <result column="channel_id" property="channelId"/>
     </resultMap>
 
     <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.NavDO">
         insert into nav(fund_id,price_date,nav,cumulative_nav,cumulative_nav_withdrawal,
-                                  isvalid, creatorid, createtime, updaterid, updatetime)
+                                  isvalid, creatorid, createtime, updaterid, updatetime,channel_id)
         values
         <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
             (#{itemDo.fundId},#{itemDo.priceDate},#{itemDo.nav},#{itemDo.cumulativeNav},#{itemDo.cumulativeNavWithdrawal},
-            #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
+            #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime}, #{itemDo.channelId})
         </foreach>
 
     </insert>
@@ -37,14 +38,17 @@
             where isvalid = 1
             and fund_id = #{itemDo.fundId}
             and price_date = #{itemDo.priceDate}
+            <if test="itemDo.channelId != null and itemDo.channelId !='">
+                and channel_id = #{itemDo.channelId}
+            </if>
         </foreach>
     </insert>
     <insert id="saveNav" parameterType="com.simuwang.base.pojo.dos.NavDO">
         insert into nav(fund_id,price_date,nav,cumulative_nav,cumulative_nav_withdrawal,
-        isvalid, creatorid, createtime, updaterid, updatetime)
+        isvalid, creatorid, createtime, updaterid, updatetime,channel_id)
         values
             (#{fundId},#{priceDate},#{nav},#{cumulativeNav},#{cumulativeNavWithdrawal},
-            #{isvalid}, #{creatorId}, #{createTime}, #{updaterId}, #{updateTime})
+            #{isvalid}, #{creatorId}, #{createTime}, #{updaterId}, #{updateTime},#{channelId})
     </insert>
     <update id="updateNav" parameterType="com.simuwang.base.pojo.dos.NavDO">
         update nav
@@ -77,15 +81,21 @@
         <foreach collection="priceDateList" index="index" item="priceDate" separator="," open="(" close=")">
             #{priceDate}
         </foreach>
+        <if test="channelId != null and channelId !='">
+            channel_id=#{channnelId}
+        </if>
     </select>
     <select id="queryFundNav" resultMap="BaseResultMap"
             parameterType="com.simuwang.base.pojo.dos.NavDO">
         SELECT id, fund_id,price_date,nav,cumulative_nav,cumulative_nav_withdrawal,
-               isvalid, creatorid, createtime, updaterid, updatetime
+               isvalid, creatorid, createtime, updaterid, updatetime,channel_id
         from nav
         where isvalid = 1
           and fund_id = #{fundId}
           and price_date=#{priceDate}
+        <if test="channelId != null and channelId !=''">
+            and channel_id=#{channelId}
+        </if>
     </select>
     <select id="getAllFundId" resultType="java.lang.String">
         select distinct fund_id from nav where isvalid=1
@@ -109,6 +119,9 @@
         from nav
         where isvalid = 1
           and fund_id = #{fundId} and price_date = #{priceDate}
+        <if test="channelId != null and channelId !=''">
+            and channel_id=#{channelId}
+        </if>
         order by price_date desc
         limit 1
     </select>
@@ -118,6 +131,9 @@
         from nav
         where isvalid = 1
           and fund_id = #{fundId} and price_date <![CDATA[ < ]]> #{priceDate}
+        <if test="channelId != null and channelId !=''">
+            and channel_id=#{channelId}
+        </if>
         order by price_date desc
             limit 1
     </select>

+ 25 - 12
service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java

@@ -91,6 +91,9 @@ public class EmailParseService {
     @Autowired
     private ReportWriterFactory reportWriterFactory;
 
+    @Autowired
+    private ChannelMapper channelMapper;
+
     public EmailParseService(EmailTypeRuleMapper emailTypeRuleMapper, EmailRuleConfig emailRuleConfig,
                              EmailFieldMappingMapper emailFieldMapper, EmailParserFactory emailParserFactory,
                              EmailParseInfoMapper emailParseInfoMapper, EmailFileInfoMapper emailFileInfoMapper,
@@ -98,7 +101,8 @@ public class EmailParseService {
                              AssetMapper assetMapper, NavMapper navMapper, FundService fundService,
                              FundAliasMapper fundAliasMapper,
                              ValuationTableMapper valuationTableMapper, ValuationTableAttributeMapper valuationTableAttributeMapper,
-                             FundPositionDetailMapper fundPositionDetailMapper, DistributionMapper distributionMapper, CompanyInformationMapper companyInformationMapper, FileManageMapper fileManageMapper, FundInfoMapper fundInfoMapper) {
+                             FundPositionDetailMapper fundPositionDetailMapper, DistributionMapper distributionMapper, CompanyInformationMapper companyInformationMapper,
+                             FileManageMapper fileManageMapper, FundInfoMapper fundInfoMapper,ChannelMapper channelMapper) {
         this.emailTypeRuleMapper = emailTypeRuleMapper;
         this.emailRuleConfig = emailRuleConfig;
         this.emailFieldMapper = emailFieldMapper;
@@ -112,7 +116,7 @@ public class EmailParseService {
         this.navMapper = navMapper;
         this.fundService = fundService;
         this.fundAliasMapper = fundAliasMapper;
-
+        this.channelMapper = channelMapper;
         this.valuationTableMapper = valuationTableMapper;
         this.valuationTableAttributeMapper = valuationTableAttributeMapper;
         this.fundPositionDetailMapper = fundPositionDetailMapper;
@@ -195,12 +199,15 @@ public class EmailParseService {
         String emailDate = CollUtil.isNotEmpty(emailContentInfoDTOList) ? emailContentInfoDTOList.get(0).getEmailDate() : null;
         Integer emailType = CollUtil.isNotEmpty(emailContentInfoDTOList) ? emailContentInfoDTOList.get(0).getEmailType() : null;
         Integer emailId = CollUtil.isNotEmpty(emailContentInfoDTOList) ? emailContentInfoDTOList.get(0).getEmailId() : null;
-        String senderEmail = CollUtil.isNotEmpty(emailContentInfoDTOList) ? emailContentInfoDTOList.get(0).getSenderEmail() : null;
+        String senderEmail = CollUtil.isNotEmpty(emailContentInfoDTOList) ? emailContentInfoDTOList.get(0).getSenderEmail() : "";
         Date parseDate = new Date();
         int emailParseStatus = EmailParseStatusConst.SUCCESS;
         EmailParseInfoDO emailParseInfoDO = buildEmailParseInfo(emailId, emailAddress, senderEmail, emailDate, emailTitle, emailType, emailParseStatus, parseDate);
         emailId = saveEmailParseInfo(emailParseInfoDO);
-
+        Integer channelId = channelMapper.selectChannelIdByEmail(emailAddress);
+        if(channelId == null){
+            channelId=-1;
+        }
         // python 报告解析接口结果
         List<ParseResult<ReportData>> dataList = ListUtil.list(false);
         for (Map.Entry<EmailContentInfoDTO, List<EmailFundNavDTO>> fileNameNavEntry : fileNameNavMap.entrySet()) {
@@ -258,7 +265,7 @@ public class EmailParseService {
                 log.error("保存文件管理信息报错:"+e.getMessage(),e);
             }
             // 保存净值表和规模表
-            saveNavAndAssetNet(fileId, fundNavDTOList, parseDate);
+            saveNavAndAssetNet(channelId,fileId, fundNavDTOList, parseDate);
             saveValuationInfo(fileId, fundNavDTOList);
         }
 
@@ -620,13 +627,13 @@ public class EmailParseService {
         return result;
     }
 
-    private void saveNavAndAssetNet(Integer fileId, List<EmailFundNavDTO> fundNavDTOList, Date parseDate) {
+    private void saveNavAndAssetNet(Integer channelId,Integer fileId, List<EmailFundNavDTO> fundNavDTOList, Date parseDate) {
         if (CollUtil.isEmpty(fundNavDTOList)) {
             return;
         }
         // 净值数据
         List<EmailFundNavDO> emailFundNavDOList = fundNavDTOList.stream()
-                .map(e -> buildEmailFundNavDo(fileId, e, parseDate)).filter(CollUtil::isNotEmpty).flatMap(List::stream).collect(Collectors.toList());
+                .map(e -> buildEmailFundNavDo(channelId,fileId, e, parseDate)).filter(CollUtil::isNotEmpty).flatMap(List::stream).collect(Collectors.toList());
         if (CollUtil.isNotEmpty(emailFundNavDOList)) {
             // 先删除文件id下的净值数据(考虑到重新解析的需求,如果是首次解析,那么file_id下不存在净值数据)
             emailFundNavMapper.deleteByFileId(fileId);
@@ -637,7 +644,7 @@ public class EmailParseService {
         }
         // 保存规模数据
         List<EmailFundAssetDO> emailFundAssetDOList = fundNavDTOList.stream()
-                .map(e -> buildEmailFundAssetDo(fileId, e, parseDate)).filter(CollUtil::isNotEmpty).flatMap(List::stream).collect(Collectors.toList());
+                .map(e -> buildEmailFundAssetDo(channelId,fileId, e, parseDate)).filter(CollUtil::isNotEmpty).flatMap(List::stream).collect(Collectors.toList());
         if (CollUtil.isNotEmpty(emailFundAssetDOList)) {
             // 先删除file_id下的规模数据(考虑到重新解析的需求,如果是首次解析,那么file_id下不存在规模数据)
             emailFundAssetMapper.deleteByFileId(fileId);
@@ -707,6 +714,7 @@ public class EmailParseService {
         EmailFundNavDO fundNavDO = new EmailFundNavDO();
         fundNavDO.setFundId(insertDO.getFundId());
         fundNavDO.setNav(insertDO.getNav());
+        fundNavDO.setChannelId(insertDO.getChannelId());
         fundNavDO.setPriceDate(insertDO.getPriceDate());
         fundNavDO.setCumulativeNavWithdrawal(insertDO.getCumulativeNavWithdrawal());
         fundNavDO.setFileId(fileId);
@@ -720,11 +728,12 @@ public class EmailParseService {
         if (CollUtil.isEmpty(assetDOList)) {
             return;
         }
+        Integer channelId = assetDOList.get(0).getChannelId();
         Map<String, List<AssetDO>> fundIdNavMap = assetDOList.stream().collect(Collectors.groupingBy(AssetDO::getFundId));
         for (Map.Entry<String, List<AssetDO>> entry : fundIdNavMap.entrySet()) {
             List<AssetDO> assetDOS = entry.getValue();
             List<String> priceDateList = assetDOS.stream().map(AssetDO::getPriceDate).map(e -> DateUtil.format(e, DateConst.YYYY_MM_DD)).collect(Collectors.toList());
-            List<String> dateList = assetMapper.queryFundNavByDate(entry.getKey(), priceDateList);
+            List<String> dateList = assetMapper.queryFundNavByDate(entry.getKey(), priceDateList,channelId);
             List<AssetDO> updateAssetDoList = assetDOS.stream().filter(e -> dateList.contains(DateUtil.format(e.getPriceDate(), DateConst.YYYY_MM_DD))).collect(Collectors.toList());
             List<AssetDO> insertAssetDoList = assetDOS.stream().filter(e -> !dateList.contains(DateUtil.format(e.getPriceDate(), DateConst.YYYY_MM_DD))).collect(Collectors.toList());
             if (CollUtil.isNotEmpty(insertAssetDoList)) {
@@ -742,7 +751,7 @@ public class EmailParseService {
         }
     }
 
-    private List<EmailFundAssetDO> buildEmailFundAssetDo(Integer fileId, EmailFundNavDTO fundNavDTO, Date parseDate) {
+    private List<EmailFundAssetDO> buildEmailFundAssetDo(Integer channelId,Integer fileId, EmailFundNavDTO fundNavDTO, Date parseDate) {
         List<EmailFundAssetDO> fundAssetDOList = CollUtil.newArrayList();
         BigDecimal assetNet = StrUtil.isNotBlank(fundNavDTO.getAssetNet()) ? new BigDecimal(fundNavDTO.getAssetNet()) : null;
         BigDecimal assetShare = StrUtil.isNotBlank(fundNavDTO.getAssetShare()) ? new BigDecimal(fundNavDTO.getAssetShare()) : null;
@@ -756,6 +765,7 @@ public class EmailParseService {
             for (String fundId : fundNavDTO.getFundIdList()) {
                 EmailFundAssetDO emailFundAssetDO = new EmailFundAssetDO();
                 emailFundAssetDO.setFileId(fileId);
+                emailFundAssetDO.setChannelId(channelId);
                 emailFundAssetDO.setPriceDate(priceDate);
                 emailFundAssetDO.setFundId(fundId);
                 emailFundAssetDO.setFundName(fundNavDTO.getFundName());
@@ -774,6 +784,7 @@ public class EmailParseService {
         } else {
             EmailFundAssetDO emailFundAssetDO = new EmailFundAssetDO();
             emailFundAssetDO.setFileId(fileId);
+            emailFundAssetDO.setChannelId(channelId);
             emailFundAssetDO.setPriceDate(priceDate);
             emailFundAssetDO.setFundName(fundNavDTO.getFundName());
             emailFundAssetDO.setRegisterNumber(fundNavDTO.getRegisterNumber());
@@ -791,7 +802,7 @@ public class EmailParseService {
         return fundAssetDOList;
     }
 
-    private List<EmailFundNavDO> buildEmailFundNavDo(Integer fileId, EmailFundNavDTO fundNavDTO, Date parseDate) {
+    private List<EmailFundNavDO> buildEmailFundNavDo(Integer channelId,Integer fileId, EmailFundNavDTO fundNavDTO, Date parseDate) {
         List<EmailFundNavDO> fundNavDOList = CollUtil.newArrayList();
         Date priceDate = DateUtil.parse(fundNavDTO.getPriceDate(), DateConst.YYYY_MM_DD);
         BigDecimal nav = StrUtil.isNotBlank(fundNavDTO.getNav()) ? new BigDecimal(fundNavDTO.getNav()) : null;
@@ -802,6 +813,7 @@ public class EmailParseService {
             for (String fundId : fundNavDTO.getFundIdList()) {
                 EmailFundNavDO emailFundNavDO = new EmailFundNavDO();
                 emailFundNavDO.setFileId(fileId);
+                emailFundNavDO.setChannelId(channelId);
                 emailFundNavDO.setIsStored(isStored);
                 emailFundNavDO.setPriceDate(priceDate);
                 emailFundNavDO.setNav(nav);
@@ -821,6 +833,7 @@ public class EmailParseService {
         } else {
             EmailFundNavDO emailFundNavDO = new EmailFundNavDO();
             emailFundNavDO.setFileId(fileId);
+            emailFundNavDO.setChannelId(channelId);
             emailFundNavDO.setPriceDate(priceDate);
             emailFundNavDO.setNav(nav);
             emailFundNavDO.setCumulativeNavWithdrawal(cumulativeNavWithdrawal);
@@ -911,7 +924,7 @@ public class EmailParseService {
         String fundId = navDO.getFundId();
         String priceDate = DateUtils.format(navDO.getPriceDate(), DateUtils.YYYY_MM_DD);
         //上一期单位净值
-        NavDO preNavDO = navMapper.queryLastNavByFundIdDate(fundId,priceDate);
+        NavDO preNavDO = navMapper.queryLastNavByFundIdDate(fundId,priceDate,navDO.getChannelId());
         if(preNavDO == null){
             return BigDecimal.valueOf(0);
         }

+ 4 - 1
service-manage/src/main/java/com/simuwang/manage/api/company/CompanyEmailSendHistoryController.java

@@ -1,6 +1,5 @@
 package com.simuwang.manage.api.company;
 
-
 import com.simuwang.base.common.support.MybatisPage;
 import com.simuwang.base.pojo.dto.query.CompanyEmailHistoryPageQuery;
 import com.simuwang.base.pojo.dto.query.CompanyEmailPageQuery;
@@ -14,6 +13,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
 import java.util.List;
 /**
  * 公司邮箱配置管理
@@ -157,4 +157,7 @@ public class CompanyEmailSendHistoryController{
         companyEmailConfigService.sendCompanyEmail(idListVO.getIdList());
         return true;
     }
+
+
+
 }

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

@@ -54,9 +54,9 @@ public class EmailConfigController{
                 return vo;
             }
             emailConfigService.saveEmailConfig(mailboxInfoVO);
-            vo.setData(true);
         }catch (Exception e){
             vo.setCode(ResultCode.SAVE_FAILED.getCode());
+            vo.setData(false);
             logger.error(e.getMessage(),e);
         }
         return vo;

+ 43 - 0
service-manage/src/main/java/com/simuwang/manage/api/image/ImageController.java

@@ -0,0 +1,43 @@
+package com.simuwang.manage.api.image;
+
+import com.simuwang.logging.SystemLog;
+import com.simuwang.manage.service.ImageSevice;
+import com.smppw.common.pojo.ResultVo;
+import com.smppw.common.pojo.enums.status.ResultCode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+@SystemLog(value = "名片管理")
+@RestController
+@RequestMapping("/v1/image")
+public class ImageController {
+    @Autowired
+    private ImageSevice imageSevice;
+
+    private static final Logger logger = LoggerFactory.getLogger(ImageController.class);
+    /**
+     * 上传图片
+     * @param file
+     * @return
+     */
+    @SystemLog(value = "上传图片", type = SystemLog.Type.UPLOAD_OR_IMPORT)
+    @PostMapping("upload")
+    public ResultVo upload(@RequestParam("file") MultipartFile file) {
+        ResultVo vo = new ResultVo(ResultCode.SAVE_SUCCESS.getCode());
+        try{
+            vo = imageSevice.saveImage(file);
+        }catch (Exception e){
+            logger.error(e.getMessage(),e);
+            vo.setCode(ResultCode.SAVE_FAILED.getCode());
+            vo.setMsg(ResultCode.SAVE_FAILED.getMsg());
+            vo.setData(false);
+        }
+        return vo;
+    }
+}

+ 2 - 0
service-manage/src/main/java/com/simuwang/manage/service/CompanyEmailConfigService.java

@@ -2,6 +2,7 @@ package com.simuwang.manage.service;
 
 import com.simuwang.base.pojo.vo.CompanyEmailConfigVO;
 import com.smppw.common.pojo.ResultVo;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -22,4 +23,5 @@ public interface CompanyEmailConfigService {
     void sendCompanyEmail(List<Integer> idList);
 
     void sendEmail(String companyId, String email);
+
 }

+ 8 - 0
service-manage/src/main/java/com/simuwang/manage/service/ImageSevice.java

@@ -0,0 +1,8 @@
+package com.simuwang.manage.service;
+
+import com.smppw.common.pojo.ResultVo;
+import org.springframework.web.multipart.MultipartFile;
+
+public interface ImageSevice {
+    ResultVo saveImage(MultipartFile file);
+}

+ 8 - 11
service-manage/src/main/java/com/simuwang/manage/service/impl/CompanyEmailConfigServiceImpl.java

@@ -7,35 +7,30 @@ import com.simuwang.base.common.util.DateUtils;
 import com.simuwang.base.common.util.EmailUtil;
 import com.simuwang.base.common.util.ExcelUtil;
 import com.simuwang.base.common.util.StringUtil;
-import com.simuwang.base.mapper.daq.CompanyEmailConfigMapper;
-import com.simuwang.base.mapper.daq.CompanyEmailSendHistoryMapper;
-import com.simuwang.base.mapper.daq.DeletionInfoMapper;
-import com.simuwang.base.mapper.daq.FundInfoMapper;
+import com.simuwang.base.mapper.daq.*;
 import com.simuwang.base.mapper.daq.system.SysConfigMapper;
 import com.simuwang.base.pojo.dos.CompanyEmailConfigDO;
 import com.simuwang.base.pojo.dos.CompanyEmailSendHistoryDO;
 import com.simuwang.base.pojo.dos.EmailDeletionInfoDO;
-import com.simuwang.base.pojo.dto.ExcelDeletionInfoDTO;
+import com.simuwang.base.pojo.dos.ImageInfoDO;
 import com.simuwang.base.pojo.dto.MailboxInfoDTO;
 import com.simuwang.base.pojo.vo.CompanyEmailConfigVO;
-import com.simuwang.manage.init.CompleteScheduleConfig;
 import com.simuwang.manage.service.CompanyEmailConfigService;
 import com.simuwang.shiro.utils.UserUtils;
 import com.smppw.common.pojo.ResultVo;
-import jakarta.annotation.Resource;
-import jakarta.mail.Message;
-import jakarta.mail.Store;
-import jakarta.mail.internet.MimeMessage;
+import org.apache.commons.io.FileUtils;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.mail.javamail.JavaMailSender;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -64,6 +59,7 @@ public class CompanyEmailConfigServiceImpl implements CompanyEmailConfigService
 
     @Value("${email.file.path}")
     private String path;
+
     @Override
     public ResultVo saveCompanyEmailConfig(List<CompanyEmailConfigVO> companyEmailConfigVOS) {
         ResultVo vo = new ResultVo(com.smppw.common.pojo.enums.status.ResultCode.SAVE_SUCCESS);
@@ -190,6 +186,7 @@ public class CompanyEmailConfigServiceImpl implements CompanyEmailConfigService
         }
     }
 
+
     private void saveCompanyEmailSendHistory(String companyId, String email,Integer sendStatus,String msg) {
         CompanyEmailSendHistoryDO historyDO = new CompanyEmailSendHistoryDO();
         historyDO.setCompanyId(companyId);

+ 2 - 0
service-manage/src/main/java/com/simuwang/manage/service/impl/EmailConfigServiceImpl.java

@@ -11,6 +11,7 @@ import com.simuwang.base.common.support.MybatisPage;
 import com.simuwang.base.common.util.*;
 import com.simuwang.base.config.DaqProperties;
 import com.simuwang.base.mapper.daq.MailboxInfoMapper;
+import com.simuwang.base.pojo.dos.ChannelEmailInfoDO;
 import com.simuwang.base.pojo.dos.MailboxInfoDO;
 import com.simuwang.base.pojo.dto.MailboxInfoDTO;
 import com.simuwang.base.pojo.dto.QuartzBean;
@@ -258,6 +259,7 @@ public class EmailConfigServiceImpl implements EmailConfigService {
         mailboxInfoDO.setUpdaterId(UserUtils.getLoginUser().getUserId());
         mailboxInfoDO.setCreatorId(UserUtils.getLoginUser().getUserId());
         mailboxInfoDO.setOpenStatus(1);
+        mailboxInfoDO.setChannelId(mailboxInfoVO.getChannelId());
         return mailboxInfoDO;
     }
 

+ 58 - 0
service-manage/src/main/java/com/simuwang/manage/service/impl/ImageSeviceImpl.java

@@ -0,0 +1,58 @@
+package com.simuwang.manage.service.impl;
+
+import com.simuwang.base.common.util.DateUtils;
+import com.simuwang.base.mapper.daq.ImageMapper;
+import com.simuwang.base.pojo.dos.ImageInfoDO;
+import com.simuwang.manage.service.ImageSevice;
+import com.simuwang.shiro.utils.UserUtils;
+import com.smppw.common.pojo.ResultVo;
+import org.apache.commons.io.FileUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+
+@Service
+public class ImageSeviceImpl implements ImageSevice {
+
+    @Value("${email.file.path}")
+    private String path;
+    @Autowired
+    private ImageMapper imageMapper;
+
+    @Override
+    public ResultVo saveImage(MultipartFile file) {
+        path +="image/";
+        ResultVo vo = new ResultVo(com.smppw.common.pojo.enums.status.ResultCode.SAVE_SUCCESS.getCode());
+        ImageInfoDO imageInfoDO = new ImageInfoDO();
+        String fileName = file.getOriginalFilename();
+        imageInfoDO.setFileName(fileName);
+        File dir = new File(path + DateUtils.datePath()+"/");
+        if(!dir.mkdirs()){
+            dir.mkdirs();
+        }
+        String imagePath = path + DateUtils.datePath()+"/"+System.currentTimeMillis()+fileName.substring(fileName.lastIndexOf("."));
+        InputStream inputStream = null;
+        File image = new File(imagePath);
+        try {
+            inputStream = file.getInputStream();
+            FileUtils.copyToFile(inputStream,image);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        imageInfoDO.setFilePath(path);
+        imageInfoDO.setUpdaterId(UserUtils.getLoginUser().getUserId());
+        imageInfoDO.setCreatorId(UserUtils.getLoginUser().getUserId());
+        imageInfoDO.setIsvalid(1);
+        imageInfoDO.setCreateTime(new Date());
+        imageInfoDO.setUpdateTime(new Date());
+        imageMapper.insert(imageInfoDO);
+        vo.setData(imageInfoDO);
+        return vo;
+    }
+}

+ 1 - 3
service-manage/src/main/java/com/simuwang/manage/service/impl/ParseEmailDetailServiceImpl.java

@@ -14,10 +14,8 @@ import com.simuwang.shiro.utils.UserUtils;
 import com.smppw.common.pojo.ResultVo;
 import com.smppw.common.pojo.enums.status.ResultCode;
 import com.smppw.utils.DateUtil;
-import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -78,7 +76,7 @@ public class ParseEmailDetailServiceImpl implements ParseEmailDetailService {
                 emailFundNavDO.setUpdaterId(userId);
                 emailFundNavMapper.updateEmailNav(emailFundNavDO);
                 //将净值入库
-                NavDO navDO = navMapper.queryNavByFundIdDate(emailFundNavDO.getFundId(),DateUtils.format(emailFundNavDO.getPriceDate(),DateUtils.YYYY_MM_DD));
+                NavDO navDO = navMapper.queryNavByFundIdDate(emailFundNavDO.getFundId(),DateUtils.format(emailFundNavDO.getPriceDate(),DateUtils.YYYY_MM_DD),emailFundNavDO.getChannelId());
                 if(navDO == null){
                     navDO = new NavDO();
                     navDO.setNav(emailFundNavDO.getNav());

+ 2 - 2
service-manage/src/main/java/com/simuwang/manage/task/NavAmplitudeTask.java

@@ -74,7 +74,7 @@ public class NavAmplitudeTask {
             String fundId = emailFundNavDO.getFundId();
             String priceDate = DateUtils.format(emailFundNavDO.getPriceDate(), DateUtils.YYYY_MM_DD);
             //上一期单位净值
-            NavDO preNavDO = navMapper.queryLastNavByFundIdDate(fundId,priceDate);
+            NavDO preNavDO = navMapper.queryLastNavByFundIdDate(fundId,priceDate,emailFundNavDO.getChannelId());
             if(preNavDO == null){
                 saveEmailFundNav(emailFundNavDO,NavParseStatusConst.SUCCESS,1);
                 saveEmailFundNavToNav(emailFundNavDO);
@@ -102,7 +102,7 @@ public class NavAmplitudeTask {
     private void saveEmailFundNavToNav(EmailFundNavDO emailFundNavDO) {
         String fundId = emailFundNavDO.getFundId();
         String priceDate = DateUtils.format(emailFundNavDO.getPriceDate(), DateUtils.YYYY_MM_DD);
-        NavDO oldNavDO = navMapper.queryNavByFundIdDate(fundId,priceDate);
+        NavDO oldNavDO = navMapper.queryNavByFundIdDate(fundId,priceDate,emailFundNavDO.getChannelId());
         if(oldNavDO != null){
             oldNavDO.setNav(emailFundNavDO.getNav());
             oldNavDO.setCumulativeNavWithdrawal(emailFundNavDO.getCumulativeNavWithdrawal());