Bladeren bron

新增处理旧数据客户首次面谈客户时间

anderx 9 maanden geleden
bovenliggende
commit
02930c7a1a

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

@@ -13,6 +13,8 @@ public class AdminCustomerBo {
 	/** 私有数 */
 	@Excel( name = "私有数",width = 12)
 	private Integer userCount;
+	@Excel( name = "有效面谈",width = 12)
+	private Integer firstInterviewCount;
 	/** 渠道数 */
 	@Excel( name = "渠道数",width = 12)
 	private Integer channelCount;
@@ -47,6 +49,14 @@ public class AdminCustomerBo {
 	@Excel( name = "重点客户",width = 12)
 	private Integer keynoteCount;
 
+	public Integer getFirstInterviewCount() {
+		return firstInterviewCount;
+	}
+
+	public void setFirstInterviewCount(Integer firstInterviewCount) {
+		this.firstInterviewCount = firstInterviewCount;
+	}
+
 	public Integer getGeneralCount() {
 		return generalCount;
 	}

+ 7 - 0
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -447,6 +447,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		if(!admins.isEmpty()){
 			List<AdminCustomerBo> users = 	userMapper.selectNoChannelByaids(admins,startTime,endTime);
 			List<AdminCustomerBo> users2 = 	userMapper.selectChannelByaids(admins,startTime,endTime);
+			List<AdminCustomerBo> users3 = userMapper.selectFirstInterviewByaids(admins,startTime,endTime);
 			for (AdminCustomerBo admin : admins) {
 				for (AdminCustomerBo user : users) {
 					if (admin.getAid().equals(user.getAid())){
@@ -470,6 +471,12 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 						break;
 					}
 				}
+				for (AdminCustomerBo user : users3) {
+					if (admin.getAid().equals(user.getAid())){
+						admin.setFirstInterviewCount(user.getFirstInterviewCount());
+						break;
+					}
+				}
 				pushAdminCount(admin);
 			}
 		}

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

@@ -279,6 +279,7 @@ public interface UserMapper {
 
     List<AdminCustomerBo> selectNoChannelByaids(@Param("admins")List<AdminCustomerBo> admins,@Param("startTime") String startTime,@Param("endTime") String endTime);
     List<AdminCustomerBo> selectChannelByaids(@Param("admins")List<AdminCustomerBo> admins,@Param("startTime") String startTime,@Param("endTime") String endTime);
+    List<AdminCustomerBo> selectFirstInterviewByaids(@Param("admins")List<AdminCustomerBo> admins,@Param("startTime") String startTime,@Param("endTime") String endTime);
 
     List<String> selectBelongByaid(String aid);
 
@@ -304,5 +305,8 @@ public interface UserMapper {
     List<User> selectClueUserByClueType(String aid);
 
     void updateClueUserRelease(List<User> updateList);
+
+
+
 }
 

+ 17 - 0
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2391,6 +2391,22 @@ inner join(
 		</if>
 		group by a.aid
 	</select>
+	<select id="selectFirstInterviewByaids" resultType="com.goafanti.admin.bo.AdminCustomerBo">
+		SELECT aid, sum(1) firstInterviewCount
+		from user_first_interview
+		<where>
+			<if test="startTime != null and endTime != null">
+				and  first_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+			</if>
+			<if test="admins!= null">
+				and aid in
+				<foreach close=")" collection="admins" item="ad" open="(" separator=",">
+					#{ad.aid}
+				</foreach>
+			</if>
+		</where>
+		group by aid
+	</select>
 	<select id="selectBelongByaid" resultType="java.lang.String">
 		SELECT id     from user
 		where aid= #{aid} and share_type in (0,2)
@@ -2557,6 +2573,7 @@ inner join(
 		from user
 		where clue_status =1 and clue_process in (0,1,2) and clue_aid = #{aid}
 	</select>
+
 	<update id="updateClueUserRelease">
 		update user
 		set clue_process =3,clue_transfer_time=now()