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

修改客户模块

Signed-off-by: anderx <312518615@qq.com>
anderx лет назад: 5
Родитель
Сommit
034bd0ba7a

+ 6 - 1
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -138,7 +138,12 @@ public class AFTConstants {
 	/** 转公共客户拜访时限 **/
 	public static final long USER_FOLLOW_LIMIT_MS					= 24*3600*1000*30L;
 	/** 转公公共客户签单时限 **/
-	public static final long USER_SIGN_LIMIT_MS						= 24*3600*1000*360L;
+	public static final long USER_SIGN_LIMIT_MS						= 24*3600*1000*270L;
+	
+	/** 转公共客户拜访时限 **/
+	public static final long PROJECT_FOLLOW_LIMIT_MS					= 24*3600*1000*360L;
+	/** 转公公共客户签单时限 **/
+	public static final long PROJECT_SIGN_LIMIT_MS						= 24*3600*1000*900L;
 	
 	public static final Integer USER_STATUS = 1;
 	/** 领取员工上线 **/

+ 18 - 11
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -127,7 +127,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Map<String,Object> params = disposeParams(cli);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPrivatePersonalCustomerList","selectPrivatePersonalCustomerCount",params,pageNo,pageSize);
 		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList);
+		setCustomerList(tmpList,0);
 		list.setList(tmpList);
 		return list;
 	}
@@ -172,7 +172,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		params.put("sortType",sortType);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPrivateOrganizationCustomerList","selectPrivateOrganizationCustomerCount",params,pageNo,pageSize);
 		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList);
+		setCustomerList(tmpList,0);
 		list.setList(tmpList);
 		return list;
 	}
@@ -1277,15 +1277,16 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return userMapper.updateRefusedCustomer(id, nickname, mobile, societyTag);
 	}
 	
-	private void setCustomerList(List<CustomerListOut> tmpList){
+	private void setCustomerList(List<CustomerListOut> tmpList,int i){
 		Date now = new Date();
 		String s1,s2;
 		Long l1,l2;
-		int diff1,diff2;
+		int diff1=0,diff2=0;
 		for(CustomerListOut clo: tmpList){
-			//s1 = StringUtils.isBlank(clo.getLastFollowTime()) ? clo.getTransferTime() : clo.getLastFollowTime();
 			try {
+				//如果最近跟进为空直接取转换时间
 			if (StringUtils.isNotBlank(clo.getLastFollowTime())){
+				//如果最近跟进小于转换取转换时间
 				if(DateUtils.parseDate(clo.getLastFollowTime(), AFTConstants.YYYYMMDDHHMMSS).getTime()>DateUtils.parseDate(clo.getTransferTime(), AFTConstants.YYYYMMDDHHMMSS).getTime()) {
 					s1=clo.getLastFollowTime();
 				}else {
@@ -1294,11 +1295,17 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			}else {
 				s1=clo.getTransferTime();
 			}
-			s2 = StringUtils.isBlank(clo.getLastSignTime()) ? clo.getTransferTime() : clo.getLastSignTime();
+			//另外一个时间取转换时间
+			s2 = clo.getTransferTime();
 				l1 = DateUtils.parseDate(s1, AFTConstants.YYYYMMDDHHMMSS).getTime();
 				l2 = DateUtils.parseDate(s2, AFTConstants.YYYYMMDDHHMMSS).getTime();
-				diff1 = (int)((l1 + AFTConstants.USER_FOLLOW_LIMIT_MS - now.getTime())/(24*3600*1000));
-				diff2 = (int)((l2 + AFTConstants.USER_SIGN_LIMIT_MS - now.getTime())/(24*3600*1000));
+				if(i==0) {
+					diff1 = (int)((l1 + AFTConstants.USER_FOLLOW_LIMIT_MS - now.getTime())/(24*3600*1000));
+					diff2 = (int)((l2 + AFTConstants.USER_SIGN_LIMIT_MS - now.getTime())/(24*3600*1000));
+				}else if (i==1) {
+					diff1 = (int)((l1 + AFTConstants.PROJECT_FOLLOW_LIMIT_MS - now.getTime())/(24*3600*1000));
+					diff2 = (int)((l2 + AFTConstants.PROJECT_SIGN_LIMIT_MS - now.getTime())/(24*3600*1000));
+				}
 				clo.setSurplusFollowTime(diff1 + "");
 				clo.setSurplusSignTime(diff2 + "");
 			} catch (ParseException e) {
@@ -1316,7 +1323,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Map<String,Object> params = disposeParams(cli);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectSignOrganizationCustomerList","selectSignOrganizationCustomerCount",params,pageNo,pageSize);
 		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList);
+		setCustomerList(tmpList,1);
 		list.setList(tmpList);
 		return list;
 	}
@@ -1329,7 +1336,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		Map<String,Object> params = disposeParams(cli);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectSignPersonalCustomerList","selectSignPersonalCustomerCount",params,pageNo,pageSize);
 		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
-		setCustomerList(tmpList);
+		setCustomerList(tmpList,0);
 		list.setList(tmpList);
 		return list;
 	}
@@ -1492,7 +1499,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		params.put("sort", sort);
 		params.put("sortType",sortType);
 		List<CustomerListOut> list= userMapper.privateUnitCustomerList(params);
-		setCustomerList(list);
+		setCustomerList(list,0);
 		if (list==null || list.size()==0) return null;
 		String[] comment = {"客户名称","地区","联系人","联系电话","社会性质","客户初始时间","剩余私有天数","最新跟进时间","客户等级"};
 		String filePath = uploadPath + "/privateUnitCustomer";