Merge branch 'master' into SecondStage
# Conflicts: # db/update/测试阶段.sql
This commit is contained in:
@@ -536,3 +536,50 @@ ALTER TABLE laws_document_split ADD PRIMARY KEY (id);
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `parent_id`, `item_text`, `en_name`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `stat_node`, `en_base`) VALUES ('1694639979913162755', '1493098515761917954', '0', '多选用户弹框', 'Multiple selection a user', '19', '', 1, 1, 'admin', '2023-08-24 17:17:11', 'admin', '2023-08-24 17:41:25', NULL, 0, NULL, '0', NULL, NULL);
|
||||
update laws_tag set field_show_type = '19' where db_field_txt = '责任人'
|
||||
|
||||
-- 2024-09-24 外来标准库增加 关联部门 字段长度
|
||||
ALTER TABLE `laws_domestic_standard`
|
||||
MODIFY COLUMN `associate_dept` text NULL COMMENT '关联部门';
|
||||
|
||||
-- 2024-09-25 流程待办推送记录表
|
||||
ALTER TABLE `laws_unified_todo_log`
|
||||
MODIFY COLUMN `json_str` longtext NULL COMMENT '推送内容';
|
||||
ALTER TABLE `laws_unified_todo_log`
|
||||
MODIFY COLUMN `response_body` longtext NULL COMMENT '返回值';
|
||||
CREATE INDEX lutl_idx_state ON laws_unified_todo_log(`state`);
|
||||
CREATE INDEX lutl_idx_message_type ON laws_unified_todo_log(`message_type`);
|
||||
CREATE INDEX lutl_idx_create_time ON laws_unified_todo_log(`create_time`);
|
||||
|
||||
-- 2024-09-27 责任人改为多选弹窗
|
||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `parent_id`, `item_text`, `en_name`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `stat_node`, `en_base`) VALUES ('1694639979913162755', '1493098515761917954', '0', '多选用户弹框', 'Multiple selection a user', '19', '', 1, 1, 'admin', '2023-08-24 17:17:11', 'admin', '2023-08-24 17:41:25', NULL, 0, NULL, '0', NULL, NULL);
|
||||
update laws_tag set field_show_type = '19' where db_field_txt = '责任人'
|
||||
|
||||
-- 2024-09-27 市场法规清单添加直接发布按钮
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`, `app_id`, `home_icon`) VALUES ('897f89d79231fcb9019231fcb9ca0000', '897f89d79014d7fe019014d7fe2e0000', '直接发布', NULL, NULL, NULL, NULL, 2, 'marketStandard:directRelease', '1', 8.00, 0, NULL, 1, 1, 0, 0, NULL, 'ldq', '2024-09-27 13:38:19', NULL, NULL, 0, 0, '1', 0, 'Direct release', NULL, NULL);
|
||||
-- 2024-09-27 修改条款字段长度
|
||||
UPDATE `laws_tag` SET `db_length` = 2000 WHERE `id` = '1702557948281909251';
|
||||
UPDATE `laws_tag` SET `db_length` = 2000 WHERE `id` = '1803335200567070723';
|
||||
UPDATE `laws_tag` SET `db_length` = 2000 WHERE `id` = '1803335200571265024';
|
||||
UPDATE `laws_tag` SET `db_length` = 2000 WHERE `id` = '1803335200571265025';
|
||||
|
||||
|
||||
ALTER TABLE `laws_document_split`
|
||||
MODIFY COLUMN `change_description` longtext NULL COMMENT '变化点说明';
|
||||
ALTER TABLE `laws_document_split`
|
||||
MODIFY COLUMN `technical_agreement_template` longtext NULL COMMENT '技术协议模板';
|
||||
ALTER TABLE `laws_document_split`
|
||||
MODIFY COLUMN `verification_report_template_checklist` longtext NULL COMMENT '校核报告模板/checklist';
|
||||
ALTER TABLE `laws_document_split`
|
||||
MODIFY COLUMN `dvp_template` longtext NULL COMMENT 'DVP模板';
|
||||
|
||||
-- 2024-09-29 修改条款字段长度
|
||||
UPDATE `laws_tag` SET `db_length` = 2000 WHERE `id` = '1803335200571265026';
|
||||
UPDATE `laws_tag` SET `db_length` = 2000 WHERE `id` = '1803335200567070720';
|
||||
UPDATE `laws_tag` SET `db_length` = 5000 WHERE `id` = '1701142955053371394';
|
||||
|
||||
ALTER TABLE `laws_document_split`
|
||||
MODIFY COLUMN `dfema` longtext NULL COMMENT 'DEFMA';
|
||||
ALTER TABLE `laws_document_split`
|
||||
MODIFY COLUMN `enterprise_standard` longtext NULL COMMENT '企业标准';
|
||||
|
||||
|
||||
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ public interface PushWorkflowIntegrationAPI {
|
||||
* @return*/
|
||||
void sendTodoTask(List<UnifiedTodoVO> unifiedTodoVOList);
|
||||
|
||||
void sendTodoTaskMakeUpFor(List<UnifiedTodoVO> unifiedTodoVOList,String sendId);
|
||||
|
||||
/**
|
||||
* @Author:
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.jero.modules.docking.hiwork.job;
|
||||
|
||||
import cn.hutool.http.Header;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.jero.common.api.PushWorkflowIntegrationAPI;
|
||||
import com.jero.common.api.dto.message.UnifiedTodoVO;
|
||||
import com.jero.modules.docking.hiwork.entity.LawsUnifiedTodoLog;
|
||||
import com.jero.modules.docking.hiwork.service.LawsUnifiedTodoLogService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 每天全量推送失败的待办
|
||||
*/
|
||||
@Slf4j
|
||||
public class SyncOaSendDataJob implements Job {
|
||||
|
||||
@Resource
|
||||
private LawsUnifiedTodoLogService lawsUnifiedTodoLogService;
|
||||
@Resource
|
||||
private PushWorkflowIntegrationAPI pushWorkflowIntegrationAPI;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
LambdaQueryWrapper<LawsUnifiedTodoLog> queryLawsUnifiedTodoLog = new LambdaQueryWrapper<>();
|
||||
queryLawsUnifiedTodoLog.eq(LawsUnifiedTodoLog::getState,"2");
|
||||
queryLawsUnifiedTodoLog.eq(LawsUnifiedTodoLog::getMessageType,"1");
|
||||
queryLawsUnifiedTodoLog.orderByAsc(LawsUnifiedTodoLog::getId);
|
||||
List<LawsUnifiedTodoLog> listLawsUnifiedTodoLog = lawsUnifiedTodoLogService.list(queryLawsUnifiedTodoLog);
|
||||
if(CollectionUtils.isEmpty(listLawsUnifiedTodoLog)){
|
||||
return;
|
||||
}
|
||||
for (LawsUnifiedTodoLog lawsUnifiedTodoLog : listLawsUnifiedTodoLog) {
|
||||
if(StringUtils.isBlank(lawsUnifiedTodoLog.getJsonStr())){
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
List<UnifiedTodoVO> unifiedTodoVOList = JSON.parseObject(lawsUnifiedTodoLog.getJsonStr(),
|
||||
new TypeReference<List<UnifiedTodoVO>>() {});
|
||||
try {
|
||||
pushWorkflowIntegrationAPI.sendTodoTaskMakeUpFor(unifiedTodoVOList, lawsUnifiedTodoLog.getId());
|
||||
}catch (Exception e){
|
||||
log.error("OA推送待办异常" + e.getMessage());
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("OA推送待办定时推送异常" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.jero.modules.docking.hiwork.job;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.PushWorkflowIntegrationAPI;
|
||||
import com.jero.common.api.dto.message.UnifiedTodoVO;
|
||||
import com.jero.modules.docking.hiwork.entity.LawsUnifiedTodoLog;
|
||||
import com.jero.modules.docking.hiwork.service.LawsUnifiedTodoLogService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 每天全量推送失败的待办
|
||||
*/
|
||||
@Slf4j
|
||||
public class SyncOaSendDataMakeUpForJob implements Job {
|
||||
|
||||
@Resource
|
||||
private LawsUnifiedTodoLogService lawsUnifiedTodoLogService;
|
||||
@Resource
|
||||
private PushWorkflowIntegrationAPI pushWorkflowIntegrationAPI;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
QueryWrapper<LawsUnifiedTodoLog> queryLawsUnifiedTodoLog = new QueryWrapper<>();
|
||||
queryLawsUnifiedTodoLog.eq("state","2");
|
||||
queryLawsUnifiedTodoLog.eq("message_type","1");
|
||||
queryLawsUnifiedTodoLog.and(o->o.eq("TIMESTAMPDIFF(MINUTE, create_time, NOW())",3).or()
|
||||
.eq("TIMESTAMPDIFF(MINUTE, create_time, NOW())",5).or()
|
||||
.eq("TIMESTAMPDIFF(MINUTE, create_time, NOW())", 10));
|
||||
queryLawsUnifiedTodoLog.orderByAsc("id");
|
||||
List<LawsUnifiedTodoLog> listLawsUnifiedTodoLog = lawsUnifiedTodoLogService.list(queryLawsUnifiedTodoLog);
|
||||
if(CollectionUtils.isEmpty(listLawsUnifiedTodoLog)){
|
||||
return;
|
||||
}
|
||||
for (LawsUnifiedTodoLog lawsUnifiedTodoLog : listLawsUnifiedTodoLog) {
|
||||
if(StringUtils.isBlank(lawsUnifiedTodoLog.getJsonStr())){
|
||||
continue;
|
||||
}
|
||||
log.info("发送id" + lawsUnifiedTodoLog.getId());
|
||||
try {
|
||||
List<UnifiedTodoVO> unifiedTodoVOList = JSON.parseObject(lawsUnifiedTodoLog.getJsonStr(),
|
||||
new TypeReference<List<UnifiedTodoVO>>() {});
|
||||
try {
|
||||
pushWorkflowIntegrationAPI.sendTodoTaskMakeUpFor(unifiedTodoVOList, lawsUnifiedTodoLog.getId());
|
||||
}catch (Exception e){
|
||||
log.error("OA推送待办异常" + e.getMessage());
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("OA推送待办定时推送异常" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
-8
@@ -84,21 +84,28 @@ public class LawsUnifiedTodoLogServiceImpl extends ServiceImpl<LawsUnifiedTodoLo
|
||||
Integer messageType = lawsUnifiedTodoLogObj.getMessageType();
|
||||
if (messageType == 1) { // 重发OA
|
||||
List<UnifiedTodoVO> unifiedTodoVOList = JSON.parseObject(jsonStr, new TypeReference<List<UnifiedTodoVO>>() {});
|
||||
pushWorkflowIntegrationAPI.sendTodoTask(unifiedTodoVOList);
|
||||
pushWorkflowIntegrationAPI.sendTodoTaskMakeUpFor(unifiedTodoVOList, lawsUnifiedTodoLogObj.getId());
|
||||
}else if (messageType == 2) { // 重发飞书-待办
|
||||
InstanceDto instanceDto = JSON.parseObject(jsonStr, InstanceDto.class);
|
||||
feiShuDockingService.synchronizeApprovalInstance(instanceDto);
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
LambdaUpdateWrapper<LawsUnifiedTodoLog> queryLawsUnifiedTodoLog = new LambdaUpdateWrapper<>();
|
||||
queryLawsUnifiedTodoLog.eq(LawsUnifiedTodoLog::getId,lawsUnifiedTodoLog.getId());
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getState,1);
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getCreateBy,sysUser.getUsername());
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getUpdateTime,new Date());
|
||||
update(queryLawsUnifiedTodoLog);
|
||||
}else { // 重发飞书-消息
|
||||
BotMessageDto botMessageDto = JSON.parseObject(jsonStr, BotMessageDto.class);
|
||||
feiShuDockingService.sendHrefMessageByBot(botMessageDto);
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
LambdaUpdateWrapper<LawsUnifiedTodoLog> queryLawsUnifiedTodoLog = new LambdaUpdateWrapper<>();
|
||||
queryLawsUnifiedTodoLog.eq(LawsUnifiedTodoLog::getId,lawsUnifiedTodoLog.getId());
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getState,1);
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getCreateBy,sysUser.getUsername());
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getUpdateTime,new Date());
|
||||
update(queryLawsUnifiedTodoLog);
|
||||
}
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
LambdaUpdateWrapper<LawsUnifiedTodoLog> queryLawsUnifiedTodoLog = new LambdaUpdateWrapper<>();
|
||||
queryLawsUnifiedTodoLog.eq(LawsUnifiedTodoLog::getId,lawsUnifiedTodoLog.getId());
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getState,1);
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getCreateBy,sysUser.getUsername());
|
||||
queryLawsUnifiedTodoLog.set(LawsUnifiedTodoLog::getUpdateTime,new Date());
|
||||
update(queryLawsUnifiedTodoLog);
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ public class SendFeiShuServiceImpl implements ISendFeiShuService {
|
||||
.replace("{processInstanceId}",processApprovalRecord.getProcessInstanceId())
|
||||
.replace("{nodeId}",processApprovalRecord.getNodeId());
|
||||
// 跳转链接
|
||||
String businessLink = Objects.requireNonNull(ProcessTypeEnum.getFontReturnUrlPc(processAll.getPrcType())) + url;
|
||||
String businessLink = url.replace("{url}", Objects.requireNonNull(ProcessTypeEnum.getFontReturnUrlPc(processAll.getPrcType())));
|
||||
instanceDto.setPromoterPcLink(businessLink);
|
||||
// APP跳转链接
|
||||
String appUrl = reviewPcLink
|
||||
|
||||
+90
-53
@@ -116,7 +116,48 @@ public class UnifiedTodoServiceImpl implements PushWorkflowIntegrationAPI {
|
||||
log.info("统一待办推送入参" + jsonString);
|
||||
ForkJoinPool pool = new ForkJoinPool();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
push(ip + todoUrl,jsonString,reqJsonString, unifiedTodoList.get(0).getRequestname());
|
||||
push(ip + todoUrl,jsonString,reqJsonString, unifiedTodoList.get(0).getRequestname(), null);
|
||||
},pool);
|
||||
}catch (Exception e){
|
||||
log.error("统一待办推送异常" + e);
|
||||
}
|
||||
long l1 = System.currentTimeMillis();
|
||||
System.out.println("===========================OA" + (l1-l));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Author: liao
|
||||
* @Date: 2023/10/13 15:12
|
||||
* @Description: 统一待办集成
|
||||
*
|
||||
* @return*/
|
||||
@Override
|
||||
public void sendTodoTaskMakeUpFor(List<UnifiedTodoVO> unifiedTodoVOList,String sendId) {
|
||||
if(!isWorkflow){
|
||||
return;
|
||||
}
|
||||
boolean successFlag = true;
|
||||
if (CollectionUtils.isEmpty(unifiedTodoVOList)) {
|
||||
return;
|
||||
// throw new JeroBootException(ResultCommon.EMPTY_COMMON, "unifiedTodoVOList");
|
||||
}
|
||||
long l = System.currentTimeMillis();
|
||||
String newDate = DateUtil.formatDateTime(new Date());
|
||||
for (UnifiedTodoVO unifiedTodoVO : unifiedTodoVOList) {
|
||||
String date = unifiedTodoVO.getDate();
|
||||
if (StringUtils.isBlank(date)){
|
||||
unifiedTodoVO.setDate(newDate);
|
||||
}
|
||||
}
|
||||
try {
|
||||
List<UnifiedTodo> unifiedTodoList = getHiworkTodos(unifiedTodoVOList);
|
||||
String reqJsonString = JSONObject.toJSONString(unifiedTodoVOList);
|
||||
String jsonString = JSONObject.toJSONString(unifiedTodoList);
|
||||
log.info("统一待办推送入参" + jsonString);
|
||||
ForkJoinPool pool = new ForkJoinPool();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
push(ip + todoUrl,jsonString,reqJsonString, unifiedTodoList.get(0).getRequestname(),sendId);
|
||||
},pool);
|
||||
}catch (Exception e){
|
||||
log.error("统一待办推送异常" + e);
|
||||
@@ -134,65 +175,61 @@ public class UnifiedTodoServiceImpl implements PushWorkflowIntegrationAPI {
|
||||
System.out.println("===========================feishu" + (l1-l));
|
||||
}
|
||||
|
||||
private void push(String url, String jsonString,String reqJsonString, String title) {
|
||||
// 设置最大重试次数
|
||||
int maxRetries = 3;
|
||||
// 当前重试次数
|
||||
int retries = 0;
|
||||
private void push(String url, String jsonString,String reqJsonString, String title,String sendId) {
|
||||
LawsUnifiedTodoLog lawsUnifiedTodoLog = new LawsUnifiedTodoLog();
|
||||
while (retries < maxRetries) {
|
||||
log.info("==========OA调用");
|
||||
// 远程调用
|
||||
HttpResponse execute = HttpRequest.post(url)
|
||||
.header(Header.CONTENT_TYPE, "application/json;charset=UTF-8")
|
||||
.body(jsonString)//表单内容
|
||||
.timeout(3000)//超时,毫秒
|
||||
.execute();
|
||||
if (execute.isOk()) {
|
||||
String body = execute.body();
|
||||
List<JSONObject> listJson = JSONArray.parseArray(body,JSONObject.class);
|
||||
if(!CollectionUtils.isEmpty(listJson)) {
|
||||
String operResult = String.valueOf(listJson.get(0).get("operResult"));
|
||||
lawsUnifiedTodoLog.setResponseBody(body);
|
||||
if (Objects.equals(operResult, "1")) {
|
||||
log.info("统一待办推送成功");
|
||||
lawsUnifiedTodoLog.setState(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
log.info("统一待办推送失败{}",body);
|
||||
lawsUnifiedTodoLog.setState(2);
|
||||
retries++;
|
||||
}else {
|
||||
String body = execute.body();
|
||||
lawsUnifiedTodoLog.setResponseBody(body);
|
||||
List<JSONObject> listJson = JSONArray.parseArray(body,JSONObject.class);
|
||||
if(!CollectionUtils.isEmpty(listJson)){
|
||||
String operResult = String.valueOf(listJson.get(0).get("operResult"));
|
||||
if (Objects.equals(operResult, "1")) {
|
||||
log.info("统一待办推送成功");
|
||||
lawsUnifiedTodoLog.setState(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
log.info("统一待办推送失败{}",body);
|
||||
lawsUnifiedTodoLog.setState(2);
|
||||
retries++;
|
||||
}
|
||||
log.info("==========OA调用");
|
||||
// 远程调用
|
||||
try {
|
||||
sendData(url, jsonString, lawsUnifiedTodoLog);
|
||||
}catch (Exception e){
|
||||
log.error("统一待办推送失败{}" + e.getMessage());
|
||||
lawsUnifiedTodoLog.setState(2);
|
||||
lawsUnifiedTodoLog.setResponseBody(e.getMessage());
|
||||
}
|
||||
lawsUnifiedTodoLog.setId(sendId);
|
||||
lawsUnifiedTodoLog.setUrl(url);
|
||||
lawsUnifiedTodoLog.setJsonStr(reqJsonString);
|
||||
lawsUnifiedTodoLog.setMessageType(1);
|
||||
lawsUnifiedTodoLog.setTitle(title);
|
||||
if(Objects.isNull(lawsUnifiedTodoLog.getState())){
|
||||
if (retries == maxRetries){
|
||||
lawsUnifiedTodoLog.setState(2);
|
||||
}else {
|
||||
lawsUnifiedTodoLog.setState(1);
|
||||
}
|
||||
}
|
||||
unifiedTodoLogService.saveOrUpdate(lawsUnifiedTodoLog);
|
||||
}
|
||||
|
||||
unifiedTodoLogService.add(lawsUnifiedTodoLog);
|
||||
private void sendData(String url, String jsonString, LawsUnifiedTodoLog lawsUnifiedTodoLog) {
|
||||
HttpResponse execute = HttpRequest.post(url)
|
||||
.header(Header.CONTENT_TYPE, "application/json;charset=UTF-8")
|
||||
.body(jsonString)//表单内容
|
||||
.timeout(3000)//超时,毫秒
|
||||
.execute();
|
||||
log.info("==========OA调用成功");
|
||||
if (execute.isOk()) {
|
||||
String body = execute.body();
|
||||
List<JSONObject> listJson = JSONArray.parseArray(body,JSONObject.class);
|
||||
if(!CollectionUtils.isEmpty(listJson)) {
|
||||
String operResult = String.valueOf(listJson.get(0).get("operResult"));
|
||||
lawsUnifiedTodoLog.setResponseBody(body);
|
||||
if (Objects.equals(operResult, "1")) {
|
||||
log.info("统一待办推送成功");
|
||||
lawsUnifiedTodoLog.setState(1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
log.info("统一待办推送失败{}",body);
|
||||
lawsUnifiedTodoLog.setState(2);
|
||||
}else {
|
||||
String body = execute.body();
|
||||
lawsUnifiedTodoLog.setResponseBody(body);
|
||||
List<JSONObject> listJson = JSONArray.parseArray(body,JSONObject.class);
|
||||
if(!CollectionUtils.isEmpty(listJson)){
|
||||
String operResult = String.valueOf(listJson.get(0).get("operResult"));
|
||||
if (Objects.equals(operResult, "1")) {
|
||||
log.info("统一待办推送成功");
|
||||
lawsUnifiedTodoLog.setState(1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
log.info("统一待办推送失败{}",body);
|
||||
lawsUnifiedTodoLog.setState(2);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+3
-3
@@ -157,9 +157,9 @@ public class ProcessStandardInterpretClauseSublist extends BaseEntity {
|
||||
@ApiModelProperty(value = "DVP模板")
|
||||
@Excel(name = "DVP模板", width = 15)
|
||||
private String dvpTemplate;
|
||||
/**DFEMA*/
|
||||
@ApiModelProperty(value = "DFEMA")
|
||||
@Excel(name = "DFEMA", width = 15)
|
||||
/**DEFMA*/
|
||||
@ApiModelProperty(value = "DEFMA")
|
||||
@Excel(name = "DEFMA", width = 15)
|
||||
private String dfema;
|
||||
/**关键技术分解表*/
|
||||
@ApiModelProperty(value = "关键技术分解表")
|
||||
|
||||
+14
-13
@@ -176,6 +176,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
private final int TEXT_LENGTH = 50;
|
||||
private final int TEXT_LENGTH_2 = 200;
|
||||
private final int TEXT_DICT_LENGTH = 500;
|
||||
private final int TEXT_LENGTH_1000 = 1000;
|
||||
private final int TEXT_AREA_LENGTH = 2000;
|
||||
|
||||
@Override
|
||||
@@ -1149,37 +1150,37 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
}
|
||||
|
||||
String technicalSpecificationDesignGuide = data.getTechnicalSpecificationDesignGuide();
|
||||
textLenghtCheck(technicalSpecificationDesignGuide, TEXT_LENGTH, errorList, "技术规范/设计指南");
|
||||
textLenghtCheck(technicalSpecificationDesignGuide, TEXT_DICT_LENGTH, errorList, "技术规范/设计指南");
|
||||
|
||||
String drawingTemplate = data.getDrawingTemplate();
|
||||
textLenghtCheck(drawingTemplate, TEXT_LENGTH, errorList, "图纸模板");
|
||||
textLenghtCheck(drawingTemplate, TEXT_DICT_LENGTH, errorList, "图纸模板");
|
||||
|
||||
String technicalAgreementTemplate = data.getTechnicalAgreementTemplate();
|
||||
textLenghtCheck(technicalAgreementTemplate, TEXT_LENGTH, errorList, "技术协议模板");
|
||||
textLenghtCheck(technicalAgreementTemplate, TEXT_AREA_LENGTH, errorList, "技术协议模板");
|
||||
|
||||
String verificationReportTemplateChecklist = data.getVerificationReportTemplateChecklist();
|
||||
textLenghtCheck(verificationReportTemplateChecklist, TEXT_LENGTH, errorList, "校验报告模块/checklist");
|
||||
textLenghtCheck(verificationReportTemplateChecklist, TEXT_AREA_LENGTH, errorList, "校验报告模块/checklist");
|
||||
|
||||
String dvpTemplate = data.getDvpTemplate();
|
||||
textLenghtCheck(dvpTemplate, TEXT_LENGTH, errorList, "DVP模板");
|
||||
textLenghtCheck(dvpTemplate, TEXT_AREA_LENGTH, errorList, "DVP模板");
|
||||
|
||||
String dfema = data.getDfema();
|
||||
textLenghtCheck(dfema, TEXT_LENGTH, errorList, "DFEMA");
|
||||
textLenghtCheck(dfema, TEXT_AREA_LENGTH, errorList, "DEFMA");
|
||||
|
||||
String keyTechnologyDecompositionTable = data.getKeyTechnologyDecompositionTable();
|
||||
textLenghtCheck(keyTechnologyDecompositionTable, TEXT_LENGTH, errorList, "关键技术分解表");
|
||||
textLenghtCheck(keyTechnologyDecompositionTable, TEXT_DICT_LENGTH, errorList, "关键技术分解表");
|
||||
|
||||
String otherDocumentsTemplates = data.getOtherDocumentsTemplates();
|
||||
textLenghtCheck(otherDocumentsTemplates, TEXT_LENGTH, errorList, "其他文件或模板");
|
||||
textLenghtCheck(otherDocumentsTemplates, TEXT_DICT_LENGTH, errorList, "其他文件或模板");
|
||||
|
||||
String p3 = data.getP3();
|
||||
textLenghtCheck(p3, TEXT_LENGTH_2, errorList, "P3证明符合性的交付物名称");
|
||||
textLenghtCheck(p3, TEXT_DICT_LENGTH, errorList, "P3证明符合性的交付物名称");
|
||||
|
||||
String p5 = data.getP5();
|
||||
textLenghtCheck(p5, TEXT_LENGTH_2, errorList, "P5证明符合性的交付物名称");
|
||||
textLenghtCheck(p5, TEXT_DICT_LENGTH, errorList, "P5证明符合性的交付物名称");
|
||||
|
||||
String remarks = data.getRemarks();
|
||||
textLenghtCheck(remarks, TEXT_AREA_LENGTH, errorList, "备注");
|
||||
textLenghtCheck(remarks, TEXT_DICT_LENGTH, errorList, "备注");
|
||||
|
||||
String investigationStage = data.getInvestigationStage();
|
||||
if (StringUtils.isNotBlank(investigationStage)){
|
||||
@@ -1444,10 +1445,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
}
|
||||
|
||||
String changeDescription = data.getChangeDescription();
|
||||
textLenghtCheck(changeDescription, TEXT_LENGTH, errorList, "相对上一版变化点说明");
|
||||
textLenghtCheck(changeDescription, TEXT_AREA_LENGTH, errorList, "相对上一版变化点说明");
|
||||
|
||||
String regulatoryNotes = data.getRegulatoryNotes();
|
||||
textLenghtCheck(regulatoryNotes, TEXT_LENGTH_2, errorList, "法规注释");
|
||||
textLenghtCheck(regulatoryNotes, TEXT_LENGTH_1000, errorList, "法规注释");
|
||||
|
||||
String domainArea = data.getDomainArea();
|
||||
if (StringUtils.isNotBlank(domainArea)){
|
||||
|
||||
+2
-2
@@ -128,8 +128,8 @@ public class FlowImportExcel {
|
||||
@Excel(name = "DVP模板", width = 15)
|
||||
private String dvpTemplate;
|
||||
/**DFEMA*/
|
||||
@ApiModelProperty(value = "DFEMA")
|
||||
@Excel(name = "DFEMA", width = 15)
|
||||
@ApiModelProperty(value = "DEFMA")
|
||||
@Excel(name = "DEFMA", width = 15)
|
||||
private String dfema;
|
||||
/**关键技术分解表*/
|
||||
@ApiModelProperty(value = "关键技术分解表")
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ public class LawsDocumentSplit extends BaseEntity {
|
||||
@ApiModelProperty("DVP模板")
|
||||
private String dvpTemplate;
|
||||
// DFEMA
|
||||
@ApiModelProperty("DFEMA")
|
||||
@ApiModelProperty("DEFMA")
|
||||
private String dfema;
|
||||
// 关键技术分解表
|
||||
@ApiModelProperty("关键技术分解表")
|
||||
|
||||
+2
-2
@@ -406,6 +406,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> queryDocumentSplitDetailByList(Map<String, Object> parameter) {
|
||||
// 防止SQL注入
|
||||
this.checkForSQLInjection(parameter);
|
||||
// 查询全部字段列表
|
||||
List<LawsTag> fieldList = lawsCommonMapper.getFieldList(TableNameEnum.DOCUMENT_SPLIT.getTableName());
|
||||
// 列表展示字段
|
||||
@@ -1780,8 +1782,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
}
|
||||
|
||||
private String getSelectCondition(Map<String, Object> parameter, List<LawsTag> fieldListCondition) {
|
||||
// 防止SQL注入
|
||||
this.checkForSQLInjection(parameter);
|
||||
// 拼接查询条件
|
||||
StringBuilder selectCondition = new StringBuilder("where del_flag = 0");
|
||||
// 非动态查询条件
|
||||
|
||||
+2
-2
@@ -825,8 +825,8 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
||||
}
|
||||
String implementationDate = "implementationDate";
|
||||
if(map.containsKey(implementationDate) && !Objects.isNull(map.get(implementationDate))){
|
||||
String date = new SimpleDateFormat(YYYY_MM_DD).format(Long.parseLong(map.get(implementationDate).toString()));
|
||||
map.put(implementationDate,!Objects.equals(date,"1900-01-01") ? date : "-");
|
||||
String date = map.get(implementationDate).toString();
|
||||
map.put(implementationDate, date);
|
||||
}
|
||||
String createTime = "createTime";
|
||||
if(map.containsKey(createTime) && !Objects.isNull(map.get(createTime))){
|
||||
|
||||
+2
-2
@@ -161,8 +161,8 @@ public class LawsHomeAdvancedSearchClauseExcelVO implements Serializable {
|
||||
/**
|
||||
* DFEMA
|
||||
*/
|
||||
@ApiModelProperty(value = "DFEMA")
|
||||
@Excel(name = "DFEMA", width = 30)
|
||||
@ApiModelProperty(value = "DEFMA")
|
||||
@Excel(name = "DEFMA", width = 30)
|
||||
private String dfema;
|
||||
|
||||
/**
|
||||
|
||||
+19
@@ -191,6 +191,7 @@ public class MarketStandardController {
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发布
|
||||
*
|
||||
@@ -209,6 +210,24 @@ public class MarketStandardController {
|
||||
return marketStandardService.checkPublish(map.get("id"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接发布
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-直接发布")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-直接发布", notes = "外部标准库-市场法规清单-直接发布")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@PostMapping(value = "/directRelease")
|
||||
@RequiresPermissions("marketStandard:directRelease")
|
||||
public Result<?> directRelease(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
|
||||
return Result.error(ResultCommon.SELECT_DATA);
|
||||
}
|
||||
return marketStandardService.directRelease(map.get("ids"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询第一个版本
|
||||
*
|
||||
|
||||
+7
@@ -94,6 +94,13 @@ public interface ILawsMarketStandardService extends IService<LawsMarketStandard>
|
||||
*/
|
||||
Result<?> checkPublish(String id);
|
||||
|
||||
/**
|
||||
* 直接发布
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Result<?> directRelease(String ids);
|
||||
|
||||
/**
|
||||
* 发布
|
||||
* @param id
|
||||
|
||||
+90
-14
@@ -32,6 +32,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@@ -509,6 +510,82 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public Result<?> directRelease(String ids) {
|
||||
List<String> listIds = Arrays.asList(ids.split(","));
|
||||
List<LawsMarketStandard> lawsMarketStandardOldList = listByIds(listIds);
|
||||
if(listIds.size() != lawsMarketStandardOldList.size()){
|
||||
return Result.error(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
StringBuilder msg = new StringBuilder();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
for (LawsMarketStandard lawsMarketStandard : lawsMarketStandardOldList) {
|
||||
// 已发布的清单所有人都可以查看,未发布的数据只能作者和管理管查看、编辑、删除
|
||||
if(!Arrays.asList(sysUser.getRoleIds().split(",")).contains(lawsAdmin)
|
||||
&& Arrays.stream(sysUser.getRoleIds().split(",")).noneMatch(otherAdmin::contains)
|
||||
&& !Arrays.asList(sysUser.getRoleIds().split(",")).contains(superAdmin)
|
||||
&& !Objects.equals(lawsMarketStandard.getAuthor(),sysUser.getId())){
|
||||
msg.append(lawsMarketStandard.getManifestNo())
|
||||
.append(Objects.equals(LocaleContextHolder.getLocale(),Locale.ENGLISH)
|
||||
? "No data operation permission," : "没有权限,");
|
||||
continue;
|
||||
}
|
||||
if(Objects.equals(lawsMarketStandard.getManifestStatus(),MarketStandardConstants.MANIFEST_STATUS_PUBLISH)){
|
||||
msg.append(lawsMarketStandard.getManifestNo())
|
||||
.append(Objects.equals(LocaleContextHolder.getLocale(),Locale.ENGLISH)
|
||||
? "Data published," : "数据已发布,");
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
processMarketStandardReleaseService.checkProcessStatus(lawsMarketStandard.getId());
|
||||
}catch (Exception e){
|
||||
msg.append(lawsMarketStandard.getManifestNo())
|
||||
.append("当前数据已发布的流程未结束,不可操作,");
|
||||
}
|
||||
|
||||
}
|
||||
if(!StringUtils.isEmpty(msg.toString())){
|
||||
return Result.error(msg.toString().substring(0,msg.toString().length() - 1));
|
||||
}
|
||||
for (LawsMarketStandard lawsMarketStandardOld : lawsMarketStandardOldList) {
|
||||
LambdaQueryWrapper<LawsMarketStandard> queryLawsMarketStandard = new LambdaQueryWrapper<>();
|
||||
queryLawsMarketStandard.eq(LawsMarketStandard::getVersionFlag,lawsMarketStandardOld.getVersionFlag());
|
||||
long l = count(queryLawsMarketStandard);
|
||||
// 更新状态
|
||||
LambdaUpdateWrapper<LawsMarketStandard> updateLawsMarketStandard = new LambdaUpdateWrapper<>();
|
||||
updateLawsMarketStandard.eq(LawsMarketStandard::getId, lawsMarketStandardOld.getId());
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getReleaseDate,new Date());
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getManifestVersion, "V" + l + ".0");
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getManifestStatus,MarketStandardConstants.MANIFEST_STATUS_PUBLISH);
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getUpdateTime,new Date());
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getUpdateBy,sysUser.getUsername());
|
||||
update(updateLawsMarketStandard);
|
||||
|
||||
// 更新标准的市场数据
|
||||
LambdaQueryWrapper<LawsMarketStandardDetail> queryLawsMarketStandardDetail = new LambdaQueryWrapper<>();
|
||||
queryLawsMarketStandardDetail.eq(LawsMarketStandardDetail::getManifestId,lawsMarketStandardOld.getId());
|
||||
List<LawsMarketStandardDetail> listLawsMarketStandardDetail = lawsMarketStandardDetailService
|
||||
.list(queryLawsMarketStandardDetail);
|
||||
if(!CollectionUtils.isEmpty(listLawsMarketStandardDetail)){
|
||||
List<LawsDomesticStandard> listLawsDomesticStandard = new ArrayList<>();
|
||||
String country = lawsMarketStandardOld.getCountry();
|
||||
for (LawsMarketStandardDetail lawsMarketStandardDetail : listLawsMarketStandardDetail) {
|
||||
String countryDetail = lawsMarketStandardDetail.getCountry();
|
||||
String dis = StringUtils.isEmpty(countryDetail) ? country : country + "," + countryDetail;
|
||||
List<String> data = Arrays.stream(dis.split(",")).distinct().collect(Collectors.toList());
|
||||
LawsDomesticStandard lawsDomesticStandard = new LawsDomesticStandard();
|
||||
lawsDomesticStandard.setId(lawsMarketStandardDetail.getStandardId());
|
||||
lawsDomesticStandard.setApplicableMarket(String.join(",",data));
|
||||
listLawsDomesticStandard.add(lawsDomesticStandard);
|
||||
}
|
||||
lawsDomesticStandardService.updateBatchById(listLawsDomesticStandard);
|
||||
}
|
||||
lawsStandardMasterPlanService.syncMarketRegulationListUpdate(lawsMarketStandardOld.getId(),lawsMarketStandardOld.getCountry());
|
||||
}
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public synchronized Result<?> publish(String id) {
|
||||
@@ -540,21 +617,20 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
|
||||
queryLawsMarketStandardDetail.eq(LawsMarketStandardDetail::getManifestId,id);
|
||||
List<LawsMarketStandardDetail> listLawsMarketStandardDetail = lawsMarketStandardDetailService
|
||||
.list(queryLawsMarketStandardDetail);
|
||||
if(CollectionUtils.isEmpty(listLawsMarketStandardDetail)){
|
||||
return Result.OK(ResultCommon.OK);
|
||||
if(!CollectionUtils.isEmpty(listLawsMarketStandardDetail)){
|
||||
List<LawsDomesticStandard> listLawsDomesticStandard = new ArrayList<>();
|
||||
String country = lawsMarketStandardOld.getCountry();
|
||||
for (LawsMarketStandardDetail lawsMarketStandardDetail : listLawsMarketStandardDetail) {
|
||||
String countryDetail = lawsMarketStandardDetail.getCountry();
|
||||
String dis = StringUtils.isEmpty(countryDetail) ? country : country + "," + countryDetail;
|
||||
List<String> data = Arrays.stream(dis.split(",")).distinct().collect(Collectors.toList());
|
||||
LawsDomesticStandard lawsDomesticStandard = new LawsDomesticStandard();
|
||||
lawsDomesticStandard.setId(lawsMarketStandardDetail.getStandardId());
|
||||
lawsDomesticStandard.setApplicableMarket(String.join(",",data));
|
||||
listLawsDomesticStandard.add(lawsDomesticStandard);
|
||||
}
|
||||
lawsDomesticStandardService.updateBatchById(listLawsDomesticStandard);
|
||||
}
|
||||
List<LawsDomesticStandard> listLawsDomesticStandard = new ArrayList<>();
|
||||
String country = lawsMarketStandardOld.getCountry();
|
||||
for (LawsMarketStandardDetail lawsMarketStandardDetail : listLawsMarketStandardDetail) {
|
||||
String countryDetail = lawsMarketStandardDetail.getCountry();
|
||||
String dis = StringUtils.isEmpty(countryDetail) ? country : country + "," + countryDetail;
|
||||
List<String> data = Arrays.stream(dis.split(",")).distinct().collect(Collectors.toList());
|
||||
LawsDomesticStandard lawsDomesticStandard = new LawsDomesticStandard();
|
||||
lawsDomesticStandard.setId(lawsMarketStandardDetail.getStandardId());
|
||||
lawsDomesticStandard.setApplicableMarket(String.join(",",data));
|
||||
listLawsDomesticStandard.add(lawsDomesticStandard);
|
||||
}
|
||||
lawsDomesticStandardService.updateBatchById(listLawsDomesticStandard);
|
||||
lawsStandardMasterPlanService.syncMarketRegulationListUpdate(id,lawsMarketStandardOld.getCountry());
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
+146
-24
@@ -2,6 +2,7 @@ package com.jero.modules.split.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -2679,7 +2680,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// 树形字典
|
||||
List<SysDict> sysDictTreeList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getAttributeType, "2"));
|
||||
// 组织结构
|
||||
List<SysDepart> sysDepartList = sysDepartService.list();
|
||||
List<SysDepart> departList = sysDepartService.list();
|
||||
Map<String, List<SysDepart>> departMap = departList.stream().collect(Collectors.groupingBy(SysDepart::getDepartName));
|
||||
Map<String, String> departPartMap = SysDepart.buildPaths(departList);
|
||||
// 适用零部件
|
||||
List<PartName> partNameList = new ArrayList<>();
|
||||
//存放数据验证结果信息
|
||||
@@ -3175,19 +3178,59 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
|
||||
if (StringUtils.isNotBlank(value)){
|
||||
for (String v : value.split(",")) {
|
||||
Optional<SysDepart> first = sysDepartList.stream().filter(o -> v.equals(o.getDepartName())).findFirst();
|
||||
if (!first.isPresent()) {
|
||||
String[] splitValue = v.split("/");
|
||||
List<SysDepart> sysDeparts = departMap.get(splitValue[splitValue.length - 1]);
|
||||
if (sysDeparts != null) {
|
||||
if (sysDeparts.size() > 1) {
|
||||
// 叶子节点名称重复,需要寻找全路径
|
||||
String nodeId = departPartMap.get(v);
|
||||
if (StrUtil.isBlank(nodeId)) {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中组织机构" + v + "不存在;";
|
||||
} else {
|
||||
errorMsg += fieldName + " " + v + "Not exist;";
|
||||
}
|
||||
countError++;
|
||||
valueList = new ArrayList<>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中组织机构" + v + "不存在;";
|
||||
} else {
|
||||
errorMsg += fieldName + " " + v + "Not exist;";
|
||||
}
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
continue;
|
||||
}else {
|
||||
valueList.add(first.get().getId());
|
||||
valueList = new ArrayList<>();
|
||||
break;
|
||||
}
|
||||
String cellValue = this.convertMultiOrgId(v, departMap, departPartMap);
|
||||
if(StringUtils.isEmpty(cellValue)){
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中组织机构" + v + "不存在;";
|
||||
} else {
|
||||
errorMsg += fieldName + " " + v + "Not exist;";
|
||||
}
|
||||
countError++;
|
||||
valueList = new ArrayList<>();
|
||||
break;
|
||||
}
|
||||
valueList.add(cellValue);
|
||||
|
||||
// Optional<SysDepart> first = sysDepartList.stream().filter(o -> v.equals(o.getDepartName())).findFirst();
|
||||
// if (!first.isPresent()) {
|
||||
// if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
// errorMsg += fieldName + "中组织机构" + v + "不存在;";
|
||||
// } else {
|
||||
// errorMsg += fieldName + " " + v + "Not exist;";
|
||||
// }
|
||||
// countError++;
|
||||
// valueList = new ArrayList<>();
|
||||
// break;
|
||||
// }else {
|
||||
// valueList.add(first.get().getId());
|
||||
// }
|
||||
}
|
||||
}
|
||||
}else if (FieldTypeEnum.TREE_BOX.getValue().equals(fieldShowType)) {
|
||||
@@ -3221,54 +3264,64 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
|
||||
.collect(Collectors.toList());
|
||||
if(!pathOther.isEmpty()){
|
||||
if (path.size() > 1) {
|
||||
if (pathOther.size() > 1) {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "存在多个;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if(CollectionUtils.isEmpty(valueList)){
|
||||
valueList = new ArrayList<>();
|
||||
}
|
||||
valueList.add(pathOther.get(0).getItemValue());
|
||||
}else{
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "存在多个;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Not exist;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(CollectionUtils.isEmpty(valueList)){
|
||||
valueList = new ArrayList<>();
|
||||
}
|
||||
valueList.add(path.get(0).getItemValue());
|
||||
}else {
|
||||
List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists);
|
||||
List<SysDictItem> pathOther =
|
||||
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
|
||||
.collect(Collectors.toList());
|
||||
if(!pathOther.isEmpty()){
|
||||
if (path.size() > 1) {
|
||||
if (pathOther.size() > 1) {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "存在多个;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if(CollectionUtils.isEmpty(valueList)){
|
||||
valueList = new ArrayList<>();
|
||||
}
|
||||
valueList.add(pathOther.get(0).getItemValue());
|
||||
}else{
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "不存在;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Not exist;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3287,22 +3340,22 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "存在多个;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
valueList.add(path.get(0).getCode());
|
||||
}else {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "不存在;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Not exist;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3336,6 +3389,55 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
// 组织机构
|
||||
public boolean multiOrgValid(String cellValue, Map<String, List<SysDepart>> sysDepartMap, Map<String, String> sysDepartPathMap) {
|
||||
String[] cellValues = cellValue.split(",");
|
||||
for (String value : cellValues) {
|
||||
String[] splitValue = value.split("/");
|
||||
List<SysDepart> sysDeparts = sysDepartMap.get(splitValue[splitValue.length - 1]);
|
||||
if (sysDeparts != null) {
|
||||
if (sysDeparts.size() == 1) continue;
|
||||
if (sysDeparts.size() > 1) {
|
||||
// 叶子节点名称重复,需要寻找全路径
|
||||
String nodeId = sysDepartPathMap.get(value);
|
||||
if (StrUtil.isBlank(nodeId)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 多选部门转换
|
||||
public String convertMultiOrgId(String cellValue, Map<String, List<SysDepart>> sysDepartMap, Map<String, String> sysDepartPathMap) {
|
||||
if (StrUtil.isBlank(cellValue)) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder result = new StringBuilder();
|
||||
String[] cellValues = cellValue.split(",");
|
||||
for (String value : cellValues) {
|
||||
String[] splitValue = value.split("/");
|
||||
List<SysDepart> sysDeparts = sysDepartMap.get(splitValue[splitValue.length - 1]);
|
||||
if (sysDeparts != null) {
|
||||
if (sysDeparts.size() == 1) {
|
||||
result.append(sysDeparts.get(0).getId()).append(",");
|
||||
}
|
||||
if (sysDeparts.size() > 1) {
|
||||
// 叶子节点名称重复,需要寻找全路径
|
||||
String nodeId = sysDepartPathMap.get(value);
|
||||
result.append(nodeId).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 去除掉最后的逗号
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
||||
|
||||
private List<PartName> partNameGetLevelPath(List<PartName> partNames) {
|
||||
List<PartName> list = new ArrayList<>();
|
||||
// 一级节点
|
||||
@@ -3544,9 +3646,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
|
||||
List<SarFileSplitMenuTreeNode> treeNodeList = new ArrayList<>();
|
||||
String regex = "^[0-9]{0}([0-9]|[.])+$"; //TODO 待优化:数字和点必须交替
|
||||
String parentId = "";
|
||||
String parentId = menuId;
|
||||
for (Map<String, Object> itemEO : addItemsEOList) {
|
||||
String itemNum = itemEO.get("item_num").toString();
|
||||
String itemNum = itemEO.get("item_num").toString().trim();
|
||||
String itemTitle = itemEO.get("item_title").toString();
|
||||
// if(itemNum.matches(regex) || itemNum.contains("附录")) { // TODO 解除条款号格式限制
|
||||
SarFileSplitMenuTreeNode treeNode = new SarFileSplitMenuTreeNode();
|
||||
@@ -4625,11 +4727,31 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
bis.close(); // 先开后关
|
||||
}
|
||||
|
||||
private void checkForSQLInjection(Map<String, Object> parameterMap) {
|
||||
// 定义要检查的特殊字符
|
||||
String[] specialCharacters = {"'", "\"", "\\", "<", ">", "&", "*", ";"};
|
||||
|
||||
for (Map.Entry<String, Object> entry : parameterMap.entrySet()) {
|
||||
Object value = entry.getValue();
|
||||
|
||||
// 检查是否是字符串类型
|
||||
if (value instanceof String) {
|
||||
String strValue = (String) value;
|
||||
// 检查是否包含特殊字符
|
||||
for (String character : specialCharacters) {
|
||||
if (strValue.contains(character)) {
|
||||
throw new JeroBootException("输入字段中包含非法字符,请检查");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void exportSplitInfo(String cut, String idList, Map<String, Object> parameter,String exportName, HttpServletResponse response, HttpServletRequest request) {
|
||||
// 水平越权
|
||||
documentSplitService.isHorizontalOverstep(String.valueOf(parameter.get("info_id")));
|
||||
|
||||
// 防止SQL注入
|
||||
this.checkForSQLInjection(parameter);
|
||||
OutputStream os = null;
|
||||
OutputStream excelOS = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
|
||||
+15
-48
@@ -379,13 +379,10 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
public void updateMenuLevel(String sourceIds, String parentId, Long displaySeq) {
|
||||
// 要移动到的节点信息
|
||||
SarFileSplitMenuEO parentMenu = baseMapper.findById(parentId);
|
||||
|
||||
List<String> sourceIdList = Arrays.asList(sourceIds.split(","));
|
||||
// 获取要移动到的层级的最后一个 的排序值
|
||||
List<SarFileSplitMenuEO> lastMenuList = getLastMenu(parentMenu.getId(),displaySeq,sourceIdList);
|
||||
if (CollectionUtil.isNotEmpty(lastMenuList)){
|
||||
displaySeq = lastMenuList.stream().map(SarFileSplitMenuEO::getDisplaySeq).min(Comparator.comparing(x -> x)).orElse(null);
|
||||
}
|
||||
// 要移动的节点所有子集(包括本身)
|
||||
|
||||
// 更新要移动的节点的父级id
|
||||
List<SarFileSplitMenuEO> sarFileSplitMenuEO1List = new ArrayList<>();
|
||||
for (String sourceId : sourceIdList) {
|
||||
// 要移动的节点信息
|
||||
@@ -393,54 +390,24 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
sarFileSplitMenuEO.setParentId(parentId);
|
||||
sarFileSplitMenuEO1List.add(sarFileSplitMenuEO);
|
||||
}
|
||||
List<SarFileSplitMenuEO> allList = new ArrayList<>();
|
||||
getChildren(allList, sarFileSplitMenuEO1List);
|
||||
//for (SarFileSplitMenuEO splitMenuEO : allList) {
|
||||
// splitMenuEO.setParentId(parentId);
|
||||
//}
|
||||
//排除
|
||||
getChildren(allList, lastMenuList);
|
||||
|
||||
List<SarFileSplitMenuEO> allList = new ArrayList<>();
|
||||
//获得子父级目录
|
||||
getChildren(allList, sarFileSplitMenuEO1List);
|
||||
//获得大于排序的所有目录,全部向下移动
|
||||
List<SarFileSplitMenuEO> sarFileSplitMenuEOS = baseMapper.queryByGTDisplaySeq(parentMenu.getInfoId(),displaySeq);
|
||||
for (int i = 0; i < sarFileSplitMenuEOS.size(); i++) {
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = sarFileSplitMenuEOS.get(i);
|
||||
sarFileSplitMenuEO.setDisplaySeq(displaySeq+allList.size()+i+1);
|
||||
baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO);
|
||||
}
|
||||
|
||||
//移动要移动的子父级目录
|
||||
for (int i = 0; i < allList.size(); i++) {
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = allList.get(i);
|
||||
sarFileSplitMenuEO.setDisplaySeq(displaySeq+i+1);
|
||||
baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO);
|
||||
}
|
||||
|
||||
//this.updateBatchById(updateList);
|
||||
// 要移动的节点所有子集(包括本身)
|
||||
//List<SarFileSplitMenuEO> sarFileSplitMenuEO1List = new ArrayList<>();
|
||||
//sarFileSplitMenuEO1List.add(sarFileSplitMenuEO1);
|
||||
//List<SarFileSplitMenuEO> allList = new ArrayList<>();
|
||||
//getChildren(allList, sarFileSplitMenuEO1List);
|
||||
//List<String> idlist = new ArrayList<>();
|
||||
//
|
||||
//// 更新要移动节点及其子集的排序
|
||||
//for (int i = 0; i <allList.size(); i++) {
|
||||
// SarFileSplitMenuEO sarFileSplitMenuEO = allList.get(i);
|
||||
// if (!Objects.equals(sarFileSplitMenuEO.getId(), lastMenu.getId())){
|
||||
// sarFileSplitMenuEO.setDisplaySeq(lastMenu.getDisplaySeq() + i + 1);
|
||||
// }
|
||||
// idlist.add(sarFileSplitMenuEO.getId());
|
||||
// baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO);
|
||||
//}
|
||||
//Long displaySeq = allList.get(allList.size() - 1).getDisplaySeq();
|
||||
//
|
||||
//// 更新 大于 要移动到节点最后节点 的节点排序值
|
||||
//List<SarFileSplitMenuEO> sarFileSplitMenuEOList =
|
||||
// baseMapper.queryByGTDisplaySeq(sarFileSplitMenuEO1.getInfoId(), lastMenu.getDisplaySeq());
|
||||
//sarFileSplitMenuEOList = sarFileSplitMenuEOList.stream()
|
||||
// .filter(v -> !idlist.contains(v.getId())).collect(Collectors.toList());
|
||||
//for (int i = 0; i < sarFileSplitMenuEOList.size(); i++) {
|
||||
// // 更新排序
|
||||
// SarFileSplitMenuEO fileSplitMenuEO = sarFileSplitMenuEOList.get(i);
|
||||
// fileSplitMenuEO.setDisplaySeq(displaySeq + i + 1);
|
||||
// baseMapper.updateByPrimaryKeySelective(fileSplitMenuEO);
|
||||
//}
|
||||
//
|
||||
//// 更新要移动节点的parentId
|
||||
//sarFileSplitMenuEO1.setParentId(parentId);
|
||||
//baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO1);
|
||||
}
|
||||
|
||||
private void getChildren(List<SarFileSplitMenuEO> allList, List<SarFileSplitMenuEO> sarFileSplitMenuEOList) {
|
||||
|
||||
@@ -609,7 +609,7 @@ feishu:
|
||||
# 飞书单点登录地址
|
||||
sign_login_in: ${feishu.base_url}/authen/v1/index?redirect_uri={REDIRECT_URI}&app_id=${feishu.app_id}&state=feishu
|
||||
# 飞书PC端待办地址
|
||||
promoter_pc_link: ${feishu.redirect_prefix}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
promoter_pc_link: ${feishu.redirect_prefix}{url}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
# 飞书PC端发起流程地址
|
||||
review_pc_link: ${feishu.redirect_prefix}{url}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ jero:
|
||||
fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin,$DATA
|
||||
# 跨站白名单 域名
|
||||
whiteUrls: localhost:62345,localhost:8188,localhost:3344,localhost:3435,localhost:3408,10.2.16.33:8188,10.2.16.33:3344,10.2.16.37:3344,10.2.16.34:8188,10.2.16.34:3344,10.2.16.33:8012,cgrsm.mychery.com:8188,cgrsm.mychery.com:3344,cgrsm.mychery.com:8012
|
||||
xssExcludedPages: /login,/updatePassword
|
||||
xssExcludedPages: /login,/updatePassword,/uploadModelFile,/standardComplianceCheck/start
|
||||
# cors白名单
|
||||
notFilter:
|
||||
# origin地址 域名
|
||||
@@ -392,7 +392,7 @@ iam:
|
||||
|
||||
# Hiwork集成
|
||||
hiwork:
|
||||
ip: https://newoatest.mychery.com:8088/
|
||||
ip: https://www.mychery.com/
|
||||
# 异构系统标识
|
||||
sysCode: CGRSM
|
||||
# 服务号
|
||||
@@ -408,8 +408,8 @@ hiwork:
|
||||
# 前端调用地址
|
||||
url: https://iam.mychery.com:6443/idp/oauth2/authorize?state=123&client_id=CGRSM&redirect_uri=
|
||||
# 域名
|
||||
fontUrl: https://cgrsm.mychery.com:3344/{url}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
fontAppUrl: https://cgrsm.mychery.com:3344//mobile{url}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
fontUrl: https://cgrsm.mychery.com:3344{url}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
fontAppUrl: https://cgrsm.mychery.com:3344/mobile{url}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
#hiwork单点登录
|
||||
appkey: dingshfclphtivrd0r7k
|
||||
appsecret: dqhom_17n6BC8pmLeaf5wNp4aV_4XSt_aYn-dNBo8z__-79NjVvZhDJ_M2REdxRc
|
||||
@@ -578,7 +578,7 @@ feishu:
|
||||
# 是否推送飞书
|
||||
isSendStatus: true
|
||||
# 重定向到前端的地址前缀
|
||||
redirect_prefix: http://10.2.16.37:3344/transferRedirectPage?finalRedirectPage=
|
||||
redirect_prefix: https://cgrsm.mychery.com:3344/transferRedirectPage?finalRedirectPage=
|
||||
# app的id
|
||||
app_id : cli_a6541d37d6359013
|
||||
# app秘钥
|
||||
|
||||
@@ -310,7 +310,7 @@ jero:
|
||||
fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin,$DATA
|
||||
# 跨站白名单
|
||||
whiteUrls: localhost:62345,localhost:8188,localhost:3344,localhost:3435,localhost:3408,10.2.16.10:8188,10.2.16.10:3344,10.2.16.10:8012,cgrsmuat.mychery.com:8188,cgrsmuat.mychery.com:3344,cgrsmuat.mychery.com:8012
|
||||
xssExcludedPages: /login,/updatePassword
|
||||
xssExcludedPages: /login,/updatePassword,/uploadModelFile,/standardComplianceCheck/start
|
||||
# cors白名单
|
||||
notFilter:
|
||||
# origin地址
|
||||
@@ -607,7 +607,7 @@ feishu:
|
||||
# 飞书单点登录地址
|
||||
sign_login_in: ${feishu.base_url}/authen/v1/index?redirect_uri={REDIRECT_URI}&app_id=${feishu.app_id}&state=feishu
|
||||
# 飞书PC端待办地址
|
||||
promoter_pc_link: ${feishu.redirect_prefix}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
promoter_pc_link: ${feishu.redirect_prefix}{url}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
# 飞书PC端发起流程地址
|
||||
review_pc_link: ${feishu.redirect_prefix}{url}?projectId={projectId}&taskName={taskName}&taskId={taskId}&processInstanceId={processInstanceId}&nodeId={nodeId}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user