yusm 1 年間 前
コミット
137657b981

+ 2 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ContactsController.java

@@ -55,8 +55,8 @@ public class ContactsController {
      * @return
      */
     @RequestMapping("/pageContacts")
-    public HttpRespMsg pageContacts(@RequestParam Integer pageIndex, @RequestParam Integer pageSize,String customName, String name, String phone, String ownerName){
-        return contactsService.pageContacts(pageIndex,pageSize,customName,name,phone,ownerName,request);
+    public HttpRespMsg pageContacts(@RequestParam Integer pageIndex, @RequestParam Integer pageSize,String customName, String name, String email,String creatorName, String phone, String ownerName){
+        return contactsService.pageContacts(pageIndex,pageSize,customName,name,email,creatorName,phone,ownerName,request);
     }
 
     /**

+ 46 - 16
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Contacts.java

@@ -19,7 +19,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2024-03-05
+ * @since 2024-03-12
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -34,6 +34,12 @@ public class Contacts extends Model<Contacts> {
     @TableField("company_id")
     private Integer companyId;
 
+    /**
+     * 性别: 0女  1男
+     */
+    @TableField("sex")
+    private Integer sex;
+
     /**
      * 联系人名称
      */
@@ -59,11 +65,49 @@ public class Contacts extends Model<Contacts> {
     private String phone;
 
     /**
-     * 联系人所属
+     * 负责
      */
     @TableField("owner_id")
     private String ownerId;
 
+    /**
+     * 创建人
+     */
+    @TableField("creator_id")
+    private String creatorId;
+
+    /**
+     * 地址
+     */
+    @TableField("address")
+    private String address;
+
+    /**
+     * 备注
+     */
+    @TableField("remark")
+    private String remark;
+
+    /**
+     * 回收站(是否删除) 0-否 1-是
+     */
+    @TableField("is_delete")
+    private Integer isDelete;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    private LocalDateTime createTime;
+
+    /**
+     * 职务
+     */
+    @TableField("range")
+    private String range;
+
     /**
      * 自定义字段存值
      */
@@ -94,20 +138,6 @@ public class Contacts extends Model<Contacts> {
     @TableField("plate5")
     private String plate5;
 
-    /**
-     * 回收站(是否删除) 0-否 1-是
-     */
-    @TableField("is_delete")
-    private Integer isDelete;
-
-    /**
-     * 创建时间
-     */
-    @TableField("create_time")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
-    private LocalDateTime createTime;
-
 
     @Override
     protected Serializable pkVal() {

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ContactsService.java

@@ -20,7 +20,7 @@ public interface ContactsService extends IService<Contacts> {
 
     HttpRespMsg addContacts(Contacts contacts, HttpServletRequest request);
 
-    HttpRespMsg pageContacts(Integer pageIndex, Integer pageSize, String customName, String name, String phone, String ownerName, HttpServletRequest request);
+    HttpRespMsg pageContacts(Integer pageIndex, Integer pageSize, String customName, String name,String email,String creatorName,  String phone, String ownerName, HttpServletRequest request);
 
     HttpRespMsg selectContactsByCustomId(Custom custom,HttpServletRequest request);
 

+ 5 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java

@@ -58,7 +58,8 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
                 //todo:联系人的所有人是可选择的
 //                .setOwnerId(user.getId())//添加时默认
                 .setIsDelete(0)
-                .setCreateTime(LocalDateTime.now());
+                .setCreateTime(LocalDateTime.now())
+                .setCreatorId(user.getId());
         contactsMapper.insert(contacts);
 
         ContactsLog contactsLog = new ContactsLog();
@@ -73,12 +74,14 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
     }
 
     @Override
-    public HttpRespMsg pageContacts(Integer pageIndex, Integer pageSize, String customName, String name, String phone, String ownerName, HttpServletRequest request) {
+    public HttpRespMsg pageContacts(Integer pageIndex, Integer pageSize, String customName, String name,String email,String creatorName,  String phone, String ownerName, HttpServletRequest request) {
         Map<String, Object> map = new HashMap<>();
         map.put("customName", customName);
         map.put("name", name);
         map.put("phone", phone);
         map.put("ownerName", ownerName);
+        map.put("email", email);
+        map.put("creatorName", creatorName);
         String token = String.valueOf(request.getHeader("Token"));
         User user = userMapper.selectById(token);
         map.put("companyId",user.getCompanyId());

+ 14 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ContactsMapper.xml

@@ -6,23 +6,28 @@
     <resultMap id="BaseResultMap" type="com.management.platform.entity.Contacts">
         <id column="id" property="id" />
         <result column="company_id" property="companyId" />
+        <result column="sex" property="sex" />
         <result column="name" property="name" />
         <result column="custom_id" property="customId" />
         <result column="email" property="email" />
         <result column="phone" property="phone" />
         <result column="owner_id" property="ownerId" />
+        <result column="creator_id" property="creatorId" />
+        <result column="address" property="address" />
+        <result column="remark" property="remark" />
+        <result column="is_delete" property="isDelete" />
+        <result column="create_time" property="createTime" />
+        <result column="range" property="range" />
         <result column="plate1" property="plate1" />
         <result column="plate2" property="plate2" />
         <result column="plate3" property="plate3" />
         <result column="plate4" property="plate4" />
         <result column="plate5" property="plate5" />
-        <result column="is_delete" property="isDelete" />
-        <result column="create_time" property="createTime" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, name, custom_id, email, phone, owner_id, plate1, plate2, plate3, plate4, plate5, is_delete, create_time
+        id, company_id, sex, name, custom_id, email, phone, owner_id, creator_id, address, remark, is_delete, create_time, range, plate1, plate2, plate3, plate4, plate5
     </sql>
     <select id="pageContacts" parameterType="java.util.Map"  resultType="com.management.platform.entity.vo.ContactsVo">
         SELECT c.*, cust.custom_name as customName, own.name as ownerName
@@ -39,12 +44,18 @@
             <if test="map.ownerName != null and map.ownerName != ''">
                 AND own.name LIKE CONCAT('%', #{map.ownerName}, '%')
             </if>
+            <if test="map.creatorName != null and map.creatorName != ''">
+                AND own.name LIKE CONCAT('%', #{map.creatorName}, '%')
+            </if>
             <if test="map.phone != null and map.phone != ''">
                 AND c.phone LIKE CONCAT('%', #{map.phone}, '%')
             </if>
             <if test="map.name != null and map.name != ''">
                 AND c.name LIKE CONCAT('%', #{map.name}, '%')
             </if>
+            <if test="map.email != null and map.email != ''">
+                AND c.email LIKE CONCAT('%', #{map.email}, '%')
+            </if>
             <if test="map.companyId != null">
                 AND c.company_id=#{map.companyId}
             </if>