浏览代码

feat:用户渠道绑定功能开发,渠道展示权限控制

chenjianhua 2 月之前
父节点
当前提交
241eb87b3a
共有 22 个文件被更改,包括 274 次插入34 次删除
  1. 1 1
      service-base/src/main/java/com/simuwang/base/components/UserAuthService.java
  2. 4 0
      service-base/src/main/java/com/simuwang/base/mapper/daq/ChannelMapper.java
  3. 10 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/query/ChannelPageQuery.java
  4. 10 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/query/DeletionPageQuery.java
  5. 10 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/query/DistributionPageQuery.java
  6. 6 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/query/FundNavAssetPageQuery.java
  7. 22 0
      service-base/src/main/java/com/simuwang/base/pojo/dto/query/ParseDetailPageQuery.java
  8. 35 12
      service-base/src/main/resources/mapper/daq/ChannelMapper.xml
  9. 16 2
      service-base/src/main/resources/mapper/daq/DeletionInfoMapper.xml
  10. 18 4
      service-base/src/main/resources/mapper/daq/DistributionMapper.xml
  11. 24 4
      service-base/src/main/resources/mapper/daq/EmailFundAssetMapper.xml
  12. 22 2
      service-base/src/main/resources/mapper/daq/EmailFundNavMapper.xml
  13. 25 4
      service-base/src/main/resources/mapper/daq/FundNavAssetMapper.xml
  14. 1 0
      service-base/src/main/resources/mapper/daq/system/SysUserMapper.xml
  15. 13 1
      service-manage/src/main/java/com/simuwang/manage/api/channel/ChannelController.java
  16. 2 0
      service-manage/src/main/java/com/simuwang/manage/service/ChannelService.java
  17. 18 0
      service-manage/src/main/java/com/simuwang/manage/service/impl/ChannelServiceImpl.java
  18. 8 0
      service-manage/src/main/java/com/simuwang/manage/service/impl/DeletionServiceImpl.java
  19. 8 0
      service-manage/src/main/java/com/simuwang/manage/service/impl/DistributionServiceImpl.java
  20. 8 0
      service-manage/src/main/java/com/simuwang/manage/service/impl/FundNavAssetServiceImpl.java
  21. 12 0
      service-manage/src/main/java/com/simuwang/manage/service/impl/ParseEmailDetailServiceImpl.java
  22. 1 4
      service-manage/src/main/java/com/simuwang/manage/service/impl/UserChannelMappingServiceImpl.java

+ 1 - 1
service-base/src/main/java/com/simuwang/base/components/UserAuthService.java

