Merge branch 'develop_no_common_group' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop_no_common_group
This commit is contained in:
@@ -161,10 +161,11 @@ public class ScheduleUpdateInterceptor extends BaseInterceptor{
|
||||
//整理需要 insert 的 schedule_cfg 的数据
|
||||
List<ScheduleCfg> scheduleList = Lists.newArrayList();
|
||||
for(BaseCfg<?> baseCfg : cfgList) {
|
||||
baseCfg.setIsValid(0);//设置默认值
|
||||
baseCfg.setIsAudit(0);//设置默认值
|
||||
ScheduleCfg scList = copyScheduleCfgFromBaseCfg(baseCfg, tableName);
|
||||
if(scList!=null){
|
||||
//TODO 定时任务设置默认为isValid=0 isAudit=0,需要考虑允许用户新增isValid=1 isAudit=1的配置下发
|
||||
scList.setIsValid(0);//设置默认值
|
||||
scList.setIsAudit(0);//设置默认值
|
||||
scheduleList.add(scList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,6 +315,34 @@ public class ScheduleCfgJob implements Job {
|
||||
Date invalidTime = DateBuilder.todayAt(invalidList.get(0), invalidList.get(1), invalidList.get(2));
|
||||
CalendarIntervalScheduleBuilder intervalBuilder = null;
|
||||
if("EVERYDAY".equalsIgnoreCase(dayOrWeek)) {
|
||||
//开始时间+2分钟
|
||||
Calendar validStartCal=Calendar.getInstance();
|
||||
validStartCal.setTime(validStartTime);
|
||||
validStartCal.add(Calendar.MINUTE, 2);
|
||||
long validStartTimes=validStartCal.getTime().getTime();
|
||||
//结束时间+2分钟
|
||||
Calendar invalidCal=Calendar.getInstance();
|
||||
invalidCal.setTime(invalidTime);
|
||||
invalidCal.add(Calendar.MINUTE, 2);
|
||||
long invalidTimes=validStartCal.getTime().getTime();
|
||||
long currentTimes=new Date().getTime();
|
||||
//开始时间设置为今天已过时,则将开始时间加上周期
|
||||
if((currentTimes-validStartTimes) > 0) {
|
||||
Calendar validStartCalNew=Calendar.getInstance();
|
||||
validStartCalNew.setTime(validStartTime);
|
||||
validStartCalNew.add(Calendar.DAY_OF_MONTH, interval);
|
||||
validStartTime=validStartCalNew.getTime();
|
||||
}
|
||||
|
||||
//结束时间设置为今天已过时,则将开始时间加上周期
|
||||
if((currentTimes-invalidTimes) > 0) {
|
||||
Calendar invalidCalNew=Calendar.getInstance();
|
||||
invalidCalNew.setTime(invalidTime);
|
||||
invalidCalNew.add(Calendar.DAY_OF_MONTH, interval);
|
||||
invalidTime=invalidCalNew.getTime();
|
||||
}
|
||||
|
||||
|
||||
intervalBuilder = CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInDays(interval);
|
||||
//valid
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
@@ -329,6 +357,7 @@ public class ScheduleCfgJob implements Job {
|
||||
.startAt(validStartTime)
|
||||
.build();
|
||||
triList.add(validTri);
|
||||
|
||||
//invalid
|
||||
dataMap = new JobDataMap();
|
||||
dataMap.put("isValid", false);
|
||||
@@ -478,14 +507,25 @@ public class ScheduleCfgJob implements Job {
|
||||
|
||||
|
||||
/**
|
||||
* 查找最近的 星期几 ,包括今天
|
||||
* 查找最近的 星期几 ,包括今天(如果今天的时间点已过,从明天开始算)
|
||||
* @param date
|
||||
* @param w 周一开始 1 -7
|
||||
* @return
|
||||
*/
|
||||
public static Date closestAfterWeek(Date date,int w) {
|
||||
//设置calC为开始时间+2分钟,判断calC时间是否已过,如果小于当前时间则直接从明天开始算
|
||||
Calendar calC = Calendar.getInstance();
|
||||
calC.setTime(date);
|
||||
calC.add(Calendar.MINUTE, 2);
|
||||
long currentDate=new Date().getTime();//当前时间
|
||||
long weekStartDate=calC.getTime().getTime();//周任务开始时间+2分钟
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
//如果开始时间已过期,则从明天开始算
|
||||
if((currentDate-weekStartDate) > 0) {
|
||||
cal.add(Calendar.DAY_OF_MONTH, 1);
|
||||
}
|
||||
int i = cal.get(Calendar.DAY_OF_WEEK);//周日开始 1-7
|
||||
i = (i==1)? 7: i-1;//转换为 周一到 周日 1-7
|
||||
cal.add(Calendar.DAY_OF_MONTH, (i>w)?(7-(i-w)) : (w-i));
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
submitHandler : function(form) {
|
||||
var flag = true;
|
||||
//存在隐藏的subscribeId,不算进域配置
|
||||
if($(".boxSolid[class~='subscribeId']").length>0){
|
||||
/* if($(".boxSolid[class~='subscribeId']").length>0){
|
||||
if($(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){
|
||||
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
@@ -57,10 +57,11 @@
|
||||
}
|
||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||
}else{
|
||||
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
|
||||
} */
|
||||
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
submitHandler : function(form) {
|
||||
var flag = true;
|
||||
//存在隐藏的subscribeId,不算进域配置
|
||||
if($(".boxSolid[class~='subscribeId']").length>0){
|
||||
/* if($(".boxSolid[class~='subscribeId']").length>0){
|
||||
if($(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){
|
||||
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
@@ -57,10 +57,12 @@
|
||||
}
|
||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||
}else{
|
||||
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
|
||||
} */
|
||||
|
||||
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
submitHandler : function(form) {
|
||||
|
||||
var flag = true;
|
||||
var subscribeId=0;
|
||||
/* var subscribeId=0;
|
||||
//存在隐藏的subscribeId,不算进域配置
|
||||
if($(".boxSolid.hidden").hasClass("subscribeId")){
|
||||
subscribeId=1;
|
||||
@@ -59,12 +59,12 @@
|
||||
var boxSolidLenth=$(".boxSolid").length;
|
||||
if($(".boxSolid").hasClass("subscribeId")){
|
||||
boxSolidLenth=boxSolidLenth-1;
|
||||
}
|
||||
} */
|
||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||
if(boxSolidLenth == ($(".boxSolid.hidden").length-subscribeId)){
|
||||
if(boxSolidLenth == ($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
||||
|
||||
@@ -28,20 +28,20 @@
|
||||
submitHandler : function(form) {
|
||||
|
||||
var flag = true;
|
||||
var subscribeId=0;
|
||||
/* var subscribeId=0;
|
||||
//存在隐藏的subscribeId,不算进域配置
|
||||
if($(".boxSolid.hidden").hasClass("subscribeId")){
|
||||
subscribeId=1;
|
||||
}
|
||||
} */
|
||||
var boxSolidLenth=$(".boxSolid").length;
|
||||
if($(".boxSolid").hasClass("subscribeId")){
|
||||
/* if($(".boxSolid").hasClass("subscribeId")){
|
||||
boxSolidLenth=boxSolidLenth-1;
|
||||
}
|
||||
} */
|
||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||
if(boxSolidLenth == ($(".boxSolid.hidden").length-subscribeId)){
|
||||
if(boxSolidLenth == ($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
||||
|
||||
@@ -53,20 +53,20 @@
|
||||
submitHandler : function(form) {
|
||||
|
||||
var flag = true;
|
||||
var subscribeId=0;
|
||||
/* var subscribeId=0;
|
||||
//存在隐藏的subscribeId,不算进域配置
|
||||
if($(".boxSolid.hidden").hasClass("subscribeId")){
|
||||
subscribeId=1;
|
||||
}
|
||||
} */
|
||||
var boxSolidLenth=$(".boxSolid").length;
|
||||
if($(".boxSolid").hasClass("subscribeId")){
|
||||
/* if($(".boxSolid").hasClass("subscribeId")){
|
||||
boxSolidLenth=boxSolidLenth-1;
|
||||
}
|
||||
} */
|
||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||
if(boxSolidLenth ==($(".boxSolid.hidden").length-subscribeId)){
|
||||
if(boxSolidLenth ==($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
||||
|
||||
@@ -321,7 +321,7 @@
|
||||
</c:if>
|
||||
<c:if test="${region.configRegionValue eq _cfg.ntcSubscribeIdCfg.cfgType }">
|
||||
<!--response body info-->
|
||||
<div class="ntcSubscribeIdCfgCfg">
|
||||
<div class="httpReqCfg ntcSubscribeIdCfgCfg">
|
||||
<c:set var="tabName" value="ntcSubscribeIdCfgTab"></c:set>
|
||||
<h4 class="form-section">
|
||||
<spring:message code="NTC_SUBSCRIBE_ID" />
|
||||
|
||||
@@ -32,20 +32,20 @@
|
||||
submitHandler : function(form) {
|
||||
|
||||
var flag = true;
|
||||
var subscribeId=0;
|
||||
/* var subscribeId=0;
|
||||
//存在隐藏的subscribeId,不算进域配置
|
||||
if($(".boxSolid.hidden").hasClass("subscribeId")){
|
||||
subscribeId=1;
|
||||
}
|
||||
} */
|
||||
var boxSolidLenth=$(".boxSolid").length;
|
||||
if($(".boxSolid").hasClass("subscribeId")){
|
||||
/* if($(".boxSolid").hasClass("subscribeId")){
|
||||
boxSolidLenth=boxSolidLenth-1;
|
||||
}
|
||||
} */
|
||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||
if(boxSolidLenth ==($(".boxSolid.hidden").length-subscribeId)){
|
||||
if(boxSolidLenth ==($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
||||
|
||||
@@ -78,12 +78,12 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(!$(".httpResCfg").hasClass("hidden")){
|
||||
if(!$(".httpResCfg").hasClass("hidden")){
|
||||
if($(".httpResCfg").find(".boxSolid").length==$(".httpResCfg").find(".boxSolid.hidden").length){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
||||
@@ -397,7 +397,7 @@
|
||||
</c:if>
|
||||
<c:if test="${region.configRegionValue eq _cfg.ntcSubscribeIdCfg.cfgType }">
|
||||
<!--response header info-->
|
||||
<div class="subscribeId">
|
||||
<div class="httpResCfg subscribeId httpReqCfg">
|
||||
<c:set var="tabName" value="subscribeIdTab"></c:set>
|
||||
<h4 class="form-section" >
|
||||
<spring:message code="${region.configRegionValue}" />
|
||||
|
||||
@@ -34,19 +34,19 @@
|
||||
submitHandler : function(form) {
|
||||
//loading('onloading...');
|
||||
var flag = true;
|
||||
var subscribeId=0;
|
||||
/* var subscribeId=0;
|
||||
//console.log("boxSolid:"+$(".boxSolid.hidden").length);
|
||||
//console.log("hidden subscribeId:"+$(".boxSolid,.hidden").hasClass("subscribeId"));
|
||||
//存在隐藏的subscribeId,不算进域配置
|
||||
if($(".boxSolid.hidden").hasClass("subscribeId")){
|
||||
subscribeId=1;
|
||||
}
|
||||
} */
|
||||
var boxSolidLenth=$(".boxSolid").length;
|
||||
if($(".boxSolid").hasClass("subscribeId")){
|
||||
/* if($(".boxSolid").hasClass("subscribeId")){
|
||||
boxSolidLenth=boxSolidLenth-1;
|
||||
}
|
||||
} */
|
||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||
if(boxSolidLenth ==($(".boxSolid.hidden").length-subscribeId)){
|
||||
if(boxSolidLenth ==($(".boxSolid.hidden").length)){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -589,9 +589,14 @@ $(function(){
|
||||
});*/
|
||||
$("input[name*='userRegion'][type='text']").addClass("invisibleChar");
|
||||
$("#cancel").on("click",function(){
|
||||
window.history.back();
|
||||
return false;
|
||||
window.history.back();
|
||||
return false;
|
||||
});
|
||||
$("button[id='audit']").on("click",function(){
|
||||
$("input[name='isValid']").val(1);
|
||||
$("input[name='isAudit']").val(1);
|
||||
});
|
||||
|
||||
//去掉首尾空格
|
||||
$("input,textarea").on("blur",function(){
|
||||
if($(this).attr("type")!="file"){
|
||||
|
||||
Reference in New Issue
Block a user