|  | @ -405,32 +405,40 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
 | 
	
		
			
				|  |  |             activityDO.setStatus(2);
 | 
	
		
			
				|  |  |         }else if("0".equals(type)){
 | 
	
		
			
				|  |  |             //上线
 | 
	
		
			
				|  |  |             String ruleJson=null!=activityRuleDO?activityRuleDO.getValue2():"";
 | 
	
		
			
				|  |  |             JSONObject obj=JSONObject.parseObject(ruleJson);
 | 
	
		
			
				|  |  |             SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
 | 
	
		
			
				|  |  |             SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
 | 
	
		
			
				|  |  |             //报名截止时间
 | 
	
		
			
				|  |  |             Date registrationTime=(null!=obj.get("registrationTime")? DateUtil.strToDate(sdf2.format(sdf1.parse(obj.get("registrationTime").toString())),"yyyy-MM-dd HH:mm"):null);
 | 
	
		
			
				|  |  |             //参与截止时间
 | 
	
		
			
				|  |  |             Date deadLine=(null!=obj.get("deadLine")? DateUtil.strToDate(sdf2.format(sdf1.parse(obj.get("deadLine").toString())),"yyyy-MM-dd HH:mm"):null);
 | 
	
		
			
				|  |  |             //活动下线时间
 | 
	
		
			
				|  |  |             Date activityOfflineTime=(null!=obj.get("activityOfflineTime")? DateUtil.strToDate(sdf2.format(sdf1.parse(obj.get("activityOfflineTime").toString())),"yyyy-MM-dd HH:mm"):null);
 | 
	
		
			
				|  |  |             //获取当前时间
 | 
	
		
			
				|  |  |             Date now = DateUtil.strToDate(sdf2.format(new Date()),"yyyy-MM-dd HH:mm");
 | 
	
		
			
				|  |  |             if(activityOfflineTime.compareTo(now)<=0){
 | 
	
		
			
				|  |  |                 //活动下线
 | 
	
		
			
				|  |  |                 activityDO.setStatus(2);
 | 
	
		
			
				|  |  |             }else if(activityOfflineTime.compareTo(now)>0 && deadLine.compareTo(now)<=0){
 | 
	
		
			
				|  |  |                 //活动结束
 | 
	
		
			
				|  |  |                 activityDO.setStatus(-1);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             }else if(deadLine.compareTo(now)>0&®istrationTime.compareTo(now)<=0){
 | 
	
		
			
				|  |  |                 //活动未结束
 | 
	
		
			
				|  |  |                 activityDO.setStatus(0);
 | 
	
		
			
				|  |  |             }else if (registrationTime.compareTo(now)>1){
 | 
	
		
			
				|  |  |                 //报名未截止
 | 
	
		
			
				|  |  |                 activityDO.setStatus(1);
 | 
	
		
			
				|  |  |             if(null!=activityRuleDO){
 | 
	
		
			
				|  |  |                 String ruleJson=activityRuleDO.getValue2();
 | 
	
		
			
				|  |  |                 JSONObject obj=JSONObject.parseObject(ruleJson);
 | 
	
		
			
				|  |  |                 SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
 | 
	
		
			
				|  |  |                 SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
 | 
	
		
			
				|  |  |                 //报名截止时间
 | 
	
		
			
				|  |  |                 Date registrationTime=(null!=obj.get("registrationTime")? DateUtil.strToDate(sdf2.format(sdf1.parse(obj.get("registrationTime").toString())),"yyyy-MM-dd HH:mm"):null);
 | 
	
		
			
				|  |  |                 //参与截止时间
 | 
	
		
			
				|  |  |                 Date deadLine=(null!=obj.get("deadLine")? DateUtil.strToDate(sdf2.format(sdf1.parse(obj.get("deadLine").toString())),"yyyy-MM-dd HH:mm"):null);
 | 
	
		
			
				|  |  |                 //活动下线时间
 | 
	
		
			
				|  |  |                 Date activityOfflineTime=(null!=obj.get("activityOfflineTime")? DateUtil.strToDate(sdf2.format(sdf1.parse(obj.get("activityOfflineTime").toString())),"yyyy-MM-dd HH:mm"):null);
 | 
	
		
			
				|  |  |                 //获取当前时间
 | 
	
		
			
				|  |  |                 Date now = DateUtil.strToDate(sdf2.format(new Date()),"yyyy-MM-dd HH:mm");
 | 
	
		
			
				|  |  |                 if(null!=activityOfflineTime&&activityOfflineTime.compareTo(now)<=0){
 | 
	
		
			
				|  |  |                     //活动下线
 | 
	
		
			
				|  |  |                     activityDO.setStatus(2);
 | 
	
		
			
				|  |  |                 }else if((null!=activityOfflineTime&&activityOfflineTime.compareTo(now)>0) && (null!=deadLine&&deadLine.compareTo(now)<=0)){
 | 
	
		
			
				|  |  |                     //活动结束
 | 
	
		
			
				|  |  |                     activityDO.setStatus(-1);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 }else if((null!=deadLine&&deadLine.compareTo(now)>0)&&(null!=registrationTime&®istrationTime.compareTo(now)<=0)){
 | 
	
		
			
				|  |  |                     //活动未结束
 | 
	
		
			
				|  |  |                     activityDO.setStatus(0);
 | 
	
		
			
				|  |  |                 }else if (null!=registrationTime&®istrationTime.compareTo(now)>1){
 | 
	
		
			
				|  |  |                     //报名未截止
 | 
	
		
			
				|  |  |                     activityDO.setStatus(1);
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                     //没有时间限制,上线
 | 
	
		
			
				|  |  |                     activityDO.setStatus(0);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 throw new Exception("活动规则缺失!");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | //        activityDO.setReleaseTime(new Date());
 | 
	
		
			
				|  |  |         activityDO=  activityDao.save(activityDO);
 |