Просмотр исходного кода

Merge branch 'test2' into test

# Conflicts:
#	src/main/java/com/goafanti/common/dao/UserArchivesMapper.java
#	src/main/java/com/goafanti/common/model/UserArchives.java
#	src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java
anderx 1 год назад
Родитель
Сommit
03052da5ee
23 измененных файлов с 505 добавлено и 268 удалено
  1. 46 0
      src/main/java/com/goafanti/admin/bo/AdminCustomerBo.java
  2. 30 0
      src/main/java/com/goafanti/admin/bo/DepCountBo.java
  3. 3 0
      src/main/java/com/goafanti/admin/service/AdminService.java
  4. 51 1
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  5. 3 2
      src/main/java/com/goafanti/common/dao/UserArchivesMapper.java
  6. 2 0
      src/main/java/com/goafanti/common/dao/UserMapper.java
  7. 1 1
      src/main/java/com/goafanti/common/dao/UserServiceMapper.java
  8. 1 1
      src/main/java/com/goafanti/common/mapper/UserArchivesMapper.xml
  9. 55 41
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  10. 126 97
      src/main/java/com/goafanti/common/mapper/UserServiceMapper.xml
  11. 15 16
      src/main/java/com/goafanti/common/model/UserArchives.java
  12. 14 2
      src/main/java/com/goafanti/common/model/UserService.java
  13. 1 1
      src/main/java/com/goafanti/common/task/ReleaseUserTask.java
  14. 9 0
      src/main/java/com/goafanti/customer/bo/InputAddCustomer.java
  15. 83 83
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  16. 2 0
      src/main/java/com/goafanti/customer/service/CustomerService.java
  17. 7 1
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  18. 2 1
      src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java
  19. 3 1
      src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java
  20. 19 0
      src/main/java/com/goafanti/user/bo/InputListOrderUserService.java
  21. 13 0
      src/main/java/com/goafanti/user/bo/OutOrderUserService.java
  22. 9 9
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java
  23. 10 11
      src/main/java/com/goafanti/user/service/impl/UserServiceServiceImpl.java

+ 46 - 0
src/main/java/com/goafanti/admin/bo/AdminCustomerBo.java

@@ -1,29 +1,75 @@
 package com.goafanti.admin.bo;
 package com.goafanti.admin.bo;
 
 
 
 
+import com.goafanti.common.utils.excel.Excel;
+
 public class AdminCustomerBo {
 public class AdminCustomerBo {
 	private String aid;
 	private String aid;
+	@Excel( name = "名称")
 	private String aName;
 	private String aName;
 	private String depId;
 	private String depId;
+	@Excel( name = "部门")
 	private String depName;
 	private String depName;
 	/** 私有数 */
 	/** 私有数 */
+	@Excel( name = "私有数",width = 12)
 	private Integer userCount;
 	private Integer userCount;
 	/** 渠道数 */
 	/** 渠道数 */
+	@Excel( name = "渠道数",width = 12)
 	private Integer channelCount;
 	private Integer channelCount;
 	/** 签单数 */
 	/** 签单数 */
+	@Excel( name = "签单数",width = 12)
 	private Integer signCount;
 	private Integer signCount;
 	/** 私有新增数 */
 	/** 私有新增数 */
+	@Excel( name = "私有新增数",width = 12)
 	private Integer newCount;
 	private Integer newCount;
 	/** 渠道新增数 */
 	/** 渠道新增数 */
+	@Excel( name = "渠道新增数",width = 12)
 	private Integer channelNewCount;
 	private Integer channelNewCount;
 	/** 私有面谈数 */
 	/** 私有面谈数 */
+	@Excel( name = "私有面谈数",width = 12)
 	private Integer completeCount;
 	private Integer completeCount;
 	/** 渠道面谈数 */
 	/** 渠道面谈数 */
+	@Excel( name = "渠道面谈数",width = 12)
 	private Integer channelCompleteCount;
 	private Integer channelCompleteCount;
 	/** 私有领取数 */
 	/** 私有领取数 */
+	@Excel( name = "私有领取数",width = 12)
 	private Integer receiveCount;
 	private Integer receiveCount;
 	/** 私有转交数 */
 	/** 私有转交数 */
+	@Excel( name = "私有转交数",width = 12)
 	private Integer transferCount;
 	private Integer transferCount;
+	/** 一般客戶 */
+	@Excel( name = "一般客户",width = 12)
+	private Integer generalCount;
+	/** 私有客戶 */
+	@Excel( name = "私有客户",width = 12)
+	private Integer intentionCount;
+	/** 重点客户 */
+	@Excel( name = "重点客户",width = 12)
+	private Integer keynoteCount;
+
+	public Integer getGeneralCount() {
+		return generalCount;
+	}
+
+	public void setGeneralCount(Integer generalCount) {
+		this.generalCount = generalCount;
+	}
+
+	public Integer getIntentionCount() {
+		return intentionCount;
+	}
+
+	public void setIntentionCount(Integer intentionCount) {
+		this.intentionCount = intentionCount;
+	}
+
+	public Integer getKeynoteCount() {
+		return keynoteCount;
+	}
+
+	public void setKeynoteCount(Integer keynoteCount) {
+		this.keynoteCount = keynoteCount;
+	}
 
 
 	public Integer getTransferCount() {
 	public Integer getTransferCount() {
 		return transferCount;
 		return transferCount;

+ 30 - 0
src/main/java/com/goafanti/admin/bo/DepCountBo.java

@@ -16,9 +16,39 @@ public class DepCountBo {
 	private Integer transferCount;
 	private Integer transferCount;
 	private Integer channelNewCount;
 	private Integer channelNewCount;
 	private Integer channelCompleteCount;
 	private Integer channelCompleteCount;
+	/** 一般客戶 */
+	private Integer generalCount;
+	/** 私有客戶 */
+	private Integer intentionCount;
+	/** 重点客户 */
+	private Integer keynoteCount;
 	private List<DepCountBo> list;
 	private List<DepCountBo> list;
 	private List<AdminCustomerBo> aList;
 	private List<AdminCustomerBo> aList;
 
 
+	public Integer getGeneralCount() {
+		return generalCount;
+	}
+
+	public void setGeneralCount(Integer generalCount) {
+		this.generalCount = generalCount;
+	}
+
+	public Integer getIntentionCount() {
+		return intentionCount;
+	}
+
+	public void setIntentionCount(Integer intentionCount) {
+		this.intentionCount = intentionCount;
+	}
+
+	public Integer getKeynoteCount() {
+		return keynoteCount;
+	}
+
+	public void setKeynoteCount(Integer keynoteCount) {
+		this.keynoteCount = keynoteCount;
+	}
+
 	public Integer getTransferCount() {
 	public Integer getTransferCount() {
 		return transferCount;
 		return transferCount;
 	}
 	}

+ 3 - 0
src/main/java/com/goafanti/admin/service/AdminService.java

@@ -1,6 +1,7 @@
 package com.goafanti.admin.service;
 package com.goafanti.admin.service;
 
 
 import com.goafanti.admin.bo.*;
 import com.goafanti.admin.bo.*;
+import com.goafanti.common.bo.Result;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Admin;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 
 
@@ -86,4 +87,6 @@ public interface AdminService {
 
 
 
 
     Object pushStatistics() ;
     Object pushStatistics() ;
+
+	Result selectAllUserExport(String depId, String startTime, String endTime, String aName);
 }
 }

+ 51 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -4,6 +4,7 @@ import com.goafanti.admin.bo.*;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.admin.service.NewAdminService;
 import com.goafanti.admin.service.NewAdminService;
+import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.*;
 import com.goafanti.common.dao.*;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.error.BusinessException;
@@ -11,6 +12,7 @@ import com.goafanti.common.model.*;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -18,6 +20,7 @@ import com.goafanti.customer.bo.BusinessListBo;
 import com.goafanti.organization.bo.OrganizationListOut;
 import com.goafanti.organization.bo.OrganizationListOut;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
@@ -60,6 +63,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	@Autowired
 	@Autowired
 	private FinanceCountMapper financeCountMapper;
 	private FinanceCountMapper financeCountMapper;
 
 
+	@Value(value = "${upload.path}")
+	private String uploadPath = null;
+
 
 
 
 
 
 
@@ -445,6 +451,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 						admin.setChannelNewCount(user.getChannelNewCount());
 						admin.setChannelNewCount(user.getChannelNewCount());
 						admin.setReceiveCount(user.getReceiveCount());
 						admin.setReceiveCount(user.getReceiveCount());
 						admin.setTransferCount(user.getTransferCount());
 						admin.setTransferCount(user.getTransferCount());
+						admin.setIntentionCount(user.getIntentionCount());
+						admin.setKeynoteCount(user.getKeynoteCount());
+						admin.setGeneralCount(user.getGeneralCount());
 						break;
 						break;
 					}
 					}
 				}
 				}
@@ -471,6 +480,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		if (admin.getCompleteCount()==null) admin.setCompleteCount(0);
 		if (admin.getCompleteCount()==null) admin.setCompleteCount(0);
 		if (admin.getChannelCompleteCount()==null) admin.setChannelCompleteCount(0);
 		if (admin.getChannelCompleteCount()==null) admin.setChannelCompleteCount(0);
 		if (admin.getTransferCount()==null)admin.setTransferCount(0);
 		if (admin.getTransferCount()==null)admin.setTransferCount(0);
+		if (admin.getIntentionCount()==null)admin.setIntentionCount(0);
+		if (admin.getKeynoteCount()==null)admin.setKeynoteCount(0);
+		if (admin.getGeneralCount()==null)admin.setGeneralCount(0);
 	}
 	}
 
 
 	//迭代获取所有部门与部门员工并计算出部门数量
 	//迭代获取所有部门与部门员工并计算出部门数量
