Przeglądaj źródła

用户档案记录修改记录提交

anderx 1 rok temu
rodzic
commit
7af3aba9bf

+ 2 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -146,5 +146,7 @@ public interface PublicReleaseMapper {
     void updateAssist(InputPublicRelease in);
 
     List<PublicRelease> checkTech(@Param("aid")String aid, @Param("start") Date start, @Param("end")Date end);
+
+    List<MyUserDetailsBo> selectCountByUid(String id);
 }
 

+ 2 - 3
src/main/java/com/goafanti/common/dao/UserArchivesMapper.java

@@ -10,7 +10,7 @@ import java.util.List;
  * 客户档案表(UserArchives)表数据库访问层
  *
  * @author makejava
- * @since 2024-08-12 10:38:57
+ * @since 2024-09-26 09:25:42
  */
 public interface UserArchivesMapper {
 
@@ -22,13 +22,12 @@ public interface UserArchivesMapper {
      */
     UserArchives queryById(Integer id);
 
-    
 
     /**
      * 查询指定行数据
      *
      * @param userArchives 查询条件
-     * @param pageable         分页对象
+     * @param pageable     分页对象
      * @return 对象列表
      */
     List<UserArchives> findUserArchivesList(UserArchives userArchives, @Param("pageable") Pageable pageable);

+ 9 - 1
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -1184,11 +1184,18 @@
           and e.aid =  #{aid}
     </select>
     <select id="selectByUid" resultType="com.goafanti.customer.bo.MyUserDetailsBo">
-        select  a.id ,c.name  aname,a.release_start as releaseStart
+        select  a.id ,a.aid,c.name  aname,a.release_start as releaseStart
         from public_release a  left join admin c on a.aid =c.id
         where  a.status in  (2) and a.type in (0,1,2)
           and a.id in (select DISTINCT prid from public_release_details where uid = #{id})
     </select>
+
+    <select id="selectCountByUid" resultType="com.goafanti.customer.bo.MyUserDetailsBo">
+        select  a.id ,a.aid,c.name  aname,a.release_start as releaseStart,a.duration
+        from public_release a  left join admin c on a.aid =c.id
+        where  a.status in  (2) and
+          and a.id in (select DISTINCT prid from public_release_details where uid = #{id})
+    </select>
     <select id="selectByMainIdAndReviewer" resultMap="PublicReleaseMap">
         select
             a.id, a.aid, a.release_start, a.release_end, a.remarks, a.annex_url, a.status, a.create_time, a.pid, a.pname, a.duration, a.valid_date, a.supplement, a.audit_info, a.plan, a.expected_effect, a.next_plan, a.type, a.order_no, a.update_time, a.update_status, a.assist, a.assist_aid, a.assist_aid_name, a.main_id, a.main_name
@@ -1221,5 +1228,6 @@
             or  (release_start &lt; #{end} and release_end &gt; #{end}))
     </select>
 
+
 </mapper>
 

+ 58 - 29
src/main/java/com/goafanti/common/mapper/UserArchivesMapper.xml

@@ -1,7 +1,6 @@
 <?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.goafanti.common.dao.UserArchivesMapper">
-
     <resultMap type="com.goafanti.common.model.UserArchives" id="UserArchivesMap">
         <result property="id" column="id" jdbcType="INTEGER"/>
         <result property="uid" column="uid" jdbcType="VARCHAR"/>
@@ -18,16 +17,17 @@
         <result property="enterpriseCount" column="enterprise_count" jdbcType="INTEGER"/>
         <result property="channelIndicators" column="channel_indicators" jdbcType="VARCHAR"/>
         <result property="interviewDistribution" column="interview_distribution" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
     </resultMap>
-    
+
     <sql id="UserArchivesAllSql">
-id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution        
+        id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution, update_time
     </sql>
 
     <!--查询单个-->
     <select id="queryById" resultMap="UserArchivesMap">
         select
-          <include refid="UserArchivesAllSql"/>
+        <include refid="UserArchivesAllSql"/>
         from user_archives
         where id = #{id}
     </select>
@@ -35,7 +35,7 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
     <!--查询指定行数据-->
     <select id="findUserArchivesList" resultMap="UserArchivesMap">
         select
-          <include refid="UserArchivesAllSql"/>
+        <include refid="UserArchivesAllSql"/>
 
         from user_archives
         <where>
@@ -84,9 +84,12 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
             <if test="interviewDistribution != null and interviewDistribution != ''">
                 and interview_distribution = #{interviewDistribution}
             </if>
+            <if test="updateTime != null">
+                and update_time = #{updateTime}
+            </if>
         </where>
         <if test="page_sql != null">
-    		${page_sql}
+            ${page_sql}
         </if>
     </select>
 
@@ -140,44 +143,65 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
             <if test="interviewDistribution != null and interviewDistribution != ''">
                 and interview_distribution = #{interviewDistribution}
             </if>
+            <if test="updateTime != null">
+                and update_time = #{updateTime}
+            </if>
         </where>
     </select>
 
     <!--新增所有列-->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
-        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution)
-        values (#{uid}, #{patentCount}, #{inventionPatentCount}, #{utilityModelCount}, #{appearancePatentCount}, #{softwareWorksCount}, #{otherCount}, #{financialData}, #{earlyCommunication}, #{interviewIdeas}, #{createTime}, #{enterpriseCount}, #{channelIndicators}, #{interviewDistribution})
+        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count,
+                                  appearance_patent_count, software_works_count, other_count, financial_data,
+                                  early_communication, interview_ideas, create_time, enterprise_count,
+                                  channel_indicators, interview_distribution, update_time)
+        values (#{uid}, #{patentCount}, #{inventionPatentCount}, #{utilityModelCount}, #{appearancePatentCount},
+                #{softwareWorksCount}, #{otherCount}, #{financialData}, #{earlyCommunication}, #{interviewIdeas},
+                #{createTime}, #{enterpriseCount}, #{channelIndicators}, #{interviewDistribution}, #{updateTime})
     </insert>
 
-    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
-        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution)
+    <insert id="insertBatch">
+        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count,
+        appearance_patent_count, software_works_count, other_count, financial_data, early_communication,
+        interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution, update_time)
         values
         <foreach collection="entities" item="entity" separator=",">
-        (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime}, #{entity.enterpriseCount}, #{entity.channelIndicators}, #{entity.interviewDistribution})
+            (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount},
+            #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount},
+            #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime},
+            #{entity.enterpriseCount}, #{entity.channelIndicators}, #{entity.interviewDistribution},
+            #{entity.updateTime})
         </foreach>
     </insert>
 
     <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
-        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution)
+        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count,
+        appearance_patent_count, software_works_count, other_count, financial_data, early_communication,
+        interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution, update_time)
         values
         <foreach collection="entities" item="entity" separator=",">
-            (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime}, #{entity.enterpriseCount}, #{entity.channelIndicators}, #{entity.interviewDistribution})
+            (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount},
+            #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount},
+            #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime},
+            #{entity.enterpriseCount}, #{entity.channelIndicators}, #{entity.interviewDistribution},
+            #{entity.updateTime})
         </foreach>
         on duplicate key update
-uid = values(uid),
-patent_count = values(patent_count),
-invention_patent_count = values(invention_patent_count),
-utility_model_count = values(utility_model_count),
-appearance_patent_count = values(appearance_patent_count),
-software_works_count = values(software_works_count),
-other_count = values(other_count),
-financial_data = values(financial_data),
-early_communication = values(early_communication),
-interview_ideas = values(interview_ideas),
-create_time = values(create_time),
-enterprise_count = values(enterprise_count),
-channel_indicators = values(channel_indicators),
-interview_distribution = values(interview_distribution)
+        uid = values(uid),
+        patent_count = values(patent_count),
+        invention_patent_count = values(invention_patent_count),
+        utility_model_count = values(utility_model_count),
+        appearance_patent_count = values(appearance_patent_count),
+        software_works_count = values(software_works_count),
+        other_count = values(other_count),
+        financial_data = values(financial_data),
+        early_communication = values(early_communication),
+        interview_ideas = values(interview_ideas),
+        create_time = values(create_time),
+        enterprise_count = values(enterprise_count),
+        channel_indicators = values(channel_indicators),
+        interview_distribution = values(interview_distribution),
+        update_time = values(update_time)
     </insert>
 
     <!--通过主键修改数据-->
@@ -226,13 +250,18 @@ interview_distribution = values(interview_distribution)
             <if test="interviewDistribution != null and interviewDistribution != ''">
                 interview_distribution = #{interviewDistribution},
             </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime},
