From 1c4fe8709d4c3eeed420c18325184e29a5b180b5 Mon Sep 17 00:00:00 2001 From: "youhong.ai" Date: Fri, 9 Jun 2023 17:03:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96cus?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- javascript/common/dev.js | 23 +- .../taibao/建模打包带数据到指定明细.js | 109 ++++++++ src/main/java/aiyh/utils/Util.java | 15 ++ .../contoller/TaskElementController.java | 5 +- .../taskele/mapper/TaskElementMapper.java | 29 +++ .../taskele/service/TaskElementService.java | 9 +- .../PackingToWorkflowController.java | 39 +++ .../dabao/mapper/PackingToWorkflowMapper.java | 31 +++ .../service/PackingToWorkflowService.java | 34 +++ .../impl/InterceptRequestLogImpl.java | 3 - .../{impl => }/entity/SubRequestEntity.java | 2 +- .../entity/SubRequestToDataConfig.java | 9 +- .../entity/SubRequestToDataMapping.java | 15 +- .../entity/WorkflowBaseDataEntity.java | 2 +- .../impl/TriSubRequestAfterInterceptImpl.java | 232 +++++++++++------- .../TriSubRequestAfterMapper.java | 46 ++-- src/main/java/ln/LNParse.java | 88 +++++++ .../submitfirst/AutoSubmitFirstNewAction.java | 127 ++++++++++ .../intellectualproperty/util/OFDReader.java | 2 +- src/main/resources/cus_getlog/index.jsp | 8 +- .../java/youhong/ai/taibao/TestTaiBao.java | 14 ++ .../java/youhong/ai/utiltest/PDFODFTest.java | 2 +- view-oracle.sql | 49 ++-- view-sql-server.sql | 3 +- 24 files changed, 743 insertions(+), 153 deletions(-) create mode 100644 javascript/youhong.ai/taibao/建模打包带数据到指定明细.js create mode 100644 src/main/java/com/api/youhong/ai/taibao/dabao/controller/PackingToWorkflowController.java create mode 100644 src/main/java/com/api/youhong/ai/taibao/dabao/mapper/PackingToWorkflowMapper.java create mode 100644 src/main/java/com/api/youhong/ai/taibao/dabao/service/PackingToWorkflowService.java rename src/main/java/com/customization/youhong/taibao/trisubreq/{impl => }/entity/SubRequestEntity.java (88%) rename src/main/java/com/customization/youhong/taibao/trisubreq/{impl => }/entity/SubRequestToDataConfig.java (69%) rename src/main/java/com/customization/youhong/taibao/trisubreq/{impl => }/entity/SubRequestToDataMapping.java (62%) rename src/main/java/com/customization/youhong/taibao/trisubreq/{impl => }/entity/WorkflowBaseDataEntity.java (86%) rename src/main/java/com/customization/youhong/taibao/trisubreq/{impl => mapper}/TriSubRequestAfterMapper.java (78%) create mode 100644 src/main/java/ln/LNParse.java create mode 100644 src/main/java/weaver/youhong/ai/geerde/action/submitfirst/AutoSubmitFirstNewAction.java diff --git a/javascript/common/dev.js b/javascript/common/dev.js index 331fa30..67a3756 100644 --- a/javascript/common/dev.js +++ b/javascript/common/dev.js @@ -233,7 +233,28 @@ WfForm.showConfirm = function (content, okEvent, cancelEvent, otherInfo = {}) { /* ******************* 建模表开发依赖 ******************* */ -const ModeList = {} +const ModeList = { + /** + * getCheckedID: function() + * + * 描述: 选中的checkbox的值(主表数据ID) + * @returns {undefined} + */ + getCheckedID() { + return undefined; + }, + /** + * showLoading: function(show, size, msg) + * + * 描述: 控制全局loading的显示/隐藏 + * @param show + * @param size + * @param msg + */ + showLoading(show, size, msg) { + + } +} ModeList.dataLoadAfter = function (data) { // 描述:在列表数据加载完,对列表的数据进行二次加工,并渲染。 dataLoadAfter传入dataHandle方法,用来接收并处理数据,dataHandle有两个参数。 // var dataHandle = function(datas,displayType){ diff --git a/javascript/youhong.ai/taibao/建模打包带数据到指定明细.js b/javascript/youhong.ai/taibao/建模打包带数据到指定明细.js new file mode 100644 index 0000000..75e2a2c --- /dev/null +++ b/javascript/youhong.ai/taibao/建模打包带数据到指定明细.js @@ -0,0 +1,109 @@ +/* ******************* youhong.ai 建模部分 start ******************* */ +$(() => { + let config = { + workflowUrl: '', + table: '', + detailTable: 'detail_1', + fieldMap: { + fkgs: 'fkgs', + zw: 'zw', + fj: 'fj' + } + } + + function jumpToWorkflow() { + let ids = ModeList.getCheckedID(); + let url = `${config.workflowUrl}&table=${config.table}&ids=${ids}&detail=${config.detailTable}&field_map=${JSON.stringify(config.fieldMap)}` + window.open(url, "_blank") + } + + window.jumpToWorkflow = jumpToWorkflow +}) + +/* ******************* youhong.ai 建模部分 end ******************* */ + + +/* ******************* youhong.ai 流程部分 start ******************* */ +$(() => { + + function getQueryString(name) { + let reg = new RegExp("(^|&|\/?)" + name + "=([^&]*)(&|$)", "i"); + let searchStr = window.location.href + if (searchStr.startsWith('&')) { + searchStr = searchStr.substr(1) + } + let search = searchStr.match(reg) + if (search != null) { + return unescape(search[2]); + } + return null; + } + + function getConfig() { + let tableName = getQueryString("table") + let ids = getQueryString("ids") + let mapping = getQueryString("field_map") + let detail = getQueryString("detail") + let fieldMap = JSON.parse(mapping) + return { + table: tableName, + ids, + fieldMap, + detailTable: detail + } + } + + function runJs(config) { + console.log("config", config) + let {WeaLoadingGlobal} = ecCom + WeaLoadingGlobal.start(); + $.ajax(`/aiyh/taibao/packing2model/packing?table=${config.table}&ids=${config.ids}`, { + success: (res) => { + WeaLoadingGlobal.destroy(); + if (res && res.code === 200) { + console.log("获取到的数据", res.data) + let modelData = res.data + let fieldMap = config.fieldMap + let workflowDetailList = [] + modelData.forEach(item => { + let obj = {} + Object.keys(fieldMap).forEach(key => { + obj[key] = item[fieldMap[key]] + }) + workflowDetailList.push(obj) + }) + console.log("收集整理的数据:", workflowDetailList) + addDetailValue(workflowDetailList, config.detailTable) + } else { + WfForm.showMessage("打包数据错误,无法带出数据!", 2, 5); + } + }, + error: (err) => { + WeaLoadingGlobal.destroy(); + WfForm.showMessage("网路异常,打包失败!", 2, 5); + console.log(err) + }, + complete: () => { + WeaLoadingGlobal.destroy(); + } + }) + } + + function addDetailValue(workflowDetailList, detail) { + workflowDetailList.forEach(item => { + let valueMap = {} + Object.keys(item).forEach(key => { + valueMap[WfForm.convertFieldNameToId(key, detail)] = { + value: item[key] + } + }) + console.log("添加明细行数据", valueMap) + WfForm.addDetailRow(detail, valueMap); + }) + } + + runJs(getConfig()) + +}) + +/* ******************* youhong.ai 流程部分 end ******************* */ \ No newline at end of file diff --git a/src/main/java/aiyh/utils/Util.java b/src/main/java/aiyh/utils/Util.java index bb5deba..bec3d42 100644 --- a/src/main/java/aiyh/utils/Util.java +++ b/src/main/java/aiyh/utils/Util.java @@ -4053,6 +4053,14 @@ public class Util extends weaver.general.Util { return filePath; } + /** + *

创建临时文件

+ * + * @param inputStream 文件流 + * @param imageFileName 文件名 + * @param tempDir 临时文件夹 + * @return 文件路径 + */ public static String createTempFile(InputStream inputStream, String imageFileName, String tempDir) { String filePath = getTempFilePath(tempDir, imageFileName); try { @@ -4063,6 +4071,13 @@ public class Util extends weaver.general.Util { return filePath; } + /** + *

写入文件数据

+ * + * @param inputStream 文件流 + * @param filePath 文件路径 + * @throws IOException io异常 + */ public static void writeToFile(InputStream inputStream, String filePath) throws IOException { Path path = Paths.get(filePath); Path parentDir = path.getParent(); diff --git a/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/contoller/TaskElementController.java b/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/contoller/TaskElementController.java index 7e5ea84..dfef1fc 100644 --- a/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/contoller/TaskElementController.java +++ b/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/contoller/TaskElementController.java @@ -32,10 +32,11 @@ public class TaskElementController { @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) - public String getList(@Context HttpServletRequest request, @Context HttpServletResponse response) { + public String getList(@Context HttpServletRequest request, @Context HttpServletResponse response, + @QueryParam("itemGroup") String itemGroup) { User user = HrmUserVarify.getUser(request, response); try { - return ApiResult.success(service.getList(user)); + return ApiResult.success(service.getList(user,itemGroup)); } catch (Exception e) { log.error("get task list error!\n" + Util.getErrString(e)); return ApiResult.error("system error!"); diff --git a/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/mapper/TaskElementMapper.java b/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/mapper/TaskElementMapper.java index 164c565..194616b 100644 --- a/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/mapper/TaskElementMapper.java +++ b/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/mapper/TaskElementMapper.java @@ -44,6 +44,33 @@ public interface TaskElementMapper { }) List selectConfig(); + /** + *

查询配置信息

+ * + * @param itemGroup 分组 + * @return 配置信息 + */ + @Select("select * from uf_ihg_el_config where enable_status = 1 and item_group = #{itemGroup}") + @Associations({ + @Association( + property = "icon", + column = "icon", + id = @Id(methodId = 1, value = String.class)), + @Association( + property = "iconActive", + column = "icon_active", + id = @Id(methodId = 1, value = String.class)), + @Association( + property = "iconMobile", + column = "icon_mobile", + id = @Id(methodId = 1, value = String.class)), + @Association( + property = "iconMobileActive", + column = "icon_mobile_active", + id = @Id(methodId = 1, value = String.class)) + }) + List selectConfigByGroup(@ParamMapper("itemGroup") String itemGroup); + /** *

查询配置信息

* @@ -121,4 +148,6 @@ public interface TaskElementMapper { */ @Select(custom = true) String selectConvert(@SqlString String sql, @ParamMapper("value") String o); + + } diff --git a/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/service/TaskElementService.java b/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/service/TaskElementService.java index 5845bc2..86d3704 100644 --- a/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/service/TaskElementService.java +++ b/src/main/java/com/api/youhong/ai/ihgzhouji/taskele/service/TaskElementService.java @@ -48,8 +48,13 @@ public class TaskElementService { return config; } - public List getList(User user) { - List ihgTaskElementConfItemList = mapper.selectConfig(); + public List getList(User user,String itemGroup) { + List ihgTaskElementConfItemList = null; + if (StrUtil.isBlank(itemGroup)) { + ihgTaskElementConfItemList = mapper.selectConfig(); + }else { + ihgTaskElementConfItemList = mapper.selectConfigByGroup(itemGroup); + } if (CollectionUtil.isEmpty(ihgTaskElementConfItemList)) { return Collections.emptyList(); } diff --git a/src/main/java/com/api/youhong/ai/taibao/dabao/controller/PackingToWorkflowController.java b/src/main/java/com/api/youhong/ai/taibao/dabao/controller/PackingToWorkflowController.java new file mode 100644 index 0000000..23f749f --- /dev/null +++ b/src/main/java/com/api/youhong/ai/taibao/dabao/controller/PackingToWorkflowController.java @@ -0,0 +1,39 @@ +package com.api.youhong.ai.taibao.dabao.controller; + +import aiyh.utils.ApiResult; +import aiyh.utils.Util; +import com.api.youhong.ai.taibao.dabao.service.PackingToWorkflowService; +import org.apache.log4j.Logger; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; + +/** + *

打包到流程

+ * + *

create: 2023/6/7 13:45

+ * + * @author youHong.ai + */ +@Path("/aiyh/taibao/packing2model") +public class PackingToWorkflowController { + private final Logger log = Util.getLogger(); + + private final PackingToWorkflowService service = new PackingToWorkflowService(); + + @Path("/packing") + @GET + @Produces(MediaType.APPLICATION_JSON) + public String getPackingData(@QueryParam("table") String table, @QueryParam("ids") String ids) { + try { + return ApiResult.success(service.getPackingData(table, ids)); + } catch (Exception e) { + log.error("打包数据查询异常:" + Util.getErrString(e)); + return ApiResult.error("system error"); + } + } + +} diff --git a/src/main/java/com/api/youhong/ai/taibao/dabao/mapper/PackingToWorkflowMapper.java b/src/main/java/com/api/youhong/ai/taibao/dabao/mapper/PackingToWorkflowMapper.java new file mode 100644 index 0000000..93c0f73 --- /dev/null +++ b/src/main/java/com/api/youhong/ai/taibao/dabao/mapper/PackingToWorkflowMapper.java @@ -0,0 +1,31 @@ +package com.api.youhong.ai.taibao.dabao.mapper; + +import aiyh.utils.annotation.recordset.ParamMapper; +import aiyh.utils.annotation.recordset.Select; +import aiyh.utils.annotation.recordset.SqlMapper; + +import java.util.List; +import java.util.Map; + +/** + *

+ * + *

create: 2023/6/7 13:54

+ * + * @author youHong.ai + */ +@SqlMapper +public interface PackingToWorkflowMapper { + + /** + *

查询建模表指定id数据

+ * + * @param tableName 建模表名 + * @param ids 数据id + * @return 数据 + */ + @Select("select * from $t{tableName} where id in ($t{ids})") + List> selectDataList(@ParamMapper("tableName") String tableName, + @ParamMapper("ids") String ids); + +} diff --git a/src/main/java/com/api/youhong/ai/taibao/dabao/service/PackingToWorkflowService.java b/src/main/java/com/api/youhong/ai/taibao/dabao/service/PackingToWorkflowService.java new file mode 100644 index 0000000..eaef921 --- /dev/null +++ b/src/main/java/com/api/youhong/ai/taibao/dabao/service/PackingToWorkflowService.java @@ -0,0 +1,34 @@ +package com.api.youhong.ai.taibao.dabao.service; + +import aiyh.utils.Util; +import aiyh.utils.tool.cn.hutool.core.collection.CollectionUtil; +import aiyh.utils.tool.cn.hutool.core.util.StrUtil; +import com.api.youhong.ai.taibao.dabao.mapper.PackingToWorkflowMapper; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + *

+ * + *

create: 2023/6/7 13:53

+ * + * @author youHong.ai + */ +public class PackingToWorkflowService { + + + private final PackingToWorkflowMapper mapper = Util.getMapper(PackingToWorkflowMapper.class); + + public Object getPackingData(String table, String ids) { + if (StrUtil.isBlank(ids)) { + return Collections.emptyList(); + } + List> maps = mapper.selectDataList(table, ids); + if (CollectionUtil.isEmpty(maps)) { + return Collections.emptyList(); + } + return maps; + } +} diff --git a/src/main/java/com/customization/youhong/deerge/requestlog/impl/InterceptRequestLogImpl.java b/src/main/java/com/customization/youhong/deerge/requestlog/impl/InterceptRequestLogImpl.java index 45f36a5..df94065 100644 --- a/src/main/java/com/customization/youhong/deerge/requestlog/impl/InterceptRequestLogImpl.java +++ b/src/main/java/com/customization/youhong/deerge/requestlog/impl/InterceptRequestLogImpl.java @@ -119,21 +119,18 @@ public class InterceptRequestLogImpl extends AbstractServiceProxy implements Req @Override @ServiceMethodDynamicProxy(desc = "保存和提交流程时,判断是否开启隐私") public Map requestSubmit(HttpServletRequest request) { - log.info("requestSubmit:=>"); return handlerRequestLogPrivacy(request); } @Override @ServiceMethodDynamicProxy(desc = "转发流程、意见征询时,判断是否开启隐私") public Map forwardSubmit(HttpServletRequest request) { - log.info("forwardSubmit:=>"); return handlerRequestLogPrivacy(request); } @Override @ServiceMethodDynamicProxy(desc = "转发流程、意见征询时,判断是否开启隐私") public Map remarkSubmit(HttpServletRequest request) { - log.info("remarkSubmit:=>"); return handlerRequestLogPrivacy(request); } diff --git a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestEntity.java b/src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestEntity.java similarity index 88% rename from src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestEntity.java rename to src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestEntity.java index bbd8bad..4be74f2 100644 --- a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestEntity.java +++ b/src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestEntity.java @@ -1,4 +1,4 @@ -package com.customization.youhong.taibao.trisubreq.impl.entity; +package com.customization.youhong.taibao.trisubreq.entity; import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn; import lombok.Getter; diff --git a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestToDataConfig.java b/src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestToDataConfig.java similarity index 69% rename from src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestToDataConfig.java rename to src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestToDataConfig.java index c95df11..065cfcc 100644 --- a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestToDataConfig.java +++ b/src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestToDataConfig.java @@ -1,5 +1,6 @@ -package com.customization.youhong.taibao.trisubreq.impl.entity; +package com.customization.youhong.taibao.trisubreq.entity; +import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn; import aiyh.utils.entity.ModelTableInfo; import lombok.Getter; import lombok.Setter; @@ -22,19 +23,23 @@ public class SubRequestToDataConfig { private Integer id; /** 流程 */ + @SqlOracleDbFieldAnn("WORKFLOW_TYPE") private String workflowType; /** 子流程 */ + @SqlOracleDbFieldAnn("WORKFLOW_TYPE_1") private String workflowType1; /** 建模 */ + @SqlOracleDbFieldAnn("MODEL_TABLE") private String modelTable; /** 更新条件 */ + @SqlOracleDbFieldAnn("CONDITION_UPDATE") private String conditionUpdate; /** 建模表 */ + @SqlOracleDbFieldAnn("MODEL_TABLE_INFO") private ModelTableInfo modelTableInfo; /** 插入字段映射 */ - private List mappings; /** 更新字段映射 */ diff --git a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestToDataMapping.java b/src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestToDataMapping.java similarity index 62% rename from src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestToDataMapping.java rename to src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestToDataMapping.java index 8a7cd9c..030e09e 100644 --- a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/SubRequestToDataMapping.java +++ b/src/main/java/com/customization/youhong/taibao/trisubreq/entity/SubRequestToDataMapping.java @@ -1,6 +1,7 @@ -package com.customization.youhong.taibao.trisubreq.impl.entity; +package com.customization.youhong.taibao.trisubreq.entity; import aiyh.utils.annotation.recordset.SqlDbFieldAnn; +import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn; import aiyh.utils.entity.FieldViewInfo; import lombok.Getter; import lombok.Setter; @@ -19,7 +20,7 @@ import lombok.ToString; public class SubRequestToDataMapping { private Integer id; - @SqlDbFieldAnn("mainid") + @SqlDbFieldAnn("MAINID") private Integer mainId; /** 建模字段 */ @@ -31,5 +32,15 @@ public class SubRequestToDataMapping { private FieldViewInfo mainWorkflowField; /** 数据来源 */ + @SqlOracleDbFieldAnn("DATA_SOURCE") private Integer dataSource; + + + /** 转换规则 */ + @SqlOracleDbFieldAnn("RULES_TYPE") + private Integer rulesType; + + /** 自定义值 */ + @SqlOracleDbFieldAnn("CUSTOMER_VALUE") + private String customerValue; } diff --git a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/WorkflowBaseDataEntity.java b/src/main/java/com/customization/youhong/taibao/trisubreq/entity/WorkflowBaseDataEntity.java similarity index 86% rename from src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/WorkflowBaseDataEntity.java rename to src/main/java/com/customization/youhong/taibao/trisubreq/entity/WorkflowBaseDataEntity.java index b955e2c..f16f008 100644 --- a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/entity/WorkflowBaseDataEntity.java +++ b/src/main/java/com/customization/youhong/taibao/trisubreq/entity/WorkflowBaseDataEntity.java @@ -1,4 +1,4 @@ -package com.customization.youhong.taibao.trisubreq.impl.entity; +package com.customization.youhong.taibao.trisubreq.entity; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/TriSubRequestAfterInterceptImpl.java b/src/main/java/com/customization/youhong/taibao/trisubreq/impl/TriSubRequestAfterInterceptImpl.java index dca8694..ccda758 100644 --- a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/TriSubRequestAfterInterceptImpl.java +++ b/src/main/java/com/customization/youhong/taibao/trisubreq/impl/TriSubRequestAfterInterceptImpl.java @@ -6,23 +6,24 @@ import aiyh.utils.excention.CustomerException; import aiyh.utils.recordset.MapperBuilderSql; import aiyh.utils.tool.cn.hutool.core.collection.CollectionUtil; import aiyh.utils.tool.cn.hutool.core.util.StrUtil; -import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestEntity; -import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestToDataConfig; -import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestToDataMapping; -import com.customization.youhong.taibao.trisubreq.impl.entity.WorkflowBaseDataEntity; +import com.customization.youhong.taibao.trisubreq.entity.SubRequestEntity; +import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataConfig; +import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataMapping; +import com.customization.youhong.taibao.trisubreq.entity.WorkflowBaseDataEntity; +import com.customization.youhong.taibao.trisubreq.mapper.TriSubRequestAfterMapper; import com.engine.core.cfg.annotation.ServiceDynamicProxy; +import com.engine.core.cfg.annotation.ServiceMethodDynamicProxy; import com.engine.core.impl.aop.AbstractServiceProxy; import com.engine.workflow.service.SubRequestService; import com.engine.workflow.service.impl.SubRequestServiceImpl; import ebu7common.youhong.ai.bean.Builder; import org.apache.log4j.Logger; +import weaver.soa.workflow.request.RequestInfo; +import weaver.soa.workflow.request.RequestService; import weaver.workflow.request.DiffWfTriggerSetting; import weaver.workflow.request.SameWfTriggerSetting; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -32,7 +33,7 @@ import java.util.stream.Collectors; * * @author youHong.ai */ -@ServiceDynamicProxy(target = SubRequestServiceImpl.class, desc = "拦截签字意见信息,是否需要隐私控制") +@ServiceDynamicProxy(target = SubRequestServiceImpl.class, desc = "子流程触发后调用方法,设置流程数据转存") public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implements SubRequestService { private final TriSubRequestAfterMapper mapper = Util.getMapper(TriSubRequestAfterMapper.class); @@ -50,83 +51,104 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem } @Override + @ServiceMethodDynamicProxy(desc = "子流程触发时,做流程转数据") public void triSubRequestAfter(int i) { - // 查询所有的子流程 - List subRequestEntities = mapper.selectSubRequestByMainRequest(i); - if (CollectionUtil.isEmpty(subRequestEntities)) { - return; - } - String mainWorkflowId = mapper.selectWorkflowId(i); - // 查询配置信息 - List subRequestToDataConfigs = mapper.selectConfig(mainWorkflowId); - if (CollectionUtil.isEmpty(subRequestToDataConfigs)) { - return; - } - // 按照流程类型分组,主要作用于不同流程的触发操作 - Map collect = subRequestToDataConfigs - .stream() - .collect( - Collectors.toMap( - SubRequestToDataConfig::getWorkflowType, - value -> value - )); - // 查询出所有子流程的数据信息 - List requestDataList = new ArrayList<>(); - for (SubRequestEntity subRequestEntity : subRequestEntities) { - // 查询流程对应的配置信息 - Map requestData = getRequestData(subRequestEntity); - WorkflowBaseDataEntity build = Builder.builder(WorkflowBaseDataEntity::new) - .with(WorkflowBaseDataEntity::setRequestId, subRequestEntity.getRequestId()) - .with(WorkflowBaseDataEntity::setWorkflowId, subRequestEntity.getWorkflowId()) - .with(WorkflowBaseDataEntity::setData, requestData) - .build(); - requestDataList.add(build); - } - if (CollectionUtil.isEmpty(requestDataList)) { - return; - } - // 更具requestId转换map - Map requestDataMap = requestDataList.stream().collect(Collectors.toMap( - WorkflowBaseDataEntity::getRequestId, - value -> value - )); - // 查询主流程数据信息 - Map mainRequestData = mapper.selectRequestBase(Util.null2String(i)); - for (SubRequestEntity subRequestEntity : subRequestEntities) { - // 根据workflowId获取配置信息 - SubRequestToDataConfig subRequestToDataConfig = collect.get(subRequestEntity.getWorkflowId()); - WorkflowBaseDataEntity workflowBaseDataEntity = requestDataMap.get(subRequestEntity.getRequestId()); - Map data = workflowBaseDataEntity.getData(); - String conditionUpdate = subRequestToDataConfig.getConditionUpdate(); - ModelTableInfo modelTableInfo = subRequestToDataConfig.getModelTableInfo(); - String modelId = ""; - Map updateMap = null; - String id = ""; - // 没有更新条件,不需要更新数据信息 - if (StrUtil.isBlank(conditionUpdate)) { - modelId = mapper.selectModelId(conditionUpdate, modelTableInfo.getTableName(), mainRequestData, data); - id = modelId; + try { + log.info("子流程触发后调用方法.............."); + // 查询主流程数据信息 + Map mainRequestData = mapper.selectRequestBase(Util.null2String(i)); + RequestService requestService = new RequestService(); + RequestInfo request = requestService.getRequest(i); + String tableName = request.getRequestManager().getBillTableName(); + Map mainData = mapper.selectWorkflowData(tableName, Util.null2String(i)); + if (Objects.nonNull(mainRequestData)) { + mainRequestData.putAll(mainData); } - if (StrUtil.isNotBlank(modelId)) { - // 查询到数据,需要更新数据信息 - List updateMappings = subRequestToDataConfig.getUpdateMappings(); - updateMap = tidyUpData(updateMappings, mainRequestData, data); - } else { - // 没有数据,需要插入 - List mappings = subRequestToDataConfig.getMappings(); - updateMap = tidyUpData(mappings, mainRequestData, data); - int modeDataId = Util.getModeDataId(subRequestToDataConfig.getModelTable(), 1); - id = Util.null2String(modeDataId); + // 是否触发 + String sffk = Util.null2String(mainRequestData.get("sffk")); + if (!"0".equals(sffk)) { + return; } - String updateSql = MapperBuilderSql.builderUpdateSql(subRequestToDataConfig.getModelTable(), updateMap); - updateSql += " where id = #{id}"; - updateMap.put("id", id); - boolean flag = mapper.updateModelData(updateSql, updateMap); - if (!flag) { - log.info("流程转数据数据信息更新失败!" + updateSql); - } else { - Util.rebuildModeDataShare(1, subRequestToDataConfig.getModelTable(), Integer.valueOf(id)); + // 查询所有的子流程 + List subRequestEntities = mapper.selectSubRequestByMainRequest(i); + if (CollectionUtil.isEmpty(subRequestEntities)) { + return; } + String mainWorkflowId = mapper.selectWorkflowId(i); + // 查询配置信息 + List subRequestToDataConfigs = mapper.selectConfig(mainWorkflowId); + if (CollectionUtil.isEmpty(subRequestToDataConfigs)) { + return; + } + // 按照流程类型分组,主要作用于不同流程的触发操作 + Map collect = subRequestToDataConfigs + .stream() + .collect( + Collectors.toMap( + SubRequestToDataConfig::getWorkflowType, + value -> value + )); + // 查询出所有子流程的数据信息 + List requestDataList = new ArrayList<>(); + for (SubRequestEntity subRequestEntity : subRequestEntities) { + // 查询流程对应的配置信息 + Map requestData = getRequestData(subRequestEntity); + WorkflowBaseDataEntity build = Builder.builder(WorkflowBaseDataEntity::new) + .with(WorkflowBaseDataEntity::setRequestId, subRequestEntity.getRequestId()) + .with(WorkflowBaseDataEntity::setWorkflowId, subRequestEntity.getWorkflowId()) + .with(WorkflowBaseDataEntity::setData, requestData) + .build(); + requestDataList.add(build); + } + if (CollectionUtil.isEmpty(requestDataList)) { + return; + } + // 更具requestId转换map + Map requestDataMap = requestDataList.stream().collect(Collectors.toMap( + WorkflowBaseDataEntity::getRequestId, + value -> value + )); + for (SubRequestEntity subRequestEntity : subRequestEntities) { + // 根据workflowId获取配置信息 + SubRequestToDataConfig subRequestToDataConfig = collect.get(subRequestEntity.getWorkflowId()); + if (Objects.isNull(subRequestToDataConfig)) { + continue; + } + WorkflowBaseDataEntity workflowBaseDataEntity = requestDataMap.get(subRequestEntity.getRequestId()); + Map data = workflowBaseDataEntity.getData(); + String conditionUpdate = subRequestToDataConfig.getConditionUpdate(); + ModelTableInfo modelTableInfo = subRequestToDataConfig.getModelTableInfo(); + String modelId = ""; + Map updateMap = null; + String id = ""; + // 有更新条件,需要更新数据信息 + if (!StrUtil.isBlank(conditionUpdate)) { + modelId = mapper.selectModelId(conditionUpdate, modelTableInfo.getTableName(), mainRequestData, data); + id = modelId; + } + if (StrUtil.isNotBlank(modelId)) { + // 查询到数据,需要更新数据信息 + List updateMappings = subRequestToDataConfig.getUpdateMappings(); + updateMap = tidyUpData(updateMappings, mainRequestData, data); + } else { + // 没有数据,需要插入 + List mappings = subRequestToDataConfig.getMappings(); + updateMap = tidyUpData(mappings, mainRequestData, data); + int modeDataId = Util.getModeDataId(subRequestToDataConfig.getModelTableInfo().getTableName(), 1); + id = Util.null2String(modeDataId); + } + String updateSql = MapperBuilderSql.builderUpdateSql(subRequestToDataConfig.getModelTableInfo().getTableName(), updateMap); + updateSql += " where id = #{id}"; + updateMap.put("id", id); + boolean flag = mapper.updateModelData(updateSql, updateMap); + if (!flag) { + log.info("流程转数据数据信息更新失败!" + updateSql); + } else { + Util.rebuildModeDataShare(1, subRequestToDataConfig.getModelTableInfo().getTableName(), Integer.valueOf(id)); + } + } + } catch (Exception e) { + log.error("流程转存数据执行失败!" + Util.getErrString(e)); } } @@ -146,14 +168,46 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem for (SubRequestToDataMapping mapping : mappings) { Integer dataSource = mapping.getDataSource(); Object value = null; - if (dataSource == 0) { - // 主流程数据 - value = mainRequestData.get(mapping.getMainWorkflowField().getFieldName()); - } else { - // 子流程数据 - value = data.get(mapping.getWorkflowField().getFieldName()); + Integer rulesType = mapping.getRulesType(); + String customerValue = mapping.getCustomerValue(); + switch (rulesType) { + case 0: + // 固定值 + value = customerValue; + break; + case 1: + // 流程字段 + { + if (dataSource == 0) { + // 主流程数据 + value = mainRequestData.get(mapping.getMainWorkflowField().getFieldName()); + } else { + // 子流程数据 + value = data.get(mapping.getWorkflowField().getFieldName()); + } + } + break; + case 2: + // 自定义sql + value = mapper.selectCustomerSql(customerValue, mainRequestData, data); + break; + case 3: + // 序号 + String valueN = ""; + if (StrUtil.isNotBlank(customerValue)) { + valueN = mapper.selectCustomerSql(customerValue, mainRequestData, data); + } + if (StrUtil.isBlank(valueN)) { + valueN = "0"; + } + int intValue = Util.getIntValue(valueN); + intValue += 1; + value = intValue; + default: + break; } - result.put(mapping.getModelField().getTableName(), value); + + result.put(mapping.getModelField().getFieldName(), value); } return result; } diff --git a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/TriSubRequestAfterMapper.java b/src/main/java/com/customization/youhong/taibao/trisubreq/mapper/TriSubRequestAfterMapper.java similarity index 78% rename from src/main/java/com/customization/youhong/taibao/trisubreq/impl/TriSubRequestAfterMapper.java rename to src/main/java/com/customization/youhong/taibao/trisubreq/mapper/TriSubRequestAfterMapper.java index 7945016..5e6140c 100644 --- a/src/main/java/com/customization/youhong/taibao/trisubreq/impl/TriSubRequestAfterMapper.java +++ b/src/main/java/com/customization/youhong/taibao/trisubreq/mapper/TriSubRequestAfterMapper.java @@ -1,9 +1,9 @@ -package com.customization.youhong.taibao.trisubreq.impl; +package com.customization.youhong.taibao.trisubreq.mapper; import aiyh.utils.annotation.recordset.*; -import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestEntity; -import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestToDataConfig; -import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestToDataMapping; +import com.customization.youhong.taibao.trisubreq.entity.SubRequestEntity; +import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataConfig; +import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataMapping; import java.util.List; import java.util.Map; @@ -29,7 +29,7 @@ public interface TriSubRequestAfterMapper { @Associations({ @Association( property = "workflowTable", - column = "workflowid", + column = "workflow_id", id = @Id(value = String.class, methodId = 2) ) }) @@ -41,8 +41,8 @@ public interface TriSubRequestAfterMapper { * @param billId 流程表id * @return 流程表 */ - @Select("select tablename workflow_table from workflow_base wb\n" + - "inner join workflow_table_view wv on wv.id = wb.id\n" + + @Select("select tablename workflow_table from workflow_base wb " + + "inner join workflow_table_view wv on wv.id = wb.id " + "where wb.id = #{billId}") @AssociationMethod(value = 2, desc = "查询流程对应的表表名") String selectWorkflowTable(@ParamMapper("billId") String billId); @@ -56,7 +56,7 @@ public interface TriSubRequestAfterMapper { @Associations({ @Association( property = "modelTableInfo", - column = "model_table", + column = "MODEL_TABLE", select = "aiyh.utils.mapper.UtilMapper.selectModelTableInfo", id = @Id(value = Integer.class) ) @@ -87,19 +87,19 @@ public interface TriSubRequestAfterMapper { @Associations({ @Association( property = "modelField", - column = "model_field", + column = "MODEL_FIELD", select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo", id = @Id(value = Integer.class) ), @Association( property = "workflowField", - column = "workflow_field", + column = "WORKFLOW_FIELD", select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo", id = @Id(value = Integer.class) ), @Association( property = "mainWorkflowField", - column = "main_workflow_field", + column = "MAIN_WORKFLOW_FIELD", select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo", id = @Id(value = Integer.class) ) @@ -117,19 +117,19 @@ public interface TriSubRequestAfterMapper { @Associations({ @Association( property = "modelField", - column = "model_field", + column = "MODEL_FIELD", select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo", id = @Id(value = Integer.class) ), @Association( property = "workflowField", - column = "workflow_field", + column = "WORKFLOW_FIELD", select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo", id = @Id(value = Integer.class) ), @Association( property = "mainWorkflowField", - column = "main_workflow_field", + column = "MAIN_WORKFLOW_FIELD", select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo", id = @Id(value = Integer.class) ) @@ -143,7 +143,7 @@ public interface TriSubRequestAfterMapper { * @param requestId 请求id * @return 流程数据 */ - @Select("select $t{tableName} where requestid = #{requestId}") + @Select("select * from $t{tableName} where requestid = #{requestId}") Map selectWorkflowData(@ParamMapper("tableName") String tableName, @ParamMapper("requestId") String requestId); /** @@ -164,7 +164,7 @@ public interface TriSubRequestAfterMapper { * @param data 子流程数据 * @return 流程数据 */ - @Select("select * from $t{tableName} where $t{conditionUpdate}") + @Select("select id from $t{tableName} where $t{conditionUpdate}") String selectModelId( @ParamMapper("conditionUpdate") String conditionUpdate, @ParamMapper("tableName") String tableName, @@ -177,6 +177,7 @@ public interface TriSubRequestAfterMapper { * * @param updateSql 自定义sql * @param updateMap 更新值 + * @return 是否更新成功 */ @Update(custom = true) boolean updateModelData(@SqlString String updateSql, Map updateMap); @@ -189,4 +190,17 @@ public interface TriSubRequestAfterMapper { */ @Select("select WORKFLOWID from workflow_requestbase where requestid = #{requestId}") String selectWorkflowId(@ParamMapper("requestId") int i); + + /** + *

查询自定义sql

+ * + * @param customerValue 自定义值 + * @param mainRequestData 主流程数据 + * @param data 子流程数据 + * @return 查询值 + */ + @Select(custom = true) + String selectCustomerSql(@SqlString String customerValue, + @ParamMapper("main") Map mainRequestData, + @ParamMapper("sub") Map data); } diff --git a/src/main/java/ln/LNParse.java b/src/main/java/ln/LNParse.java new file mode 100644 index 0000000..dcf9993 --- /dev/null +++ b/src/main/java/ln/LNParse.java @@ -0,0 +1,88 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package ln; + +import org.apache.commons.codec.binary.Base64; +import org.json.JSONObject; + +import java.security.InvalidKeyException; + +public class LNParse { + public LNParse() { + } + + public LNBean getLNBean(String licensefilepath, String key) throws Exception { + byte[] licenseFile = Zip.getZipSomeByte(licensefilepath, "license"); + byte[] publicKey = Zip.getZipSomeByte(licensefilepath, "publicKey"); + byte[] licenseEncryptKey = Zip.getZipSomeByte(licensefilepath, "licenseEncryptKey"); + byte[] licenseFile2 = Zip.getZipSomeByte(licensefilepath, "license2"); + String realPublicKey = ""; + if ("emessage2".equals(key)) { + realPublicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIJWRm0eoQNEgZB9aUlM1PoT0N7cKCBCfkecycpeKeg57e73Fcj4ik9uYrGB01t38ut45iHJi8TLoeORYuUAhWUCAwEAAQ=="; + } else if (!"ecology7".equals(key) && !"ecology8".equals(key)) { + if ("ecology9".equals(key)) { + realPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyC90YpaWPbLaQwqt3TYlRqYC+gDTivXiVU2ZnL+tVop7tm1Ss8gnXnkd1I0jr2ffQK6m4HIGdz4lyxOfJVuT9hwtDpnflxK5fBIpc6N5iB3bZkes3XMJTyXY+afvh7vKf9yW0p1ZgQkMp7Ty4nRNQ1H/JV7RIUohEM24udiZNZySLpIYeAxTl8gR/EKL/YCIxBQfFEyQtijB0+X6Sfd/CWgNGVPuPr8V5nUZm8vXIszWBSPamD/yfvwNI9PAOII7OBNMXOC9BFAjTdCKkxdRS4ovu2V9STxAu0P8hhTnH0/zpxi4VOn32povh4f5J7x5eV+vSaN5G1G1zVPs5lc62QIDAQAB"; + } + } else { + realPublicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALUgEZ7eGZmJJM/3Ajj5Zdd2MG1ZONVybJV+v+jQT+csNWBBqxosLVlWvwaod1ix8Gg9GsyRJgoTs1Mg25raZcsCAwEAAQ=="; + } + + String publicKeyStr = new String(Base64.encodeBase64(publicKey)); + if (!realPublicKey.equals(publicKeyStr)) { + throw new Exception("license error!"); + } else { + JSONObject jsonLicense; + try { + byte[] licenseKey = RSACoder.decryptByPublicKey(licenseEncryptKey, publicKey); + jsonLicense = new JSONObject(new String(DESCoder.decrypt(licenseFile, licenseKey), "GBK")); + } catch (InvalidKeyException var15) { + var15.printStackTrace(); + byte[] licenseInfo2 = DESCoder.decrypt(licenseFile2, key.getBytes()); + jsonLicense = new JSONObject(new String(licenseInfo2)); + } + + LNBean lnb = new LNBean(); + lnb.setCompanyname(jsonLicense.getString("companyname")); + lnb.setLicensecode(jsonLicense.getString("licensecode")); + lnb.setHrmnum(jsonLicense.getString("hrmnum")); + // lnb.setExpiredate(jsonLicense.getString("expiredate")); + lnb.setExpiredate("2222-12-31"); + lnb.setConcurrentFlag(jsonLicense.getString("concurrentFlag")); + lnb.setLicense(jsonLicense.getString("license")); + + try { + lnb.setCid(jsonLicense.getString("cid")); + } catch (Exception var14) { + System.out.println(var14); + } + + try { + lnb.setScType(jsonLicense.getString("scType")); + } catch (Exception var13) { + System.out.println(var13); + } + + try { + lnb.setScCount(jsonLicense.getString("scCount")); + } catch (Exception var12) { + System.out.println(var12); + } + + return lnb; + } + } + + public boolean checkLicesne(LNBean lnb) { + boolean returnValue = false; + String src = lnb.getCompanyname() + lnb.getLicensecode() + "ALL" + lnb.getHrmnum() + lnb.getExpiredate() + lnb.getConcurrentFlag(); + MD5 md5 = new MD5(); + if (lnb.getLicense().equals(md5.getMD5ofStr(src))) { + returnValue = true; + } + + return returnValue; + } +} diff --git a/src/main/java/weaver/youhong/ai/geerde/action/submitfirst/AutoSubmitFirstNewAction.java b/src/main/java/weaver/youhong/ai/geerde/action/submitfirst/AutoSubmitFirstNewAction.java new file mode 100644 index 0000000..b72b303 --- /dev/null +++ b/src/main/java/weaver/youhong/ai/geerde/action/submitfirst/AutoSubmitFirstNewAction.java @@ -0,0 +1,127 @@ +package weaver.youhong.ai.geerde.action.submitfirst; + +import aiyh.utils.Util; +import aiyh.utils.action.SafeCusBaseAction; +import aiyh.utils.annotation.*; +import aiyh.utils.tool.cn.hutool.core.util.StrUtil; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import weaver.hrm.User; +import weaver.soa.workflow.request.RequestInfo; +import weaver.soa.workflow.request.RequestService; +import weaver.youhong.ai.geerde.action.submitfirst.mapper.AutoSubmitFirstMapper; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + *

自动提交第一次经过节点的流程

+ * + *

create: 2023/5/17 18:52

+ * + * @author youHong.ai + */ +@Getter +@Setter +@ToString +@ActionDesc(author = "youhong.ai", value = "自动流程提交,需要挂在需要提交的流程节点的节点前或者前一个节点的节点后或者两个节点的流转出口线上") +public class AutoSubmitFirstNewAction extends SafeCusBaseAction { + + private final AutoSubmitFirstMapper mapper = Util.getMapper(AutoSubmitFirstMapper.class); + + @RequiredMark(value = "account", desc = "主表流程经过标识字段,整数或单行文本字段名都可以") + @PrintParamMark + @ActionDefaultTestValue("account") + private String accountField; + + @ActionOptionalParam(value = "1", desc = "流程操作人id,默认为1-系统管理员") + @PrintParamMark + private String operator = "1"; + + private static final Map oneRequestLock = new ConcurrentHashMap<>(); + + @Override + @SuppressWarnings("all") + public void doSubmit(String requestId, String billTable, + int workflowId, User user, + RequestInfo requestInfo) { + // 如果存在当前流程id的值,表示当前action属于锁住状态,需要进入线程睡眠等待 + if (oneRequestLock.containsKey(requestId)) { + log.info("流程正在异步提交中,使用线程排队"); + new Thread(() -> { + log.info("开始异步等待上一个节点提交"); + while (oneRequestLock.containsKey(requestId)) { + try { + Thread.sleep(1000L * 60 * oneRequestLock.get(requestId)); + } catch (InterruptedException e) { + log.error("线程休眠失败!"); + throw new RuntimeException(e); + } + } + log.info("开始提交流程!"); + oneRequestLock.put(requestId, 2); + Map mainMap = mapper.selectMainMap(billTable, requestId); + String currentNode = mapper.selectCurrentNodeId(requestId); + if (mainMap.containsKey(accountField)) { + String mark = Util.null2String(mainMap.get(accountField)); + String nodesStr = currentNode; + if (StrUtil.isNotBlank(mark)) { + String[] split = mark.split(","); + List nodes = Arrays.asList(split); + if (nodes.contains(currentNode)) { + return; + } + nodesStr += "," + Util.join(nodes, ","); + } + int creatorId = requestInfo.getRequestManager().getCreater(); + String finalNodesStr = nodesStr; + RequestService requestService = new RequestService(); + // requestService.setSubmitToNodeid(); + Util.submitWorkflowThread(Integer.parseInt(requestId), creatorId, + "", 60, flag -> { + oneRequestLock.remove(requestId); + if (flag) { + mapper.updateMark(billTable, accountField, finalNodesStr, + Util.null2String(mainMap.get("id"))); + } + }); + } + }).start(); + return; + } + // 如果没有锁住,异步延时提交,延时3分钟 + log.info("没有锁住流程,开始异步提交流程"); + oneRequestLock.put(requestId, 2); + Map mainTableValue = getMainTableValue(requestInfo); + String currentNode = mapper.selectCurrentNodeId(requestId); + int creatorId = requestInfo.getRequestManager().getCreater(); + // 判断是否存在统计字段 + if (mainTableValue.containsKey(accountField)) { + // 获取统计字段的值 + String mark = mainTableValue.get(accountField); + String nodesStr = currentNode; + if (StrUtil.isNotBlank(mark)) { + String[] split = mark.split(","); + List nodes = Arrays.asList(split); + if (nodes.contains(currentNode)) { + return; + } + nodesStr += "," + Util.join(nodes, ","); + } + String finalNodesStr = nodesStr; + Util.submitWorkflowThread(Integer.parseInt(requestId), creatorId, + "", 60, flag -> { + oneRequestLock.remove(requestId); + if (flag) { + log.info("异步提交流程完成!"); + // 提交成功,更新标识 + mapper.updateMark(billTable, accountField, finalNodesStr, + mainTableValue.get("id")); + } + }); + } + } +} diff --git a/src/main/java/weaver/youhong/ai/intellectualproperty/util/OFDReader.java b/src/main/java/weaver/youhong/ai/intellectualproperty/util/OFDReader.java index 02bc6e1..819e76a 100644 --- a/src/main/java/weaver/youhong/ai/intellectualproperty/util/OFDReader.java +++ b/src/main/java/weaver/youhong/ai/intellectualproperty/util/OFDReader.java @@ -124,7 +124,7 @@ public class OFDReader { keywordInfos.add(keywordNode); break; } - startK = j; + startK = k; startNode = createKeywordNode(pageFolder, keywordInfos, textNode); break; } diff --git a/src/main/resources/cus_getlog/index.jsp b/src/main/resources/cus_getlog/index.jsp index 175d1bf..a34e9d9 100755 --- a/src/main/resources/cus_getlog/index.jsp +++ b/src/main/resources/cus_getlog/index.jsp @@ -160,11 +160,11 @@ - + - - - + + +