Pārlūkot izejas kodu

feat:渠道绑定责任岗功能开发

chenjianhua 3 nedēļas atpakaļ
vecāks
revīzija
f06df097d9

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

@@ -11,6 +11,7 @@ import java.util.List;
 
 @Mapper
 public interface ChannelEmailMapper extends BaseMapper<ChannelEmailInfoDO> {
+
     void deleteByChannelId(@Param("channelId") Integer id,@Param("userId") Integer userId);
 
     ChannelEmailInfoDO selectByEmail(@Param("email") String email);

+ 21 - 0
service-base/src/main/java/com/simuwang/base/mapper/daq/ChannelResponbilityMapper.java

@@ -0,0 +1,21 @@
+package com.simuwang.base.mapper.daq;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.simuwang.base.pojo.dos.ChannelEmailInfoDO;
+import com.simuwang.base.pojo.dos.ChannelResponsibilityInfoDO;
+import com.simuwang.base.pojo.dto.query.ChannelIdPageQuery;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface ChannelResponbilityMapper extends BaseMapper<ChannelEmailInfoDO> {
+
+
+    ChannelResponsibilityInfoDO select(ChannelResponsibilityInfoDO channelResponsibilityInfoDO);
+
+    void updateChannelResponsibilityInfoDO(ChannelResponsibilityInfoDO channelResponsibilityInfoDO);
+
+    void saveChannelResponsibilityInfoDO(ChannelResponsibilityInfoDO channelResponsibilityInfoDO);
+}

+ 15 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/ChannelPageInfoDO.java

@@ -21,6 +21,18 @@ public class ChannelPageInfoDO {
      */
     private String channelName;
     /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 用户名称
+     */
+    private String userName;
+    /**
+     * 责任岗绑定邮箱
+     */
+    private String responbilityEmail;
+    /**
      * 邮箱地址
      */
     private String email;
@@ -50,6 +62,9 @@ public class ChannelPageInfoDO {
         vo.setUpdateTime(DateUtils.format(updateTime,DateUtils.YYYY_MM_DD_HH_MM_SS));
         vo.setCreatorId(creatorId);
         vo.setUpdaterId(updaterId);
+        vo.setResponbilityEmail(responbilityEmail);
+        vo.setUserName(userName);
+        vo.setUserId(userId);
         return vo;
     }
 }

+ 36 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/ChannelResponsibilityInfoDO.java

@@ -0,0 +1,36 @@
+package com.simuwang.base.pojo.dos;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ChannelResponsibilityInfoDO {
+    /**
+     * ID
+     */
+    private Integer id;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 渠道ID
+     */
+    private Integer channelId;
+    /**
+     * 邮箱地址
+     */
+    private String email;
+
+    private Integer isvalid;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    private Integer creatorId;
+
+    private Integer updaterId;
+}

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

@@ -13,6 +13,10 @@ import lombok.Data;
 public class FundNavAssetPageQuery extends PageQuery {
 
     /**
+     * 基金ID
+     */
+    private String fundId;
+    /**
      * 基金名称
      */
     private String fundName;

+ 12 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/ChannelPageInfoVO.java

@@ -15,6 +15,18 @@ public class ChannelPageInfoVO {
      */
     private String channelName;
     /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 用户名称
+     */
+    private String userName;
+    /**
+     * 责任岗绑定邮箱
+     */
+    private String responbilityEmail;
+    /**
      * 邮箱地址
      */
     private String email;

+ 33 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/ChannelResponsibilityInfoVO.java

@@ -0,0 +1,33 @@
+package com.simuwang.base.pojo.vo;
+
+import lombok.Data;
+
+@Data
+public class ChannelResponsibilityInfoVO {
+    /**
+     * ID
+     */
+    private Integer id;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 渠道ID
+     */
+    private Integer channelId;
+    /**
+     * 邮箱地址
+     */
+    private String email;
+
+    private Integer isvalid;
+
+    private String createTime;
+
+    private String updateTime;
+
+    private Integer creatorId;
+
+    private Integer updaterId;
+}

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

@@ -22,6 +22,9 @@
     <resultMap id="BasePageResultMap" type="com.simuwang.base.pojo.dos.ChannelPageInfoDO" >
         <id column="id" property="id" jdbcType="INTEGER" />
         <result column="channel_name" property="channelName" jdbcType="VARCHAR" />
+        <result column="user_name" property="userName" jdbcType="VARCHAR" />
+        <result column="user_id" property="userId" jdbcType="VARCHAR" />
+        <result column="responbility_email" property="responbilityEmail" jdbcType="VARCHAR" />
         <result column="email" property="email" jdbcType="VARCHAR" />
         <result column="channel_remark" property="channelRemark" jdbcType="VARCHAR" />
         <result column="creatorid" property="creatorId" jdbcType="INTEGER" />
@@ -66,10 +69,17 @@
         info.updatetime,
         info.isvalid,
         info.creatorid,
-        info.updaterid
+        info.updaterid,
+        su.user_id,
+        su.user_name,
+        crm.email as responbility_email
         from channel_info info
         left join channel_email_info e
         on info.id = e.channel_id and e.isvalid=1
+        left join channel_responsibility_mapping crm
+        on crm.channel_id = info.id and crm.isvalid=1
+        left join sys_user su
+        on su.user_id = crm.user_id and su.isvalid=1
         where info.isvalid=1
         <if test="channelName != null and channelName !=''">
             and info.channel_name like concat('%',#{channelName},'%')

+ 28 - 0
service-base/src/main/resources/mapper/daq/ChannelResponbilityMapper.xml

@@ -0,0 +1,28 @@
+<?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.daq.ChannelResponbilityMapper">
+
+    <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.ChannelResponsibilityInfoDO" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="channel_id" property="channelId" jdbcType="VARCHAR" />
+        <result column="user_id" property="userId" jdbcType="VARCHAR" />
+        <result column="email" property="email" jdbcType="VARCHAR" />
+        <result column="creatorid" property="creatorId" jdbcType="INTEGER" />
+        <result column="createtime" property="createTime" jdbcType="TIMESTAMP" />
+        <result column="updaterid" property="updaterId" jdbcType="INTEGER" />
+        <result column="updatetime" property="updateTime" jdbcType="TIMESTAMP" />
+        <result column="isvalid" property="isvalid" jdbcType="INTEGER" />
+    </resultMap>
+    <insert id="saveChannelResponsibilityInfoDO">
+        insert into channel_responsibility_mapping(channel_id,user_id,email,creatorid,createtime,updaterid,updatetime,isvalid)
+        values (#{channelId},#{userId},#{email},#{creatorId},#{createTime},#{updaterId},#{updateTime},1)
+    </insert>
+    <update id="updateChannelResponsibilityInfoDO">
+        update channel_responsibility_mapping set user_id=#{userId},email=#{email},updaterid=#{updaterId},updatetime=#{updateTime} where id=#{id}
+    </update>
+    <select id="select" resultMap="BaseResultMap">
+        select id,channel_id,user_id,email,creatorid,createtime,updaterid,updatetime,isvalid
+        from channel_responsibility_mapping where channel_id = #{channelId} and isvalid=1
+    </select>
+
+</mapper>

+ 6 - 0
service-base/src/main/resources/mapper/daq/FundNavAssetMapper.xml

@@ -46,6 +46,9 @@
         <if test="userId != null and userId !=''">
             and ucm.user_id =#{userId}
         </if>
+        <if test="fundId != null and fundId !=''">
+            and info.fund_id=#{fundId}
+        </if>
         <if test="fundName != null and fundName !=''">
             and (info.fund_name like concat(#{fundName},'%') or info.fund_short_name like concat(#{fundName},'%'))
         </if>
@@ -101,6 +104,9 @@
         <if test="userId != null and userId !=''">
             and ucm.user_id =#{userId}
         </if>
+        <if test="fundId != null and fundId !=''">
+            and info.fund_id=#{fundId}
+        </if>
         <if test="fundName != null and fundName !=''">
             and (info.fund_name like concat(#{fundName},'%') or info.fund_short_name like concat(#{fundName},'%'))
         </if>

+ 1 - 1
service-daq/src/main/java/com/simuwang/daq/service/ValuationParseService.java

@@ -207,7 +207,7 @@ public class ValuationParseService {
             List<String> contentList = Arrays.stream(headInfo.split("@")).collect(Collectors.toList());
             for (String content : contentList) {
                 String registerNumber = content.length() > 6 ? content.substring(0, 6) : null;
-                if (StrUtil.isNotBlank(registerNumber) && !ValuationDataUtils.hasChinese(registerNumber, false)) {
+                if (StrUtil.isNotBlank(registerNumber) && !ValuationDataUtils.hasChinese(registerNumber, false) && registerNumber.matches("[A-Za-z].*")) {
                     info.setRegisterNumber(registerNumber);
                 }
                 if (content.contains("估值表") || content.contains("专用表")) {

+ 11 - 0
service-manage/src/main/java/com/simuwang/manage/api/channel/ChannelController.java

@@ -48,6 +48,17 @@ public class ChannelController {
     }
 
     /**
+     * 保存渠道责任岗信息
+     * @param channelResponsibilityInfoVO
+     * @return
+     */
+    @SystemLog(value = "保存渠道责任岗信息", type = SystemLog.Type.INSERT)
+    @PostMapping("save-channel-responsibility")
+    public ResultVo saveChannelResponsibility(@RequestBody ChannelResponsibilityInfoVO channelResponsibilityInfoVO) {
+        ResultVo vo = channelService.saveChannelResponsibility(channelResponsibilityInfoVO);
+        return vo;
+    }
+    /**
      * 删除渠道信息
      * @param idListVO
      * @return

+ 1 - 2
service-manage/src/main/java/com/simuwang/manage/api/navAsset/FundNavAssetController.java

@@ -35,8 +35,7 @@ public class FundNavAssetController {
     @SystemLog(value = "基金净值规模页面展示查询")
     @RequestMapping("search-nav-asset-list")
     public MybatisPage<FundNavAssetVO> searchNavAssetList(FundNavAssetPageQuery fundNavAssetPageQuery){
-        MybatisPage<FundNavAssetVO> result = fundNavAssetService.searchNavAssetList(fundNavAssetPageQuery);
-        return result;
+        return fundNavAssetService.searchNavAssetList(fundNavAssetPageQuery);
     }
 
     /**

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

@@ -7,6 +7,7 @@ import com.simuwang.base.pojo.dto.query.ChannelPageQuery;
 import com.simuwang.base.pojo.vo.ChannelEmailInfoVO;
 import com.simuwang.base.pojo.vo.ChannelInfoVO;
 import com.simuwang.base.pojo.vo.ChannelPageInfoVO;
+import com.simuwang.base.pojo.vo.ChannelResponsibilityInfoVO;
 import com.smppw.common.pojo.ResultVo;
 
 import java.util.List;
@@ -27,4 +28,6 @@ public interface ChannelService {
     MybatisPage<ChannelEmailInfoVO> searchChannelEmailList(ChannelIdPageQuery channelIdPageQuery);
 
     boolean existsChannel(String channelId);
+
+    ResultVo saveChannelResponsibility(ChannelResponsibilityInfoVO channelResponsibilityInfoVO);
 }

+ 36 - 10
service-manage/src/main/java/com/simuwang/manage/service/impl/ChannelServiceImpl.java

@@ -5,21 +5,19 @@ 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;
-import com.simuwang.base.pojo.dos.ChannelInfoDO;
-import com.simuwang.base.pojo.dos.ChannelPageInfoDO;
-import com.simuwang.base.pojo.dos.CompanyEmailSendHistoryDO;
+import com.simuwang.base.mapper.daq.ChannelResponbilityMapper;
+import com.simuwang.base.pojo.dos.*;
 import com.simuwang.base.pojo.dto.GetByIdQuery;
 import com.simuwang.base.pojo.dto.query.ChannelIdPageQuery;
 import com.simuwang.base.pojo.dto.query.ChannelPageQuery;
-import com.simuwang.base.pojo.vo.ChannelEmailInfoVO;
-import com.simuwang.base.pojo.vo.ChannelInfoVO;
-import com.simuwang.base.pojo.vo.ChannelPageInfoVO;
-import com.simuwang.base.pojo.vo.CompanyEmailSendHistoryVO;
+import com.simuwang.base.pojo.vo.*;
+import com.simuwang.daq.service.AbstractEmailParser;
 import com.simuwang.manage.service.ChannelService;
 import com.simuwang.shiro.utils.UserUtils;
 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.stereotype.Service;
 
@@ -37,9 +35,10 @@ public class ChannelServiceImpl implements ChannelService {
     @Autowired
     private ChannelEmailMapper channelEmailMapper;
     @Autowired
-    private UserAuthService UserAuthService;
-    @Autowired
     private UserAuthService userAuthService;
+    @Autowired
+    private ChannelResponbilityMapper channelResponbilityMapper;
+    private static final Logger log = LoggerFactory.getLogger(ChannelServiceImpl.class);
 
     @Override
     public ResultVo saveChannel(ChannelInfoVO channel) {
@@ -152,4 +151,31 @@ public class ChannelServiceImpl implements ChannelService {
         ChannelEmailInfoDO channelEmailInfoDO = channelEmailMapper.selectById(channelId);
         return channelEmailInfoDO == null;
     }
+
+    @Override
+    public ResultVo saveChannelResponsibility(ChannelResponsibilityInfoVO channelResponsibilityInfoVO) {
+        ResultVo vo = new ResultVo(ResultCode.SAVE_SUCCESS.getCode());
+        try{
+            ChannelResponsibilityInfoDO channelResponsibilityInfoDO = new ChannelResponsibilityInfoDO();
+            BeanUtil.copyProperties(channelResponsibilityInfoVO, channelResponsibilityInfoDO);
+            Integer userId = UserUtils.getLoginUser().getUserId();
+            channelResponsibilityInfoDO.setUpdaterId(userId);
+            channelResponsibilityInfoDO.setIsvalid(1);
+            channelResponsibilityInfoDO.setUpdateTime(new Date());
+            ChannelResponsibilityInfoDO oldchannelResponsibilityInfoDO = channelResponbilityMapper.select(channelResponsibilityInfoDO);
+            if (oldchannelResponsibilityInfoDO != null) {
+                channelResponsibilityInfoDO.setId(oldchannelResponsibilityInfoDO.getId());
+                channelResponbilityMapper.updateChannelResponsibilityInfoDO(channelResponsibilityInfoDO);
+            }else{
+                channelResponsibilityInfoDO.setCreatorId(userId);
+                channelResponsibilityInfoDO.setCreateTime(new Date());
+                channelResponbilityMapper.saveChannelResponsibilityInfoDO(channelResponsibilityInfoDO);
+            }
+        }catch (Exception e){
+            log.error(e.getMessage(),e);
+            vo.setCode(ResultCode.SAVE_FAILED.getCode());
+            vo.setMsg(e.getMessage());
+        }
+        return vo;
+    }
 }