Merge branch 'develop_master' into develop_migration

This commit is contained in:
super_liu
2021-10-30 00:55:32 +08:00
11 changed files with 176 additions and 54 deletions
@@ -399,4 +399,7 @@ public interface workFlowFeignClient {
// @RequestMapping(value = "/bat-wkflow/findProcessNameByPrcNum",method = RequestMethod.POST)
// List<BusProcessName> findProcessNameByPrcNum(@RequestBody String taskId);
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlock",method = RequestMethod.GET)
List<BusProcessNew> everyDayTenOlock();
}
@@ -1,10 +1,17 @@
package com.adc.da.Timer;
import com.adc.da.FeignClient.workFlowFeignClient;
import com.adc.da.common.BusMes;
import com.adc.da.common.BusProcessName;
import com.adc.da.common.BusProcessNew;
import com.adc.da.common.Wrapper;
import com.adc.da.http.ResponseMessage;
import com.adc.da.sys.common.EmailUtils;
import com.adc.da.sys.entity.UserEO;
import com.adc.da.sys.service.IUserEOService;
import com.adc.da.workFlow.controller.WorkFlowController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
@@ -13,6 +20,7 @@ import org.springframework.stereotype.Component;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -34,6 +42,9 @@ public class ProcessTimer {
@Autowired
private IUserEOService userEOService;
@Autowired
private WorkFlowController workFlowController;
/***
* @Description: 自动催办,任务截至时间前3天开始每天催办
* @Author: yangxuenan
@@ -46,14 +57,14 @@ public class ProcessTimer {
// @Scheduled(cron = "0/20 * * * * ?")
public void urging() {
List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null);
if(null != busProcessNames && 0 < busProcessNames.size()){
for (BusProcessName busProcessName : busProcessNames){
if (null != busProcessNames && 0 < busProcessNames.size()) {
for (BusProcessName busProcessName : busProcessNames) {
String type = busProcessName.getPrcType();
Integer typeInt = 99;
if (StringUtils.isNotEmpty(type)){
if (StringUtils.isNotEmpty(type)) {
typeInt = Integer.valueOf(type);
}
type = chooseType(typeInt,type);
type = chooseType(typeInt, type);
UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
String[] array = userEO.getEmail().split(",");
@@ -64,30 +75,30 @@ public class ProcessTimer {
try {
dateTime = simpleDateFormat.parse(overTime);
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));
} catch (ParseException e) {
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
try {
dateTime = simpleDateFormat1.parse(overTime);
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));
} catch (ParseException e1) {
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 +"] 您有未完成的待办任务";
mailUtil.sendMsgFeign(array,title,msg);
String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
mailUtil.sendMsgFeign(array, title, msg);
}
}
}
public String chooseType(Integer typeInt,String type) {
public String chooseType(Integer typeInt, String type) {
switch (typeInt) {
case 1:
type = "法规入库及评估流程";
@@ -151,4 +162,31 @@ public class ProcessTimer {
}
return type;
}
@Scheduled(cron = "0 0 10 * * ? ")//每天十点执行
// @Scheduled(cron = "*/20 * * * * ? ")//每天十点执行
public void everyDayTenOlockScan() {
List<BusProcessNew> busProcessNews=new ArrayList<>();
busProcessNews=workFlowFeignClient.everyDayTenOlock();
if (!busProcessNews.isEmpty()){
for (BusProcessNew bus:busProcessNews) {
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
jsonObject.put("auto","1");
ResponseMessage responseMessage = workFlowController.startProcessNew("19",jsonObject.getString("revisionId"),null);
BusMes busMes=new BusMes();
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
busMes.setJson(jsonObject.toJSONString());
busMes.setUserId(jsonObject.getString("revisionId"));
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
System.out.println("dasda");
}
}
}
public static void main(String[]args){
ProcessTimer processTimer = new ProcessTimer();
processTimer.everyDayTenOlockScan();
}
}
@@ -25,6 +25,21 @@ public class ActDefineStartMap {
map.put("8","nonConformanceRectificationKey");
map.put("9","standardReadWkflow");
map.put("10","itemlistvalidationprocessKey");
//张超然
map.put("20","StandardApplyMeetProcess");
map.put("21","StandardMeetProcess");
map.put("22","StandardAfterMeetProcess");
//李奥
map.put("14","ParticipateRevisionFiling");
map.put("15","JoinStandardFiling");
map.put("16","RecommendedApprovalleo");
//孔维一
map.put("17","policyResearchGroupEnrollment");
map.put("18","policyResearchGroupAttendMeeting");
map.put("19","policyResearchGroupAfterMeeting");
return map.get(type);
}
}
@@ -122,6 +122,16 @@ public class WorkFlowController {
}
}
@ApiOperation(value = "定时任务启动流程-以流程定义id")
@GetMapping("/startProcessNew")
public ResponseMessage startProcessNew(@RequestParam("type") String type, @RequestParam(value="userId",required = false) String userId, @RequestParam(value="id",required = false) String id){
if(StringUtils.isNotBlank(type)){
return this.activiti_define_start(ActDefineStartMap.actDefineStartMap(type), userId,id);
}else {
return null;
}
}
@ApiOperation(value = "待办任务详情")
@GetMapping("/todotask")
public PageInfo<BusProcessNew> todotask(@RequestParam("userId") String userId, @RequestParam("pId") String pId){
@@ -3,9 +3,10 @@
# 数据库配置
#=============================================
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://10.100.5.111:3306/foton_slrs?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
spring.datasource.username = tempuser
spring.datasource.password = Fting&8g35g#geg2
spring.datasource.url = jdbc:mysql://39.100.23.127:3306/foton_slrs_test2?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
#spring.datasource.url = jdbc:mysql://10.96.10.54/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
spring.datasource.username = root
spring.datasource.password = root
@@ -15,10 +16,10 @@ spring.application.name=FotonLAWSSystem
application.code=20200101
application.center=1
#==============================================
#Eureka
#Eruept
eureka.client.allow-redirects=true
eureka.client.register-with-eureka=true
eureka.client.service-url.defaultZone=http://10.100.5.117:4201/eureka/
eureka.client.service-url.defaultZone=http://62.234.136.153:8761/eureka/
#==============================================
# 邮箱配置1
@@ -34,18 +35,22 @@ spring.mail.properties.smtp.starttls.required=false
spring.mail.properties.mail.smtp.ssl.enable=false
spring.mail.port=587
#==============================================
# MQ配置
#==============================================
spring.rabbitmq.host=10.100.5.119
# ==============================================
# rabbitMQ
# ==============================================
#spring.rabbitmq.host=10.2.186.93
#spring.rabbitmq.port=5672
#spring.rabbitmq.username=ca
#spring.rabbitmq.password=cs986432
spring.rabbitmq.host=62.234.118.181
spring.rabbitmq.port=5672
spring.rabbitmq.username=admin
spring.rabbitmq.password=foton@admin
spring.rabbitmq.password=admin
spring.rabbitmq.listener.simple.acknowledge-mode= manual
# 生产者 默认关闭 发版 需改为 true
spring.rabbitmq.listener.direct.auto-startup=true
spring.rabbitmq.listener.direct.auto-startup=false
# 消费者 默认关闭 发版 需改为 true
spring.rabbitmq.listener.simple.auto-startup=true
spring.rabbitmq.listener.simple.auto-startup=false
#消费失败消息干掉
spring.rabbitmq.listener.simple.default-requeue-rejected= true
#5秒
@@ -53,22 +58,21 @@ spring.rabbitmq.listener.simple.retry.initial-interval= 5000
spring.rabbitmq.listener.simple.retry.enabled= true
#最大重试5次
spring.rabbitmq.listener.simple.retry.max-attempts= 5
# ==============================================
# 文档存储路径指向
# ==============================================
file.path=/data/slrs/file
file.path=/usr/laws/file/
# 云端OCR识别集成配置参数
#OCR请求识别URL地址
OCR.handleFileUrl = http://61.136.1.103:8091/WebService.asmx/FileConversion
# OCR回调接口地址 配置客户本地的IP及端口号
OCR.callBackUrl = https://slrs.foton.com.cn/api/ocr/OCRRestful/OcrHandleResult
OCR.callBackUrl = http://62.234.136.153:8033/api/ocr/OCRRestful/OcrHandleResult
OCR.userId =dayuzhou1234
OCR.authCode =123456
OCR.publicKey =EC4KKA6ZDTCPAOCRBC5M
# OCR文件存储路径
OCR.ocrPath=/data/slrs/ocrResultFile
OCR.ocrPath=/opt/foton-slrs/front/dist/file/
# OCR文件请求下载或在线预览时URL
OCR.ocrDownPath=/data/slrs/ocrResultFile
OCR.ocrDownPath=http://62.234.136.153:8038/file/
OCR.times=20
OCR.convertType=BOTH
@@ -9,12 +9,12 @@ spring.profiles.active=dev
server.compression.enabled=true
server.compression.mime-types=application/json,application/xml,text/html,text/plain,text/css,application/x-javascript
# 端口号设置
server.port=4202
server.port=9999
#主服务session超时
server.servlet.session.timeout =600
#tomcat /resource/local/version-manager 创建tomcat指定临时目录
server.tomcat.basedir=/data/slrs/temp
server.tomcat.basedir=/resource/local/version-manager
# http-only
server.session.cookie.http-only=true
@@ -30,14 +30,20 @@ logging.level.org.springframework=info
# 请求前缀
restPath=/api
#server.servlet.context-path=/api
#是否将自己注册到Eureka Server上,默认为true
eureka.client.register-with-eureka=true
##是否从Eureka Server上获取注册信息,默认为true
eureka.client.fetch-registry=true
eureka.instance.prefer-ip-address=true
eureka.client.service-url.defaultZone=http://10.100.5.117:4201/eureka/
#eureka.client.service-url.defaultZone=http://10.5.116.172:8672/eureka/
#eureka.client.service-url.defaultZone=http://127.0.0.1:8671/eureka/
#eureka.client.service-url.defaultZone=http://10.5.116.172:8672/eureka/
eureka.client.service-url.defaultZone=http://62.234.136.153:8761/eureka/
#eureka.client.service-url.defaultZone=http://10.96.10.171:8761/eureka/
# 请求连接的超时时间 默认的时间为 1 秒
ribbon.ConnectTimeout=500000
@@ -131,9 +137,9 @@ verifyCodeMode=1
# 文件上传管控及配置
# =============================================================================
# file模块上传文件的服务器地址
file.path=/data/slrs/file
# 文件下载地址参数(弃用)
file.downloadUrl=
file.path=D:/uploadfile/bus
# 文件下载地址参数
file.downloadUrl=http://39.98.140.126:10001/uploadPath
#上传文件白名单-以,分隔
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt
@@ -141,13 +147,14 @@ upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt
# elasticsearch 配置
# =============================================================================
elasticsearch.clustername=elasticsearch
elasticsearch.ip=10.100.5.122
elasticsearch.ip=172.17.0.1
elasticsearch.port=9300
elasticsearch.poolSize=5
elas.flag=true
# 文档转换TCP通讯地址
convert.host=127.0.0.1
#convert.host=0.0.0.0
# =============================================================================
# scheduled 配置
@@ -10,6 +10,7 @@ import com.adc.da.slrs.sarStandardsInfo.controller.SarStandardsInfoController;
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -39,7 +40,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
@Autowired
private SarLawsAttrDetailedListDao sarLawsAttrDetailedListDao;
@Autowired
private SarStandardsInfoController sarStandardsInfoController;
private ISarStandardsInfoService sarStandardsInfoService;
@Autowired
private SarStandItemsDao sarStandItemsDao;
@@ -155,7 +156,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
page.setUserId(null);
List<SarStandardsInfo> pageInfo = null;
try {
pageInfo = sarStandardsInfoController.getSarStandardsInfoPage(page).getData().getList();
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
} catch (Exception e) {
e.printStackTrace();
}
@@ -91,7 +91,7 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
@ApiOperation(value = "|SarStandardsInfoEO|自定义分页查询")
@GetMapping("/getSarStandardsInfoPage")
//@RequiresPermissions("lawss:sarStandardsInfo:getSarStandardsInfoPage")
public ResponseMessage<PageInfo<SarStandardsInfo>> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception {
public ResponseMessage<PageInfo<SarStandardsInfo>> getSarStandardsInfoPage(SarStandardsInfoEOPage page,@RequestParam(defaultValue = "0") String mark) throws Exception {
int isNull = -1;
if (null != page.getNowOrderBy()) {
switch (page.getNowOrderBy()) {
@@ -21,6 +21,8 @@ public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception;
List<SarStandardsInfo> getSarStandardsInfoPageBak(SarStandardsInfoEOPage page) throws Exception;
void createSarStandardsInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception;
int updateSarStandardsInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception;
@@ -284,6 +284,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
* @Param: [page]
* @Return: java.util.List<com.adc.da.lawss.entity.SarStandardsInfoEO>
*/
@Override
public List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception {
//查询当前登录人角色拥有权限的菜单
if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){
@@ -311,6 +312,34 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
return sarlist;
}
@Override
public List<SarStandardsInfo> getSarStandardsInfoPageBak(SarStandardsInfoEOPage page) throws Exception {
//查询当前登录人角色拥有权限的菜单
if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){
QueryWrapper<TsResource> qw = new QueryWrapper<>();
qw.eq("ID",page.getMenuId());
qw.isNull("PARENT_ID");
List<TsResource> children = iTsResourceService.list(qw);
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
}
}
}
Integer rowCount = dao.getSarStandardsInfoCount(page);
page.getPager().setRowCount(rowCount);
List<SarStandardsInfo> sarlist = dao.getSarStandardsInfoPage(page);
attrInfo(sarlist);
return sarlist;
}
public void attrInfo(List<SarStandardsInfo> sarlist) throws Exception {
for (SarStandardsInfo row : sarlist) {
attrInfoDetails(row);
@@ -358,7 +387,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
if ("\"null\"".equals(entry.getValue())) {
entry.setValue("");
}
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
String value = entry.getValue().toString();
String selVal = InitStandAttrUtil.selectFieldMap.get(name);
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
@@ -453,7 +482,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
entry.setValue(fileObj);
//以标准id和文本类型查询分解单表 有数据设标记为为 1
//以标准id和文本类型查询分解单表 有数据设标记为为 1
FindSarItemsPageReqDTO sarItemCount = new FindSarItemsPageReqDTO();
sarItemCount.setStandId(row.getId());
sarItemCount.setFileType(name);
@@ -159,20 +159,27 @@
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
and
ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
and
a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
UNION
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
@@ -182,21 +189,27 @@
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
and
ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
and
a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
</select>