+            </if>
         </set>
         where id = #{id}
     </update>
 
     <!--通过主键删除-->
     <delete id="deleteById">
-        delete from user_archives where id = #{id}
+        delete
+        from user_archives
+        where id = #{id}
     </delete>
 
     <select id="queryByUid" resultMap="UserArchivesMap">
@@ -252,7 +281,7 @@ interview_distribution = values(interview_distribution)
         e.early_communication as earlyCommunication,e.patent_count as patentCount,
         e.invention_patent_count as inventionPatentCount,e.utility_model_count as utilityModelCount,
         e.appearance_patent_count as appearancePatentCount,e.software_works_count as softwareWorksCount,
-        e.other_count as otherCount
+        e.other_count as otherCount,e.create_time as createTime,e.update_time as updateTime
         from user a left join organization_identity b on a.id =b.uid
                     left join organization_contact_book c on a.id =c.uid and c.major =1
                     left join user_mid d on a.id =d.uid

+ 27 - 15
src/main/java/com/goafanti/common/model/UserArchives.java

@@ -10,66 +10,70 @@ import java.util.Date;
  * 客户档案表(UserArchives)实体类
  *
  * @author makejava
- * @since 2024-08-12 10:38:57
+ * @since 2024-09-26 09:25:42
  */
 public class UserArchives implements Serializable {
-    private static final long serialVersionUID = -61985340141600786L;
+    private static final long serialVersionUID = 270185495568394336L;
 
     private Integer id;
 
     private String uid;
-/**
+    /**
      * 专利数
      */
     private Integer patentCount;
-/**
+    /**
      * 发明专利数
      */
     private Integer inventionPatentCount;
-/**
+    /**
      * 实用新型数
      */
     private Integer utilityModelCount;
-/**
+    /**
      * 外观专利数
      */
     private Integer appearancePatentCount;
-/**
+    /**
      * 软著数
      */
     private Integer softwareWorksCount;
-/**
+    /**
      * 其他数
      */
     private Integer otherCount;
-/**
+    /**
      * 财务数据
      */
     private String financialData;
-/**
+    /**
      * 前期沟通
      */
     private String earlyCommunication;
-/**
+    /**
      * 面谈思路
      */
     private String interviewIdeas;
-/**
+    /**
      * 创建时间
      */
     private Date createTime;
-/**
+    /**
      * 企业数
      */
     private Integer enterpriseCount;
-/**
+    /**
      * 渠道考核指标
      */
     private String channelIndicators;
-/**
+    /**
      * 我方主要面谈及分工
      */
     private String interviewDistribution;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
 
 
     public Integer getId() {
@@ -193,5 +197,13 @@ public class UserArchives implements Serializable {
         this.interviewDistribution = interviewDistribution;
     }
 
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
 }
 

+ 18 - 0
src/main/java/com/goafanti/customer/bo/MyUserDetailsBo.java

@@ -7,10 +7,28 @@ import java.util.Date;
 public class MyUserDetailsBo {
 
     private String id;
+    private String aid;
 
     private Date releaseStart;
 
     private String aname;
+    private Double duration;
+
+    public Double getDuration() {
+        return duration;
+    }
+
+    public void setDuration(Double duration) {
+        this.duration = duration;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
 
     public String getId() {
         return id;

+ 24 - 1
src/main/java/com/goafanti/customer/bo/OutSelectUserArchives.java

@@ -1,5 +1,9 @@
 package com.goafanti.customer.bo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+
 public class OutSelectUserArchives {
     private String id;
     private String nickname;
@@ -21,12 +25,31 @@ public class OutSelectUserArchives {
     private String businessScope;
     private String financialData;
     private String earlyCommunication;
-    private Integer  patentCount;
+    private Integer patentCount;
     private Integer inventionPatentCount;
     private Integer utilityModelCount;
     private Integer appearancePatentCount;
     private Integer softwareWorksCount;
     private Integer otherCount;
+    private Date createTime;
+    private Date updateTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
 
     public String getId() {
         return id;

+ 18 - 2
src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

@@ -6,6 +6,8 @@ import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.InputSelectUserArchives;
+import com.goafanti.customer.bo.MyUserDetailsBo;
+import com.goafanti.customer.bo.OutSelectUserArchives;
 import com.goafanti.customer.bo.UserArchivesDetails;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.customer.service.UserArchivesService;
@@ -17,6 +19,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -41,6 +44,8 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
     private AdminMapper adminMapper;
     @Resource
     private UserDataLogMapper userDataLogMapper;
+    @Resource
+    private PublicReleaseMapper publicReleaseMapper;
     
     @Override
     public Pagination<UserArchives> list(UserArchives userArchives, Integer pageNo, Integer pageSize) {
@@ -252,7 +257,18 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
             String[] split = in.getIndustry().split(",");
             params.put("industry", split);
         }
-        return findPage("selectUserArchivesList",
-                "selectUserArchivesCount", params, in.getPageNo(), in.getPageSize());
+
+        return pushPage(findPage("selectUserArchivesList", "selectUserArchivesCount", params, in.getPageNo(), in.getPageSize()));
+
+    }
+
+    private Object pushPage(Pagination<?> page) {
+        List<OutSelectUserArchives> list = (List<OutSelectUserArchives>) page.getList();
+        list.forEach(e ->{
+            List<MyUserDetailsBo> myUserDetailsBos = publicReleaseMapper.selectCountByUid(e.getId());
+            myUserDetailsBos.stream().collect(Collectors.toMap(MyUserDetailsBo::getAid, Function.identity(),(e1,e2)->e1))
+                    .values().stream().collect(Collectors.toList());
+        });
+        return page;
     }
 }