feat: There is no way the,福田标准自动变更逻辑 30%
This commit is contained in:
+28
-14
@@ -24,9 +24,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.sql.Clob;
|
import java.sql.Clob;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -77,6 +79,7 @@ public class UpdateStateBussSync {
|
|||||||
|
|
||||||
// 每天0点1分执行 企标标准文本状态 即将实施和现行有效状态自动变更逻辑
|
// 每天0点1分执行 企标标准文本状态 即将实施和现行有效状态自动变更逻辑
|
||||||
// @Scheduled(cron="0 0 1 1 * ?")
|
// @Scheduled(cron="0 0 1 1 * ?")
|
||||||
|
@Scheduled(cron="*/60 * * * * ?")
|
||||||
// @Scheduled(cron = "0 1 0 * * ?")
|
// @Scheduled(cron = "0 1 0 * * ?")
|
||||||
@Async
|
@Async
|
||||||
public void BussScheduled(){
|
public void BussScheduled(){
|
||||||
@@ -88,12 +91,12 @@ public class UpdateStateBussSync {
|
|||||||
// 发布、即将实施
|
// 发布、即将实施
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
// 发布
|
// 发布
|
||||||
list.add("hc99551723c");
|
list.add("6jnqba2mby");
|
||||||
// 即将实施
|
// 即将实施
|
||||||
list.add("hb0iy9z23c");
|
list.add("rpvoxsvr60");
|
||||||
QueryWrapper wrapper = new QueryWrapper();
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
wrapper.eq("A.VALID_FLAG","0");
|
wrapper.eq("A.VALID_FLAG","0");
|
||||||
wrapper.in("A.TEXT_STATUS",list);
|
wrapper.in("A.TEXT_STATUS_BUSS",list);
|
||||||
List<SarBussionessStand> getStateScheduledList = sarBussionessStandDao.getStateScheduledList(wrapper);
|
List<SarBussionessStand> getStateScheduledList = sarBussionessStandDao.getStateScheduledList(wrapper);
|
||||||
if(!getStateScheduledList.isEmpty()){
|
if(!getStateScheduledList.isEmpty()){
|
||||||
// N个实施日期中大于当前日期
|
// N个实施日期中大于当前日期
|
||||||
@@ -103,9 +106,8 @@ public class UpdateStateBussSync {
|
|||||||
List<String> dateIsAfterList = dateList.stream().filter(s -> {
|
List<String> dateIsAfterList = dateList.stream().filter(s -> {
|
||||||
if(Util.isValidDate(s)){
|
if(Util.isValidDate(s)){
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
LocalDateTime parse = LocalDate.parse(s, dateTimeFormatter).atStartOfDay();
|
||||||
LocalDateTime parse = LocalDateTime.parse(s, dtf);
|
|
||||||
// 实施日期是否大于当前日期
|
// 实施日期是否大于当前日期
|
||||||
return parse.isAfter(now);
|
return parse.isAfter(now);
|
||||||
}
|
}
|
||||||
@@ -125,9 +127,8 @@ public class UpdateStateBussSync {
|
|||||||
List<String> dateIsBeforeList = dateList.stream().filter(s -> {
|
List<String> dateIsBeforeList = dateList.stream().filter(s -> {
|
||||||
if(Util.isValidDate(s)){
|
if(Util.isValidDate(s)){
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
LocalDateTime parse = LocalDate.parse(s, dateTimeFormatter).atStartOfDay();
|
||||||
LocalDateTime parse = LocalDateTime.parse(s, dtf);
|
|
||||||
// 实施日期是否小于当前时间
|
// 实施日期是否小于当前时间
|
||||||
return parse.isBefore(now);
|
return parse.isBefore(now);
|
||||||
}
|
}
|
||||||
@@ -139,14 +140,14 @@ public class UpdateStateBussSync {
|
|||||||
return false;
|
return false;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
// N个实施日期中大于当前日期 执行逻辑
|
// N个实施日期中大于当前日期 执行逻辑 更为即将实施
|
||||||
if(!getStateScheduledListToIsAfter.isEmpty()){
|
if(!getStateScheduledListToIsAfter.isEmpty()){
|
||||||
execStandDate(getStateScheduledListToIsAfter,"hb0iy9z23c");
|
execStandDate(getStateScheduledListToIsAfter,"rpvoxsvr60");
|
||||||
}
|
}
|
||||||
|
|
||||||
// N个实施日期中小于当前时间 执行逻辑
|
// N个实施日期中小于当前时间 执行逻辑 更为现行有效
|
||||||
if(!getStateScheduledListToIsBefore.isEmpty()){
|
if(!getStateScheduledListToIsBefore.isEmpty()){
|
||||||
execStandDate(getStateScheduledListToIsAfter,"vsaga7nwub");
|
execStandDate(getStateScheduledListToIsBefore,"9z741h2m3j");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -179,13 +180,26 @@ public class UpdateStateBussSync {
|
|||||||
|
|
||||||
@Async
|
@Async
|
||||||
public void execStandDate(List<SarBussionessStand> infoList, String textStatusStand) throws Exception {
|
public void execStandDate(List<SarBussionessStand> infoList, String textStatusStand) throws Exception {
|
||||||
|
List<SarBussionessStand> list = new ArrayList<>();
|
||||||
for (SarBussionessStand info : infoList) {
|
for (SarBussionessStand info : infoList) {
|
||||||
info.setTextStatusBuss(textStatusStand);
|
info.setTextStatusBuss(textStatusStand);
|
||||||
bussAttrInfoShowSearchDetails(info);
|
bussAttrInfoShowSearchDetails(info);
|
||||||
if (info.getAttrInfoMap() != null) {
|
if (info.getAttrInfoMap() != null) {
|
||||||
info.setSarStandAttrEOStr(JSONObject.toJSONString(info.getAttrInfoMap()));
|
info.setSarStandAttrEOStr(JSONObject.toJSONString(info.getAttrInfoMap()));
|
||||||
}
|
}
|
||||||
createStandMQService.sendBussStandMQ(info,"update"); }
|
createStandMQService.sendBussStandMQ(info,"update");
|
||||||
|
|
||||||
|
// 只批量更新文本字段
|
||||||
|
SarBussionessStand newInfo = new SarBussionessStand();
|
||||||
|
newInfo.setTextStatusBuss(textStatusStand);
|
||||||
|
newInfo.setId(info.getId());
|
||||||
|
newInfo.setModifyTime(new Date());
|
||||||
|
list.add(newInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!list.isEmpty()){
|
||||||
|
iSarBussionessStandService.updateBatchById(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+16
-4
@@ -80,7 +80,7 @@ public class UpdateStateStandSync {
|
|||||||
|
|
||||||
// 每天0点1分执行 国内标准文本状态 即将实施和现行有效状态自动变更逻辑
|
// 每天0点1分执行 国内标准文本状态 即将实施和现行有效状态自动变更逻辑
|
||||||
// @Scheduled(cron="0 0 1 1 * ?")
|
// @Scheduled(cron="0 0 1 1 * ?")
|
||||||
// @Scheduled(cron="0 42 17 * * ?")
|
// @Scheduled(cron="0 37 9 * * ?")
|
||||||
// @Scheduled(cron = "0 1 0 * * ?")
|
// @Scheduled(cron = "0 1 0 * * ?")
|
||||||
@Async
|
@Async
|
||||||
public void StandScheduled(){
|
public void StandScheduled(){
|
||||||
@@ -89,7 +89,7 @@ public class UpdateStateStandSync {
|
|||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
logger.info("每天0点1分执行 国内标准文本状态 即将实施和现行有效状态自动变更逻辑:"+Thread.currentThread().getName() + " cron=0 1 0 * * ? --- " + new Date()+"---START-01");
|
logger.info("每天0点1分执行 国内标准文本状态 即将实施和现行有效状态自动变更逻辑:"+Thread.currentThread().getName() + " cron=0 1 0 * * ? --- " + new Date()+"---START-01");
|
||||||
|
|
||||||
// 发布、即将实施
|
// 发布、即将实施 只查询国内标准
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
// 发布
|
// 发布
|
||||||
list.add("hc99551723c");
|
list.add("hc99551723c");
|
||||||
@@ -97,6 +97,7 @@ public class UpdateStateStandSync {
|
|||||||
list.add("hb0iy9z23c");
|
list.add("hb0iy9z23c");
|
||||||
QueryWrapper wrapper = new QueryWrapper();
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
wrapper.eq("A.VALID_FLAG","0");
|
wrapper.eq("A.VALID_FLAG","0");
|
||||||
|
wrapper.eq("STAND_TYPE","INLAND");
|
||||||
wrapper.in("A.TEXT_STATUS",list);
|
wrapper.in("A.TEXT_STATUS",list);
|
||||||
List<SarStandardsInfo> getStateScheduledList = sarStandardsInfoDao.getStateScheduledList(wrapper);
|
List<SarStandardsInfo> getStateScheduledList = sarStandardsInfoDao.getStateScheduledList(wrapper);
|
||||||
if(!getStateScheduledList.isEmpty()){
|
if(!getStateScheduledList.isEmpty()){
|
||||||
@@ -141,14 +142,14 @@ public class UpdateStateStandSync {
|
|||||||
return false;
|
return false;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
// N个实施日期中大于当前日期 执行逻辑
|
// N个实施日期中大于当前日期 执行逻辑 更为即将实施
|
||||||
if(!getStateScheduledListToIsAfter.isEmpty()){
|
if(!getStateScheduledListToIsAfter.isEmpty()){
|
||||||
logger.info("=============N个实施日期中大于当前日期 执行============");
|
logger.info("=============N个实施日期中大于当前日期 执行============");
|
||||||
// 文本状态更为即将实施
|
// 文本状态更为即将实施
|
||||||
execStandDate(getStateScheduledListToIsAfter,"hb0iy9z23c");
|
execStandDate(getStateScheduledListToIsAfter,"hb0iy9z23c");
|
||||||
}
|
}
|
||||||
|
|
||||||
// N个实施日期中小于当前时间 执行逻辑
|
// N个实施日期中小于当前时间 执行逻辑 更为现行有效
|
||||||
if(!getStateScheduledListToIsBefore.isEmpty()){
|
if(!getStateScheduledListToIsBefore.isEmpty()){
|
||||||
logger.info("=============N个实施日期中小于当前时间 执行============");
|
logger.info("=============N个实施日期中小于当前时间 执行============");
|
||||||
// 文本状态更为现行有效
|
// 文本状态更为现行有效
|
||||||
@@ -175,6 +176,17 @@ public class UpdateStateStandSync {
|
|||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
logger.info("每天0点1分执行 国内标准文本状态被代替逻辑 标准自动变更废止:"+Thread.currentThread().getName() + " cron=0 1 0 * * ? --- " + new Date()+"---START-01");
|
logger.info("每天0点1分执行 国内标准文本状态被代替逻辑 标准自动变更废止:"+Thread.currentThread().getName() + " cron=0 1 0 * * ? --- " + new Date()+"---START-01");
|
||||||
|
|
||||||
|
// 发布、即将实施 只查询国内标准
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
// 发布
|
||||||
|
list.add("hc99551723c");
|
||||||
|
// 即将实施
|
||||||
|
list.add("hb0iy9z23c");
|
||||||
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
|
wrapper.eq("A.VALID_FLAG","0");
|
||||||
|
wrapper.eq("STAND_TYPE","INLAND");
|
||||||
|
wrapper.in("A.TEXT_STATUS",list);
|
||||||
|
List<SarStandardsInfo> getStateScheduledList = sarStandardsInfoDao.getStateScheduledList(wrapper);
|
||||||
|
|
||||||
logger.info("每天0点1分执行 国内标准文本状态被代替逻辑 标准自动变更废止:"+Thread.currentThread().getName() + " cron=0 1 0 * * ? --- " + new Date()+"---End-01");
|
logger.info("每天0点1分执行 国内标准文本状态被代替逻辑 标准自动变更废止:"+Thread.currentThread().getName() + " cron=0 1 0 * * ? --- " + new Date()+"---End-01");
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ import java.util.List;
|
|||||||
@Repository
|
@Repository
|
||||||
public interface SarBussionessStandDao extends BaseMapper<SarBussionessStand> {
|
public interface SarBussionessStandDao extends BaseMapper<SarBussionessStand> {
|
||||||
|
|
||||||
String updateStateScheduledSql = "SELECT A.*,B.BDTQBBHBUSS FROM sar_bussioness_stand A LEFT JOIN sar_buss_stand_attr_info B ON B.STAND_ID = A.ID";
|
String updateStateScheduledSql = "SELECT A.*,B.BDTQBBHBUSS FROM sar_bussioness_stand A LEFT JOIN sar_buss_stand_attr_info B ON B.STAND_ID = A.ID ${ew.customSqlSegment}";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动更新文本状态通用查询
|
* 自动更新文本状态通用查询
|
||||||
|
|||||||
@@ -1,2 +1,6 @@
|
|||||||
4.13------------------
|
4.13------------------
|
||||||
INSERT INTO `foton_slrs_test2`.`sar_menu`(`ID`, `SOR_DIVIDE`, `MENU_NAME`, `PARENT_ID`, `PARENT_IDS`, `LEVEL`, `DISPLAY_SEQ`, `HREF`, `VALID_FLAG`, `CREATION_TIME`, `MODIFY_TIME`, `REMARKS`) VALUES ('asdzcfgk', NULL, '政策法规库', NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL);
|
INSERT INTO `foton_slrs_test2`.`sar_menu`(`ID`, `SOR_DIVIDE`, `MENU_NAME`, `PARENT_ID`, `PARENT_IDS`, `LEVEL`, `DISPLAY_SEQ`, `HREF`, `VALID_FLAG`, `CREATION_TIME`, `MODIFY_TIME`, `REMARKS`) VALUES ('asdzcfgk', NULL, '政策法规库', NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
5.12------------------- 新增企标文本状态 发布、即将实施
|
||||||
|
INSERT INTO `foton_slrs`.`ts_dictype` (`ID`, `DIC_ID`, `DIC_TYPE_NAME`, `DIC_TYPE_CODE`, `DESCRIBES`, `SHOW_INDEX`, `PARENT_ID`, `TREE_PID`, `OTHERS`, `CREATION_USER`, `VALID_FLAG`, `CREATION_TIME`, `MODIFY_TIME`) VALUES ('yxje11vu7hngvakm6xor', 'qybmpmpvykzpwy511xai', '发布', '6jnqba2mby', '', '7', NULL, NULL, NULL, 'chenchunmei', '0', '2022-05-12 01:45:21', '2022-05-12 01:45:21');
|
||||||
|
INSERT INTO `foton_slrs`.`ts_dictype` (`ID`, `DIC_ID`, `DIC_TYPE_NAME`, `DIC_TYPE_CODE`, `DESCRIBES`, `SHOW_INDEX`, `PARENT_ID`, `TREE_PID`, `OTHERS`, `CREATION_USER`, `VALID_FLAG`, `CREATION_TIME`, `MODIFY_TIME`) VALUES ('n4wyayhkmbhc58wi21rs', 'qybmpmpvykzpwy511xai', '即将实施', 'rpvoxsvr60', '', '8', NULL, NULL, NULL, 'chenchunmei', '0', '2022-05-12 01:45:56', '2022-05-12 01:45:56');
|
||||||
|
|||||||
Reference in New Issue
Block a user