Browse Source

客户档案导出开发

anderx 1 year ago
parent
commit
bfa024ae35

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

@@ -2083,7 +2083,7 @@
         a.project_status projectStatus,a.id,b.order_remarks orderRemarks, a.set_up_status setUpStatus , date_format( a.set_up_time , '%Y-%m-%d' ) setUpTime ,
         a.spot_check_status spotCheckStatus ,b.contact_mobile contactMobile ,b.legal_person_tel legalPersonTel , a.certificate_number certificateNumber,
         a.declaration_batch declarationBatch, date_format(a.licence_time, '%Y-%m-%d' ) licenceTime, a.commodity_quantity commodityQuantity ,
-        ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial, ttm.cost_amount costAmount ,
+        ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial, ttm.cost_amount costAmount ,bc.sort cSort,
         (a.commodity_price-ttm.cost_amount)profit, a.high_tech_status highTechStatus, tp.patent_name patentName ,tp.patent_no patentNo ,
         date_format(tp.accept_time, '%Y-%m-%d ' ) acceptTime , date_format(tp.authorize_time, '%Y-%m-%d ' )  authorizeTime, ttm.reject_count rejectCount ,
         tm.service_life serviceLife,tm.service_year serviceyear, tm.year_sum yearsum,tm.contract_term contractTerm, a.commodity_price commodityPrice ,

+ 12 - 2
src/main/java/com/goafanti/common/mapper/UserArchivesMapper.xml

@@ -280,7 +280,12 @@ interview_distribution = values(interview_distribution)
             </foreach>
             </if>
             <if test="shareType !=null">
