修改获取cus日志修改

jingwei
youhong.ai 2023-06-09 17:03:23 +08:00
parent cf0af8919e
commit 1c4fe8709d
24 changed files with 743 additions and 153 deletions

View File

@ -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){

View File

@ -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 ******************* */

View File

@ -4053,6 +4053,14 @@ public class Util extends weaver.general.Util {
return filePath;
}
/**
* <h2></h2>
*
* @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;
}
/**
* <h2></h2>
*
* @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();

View File

@ -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!");

View File

@ -44,6 +44,33 @@ public interface TaskElementMapper {
})
List<IhgTaskElementConfigItem> selectConfig();
/**
* <h2></h2>
*
* @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<IhgTaskElementConfigItem> selectConfigByGroup(@ParamMapper("itemGroup") String itemGroup);
/**
* <h2> </h2>
*
@ -121,4 +148,6 @@ public interface TaskElementMapper {
*/
@Select(custom = true)
String selectConvert(@SqlString String sql, @ParamMapper("value") String o);
}

View File

@ -48,8 +48,13 @@ public class TaskElementService {
return config;
}
public List<IhgTaskElementVo> getList(User user) {
List<IhgTaskElementConfigItem> ihgTaskElementConfItemList = mapper.selectConfig();
public List<IhgTaskElementVo> getList(User user,String itemGroup) {
List<IhgTaskElementConfigItem> ihgTaskElementConfItemList = null;
if (StrUtil.isBlank(itemGroup)) {
ihgTaskElementConfItemList = mapper.selectConfig();
}else {
ihgTaskElementConfItemList = mapper.selectConfigByGroup(itemGroup);
}
if (CollectionUtil.isEmpty(ihgTaskElementConfItemList)) {
return Collections.emptyList();
}

View File

@ -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;
/**
* <h1></h1>
*
* <p>create: 2023/6/7 13:45</p>
*
* @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");
}
}
}

View File

@ -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;
/**
* <h1></h1>
*
* <p>create: 2023/6/7 13:54</p>
*
* @author youHong.ai
*/
@SqlMapper
public interface PackingToWorkflowMapper {
/**
* <h2>id</h2>
*
* @param tableName
* @param ids id
* @return
*/
@Select("select * from $t{tableName} where id in ($t{ids})")
List<Map<String, Object>> selectDataList(@ParamMapper("tableName") String tableName,
@ParamMapper("ids") String ids);
}

View File

@ -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;
/**
* <h1></h1>
*
* <p>create: 2023/6/7 13:53</p>
*
* @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<Map<String, Object>> maps = mapper.selectDataList(table, ids);
if (CollectionUtil.isEmpty(maps)) {
return Collections.emptyList();
}
return maps;
}
}

View File

@ -119,21 +119,18 @@ public class InterceptRequestLogImpl extends AbstractServiceProxy implements Req
@Override
@ServiceMethodDynamicProxy(desc = "保存和提交流程时,判断是否开启隐私")
public Map<String, Object> requestSubmit(HttpServletRequest request) {
log.info("requestSubmit:=>");
return handlerRequestLogPrivacy(request);
}
@Override
@ServiceMethodDynamicProxy(desc = "转发流程、意见征询时,判断是否开启隐私")
public Map<String, Object> forwardSubmit(HttpServletRequest request) {
log.info("forwardSubmit:=>");
return handlerRequestLogPrivacy(request);
}
@Override
@ServiceMethodDynamicProxy(desc = "转发流程、意见征询时,判断是否开启隐私")
public Map<String, Object> remarkSubmit(HttpServletRequest request) {
log.info("remarkSubmit:=>");
return handlerRequestLogPrivacy(request);
}

View File

@ -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;

View File

@ -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<SubRequestToDataMapping> mappings;
/** 更新字段映射 */

View File

@ -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;
}

View File

@ -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;

View File

@ -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,7 +51,24 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem
}
@Override
@ServiceMethodDynamicProxy(desc = "子流程触发时,做流程转数据")
public void triSubRequestAfter(int i) {
try {
log.info("子流程触发后调用方法..............");
// 查询主流程数据信息
Map<String, Object> mainRequestData = mapper.selectRequestBase(Util.null2String(i));
RequestService requestService = new RequestService();
RequestInfo request = requestService.getRequest(i);
String tableName = request.getRequestManager().getBillTableName();
Map<String, Object> mainData = mapper.selectWorkflowData(tableName, Util.null2String(i));
if (Objects.nonNull(mainRequestData)) {
mainRequestData.putAll(mainData);
}
// 是否触发
String sffk = Util.null2String(mainRequestData.get("sffk"));
if (!"0".equals(sffk)) {
return;
}
// 查询所有的子流程
List<SubRequestEntity> subRequestEntities = mapper.selectSubRequestByMainRequest(i);
if (CollectionUtil.isEmpty(subRequestEntities)) {
@ -90,11 +108,12 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem
WorkflowBaseDataEntity::getRequestId,
value -> value
));
// 查询主流程数据信息
Map<String, Object> mainRequestData = mapper.selectRequestBase(Util.null2String(i));
for (SubRequestEntity subRequestEntity : subRequestEntities) {
// 根据workflowId获取配置信息
SubRequestToDataConfig subRequestToDataConfig = collect.get(subRequestEntity.getWorkflowId());
if (Objects.isNull(subRequestToDataConfig)) {
continue;
}
WorkflowBaseDataEntity workflowBaseDataEntity = requestDataMap.get(subRequestEntity.getRequestId());
Map<String, Object> data = workflowBaseDataEntity.getData();
String conditionUpdate = subRequestToDataConfig.getConditionUpdate();
@ -102,8 +121,8 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem
String modelId = "";
Map<String, Object> updateMap = null;
String id = "";
// 有更新条件,需要更新数据信息
if (StrUtil.isBlank(conditionUpdate)) {
// 有更新条件,需要更新数据信息
if (!StrUtil.isBlank(conditionUpdate)) {
modelId = mapper.selectModelId(conditionUpdate, modelTableInfo.getTableName(), mainRequestData, data);
id = modelId;
}
@ -115,19 +134,22 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem
// 没有数据,需要插入
List<SubRequestToDataMapping> mappings = subRequestToDataConfig.getMappings();
updateMap = tidyUpData(mappings, mainRequestData, data);
int modeDataId = Util.getModeDataId(subRequestToDataConfig.getModelTable(), 1);
int modeDataId = Util.getModeDataId(subRequestToDataConfig.getModelTableInfo().getTableName(), 1);
id = Util.null2String(modeDataId);
}
String updateSql = MapperBuilderSql.builderUpdateSql(subRequestToDataConfig.getModelTable(), updateMap);
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.getModelTable(), Integer.valueOf(id));
Util.rebuildModeDataShare(1, subRequestToDataConfig.getModelTableInfo().getTableName(), Integer.valueOf(id));
}
}
} catch (Exception e) {
log.error("流程转存数据执行失败!" + Util.getErrString(e));
}
}
/**
@ -146,6 +168,16 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem
for (SubRequestToDataMapping mapping : mappings) {
Integer dataSource = mapping.getDataSource();
Object value = null;
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());
@ -153,7 +185,29 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem
// 子流程数据
value = data.get(mapping.getWorkflowField().getFieldName());
}
result.put(mapping.getModelField().getTableName(), value);
}
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().getFieldName(), value);
}
return result;
}

View File

@ -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<String, Object> 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<String, Object> updateMap);
@ -189,4 +190,17 @@ public interface TriSubRequestAfterMapper {
*/
@Select("select WORKFLOWID from workflow_requestbase where requestid = #{requestId}")
String selectWorkflowId(@ParamMapper("requestId") int i);
/**
* <h2>sql</h2>
*
* @param customerValue
* @param mainRequestData
* @param data
* @return
*/
@Select(custom = true)
String selectCustomerSql(@SqlString String customerValue,
@ParamMapper("main") Map<String, Object> mainRequestData,
@ParamMapper("sub") Map<String, Object> data);
}

