Commit af1583a7 authored by suhuiguang's avatar suhuiguang

1.巡检bug修改,23425, 25978

parent ff5cef42
......@@ -857,7 +857,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
String number = DateUtils.stampToDate(SystemClock.now(), "yyyyMMddHHmmss");
workOrderNumber = number + seq;
} finally {
lock.unlock();
if (lock.isHeldByCurrentThread()) {
lock.unlock();
}
}
return workOrderNumber;
}
......
......@@ -292,7 +292,7 @@ public class CheckController extends AbstractBaseController {
Date endTime = DateUtil.getLongDate(planTask.getEndTime());
int beginCompareTo = checkTime.compareTo(beginTime);
int endCompareTo = checkTime.compareTo(endTime);
if(beginCompareTo == -1 || endCompareTo == 1){
if(beginCompareTo < 0 || endCompareTo > 0){
return ResponseHelper.buildResponse("请在计划时间内完成任务!");
}
}
......@@ -598,7 +598,7 @@ public class CheckController extends AbstractBaseController {
@GetMapping(value = "/checkCalendarForWx", produces = "application/json;charset=UTF-8")
public ResponseModel<Object> checkCalendarForWx(
@RequestParam(required = false) String checkTime,
@RequestParam(required = true) String type) {
@RequestParam String type) {
try {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
......@@ -609,7 +609,7 @@ public class CheckController extends AbstractBaseController {
stopWatch.stop();
log.info("获取巡检日历数据=====> loginOrgCode time: {}", stopWatch.getTotalTimeSeconds());
if(StringUtils.isBlank(checkTime)) {
if(type.equals(String.valueOf(PlanTaskTypeStatusEnum.month.getValue()))) {
if(type.equals(String.valueOf(PlanTaskTypeStatusEnum.month.getName()))) {
checkTime = DateUtils.dateFormat(new Date(), DateUtils.YEAR_PATTERN);
} else {
checkTime = DateUtils.dateFormat(new Date(), DateUtils.MONTH_PATTERN);
......
......@@ -618,6 +618,15 @@ public class CheckServiceImpl implements ICheckService {
taskDetail.setStatus(CheckStatusEnum.QUALIFIED.getCode());
}
planTaskDetailDao.saveAndFlush(taskDetail);
// 结果不合格时 更新统计不合格数量,小程序任务详情 环形图上方统计使用
if(check.getIsOk().equals(CheckStatusEnum.UNQUALIFIED.getCode())){
Optional<ESPlanTaskListDto> op = esPlanTaskList.findById(String.valueOf(planTask.getId()));
op.ifPresent(esPlanTaskListDto->{
int unqualified = Integer.parseInt(esPlanTaskListDto.getUnqualified()) + 1;
esPlanTaskListDto.setUnqualified( unqualified + "");
esPlanTaskList.save(esPlanTaskListDto);
});
}
// ESTaskDetailDto esTaskDetailDto = esTaskDetail.findById(String.valueOf(taskDetail.getId())).get();
// esTaskDetailDto.setPointStatus(String.valueOf(taskDetail.getIsFinish()));
// JSONObject appCheckInput = esTaskDetailDto.getAppCheckInput();
......
......@@ -2301,13 +2301,13 @@
) stime
from ${table} tb
<where>
<if test="type=='1'">
<if test='type=="1"'>
DATE_FORMAT(tb.check_time, '%Y-%m') = #{checkTime}
</if>
<if test="type=='2'">
<if test='type=="2"'>
AND tb.check_time between #{startTime} and #{endTime}
</if>
<if test="type=='3'">
<if test='type=="3"'>
AND DATE_FORMAT(tb.check_time, '%Y') = #{checkTime}
</if>
<if test="orgCode!=null">AND tb.org_code = #{orgCode} </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment