Merge remote-tracking branch 'origin/develop_master' into develop_master

This commit is contained in:
yuezhihang
2022-06-23 14:35:57 +08:00
4 changed files with 262 additions and 205 deletions
@@ -69,45 +69,45 @@ public class ProcessTimer {
public void urging() { public void urging() {
if(isNotScheduled){ if(isNotScheduled){
log.info("=================================自动催办定时任务启动====================================="); log.info("=================================自动催办定时任务启动=====================================");
List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null); // List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null);
if (null != busProcessNames && 0 < busProcessNames.size()) { // if (null != busProcessNames && 0 < busProcessNames.size()) {
for (BusProcessName busProcessName : busProcessNames) { // for (BusProcessName busProcessName : busProcessNames) {
String type = busProcessName.getPrcType(); // String type = busProcessName.getPrcType();
Integer typeInt = 99; // Integer typeInt = 99;
if (StringUtils.isNotEmpty(type)) { // if (StringUtils.isNotEmpty(type)) {
typeInt = Integer.valueOf(type); // typeInt = Integer.valueOf(type);
} // }
type = chooseType(typeInt, type); // type = chooseType(typeInt, type);
//
UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName()); // UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
String[] array = userEO.getEmail().split(","); // String[] array = userEO.getEmail().split(",");
String overTime = busProcessName.getOverTime(); // String overTime = busProcessName.getOverTime();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date dateTime = null; // Date dateTime = null;
Integer num = 3; // Integer num = 3;
try { // try {
dateTime = simpleDateFormat.parse(overTime); // dateTime = simpleDateFormat.parse(overTime);
Date now = new Date(); // Date now = new Date();
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000); // long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
num = Integer.valueOf(String.valueOf(daysBetween)); // num = Integer.valueOf(String.valueOf(daysBetween));
} catch (ParseException e) { // } catch (ParseException e) {
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'"); // SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
try { // try {
dateTime = simpleDateFormat1.parse(overTime); // dateTime = simpleDateFormat1.parse(overTime);
Date now = new Date(); // Date now = new Date();
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000); // long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
num = Integer.valueOf(String.valueOf(daysBetween)); // num = Integer.valueOf(String.valueOf(daysBetween));
} catch (ParseException e1) { // } catch (ParseException e1) {
e.getMessage(); // e.getMessage();
} // }
} // }
//
String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理,距离截至日期还有[" + String.valueOf(num) + "]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" + // String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理,距离截至日期还有[" + String.valueOf(num) + "]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" +
" ——来自 全球标准法规管理系统"; // " ——来自 全球标准法规管理系统";
String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务"; // String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
mailUtil.sendMsgFeign(array, title, msg); // mailUtil.sendMsgFeign(array, title, msg);
} // }
} // }
log.info("=================================自动催办定时任务结束====================================="); log.info("=================================自动催办定时任务结束=====================================");
} }
} }
@@ -188,6 +188,41 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
attrInfoMap.put(key, "null"); attrInfoMap.put(key, "null");
} }
} }
// 逻辑字段
if ("FOREIGN".equals(String.valueOf(attrInfoMap.get("standType")))){
fullTextSearchEO.put("standTypeOrder","2");
}else {
fullTextSearchEO.put("standTypeOrder","1");
}
fullTextSearchEO.put("standSortOrder",esStateOrder(String.valueOf(attrInfoMap.get("standSort")),dicMap));
fullTextSearchEO.put("yearOrder", String.valueOf(attrInfoMap.get("standYear")));
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("standSort")));
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("standNumber")));
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("standName")));
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("standEnName")));
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("textStatusName",""));
// 全文检索 加入 发布稿 分解单条款内容逻辑
StringBuilder itemBuilder = new StringBuilder();
mapItems.forEach((s, s2) -> {
itemBuilder.append(s+" ").append(s2).append("</br>");
});
StringBuilder textItemContent = replaceAll(itemBuilder, "null", "--");
fullTextSearchEO.put("textItems",textItemContent.toString());
if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
fullTextSearchEO.put("issue_time", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))));
fullTextSearchEO.put("issue_time_order", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))).replace("-",""));
}else {
fullTextSearchEO.put("issue_time", "--");
fullTextSearchEO.put("issue_time_order", "--");
}
// 文本内容字段
try {
StringBuilder contentBuilder = new StringBuilder(); StringBuilder contentBuilder = new StringBuilder();
contentBuilder.append("标准类别:").append(attrInfoMap.get("standSort")).append(" "); contentBuilder.append("标准类别:").append(attrInfoMap.get("standSort")).append(" ");
@@ -268,35 +303,8 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
contentBuilder.append("标准文本: ").append(attrInfoMap.get("content")).append(" "); contentBuilder.append("标准文本: ").append(attrInfoMap.get("content")).append(" ");
StringBuilder textContent = replaceAll(contentBuilder, "null", "--"); StringBuilder textContent = replaceAll(contentBuilder, "null", "--");
fullTextSearchEO.put("textContent",textContent.toString()); fullTextSearchEO.put("textContent",textContent.toString());
if ("FOREIGN".equals(String.valueOf(attrInfoMap.get("standType")))){ }catch (Exception e){
fullTextSearchEO.put("standTypeOrder","2"); logger.info("err:" + errFilter(e.getMessage()));
}else {
fullTextSearchEO.put("standTypeOrder","1");
}
fullTextSearchEO.put("standSortOrder",esStateOrder(String.valueOf(attrInfoMap.get("standSort")),dicMap));
fullTextSearchEO.put("yearOrder", String.valueOf(attrInfoMap.get("standYear")));
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("standSort")));
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("standNumber")));
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("standName")));
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("standEnName")));
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("textStatusName",""));
// 全文检索 加入 发布稿 分解单条款内容逻辑
StringBuilder itemBuilder = new StringBuilder();
mapItems.forEach((s, s2) -> {
itemBuilder.append(s+" ").append(s2).append("</br>");
});
StringBuilder textItemContent = replaceAll(itemBuilder, "null", "--");
fullTextSearchEO.put("textItems",textItemContent.toString());
if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
fullTextSearchEO.put("issue_time", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))));
fullTextSearchEO.put("issue_time_order", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))).replace("-",""));
}else {
fullTextSearchEO.put("issue_time", "--");
fullTextSearchEO.put("issue_time_order", "--");
} }
} else if("laws".equals(attrInfoMap.get("type"))){ } else if("laws".equals(attrInfoMap.get("type"))){
// 政策全文 // 政策全文
@@ -305,12 +313,32 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
attrInfoMap.put(key, "null"); attrInfoMap.put(key, "null");
} }
} }
// 逻辑字段
if(StringUtils.isNotBlank(attrInfoMap.getOrDefault("lawsName","").toString())){ if(StringUtils.isNotBlank(attrInfoMap.getOrDefault("lawsName","").toString())){
fullTextSearchEO.put("title",attrInfoMap.get("lawsTypeName")+" "+attrInfoMap.getOrDefault("lawsNumber","")+" "+attrInfoMap.getOrDefault("lawsName","")); fullTextSearchEO.put("title",attrInfoMap.get("lawsTypeName")+" "+attrInfoMap.getOrDefault("lawsNumber","")+" "+attrInfoMap.getOrDefault("lawsName",""));
}else{ }else{
fullTextSearchEO.put("title",attrInfoMap.get("lawsTypeName")+" "+attrInfoMap.getOrDefault("lawsNumber","")+" "+attrInfoMap.getOrDefault("lawsEnName","")); fullTextSearchEO.put("title",attrInfoMap.get("lawsTypeName")+" "+attrInfoMap.getOrDefault("lawsNumber","")+" "+attrInfoMap.getOrDefault("lawsEnName",""));
} }
fullTextSearchEO.put("standTypeOrder","4");
fullTextSearchEO.put("standSortOrder",esStateOrder(String.valueOf(attrInfoMap.get("lawsTypeName")),dicMap));
fullTextSearchEO.put("yearOrder", String.valueOf(attrInfoMap.get("lawsYearName")));
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("lawsTypeName")));
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("lawsNumber")));
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("lawsName")));
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("lawsEnName")));
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("lawsTextStateName",""));
if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
fullTextSearchEO.put("issue_time", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))));
fullTextSearchEO.put("issue_time_order", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))).replace("-",""));
}else {
fullTextSearchEO.put("issue_time", "--");
fullTextSearchEO.put("issue_time_order", "--");
}
// 文本内容字段
try {
StringBuilder contentBuilder = new StringBuilder(); StringBuilder contentBuilder = new StringBuilder();
contentBuilder.append("政策分类: ").append(attrInfoMap.get("lawsTypeName")).append(" "); contentBuilder.append("政策分类: ").append(attrInfoMap.get("lawsTypeName")).append(" ");
contentBuilder.append("政策编号: ").append(attrInfoMap.get("lawsNumber")).append(" "); contentBuilder.append("政策编号: ").append(attrInfoMap.get("lawsNumber")).append(" ");
@@ -359,22 +387,8 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
contentBuilder.append("标准文本: ").append(attrInfoMap.get("content")).append(" "); contentBuilder.append("标准文本: ").append(attrInfoMap.get("content")).append(" ");
StringBuilder textContent = replaceAll(contentBuilder, "null", "--"); StringBuilder textContent = replaceAll(contentBuilder, "null", "--");
fullTextSearchEO.put("textContent",textContent.toString()); fullTextSearchEO.put("textContent",textContent.toString());
fullTextSearchEO.put("standTypeOrder","4"); }catch (Exception e){
fullTextSearchEO.put("standSortOrder",esStateOrder(String.valueOf(attrInfoMap.get("lawsTypeName")),dicMap)); logger.info("err:" + errFilter(e.getMessage()));
fullTextSearchEO.put("yearOrder", String.valueOf(attrInfoMap.get("lawsYearName")));
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("lawsTypeName")));
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("lawsNumber")));
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("lawsName")));
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("lawsEnName")));
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("lawsTextStateName",""));
if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
fullTextSearchEO.put("issue_time", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))));
fullTextSearchEO.put("issue_time_order", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))).replace("-",""));
}else {
fullTextSearchEO.put("issue_time", "--");
fullTextSearchEO.put("issue_time_order", "--");
} }
}else if ("bussstand".equals(attrInfoMap.get("type"))){ }else if ("bussstand".equals(attrInfoMap.get("type"))){
@@ -388,6 +402,25 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
}else{ }else{
fullTextSearchEO.put("title",attrInfoMap.get("stand_code")+" "+attrInfoMap.getOrDefault("stand_en_name","")); fullTextSearchEO.put("title",attrInfoMap.get("stand_code")+" "+attrInfoMap.getOrDefault("stand_en_name",""));
} }
// 逻辑字段
fullTextSearchEO.put("standTypeOrder","3");
fullTextSearchEO.put("standSortOrder",esStateOrder(String.valueOf(attrInfoMap.get("standSort")),dicMap));
fullTextSearchEO.put("yearOrder", String.valueOf(attrInfoMap.get("standYear")));
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("standSort")));
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("standNumber")));
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("stand_name")));
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("stand_en_name")));
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("textStatusBussName",""));
if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
fullTextSearchEO.put("issue_time", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))));
fullTextSearchEO.put("issue_time_order", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))).replace("-",""));
}else {
fullTextSearchEO.put("issue_time", "--");
fullTextSearchEO.put("issue_time_order", "--");
}
// 文本内容字段
try {
StringBuilder contentBuilder = new StringBuilder(); StringBuilder contentBuilder = new StringBuilder();
contentBuilder.append("企标类别:").append(attrInfoMap.get("standSort")).append(" "); contentBuilder.append("企标类别:").append(attrInfoMap.get("standSort")).append(" ");
contentBuilder.append("标准年份:").append(attrInfoMap.get("standYear")).append(" "); contentBuilder.append("标准年份:").append(attrInfoMap.get("standYear")).append(" ");
@@ -426,26 +459,20 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
StringBuilder textContent = replaceAll(contentBuilder, "null", "--"); StringBuilder textContent = replaceAll(contentBuilder, "null", "--");
fullTextSearchEO.put("textContent",textContent.toString()); fullTextSearchEO.put("textContent",textContent.toString());
fullTextSearchEO.put("standTypeOrder","3"); }catch (Exception e){
fullTextSearchEO.put("standSortOrder",esStateOrder(String.valueOf(attrInfoMap.get("standSort")),dicMap)); logger.info("err:" + errFilter(e.getMessage()));
fullTextSearchEO.put("yearOrder", String.valueOf(attrInfoMap.get("standYear")));
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("standSort")));
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("standNumber")));
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("stand_name")));
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("stand_en_name")));
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("textStatusBussName",""));
if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
fullTextSearchEO.put("issue_time", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))));
fullTextSearchEO.put("issue_time_order", dateFormatToStr(String.valueOf(attrInfoMap.get("issueTime"))).replace("-",""));
}else {
fullTextSearchEO.put("issue_time", "--");
fullTextSearchEO.put("issue_time_order", "--");
} }
} }
return fullTextSearchEO; return fullTextSearchEO;
} }
private String errFilter(String str){
if (str.contains("Cause")){
str = str.split("Cause")[0].replaceAll("\\r\\n###","");
}
return str;
}
private String esStateOrder(String data, Map<String, Integer> dicMap){ private String esStateOrder(String data, Map<String, Integer> dicMap){
if(StringUtils.isNotBlank(data)){ if(StringUtils.isNotBlank(data)){
data = data.replace(" ",""); data = data.replace(" ","");
@@ -0,0 +1,29 @@
package com.adc.da.scheduled;
import com.adc.da.common.GetBeanUtil;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Slf4j
public class WarningSchedulingTasks implements Runnable{
Logger logger = LoggerFactory.getLogger(WarningSchedulingTasks.class);
private ScheduledJob scheduledJob;
public WarningSchedulingTasks() {
scheduledJob= GetBeanUtil.getApplicationContext().getBean(ScheduledJob.class);
}
@Override
public void run() {
try{
Thread.sleep(2000);
scheduledJob.warningSchedulingTasks();
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
@@ -0,0 +1 @@
INSERT INTO `tb_task`(`id`, `task_name`, `task_desc`, `task_exp`, `task_status`, `task_class`, `update_time`, `create_time`) VALUES ('6', 'task6', '每天定时扫描标准预警数据', '*/5 * * * * ?', 0, 'com.adc.da.scheduled.WarningSchedulingTasks', '2022-06-23 06:19:32', '2022-06-23 06:19:32');