Browse Source

Merge branch 'test' of jishutao/kede-server into prod

anderx 5 years ago
parent
commit
47b8e24e9b

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

@@ -53,8 +53,6 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	private UserBusinessMapper	userBusinessMapper;
 	@Resource(name = "passwordUtil")
 	private PasswordUtil					passwordUtil;
-	@Autowired
-	private DistrictGlossoryMapper	districtGlossoryMapper;
 	
 	@Override
 	public List<Admin> selectAllAdmin() {

+ 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;
 	/** 领取员工上线 **/

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

@@ -722,7 +722,7 @@
 
   
   <select id="listAdminByName" parameterType="java.lang.String" resultMap="BaseResultMap">
-	select id,name from admin where name like concat('%',#{name},'%')  
+	select id,name from admin where status='正常'  and name like concat('%',#{name},'%')  
   </select>
 
   <!--*************************************************************************-->

+ 2 - 2
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml

@@ -507,8 +507,8 @@
 		select
 		name,id
 		from admin
-		where
-		name  like concat('%',#{name,jdbcType=VARCHAR},'%')
+		where status='正常'
+		and name  like concat('%',#{name,jdbcType=VARCHAR},'%')
 	</select>
 	<select id="selectAllById" resultType="com.goafanti.organization.bo.OrganizationListOut">
 	select

+ 2 - 2
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1094,7 +1094,7 @@ ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.s
   	left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id
     left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber from task_progress 
     group by task_id) i on a.id=i.task_id left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid left join t_order_outsource l
-    on a.id=l.tid where  e.delete_sign in (0,1,2)  and e.order_status in (2,4) 
+    on a.id=l.tid where  e.delete_sign in (0,2,3)  and e.order_status in (2,4) 
     and a.outsource= #{outsource,jdbcType=INTEGER}
     <if test="role == 0 ">
     and a.task_receiver= #{aid,jdbcType=VARCHAR}
@@ -1158,7 +1158,7 @@ ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.s
   
    <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
   	select  count(*) from t_order_task a  left join t_order_new e on a.order_no=e.order_no
-    left join admin g on e.salesman_id=g.id left join department h on g.department_id=h.id where e.delete_sign in (0,1,2)  and e.order_status in (2,4) 
+    left join admin g on e.salesman_id=g.id left join department h on g.department_id=h.id where e.delete_sign in (0,2,3)  and e.order_status in (2,4) 
     and a.outsource= #{outsource,jdbcType=INTEGER}
    <if test="role == 0 ">
     and a.task_receiver= #{aid,jdbcType=VARCHAR}

+ 3 - 3
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -97,7 +97,7 @@ public class PatentTask {
 						n.setContent(str2+",aid="+p.getAid());
 						nlist.add(n);
 							continue;
-					 }else if (!SendEmailUtil.isEmail(p.getEmail())) {
+					 }else if (!SendEmailUtil.isEmail(p.getEmail().trim())) {
 						n.setContent(str2+",管理员="+a.getName());
 						nlist.add(n);
 						//再发一条给管理员
@@ -227,8 +227,8 @@ public class PatentTask {
 	}
 	
 	
-
-		
+	
+	
 	/**
          * @param htmlStr
          * @return

+ 29 - 20
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;
 	}
@@ -509,10 +509,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 					//更新业务表
 					userBusiness.setId(ub.getBusinessId());
 					if (us.getFollowSituation()==5) {//如果已签合同,则不允许变更
-					/*if (ub.getFollowSituation()!=5&&checkCustomerInformation(uid)) {
-						throw new BusinessException(new Error("","请到客户资料-客户资料维护模块完善您的客户信息!"));
-						}*/
-						if (ub.getCustomerStatus()!=us.getCustomerStatus()|| ub.getFollowSituation()!=5) {
+						if (ub.getCustomerStatus()!=us.getCustomerStatus()&& ub.getFollowSituation()!=5) {
 							throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_LOCKED,""));
 						}
 					}
@@ -941,7 +938,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			user.setShareType(AFTConstants.USER_SHARE_PRIVATE);
 			user.setInformationMaintainer(TokenManager.getAdminId());
 			user.setSource(2);//客户来源设置为领取
-			user.setTransferTime(now);
+//			转换不重置时间
+//			user.setTransferTime(now);
 			flag = addUserLock(uid,TokenManager.getAdminId(),0,null,now); //指定用户锁定客户
 			if(flag <= 0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_RECEIVE,""));
 			if(userMapper.UserReceiveCount(TokenManager.getAdminId())>AFTConstants.USER_RCEIVE_MAX)
@@ -950,7 +948,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		}else if(operatorType.equals(AFTConstants.USER_TRANSFER_TO_OTHER)){
 			user.setAid(String.valueOf(params[0]));
 			user.setSource(3);//客户来源设置为转交
-			user.setTransferTime(now);
+//			转换不重置时间
+//			user.setTransferTime(now);
 			//查询这个客户是否是登陆人的客户
 			if(userMapper.getAidAndUser(uid,TokenManager.getAdminId())<=0)throw new BusinessException(new Error("请勿非法操作!","请勿非法操作!"));
 			flag = updateUserLock(uid,oldAid,UserLockReleaseStatus.LOCKED.getCode(),UserLockReleaseStatus.RELEASE.getCode()); //原用户释放客户
@@ -1277,15 +1276,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 +1294,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 +1322,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 +1335,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 +1498,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";
@@ -1524,11 +1530,14 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		LockingReleaseBo l=list.get(0);
 		UserLockRelease ul=new UserLockRelease();
 		ul.setId(l.getId());
-		ul.setStatus(2);
-		ul.setReleaseTime(now);
+//		不做释放与锁定的动作
+//		ul.setStatus(2);
+		ul.setAid(inputId);
+//		不修改时间
+//		ul.setReleaseTime(now);
 		userLockReleaseMapper.updateByPrimaryKeySelective(ul);
 		addtransferLog(uid,pid,TokenManager.getAdminId(),inputId,1);
-		addUserLock(uid,inputId,1,pid,now); //指定用户锁定客户
+//		addUserLock(uid,inputId,1,pid,now); //指定用户锁定客户
 		List<BusinessListBo> bl=userBusinessMapper.selectBusinessProjectByUAPid(uid, TokenManager.getAdminId(), pid);
 		if (bl.size()==1) {
 			UserBusiness ub=new UserBusiness();

+ 8 - 8
src/main/resources/props/config_local.properties

@@ -1,13 +1,13 @@
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-#jdbc.url=jdbc\:mysql\://localhost\:3306/aft?useUnicode\=true&characterEncoding\=UTF-8&autoReconnect\=true&useSSL\=false
-#jdbc.username=dev
-#jdbc.password=123456
+jdbc.url=jdbc\:mysql\://localhost\:3306/aft?useUnicode\=true&characterEncoding\=UTF-8&autoReconnect\=true&useSSL\=false
+jdbc.username=dev
+jdbc.password=123456
 #测试
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft20200511?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=aftdev
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft20200511?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 #\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
 jdbc.validationQuery=SELECT 'x'
 #\u521d\u59cb\u8fde\u63a5\u6570
@@ -60,12 +60,12 @@ template.cacheable=false
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-#static.host=//sb.jishutao.com/1.1.43
+#static.host=//sb.jishutao.com/1.1.46
 #avatar.host=//sb.jishutao.com
 
 #连测试
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.43
+static.host=//static.jishutao.com/1.1.46
 
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -54,7 +54,7 @@ session.validate.timespan=18000000
 app.name=AFT
 template.cacheable=false
 
-static.host=//static.jishutao.com/1.1.43
+static.host=//static.jishutao.com/1.1.46
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload