fix 80334 未符合项编辑新增时自动判断预警和整改

This commit is contained in:
lijiarao
2024-01-09 15:41:50 +08:00
parent a4bb08dedc
commit e09686f770
@@ -1,5 +1,7 @@
package com.jero.modules.projectLibrary.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -141,6 +143,17 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
}
lawsEvaluationNotMet.setStandardId(standardId);
lawsEvaluationNotMet.setSource(source);
//判断预警和超期
Date expectedTime = lawsEvaluationNotMet.getExpectedTime();
DateTime date = DateUtil.date();
DateTime theDayBefore = DateUtil.offsetDay(date, 1);
DateTime theDayAfter = DateUtil.offsetDay(date, -1);
if (expectedTime.compareTo(theDayAfter)<0){
lawsEvaluationNotMet.setState(AssessCommon.OVERDUE);
}else if (expectedTime.compareTo(theDayBefore)<0){
lawsEvaluationNotMet.setState(AssessCommon.WARNING);
}
}
/**