Browse Source

1.客户面谈列表修改
2. 领取客户新增客户佐证材料
3. 新增客户领取日志列表

anderx 8 months ago
parent
commit
49379b4d67

+ 2 - 2
src/main/java/com/goafanti/Interview/service/impl/UserArchivesInterviewServiceImpl.java

@@ -5,6 +5,7 @@ import com.goafanti.Interview.bo.UpdateUserBo;
 import com.goafanti.Interview.service.UserArchivesInterviewService;
 import com.goafanti.common.dao.*;
 import com.goafanti.common.model.*;
+import com.goafanti.common.utils.BeanUtilsExt;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -38,9 +39,8 @@ public class UserArchivesInterviewServiceImpl extends BaseMybatisDao<UserArchive
 
     @Override
     public Pagination<UserArchivesInterview> list(UserArchivesInterview userArchivesInterview, Integer pageNo, Integer pageSize) {
-        Map<String, Object> params = new HashMap<>();
         userArchivesInterview.setAid(TokenManager.getAdminId());
-        params.put("in", userArchivesInterview);
+        Map<String, Object> params = BeanUtilsExt.pushMap(userArchivesInterview);
         return (Pagination<UserArchivesInterview>) findPage("findUserArchivesInterviewList",
                 "findUserArchivesInterviewCount", params, pageNo, pageSize);
     }

+ 84 - 0
src/main/java/com/goafanti/common/dao/UserReceiveLogMapper.java

@@ -0,0 +1,84 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.UserReceiveLog;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 客户领取日志表(UserReceiveLog)表数据库访问层
+ *
+ * @author makejava
+ * @since 2025-05-12 09:27:17
+ */
+public interface UserReceiveLogMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    UserReceiveLog selectById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param userReceiveLog 查询条件
+     * @param pageable       分页对象
+     * @return 对象列表
+     */
+    List<UserReceiveLog> findUserReceiveLogList(UserReceiveLog userReceiveLog);
+
+    /**
+     * 统计总行数
+     *
+     * @param userReceiveLog 查询条件
+     * @return 总行数
+     */
+    int findUserReceiveLogCount(UserReceiveLog userReceiveLog);
+
+    /**
+     * 新增数据
+     *
+     * @param userReceiveLog 实例对象
+     * @return 影响行数
+     */
+    int insert(UserReceiveLog userReceiveLog);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<UserReceiveLog> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<UserReceiveLog> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<UserReceiveLog> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<UserReceiveLog> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param userReceiveLog 实例对象
+     * @return 影响行数
+     */
+    int update(UserReceiveLog userReceiveLog);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+}
+

+ 143 - 0
src/main/java/com/goafanti/common/mapper/UserReceiveLogMapper.xml