@@ -132,7 +132,7 @@ public class UserAuthService {
      * @param userId 用户id
      * @return /
      */
-    private boolean isAdmin(Integer userId) {
+    public boolean isAdmin(Integer userId) {
         if (Objects.equals(0, userId) || Objects.equals(1, userId)) {
             return true;
         }

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

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

+ 10 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/query/ChannelPageQuery.java

@@ -6,6 +6,16 @@ public class ChannelPageQuery extends PageQuery {
 
     private String channelName;
 
+    private Integer userId ;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
     public String getChannelName() {
         return channelName;
     }

+ 10 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/query/DeletionPageQuery.java

@@ -35,6 +35,16 @@ public class DeletionPageQuery extends PageQuery {
      */
     private Integer deletionEndNum;
 
+    private Integer userId;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
     public String getFundName() {
         return fundName;
     }

+ 10 - 0
service-base/src/main/java/com/simuwang/base/pojo/dto/query/DistributionPageQuery.java

@@ -35,6 +35,16 @@ public class DistributionPageQuery extends PageQuery {
      */
     private String endDate;
 
+    private Integer userId;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
     public String getFundName() {
         return fundName;
     }

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

@@ -17,6 +17,10 @@ public class FundNavAssetPageQuery extends PageQuery {
      */
     private String fundName;
     /**
+     * 备案编码
+     */
+    private String registerNumber;
+    /**
      * 净值开始日期
      */
     private String priceStartDate;
@@ -41,4 +45,6 @@ public class FundNavAssetPageQuery extends PageQuery {
      * 渠道名称
      */
     private String channelName;
+
+    private Integer userId;
 }

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

@@ -16,6 +16,10 @@ public class ParseDetailPageQuery extends PageQuery {
      */
     private String fundName;
     /**
+     * 备案编码
+     */
+    private String registerNumber;
+    /**
      * 净值开始日期
      */
     private String priceStartDate;
@@ -45,6 +49,8 @@ public class ParseDetailPageQuery extends PageQuery {
      * 邮件标题
      */
     private String emailTitle;
+
+    private Integer userId;
     /**
      * 邮件ID
      */
@@ -110,6 +116,22 @@ public class ParseDetailPageQuery extends PageQuery {
         this.exceptionStatusList = exceptionStatusList;
     }
 
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getRegisterNumber() {
+        return registerNumber;
+    }
+
+    public void setRegisterNumber(String registerNumber) {
+        this.registerNumber = registerNumber;
+    }
+
     public Integer getIsStore() {
         return isStore;
     }

+ 35 - 12
service-base/src/main/resources/mapper/daq/ChannelMapper.xml

@@ -34,13 +34,39 @@
     <select id="searchChannelList" resultMap="BasePageResultMap">
         select info.id,
                info.channel_name,
-               info.channel_remark,
-               wm_concat(e.email) as email,
-               info.createtime,
-               info.updatetime,
-               info.isvalid,
-               info.creatorid,
-               info.updaterid
+               info.channel_remark
+        from channel_info info
+        join user_channel_mapping e
+        on info.id = e.channel_id
+        where info.isvalid=1 and e.isvalid=1
+        <if test="userId !=null and userId !=''">
+            and e.user_id=#{userId}
+        </if>
+        group by info.id,info.channel_name,info.channel_remark
+        limit #{offset},#{pageSize}
+    </select>
+    <select id="countChannelInfo" resultType="java.lang.Long">
+        select count(distinct info.id) from channel_info info
+        join user_channel_mapping e
+        on info.id = e.channel_id
+        where info.isvalid=1 and e.isvalid=1
+        <if test="userId !=null and userId !=''">
+            and e.user_id=#{userId}
+        </if>
+    </select>
+    <select id="selectChannelIdByEmail" resultType="java.lang.Integer">
+        select channel_id from channel_email_info where isvalid=1 and email=#{email}
+    </select>
+    <select id="searchChannelPage" resultMap="BasePageResultMap">
+        select info.id,
+        info.channel_name,
+        info.channel_remark,
+        wm_concat(e.email) as email,
+        info.createtime,
+        info.updatetime,
+        info.isvalid,
+        info.creatorid,
+        info.updaterid
         from channel_info info
         left join channel_email_info e
         on info.id = e.channel_id and e.isvalid=1
@@ -52,13 +78,10 @@
         order by info.createtime
         limit #{offset},#{pageSize}
     </select>
-    <select id="countChannelInfo" resultType="java.lang.Long">
+    <select id="countChannelInfoPage" resultType="java.lang.Long">
         select count(*) from channel_info where isvalid=1
         <if test="channelName != null and channelName !=''">
-            and  info.channel_name like concat('%',#{channelName},'%')
+            and 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>

+ 16 - 2
service-base/src/main/resources/mapper/daq/DeletionInfoMapper.xml

@@ -91,9 +91,16 @@
         ON d.fund_id = info.fund_id and info.isvalid=1
         LEFT JOIN pvn_company_info c
         ON info.trust_id = c.company_id and c.isvalid=1
-        left join channel_info ci
+        join channel_info ci
         on ci.id = d.channel_id and ci.isvalid=1
+        <if test="userId != null and userId !=''">
+            join user_channel_mapping ucm
+            on ucm.channel_id = ci.id and ucm.isvalid=1
+        </if>
         WHERE 1=1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="companyName != null and companyName !=''">
             and (c.company_name like concat('%',#{companyName},'%') or c.company_short_name like concat('%',#{companyName},'%'))
         </if>
@@ -130,9 +137,16 @@
         ON d.fund_id = info.fund_id and info.isvalid=1
         LEFT JOIN pvn_company_info c
         ON info.trust_id = c.company_id and c.isvalid=1
-        left join channel_info ci
+        join channel_info ci
         on ci.id = d.channel_id and ci.isvalid=1
+        <if test="userId != null and userId !=''">
+            join user_channel_mapping ucm
+            on ucm.channel_id = ci.id and ucm.isvalid=1
+        </if>
         WHERE 1=1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="companyName != null and companyName !=''">
             and (c.company_name like concat(#{companyName},'%') or c.company_short_name like concat(#{companyName},'%'))
         </if>

+ 18 - 4
service-base/src/main/resources/mapper/daq/DistributionMapper.xml

@@ -77,10 +77,17 @@
             JOIN nav n
             ON n.fund_id = d.fund_id and d.distribute_date=n.price_date
             AND n.isvalid = 1 and d.channel_id=n.channel_id
-            left join channel_info ci
+            join channel_info ci
             on ci.id = d.channel_id and ci.isvalid=1
+            <if test="userId != null and userId !=''">
+                join user_channel_mapping ucm
+                on ucm.channel_id = ci.id and ucm.isvalid=1
+            </if>
         WHERE d.isvalid = 1
             AND info.isvalid = 1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="companyName != null and companyName !=''">
             and (c.company_name like concat('%',#{companyName},'%') or c.company_short_name like concat('%',#{companyName},'%'))
         </if>
@@ -120,10 +127,17 @@
         ON info.trust_id = c.company_id AND c.isvalid = 1
         JOIN nav n
         ON n.fund_id = d.fund_id and d.distribute_date=n.price_date  and n.channel_id = n.channel_id
-        left join channel_info ci
+        join channel_info ci
         on ci.id = d.channel_id and ci.isvalid=1
-        WHERE d.isvalid = 1 AND info.isvalid = 1
-        AND n.isvalid = 1
+        <if test="userId != null and userId !=''">
+            join user_channel_mapping ucm
+            on ucm.channel_id = ci.id and ucm.isvalid=1
+        </if>
+        WHERE d.isvalid = 1
+        AND info.isvalid = 1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="companyName != null and companyName !=''">
             and (c.company_name like concat('%',#{companyName},'%') or c.company_short_name like concat('%',#{companyName},'%'))
         </if>

+ 24 - 4
service-base/src/main/resources/mapper/daq/EmailFundAssetMapper.xml

@@ -71,9 +71,19 @@
         on file.email_id = parse.id
         join channel_info c
         on asset.channel_id=c.id and c.isvalid=1
+        <if test="userId != null and userId !=''">
+            join user_channel_mapping ucm
+            on ucm.channel_id = c.id and ucm.isvalid=1
+        </if>
         where asset.isvalid=1 and file.isvalid=1 and parse.isvalid=1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="fundName != null and fundName !=''">
-            and (asset.fund_name like concat(#{fundName},'%') or asset.register_number like concat(#{fundName},'%'))
+            and (asset.fund_name like concat(#{fundName},'%'))
+        </if>
+        <if test="registerNumber != null and registerNumber !=''">
+            and (asset.register_number like concat(#{registerNumber},'%'))
         </if>
         <if test="priceStartDate != null and priceStartDate !=''">
             and asset.price_date >= #{priceStartDate}
@@ -134,11 +144,21 @@
         on asset.file_id = file.id
         join email_parse_info parse
         on file.email_id = parse.id
-        left join pvn_fund_info info
-        on asset.fund_id=info.fund_id and info.isvalid=1
+        join channel_info c
+        on asset.channel_id=c.id and c.isvalid=1
+        <if test="userId != null and userId !=''">
+            join user_channel_mapping ucm
+            on ucm.channel_id = c.id and ucm.isvalid=1
+        </if>
         where asset.isvalid=1 and file.isvalid=1 and parse.isvalid=1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="fundName != null and fundName !=''">
-            and (asset.fund_name like concat('%',#{fundName},'%') or asset.register_number like concat('%',#{fundName},'%'))
+            and (asset.fund_name like concat('%',#{fundName},'%'))
+        </if>
+        <if test="registerNumber != null and registerNumber !=''">
+            and (asset.register_number like concat(#{registerNumber},'%'))
         </if>
         <if test="priceStartDate != null and priceStartDate !=''">
             and asset.price_date >= #{priceStartDate}

+ 22 - 2
service-base/src/main/resources/mapper/daq/EmailFundNavMapper.xml

@@ -117,9 +117,19 @@
                 on file.email_id = parse.id
             join channel_info c
                 on nav.channel_id=c.id and c.isvalid=1
+            <if test="userId != null and userId !=''">
+                join user_channel_mapping ucm
+                on ucm.channel_id = c.id and ucm.isvalid=1
+            </if>
         WHERE nav.isvalid = 1  and file.isvalid=1 and parse.isvalid=1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="fundName != null and fundName !=''">
-            and (nav.fund_name like concat(#{fundName},'%') or nav.register_number like concat(#{fundName},'%'))
+            and (nav.fund_name like concat(#{fundName},'%'))
+        </if>
+        <if test="registerNumber != null and registerNumber !=''">
+            and (nav.register_number like concat(#{registerNumber},'%'))
         </if>
         <if test="priceStartDate != null and priceStartDate !=''">
             and nav.price_date >= #{priceStartDate}
@@ -175,9 +185,19 @@
         on file.email_id = parse.id
         join channel_info c
         on nav.channel_id=c.id and c.isvalid=1
+        <if test="userId != null and userId !=''">
+            join user_channel_mapping ucm
+            on ucm.channel_id = c.id and ucm.isvalid=1
+        </if>
         WHERE nav.isvalid = 1  and file.isvalid=1 and parse.isvalid=1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="fundName != null and fundName !=''">
-            and (nav.fund_name like concat(#{fundName},'%') or nav.register_number like concat(#{fundName},'%'))
+            and (nav.fund_name like concat(#{fundName},'%'))
+        </if>
+        <if test="registerNumber != null and registerNumber !=''">
+            and (nav.register_number like concat(#{registerNumber},'%'))
         </if>
         <if test="priceStartDate != null and priceStartDate !=''">
             and nav.price_date >= #{priceStartDate}

+ 25 - 4
service-base/src/main/resources/mapper/daq/FundNavAssetMapper.xml

@@ -16,7 +16,7 @@
     </resultMap>
     <select id="searchNavAssetList" resultMap="BaseResultMap"
             parameterType="com.simuwang.base.pojo.dto.query.FundNavAssetPageQuery">
-        SELECT distinct
+        SELECT
         info.fund_id,
         info.fund_short_name,
         info.register_number,
@@ -36,11 +36,21 @@
         ON nav.fund_id = asset.fund_id
         AND nav.price_date = asset.price_date
         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
+        join channel_info c on c.id = nav.channel_id and c.isvalid=1
+        <if test="userId != null and userId !=''">
+            join user_channel_mapping ucm
+            on ucm.channel_id = c.id and ucm.isvalid=1
+        </if>
         WHERE info.isvalid = 1
         AND nav.isvalid = 1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="fundName != null and fundName !=''">
-            and (info.fund_name like concat('%',#{fundName},'%') or info.fund_short_name like concat('%',#{fundName},'%') or info.register_number like concat('%',#{fundName},'%'))
+            and (info.fund_name like concat(#{fundName},'%') or info.fund_short_name like concat(#{fundName},'%'))
+        </if>
+        <if test="registerNumber != null and registerNumber !=''">
+            and (info.register_number like concat(#{registerNumber},'%'))
         </if>
         <if test="priceStartDate != null and priceStartDate !=''">
             and (nav.price_date >= #{priceStartDate} or asset.price_date >= #{priceStartDate})
@@ -81,10 +91,21 @@
         ON nav.fund_id = asset.fund_id
         AND nav.price_date = asset.price_date
         AND asset.isvalid = 1
+        join channel_info c on c.id = nav.channel_id and c.isvalid=1
+        <if test="userId != null and userId !=''">
+            join user_channel_mapping ucm
+            on ucm.channel_id = c.id and ucm.isvalid=1
+        </if>
         WHERE info.isvalid = 1
         AND nav.isvalid = 1
+        <if test="userId != null and userId !=''">
+            and ucm.user_id =#{userId}
+        </if>
         <if test="fundName != null and fundName !=''">
-            and (info.fund_name like concat('%',#{fundName},'%') or info.fund_short_name like concat('%',#{fundName},'%') or info.register_number like concat('%',#{fundName},'%'))
+            and (info.fund_name like concat(#{fundName},'%') or info.fund_short_name like concat(#{fundName},'%'))
+        </if>
+        <if test="registerNumber != null and registerNumber !=''">
+            and (info.register_number like concat(#{registerNumber},'%'))
         </if>
         <if test="priceStartDate != null and priceStartDate !=''">
             and (nav.price_date >= #{priceStartDate} or asset.price_date >= #{priceStartDate})

+ 1 - 0
service-base/src/main/resources/mapper/daq/system/SysUserMapper.xml

@@ -196,6 +196,7 @@
                su.updatetime as updateTime,
                su.email,
                su.sex,
+               su.status,
                su.user_id as userId,
                su.user_name as userName,
                su.user_type as userType,

+ 13 - 1
service-manage/src/main/java/com/simuwang/manage/api/channel/ChannelController.java

@@ -76,7 +76,7 @@ public class ChannelController {
      * @param  channelPageQuery
      * @return
      */
-    @SystemLog(value = "查询渠道信息")
+    @SystemLog(value = "查询渠道信息下拉框")
     @RequestMapping("search-channel-list")
     public MybatisPage<ChannelPageInfoVO> searchChannelList(ChannelPageQuery channelPageQuery){
         MybatisPage<ChannelPageInfoVO> result = channelService.searchChannelList(channelPageQuery);
@@ -84,6 +84,18 @@ public class ChannelController {
     }
 
     /**
+     * 查询渠道信息
+     * @param  channelPageQuery
+     * @return
+     */
+    @SystemLog(value = "查询渠道信息")
+    @RequestMapping("search-channel-page")
+    public MybatisPage<ChannelPageInfoVO> searchChannelPage(ChannelPageQuery channelPageQuery){
+        MybatisPage<ChannelPageInfoVO> result = channelService.searchChannelPage(channelPageQuery);
+        return result;
+    }
+
+    /**
      * 查询渠道邮件
      * @param  channelIdPageQuery
      * @return

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

@@ -20,6 +20,8 @@ public interface ChannelService {
 
     MybatisPage<ChannelPageInfoVO> searchChannelList(ChannelPageQuery channelPageQuery);
 
+    MybatisPage<ChannelPageInfoVO> searchChannelPage(ChannelPageQuery channelPageQuery);
+
     ResultVo deleteChannelEmail(Integer id);
 
     MybatisPage<ChannelEmailInfoVO> searchChannelEmailList(ChannelIdPageQuery channelIdPageQuery);

+ 18 - 0
service-manage/src/main/java/com/simuwang/manage/service/impl/ChannelServiceImpl.java

@@ -2,6 +2,7 @@ package com.simuwang.manage.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import com.simuwang.base.common.support.MybatisPage;
+import com.simuwang.base.components.UserAuthService;
 import com.simuwang.base.mapper.daq.ChannelEmailMapper;
 import com.simuwang.base.mapper.daq.ChannelMapper;
 import com.simuwang.base.pojo.dos.ChannelEmailInfoDO;
@@ -35,6 +36,10 @@ public class ChannelServiceImpl implements ChannelService {
 
     @Autowired
     private ChannelEmailMapper channelEmailMapper;
+    @Autowired
+    private UserAuthService UserAuthService;
+    @Autowired
+    private UserAuthService userAuthService;
 
     @Override
     public ResultVo saveChannel(ChannelInfoVO channel) {
@@ -106,6 +111,11 @@ public class ChannelServiceImpl implements ChannelService {
 
     @Override
     public MybatisPage<ChannelPageInfoVO> searchChannelList(ChannelPageQuery channelPageQuery) {
+        Integer userId = UserUtils.getLoginUser().getUserId();
+        if(!userAuthService.isAdmin(userId)){
+            //非管理员,需要刷选匹配的渠道
+            channelPageQuery.setUserId(userId);
+        }
         List<ChannelPageInfoDO> dataList = channelMapper.searchChannelList(channelPageQuery);
         List<ChannelPageInfoVO> voList = dataList.stream().filter(Objects::nonNull).map(ChannelPageInfoDO::toVo).collect(Collectors.toList());
         long total = channelMapper.countChannelInfo(channelPageQuery);
@@ -113,6 +123,14 @@ public class ChannelServiceImpl implements ChannelService {
     }
 
     @Override
+    public MybatisPage<ChannelPageInfoVO> searchChannelPage(ChannelPageQuery channelPageQuery) {
+        List<ChannelPageInfoDO> dataList = channelMapper.searchChannelPage(channelPageQuery);
+        List<ChannelPageInfoVO> voList = dataList.stream().filter(Objects::nonNull).map(ChannelPageInfoDO::toVo).collect(Collectors.toList());
+        long total = channelMapper.countChannelInfoPage(channelPageQuery);
+        return MybatisPage.of(total, voList);
+    }
+
+    @Override
     public ResultVo deleteChannelEmail(Integer id) {
         ResultVo vo = new ResultVo(ResultCode.DELETE_SUCCESS.getCode());
         Integer userId = UserUtils.getLoginUser().getUserId();

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

@@ -7,6 +7,7 @@ import com.simuwang.base.common.enums.Frequency;
 import com.simuwang.base.common.support.MybatisPage;
 import com.simuwang.base.common.util.DateUtils;
 import com.simuwang.base.common.util.StringUtil;
+import com.simuwang.base.components.UserAuthService;
 import com.simuwang.base.mapper.daq.*;
 import com.simuwang.base.pojo.dos.*;
 import com.simuwang.base.pojo.dto.DeletionDownParam;
@@ -67,8 +68,15 @@ public class DeletionServiceImpl implements DeletionService {
     @Autowired
     private DeletionTypeStatisticsMapper deletionTypeStatisticsMapper;
 
+    @Autowired
+    private UserAuthService userAuthService;
+
     @Override
     public MybatisPage<DeletionInfoVO> searchDeletionList(DeletionPageQuery deletionPageQuery) {
+        Integer userId = UserUtils.getLoginUser().getUserId();
+        if(!userAuthService.isAdmin(userId)){
+            deletionPageQuery.setUserId(userId);
+        }
         List<DeletionInfoDO> deletionInfoDOList = deletionInfoMapper.searchDeletionList(deletionPageQuery);
         long total = deletionInfoMapper.countDeletion(deletionPageQuery);
         List<DeletionInfoVO> dataList = deletionInfoDOList.stream().map(DeletionInfoDO::toVO).collect(Collectors.toList());

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

@@ -12,6 +12,7 @@ import com.simuwang.base.common.util.DateUtils;
 import com.simuwang.base.common.util.ExcelUtil;
 import com.simuwang.base.common.util.FileUtil;
 import com.simuwang.base.common.util.StringUtil;
+import com.simuwang.base.components.UserAuthService;
 import com.simuwang.base.mapper.daq.DistributionMapper;
 import com.simuwang.base.mapper.daq.FundInfoMapper;
 import com.simuwang.base.mapper.daq.NavMapper;
@@ -63,10 +64,17 @@ public class DistributionServiceImpl implements DistributionService {
     @Autowired
     private FundInfoMapper fundInfoMapper;
 
+    @Autowired
+    private UserAuthService userAuthService;
+
     @Value("${email.file.path}")
     private String path;
     @Override
     public MybatisPage<DistributionTablePageVO> searchDistributionList(DistributionPageQuery distributionPageQuery) {
+        Integer userId = UserUtils.getLoginUser().getUserId();
+        if(!userAuthService.isAdmin(userId)){
+            distributionPageQuery.setUserId(userId);
+        }
         List<DistributionTablePageDO> distributionTablePageDOList = distributionMapper.searchDistributionList(distributionPageQuery);
         List<DistributionTablePageVO> distributionTablePageVOList = distributionTablePageDOList.stream().map(DistributionTablePageDO::toVo).collect(Collectors.toList());
         long total = distributionMapper.countDistributionList(distributionPageQuery);

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

@@ -8,6 +8,7 @@ import com.simuwang.base.common.enums.DistributeType;
 import com.simuwang.base.common.support.MybatisPage;
 import com.simuwang.base.common.util.DateUtils;
 import com.simuwang.base.common.util.StringUtil;
+import com.simuwang.base.components.UserAuthService;
 import com.simuwang.base.mapper.daq.*;
 import com.simuwang.base.pojo.dos.AssetDO;
 import com.simuwang.base.pojo.dos.FundNavAssetDO;
@@ -60,11 +61,18 @@ public class FundNavAssetServiceImpl implements FundNavAssetService {
     @Autowired
     private ChannelService channelService;
 
+    @Autowired
+    private UserAuthService userAuthService;
+
     @Value("${email.file.path}")
     private String path;
     private static final Logger logger = LoggerFactory.getLogger(FundNavAssetServiceImpl.class);
     @Override
     public MybatisPage<FundNavAssetVO> searchNavAssetList(FundNavAssetPageQuery fundNavAssetPageQuery) {
+        Integer userId = UserUtils.getLoginUser().getUserId();
+        if(!userAuthService.isAdmin(userId)){
+            fundNavAssetPageQuery.setUserId(userId);
+        }
         List<FundNavAssetDO> fundNavAssetDOList = fundNavAssetMapper.searchNavAssetList(fundNavAssetPageQuery);
         List<FundNavAssetVO> fundNavAssetVOList = fundNavAssetDOList.stream().map(FundNavAssetDO::toVo).collect(Collectors.toList());
         long total = fundNavAssetMapper.countNavAssetList(fundNavAssetPageQuery);

+ 12 - 0
service-manage/src/main/java/com/simuwang/manage/service/impl/ParseEmailDetailServiceImpl.java

@@ -5,6 +5,7 @@ import com.simuwang.base.common.enums.NavReviewStatus;
 import com.simuwang.base.common.support.MybatisPage;
 import com.simuwang.base.common.util.DateUtils;
 import com.simuwang.base.common.util.StringUtil;
+import com.simuwang.base.components.UserAuthService;
 import com.simuwang.base.mapper.daq.*;
 import com.simuwang.base.pojo.dos.*;
 import com.simuwang.base.pojo.dto.query.ParseDetailPageQuery;
@@ -44,8 +45,15 @@ public class ParseEmailDetailServiceImpl implements ParseEmailDetailService {
     @Autowired
     private FundInformationService fundInformationService;
 
+    @Autowired
+    private UserAuthService userAuthService;
+
     @Override
     public MybatisPage<EmailFundNavVO> searchNavDetail(ParseDetailPageQuery parseDetailPageQuery) {
+        Integer userId = UserUtils.getLoginUser().getUserId();
+        if(!userAuthService.isAdmin(userId)){
+            parseDetailPageQuery.setUserId(userId);
+        }
         if(StringUtil.isNotEmpty(parseDetailPageQuery.getUpdateEndDate())){
             parseDetailPageQuery.setUpdateEndDate(DateUtil.getAroundDate(DateUtils.parse(parseDetailPageQuery.getUpdateEndDate(),DateUtils.YYYY_MM_DD),1));
         }
@@ -67,6 +75,10 @@ public class ParseEmailDetailServiceImpl implements ParseEmailDetailService {
 
     @Override
     public MybatisPage<EmailFundAssetVO> searchAssetDetail(ParseDetailPageQuery parseDetailPageQuery) {
+        Integer userId = UserUtils.getLoginUser().getUserId();
+        if(!userAuthService.isAdmin(userId)){
+            parseDetailPageQuery.setUserId(userId);
+        }
         if(StringUtil.isNotEmpty(parseDetailPageQuery.getUpdateEndDate())){
             parseDetailPageQuery.setUpdateEndDate(DateUtil.getAroundDate(DateUtils.parse(parseDetailPageQuery.getUpdateEndDate(),DateUtils.YYYY_MM_DD),1));
         }

+ 1 - 4
service-manage/src/main/java/com/simuwang/manage/service/impl/UserChannelMappingServiceImpl.java

@@ -31,10 +31,7 @@ public class UserChannelMappingServiceImpl implements UserChannelMappingService
         Integer loginUserId = UserUtils.getLoginUser().getUserId();
         try{
             List<UserChannelMappingDO> userChannelMappingDOS = new ArrayList<>();
-            if(channelIdList.isEmpty()){
-                //表示删除
-                userChannelMappingMapper.removeUserChannel(userId,loginUserId);
-            }
+            userChannelMappingMapper.removeUserChannel(userId,loginUserId);
             for (Integer channelId : channelIdList) {
                 UserChannelMappingDO userChannelMappingDO = new UserChannelMappingDO();
                 userChannelMappingDO.setUserId(userId);