Merge branch 'develop_3' into 'develop_master'
Develop 3 See merge request LiuChao/foton-slrs-system-rest!266
This commit is contained in:
@@ -9,6 +9,8 @@ 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.sarStandWarning.entity.WarningDate;
|
||||
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
@@ -25,6 +27,7 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -59,8 +62,10 @@ public class ScheduledJob {
|
||||
@Autowired
|
||||
private SarStandAttrInfoDao sarStandAttrInfoDao; //属性字段表
|
||||
|
||||
@Autowired
|
||||
private IWarningDateService iWarningDateService;// 预警日期
|
||||
|
||||
|
||||
// @PostConstruct //程序启动时执行一次
|
||||
@Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
@Async
|
||||
@@ -98,8 +103,14 @@ public class ScheduledJob {
|
||||
|
||||
TermDTO term = new TermDTO(); //预警期限(当前日期至3个月后)
|
||||
|
||||
List<WarningDate> warningDateList = sarStandardWarningDao.getWarningDate(term); //查询符合预警期限的标准 多个
|
||||
|
||||
List<EarlyWarningEO> warningList = sarStandardWarningDao.getWarningId(term);
|
||||
warningDateList.forEach(item->{
|
||||
item.setId(UUIDUtils.randomUUID20());
|
||||
});
|
||||
iWarningDateService.remove(null); //清空标准的日期子表
|
||||
iWarningDateService.saveBatch(warningDateList); // 保存进入标准的日期子表 保存标准的实施日期 新车型实施日期 在产车实施日期 多个
|
||||
List<EarlyWarningEO> warningList = sarStandardWarningDao.getWarningId(term); //联接标准的日期子表 和分解单表 查询符合预警期限的标准和分解项
|
||||
|
||||
warningList.forEach(item->{
|
||||
item.setId(UUIDUtils.randomUUID20());
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.adc.da.scheduled.dao;
|
||||
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -19,4 +20,7 @@ public interface SarStandardWarningDao extends BaseMapper<EarlyWarningEO> {
|
||||
public int autoCancelWarning();
|
||||
|
||||
public List<EarlyWarningEO> getWarningId(TermDTO term);
|
||||
|
||||
public List<WarningDate> getWarningDate(TermDTO term);
|
||||
|
||||
}
|
||||
|
||||
+31
@@ -74,4 +74,35 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getWarningDate" resultType="com.adc.da.slrs.sarStandWarning.entity.WarningDate">
|
||||
|
||||
|
||||
SELECT lawId,timeName,DATE_FORMAT(SSRQ,'%Y-%m-%d') as SSRQ FROM
|
||||
(
|
||||
select attr.STAND_ID as lawId,'SSRQ' as timeName,
|
||||
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||
from sar_stand_attr_info attr
|
||||
join mysql.help_topic b
|
||||
on b.help_topic_id < (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
||||
|
||||
UNION ALL
|
||||
|
||||
select attr.STAND_ID as lawId,'XCXSSRQ' as timeName,
|
||||
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||
from sar_stand_attr_info attr
|
||||
join mysql.help_topic b
|
||||
on b.help_topic_id < (length(attr.XCXSSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
||||
UNION ALL
|
||||
select attr.STAND_ID as lawId,'ZCCSSRQ' as timeName,
|
||||
substring_index(substring_index(attr.ZCCSSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||
from sar_stand_attr_info attr
|
||||
join mysql.help_topic b
|
||||
on b.help_topic_id < (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
||||
|
||||
) as T
|
||||
WHERE
|
||||
DATE_FORMAT(T.SSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
+4
-4
@@ -758,15 +758,15 @@
|
||||
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ',''))
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = '')
|
||||
or (stand_name like concat(concat('%',#{page.standNumber}),'%'))
|
||||
<!-- or (stand_name like concat(concat('%',#{page.standNumber}),'%')) -->
|
||||
)
|
||||
</if>
|
||||
<!-- 标准名称 -->
|
||||
<if test="page.standName != null and page.standName != ''">
|
||||
and stand_name like concat(concat('%',#{page.standName}),'%')
|
||||
or STAND_NUMBER like concat(concat('%',#{page.standName}),'%')
|
||||
or STAND_YEAR like concat(concat('%',#{page.standName}),'%')
|
||||
or STAND_SORT like concat(concat('%',#{page.standName}),'%')
|
||||
<!-- or STAND_NUMBER like concat(concat('%',#{page.standName}),'%') -->
|
||||
<!-- or STAND_YEAR like concat(concat('%',#{page.standName}),'%') -->
|
||||
<!-- or STAND_SORT like concat(concat('%',#{page.standName}),'%') -->
|
||||
</if>
|
||||
<if test="page.standEnName != null and page.standEnName != ''">
|
||||
and stand_en_name like concat(concat('%',#{page.standEnName}),'%')
|
||||
|
||||
Reference in New Issue
Block a user