-                and a.share_type = #{shareType}
+                <if test="shareType &lt; 4">
+                    and a.share_type = #{shareType}
+                </if>
+                <if test="shareType = 4">
+                    and a.share_type in (0,2)
+                </if>
             </if>
             <if test="businessScope !=null">
                 and find_in_set(#{businessScope},b.business_scope)
@@ -318,7 +323,12 @@ interview_distribution = values(interview_distribution)
                 </foreach>
             </if>
             <if test="shareType !=null">
-                and a.share_type = #{shareType}
+                <if test="shareType &lt; 4">
+                    and a.share_type = #{shareType}
+                </if>
+                <if test="shareType = 4">
+                    and a.share_type in (0,2)
+                </if>
             </if>
             <if test="businessScope !=null">
                 and find_in_set(#{businessScope},b.business_scope)

+ 29 - 8
src/main/java/com/goafanti/customer/bo/OutSelectUserArchives.java

@@ -1,32 +1,53 @@
 package com.goafanti.customer.bo;
 
+import com.goafanti.common.utils.excel.Excel;
+
 public class OutSelectUserArchives {
     private String id;
+    @Excel(name = "客户名称")
     private String nickname;
+    @Excel(name = "省",width = 8)
     private String province;
+    @Excel(name = "市",width = 8)
     private String city;
+    @Excel(name = "区",width = 8)
     private String area;
+    @Excel(name = "客户类型",readConverterExp = "0=私有客户,1=公共客户,2=签单客户,3=外联客户",width = 12)
     private Integer shareType;
+    @Excel(name = "主营产品")
+    private String businessScope;
     private Integer channelType;
     private Integer enterpriseCount;
+    @Excel(name = "行业",width = 8)
+    private String industry;
+    @Excel(name = "联系人")
     private String contactName;
+    @Excel(name = "所属人")
     private String adminName;
+    @Excel(name = "意向合作项目")
+    private String intendedProject;
     private String channelIndicators;
     private String interviewIdeas;
-    private String intendedProject;
-    private String interviewDistribution;
-    private String depName;
-
-    private String industry;
-    private String businessScope;
-    private String financialData;
-    private String earlyCommunication;
+    @Excel(name = "专利数",width = 8)
     private Integer  patentCount;
+    @Excel(name = "发明专利数",width = 8)
     private Integer inventionPatentCount;
+    @Excel(name = "实用新型数",width = 8)
     private Integer utilityModelCount;
+    @Excel(name = "外观专利数",width = 8)
     private Integer appearancePatentCount;
+    @Excel(name = "软著数",width = 8)
     private Integer softwareWorksCount;
+    @Excel(name = "其他数",width = 8)
     private Integer otherCount;
+    @Excel(name = "财务数据")
+    private String financialData;
+    @Excel(name = "前期沟通")
+    private String earlyCommunication;
+    @Excel(name = "面谈思路及目的")
+    private String interviewDistribution;
+    @Excel(name = "所属部门")
+    private String depName;
 
     public String getId() {
         return id;

+ 9 - 0
src/main/java/com/goafanti/customer/controller/UserArchivesController.java

@@ -140,6 +140,15 @@ public class UserArchivesController  extends BaseController {
         return res;
     }
 
+    /**
+     * 客户档案汇总导出
+     */
+    @GetMapping("/selectUserArchives/export")
+    public Result selectUserArchivesExport( InputSelectUserArchives in) {
+        if (in.getNewChannel()==null)in.setNewChannel(0);
+        return (Result) this.userArchivesService.selectUserArchivesExport(in);
+    }
+
 
 
 

+ 2 - 0
src/main/java/com/goafanti/customer/service/UserArchivesService.java

@@ -54,4 +54,6 @@ public interface UserArchivesService {
     boolean checkPermission(String id);
 
     Object selectUserArchives(InputSelectUserArchives in);
+
+    Object selectUserArchivesExport(InputSelectUserArchives in);
 }

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

@@ -2,14 +2,17 @@ package com.goafanti.customer.service.impl;
 
 import com.goafanti.common.dao.*;
 import com.goafanti.common.model.*;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 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.OutSelectUserArchives;
 import com.goafanti.customer.bo.UserArchivesDetails;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.customer.service.UserArchivesService;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -38,6 +41,11 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
     private AdminMapper adminMapper;
     @Resource
     private UserDataLogMapper userDataLogMapper;
+
+
+
+    @Value(value = "${upload.path}")
+    private final String	uploadPath			= null;
     
     
     @Override
@@ -236,6 +244,14 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
 
     @Override
     public Object selectUserArchives(InputSelectUserArchives in) {
+        Map<String, Object> params = getParams(in);
+        Pagination<OutSelectUserArchives> page = (Pagination<OutSelectUserArchives>) findPage("selectUserArchivesList",
+                "selectUserArchivesCount", params, in.getPageNo(), in.getPageSize());
+
+        return page;
+    }
+
+    private Map<String, Object> getParams(InputSelectUserArchives in) {
         Map<String, Object> params = new HashMap<>();
         if (in.getNewChannel() != null)params.put("newChannel", in.getNewChannel());
         if (in.getShareType() != null)params.put("shareType", in.getShareType());
@@ -250,7 +266,17 @@ 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 params;
+    }
+
+    @Override
+    public Object selectUserArchivesExport(InputSelectUserArchives in) {
+        Map<String, Object> params = getParams(in);
+        List<OutSelectUserArchives> list= (List<OutSelectUserArchives>) findList("selectUserArchivesList",
+                params, 1, 999999);
+        NewExcelUtil<OutSelectUserArchives> newExcelUtil = new NewExcelUtil<>(OutSelectUserArchives.class);
+        return newExcelUtil.exportExcel( list,"用户档案",uploadPath);
     }
+
+
 }

+ 9 - 0
src/main/java/com/goafanti/order/bo/OutProjectStatistics.java

@@ -19,6 +19,7 @@ public class OutProjectStatistics {
 	private Integer projectStatus;
 	private Integer formRetrieve;
 	private Integer satisfactionDegree;
+	private Integer cSort;
 
 
 
@@ -83,6 +84,14 @@ public class OutProjectStatistics {
 	private Integer scoreStatus;
 	private Integer scoreNumber;
 
+	public Integer getcSort() {
+		return cSort;
+	}
+
+	public void setcSort(Integer cSort) {
+		this.cSort = cSort;
+	}
+
 	public Integer getScoreStatus() {
 		return scoreStatus;
 	}