对实施日期进行预警.更新对条款的预警,加入使用车型和责任工程师
This commit is contained in:
@@ -7,6 +7,7 @@ import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
@@ -54,8 +55,8 @@ public class ScheduledJob {
|
||||
|
||||
|
||||
|
||||
@Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
// @Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
@Scheduled(cron="*/5 * * * * ?")
|
||||
@Async
|
||||
public void WarningSchedulingTasks() {
|
||||
|
||||
@@ -76,6 +77,14 @@ public class ScheduledJob {
|
||||
1:新车条款预警
|
||||
2:在产车条款预警
|
||||
*/
|
||||
|
||||
//删除不在预警范围的标准
|
||||
QueryWrapper<EarlyWarningEO> earlyWarningEOQW = new QueryWrapper<>();
|
||||
earlyWarningEOQW.lt("PUT_TIME",LocalDate.now());
|
||||
int remove = sarStandardWarningDao.delete(earlyWarningEOQW);
|
||||
System.out.println(remove);
|
||||
|
||||
|
||||
System.out.println("开始执行预警!!!");
|
||||
|
||||
DataDTO term = new DataDTO(); //预警期限(当前日期至3个月后)
|
||||
@@ -98,6 +107,7 @@ public class ScheduledJob {
|
||||
.setPower("1")
|
||||
.setMark("2")
|
||||
.setPutTime(warningEO.getZCCSSRQ());
|
||||
|
||||
}
|
||||
warningList.addAll(itemForZCCSSRQ);
|
||||
|
||||
@@ -109,6 +119,8 @@ public class ScheduledJob {
|
||||
.setMark("3")
|
||||
.setPutTime(warningEO.getXCXSSRQ())
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
|
||||
|
||||
}
|
||||
warningList.addAll(standInfoXCXSSRQ);
|
||||
|
||||
@@ -143,8 +155,8 @@ public class ScheduledJob {
|
||||
|
||||
|
||||
|
||||
// @Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
@Scheduled(cron="*/5 * * * * ?")
|
||||
@Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
@Async
|
||||
public void TextStatusSchedulingTasks() {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.adc.da.scheduled.dao;
|
||||
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -9,7 +11,7 @@ import org.springframework.stereotype.Repository;
|
||||
import java.util.LinkedList;
|
||||
|
||||
@Repository
|
||||
public interface SarStandardWarningDao extends IService<WarningEO> {
|
||||
public interface SarStandardWarningDao extends BaseMapper<EarlyWarningEO> {
|
||||
|
||||
public int ignoreInsert(@Param(value = "warningEOS") LinkedList<WarningEO> warningEOS);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package com.adc.da.scheduled.entity;
|
||||
|
||||
import com.alibaba.druid.sql.visitor.functions.Char;
|
||||
import com.sun.org.apache.bcel.internal.generic.NEW;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@@ -30,4 +36,19 @@ public class DataDTO {
|
||||
this.endDate=endDate;
|
||||
}
|
||||
|
||||
//
|
||||
// public boolean isTerm(T date){
|
||||
//
|
||||
// if (date.getClass().equals(Date.class)){
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//线程不安全
|
||||
//
|
||||
// DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
// String dataStr= dtf.format(LocalDate.now());
|
||||
// LocalDate localDateTime = LocalDate.parse(dataStr, dtf);
|
||||
// return
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ public class WarningEO extends EarlyWarningEO {
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private Date ZCCSSRQ;
|
||||
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private Date SSRQ;
|
||||
|
||||
private String standNum;
|
||||
|
||||
private String standSort;
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
|
||||
+1
-3
@@ -108,9 +108,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
return "更改成功";
|
||||
}
|
||||
private IPage<EarlyWarningEO> getEarlyWarningEOIPage(int current,int pageSize, QueryWrapper<EarlyWarningEO> wrapper) {
|
||||
DataDTO dataDTO = new DataDTO();
|
||||
wrapper.eq("power",1)
|
||||
.between("PUT_TIME",dataDTO.getStartDate(),dataDTO.getEndDate());
|
||||
wrapper.eq("power",1);
|
||||
Page<EarlyWarningEO> page = new Page<>(current, pageSize);
|
||||
IPage<EarlyWarningEO> userIPage = earlyWarningEODao.selectPage(page, wrapper);
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<result column="STAND_YEAR" property="standYear"/>
|
||||
<result column="XCXSSRQ" property="XCXSSRQ"/>
|
||||
<result column="ZCCSSRQ" property="ZCCSSRQ"/>
|
||||
<result column="SSRQ" property="SSRQ"/>
|
||||
<result column="CLLX" property="applyType" />
|
||||
<result column="STAND_TYPE" property="standType" />
|
||||
<result column="ZRGCS" property="dutyEngineer" />
|
||||
@@ -27,6 +28,7 @@
|
||||
info.STAND_TYPE,
|
||||
attrInfo.CLLX,
|
||||
attrInfo.ZRGCS,
|
||||
attrInfo.SSRQ,
|
||||
attrInfo.${str}
|
||||
FROM
|
||||
sar_standards_info AS info
|
||||
@@ -35,9 +37,11 @@
|
||||
1=1
|
||||
<if test="date!=null">
|
||||
and
|
||||
attrInfo.SSRQ
|
||||
BETWEEN #{date.startDate} and #{date.endDate}
|
||||
or
|
||||
attrInfo.${str}
|
||||
BETWEEN DATE_FORMAT( #{date.startDate},'%Y-%m-%d %H:%i:%s')
|
||||
and DATE_FORMAT( #{date.endDate},'%Y-%m-%d %H:%i:%s')
|
||||
BETWEEN #{date.startDate} and #{date.endDate}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
@@ -20,22 +20,23 @@
|
||||
<select id="selectWithinTerm" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.DataDTO">
|
||||
SELECT
|
||||
items.ID,
|
||||
STAND_ID,
|
||||
ITEMS_NUM,
|
||||
ITEMS_NAME,
|
||||
TERMS_CONDITIONS,
|
||||
DUTY_ENGINEER,
|
||||
APPLY_ARCTIC,
|
||||
items.ITEMS_NUM,
|
||||
items.ITEMS_NAME,
|
||||
items.TERMS_CONDITIONS,
|
||||
items.DUTY_ENGINEER,
|
||||
items.STAND_ID,
|
||||
info.STAND_TYPE,
|
||||
info.STAND_NUMBER,
|
||||
|
||||
${str}
|
||||
attrInfo.CLLX,
|
||||
attrInfo.ZRGCS,
|
||||
items.${str}
|
||||
FROM
|
||||
sar_stand_items AS items
|
||||
JOIN sar_standards_info AS info ON items.STAND_ID=info.ID
|
||||
JOIN sar_stand_attr_info AS attrInfo ON info.id = attrinfo.stand_id
|
||||
|
||||
WHERE
|
||||
${str} BETWEEN #{date.startDate} and #{date.endDate}
|
||||
items.${str} BETWEEN #{date.startDate} and #{date.endDate}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user