Browse Source

新增客户档案列表

anderx 1 year ago
parent
commit
56bdd3a5db

+ 72 - 0
src/main/java/com/goafanti/common/mapper/UserArchivesMapper.xml

@@ -241,5 +241,77 @@ interview_distribution = values(interview_distribution)
         from user_archives
         where uid = #{id}
     </select>
+
+    <select id="selectUserArchivesList" resultType="com.goafanti.customer.bo.OutSelectUserArchives">
+        select a.id , a.nickname ,d1.name as  province ,d2.name as  city ,d3.name area ,
+        a.share_type as shareType ,d.channel_type as channelType ,e.enterprise_count as enterpriseCount,
+        c.name contactName,f.name adminName,e.channel_indicators as channelIndicators,
+        e.interview_ideas as interviewIdeas ,b.intended_project as intendedProject,
+        e.interview_distribution as interviewDistribution, g.name depName,
+        ic.name as  industry ,b.business_scope as businessScope ,e.financial_data as financialData,
+        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
+        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
+                    left join user_archives e on a.id =e.uid
+                    left join admin f on a.aid =f.id
+                    left join department g on f.department_id =g.id
+        left join district_glossory d1 on b.location_province=d1.id
+        left join district_glossory d2 on b.location_city=d2.id
+        left join district_glossory d3 on b.location_area=d3.id
+        left join industry_category ic on b.industry=ic.id
+        <where>
+            <if test="newChannel !=null">
+                and a.new_channel = #{newChannel}
+            </if>
+            <if test="name !=null">
+            and a.nickname like concat('%',#{name},'%')
+            </if>
+            <if test="aid !=null">
+            and a.aid = #{aid}
+            </if>
+            <if test="channelType !=null">
+            and d.channel_type in
+            <foreach collection="channelType" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+            </if>
+            <if test="shareType !=null">
+            and a.share_type = #{shareType}
+            </if>
+        </where>
+        order by a.transfer_time desc
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+    <select id="selectUserArchivesCount" resultType="java.lang.Integer">
+        select count(*)
+        from user a
+        left join user_mid d on a.id =d.uid
+        <where>
+            <if test="newChannel !=null">
+                and a.new_channel = #{newChannel}
+            </if>
+            <if test="name !=null">
+                and a.nickname like concat('%',#{name},'%')
+            </if>
+            <if test="aid !=null">
+                and a.aid = #{aid}
+            </if>
+            <if test="channelType !=null">
+                and d.channel_type in
+                <foreach collection="channelType" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="shareType !=null">
+                and a.share_type = #{shareType}
+            </if>
+        </where>
+    </select>
 </mapper>
 

+ 69 - 0
src/main/java/com/goafanti/customer/bo/InputSelectUserArchives.java

@@ -0,0 +1,69 @@
+package com.goafanti.customer.bo;
+
+public class InputSelectUserArchives {
+
+    private Integer newChannel;
+    private String name;
+    private String aid;
+
+    private String  channelType;
+    private Integer shareType;
+    private Integer pageSize;
+    private Integer pageNo;
+
+    public Integer getNewChannel() {
+        return newChannel;
+    }
+
+    public void setNewChannel(Integer newChannel) {
+        this.newChannel = newChannel;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getChannelType() {
+        return channelType;
+    }
+
+    public void setChannelType(String channelType) {
+        this.channelType = channelType;
+    }
+
+    public Integer getShareType() {
+        return shareType;
+    }
+
+    public void setShareType(Integer shareType) {
+        this.shareType = shareType;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+}

+ 230 - 0
src/main/java/com/goafanti/customer/bo/OutSelectUserArchives.java

@@ -0,0 +1,230 @@
+package com.goafanti.customer.bo;
+
+public class OutSelectUserArchives {
+    private String id;
+    private String nickname;
+    private String province;
+    private String city;
+    private String area;
+    private Integer shareType;
+    private Integer channelType;
+    private Integer enterpriseCount;
+    private String contactName;
+    private String adminName;
+    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;
+    private Integer  patentCount;
+    private Integer inventionPatentCount;
+    private Integer utilityModelCount;
+    private Integer appearancePatentCount;
+    private Integer softwareWorksCount;
+    private Integer otherCount;
+
+    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 getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getArea() {
+        return area;
+    }
+
+    public void setArea(String area) {
+        this.area = area;
+    }
+
+    public Integer getShareType() {
+        return shareType;
+    }
+
+    public void setShareType(Integer shareType) {
+        this.shareType = shareType;
+    }
+
+    public Integer getChannelType() {
+        return channelType;
+    }
+
+    public void setChannelType(Integer channelType) {
+        this.channelType = channelType;
+    }
+
+    public Integer getEnterpriseCount() {
+        return enterpriseCount;
+    }
+
+    public void setEnterpriseCount(Integer enterpriseCount) {
+        this.enterpriseCount = enterpriseCount;
+    }
+
+    public String getContactName() {
+        return contactName;
+    }
+
+    public void setContactName(String contactName) {
+        this.contactName = contactName;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getChannelIndicators() {
+        return channelIndicators;
+    }
+
+    public void setChannelIndicators(String channelIndicators) {
+        this.channelIndicators = channelIndicators;
+    }
+
+    public String getInterviewIdeas() {
+        return interviewIdeas;
+    }
+
+    public void setInterviewIdeas(String interviewIdeas) {
+        this.interviewIdeas = interviewIdeas;
+    }
+
+    public String getIntendedProject() {
+        return intendedProject;
+    }
+
+    public void setIntendedProject(String intendedProject) {
+        this.intendedProject = intendedProject;
+    }
+
+    public String getInterviewDistribution() {
+        return interviewDistribution;
+    }
+
+    public void setInterviewDistribution(String interviewDistribution) {
+        this.interviewDistribution = interviewDistribution;
+    }
+
+    public String getDepName() {
+        return depName;
+    }
+
+    public void setDepName(String depName) {
+        this.depName = depName;
+    }
+
+    public String getIndustry() {
+        return industry;
+    }
+
+    public void setIndustry(String industry) {
+        this.industry = industry;
+    }
+
+    public String getBusinessScope() {
+        return businessScope;
+    }
+
+    public void setBusinessScope(String businessScope) {
+        this.businessScope = businessScope;
+    }
+
+    public String getFinancialData() {
+        return financialData;
+    }
+
+    public void setFinancialData(String financialData) {
+        this.financialData = financialData;
+    }
+
+    public String getEarlyCommunication() {
+        return earlyCommunication;
+    }
+
+    public void setEarlyCommunication(String earlyCommunication) {
+        this.earlyCommunication = earlyCommunication;
+    }
+
+    public Integer getPatentCount() {
+        return patentCount;
+    }
+
+    public void setPatentCount(Integer patentCount) {
+        this.patentCount = patentCount;
+    }
+
+    public Integer getInventionPatentCount() {
+        return inventionPatentCount;
+    }
+
+    public void setInventionPatentCount(Integer inventionPatentCount) {
+        this.inventionPatentCount = inventionPatentCount;
+    }
+
+    public Integer getUtilityModelCount() {
+        return utilityModelCount;
+    }
+
+    public void setUtilityModelCount(Integer utilityModelCount) {
+        this.utilityModelCount = utilityModelCount;
+    }
+
+    public Integer getAppearancePatentCount() {
+        return appearancePatentCount;
+    }
+
+    public void setAppearancePatentCount(Integer appearancePatentCount) {
+        this.appearancePatentCount = appearancePatentCount;
+    }
+
+    public Integer getSoftwareWorksCount() {
+        return softwareWorksCount;
+    }
+
+    public void setSoftwareWorksCount(Integer softwareWorksCount) {
+        this.softwareWorksCount = softwareWorksCount;
+    }
+
+    public Integer getOtherCount() {
+        return otherCount;
+    }
+
+    public void setOtherCount(Integer otherCount) {
+        this.otherCount = otherCount;
+    }
+}

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

@@ -3,6 +3,7 @@ package com.goafanti.customer.controller;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.UserArchives;
+import com.goafanti.customer.bo.InputSelectUserArchives;
 import com.goafanti.customer.service.UserArchivesService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -114,6 +115,19 @@ public class UserArchivesController  extends BaseController {
 
 
 
+    /**
+     * 客户档案汇总
+     */
+    @GetMapping("/selectUserArchives")
+    public Result selectUserArchives( InputSelectUserArchives in) {
+        Result res = new Result<>();
+        if (in.getNewChannel()==null)in.setNewChannel(0);
+        res.data(this.userArchivesService.selectUserArchives(in));
+        return res;
+    }
+
+
+
 
 
 

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

@@ -1,6 +1,7 @@
 package com.goafanti.customer.service;
 
 import com.goafanti.common.model.UserArchives;
+import com.goafanti.customer.bo.InputSelectUserArchives;
 
 /**
  * 客户档案表(UserArchives)表服务接口
@@ -51,4 +52,6 @@ public interface UserArchivesService {
     Object queryByUidAll(String id);
 
     boolean checkPermission(String id);
+
+    Object selectUserArchives(InputSelectUserArchives in);
 }

+ 19 - 0
src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

@@ -8,6 +8,7 @@ import com.goafanti.common.model.*;
 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.UserArchivesDetails;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.customer.service.UserArchivesService;
@@ -94,6 +95,8 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
         return false;
     }
 
+
+
     /**
      * 通过ID查询单条数据
      *
@@ -206,4 +209,20 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
     public boolean deleteById(Integer id) {
         return this.userArchivesMapper.deleteById(id) > 0;
     }
+
+
+    @Override
+    public Object selectUserArchives(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());
+        if (in.getChannelType() != null){
+            String[] split = in.getChannelType().split(",");
+            params.put("channelType", split);
+        }
+        if (in.getName() != null)params.put("name", in.getName());
+        if (in.getAid() != null)params.put("aid", in.getAid());
+        return findPage("selectUserArchivesList",
+                "selectUserArchivesCount", params, in.getPageNo(), in.getPageSize());
+    }
 }