@@ -493,7 +505,8 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	 * @param ab
 	 * @param ab
 	 */
 	 */
 	public void sumCount(DepCountBo ab) {
 	public void sumCount(DepCountBo ab) {
-		int completeCount=0,receiveCount=0,userCount=0,signCount=0,channelCount=0,newCount=0,channelNewCount=0,channelCompleteCount=0,transferCount=0;
+		int completeCount=0,receiveCount=0,userCount=0,signCount=0,channelCount=0,newCount=0,channelNewCount=0,
+				channelCompleteCount=0,transferCount=0,intentionCount=0,keynoteCount=0,generalCount=0;
 		if (ab.getList()!=null&&!ab.getList().isEmpty()) {
 		if (ab.getList()!=null&&!ab.getList().isEmpty()) {
 			for (DepCountBo a : ab.getList()) {
 			for (DepCountBo a : ab.getList()) {
 				if (a.getCompleteCount()!=null&& a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
 				if (a.getCompleteCount()!=null&& a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
@@ -505,6 +518,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 				if (a.getChannelNewCount()!=null&& a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
 				if (a.getChannelNewCount()!=null&& a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
 				if (a.getChannelCompleteCount()!=null&& a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
 				if (a.getChannelCompleteCount()!=null&& a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
 				if (a.getTransferCount()!=null&& a.getTransferCount()!=0)transferCount+=a.getTransferCount();
 				if (a.getTransferCount()!=null&& a.getTransferCount()!=0)transferCount+=a.getTransferCount();
+				if (a.getIntentionCount()!=null&& a.getIntentionCount()!=0) intentionCount+=a.getIntentionCount();
+				if (a.getKeynoteCount()!=null&& a.getKeynoteCount()!=0) keynoteCount+=a.getKeynoteCount();
+				if (a.getGeneralCount()!=null&& a.getGeneralCount()!=0) generalCount=a.getGeneralCount();
 			}
 			}
 		}
 		}
 		if (ab.getaList()!=null&&!ab.getaList().isEmpty()) {
 		if (ab.getaList()!=null&&!ab.getaList().isEmpty()) {
@@ -518,6 +534,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 				if (a.getChannelNewCount()!=null&& a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
 				if (a.getChannelNewCount()!=null&& a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
 				if (a.getChannelCompleteCount()!=null&& a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
 				if (a.getChannelCompleteCount()!=null&& a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
 				if (a.getTransferCount()!=null&& a.getTransferCount()!=0)transferCount+=a.getTransferCount();
 				if (a.getTransferCount()!=null&& a.getTransferCount()!=0)transferCount+=a.getTransferCount();
+				if (a.getIntentionCount()!=null&& a.getIntentionCount()!=0) intentionCount+=a.getIntentionCount();
+				if (a.getKeynoteCount()!=null&& a.getKeynoteCount()!=0) keynoteCount+=a.getKeynoteCount();
+				if (a.getGeneralCount()!=null&& a.getGeneralCount()!=0) generalCount=a.getGeneralCount();
 			}
 			}
 		}
 		}
 		ab.setCompleteCount(completeCount);
 		ab.setCompleteCount(completeCount);
@@ -529,6 +548,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		ab.setChannelNewCount(channelNewCount);
 		ab.setChannelNewCount(channelNewCount);
 		ab.setChannelCompleteCount(channelCompleteCount);
 		ab.setChannelCompleteCount(channelCompleteCount);
 		ab.setTransferCount(transferCount);
 		ab.setTransferCount(transferCount);
+		ab.setIntentionCount(intentionCount);
+		ab.setKeynoteCount(keynoteCount);
+		ab.setGeneralCount(generalCount);
 
 
 	}
 	}
 
 
@@ -691,6 +713,34 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		return 1;
 		return 1;
 	}
 	}
 
 
+	@Override
+	public Result selectAllUserExport(String depId, String startTime, String endTime, String aName) {
+		String endTimeStr=endTime+" 23:59:59";
+		List<Department> depIds=new ArrayList<>();
+		//总裁助力不查看老员工
+		Integer seniorstaff = null;
+		if (TokenManager.hasRole(AFTConstants.CED_ASSISTANT)){
+			seniorstaff=0;
+		}
+		OrganizationListOut oo=departmentMapper.selectAllById(depId);
+		if(TokenManager.hasRole(AFTConstants.OPERATION_MANAGER)){
+			List<String> myShiroDep = departmentService.selectMyDeps();
+			if (!myShiroDep.contains(depId))throw new BusinessException("无权查看此部门信息");
+		}
+		depIds =departmentService.selectSubordinateDeps(depId);
+		Department department = new Department();
+		department.setId(depId);
+		depIds.add(department);
+		List<AdminCustomerBo> list =null;
+		//原sql计算
+//		list=departmentMapper.AlldepCount(depIds,startTime,  endTime);
+		//新java计算
+		list=AllDepCount(depIds,startTime,endTimeStr,seniorstaff);
+		NewExcelUtil excel=new NewExcelUtil(AdminCustomerBo.class);
+		String sheetName=String.format("部门统计表_%s~%s",startTime,endTime);
+		return excel.exportExcel(list,sheetName,uploadPath);
+	}
+
 	/**
 	/**
 	 *
 	 *
 	 * @param list
 	 * @param list

+ 3 - 2
src/main/java/com/goafanti/common/dao/UserArchivesMapper.java

@@ -10,7 +10,7 @@ import java.util.List;
  * 客户档案表(UserArchives)表数据库访问层
  * 客户档案表(UserArchives)表数据库访问层
  *
  *
  * @author makejava
  * @author makejava
- * @since 2024-09-26 15:29:28
+ * @since 2024-08-12 10:38:57
  */
  */
 public interface UserArchivesMapper {
 public interface UserArchivesMapper {
 
 
@@ -22,12 +22,13 @@ public interface UserArchivesMapper {
      */
      */
     UserArchives queryById(Integer id);
     UserArchives queryById(Integer id);
 
 
+    
 
 
     /**
     /**
      * 查询指定行数据
      * 查询指定行数据
      *
      *
      * @param userArchives 查询条件
      * @param userArchives 查询条件
-     * @param pageable     分页对象
+     * @param pageable         分页对象
      * @return 对象列表
      * @return 对象列表
      */
      */
     List<UserArchives> findUserArchivesList(UserArchives userArchives, @Param("pageable") Pageable pageable);
     List<UserArchives> findUserArchivesList(UserArchives userArchives, @Param("pageable") Pageable pageable);

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -256,4 +256,6 @@ public interface UserMapper {
     void updateUserShareType(List<LockingReleaseBo> newList);
     void updateUserShareType(List<LockingReleaseBo> newList);
 
 
     List<LockingReleaseBo > selectSignReleaseUser(String id);
     List<LockingReleaseBo > selectSignReleaseUser(String id);
+
+    int selectUserLevel(String aid);
 }
 }

+ 1 - 1
src/main/java/com/goafanti/common/dao/UserServiceMapper.java

@@ -10,7 +10,7 @@ import java.util.List;
  * 客服信息表(UserService)表数据库访问层
  * 客服信息表(UserService)表数据库访问层
  *
  *
  * @author makejava
  * @author makejava
- * @since 2024-11-06 09:00:41
+ * @since 2024-11-11 17:01:53
  */
  */
 public interface UserServiceMapper {
 public interface UserServiceMapper {
 
 

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

@@ -299,7 +299,7 @@
     <select id="selectUserArchivesList" resultType="com.goafanti.customer.bo.OutSelectUserArchives">
     <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.sign_bills signBills,
         select a.id , a.nickname ,d1.name as  province ,d2.name as  city ,d3.name area ,a.sign_bills signBills,
         a.share_type as shareType ,d.channel_type as channelType ,e.enterprise_count as enterpriseCount,
         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,
+        c.name contactName,f.name adminName,e.channel_indicators as channelIndicators,a.update_time as updateTime,
         e.interview_ideas as interviewIdeas ,b.intended_project as intendedProject,
         e.interview_ideas as interviewIdeas ,b.intended_project as intendedProject,
         e.interview_distribution as interviewDistribution, g.name depName,
         e.interview_distribution as interviewDistribution, g.name depName,
         ic.name as  industry ,b.business_scope as businessScope ,e.financial_data as financialData,
         ic.name as  industry ,b.business_scope as businessScope ,e.financial_data as financialData,

+ 55 - 41
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -103,25 +103,27 @@
 		left join district_glossory dg2 on b.city = dg2.id
 		left join district_glossory dg2 on b.city = dg2.id
 		left join district_glossory dg3 on b.area = dg3.id
 		left join district_glossory dg3 on b.area = dg3.id
 		left join industry_category c on b.industry = c.id
 		left join industry_category c on b.industry = c.id
-		left join admin d on t0.aid = d.id where 1=1
-		<if test="name != null and name != ''">
-			and t0.identify_name like concat('%',#{name},'%')
-		</if>
-		<if test="startDate != null and startDate != ''">
-			and t0.transfer_time &gt; #{startDate}
-		</if>
-		<if test="endDate != null and endDate != ''">
-			and t0.transfer_time &lt; #{endDate}
-		</if>
-		<if test="province != null">
-			and b.province = #{province,jdbcType=INTEGER}
-		</if>
-		<if test="city != null">
-			and b.city = #{city,jdbcType=INTEGER}
-		</if>
-		<if test="area != null">
-			and b.area = #{area,jdbcType=INTEGER}
-		</if>
+		left join admin d on t0.aid = d.id
+		<where>
+			<if test="name != null and name != ''">
+				and t0.identify_name like concat('%',#{name},'%')
+			</if>
+			<if test="startDate != null and startDate != ''">
+				and t0.transfer_time &gt; #{startDate}
+			</if>
+			<if test="endDate != null and endDate != ''">
+				and t0.transfer_time &lt; #{endDate}
+			</if>
+			<if test="province != null">
+				and b.province = #{province,jdbcType=INTEGER}
+			</if>
+			<if test="city != null">
+				and b.city = #{city,jdbcType=INTEGER}
+			</if>
+			<if test="area != null">
+				and b.area = #{area,jdbcType=INTEGER}
+			</if>
+		</where>
 		 order by orderTime
 		 order by orderTime
 		 <if test="page_sql != null">
 		 <if test="page_sql != null">
     		${page_sql}
     		${page_sql}
@@ -131,25 +133,27 @@
 		select count(0)
 		select count(0)
 		from
 		from
 			(select id,aid,type,share_type,transfer_time,identify_name,society_tag from user where aid = #{aid} and type = 0 and share_type = 0 and status != 1)t0
 			(select id,aid,type,share_type,transfer_time,identify_name,society_tag from user where aid = #{aid} and type = 0 and share_type = 0 and status != 1)t0
-		left join user_identity b on t0.id = b.uid where 1=1
-		<if test="name != null and name != ''">
-			and t0.identify_name like concat('%',#{name},'%')
-		</if>
-		<if test="startDate != null and startDate != ''">
-			and t0.transfer_time &gt; #{startDate}
-		</if>
-		<if test="endDate != null and endDate != ''">
-			and t0.transfer_time &lt; #{endDate}
-		</if>
-		<if test="province != null">
-			and b.province = #{province,jdbcType=INTEGER}
-		</if>
-		<if test="city != null">
-			and b.city = #{city,jdbcType=INTEGER}
-		</if>
-		<if test="area != null">
-			and b.area = #{area,jdbcType=INTEGER}
-		</if>
+		left join user_identity b on t0.id = b.uid
+		 <where>
+			 <if test="name != null and name != ''">
+				 and t0.identify_name like concat('%',#{name},'%')
+			 </if>
+			 <if test="startDate != null and startDate != ''">
+				 and t0.transfer_time &gt; #{startDate}
+			 </if>
+			 <if test="endDate != null and endDate != ''">
+				 and t0.transfer_time &lt; #{endDate}
+			 </if>
+			 <if test="province != null">
+				 and b.province = #{province,jdbcType=INTEGER}
+			 </if>
+			 <if test="city != null">
+				 and b.city = #{city,jdbcType=INTEGER}
+			 </if>
+			 <if test="area != null">
+				 and b.area = #{area,jdbcType=INTEGER}
+			 </if>
+		 </where>
 	</select>
 	</select>
 	<select id="selectPublicPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
 	<select id="selectPublicPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
 		select
 		select
@@ -2328,7 +2332,11 @@ inner join(
 		sum(if(share_type=0 and source =1 and channel=0,1,0))newCount,
 		sum(if(share_type=0 and source =1 and channel=0,1,0))newCount,
 		sum(if(share_type=0 and source =3 and channel=0,1,0))transferCount,
 		sum(if(share_type=0 and source =3 and channel=0,1,0))transferCount,
 		sum(if(share_type=0 and source =1 and channel=1,1,0))channelNewCount,
 		sum(if(share_type=0 and source =1 and channel=1,1,0))channelNewCount,
-		sum(if(share_type=0 and source =2 and channel=0,1,0))receiveCount from `user` where `type` =1 and new_channel=0
+		sum(if(share_type=0 and source =2 and channel=0,1,0))receiveCount,
+		sum(if(share_type=0 and `level` =0,1,0))generalCount,
+		sum(if(share_type=0 and `level` =1,1,0))intentionCount,
+		sum(if(share_type=0 and `level` =2,1,0))keynoteCount
+		from `user` where `type` =1 and new_channel=0   and source in(1,2,3)
 		<if test="startTime != null and endTime != null">
 		<if test="startTime != null and endTime != null">
 			and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
 			and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
 		</if>
 		</if>
@@ -2362,7 +2370,7 @@ inner join(
 	</select>
 	</select>
 
 
 	<select id="selectByaidAndDate" resultType="com.goafanti.common.model.AdminUserCount">
 	<select id="selectByaidAndDate" resultType="com.goafanti.common.model.AdminUserCount">
-		SELECT aid,dateTime,sum(privateCount)privateCount,sum(channelCount)channelCount,sum(signCount)signCount
+		SELECT aid,dateTime,sum(privateCount)as privateCount,sum(channelCount) as channelCount,sum(signCount)as signCount
 		from ( select aid,DATE_FORMAT(a.transfer_time , '%Y-%m-%d') dateTime,
 		from ( select aid,DATE_FORMAT(a.transfer_time , '%Y-%m-%d') dateTime,
 					  if(share_type=0 and new_channel=0,1,0) privateCount,
 					  if(share_type=0 and new_channel=0,1,0) privateCount,
 					  if(share_type=0 and new_channel=1,1,0)channelCount, if(share_type=2,1,0)signCount
 					  if(share_type=0 and new_channel=1,1,0)channelCount, if(share_type=2,1,0)signCount
@@ -2371,7 +2379,7 @@ inner join(
 		    )x group by aid,dateTime
 		    )x group by aid,dateTime
 	</select>
 	</select>
 	<select id="selectListByaidAndDate" resultType="com.goafanti.common.model.AdminUserCount">
 	<select id="selectListByaidAndDate" resultType="com.goafanti.common.model.AdminUserCount">
-		SELECT aid,dateTime,sum(privateCount)privateCount,sum(channelCount)channelCount,sum(signCount)signCount
+		SELECT aid,dateTime,sum(privateCount)as privateCount,sum(channelCount)as channelCount,sum(signCount)as signCount
 		from ( select aid,DATE_FORMAT(a.transfer_time , '%Y-%m-%d') dateTime,
 		from ( select aid,DATE_FORMAT(a.transfer_time , '%Y-%m-%d') dateTime,
 		if(share_type=0 and new_channel=0,1,0) privateCount,
 		if(share_type=0 and new_channel=0,1,0) privateCount,
 		if(share_type=0 and new_channel=1,1,0)channelCount, if(share_type=2,1,0)signCount
 		if(share_type=0 and new_channel=1,1,0)channelCount, if(share_type=2,1,0)signCount
@@ -2510,4 +2518,10 @@ inner join(
 			and a.level = #{level}
 			and a.level = #{level}
 		</if>
 		</if>
 	</select>
 	</select>
+	<select id="selectUserLevel" resultType="java.lang.Integer">
+		select sum(level is null) sums
+		from user a
+		where a.type= 1 and a.source in(1,2,3) and a.share_type = 0 and a.new_channel=0
+		and aid = #{aid}
+	</select>
 </mapper>
 </mapper>

+ 126 - 97
src/main/java/com/goafanti/common/mapper/UserServiceMapper.xml

@@ -18,10 +18,11 @@
         <result property="techSatisfaction" column="tech_satisfaction" jdbcType="INTEGER"/>
         <result property="techSatisfaction" column="tech_satisfaction" jdbcType="INTEGER"/>
         <result property="businessSatisfaction" column="business_satisfaction" jdbcType="INTEGER"/>
         <result property="businessSatisfaction" column="business_satisfaction" jdbcType="INTEGER"/>
         <result property="addGroupChat" column="add_group_chat" jdbcType="INTEGER"/>
         <result property="addGroupChat" column="add_group_chat" jdbcType="INTEGER"/>
+        <result property="addGroupChatTime" column="add_group_chat_time" jdbcType="TIMESTAMP"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="UserServiceAllSql">
     <sql id="UserServiceAllSql">
-        id, uid, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id, new_time, remarks, create_time, tech_satisfaction, business_satisfaction, add_group_chat
+        id, uid, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id, new_time, remarks, create_time, tech_satisfaction, business_satisfaction, add_group_chat, add_group_chat_time
     </sql>
     </sql>
 
 
     <!--查询单个-->
     <!--查询单个-->
@@ -84,6 +85,9 @@
             <if test="addGroupChat != null">
             <if test="addGroupChat != null">
                 and add_group_chat = #{addGroupChat}
                 and add_group_chat = #{addGroupChat}
             </if>
             </if>
+            <if test="addGroupChatTime != null">
+                and add_group_chat_time = #{addGroupChatTime}
+            </if>
         </where>
         </where>
         <if test="page_sql != null">
         <if test="page_sql != null">
             ${page_sql}
             ${page_sql}
@@ -140,6 +144,9 @@
             <if test="addGroupChat != null">
             <if test="addGroupChat != null">
                 and add_group_chat = #{addGroupChat}
                 and add_group_chat = #{addGroupChat}
             </if>
             </if>
+            <if test="addGroupChatTime != null">
+                and add_group_chat_time = #{addGroupChatTime}
+            </if>
         </where>
         </where>
     </select>
     </select>
 
 
@@ -147,11 +154,112 @@
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
         insert into user_service(uid, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id,
         insert into user_service(uid, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id,
                                  new_time, remarks, create_time, tech_satisfaction, business_satisfaction,
                                  new_time, remarks, create_time, tech_satisfaction, business_satisfaction,
-                                 add_group_chat)
+                                 add_group_chat, add_group_chat_time)
         values (#{uid}, #{aid}, #{addWechat}, #{wechat}, #{renewal}, #{renewalTime}, #{signProject}, #{signProjectId},
         values (#{uid}, #{aid}, #{addWechat}, #{wechat}, #{renewal}, #{renewalTime}, #{signProject}, #{signProjectId},
-                #{newTime}, #{remarks}, #{createTime}, #{techSatisfaction}, #{businessSatisfaction}, #{addGroupChat})
+                #{newTime}, #{remarks}, #{createTime}, #{techSatisfaction}, #{businessSatisfaction}, #{addGroupChat},
+                #{addGroupChatTime})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into user_service(uid, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id,
+        new_time, remarks, create_time, tech_satisfaction, business_satisfaction, add_group_chat, add_group_chat_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.aid}, #{entity.addWechat}, #{entity.wechat}, #{entity.renewal},
+            #{entity.renewalTime}, #{entity.signProject}, #{entity.signProjectId}, #{entity.newTime}, #{entity.remarks},
+            #{entity.createTime}, #{entity.techSatisfaction}, #{entity.businessSatisfaction}, #{entity.addGroupChat},
+            #{entity.addGroupChatTime})
+        </foreach>
     </insert>
     </insert>
 
 
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into user_service(uid, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id,
+        new_time, remarks, create_time, tech_satisfaction, business_satisfaction, add_group_chat, add_group_chat_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.aid}, #{entity.addWechat}, #{entity.wechat}, #{entity.renewal},
+            #{entity.renewalTime}, #{entity.signProject}, #{entity.signProjectId}, #{entity.newTime}, #{entity.remarks},
+            #{entity.createTime}, #{entity.techSatisfaction}, #{entity.businessSatisfaction}, #{entity.addGroupChat},
+            #{entity.addGroupChatTime})
+        </foreach>
+        on duplicate key update
+        uid = values(uid),
+        aid = values(aid),
+        add_wechat = values(add_wechat),
+        wechat = values(wechat),
+        renewal = values(renewal),
+        renewal_time = values(renewal_time),
+        sign_project = values(sign_project),
+        sign_project_id = values(sign_project_id),
+        new_time = values(new_time),
+        remarks = values(remarks),
+        create_time = values(create_time),
+        tech_satisfaction = values(tech_satisfaction),
+        business_satisfaction = values(business_satisfaction),
+        add_group_chat = values(add_group_chat),
+        add_group_chat_time = values(add_group_chat_time)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update user_service
+        <set>
+            <if test="uid != null and uid != ''">
+                uid = #{uid},
+            </if>
+            <if test="aid != null and aid != ''">
+                aid = #{aid},
+            </if>
+            <if test="addWechat != null">
+                add_wechat = #{addWechat},
+            </if>
+            <if test="wechat != null and wechat != ''">
+                wechat = #{wechat},
+            </if>
+            <if test="renewal != null">
+                renewal = #{renewal},
+            </if>
+            <if test="renewalTime != null">
+                renewal_time = #{renewalTime},
+            </if>
+            <if test="signProject != null and signProject != ''">
+                sign_project = #{signProject},
+            </if>
+            <if test="signProjectId != null and signProjectId != ''">
+                sign_project_id = #{signProjectId},
+            </if>
+            <if test="newTime != null">
+                new_time = #{newTime},
+            </if>
+            <if test="remarks != null and remarks != ''">
+                remarks = #{remarks},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="techSatisfaction != null">
+                tech_satisfaction = #{techSatisfaction},
+            </if>
+            <if test="businessSatisfaction != null">
+                business_satisfaction = #{businessSatisfaction},
+            </if>
+            <if test="addGroupChat != null">
+                add_group_chat = #{addGroupChat},
+            </if>
+            <if test="addGroupChatTime != null">
+                add_group_chat_time = #{addGroupChatTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from user_service
+        where id = #{id}
+    </delete>
+    <!--部分新增-->
     <insert id="insertSelective" parameterType="com.goafanti.common.model.UserService">
     <insert id="insertSelective" parameterType="com.goafanti.common.model.UserService">
         <!--
         <!--
           WARNING - @mbg.generated
           WARNING - @mbg.generated
@@ -205,6 +313,9 @@
             <if test="addGroupChat != null">
             <if test="addGroupChat != null">
                 add_group_chat,
                 add_group_chat,
             </if>
             </if>
+            <if test="addGroupChatTime != null">
+                add_group_chat_time,
+            </if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">
             <if test="id != null">
@@ -252,103 +363,12 @@
             <if test="addGroupChat != null">
             <if test="addGroupChat != null">
                 #{addGroupChat,jdbcType=INTEGER},
                 #{addGroupChat,jdbcType=INTEGER},
             </if>
             </if>
+            <if test="addGroupChatTime != null">
+                #{addGroupChatTime},
+            </if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
-    <insert id="insertBatch">
-        insert into user_service(uid, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id,
-        new_time, remarks, create_time, tech_satisfaction, business_satisfaction, add_group_chat)
-        values
-        <foreach collection="entities" item="entity" separator=",">
-            (#{entity.uid}, #{entity.aid}, #{entity.addWechat}, #{entity.wechat}, #{entity.renewal},
-            #{entity.renewalTime}, #{entity.signProject}, #{entity.signProjectId}, #{entity.newTime}, #{entity.remarks},
-            #{entity.createTime}, #{entity.techSatisfaction}, #{entity.businessSatisfaction}, #{entity.addGroupChat})
-        </foreach>
-    </insert>
-
-    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
-        insert into user_service(uid, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id,
-        new_time, remarks, create_time, tech_satisfaction, business_satisfaction, add_group_chat)
-        values
-        <foreach collection="entities" item="entity" separator=",">
-            (#{entity.uid}, #{entity.aid}, #{entity.addWechat}, #{entity.wechat}, #{entity.renewal},
-            #{entity.renewalTime}, #{entity.signProject}, #{entity.signProjectId}, #{entity.newTime}, #{entity.remarks},
-            #{entity.createTime}, #{entity.techSatisfaction}, #{entity.businessSatisfaction}, #{entity.addGroupChat})
-        </foreach>
-        on duplicate key update
-        uid = values(uid),
-        aid = values(aid),
-        add_wechat = values(add_wechat),
-        wechat = values(wechat),
-        renewal = values(renewal),
-        renewal_time = values(renewal_time),
-        sign_project = values(sign_project),
-        sign_project_id = values(sign_project_id),
-        new_time = values(new_time),
-        remarks = values(remarks),
-        create_time = values(create_time),
-        tech_satisfaction = values(tech_satisfaction),
-        business_satisfaction = values(business_satisfaction),
-        add_group_chat = values(add_group_chat)
-    </insert>
-
-    <!--通过主键修改数据-->
-    <update id="update">
-        update user_service
-        <set>
-            <if test="uid != null and uid != ''">
-                uid = #{uid},
-            </if>
-            <if test="aid != null and aid != ''">
-                aid = #{aid},
-            </if>
-            <if test="addWechat != null">
-                add_wechat = #{addWechat},
-            </if>
-            <if test="wechat != null and wechat != ''">
-                wechat = #{wechat},
-            </if>
-            <if test="renewal != null">
-                renewal = #{renewal},
-            </if>
-            <if test="renewalTime != null">
-                renewal_time = #{renewalTime},
-            </if>
-            <if test="signProject != null and signProject != ''">
-                sign_project = #{signProject},
-            </if>
-            <if test="signProjectId != null and signProjectId != ''">
-                sign_project_id = #{signProjectId},
-            </if>
-            <if test="newTime != null">
-                new_time = #{newTime},
-            </if>
-            <if test="remarks != null and remarks != ''">
-                remarks = #{remarks},
-            </if>
-            <if test="createTime != null">
-                create_time = #{createTime},
-            </if>
-            <if test="techSatisfaction != null">
-                tech_satisfaction = #{techSatisfaction},
-            </if>
-            <if test="businessSatisfaction != null">
-                business_satisfaction = #{businessSatisfaction},
-            </if>
-            <if test="addGroupChat != null">
-                add_group_chat = #{addGroupChat},
-            </if>
-        </set>
-        where id = #{id}
-    </update>
-
-    <!--通过主键删除-->
-    <delete id="deleteById">
-        delete
-        from user_service
-        where id = #{id}
-    </delete>
-
     <select id="selectByUid" resultType="java.lang.Integer">
     <select id="selectByUid" resultType="java.lang.Integer">
         select id from user_service where uid= #{uid}
         select id from user_service where uid= #{uid}
     </select>
     </select>
@@ -375,6 +395,7 @@
         <result column="techSatisfaction" property="techSatisfaction" />
         <result column="techSatisfaction" property="techSatisfaction" />
         <result column="businessSatisfaction" property="businessSatisfaction" />
         <result column="businessSatisfaction" property="businessSatisfaction" />
         <result column="add_group_chat" property="addGroupChat" />
         <result column="add_group_chat" property="addGroupChat" />
+        <result column="add_group_chat_time" property="addGroupChatTime" />
         <association column="orderNo" javaType="java.util.ArrayList" property="list" select="getTask" />
         <association column="orderNo" javaType="java.util.ArrayList" property="list" select="getTask" />
     </resultMap>
     </resultMap>
 
 
@@ -388,6 +409,7 @@
     <select id="OrderUseServiceList" resultMap="userService">
     <select id="OrderUseServiceList" resultMap="userService">
         select a.order_no orderNo,a.contract_no contractNo,b.dep_name depName ,a.buyer_id uid,a.create_time ,b.buyer_name userName,c.new_time ,
         select a.order_no orderNo,a.contract_no contractNo,b.dep_name depName ,a.buyer_id uid,a.create_time ,b.buyer_name userName,c.new_time ,
         date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as orderTimes, date_format(c.new_time,'%Y-%m-%d %H:%i:%S') as newTimes,c.add_group_chat,
         date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as orderTimes, date_format(c.new_time,'%Y-%m-%d %H:%i:%S') as newTimes,c.add_group_chat,
+        c.add_group_chat_time ,
         date_format(c.renewal_time,'%Y-%m-%d') as renewalTimes, date_format(a.sign_time,'%Y-%m-%d') as signTimes,a.delete_sign deleteSign ,
         date_format(c.renewal_time,'%Y-%m-%d') as renewalTimes, date_format(a.sign_time,'%Y-%m-%d') as signTimes,a.delete_sign deleteSign ,
         d.name adminName,c.add_wechat addWechat,c.wechat ,c.renewal ,c.renewal_time ,c.sign_project signProject ,c.remarks,
         d.name adminName,c.add_wechat addWechat,c.wechat ,c.renewal ,c.renewal_time ,c.sign_project signProject ,c.remarks,
         c.tech_satisfaction techSatisfaction, c.business_satisfaction businessSatisfaction
         c.tech_satisfaction techSatisfaction, c.business_satisfaction businessSatisfaction
@@ -422,6 +444,9 @@
         <if test="addGroupChat != null">
         <if test="addGroupChat != null">
             and c.add_group_chat = #{addGroupChat}
             and c.add_group_chat = #{addGroupChat}
         </if>
         </if>
+        <if test="addGroupChatTimeStart != null">
+            and c.add_group_chat_time BETWEEN #{addGroupChatTimeStart} and #{addGroupChatTimeEnd}
+        </if>
         order by c.new_time,a.create_time
         order by c.new_time,a.create_time
         <if test="page_sql != null">
         <if test="page_sql != null">
             ${page_sql}
             ${page_sql}
@@ -461,6 +486,10 @@
         <if test="addGroupChat != null">
         <if test="addGroupChat != null">
             and c.add_group_chat = #{addGroupChat}
             and c.add_group_chat = #{addGroupChat}
         </if>
         </if>
+        <if test="addGroupChatTimeStart != null">
+            and c.add_group_chat_time BETWEEN #{addGroupChatTimeStart} and #{addGroupChatTimeEnd}
+        </if>
     </select>
     </select>
+
 </mapper>
 </mapper>
 
 

+ 15 - 16
src/main/java/com/goafanti/common/model/UserArchives.java

@@ -10,63 +10,63 @@ import java.util.Date;
  * 客户档案表(UserArchives)实体类
  * 客户档案表(UserArchives)实体类
  *
  *
  * @author makejava
  * @author makejava
- * @since 2024-09-26 15:29:28
+ * @since 2024-08-12 10:38:57
  */
  */
 public class UserArchives implements Serializable {
 public class UserArchives implements Serializable {
-    private static final long serialVersionUID = -88017082768227336L;
+    private static final long serialVersionUID = -61985340141600786L;
 
 
     private Integer id;
     private Integer id;
 
 
     private String uid;
     private String uid;
-    /**
+/**
      * 专利数
      * 专利数
      */
      */
     private Integer patentCount;
     private Integer patentCount;
-    /**
+/**
      * 发明专利数
      * 发明专利数
      */
      */
     private Integer inventionPatentCount;
     private Integer inventionPatentCount;
-    /**
+/**
      * 实用新型数
      * 实用新型数
      */
      */
     private Integer utilityModelCount;
     private Integer utilityModelCount;
-    /**
+/**
      * 外观专利数
      * 外观专利数
      */
      */
     private Integer appearancePatentCount;
     private Integer appearancePatentCount;
-    /**
+/**
      * 软著数
      * 软著数
      */
      */
     private Integer softwareWorksCount;
     private Integer softwareWorksCount;
-    /**
+/**
      * 其他数
      * 其他数
      */
      */
     private Integer otherCount;
     private Integer otherCount;
-    /**
+/**
      * 财务数据
      * 财务数据
      */
      */
     private String financialData;
     private String financialData;
-    /**
+/**
      * 前期沟通
      * 前期沟通
      */
      */
     private String earlyCommunication;
     private String earlyCommunication;
-    /**
+/**
      * 面谈思路
      * 面谈思路
      */
      */
     private String interviewIdeas;
     private String interviewIdeas;
-    /**
+/**
      * 创建时间
      * 创建时间
      */
      */
     private Date createTime;
     private Date createTime;
-    /**
+/**
      * 企业数
      * 企业数
      */
      */
     private Integer enterpriseCount;
     private Integer enterpriseCount;
-    /**
+/**
      * 渠道考核指标
      * 渠道考核指标
      */
      */
     private String channelIndicators;
     private String channelIndicators;
-    /**
+/**
      * 我方主要面谈及分工
      * 我方主要面谈及分工
      */
      */
     private String interviewDistribution;
     private String interviewDistribution;
@@ -83,7 +83,6 @@ public class UserArchives implements Serializable {
      */
      */
     private Integer awardsStatus;
     private Integer awardsStatus;
 
 
-
     public Integer getId() {
     public Integer getId() {
         return id;
         return id;
     }
     }

+ 14 - 2
src/main/java/com/goafanti/common/model/UserService.java

@@ -8,10 +8,10 @@ import java.util.Date;
  * 客服信息表(UserService)实体类
  * 客服信息表(UserService)实体类
  *
  *
  * @author makejava
  * @author makejava
- * @since 2024-11-06 09:00:41
+ * @since 2024-11-11 17:01:54
  */
  */
 public class UserService implements Serializable {
 public class UserService implements Serializable {
-    private static final long serialVersionUID = 215446055667637479L;
+    private static final long serialVersionUID = -85623933226950055L;
 
 
     private Integer id;
     private Integer id;
 
 
@@ -68,6 +68,10 @@ public class UserService implements Serializable {
      * 入群 0=否,1=是
      * 入群 0=否,1=是
      */
      */
     private Integer addGroupChat;
     private Integer addGroupChat;
+    /**
+     * 入群时间
+     */
+    private Date addGroupChatTime;
 
 
 
 
     public Integer getId() {
     public Integer getId() {
@@ -190,5 +194,13 @@ public class UserService implements Serializable {
         this.addGroupChat = addGroupChat;
         this.addGroupChat = addGroupChat;
     }
     }
 
 
+    public Date getAddGroupChatTime() {
+        return addGroupChatTime;
+    }
+
+    public void setAddGroupChatTime(Date addGroupChatTime) {
+        this.addGroupChatTime = addGroupChatTime;
+    }
+
 }
 }
 
 

+ 1 - 1
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -190,7 +190,7 @@ public class ReleaseUserTask {
 		List<Notice> ln = new ArrayList<>();
 		List<Notice> ln = new ArrayList<>();
 		List<userDaysBo> userChannelList = new ArrayList<userDaysBo>();
 		List<userDaysBo> userChannelList = new ArrayList<userDaysBo>();
 		for (User u : userList) {
 		for (User u : userList) {
-			if (StringUtils.isNotBlank(u.getId())&&AFTConstants.CAOJIN_AID.equals(u.getId())) {
+			if (StringUtils.isNotBlank(u.getId())&&!AFTConstants.CAOJIN_AID.equals(u.getId())) {
 				List<userDaysBo> userTmpList  = customerService.selectReleaseUserDays(u.getId());
 				List<userDaysBo> userTmpList  = customerService.selectReleaseUserDays(u.getId());
 				for (userDaysBo ub : userTmpList) {
 				for (userDaysBo ub : userTmpList) {
 					String str=null;
 					String str=null;

+ 9 - 0
src/main/java/com/goafanti/customer/bo/InputAddCustomer.java

@@ -22,6 +22,7 @@ public class InputAddCustomer {
     private Integer city;
     private Integer city;
 
 
     private Integer area;
     private Integer area;
+    private Integer level;
     private Integer source;
     private Integer source;
     private String societyTag;
     private String societyTag;
     private String orgCode;
     private String orgCode;
@@ -50,6 +51,14 @@ public class InputAddCustomer {
     private Integer   channelType;
     private Integer   channelType;
 
 
 
 
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+
     public String getOrgCode() {
     public String getOrgCode() {
         return orgCode;
         return orgCode;
     }
     }

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

@@ -185,7 +185,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	}
 	}
 	/**
 	/**
 	 * 私有单位客户导出xls
 	 * 私有单位客户导出xls
-	 * @throws IOException
 	 */
 	 */
 	@RequestMapping(value = "/privateUnitCustomerOutXls" , method = RequestMethod.GET)
 	@RequestMapping(value = "/privateUnitCustomerOutXls" , method = RequestMethod.GET)
 	public Result privateUnitCustomerOutXls(CustomerListIn cli ,Integer sort,Integer sortType,Integer pageNo, Integer pageSize,HttpServletResponse response) throws IOException{
 	public Result privateUnitCustomerOutXls(CustomerListIn cli ,Integer sort,Integer sortType,Integer pageNo, Integer pageSize,HttpServletResponse response) throws IOException{
@@ -306,9 +305,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * 客户查询
 	 * 客户查询
 	 * @param name  查询名称
 	 * @param name  查询名称
 	 * @param type  分类 0默认 1小程序App
 	 * @param type  分类 0默认 1小程序App
-	 * @param pageNo
-	 * @param pageSize
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/getUserByNames",method = RequestMethod.GET)
 	@RequestMapping(value = "/getUserByNames",method = RequestMethod.GET)
 	public Result getUserByName(String name,Integer type,Integer pageNo,Integer pageSize){
 	public Result getUserByName(String name,Integer type,Integer pageNo,Integer pageSize){
@@ -325,8 +321,7 @@ public class AdminCustomerApiController extends BaseApiController{
 
 
 
 
 	/** 添加客户基本信息
 	/** 添加客户基本信息
-	 * @throws Exception
-	 * @throws NumberFormatException **/
+	 * **/
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
 	public Result addCustomer(InputAddCustomer in) {
 	public Result addCustomer(InputAddCustomer in) {
 		Result res = new Result();
 		Result res = new Result();
@@ -531,7 +526,7 @@ public class AdminCustomerApiController extends BaseApiController{
 			for (int idx = 0; idx < ja.size(); idx++) {
 			for (int idx = 0; idx < ja.size(); idx++) {
 				userBusiness = ja.getJSONObject(idx).toJavaObject(BusinessListBo.class);
 				userBusiness = ja.getJSONObject(idx).toJavaObject(BusinessListBo.class);
 				for(BusinessListBo ub:list){
 				for(BusinessListBo ub:list){
-					if(ub.getBusinessProjectId() == userBusiness.getBusinessProjectId()){
+					if(Objects.equals(ub.getBusinessProjectId(), userBusiness.getBusinessProjectId())){
 						res.getError().add(new com.goafanti.common.bo.Error("业务类型重复,请检查后重新提交!"));
 						res.getError().add(new com.goafanti.common.bo.Error("业务类型重复,请检查后重新提交!"));
 						return res;
 						return res;
 					}
 					}
@@ -648,7 +643,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * 领取客户
 	 * 领取客户
 	 * @param uid 客户编号
 	 * @param uid 客户编号
 	 * @param oldAid 原来的客户归属人
 	 * @param oldAid 原来的客户归属人
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/receiveCustomer", method = RequestMethod.GET)
 	@RequestMapping(value = "/receiveCustomer", method = RequestMethod.GET)
 	public Result receiveCustomer(String uid, String oldAid) {
 	public Result receiveCustomer(String uid, String oldAid) {
@@ -685,8 +679,6 @@ public class AdminCustomerApiController extends BaseApiController{
 
 
 	/**
 	/**
 	 * 领取为渠道
 	 * 领取为渠道
-	 * @param uid
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/receiveAsChannel",method=RequestMethod.POST)
 	@RequestMapping(value = "/receiveAsChannel",method=RequestMethod.POST)
 	public Result receiveAsChannel(String uid){
 	public Result receiveAsChannel(String uid){
@@ -701,8 +693,6 @@ public class AdminCustomerApiController extends BaseApiController{
 
 
 	/**
 	/**
 	 * 上传excel文档
 	 * 上传excel文档
-	 * @param req
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/uploadExcel",method = RequestMethod.POST)
 	@RequestMapping(value = "/uploadExcel",method = RequestMethod.POST)
 	public Result uploadExcel(HttpServletRequest req){
 	public Result uploadExcel(HttpServletRequest req){
@@ -722,12 +712,12 @@ public class AdminCustomerApiController extends BaseApiController{
 				Set<Integer> existRows = new TreeSet<Integer>(); //数据库已存在
 				Set<Integer> existRows = new TreeSet<Integer>(); //数据库已存在
 				Set<Integer> filterRows = new TreeSet<Integer>(); //过滤提示
 				Set<Integer> filterRows = new TreeSet<Integer>(); //过滤提示
 				customerService.checkCustomer(boSet,existRows,filterRows);
 				customerService.checkCustomer(boSet,existRows,filterRows);
-				if(existRows.size()>0){
+				if(!existRows.isEmpty()){
 					errorMessage = StringUtils.join(existRows.toArray(),",")+ " 行客户业务已存在;";
 					errorMessage = StringUtils.join(existRows.toArray(),",")+ " 行客户业务已存在;";
 					res.getError().add(new Error(errorMessage));
 					res.getError().add(new Error(errorMessage));
 					return res;
 					return res;
 				}
 				}
-				if(filterRows.size()>0){
+				if(!filterRows.isEmpty()){
 					errorMessage = StringUtils.join(filterRows.toArray(),",")+ " 行已经被系统过滤;";
 					errorMessage = StringUtils.join(filterRows.toArray(),",")+ " 行已经被系统过滤;";
 					res.getError().add(new Error(errorMessage));
 					res.getError().add(new Error(errorMessage));
 					return res;
 					return res;
@@ -770,9 +760,6 @@ public class AdminCustomerApiController extends BaseApiController{
 
 
 	/**
 	/**
 	 * 转为公共客户 释放客户
 	 * 转为公共客户 释放客户
-	 * @param uid
-	 * @param aid
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/transferToPublic", method = RequestMethod.GET)
 	@RequestMapping(value = "/transferToPublic", method = RequestMethod.GET)
 	public Result transferToPublic(String uid,String aid){
 	public Result transferToPublic(String uid,String aid){
@@ -800,8 +787,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @param depNo 部门编号
 	 * @param depNo 部门编号
 	 * @param pageNo 页码
 	 * @param pageNo 页码
 	 * @param pageSize 页数
 	 * @param pageSize 页数
-	 * @return
-	 * @throws ParseException
 	 */
 	 */
 	@RequestMapping(value = "/customerStatistics",method = RequestMethod.GET)
 	@RequestMapping(value = "/customerStatistics",method = RequestMethod.GET)
 	public Result customerStatistics(String startDate,String endDate,String timeSpan,String depNo,String businessGlossoryId,Integer pageNo, Integer pageSize) throws ParseException{
 	public Result customerStatistics(String startDate,String endDate,String timeSpan,String depNo,String businessGlossoryId,Integer pageNo, Integer pageSize) throws ParseException{
@@ -813,17 +798,23 @@ public class AdminCustomerApiController extends BaseApiController{
 		if(StringUtils.isNotBlank(endDate)) eDate = format.parse(endDate);
 		if(StringUtils.isNotBlank(endDate)) eDate = format.parse(endDate);
 		if(StringUtils.isBlank(startDate)&&StringUtils.isBlank(endDate)){
 		if(StringUtils.isBlank(startDate)&&StringUtils.isBlank(endDate)){
 			Date date = new Date();
 			Date date = new Date();
-			if(timeSpan.equals(DateUtils.DAY_SPAN)){
-				sDate = DateUtils.getYesterday();
-			}else if(timeSpan.equals(DateUtils.WEEK_SPAN)){
-				sDate = DateUtils.getLastDayOfLastWeek(date);
-			}else if(timeSpan.equals(DateUtils.MONTH_SPAN)){
-				sDate = DateUtils.getLastDayOfLastMonth(date);
-			}else if(timeSpan.equals(DateUtils.QUARTER_SPAN)){
-				sDate = DateUtils.getLastDayOfLastQuarter(date);
-			}else if(timeSpan.equals(DateUtils.YEAR_SPAN)){
-				sDate = DateUtils.getLastDayOfLastYear(date);
-			}
+            switch (timeSpan) {
+                case DateUtils.DAY_SPAN:
+                    sDate = DateUtils.getYesterday();
+                    break;
+                case DateUtils.WEEK_SPAN:
+                    sDate = DateUtils.getLastDayOfLastWeek(date);
+                    break;
+                case DateUtils.MONTH_SPAN:
+                    sDate = DateUtils.getLastDayOfLastMonth(date);
+                    break;
+                case DateUtils.QUARTER_SPAN:
+                    sDate = DateUtils.getLastDayOfLastQuarter(date);
+                    break;
+                case DateUtils.YEAR_SPAN:
+                    sDate = DateUtils.getLastDayOfLastYear(date);
+                    break;
+            }
 		}
 		}
 		res.setData(customerService.customerStatistics(sDate,eDate,depNo,businessGlossoryId,pageNo,pageSize));
 		res.setData(customerService.customerStatistics(sDate,eDate,depNo,businessGlossoryId,pageNo,pageSize));
 		return res;
 		return res;
@@ -838,8 +829,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @param businessGlossoryId 业务编号
 	 * @param businessGlossoryId 业务编号
 	 * @param pageNo 页码
 	 * @param pageNo 页码
 	 * @param pageSize 页数
 	 * @param pageSize 页数
-	 * @return
-	 * @throws ParseException
 	 */
 	 */
 	@RequestMapping(value = "/businessStatistic", method = RequestMethod.GET)
 	@RequestMapping(value = "/businessStatistic", method = RequestMethod.GET)
 	public Result businessStatistic(String startDate,String endDate,String timeSpan,String depNo,String businessGlossoryId,Integer pageNo, Integer pageSize) throws ParseException{
 	public Result businessStatistic(String startDate,String endDate,String timeSpan,String depNo,String businessGlossoryId,Integer pageNo, Integer pageSize) throws ParseException{
@@ -851,17 +840,23 @@ public class AdminCustomerApiController extends BaseApiController{
 		if(StringUtils.isNotBlank(endDate)) eDate = format.parse(endDate);
 		if(StringUtils.isNotBlank(endDate)) eDate = format.parse(endDate);
 		if(StringUtils.isBlank(startDate)&&StringUtils.isBlank(endDate)){
 		if(StringUtils.isBlank(startDate)&&StringUtils.isBlank(endDate)){
 			Date date = new Date();
 			Date date = new Date();
-			if(timeSpan.equals(DateUtils.DAY_SPAN)){
-				sDate = DateUtils.getYesterday();
-			}else if(timeSpan.equals(DateUtils.WEEK_SPAN)){
-				sDate = DateUtils.getLastDayOfLastWeek(date);
-			}else if(timeSpan.equals(DateUtils.MONTH_SPAN)){
-				sDate = DateUtils.getLastDayOfLastMonth(date);
-			}else if(timeSpan.equals(DateUtils.QUARTER_SPAN)){
-				sDate = DateUtils.getLastDayOfLastQuarter(date);
-			}else if(timeSpan.equals(DateUtils.YEAR_SPAN)){
-				sDate = DateUtils.getLastDayOfLastYear(date);
-			}
+            switch (timeSpan) {
+                case DateUtils.DAY_SPAN:
+                    sDate = DateUtils.getYesterday();
+                    break;
+                case DateUtils.WEEK_SPAN:
+                    sDate = DateUtils.getLastDayOfLastWeek(date);
+                    break;
+                case DateUtils.MONTH_SPAN:
+                    sDate = DateUtils.getLastDayOfLastMonth(date);
+                    break;
+                case DateUtils.QUARTER_SPAN:
+                    sDate = DateUtils.getLastDayOfLastQuarter(date);
+                    break;
+                case DateUtils.YEAR_SPAN:
+                    sDate = DateUtils.getLastDayOfLastYear(date);
+                    break;
+            }
 		}
 		}
 		res.setData(customerService.businessStatistic(sDate,eDate,depNo,businessGlossoryId,pageNo,pageSize));
 		res.setData(customerService.businessStatistic(sDate,eDate,depNo,businessGlossoryId,pageNo,pageSize));
 		return res;
 		return res;
@@ -875,8 +870,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @param depNo 部门编号
 	 * @param depNo 部门编号
 	 * @param pageNo 页码
 	 * @param pageNo 页码
 	 * @param pageSize 页数
 	 * @param pageSize 页数
-	 * @return
-	 * @throws ParseException
 	 */
 	 */
 
 
 	@RequestMapping(value = "/followStatistic",method = RequestMethod.GET)
 	@RequestMapping(value = "/followStatistic",method = RequestMethod.GET)
@@ -889,17 +882,23 @@ public class AdminCustomerApiController extends BaseApiController{
 		if(StringUtils.isNotBlank(endDate)) eDate = format.parse(endDate);
 		if(StringUtils.isNotBlank(endDate)) eDate = format.parse(endDate);
 		if(StringUtils.isBlank(startDate)&&StringUtils.isBlank(endDate)){
 		if(StringUtils.isBlank(startDate)&&StringUtils.isBlank(endDate)){
 			Date date = new Date();
 			Date date = new Date();
-			if(timeSpan.equals(DateUtils.DAY_SPAN)){
-				sDate = DateUtils.getYesterday();
-			}else if(timeSpan.equals(DateUtils.WEEK_SPAN)){
-				sDate = DateUtils.getLastDayOfLastWeek(date);
-			}else if(timeSpan.equals(DateUtils.MONTH_SPAN)){
-				sDate = DateUtils.getLastDayOfLastMonth(date);
-			}else if(timeSpan.equals(DateUtils.QUARTER_SPAN)){
-				sDate = DateUtils.getLastDayOfLastQuarter(date);
-			}else if(timeSpan.equals(DateUtils.YEAR_SPAN)){
-				sDate = DateUtils.getLastDayOfLastYear(date);
-			}
+            switch (timeSpan) {
+                case DateUtils.DAY_SPAN:
+                    sDate = DateUtils.getYesterday();
+                    break;
+                case DateUtils.WEEK_SPAN:
+                    sDate = DateUtils.getLastDayOfLastWeek(date);
+                    break;
+                case DateUtils.MONTH_SPAN:
+                    sDate = DateUtils.getLastDayOfLastMonth(date);
+                    break;
+                case DateUtils.QUARTER_SPAN:
+                    sDate = DateUtils.getLastDayOfLastQuarter(date);
+                    break;
+                case DateUtils.YEAR_SPAN:
+                    sDate = DateUtils.getLastDayOfLastYear(date);
+                    break;
+            }
 		}
 		}
 		res.setData(customerService.followStatistic(sDate, eDate, depNo, pageNo, pageSize));
 		res.setData(customerService.followStatistic(sDate, eDate, depNo, pageNo, pageSize));
 		return res;
 		return res;
@@ -909,7 +908,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * 管理员列表
 	 * 管理员列表
 	 * @param adminName 名称
 	 * @param adminName 名称
 	 * @param status 0 正常 1锁定 2全部
 	 * @param status 0 正常 1锁定 2全部
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/listAdminByName",method = RequestMethod.GET)
 	@RequestMapping(value = "/listAdminByName",method = RequestMethod.GET)
 	public Result listAdminByName(String adminName,Integer status){
 	public Result listAdminByName(String adminName,Integer status){
@@ -922,11 +920,8 @@ public class AdminCustomerApiController extends BaseApiController{
 	/**
 	/**
 	 * 客户转交 私有客户转交,签单客户转交
 	 * 客户转交 私有客户转交,签单客户转交
 	 * @param uid 用户编号
 	 * @param uid 用户编号
-	 * @param aid
 	 * @param operatorType 3私有 4签单
 	 * @param operatorType 3私有 4签单
-	 * @param oldAid
 	 * @param data 资料同步转移 0无 1资料转交 2订单转交 3全部转交
 	 * @param data 资料同步转移 0无 1资料转交 2订单转交 3全部转交
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/transferToOther", method = RequestMethod.GET)
 	@RequestMapping(value = "/transferToOther", method = RequestMethod.GET)
 	public Result transferToOther(String uid,String aid,Integer operatorType,Integer data,String oldAid){
 	public Result transferToOther(String uid,String aid,Integer operatorType,Integer data,String oldAid){
@@ -938,7 +933,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		//默认为私有转交,4为签单转交
 		//默认为私有转交,4为签单转交
 		if (operatorType==null) operatorType=AFTConstants.USER_TRANSFER_TO_OTHER;
 		if (operatorType==null) operatorType=AFTConstants.USER_TRANSFER_TO_OTHER;
 		//转交,对方不是客服营销员才需要判断最大限制
 		//转交,对方不是客服营销员才需要判断最大限制
-		if (operatorType ==AFTConstants.USER_TRANSFER_TO_OTHER&&(!customerService.checkAid(aid,Integer.valueOf(AFTConstants.CUSTOMER_SERVICE_SALESMAN)))){
+		if (operatorType.equals(AFTConstants.USER_TRANSFER_TO_OTHER) &&(!customerService.checkAid(aid,Integer.valueOf(AFTConstants.CUSTOMER_SERVICE_SALESMAN)))){
 			if (customerService.checkMax(uid,aid)){
 			if (customerService.checkMax(uid,aid)){
 				res.getError().add(buildError("","对方私有客户已达最大限制"));
 				res.getError().add(buildError("","对方私有客户已达最大限制"));
 				return res;
 				return res;
@@ -953,7 +948,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	/**
 	/**
 	   *   客户转交记录
 	   *   客户转交记录
 	 * @param uid 客户编号
 	 * @param uid 客户编号
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/transferList", method = RequestMethod.GET)
 	@RequestMapping(value = "/transferList", method = RequestMethod.GET)
 	public Result transferList(String uid){
 	public Result transferList(String uid){
@@ -1323,12 +1317,9 @@ public class AdminCustomerApiController extends BaseApiController{
 	/**
 	/**
 	 * 企业项目申报材料上传
 	 * 企业项目申报材料上传
 	 *
 	 *
-	 * @param req
-	 * @param uid
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/upload", method = RequestMethod.POST)
 	@RequestMapping(value = "/upload", method = RequestMethod.POST)
-	public Result cognizanceFile(HttpServletRequest req, String uid, String id, String sign) {
+	public Result cognizanceFile(HttpServletRequest req, String uid, String sign) {
 		Result res = new Result();
 		Result res = new Result();
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 		if (attachmentType == AttachmentType.ORGANIZATION_APPLICATION) {
 		if (attachmentType == AttachmentType.ORGANIZATION_APPLICATION) {
@@ -1341,10 +1332,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		/**
 		/**
 	 *  企业项目申报材料预览授权
 	 *  企业项目申报材料预览授权
 	 *
 	 *
-	 * @param id
-	 * @param sign
-	 * @return
-	 */
+         */
 	@RequestMapping(value = "/techProject", method = RequestMethod.GET)
 	@RequestMapping(value = "/techProject", method = RequestMethod.GET)
 	public Result previewTechProject(String id, String sign) {
 	public Result previewTechProject(String id, String sign) {
 		Result res = new Result();
 		Result res = new Result();
@@ -1364,12 +1352,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	}
 	}
 	/**
 	/**
 	 * 查看营销员客户统计
 	 * 查看营销员客户统计
-	 * @param depId
-	 * @param startTime
-	 * @param endTime
-	 * @param pageSize
-	 * @param pageNo
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/selectAdminCustomerStatistics", method = RequestMethod.GET)
 	@RequestMapping(value = "/selectAdminCustomerStatistics", method = RequestMethod.GET)
 	public Result selectAdminCustomerstatistics(String depId, String startTime,String endTime, Integer pageSize, Integer pageNo) {
 	public Result selectAdminCustomerstatistics(String depId, String startTime,String endTime, Integer pageSize, Integer pageNo) {
@@ -1383,7 +1365,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @param depId 部门编号
 	 * @param depId 部门编号
 	 * @param startTime 开始时间
 	 * @param startTime 开始时间
 	 * @param endTime	结束时间
 	 * @param endTime	结束时间
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/selectAllUser", method = RequestMethod.GET)
 	@RequestMapping(value = "/selectAllUser", method = RequestMethod.GET)
 	public Result selectAllUser(String depId, String startTime,String endTime,String aName ) {
 	public Result selectAllUser(String depId, String startTime,String endTime,String aName ) {
@@ -1391,6 +1372,19 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.data(adminService.selectAllUser( depId,  startTime, endTime, aName));
 		res.data(adminService.selectAllUser( depId,  startTime, endTime, aName));
 		return res;
 		return res;
 	}
 	}
+
+
+	/**
+	 * 查看客户统计导出
+	 * @param depId 部门编号
+	 * @param startTime 开始时间
+	 * @param endTime	结束时间
+	 */
+	@RequestMapping(value = "/selectAllUser/export", method = RequestMethod.GET)
+	public Result selectAllUserExport(String depId, String startTime,String endTime,String aName ) {
+
+		return adminService.selectAllUserExport( depId,  startTime, endTime, aName);
+	}
 	/**
 	/**
 	 * 查看客户日期内新增客户
 	 * 查看客户日期内新增客户
 	 * @param type 0私有 1渠道 2签单 3私有新增 4渠道新增 5私有面谈 6渠道面谈 7私有领取 8 私有转交
 	 * @param type 0私有 1渠道 2签单 3私有新增 4渠道新增 5私有面谈 6渠道面谈 7私有领取 8 私有转交
@@ -1407,7 +1401,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @param inputId 	业务转移客户id(接收者)
 	 * @param inputId 	业务转移客户id(接收者)
 	 * @param uid		被转移的客户
 	 * @param uid		被转移的客户
 	 * @param pid		呗转移的业务
 	 * @param pid		呗转移的业务
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/privateBusinessTransfer", method = RequestMethod.POST)
 	@RequestMapping(value = "/privateBusinessTransfer", method = RequestMethod.POST)
 	public Result privateBusinessTransfer(String inputId,String uid,String pid ) {
 	public Result privateBusinessTransfer(String inputId,String uid,String pid ) {
@@ -1450,7 +1443,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @param receiveId 接受者
 	 * @param receiveId 接受者
 	 * @param remarks	备注
 	 * @param remarks	备注
 	 * @param type	0 分配 1转交 2回退
 	 * @param type	0 分配 1转交 2回退
-	 * @return
 	 */
 	 */
 	@RequestMapping(value = "/channelCustomerDeliver", method = RequestMethod.POST)
 	@RequestMapping(value = "/channelCustomerDeliver", method = RequestMethod.POST)
 	public Result channelCustomerDeliver(String userIds ,String receiveId,String remarks,Integer type){
 	public Result channelCustomerDeliver(String userIds ,String receiveId,String remarks,Integer type){
@@ -1482,10 +1474,8 @@ public class AdminCustomerApiController extends BaseApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,null,"uid或者名称"));
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,null,"uid或者名称"));
 			return res;
 			return res;
 		}
 		}
-		if (userName!=null){
-			userName=userName.trim();
-		}
-		if(customerService.checkUserName(uid,userName)){
+        userName = userName.trim();
+        if(customerService.checkUserName(uid,userName)){
 			res.getError().add(buildError(ErrorConstants.CUSTOMER_ALREADY_EXIST,null,"["+userName+"]"));
 			res.getError().add(buildError(ErrorConstants.CUSTOMER_ALREADY_EXIST,null,"["+userName+"]"));
 			return res;
 			return res;
 		}
 		}
@@ -1668,4 +1658,14 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.setData(customerService.getPublicReleaseList(id));
 		res.setData(customerService.getPublicReleaseList(id));
 		return res;
 		return res;
 	}
 	}
+
+	/**
+	 * 客户标签未标记统计
+	 */
+	@GetMapping("/selectUserLevel")
+	public Result selectUserLevel() {
+		Result res = new Result();
+		res.setData(customerService.selectUserLevel());
+		return res;
+	}
 }
 }

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

@@ -597,4 +597,6 @@ public interface CustomerService {
 	Object getPublicReleaseList(String id);
 	Object getPublicReleaseList(String id);
 
 
 	void updateUserShareType(List<LockingReleaseBo> newList);
 	void updateUserShareType(List<LockingReleaseBo> newList);
+
+	Object selectUserLevel();
 }
 }

+ 7 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -351,6 +351,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 //		user.setAid("1");
 //		user.setAid("1");
 		user.setType(in.getType());
 		user.setType(in.getType());
 		user.setLvl(UserLevel.CERTIFIED.getCode());
 		user.setLvl(UserLevel.CERTIFIED.getCode());
+		user.setLevel(in.getLevel());
 		user.setSocietyTag(in.getSocietyTag());
 		user.setSocietyTag(in.getSocietyTag());
 		user.setCreateTime(now);
 		user.setCreateTime(now);
 		user.setTransferTime(now);
 		user.setTransferTime(now);
@@ -3139,8 +3140,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 
 	}
 	}
 
 
+    @Override
+    public Object selectUserLevel() {
+		return userMapper.selectUserLevel(TokenManager.getAdminId());
+    }
+
 
 
-	private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
+    private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
 		List<InputExcelUser> res=new ArrayList<>();
 		List<InputExcelUser> res=new ArrayList<>();
 		List<InputExcelUser> list2=new ArrayList<>();
 		List<InputExcelUser> list2=new ArrayList<>();
 		int i = 0;
 		int i = 0;

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

@@ -182,7 +182,8 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
         if(userArchives.getId()==null){
         if(userArchives.getId()==null){
             return insert(userArchives);
             return insert(userArchives);
         }else {
         }else {
-            addUserLog(userArchives);
+            addUserLog( userArchives);
+            userArchives.setUpdateTime(new Date());
             this.userArchivesMapper.update(userArchives);
             this.userArchivesMapper.update(userArchives);
             return this.queryById(userArchives.getId());
             return this.queryById(userArchives.getId());
         }
         }

+ 3 - 1
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -737,9 +737,11 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
 
 
     @Override
     @Override
     public int deleteDetails(Integer id) {
     public int deleteDetails(Integer id) {
+        ExpenseAccountDetails expenseAccountDetails = expenseAccountDetailsMapper.selectByPrimaryKey(id);
+        Integer eaid=expenseAccountDetails.getEaid();
         expenseAccountDetailsMapper.deleteByPrimaryKey(id);
         expenseAccountDetailsMapper.deleteByPrimaryKey(id);
         ExpenseAccount ea =new ExpenseAccount();
         ExpenseAccount ea =new ExpenseAccount();
-        ea.setId(id);
+        ea.setId(eaid);
         pushExpenseAccountAmount(ea);
         pushExpenseAccountAmount(ea);
         expenseAccountMapper.updateByPrimaryKeySelective(ea);
         expenseAccountMapper.updateByPrimaryKeySelective(ea);
         return 1;
         return 1;

+ 19 - 0
src/main/java/com/goafanti/user/bo/InputListOrderUserService.java

@@ -24,9 +24,28 @@ public class InputListOrderUserService {
 	private String endSignTimes;
 	private String endSignTimes;
 	private String contractNo;
 	private String contractNo;
 	private Integer addGroupChat;
 	private Integer addGroupChat;
+	private String addGroupChatTimeStart;
+	private String addGroupChatTimeEnd;
 	private Integer pageSize;
 	private Integer pageSize;
 	private Integer pageNo;
 	private Integer pageNo;
 
 
+
+	public String getAddGroupChatTimeStart() {
+		return addGroupChatTimeStart;
+	}
+
+	public void setAddGroupChatTimeStart(String addGroupChatTimeStart) {
+		this.addGroupChatTimeStart = addGroupChatTimeStart;
+	}
+
+	public String getAddGroupChatTimeEnd() {
+		return addGroupChatTimeEnd;
+	}
+
+	public void setAddGroupChatTimeEnd(String addGroupChatTimeEnd) {
+		this.addGroupChatTimeEnd = addGroupChatTimeEnd;
+	}
+
 	public Integer getAddGroupChat() {
 	public Integer getAddGroupChat() {
 		return addGroupChat;
 		return addGroupChat;
 	}
 	}

+ 13 - 0
src/main/java/com/goafanti/user/bo/OutOrderUserService.java

@@ -1,7 +1,9 @@
 package com.goafanti.user.bo;
 package com.goafanti.user.bo;
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.goafanti.common.utils.excel.Excel;
 import com.goafanti.common.utils.excel.Excel;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 
 
@@ -51,9 +53,20 @@ public class OutOrderUserService {
 	private Integer businessSatisfaction;
 	private Integer businessSatisfaction;
 	@Excel(name = "是否入群",readConverterExp = "0=否,1=是")
 	@Excel(name = "是否入群",readConverterExp = "0=否,1=是")
 	private Integer addGroupChat;
 	private Integer addGroupChat;
+	@Excel(name = "入群时间")
+	private Date addGroupChatTime;
 	private String uid;
 	private String uid;
 	private List<OrderProject> list;
 	private List<OrderProject> list;
 
 
+	@JsonFormat(pattern = "yyyy-MM-dd" ,timezone = "GMT+8")
+	public Date getAddGroupChatTime() {
+		return addGroupChatTime;
+	}
+
+	public void setAddGroupChatTime(Date addGroupChatTime) {
+		this.addGroupChatTime = addGroupChatTime;
+	}
+
 	public Integer getAddGroupChat() {
 	public Integer getAddGroupChat() {
 		if (addGroupChat==null)return 0;
 		if (addGroupChat==null)return 0;
 		return addGroupChat;
 		return addGroupChat;

+ 9 - 9
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -112,7 +112,6 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		return userMapper.selectUserDownLoadBoByUserId(id);
 		return userMapper.selectUserDownLoadBoByUserId(id);
 	}
 	}
 
 
-	@SuppressWarnings("unchecked")
 	@Override
 	@Override
 	public Pagination<OrgListBo> selectUserByAid(Integer number, String mobile, Integer auditStatus, String auditName,
 	public Pagination<OrgListBo> selectUserByAid(Integer number, String mobile, Integer auditStatus, String auditName,
 			String email, String aid, String startCreateTime, String endCreateTime, Integer type, Integer pageNo,
 			String email, String aid, String startCreateTime, String endCreateTime, Integer type, Integer pageNo,
@@ -120,17 +119,20 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 
 
 		if (StringUtils.isNotBlank(startCreateTime)) {
 		if (StringUtils.isNotBlank(startCreateTime)) {
-			try {
-				params.put("startCreateTime", DateUtils.parseDate(startCreateTime, AFTConstants.YYYYMMDD));
-			} catch (ParseException e) {
-			}
-		}
+            try {
+                params.put("startCreateTime", DateUtils.parseDate(startCreateTime, AFTConstants.YYYYMMDD));
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+
+        }
 
 
 		if (StringUtils.isNotBlank(endCreateTime)) {
 		if (StringUtils.isNotBlank(endCreateTime)) {
 			try {
 			try {
 				params.put("endCreateTime",
 				params.put("endCreateTime",
 						DateUtils.addDays(DateUtils.parseDate(endCreateTime, AFTConstants.YYYYMMDD), 1));
 						DateUtils.addDays(DateUtils.parseDate(endCreateTime, AFTConstants.YYYYMMDD), 1));
 			} catch (ParseException e) {
 			} catch (ParseException e) {
+				throw new RuntimeException(e);
 			}
 			}
 		}
 		}
 
 
@@ -231,7 +233,7 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 
 
 	private Map<String, String> disposeAchievementUserOwner(List<UserNames> list) {
 	private Map<String, String> disposeAchievementUserOwner(List<UserNames> list) {
 		Map<String, String> map = new HashMap<>();
 		Map<String, String> map = new HashMap<>();
-		if (null != list && list.size() > 0) {
+		if (null != list && !list.isEmpty()) {
 			for (UserNames u : list) {
 			for (UserNames u : list) {
 				map.put(u.getUid(), u.getUsername() + " " + u.getMobile());
 				map.put(u.getUid(), u.getUsername() + " " + u.getMobile());
 			}
 			}
@@ -259,7 +261,6 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		return userMapper.findOrgPartnerDetail(uid);
 		return userMapper.findOrgPartnerDetail(uid);
 	}
 	}
 
 
-	@SuppressWarnings("unchecked")
 	@Override
 	@Override
 	public Pagination<StarListBo> listStar(Integer number, String engagedField, String username,
 	public Pagination<StarListBo> listStar(Integer number, String engagedField, String username,
 			String professionalTitle, String workUnit, Integer pNo, Integer pSize) {
 			String professionalTitle, String workUnit, Integer pNo, Integer pSize) {
@@ -295,7 +296,6 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 		return (Pagination<StarListBo>) findPage("findStarListByPage", "findStarCount", params, pNo, pSize);
 		return (Pagination<StarListBo>) findPage("findStarListByPage", "findStarCount", params, pNo, pSize);
 	}
 	}
 
 
-	@SuppressWarnings("unchecked")
 	@Override
 	@Override
 	public Pagination<StarAndExpertListBo> listStarAndExpert(Integer number, String engagedField, String username,
 	public Pagination<StarAndExpertListBo> listStarAndExpert(Integer number, String engagedField, String username,
 			String professionalTitle, String workUnit, Integer pNo, Integer pSize) {
 			String professionalTitle, String workUnit, Integer pNo, Integer pSize) {

+ 10 - 11
src/main/java/com/goafanti/user/service/impl/UserServiceServiceImpl.java

@@ -13,9 +13,9 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.user.bo.*;
 import com.goafanti.user.bo.*;
 import com.goafanti.user.service.UserServiceService;
 import com.goafanti.user.service.UserServiceService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import javax.annotation.Resource;
 import java.util.Date;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
@@ -24,11 +24,11 @@ import java.util.Map;
 @Service
 @Service
 public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> implements UserServiceService {
 public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> implements UserServiceService {
 
 
-	@Autowired
+	@Resource
 	private UserServiceMapper userServiceMapper;
 	private UserServiceMapper userServiceMapper;
-	@Autowired
+	@Resource
 	private UserServiceFollowMapper userServiceFollowMapper;
 	private UserServiceFollowMapper userServiceFollowMapper;
-	@Autowired
+	@Resource
 	private DepartmentService departmentService;
 	private DepartmentService departmentService;
 
 
 	@Override
 	@Override
@@ -59,7 +59,6 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 		return userServiceFollowMapper.listUseServiceFollow(uid);
 		return userServiceFollowMapper.listUseServiceFollow(uid);
 	}
 	}
 
 
-	@SuppressWarnings("unchecked")
 	@Override
 	@Override
 	public Pagination<OutOrderUserService> listOrderUseService(InputListOrderUserService i) {
 	public Pagination<OutOrderUserService> listOrderUseService(InputListOrderUserService i) {
 		Map<String, Object> map = setParams(i);
 		Map<String, Object> map = setParams(i);
@@ -70,7 +69,7 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 	}
 	}
 
 
 	private Map<String, Object> setParams(InputListOrderUserService i) {
 	private Map<String, Object> setParams(InputListOrderUserService i) {
-		Map<String, Object>map =new HashMap<String, Object>();
+		Map<String, Object>map =new HashMap<>();
 		if(i.getUserName()!=null)map.put("userName", i.getUserName());
 		if(i.getUserName()!=null)map.put("userName", i.getUserName());
 		if(i.getDeps()!=null)map.put("deps", departmentService.parseArray(i.getDeps()));
 		if(i.getDeps()!=null)map.put("deps", departmentService.parseArray(i.getDeps()));
 		if(i.getStartFollowTimes()!=null)map.put("startFollowTimes", i.getStartFollowTimes());
 		if(i.getStartFollowTimes()!=null)map.put("startFollowTimes", i.getStartFollowTimes());
@@ -81,10 +80,11 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 		if(i.getRenewal()!=null)map.put("renewal", i.getRenewal());
 		if(i.getRenewal()!=null)map.put("renewal", i.getRenewal());
 		if (i.getContractNo()!=null)map.put("contractNo", i.getContractNo());
 		if (i.getContractNo()!=null)map.put("contractNo", i.getContractNo());
 		if (i.getAddGroupChat()!=null)map.put("addGroupChat", i.getAddGroupChat());
 		if (i.getAddGroupChat()!=null)map.put("addGroupChat", i.getAddGroupChat());
+		if (i.getAddGroupChatTimeStart()!=null)map.put("addGroupChatTimeStart", i.getAddGroupChatTimeStart());
+		if (i.getAddGroupChatTimeEnd()!=null)map.put("addGroupChatTimeEnd", i.getAddGroupChatTimeEnd()+" 23:59:59");
 		return map;
 		return map;
 	}
 	}
 
 
-	@SuppressWarnings("unchecked")
 	@Override
 	@Override
 	public List<OutOrderUserService> listOrderUseServiceGetList(InputListOrderUserService i) {
 	public List<OutOrderUserService> listOrderUseServiceGetList(InputListOrderUserService i) {
 		Map<String, Object> map = setParams(i);
 		Map<String, Object> map = setParams(i);
@@ -101,6 +101,9 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 		update.setUid(us.getUid());
 		update.setUid(us.getUid());
 		update.setAddGroupChat(us.getAddGroupChat());
 		update.setAddGroupChat(us.getAddGroupChat());
 		Date date = new Date();
 		Date date = new Date();
+		if (update.getAddGroupChat()==1){
+			update.setAddGroupChatTime(date);
+		}
 		if (id==null) {
 		if (id==null) {
 			update.setCreateTime(date);
 			update.setCreateTime(date);
 			update.setNewTime(date);
 			update.setNewTime(date);
@@ -125,28 +128,24 @@ public class  UserServiceServiceImpl extends BaseMybatisDao<UserServiceMapper> i
 					projects.append("无");
 					projects.append("无");
 				}
 				}
 				projects.append("/");
 				projects.append("/");
-
 				if (StringUtils.isNotBlank(o.getReceiverName())) {
 				if (StringUtils.isNotBlank(o.getReceiverName())) {
 					consultants.append(o.getReceiverName());
 					consultants.append(o.getReceiverName());
 				} else {
 				} else {
 					consultants.append("无");
 					consultants.append("无");
 				}
 				}
 				consultants.append("/");
 				consultants.append("/");
-
 				if (o.getDeclarationBatch() != null) {
 				if (o.getDeclarationBatch() != null) {
 					declareBatchs.append(o.getDeclarationBatch());
 					declareBatchs.append(o.getDeclarationBatch());
 				} else {
 				} else {
 					declareBatchs.append("无");
 					declareBatchs.append("无");
 				}
 				}
 				declareBatchs.append("/");
 				declareBatchs.append("/");
-
 				if (StringUtils.isNotBlank(o.getCertificateNumber())) {
 				if (StringUtils.isNotBlank(o.getCertificateNumber())) {
 					certificationNos.append(o.getCertificateNumber());
 					certificationNos.append(o.getCertificateNumber());
 				} else {
 				} else {
 					certificationNos.append("无");
 					certificationNos.append("无");
 				}
 				}
 				certificationNos.append("/");
 				certificationNos.append("/");
-
 			}
 			}
 			if(projects.length()>1)ou.setProjects(projects.substring(0, projects.length()-1));
 			if(projects.length()>1)ou.setProjects(projects.substring(0, projects.length()-1));
 			if(consultants.length()>1)ou.setConsultants(consultants.substring(0, consultants.length()-1));
 			if(consultants.length()>1)ou.setConsultants(consultants.substring(0, consultants.length()-1));