@@ -0,0 +1,143 @@
+<?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.UserReceiveLogMapper">
+
+    <resultMap type="com.goafanti.common.model.UserReceiveLog" id="UserReceiveLogMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="uid" column="uid" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="materialUrl" column="material_url" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="UserReceiveLogAllSql">
+        id, uid, aid, material_url, create_time
+    </sql>
+
+    <!--查询单个-->
+    <select id="selectById" resultMap="UserReceiveLogMap">
+        select
+        <include refid="UserReceiveLogAllSql"/>
+        from user_receive_log
+        where id = #{id}
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into user_receive_log(uid, aid, material_url, create_time)
+        values (#{uid}, #{aid}, #{materialUrl}, #{createTime})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into user_receive_log(uid, aid, material_url, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.aid}, #{entity.materialUrl}, #{entity.createTime})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into user_receive_log(uid, aid, material_url, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.aid}, #{entity.materialUrl}, #{entity.createTime})
+        </foreach>
+        on duplicate key update
+        uid = values(uid),
+        aid = values(aid),
+        material_url = values(material_url),
+        create_time = values(create_time)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update user_receive_log
+        <set>
+            <if test="uid != null and uid != ''">
+                uid = #{uid},
+            </if>
+            <if test="aid != null and aid != ''">
+                aid = #{aid},
+            </if>
+            <if test="materialUrl != null and materialUrl != ''">
+                material_url = #{materialUrl},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+
+    <resultMap type="com.goafanti.customer.bo.UserReceiveLogListBo" id="ListMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="uid" column="uid" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="userName" column="userName" jdbcType="VARCHAR"/>
+        <result property="adminName" column="AdminName" jdbcType="VARCHAR"/>
+        <result property="materialUrl" column="material_url" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+
+    </resultMap>
+
+    <!--查询指定行数据-->
+    <select id="findUserReceiveLogList" resultMap="ListMap">
+        select
+        a.id, a.uid, a.aid, a.material_url, a.create_time,b.nickname userName,c.name AdminName
+        from user_receive_log a left join user b on a.uid=b.id
+        left join admin c on a.aid=c.id
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="uid != null and uid != ''">
+                and uid = #{uid}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="materialUrl != null and materialUrl != ''">
+                and material_url = #{materialUrl}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findUserReceiveLogCount" resultType="java.lang.Integer">
+        select count(1)
+        from user_receive_log
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="uid != null and uid != ''">
+                and uid = #{uid}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="materialUrl != null and materialUrl != ''">
+                and material_url = #{materialUrl}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+    </select>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from user_receive_log
+        where id = #{id}
+    </delete>
+
+</mapper>
+

+ 79 - 0
src/main/java/com/goafanti/common/model/UserReceiveLog.java

@@ -0,0 +1,79 @@
+package com.goafanti.common.model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 客户领取日志表(UserReceiveLog)实体类
+ *
+ * @author makejava
+ * @since 2025-05-12 09:27:17
+ */
+public class UserReceiveLog implements Serializable {
+    private static final long serialVersionUID = 484028591617850868L;
+
+    private Integer id;
+    /**
+     * 客户编号
+     */
+    private String uid;
+    /**
+     * 跟进人编号
+     */
+    private String aid;
+    /**
+     * 佐证材料url
+     */
+    private String materialUrl;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getMaterialUrl() {
+        return materialUrl;
+    }
+
+    public void setMaterialUrl(String materialUrl) {
+        this.materialUrl = materialUrl;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+}
+

+ 10 - 0
src/main/java/com/goafanti/customer/bo/InputUpdateAndReceiveCustomer.java

@@ -33,6 +33,16 @@ public class InputUpdateAndReceiveCustomer {
      */
     private Integer listedNature;
 
+    private String materialUrl;
+
+    public String getMaterialUrl() {
+        return materialUrl;
+    }
+
+    public void setMaterialUrl(String materialUrl) {
+        this.materialUrl = materialUrl;
+    }
+
     public Integer getNature() {
         return nature;
     }

+ 24 - 0
src/main/java/com/goafanti/customer/bo/UserReceiveLogListBo.java

@@ -0,0 +1,24 @@
+package com.goafanti.customer.bo;
+
+import com.goafanti.common.model.UserReceiveLog;
+
+public class UserReceiveLogListBo extends UserReceiveLog {
+    private String userName;
+    private String adminName;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+}

+ 2 - 0
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -1693,4 +1693,6 @@ public class AdminCustomerApiController extends BaseApiController{
 		customerService.updateAndReceiveCustomer(in);
 		return res;
 	}
+
+
 }

+ 40 - 0
src/main/java/com/goafanti/customer/controller/UserReceiveLogApiController.java

@@ -0,0 +1,40 @@
+package com.goafanti.customer.controller;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.model.UserReceiveLog;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.customer.bo.UserReceiveLogListBo;
+import com.goafanti.customer.service.UserReceiveLogService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/api/admin/userRecevieLog")
+public class UserReceiveLogApiController extends BaseApiController {
+    @Resource
+    private UserReceiveLogService userReceiveLogService;
+
+
+    /**
+     * 客户领取日志列表
+     * @param in
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    @GetMapping("/list")
+    public Result<UserReceiveLogListBo> list(UserReceiveLog in, Integer pageNo, Integer pageSize) {
+        Result res = new Result();
+        if (StringUtils.isEmpty(in.getUid())){
+            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "客户Id", "客户Id"));
+            return res;
+        }
+        res.setData(userReceiveLogService.list(in, pageNo, pageSize));
+        return res;
+    }
+}

+ 1 - 0
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -600,4 +600,5 @@ public interface CustomerService {
     Object checkUser(String id);
 
 	Object updateAndReceiveCustomer(InputUpdateAndReceiveCustomer in);
+
 }

+ 7 - 0
src/main/java/com/goafanti/customer/service/UserReceiveLogService.java

@@ -0,0 +1,7 @@
+package com.goafanti.customer.service;
+
+import com.goafanti.common.model.UserReceiveLog;
+
+public interface UserReceiveLogService {
+    Object list(UserReceiveLog in, Integer pageNo, Integer pageSize);
+}

+ 12 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -115,6 +115,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	@Resource
 	private	AsyncUtils asyncUtils;
 
+	@Resource
+	private UserReceiveLogMapper userReceiveLogMapper;
+
 
 
 
@@ -3120,10 +3123,19 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		oi.setIntendedProject(in.getIntendedProject());
 		oi.setBusinessScope(in.getBusinessScope());
 		organizationIdentityMapper.updateServiceByUid(oi);
+		if (StringUtils.isNotBlank(in.getMaterialUrl())){
+			UserReceiveLog log=new UserReceiveLog();
+			log.setUid(in.getId());
+			log.setAid(TokenManager.getAdminId());
+			log.setMaterialUrl(in.getMaterialUrl());
+			log.setCreateTime(new Date());
+			userReceiveLogMapper.insert(log);
+		}
 		return null;
 	}
 
 
+
 	private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
 		List<InputExcelUser> res=new ArrayList<>();
 		List<InputExcelUser> list2=new ArrayList<>();

+ 21 - 0
src/main/java/com/goafanti/customer/service/impl/UserReceiveLogServiceImpl.java

@@ -0,0 +1,21 @@
+package com.goafanti.customer.service.impl;
+
+import com.goafanti.common.dao.UserReceiveLogMapper;
+import com.goafanti.common.model.UserReceiveLog;
+import com.goafanti.common.utils.BeanUtilsExt;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.customer.service.UserReceiveLogService;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+@Service
+public class UserReceiveLogServiceImpl extends BaseMybatisDao<UserReceiveLogMapper> implements UserReceiveLogService {
+    @Override
+    public Object list(UserReceiveLog in, Integer pageNo, Integer pageSize) {
+        Map<String, Object> map = BeanUtilsExt.pushMap(in);
+        Pagination<?> page = findPage("findUserReceiveLogList", "findUserReceiveLogCount", map, pageNo, pageSize);
+        return page;
+    }
+}