Merge branch 'develop_master' into develop_migration
# Conflicts: # doc/sql/数据库改动.sql
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.adc.da.mq;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.DSarStandardDTO;
|
||||
import org.springframework.amqp.core.AmqpTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Component
|
||||
public class CreateStandardMQService {
|
||||
@Autowired
|
||||
private AmqpTemplate rabbitTemplate;
|
||||
|
||||
/**
|
||||
* @Author yuezhihang
|
||||
* @Description 创建消息队列
|
||||
* Date 2018/8/24 13:59
|
||||
* @Param [convert, convertType]
|
||||
* @return int
|
||||
**/
|
||||
public void sendMQ(List<DSarStandardDTO> changeJJSS, List<DSarStandardDTO> changeXXYX ){
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("changeJJSS",changeJJSS);
|
||||
map.put("changeXXYX",changeXXYX);
|
||||
// map.put("map",hashMap);
|
||||
//发送消息队列
|
||||
this.rabbitTemplate.convertAndSend("standard-exchange_updateText_RELEASE", "standard-key_updateText_RELEASE", map);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.DSarStandardDTO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.sys.service.IDicTypeEOService;
|
||||
@@ -201,6 +202,77 @@ public class SendQdUpdateMQService {
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@RabbitListener(bindings = @QueueBinding(
|
||||
value = @Queue(value = "createMQ_Standard_updateText_RELEASE", durable = "true"),
|
||||
exchange = @Exchange(value = "standard-exchange_updateText_RELEASE", ignoreDeclarationExceptions = "true"),
|
||||
key = "standard-key_updateText_RELEASE"))
|
||||
public void createStandardMQ(Map<String, Object> bussMap, Message message, Channel channel) throws Exception {
|
||||
|
||||
//数据字典数据组装
|
||||
//数据字典数据组装
|
||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) dicTypeEO.get("WBZTCLASS");
|
||||
arr.forEach(stringStringMap -> {
|
||||
map.put(stringStringMap.get("label"), stringStringMap.get("value"));
|
||||
});
|
||||
|
||||
|
||||
List<DSarStandardDTO> changeJJSS= (List<DSarStandardDTO>) bussMap.get("changeJJSS");
|
||||
List<DSarStandardDTO> changeXXYX= (List<DSarStandardDTO>) bussMap.get("changeXXYX");
|
||||
|
||||
|
||||
|
||||
//写修改逻辑
|
||||
Thread.sleep(5000);
|
||||
for (DSarStandardDTO jjss : changeJJSS) {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", jjss.getId());
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(jjss.getId());
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
sarStandardsInfo.setTextStatus(map.get("即将实施"));
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(jjss.getId());
|
||||
if (bussAttrInfoMap != null) {
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
}
|
||||
try {
|
||||
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (DSarStandardDTO jjss : changeXXYX) {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", jjss.getId());
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(jjss.getId());
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
sarStandardsInfo.setTextStatus(map.get("现行有效"));
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(jjss.getId());
|
||||
if (bussAttrInfoMap != null) {
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
}
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.adc.da.scheduled;
|
||||
|
||||
import com.adc.da.mq.CreateStandardMQService;
|
||||
import com.adc.da.scheduled.dao.SarStandardInfoDao;
|
||||
import com.adc.da.scheduled.dao.SarStandardItemDao;
|
||||
import com.adc.da.scheduled.dao.SarStandardWarningDao;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
|
||||
import com.adc.da.slrs.ActivityDatas.entity.DataList;
|
||||
import com.adc.da.slrs.processModel.utils.TrainFormDate;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
|
||||
@@ -13,8 +15,10 @@ 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.DSarStandardDTO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.sys.service.IDicTypeEOService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -35,6 +39,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -73,7 +79,13 @@ public class ScheduledJob {
|
||||
@Autowired
|
||||
private IWarningDateService iWarningDateService;// 预警日期
|
||||
|
||||
// @PostConstruct //程序启动时执行一次
|
||||
@Autowired
|
||||
CreateStandardMQService createStandardMQService;
|
||||
|
||||
@Autowired
|
||||
private IDicTypeEOService dicTypeEOService;
|
||||
|
||||
// @PostConstruct //程序启动时执行一次
|
||||
// @Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
// @Scheduled(fixedDelay = 120000)
|
||||
@@ -121,7 +133,7 @@ public class ScheduledJob {
|
||||
logger.info("========================================================================================================");
|
||||
//删除不在预警范围的标准
|
||||
int remove = sarStandardWarningDao.autoCancelWarning();
|
||||
logger.info("取消"+remove+"条预警");
|
||||
logger.info("取消" + remove + "条预警");
|
||||
|
||||
//预警期限(当前日期至3个月后)
|
||||
TermDTO term = new TermDTO();
|
||||
@@ -129,7 +141,7 @@ public class ScheduledJob {
|
||||
List<WarningDate> warningDateList = sarStandardWarningDao.getWarningDate(term);
|
||||
|
||||
ArrayList<WarningDate> data = new ArrayList<>();
|
||||
warningDateList.forEach(item->{
|
||||
warningDateList.forEach(item -> {
|
||||
|
||||
for (String s : item.getSSRQ().split(",")) {
|
||||
|
||||
@@ -157,16 +169,16 @@ public class ScheduledJob {
|
||||
//联接标准的日期子表 和分解单表 查询符合预警期限的标准和分解项
|
||||
List<EarlyWarningEO> warningList = sarStandardWarningDao.getWarningId(term);
|
||||
|
||||
warningList.forEach(item->{
|
||||
warningList.forEach(item -> {
|
||||
item.setId(UUIDUtils.randomUUID20());
|
||||
});
|
||||
//持久化至预警表 忽略标准id和标志位都一样的数据
|
||||
if (warningList.size()!=0){
|
||||
if (warningList.size() != 0) {
|
||||
//此表的STAND_ID和MARK字段以及ITEMS_ID字段需个建立唯一性约束
|
||||
int count = sarStandardWarningDao.ignoreInsert(warningList);
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("已预警"+ count+"条标准或条款!!");
|
||||
logger.info("已预警" + count + "条标准或条款!!");
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("==================================预警结束======================================");
|
||||
|
||||
@@ -174,10 +186,6 @@ public class ScheduledJob {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISarUpdLogService sarUpdLogEOService;
|
||||
|
||||
@@ -205,11 +213,11 @@ public class ScheduledJob {
|
||||
*实施日期是当前系统时间的标准文本状态变为'现行有效'
|
||||
*/
|
||||
QueryWrapper<SarStandAttrInfo> columnsAndCondition = new QueryWrapper<>();
|
||||
columnsAndCondition.select("STAND_ID").like("SSRQ",LocalDate.now());
|
||||
List<Map<String, Object>> effectiveList=sarStandAttrInfoDao.selectMaps(columnsAndCondition);
|
||||
columnsAndCondition.select("STAND_ID").like("SSRQ", LocalDate.now());
|
||||
List<Map<String, Object>> effectiveList = sarStandAttrInfoDao.selectMaps(columnsAndCondition);
|
||||
// List<ScheduledDTO> effectiveList = sarStandardInfoDao.selectWithinTerm(data, "SSRQ");
|
||||
|
||||
effectiveList.forEach(item->{
|
||||
effectiveList.forEach(item -> {
|
||||
try {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(item.get("STAND_ID").toString());
|
||||
@@ -218,8 +226,8 @@ public class ScheduledJob {
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
||||
// sarStandardInfoDao.updateStandardInfo(item.getStandId(),"vsaga7nwub");
|
||||
|
||||
}catch (Exception e){
|
||||
System.out.println("标准id为=="+item.get("STAND_ID").toString()+"==文本状态更新失败");
|
||||
} catch (Exception e) {
|
||||
System.out.println("标准id为==" + item.get("STAND_ID").toString() + "==文本状态更新失败");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -230,8 +238,8 @@ public class ScheduledJob {
|
||||
QueryWrapper<SarStandAttrInfo> columnForDTBJH = new QueryWrapper<>();
|
||||
|
||||
columnForDTBJH.select("DTBJH")
|
||||
.eq("VALID_FLAG","0")
|
||||
.ne("DTBJH","");
|
||||
.eq("VALID_FLAG", "0")
|
||||
.ne("DTBJH", "");
|
||||
//查询代替标准字段得到一个 被代替了的标准的id的键值对列表
|
||||
List<Map<String, Object>> replaceStandIdMaps = sarStandAttrInfoDao.selectMaps(columnForDTBJH);
|
||||
HashMap<String, Integer> replaceIdCountMap = new HashMap<>();
|
||||
@@ -242,15 +250,15 @@ public class ScheduledJob {
|
||||
* 国内外表准号格式不统一
|
||||
*/
|
||||
// Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
|
||||
replaceStandIdMaps.forEach(item->{
|
||||
if (item!=null){
|
||||
//此标准代替的标准的标准号的数组
|
||||
String DTBJHStr = item.get("DTBJH").toString();
|
||||
replaceStandIdMaps.forEach(item -> {
|
||||
if (item != null) {
|
||||
//此标准代替的标准的标准号的数组
|
||||
String DTBJHStr = item.get("DTBJH").toString();
|
||||
|
||||
//数据格式: (GB 123-2000,GB 4233434-2021,GB 423423423-2021)
|
||||
if (!DTBJHStr.equals("")) {
|
||||
String[] DTBJHArray = DTBJHStr.split(",");
|
||||
for (String DTBJH : DTBJHArray) {
|
||||
//数据格式: (GB 123-2000,GB 4233434-2021,GB 423423423-2021)
|
||||
if (!DTBJHStr.equals("")) {
|
||||
String[] DTBJHArray = DTBJHStr.split(",");
|
||||
for (String DTBJH : DTBJHArray) {
|
||||
|
||||
// if (!pattern.matcher(DTBJH).matches()){
|
||||
// continue;
|
||||
@@ -268,45 +276,43 @@ public class ScheduledJob {
|
||||
// .eq("STAND_YEAR", year);
|
||||
|
||||
|
||||
List<String> standId = sarStandardsInfoDao.selectIdFormDTBZH(DTBJH);
|
||||
if (standId.size() > 0) {
|
||||
boolean b = replaceIdCountMap.containsKey(standId.get(0));
|
||||
//如果代替标准id已存在则映射为2不存在则添加并映射为1
|
||||
if (b) {
|
||||
replaceIdCountMap.replace(standId.get(0), 2);
|
||||
} else {
|
||||
replaceIdCountMap.put(standId.get(0), 1);
|
||||
}
|
||||
List<String> standId = sarStandardsInfoDao.selectIdFormDTBZH(DTBJH);
|
||||
if (standId.size() > 0) {
|
||||
boolean b = replaceIdCountMap.containsKey(standId.get(0));
|
||||
//如果代替标准id已存在则映射为2不存在则添加并映射为1
|
||||
if (b) {
|
||||
replaceIdCountMap.replace(standId.get(0), 2);
|
||||
} else {
|
||||
replaceIdCountMap.put(standId.get(0), 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
//一个被代替标准号时,文本状态更新为废止状态,两个及以上时更新为被代替状态
|
||||
for (String key : replaceIdCountMap.keySet()) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
String reasonMsg="";
|
||||
switch (replaceIdCountMap.get(key)){
|
||||
case 1 :
|
||||
String reasonMsg = "";
|
||||
switch (replaceIdCountMap.get(key)) {
|
||||
case 1:
|
||||
//废止状态
|
||||
sarStandardsInfo.setTextStatus("chblaarg77");
|
||||
sarStandardsInfo.setId(key);
|
||||
reasonMsg="该标准被一个标准代替";
|
||||
reasonMsg = "该标准被一个标准代替";
|
||||
break;
|
||||
case 2 :
|
||||
case 2:
|
||||
//被代替状态
|
||||
sarStandardsInfo.setTextStatus("qke0ckro2p");
|
||||
sarStandardsInfo.setId(key);
|
||||
reasonMsg="该标准被一个以上标准代替";
|
||||
reasonMsg = "该标准被一个以上标准代替";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -321,11 +327,11 @@ public class ScheduledJob {
|
||||
sarStandardsInfo.setStandNumber(beforeSarStandardsInfoEO.getStandNumber());
|
||||
sarStandardsInfo.setStandYear(beforeSarStandardsInfoEO.getStandYear());
|
||||
sarStandardsInfo.setStandName(beforeSarStandardsInfoEO.getStandName());
|
||||
saveUpdateLog(sarStandardsInfo,beforeSarStandardsInfoEO,reasonMsg);
|
||||
saveUpdateLog(sarStandardsInfo, beforeSarStandardsInfoEO, reasonMsg);
|
||||
//更新日志
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
||||
}catch (Exception e){
|
||||
System.out.println("代替标准状态更新:id为"+key+"文本状态更新失败");
|
||||
} catch (Exception e) {
|
||||
System.out.println("代替标准状态更新:id为" + key + "文本状态更新失败");
|
||||
}
|
||||
}
|
||||
logger.info("==================================更新文本状态结束======================================");
|
||||
@@ -334,22 +340,134 @@ public class ScheduledJob {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void saveUpdateLog(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo,String reasonMsg) throws Exception {
|
||||
public void saveUpdateLog(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo, String reasonMsg) throws Exception {
|
||||
Map<String, Object> newMap = new HashMap<>();
|
||||
Map<String, Object> oldMap = new HashMap<>();
|
||||
String attrStr = sarStandardsInfoEO.getSarStandAttrEOStr();
|
||||
if (StringUtils.isNotBlank(attrStr)) {
|
||||
newMap = JSONObject.fromObject(attrStr);
|
||||
}
|
||||
newMap.put("textStatus",sarStandardsInfoEO.getTextStatus());
|
||||
oldMap.put("textStatus",beforeSarStandardsInfo.getTextStatus());
|
||||
newMap.put("textStatus", sarStandardsInfoEO.getTextStatus());
|
||||
oldMap.put("textStatus", beforeSarStandardsInfo.getTextStatus());
|
||||
// 增加关联事件
|
||||
String number = sarStandardsInfoEO.getStandSort() + " " + sarStandardsInfoEO.getStandNumber();
|
||||
if (StringUtils.isNotBlank(sarStandardsInfoEO.getStandYear())) {
|
||||
number += "-" + sarStandardsInfoEO.getStandYear();
|
||||
}
|
||||
String content ="==定时任务执行修改==:" + number + " 《" + sarStandardsInfoEO.getStandName() + "》"+reasonMsg;
|
||||
String content = "==定时任务执行修改==:" + number + " 《" + sarStandardsInfoEO.getStandName() + "》" + reasonMsg;
|
||||
sarUpdLogEOService.createUpdateLog(sarStandardsInfoEO.getStandType() + "_STAND", sarStandardsInfoEO.getId(), oldMap, newMap, content);
|
||||
}
|
||||
|
||||
|
||||
// @Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
// @Scheduled(cron = "*/30 * * * * ?")
|
||||
@Async
|
||||
public void TextStatusUpdateStandard() {
|
||||
Logger logger = LoggerFactory.getLogger(ScheduledJob.class);
|
||||
logger.info("=======================================开始更新文本状态======================================");
|
||||
//第一步 查询满足条件的数据 第一步只能查询 需要的标准id和日期
|
||||
//查询出两组数据
|
||||
Map<String, String> map = new HashMap<>();
|
||||
List<String> types = new ArrayList<>();
|
||||
types.add("WBZTCLASS");
|
||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCodeByType(types);
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) dicTypeEO.get("WBZTCLASS");
|
||||
arr.forEach(stringStringMap -> {
|
||||
stringStringMap.keySet().forEach(s -> {
|
||||
map.put(stringStringMap.get("label"), stringStringMap.get("value"));
|
||||
});
|
||||
});
|
||||
//只针对国内标准 INLAND
|
||||
|
||||
// 查询国标 实施日期 晚于现在
|
||||
// 标准状态属于发布
|
||||
// 标准状态改为即将实施
|
||||
List<DSarStandardDTO> changeJJSS = new ArrayList<>();
|
||||
List<String> strings = new ArrayList<>();
|
||||
strings.add(map.get("发布"));
|
||||
List<DSarStandardDTO> sarStandardsInfos = sarStandardsInfoDao.dealWithDS("INLAND", strings);
|
||||
//判定时间
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (null != sarStandardsInfos && sarStandardsInfos.size() > 0) {
|
||||
for (DSarStandardDTO s : sarStandardsInfos) {
|
||||
if (null != s.getSSRQ()) {
|
||||
if (s.getSSRQ().contains(",")) {
|
||||
//多个日期拆分 一个满足就都满足
|
||||
if (findFirstTime(s.getSSRQ()).compareTo(new Date()) >= 0 && !changeJJSS.contains(s)) {
|
||||
changeJJSS.add(s);
|
||||
}
|
||||
} else {
|
||||
Date date = null;
|
||||
try {
|
||||
date = dateFormat.parse(TrainFormDate.dealWithTimeZoneyyyy(s.getSSRQ(), "yyyy-MM-dd"));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
logger.info("时间为:" + date);
|
||||
//与现在时间进行比较
|
||||
if (date.compareTo(new Date()) >= 0 && !changeJJSS.contains(s)) {
|
||||
changeJJSS.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 标桩状态 属于即将实施 或 发布
|
||||
// 实施日期 在今天之前
|
||||
// 标准状态 改为现行有效
|
||||
List<DSarStandardDTO> changeXXYX = new ArrayList<>();
|
||||
List<String> strings2 = new ArrayList<>();
|
||||
strings2.add(map.get("即将实施"));
|
||||
strings2.add(map.get("发布"));
|
||||
List<DSarStandardDTO> sarStandardsInfos1 = sarStandardsInfoDao.dealWithDS("INLAND", strings2);
|
||||
if (null != sarStandardsInfos1 && sarStandardsInfos1.size() > 0) {
|
||||
for (DSarStandardDTO s : sarStandardsInfos1) {
|
||||
if (null != s.getSSRQ()) {
|
||||
if (s.getSSRQ().contains(",")) {
|
||||
//多个日期拆分 一个满足就都满足
|
||||
if (findFirstTime(s.getSSRQ()).compareTo(new Date()) < 0 && !changeXXYX.contains(s)) {
|
||||
changeXXYX.add(s);
|
||||
}
|
||||
} else {
|
||||
Date date = null;
|
||||
try {
|
||||
date = dateFormat.parse(TrainFormDate.dealWithTimeZoneyyyy(s.getSSRQ(), "yyyy-MM-dd"));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
logger.info("时间为:" + date);
|
||||
//与现在时间进行比较
|
||||
if (date.compareTo(new Date()) < 0 && !changeXXYX.contains(s)) {
|
||||
changeXXYX.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("改为即将实施的有" + changeJJSS.size() + "条");
|
||||
logger.info("改为现行有效的有" + changeXXYX.size() + "条");
|
||||
logger.info("=============================");
|
||||
createStandardMQService.sendMQ(changeJJSS,changeXXYX);
|
||||
}
|
||||
}
|
||||
|
||||
private Date findFirstTime(String ssrq) {
|
||||
String[] as = ssrq.split(",");
|
||||
List<Date> dates = new ArrayList<>();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
for (String s : as) {
|
||||
Date date = null;
|
||||
try {
|
||||
date = dateFormat.parse(TrainFormDate.dealWithTimeZoneyyyy(s, "yyyy-MM-dd"));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
dates.add(date);
|
||||
}
|
||||
dates.sort(Comparator.comparing(date -> date));
|
||||
return dates.get(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class StandDataServiceImpl extends ServiceImpl<StandDataDao, StandData> i
|
||||
standDataQuery.stream().peek(standData -> {
|
||||
FileResult fileResult = new FileResult();
|
||||
fileResult.setDocumentName(verifyObj(standData.getStandSort(),standData.getStandNumber(),standData.getStandName()));
|
||||
fileResult.setDocumentUrl(webUrl+"?userName="+encode(searchStandContext.getUserName())+"&dataId="+standData.getStandId()+"&datatype="+standData.getStandType());
|
||||
fileResult.setDocumentUrl(webUrl+"?dataId="+standData.getStandId()+"&datatype="+standData.getStandType());
|
||||
fileResultList.add(fileResult);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.adc.da.slrs.sarQaInfo.entity;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准法规问答信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-05-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarQaInfo对象", description="标准法规问答信息表")
|
||||
public class SarQaInfoPage extends BasePage {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "资源类型-标准、法规、企标")
|
||||
@TableField("RES_TYPE")
|
||||
private String resType;
|
||||
|
||||
@ApiModelProperty(value = "资源ID")
|
||||
@TableField("RES_ID")
|
||||
private String resId;
|
||||
|
||||
@TableField("QUE_USER")
|
||||
private String queUser;
|
||||
|
||||
@TableField("ANSWER_USER")
|
||||
private String answerUser;
|
||||
|
||||
@TableField("RE_ANSWER_USER")
|
||||
private String reAnswerUser;
|
||||
|
||||
@ApiModelProperty(value = "提问时间")
|
||||
@TableField("QUE_TIME")
|
||||
private LocalDateTime queTime;
|
||||
|
||||
@ApiModelProperty(value = "是否解答")
|
||||
@TableField("ANSWER_FLAG")
|
||||
private BigDecimal answerFlag;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private BigDecimal validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATED_TIME")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
@TableField("CREATED_USER")
|
||||
private String createdUser;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
@TableField("MODIFY_USER")
|
||||
private String modifyUser;
|
||||
|
||||
|
||||
}
|
||||
+1
-1
@@ -829,7 +829,7 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
return "1";
|
||||
}
|
||||
|
||||
|
||||
//处理 代替被代替数据 关系
|
||||
@ApiOperation(value = "国内海外数据处理接口")
|
||||
@GetMapping("/replaceBdtbzhforDtbzh")
|
||||
public String replaceBdtbzhforDtbzh(SarStandardsInfo sarStandardsInfo) {
|
||||
|
||||
+3
@@ -1,5 +1,6 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.DSarStandardDTO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage;
|
||||
@@ -96,4 +97,6 @@ public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
|
||||
|
||||
List<String> selectIdFormDTBZH(String DTBZHCode);
|
||||
|
||||
List<DSarStandardDTO> dealWithDS(@Param("type") String standType, @Param("status")List<String> strings);
|
||||
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class DSarStandardDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String SSRQ;
|
||||
|
||||
// 新添加字段
|
||||
@ApiModelProperty(value = "文本状态")
|
||||
@TableField("TEXT_STATUS")
|
||||
private String textStatus;
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user