Browse Source

Merge remote-tracking branch 'origin/test' into dev

anderx 7 years ago
parent
commit
43559a0603

+ 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">

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

@@ -330,15 +330,15 @@
 			dg1.name as province,
 			dg2.name as city, 
 			dg3.name as area,
-			d.name as adminName,
-			e.name as informationMaintainer		
+			a.aid,
+			a.share_type as shareType,
+			a.information_maintainer as mid 		
 		from user a 
 		left join organization_identity b on a.id = b.uid
 		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 
-		left join admin e on a.information_maintainer=e.id
 		where a.type = 1 and a.status != 1
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}

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

@@ -15,8 +15,8 @@ import com.goafanti.common.model.User;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.service.UserService;
-@Component
-//@Controller
+//@Component
+@Controller
 public class ReleaseUserTask {
 	@Resource
 	private CustomerService customerServiceImpl;
@@ -26,8 +26,8 @@ public class ReleaseUserTask {
 	/**
 	 * 每天凌晨一点释放客户和业务
 	 */
-	@Scheduled(cron = "0 0 12  * * ?") 
-//	@RequestMapping(value = "/releaseUser")
+//	@Scheduled(cron = "0 0 1  * * ?") 
+	@RequestMapping(value = "/releaseUser")
 	public void releaseUser(){
 		Date releaseTime = new Date();
 		List<User> userList = userServiceImpl.selectUserByRoleName("营销员","营销经理");

+ 20 - 0
src/main/java/com/goafanti/customer/bo/CustomerListOut.java

@@ -46,6 +46,10 @@ public class CustomerListOut extends CustomerListIn{
 	/** 资料所属人 **/
 	private String informationMaintainer;
 	
+	private String shareType;
+	
+	private String mid;
+	
 	public String getAuditOpinion() {
 		return auditOpinion;
 	}
@@ -164,4 +168,20 @@ public class CustomerListOut extends CustomerListIn{
 	public void setInformationMaintainer(String informationMaintainer) {
 		this.informationMaintainer = informationMaintainer;
 	}
+
+	public String getShareType() {
+		return shareType;
+	}
+
+	public void setShareType(String shareType) {
+		this.shareType = shareType;
+	}
+
+	public String getMid() {
+		return mid;
+	}
+
+	public void setMid(String mid) {
+		this.mid = mid;
+	}
 }

+ 24 - 3
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.BusinessGlossoryMapper;
 import com.goafanti.common.dao.BusinessProjectMapper;
 import com.goafanti.common.dao.OrganizationContactBookMapper;
@@ -93,6 +94,8 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	private BusinessProjectMapper businessProjectMapper;
 	@Resource
 	private UserLockReleaseMapper userLockReleaseMapper;
+	@Resource
+	private AdminMapper	adminMapper;
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<CustomerListOut> listPrivatePersonalCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
@@ -163,7 +166,16 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	public Pagination<CustomerListOut> listAllOrganizationCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
 		Map<String,Object> params = disposeParams(cli);
-		return (Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList","selectOrganizationCustomerCount",params,pageNo,pageSize);
+		Pagination<CustomerListOut> p=(Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList","selectOrganizationCustomerCount",params,pageNo,pageSize);
+		List<CustomerListOut> l=(List<CustomerListOut>) p.getList();
+		for (CustomerListOut c : l) {
+			if (null!=c) {
+				if(null!=c.getAid())c.setAdminName(adminMapper.selectNameByid(c.getAid()));
+				if (null!=c.getShareType()&&c.getShareType().equals("1"))c.setAdminName("暂无");
+				if(null!=c.getMid())c.setInformationMaintainer(adminMapper.selectNameByid(c.getMid()));
+			}
+		}
+		return p; 
 	}
 	
 	@Override
@@ -1177,9 +1189,18 @@ 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();
-			s2 = StringUtils.isBlank(clo.getLastSignTime()) ? clo.getTransferTime() : clo.getLastSignTime();
+			//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 {
+					s1=clo.getTransferTime();
+				}
+			}else {
+				s1=clo.getTransferTime();
+			}
+			s2 = StringUtils.isBlank(clo.getLastSignTime()) ? clo.getTransferTime() : clo.getLastSignTime();
 				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));