anderx преди 1 година
родител
ревизия
f2b6e28ba7

+ 9 - 3
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1896,12 +1896,18 @@
     </select>
 
     <select id="selectUserClueList" resultType="com.goafanti.customer.bo.OutUserClueBo">
-        select a.id,a.nickname ,b.contacts ,b.contact_mobile,c.name adminName,
+        select a.id,a.nickname ,b.contacts ,b.contact_mobile contactMobile,c.name adminName,
                a.clue_process clueProcess,a.clue_time clueTime
         from `user` a left join organization_identity b on a.id =b.uid
                       left join admin c on a.aid=c.id
-        where clue_status =1 and clue_process in (0,2)
+        where a.clue_status =1 and a.clue_process in (0,2)
+        <if test="page_sql !=null">
+            ${page_sql}
+        </if>
+    </select>
+    <select id="selectUserClueCount" resultType="java.lang.Integer">
+        select count(*) from `user` a
+    where clue_status =1 and clue_process in (0,2)
     </select>
-
 </mapper>
 

+ 72 - 0
src/main/java/com/goafanti/customer/bo/OutUserClueExcel.java

@@ -0,0 +1,72 @@
+package com.goafanti.customer.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+
+public class OutUserClueExcel {
+    private String id;
+    @Excel(name = "客户姓名")
+    private String nickname;
+    @Excel(name = "联系人")
+    private String contacts;
+    @Excel(name = "联系人手机号")
+    private String contactMobile;
+    private String adminName;
+    private String clueProcess;
+    private String clueTime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getContactMobile() {
+        return contactMobile;
+    }
+
+    public void setContactMobile(String contactMobile) {
+        this.contactMobile = contactMobile;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getClueProcess() {
+        return clueProcess;
+    }
+
+    public void setClueProcess(String clueProcess) {
+        this.clueProcess = clueProcess;
+    }
+
+    public String getClueTime() {
+        return clueTime;
+    }
+
+    public void setClueTime(String clueTime) {
+        this.clueTime = clueTime;
+    }
+}

+ 11 - 0
src/main/java/com/goafanti/customer/controller/UserClueApiController.java

@@ -2,8 +2,11 @@ package com.goafanti.customer.controller;
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.customer.bo.InputUserClueList;
+import com.goafanti.customer.bo.OutUserClueExcel;
 import com.goafanti.customer.service.UserClueService;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -16,10 +19,18 @@ public class UserClueApiController extends BaseApiController{
 
 	@Resource
 	private UserClueService userClueService;
+	@Value(value = "${upload.path}")
+	private String			uploadPath	= null;
 
 
 	@GetMapping("/list")
 	public Result list(InputUserClueList in) {
 		return new Result(userClueService.list(in));
 	}
+
+	@GetMapping("/exportTemplate")
+	public Result exportList( ) {
+		NewExcelUtil<OutUserClueExcel> excelUtil=new NewExcelUtil<>(OutUserClueExcel.class);
+		return excelUtil.exportExcel(null,"签单客户统计表",uploadPath);
+	}
 }