Merge remote-tracking branch 'origin/master_merge' into master_merge
This commit is contained in:
@@ -409,17 +409,21 @@ public class CoolCutTask extends AbstractAcsTask {
|
||||
String point_code2 = form.getString("point_code2");
|
||||
String point_code3 = form.getString("point_code3");
|
||||
String point_code4 = form.getString("point_code4");
|
||||
if (isSingleTask(point_code1)) {
|
||||
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||
JSONObject task1 = isSingleTask(point_code1);
|
||||
if ( ObjectUtil.isNotEmpty(task1)) {
|
||||
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务:"+task1.getString("task_code"));
|
||||
}
|
||||
if (isSingleTask(point_code2)) {
|
||||
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
||||
JSONObject task2 = isSingleTask(point_code2);
|
||||
if ( ObjectUtil.isNotEmpty(task2)) {
|
||||
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务:"+task2.getString("task_code"));
|
||||
}
|
||||
if (isSingleTask(point_code3)) {
|
||||
throw new BadRequestException("点位:" + point_code3 + "存在未完成的任务!");
|
||||
JSONObject task3 = isSingleTask(point_code3);
|
||||
if ( ObjectUtil.isNotEmpty(task3)) {
|
||||
throw new BadRequestException("点位:" + point_code3 +"存在未完成的任务:"+task3.getString("task_code"));
|
||||
}
|
||||
if (isSingleTask(point_code4)) {
|
||||
throw new BadRequestException("点位:" + point_code4 + "存在未完成的任务!");
|
||||
JSONObject task4 = isSingleTask(point_code4);
|
||||
if ( ObjectUtil.isNotEmpty(task4)) {
|
||||
throw new BadRequestException("点位:" + point_code4 + "存在未完成的任务:"+task4.getString("task_code"));
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
@@ -473,17 +477,23 @@ public class CoolCutTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
//判断该点位是否存在未完成的任务
|
||||
public boolean isSingleTask(String point_code) {
|
||||
public JSONObject isSingleTask(String point_code) {
|
||||
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
JSONObject task2 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code2 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
JSONObject task3 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code3 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
JSONObject task4 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code4 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(task1) || ObjectUtil.isNotEmpty(task2) || ObjectUtil.isNotEmpty(task3) || ObjectUtil.isNotEmpty(task4)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
if(ObjectUtil.isNotEmpty(task1)){
|
||||
return task1;
|
||||
}else if(ObjectUtil.isNotEmpty(task2)){
|
||||
return task2;
|
||||
}else if(ObjectUtil.isNotEmpty(task3)){
|
||||
return task3;
|
||||
}else if(ObjectUtil.isNotEmpty(task4)){
|
||||
return task4;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user