View File

@ -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;
}
}

View File

@ -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;
/**
* <h1></h1>
*
* <p>create: 2023/5/17 18:52</p>
*
* @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<String, Integer> 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<String, Object> 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<String> 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<String, String> 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<String> 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"));
}
});
}
}
}

View File

@ -124,7 +124,7 @@ public class OFDReader {
keywordInfos.add(keywordNode);
break;
}
startK = j;
startK = k;
startNode = createKeywordNode(pageFolder, keywordInfos, textNode);
break;
}

View File

@ -160,11 +160,11 @@
<html>
<head>
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="/getlog/css/index.css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/data.js"></script>
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/getlog/js/jquery.js"></script>
<script type="text/javascript" src="/getlog/js/data.js"></script>
<script type="text/javascript" src="/getlog/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(function () {
$("#downstartlogDate").val(new Date().format("yyyy-MM-dd"));

View File

@ -7,6 +7,9 @@ import com.alibaba.fastjson.JSONArray;
import com.api.youhong.ai.taibao.fcuntionlist.service.FunctionListService;
import com.api.youhong.ai.taibao.qikan.service.PeriodicalService;
import com.cloudstore.dev.api.util.Util_DataCache;
import com.customization.youhong.taibao.trisubreq.entity.SubRequestEntity;
import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataConfig;
import com.customization.youhong.taibao.trisubreq.mapper.TriSubRequestAfterMapper;
import com.engine.youhong.ai.taibao.email.BlackListRegister;
import com.engine.youhong.ai.taibao.email.mapper.InitBlackEmailListMapper;
import org.junit.Test;
@ -179,4 +182,15 @@ public class TestTaiBao extends BaseTest {
}
System.out.println(set);
}
@Test
public void testasdf() {
TriSubRequestAfterMapper mapper = Util.getMapper(TriSubRequestAfterMapper.class);
List<SubRequestToDataConfig> subRequestToDataConfigs = mapper.selectConfig("44");
System.out.println(JSON.toJSONString(subRequestToDataConfigs));
List<SubRequestEntity> subRequestEntities = mapper.selectSubRequestByMainRequest(562562);
System.out.println(JSON.toJSONString(subRequestEntities));
}
}

View File

@ -40,7 +40,7 @@ public class PDFODFTest extends BaseTest {
@Test
public void tesetOfdKeyWorkdasdf() throws Exception {
weaver.youhong.ai.intellectualproperty.util.OFDReader reader = new OFDReader("/Users/aoey.oct.22/Library/Containers/com.tencent.xinWeChat/Data/Library/Application Support/com.tencent.xinWeChat/2.0b4.0.9/44e92f459afe6c0b31d119efb268a257/Message/MessageTemp/65ac172b9cb23c7967462468b4b5be81/File/2b6319c0-3395-4a74-8062-07bc2089c607.ofd", "签章位置001");
weaver.youhong.ai.intellectualproperty.util.OFDReader reader = new OFDReader("/Users/aoey.oct.22/Downloads/关于《协助提供加强本市临床研究体系建设相关材料和政策清单的函》的回复.ofd", "@Signature_position@");
System.out.println(JSON.toJSONString(reader.findKeywords()));
}

View File

@ -1,6 +1,5 @@
-- 流程类型视图,可用于数据集成或流览按钮
create
or replace view workflow_type_info_view as
create or replace view workflow_type_info_view as
select wb.id,
wb.workflowname,
wt.typename,
@ -11,8 +10,7 @@ from workflow_base wb
/
-- 流程表单视图,用于流览按钮或数据集成,配置流程类型表可以用字段联动获取流程表表名
create
or replace view workflow_table_view as
create or replace view workflow_table_view as
select base.id,
base.workflowname,
base.formid,
@ -23,8 +21,7 @@ from workflow_bill bill
/
-- 流程明细表信息,可用流程主表查询对应的明细表信息,用于流览框
create
or replace view workflow_detail_table_view as
create or replace view workflow_detail_table_view as
select (bill.id || '-' || base.id) id,
bill.id bill_id,
base.id workflow_id,
@ -40,7 +37,8 @@ from workflow_billdetailtable bill
BEGIN
-- 判断表是否存在
FOR i IN (SELECT * FROM user_tables WHERE table_name = 'cus_workflow_base_field_assist') LOOP
FOR i IN (SELECT * FROM user_tables WHERE table_name = 'cus_workflow_base_field_assist')
LOOP
-- 存在则删除表
EXECUTE IMMEDIATE 'DROP TABLE cus_workflow_base_field_assist';
END LOOP;
@ -90,8 +88,7 @@ VALUES (-989, 'workflowid', '工作流idworkflowid', 'workflow_requestbase',
-- 创建试图
create
or replace view workflow_field_table_view as
create or replace view workflow_field_table_view as
select wb.id,
wb.fieldname,
(ht.indexdesc || '' || wb.fieldname) indexdesc,
@ -116,7 +113,8 @@ select wb.id,
when wb.FIELDHTMLTYPE = '3' then '流览框'
when wb.FIELDHTMLTYPE = '4' then 'check框'
when wb.FIELDHTMLTYPE = '5' then '选择框'
else '附件上传' end) fieldhtmltype
else '附件上传' end) fieldhtmltype,
wb.FIELDHTMLTYPE fieldtype
from workflow_billfield wb
left join htmllabelindex ht on wb.fieldlabel = ht.id
union all
@ -124,8 +122,7 @@ select *
from cus_workflow_base_field_assist /
-- 建模表信息视图
create
or replace view mode_bill_info_view as
create or replace view mode_bill_info_view as
select bill.id, bill.tablename, hti.indexdesc
from workflow_bill bill
left join htmllabelindex hti on hti.id = bill.namelabel
@ -133,8 +130,7 @@ where bill.id < 0
and bill.tablename like 'uf%'
/
-- 流程建模表信息
CREATE
or replace VIEW workflow_mode_table_view
CREATE or replace VIEW workflow_mode_table_view
AS
select bill.ID id,
bill.TABLENAME tablename,
@ -155,8 +151,7 @@ where ((bill.ID < 0) and (bill.TABLENAME like 'uf%'))
/
-- 流程节点信息视图
create
or replace view workflow_node_info_view as
create or replace view workflow_node_info_view as
select distinct nb.id,
nb.nodename,
(case when wb.version is null then 1 else wb.version end) version,

View File

@ -117,7 +117,8 @@ select wb.id,
when wb.FIELDHTMLTYPE = '3' then '流览框'
when wb.FIELDHTMLTYPE = '4' then 'check框'
when wb.FIELDHTMLTYPE = '5' then '选择框'
else '附件上传' end) fieldhtmltype
else '附件上传' end) fieldhtmltype,
wb.FIELDHTMLTYPE fieldtype
from workflow_billfield wb
left join htmllabelindex ht on wb.fieldlabel = ht.id
union all