Explorar o código

单位客户查询BUG修复,定时触发释放客户规则变更

anderx %!s(int64=7) %!d(string=hai) anos
pai
achega
6f2ad02f26

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

@@ -366,7 +366,7 @@
 	left join 
 		(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
 	on t0.uid = t1.uid 
-	where datediff(now(),ifnull(t1.last_follow_time,t1.t0.lock_time))>30 or datediff(now(),t0.lock_time)>270
+	where datediff(now(),if(t1.t0.lock_time < t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))>30 or datediff(now(),t0.lock_time)>270
   </select>
   
   <select id="selectWaitReleaseBusiness"  resultType="com.goafanti.customer.bo.LockingReleaseBo">

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

@@ -338,6 +338,7 @@
 		left join district_glossory dg1 on b.location_province = dg1.id
 		left join district_glossory dg2 on b.location_city = dg2.id
 		left join district_glossory dg3 on b.location_area = dg3.id
+		left join admin d on a.aid = d.id 
 		where a.type = 1 and a.status != 1
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}

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

@@ -1189,7 +1189,16 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		Long l1,l2;
 		int diff1,diff2;
 		for(CustomerListOut clo: tmpList){
-			s1 = StringUtils.isBlank(clo.getLastFollowTime()) ? clo.getTransferTime() : clo.getLastFollowTime();
+			//s1 = StringUtils.isBlank(clo.getLastFollowTime()) ? clo.getTransferTime() : clo.getLastFollowTime();
+			if (StringUtils.isNotBlank(clo.getLastFollowTime())){
+				if(Integer.valueOf(clo.getLastFollowTime())>Integer.valueOf(clo.getTransferTime())) {
+					s1=clo.getLastFollowTime();
+				}else {
+					s1=clo.getTransferTime();
+				}
+			}else {
+				s1=clo.getTransferTime();
+			}
 			s2 = StringUtils.isBlank(clo.getLastSignTime()) ? clo.getTransferTime() : clo.getLastSignTime();
 			try {
 				l1 = DateUtils.parseDate(s1, AFTConstants.YYYYMMDDHHMMSS).getTime();