修改获取cus日志修改
parent
cf0af8919e
commit
1c4fe8709d
|
@ -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) {
|
ModeList.dataLoadAfter = function (data) {
|
||||||
// 描述:在列表数据加载完,对列表的数据进行二次加工,并渲染。 dataLoadAfter传入dataHandle方法,用来接收并处理数据,dataHandle有两个参数。
|
// 描述:在列表数据加载完,对列表的数据进行二次加工,并渲染。 dataLoadAfter传入dataHandle方法,用来接收并处理数据,dataHandle有两个参数。
|
||||||
// var dataHandle = function(datas,displayType){
|
// var dataHandle = function(datas,displayType){
|
||||||
|
|
|
@ -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 ******************* */
|
|
@ -4053,6 +4053,14 @@ public class Util extends weaver.general.Util {
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>创建临时文件</h2>
|
||||||
|
*
|
||||||
|
* @param inputStream 文件流
|
||||||
|
* @param imageFileName 文件名
|
||||||
|
* @param tempDir 临时文件夹
|
||||||
|
* @return 文件路径
|
||||||
|
*/
|
||||||
public static String createTempFile(InputStream inputStream, String imageFileName, String tempDir) {
|
public static String createTempFile(InputStream inputStream, String imageFileName, String tempDir) {
|
||||||
String filePath = getTempFilePath(tempDir, imageFileName);
|
String filePath = getTempFilePath(tempDir, imageFileName);
|
||||||
try {
|
try {
|
||||||
|
@ -4063,6 +4071,13 @@ public class Util extends weaver.general.Util {
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>写入文件数据</h2>
|
||||||
|
*
|
||||||
|
* @param inputStream 文件流
|
||||||
|
* @param filePath 文件路径
|
||||||
|
* @throws IOException io异常
|
||||||
|
*/
|
||||||
public static void writeToFile(InputStream inputStream, String filePath) throws IOException {
|
public static void writeToFile(InputStream inputStream, String filePath) throws IOException {
|
||||||
Path path = Paths.get(filePath);
|
Path path = Paths.get(filePath);
|
||||||
Path parentDir = path.getParent();
|
Path parentDir = path.getParent();
|
||||||
|
|
|
@ -32,10 +32,11 @@ public class TaskElementController {
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Consumes(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);
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
try {
|
try {
|
||||||
return ApiResult.success(service.getList(user));
|
return ApiResult.success(service.getList(user,itemGroup));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("get task list error!\n" + Util.getErrString(e));
|
log.error("get task list error!\n" + Util.getErrString(e));
|
||||||
return ApiResult.error("system error!");
|
return ApiResult.error("system error!");
|
||||||
|
|
|
@ -44,6 +44,33 @@ public interface TaskElementMapper {
|
||||||
})
|
})
|
||||||
List<IhgTaskElementConfigItem> selectConfig();
|
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>
|
* <h2>查询配置信息 </h2>
|
||||||
*
|
*
|
||||||
|
@ -121,4 +148,6 @@ public interface TaskElementMapper {
|
||||||
*/
|
*/
|
||||||
@Select(custom = true)
|
@Select(custom = true)
|
||||||
String selectConvert(@SqlString String sql, @ParamMapper("value") String o);
|
String selectConvert(@SqlString String sql, @ParamMapper("value") String o);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,13 @@ public class TaskElementService {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IhgTaskElementVo> getList(User user) {
|
public List<IhgTaskElementVo> getList(User user,String itemGroup) {
|
||||||
List<IhgTaskElementConfigItem> ihgTaskElementConfItemList = mapper.selectConfig();
|
List<IhgTaskElementConfigItem> ihgTaskElementConfItemList = null;
|
||||||
|
if (StrUtil.isBlank(itemGroup)) {
|
||||||
|
ihgTaskElementConfItemList = mapper.selectConfig();
|
||||||
|
}else {
|
||||||
|
ihgTaskElementConfItemList = mapper.selectConfigByGroup(itemGroup);
|
||||||
|
}
|
||||||
if (CollectionUtil.isEmpty(ihgTaskElementConfItemList)) {
|
if (CollectionUtil.isEmpty(ihgTaskElementConfItemList)) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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);
|
||||||
|
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -119,21 +119,18 @@ public class InterceptRequestLogImpl extends AbstractServiceProxy implements Req
|
||||||
@Override
|
@Override
|
||||||
@ServiceMethodDynamicProxy(desc = "保存和提交流程时,判断是否开启隐私")
|
@ServiceMethodDynamicProxy(desc = "保存和提交流程时,判断是否开启隐私")
|
||||||
public Map<String, Object> requestSubmit(HttpServletRequest request) {
|
public Map<String, Object> requestSubmit(HttpServletRequest request) {
|
||||||
log.info("requestSubmit:=>");
|
|
||||||
return handlerRequestLogPrivacy(request);
|
return handlerRequestLogPrivacy(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ServiceMethodDynamicProxy(desc = "转发流程、意见征询时,判断是否开启隐私")
|
@ServiceMethodDynamicProxy(desc = "转发流程、意见征询时,判断是否开启隐私")
|
||||||
public Map<String, Object> forwardSubmit(HttpServletRequest request) {
|
public Map<String, Object> forwardSubmit(HttpServletRequest request) {
|
||||||
log.info("forwardSubmit:=>");
|
|
||||||
return handlerRequestLogPrivacy(request);
|
return handlerRequestLogPrivacy(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ServiceMethodDynamicProxy(desc = "转发流程、意见征询时,判断是否开启隐私")
|
@ServiceMethodDynamicProxy(desc = "转发流程、意见征询时,判断是否开启隐私")
|
||||||
public Map<String, Object> remarkSubmit(HttpServletRequest request) {
|
public Map<String, Object> remarkSubmit(HttpServletRequest request) {
|
||||||
log.info("remarkSubmit:=>");
|
|
||||||
return handlerRequestLogPrivacy(request);
|
return handlerRequestLogPrivacy(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
|
@ -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 aiyh.utils.entity.ModelTableInfo;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
@ -22,19 +23,23 @@ public class SubRequestToDataConfig {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
/** 流程 */
|
/** 流程 */
|
||||||
|
@SqlOracleDbFieldAnn("WORKFLOW_TYPE")
|
||||||
private String workflowType;
|
private String workflowType;
|
||||||
|
|
||||||
/** 子流程 */
|
/** 子流程 */
|
||||||
|
@SqlOracleDbFieldAnn("WORKFLOW_TYPE_1")
|
||||||
private String workflowType1;
|
private String workflowType1;
|
||||||
/** 建模 */
|
/** 建模 */
|
||||||
|
@SqlOracleDbFieldAnn("MODEL_TABLE")
|
||||||
private String modelTable;
|
private String modelTable;
|
||||||
/** 更新条件 */
|
/** 更新条件 */
|
||||||
|
@SqlOracleDbFieldAnn("CONDITION_UPDATE")
|
||||||
private String conditionUpdate;
|
private String conditionUpdate;
|
||||||
|
|
||||||
/** 建模表 */
|
/** 建模表 */
|
||||||
|
@SqlOracleDbFieldAnn("MODEL_TABLE_INFO")
|
||||||
private ModelTableInfo modelTableInfo;
|
private ModelTableInfo modelTableInfo;
|
||||||
/** 插入字段映射 */
|
/** 插入字段映射 */
|
||||||
|
|
||||||
private List<SubRequestToDataMapping> mappings;
|
private List<SubRequestToDataMapping> mappings;
|
||||||
|
|
||||||
/** 更新字段映射 */
|
/** 更新字段映射 */
|
|
@ -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.SqlDbFieldAnn;
|
||||||
|
import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
|
||||||
import aiyh.utils.entity.FieldViewInfo;
|
import aiyh.utils.entity.FieldViewInfo;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
@ -19,7 +20,7 @@ import lombok.ToString;
|
||||||
public class SubRequestToDataMapping {
|
public class SubRequestToDataMapping {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@SqlDbFieldAnn("mainid")
|
@SqlDbFieldAnn("MAINID")
|
||||||
private Integer mainId;
|
private Integer mainId;
|
||||||
|
|
||||||
/** 建模字段 */
|
/** 建模字段 */
|
||||||
|
@ -31,5 +32,15 @@ public class SubRequestToDataMapping {
|
||||||
private FieldViewInfo mainWorkflowField;
|
private FieldViewInfo mainWorkflowField;
|
||||||
|
|
||||||
/** 数据来源 */
|
/** 数据来源 */
|
||||||
|
@SqlOracleDbFieldAnn("DATA_SOURCE")
|
||||||
private Integer dataSource;
|
private Integer dataSource;
|
||||||
|
|
||||||
|
|
||||||
|
/** 转换规则 */
|
||||||
|
@SqlOracleDbFieldAnn("RULES_TYPE")
|
||||||
|
private Integer rulesType;
|
||||||
|
|
||||||
|
/** 自定义值 */
|
||||||
|
@SqlOracleDbFieldAnn("CUSTOMER_VALUE")
|
||||||
|
private String customerValue;
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.customization.youhong.taibao.trisubreq.impl.entity;
|
package com.customization.youhong.taibao.trisubreq.entity;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
|
@ -6,23 +6,24 @@ import aiyh.utils.excention.CustomerException;
|
||||||
import aiyh.utils.recordset.MapperBuilderSql;
|
import aiyh.utils.recordset.MapperBuilderSql;
|
||||||
import aiyh.utils.tool.cn.hutool.core.collection.CollectionUtil;
|
import aiyh.utils.tool.cn.hutool.core.collection.CollectionUtil;
|
||||||
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
|
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
|
||||||
import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestEntity;
|
import com.customization.youhong.taibao.trisubreq.entity.SubRequestEntity;
|
||||||
import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestToDataConfig;
|
import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataConfig;
|
||||||
import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestToDataMapping;
|
import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataMapping;
|
||||||
import com.customization.youhong.taibao.trisubreq.impl.entity.WorkflowBaseDataEntity;
|
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.ServiceDynamicProxy;
|
||||||
|
import com.engine.core.cfg.annotation.ServiceMethodDynamicProxy;
|
||||||
import com.engine.core.impl.aop.AbstractServiceProxy;
|
import com.engine.core.impl.aop.AbstractServiceProxy;
|
||||||
import com.engine.workflow.service.SubRequestService;
|
import com.engine.workflow.service.SubRequestService;
|
||||||
import com.engine.workflow.service.impl.SubRequestServiceImpl;
|
import com.engine.workflow.service.impl.SubRequestServiceImpl;
|
||||||
import ebu7common.youhong.ai.bean.Builder;
|
import ebu7common.youhong.ai.bean.Builder;
|
||||||
import org.apache.log4j.Logger;
|
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.DiffWfTriggerSetting;
|
||||||
import weaver.workflow.request.SameWfTriggerSetting;
|
import weaver.workflow.request.SameWfTriggerSetting;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +33,7 @@ import java.util.stream.Collectors;
|
||||||
*
|
*
|
||||||
* @author youHong.ai
|
* @author youHong.ai
|
||||||
*/
|
*/
|
||||||
@ServiceDynamicProxy(target = SubRequestServiceImpl.class, desc = "拦截签字意见信息,是否需要隐私控制")
|
@ServiceDynamicProxy(target = SubRequestServiceImpl.class, desc = "子流程触发后调用方法,设置流程数据转存")
|
||||||
public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implements SubRequestService {
|
public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implements SubRequestService {
|
||||||
|
|
||||||
private final TriSubRequestAfterMapper mapper = Util.getMapper(TriSubRequestAfterMapper.class);
|
private final TriSubRequestAfterMapper mapper = Util.getMapper(TriSubRequestAfterMapper.class);
|
||||||
|
@ -50,83 +51,104 @@ public class TriSubRequestAfterInterceptImpl extends AbstractServiceProxy implem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ServiceMethodDynamicProxy(desc = "子流程触发时,做流程转数据")
|
||||||
public void triSubRequestAfter(int i) {
|
public void triSubRequestAfter(int i) {
|
||||||
// 查询所有的子流程
|
try {
|
||||||
List<SubRequestEntity> subRequestEntities = mapper.selectSubRequestByMainRequest(i);
|
log.info("子流程触发后调用方法..............");
|
||||||
if (CollectionUtil.isEmpty(subRequestEntities)) {
|
// 查询主流程数据信息
|
||||||
return;
|
Map<String, Object> mainRequestData = mapper.selectRequestBase(Util.null2String(i));
|
||||||
}
|
RequestService requestService = new RequestService();
|
||||||
String mainWorkflowId = mapper.selectWorkflowId(i);
|
RequestInfo request = requestService.getRequest(i);
|
||||||
// 查询配置信息
|
String tableName = request.getRequestManager().getBillTableName();
|
||||||
List<SubRequestToDataConfig> subRequestToDataConfigs = mapper.selectConfig(mainWorkflowId);
|
Map<String, Object> mainData = mapper.selectWorkflowData(tableName, Util.null2String(i));
|
||||||
if (CollectionUtil.isEmpty(subRequestToDataConfigs)) {
|
if (Objects.nonNull(mainRequestData)) {
|
||||||
return;
|
mainRequestData.putAll(mainData);
|
||||||
}
|
|
||||||
// 按照流程类型分组,主要作用于不同流程的触发操作
|
|
||||||
Map<String, SubRequestToDataConfig> collect = subRequestToDataConfigs
|
|
||||||
.stream()
|
|
||||||
.collect(
|
|
||||||
Collectors.toMap(
|
|
||||||
SubRequestToDataConfig::getWorkflowType,
|
|
||||||
value -> value
|
|
||||||
));
|
|
||||||
// 查询出所有子流程的数据信息
|
|
||||||
List<WorkflowBaseDataEntity> requestDataList = new ArrayList<>();
|
|
||||||
for (SubRequestEntity subRequestEntity : subRequestEntities) {
|
|
||||||
// 查询流程对应的配置信息
|
|
||||||
Map<String, Object> 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<String, WorkflowBaseDataEntity> requestDataMap = requestDataList.stream().collect(Collectors.toMap(
|
|
||||||
WorkflowBaseDataEntity::getRequestId,
|
|
||||||
value -> value
|
|
||||||
));
|
|
||||||
// 查询主流程数据信息
|
|
||||||
Map<String, Object> mainRequestData = mapper.selectRequestBase(Util.null2String(i));
|
|
||||||
for (SubRequestEntity subRequestEntity : subRequestEntities) {
|
|
||||||
// 根据workflowId获取配置信息
|
|
||||||
SubRequestToDataConfig subRequestToDataConfig = collect.get(subRequestEntity.getWorkflowId());
|
|
||||||
WorkflowBaseDataEntity workflowBaseDataEntity = requestDataMap.get(subRequestEntity.getRequestId());
|
|
||||||
Map<String, Object> data = workflowBaseDataEntity.getData();
|
|
||||||
String conditionUpdate = subRequestToDataConfig.getConditionUpdate();
|
|
||||||
ModelTableInfo modelTableInfo = subRequestToDataConfig.getModelTableInfo();
|
|
||||||
String modelId = "";
|
|
||||||
Map<String, Object> updateMap = null;
|
|
||||||
String id = "";
|
|
||||||
// 没有更新条件,不需要更新数据信息
|
|
||||||
if (StrUtil.isBlank(conditionUpdate)) {
|
|
||||||
modelId = mapper.selectModelId(conditionUpdate, modelTableInfo.getTableName(), mainRequestData, data);
|
|
||||||
id = modelId;
|
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(modelId)) {
|
// 是否触发
|
||||||
// 查询到数据,需要更新数据信息
|
String sffk = Util.null2String(mainRequestData.get("sffk"));
|
||||||
List<SubRequestToDataMapping> updateMappings = subRequestToDataConfig.getUpdateMappings();
|
if (!"0".equals(sffk)) {
|
||||||
updateMap = tidyUpData(updateMappings, mainRequestData, data);
|
return;
|
||||||
} else {
|
|
||||||
// 没有数据,需要插入
|
|
||||||
List<SubRequestToDataMapping> mappings = subRequestToDataConfig.getMappings();
|
|
||||||
updateMap = tidyUpData(mappings, mainRequestData, data);
|
|
||||||
int modeDataId = Util.getModeDataId(subRequestToDataConfig.getModelTable(), 1);
|
|
||||||
id = Util.null2String(modeDataId);
|
|
||||||
}
|
}
|
||||||
String updateSql = MapperBuilderSql.builderUpdateSql(subRequestToDataConfig.getModelTable(), updateMap);
|
// 查询所有的子流程
|
||||||
updateSql += " where id = #{id}";
|
List<SubRequestEntity> subRequestEntities = mapper.selectSubRequestByMainRequest(i);
|
||||||
updateMap.put("id", id);
|
if (CollectionUtil.isEmpty(subRequestEntities)) {
|
||||||
boolean flag = mapper.updateModelData(updateSql, updateMap);
|
return;
|
||||||
if (!flag) {
|
|
||||||
log.info("流程转数据数据信息更新失败!" + updateSql);
|
|
||||||
} else {
|
|
||||||
Util.rebuildModeDataShare(1, subRequestToDataConfig.getModelTable(), Integer.valueOf(id));
|
|
||||||
}
|
}
|
||||||
|
String mainWorkflowId = mapper.selectWorkflowId(i);
|
||||||
|
// 查询配置信息
|
||||||
|
List<SubRequestToDataConfig> subRequestToDataConfigs = mapper.selectConfig(mainWorkflowId);
|
||||||
|
if (CollectionUtil.isEmpty(subRequestToDataConfigs)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 按照流程类型分组,主要作用于不同流程的触发操作
|
||||||
|
Map<String, SubRequestToDataConfig> collect = subRequestToDataConfigs
|
||||||
|
.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
SubRequestToDataConfig::getWorkflowType,
|
||||||
|
value -> value
|
||||||
|
));
|
||||||
|
// 查询出所有子流程的数据信息
|
||||||
|
List<WorkflowBaseDataEntity> requestDataList = new ArrayList<>();
|
||||||
|
for (SubRequestEntity subRequestEntity : subRequestEntities) {
|
||||||
|
// 查询流程对应的配置信息
|
||||||
|
Map<String, Object> 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<String, WorkflowBaseDataEntity> 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<String, Object> data = workflowBaseDataEntity.getData();
|
||||||
|
String conditionUpdate = subRequestToDataConfig.getConditionUpdate();
|
||||||
|
ModelTableInfo modelTableInfo = subRequestToDataConfig.getModelTableInfo();
|
||||||
|
String modelId = "";
|
||||||
|
Map<String, Object> updateMap = null;
|
||||||
|
String id = "";
|
||||||
|
// 有更新条件,需要更新数据信息
|
||||||
|
if (!StrUtil.isBlank(conditionUpdate)) {
|
||||||
|
modelId = mapper.selectModelId(conditionUpdate, modelTableInfo.getTableName(), mainRequestData, data);
|
||||||
|
id = modelId;
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(modelId)) {
|
||||||
|
// 查询到数据,需要更新数据信息
|
||||||
|
List<SubRequestToDataMapping> updateMappings = subRequestToDataConfig.getUpdateMappings();
|
||||||
|
updateMap = tidyUpData(updateMappings, mainRequestData, data);
|
||||||
|
} else {
|
||||||
|
// 没有数据,需要插入
|
||||||
|
List<SubRequestToDataMapping> 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) {
|
for (SubRequestToDataMapping mapping : mappings) {
|
||||||
Integer dataSource = mapping.getDataSource();
|
Integer dataSource = mapping.getDataSource();
|
||||||
Object value = null;
|
Object value = null;
|
||||||
if (dataSource == 0) {
|
Integer rulesType = mapping.getRulesType();
|
||||||
// 主流程数据
|
String customerValue = mapping.getCustomerValue();
|
||||||
value = mainRequestData.get(mapping.getMainWorkflowField().getFieldName());
|
switch (rulesType) {
|
||||||
} else {
|
case 0:
|
||||||
// 子流程数据
|
// 固定值
|
||||||
value = data.get(mapping.getWorkflowField().getFieldName());
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.customization.youhong.taibao.trisubreq.impl;
|
package com.customization.youhong.taibao.trisubreq.mapper;
|
||||||
|
|
||||||
import aiyh.utils.annotation.recordset.*;
|
import aiyh.utils.annotation.recordset.*;
|
||||||
import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestEntity;
|
import com.customization.youhong.taibao.trisubreq.entity.SubRequestEntity;
|
||||||
import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestToDataConfig;
|
import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataConfig;
|
||||||
import com.customization.youhong.taibao.trisubreq.impl.entity.SubRequestToDataMapping;
|
import com.customization.youhong.taibao.trisubreq.entity.SubRequestToDataMapping;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -29,7 +29,7 @@ public interface TriSubRequestAfterMapper {
|
||||||
@Associations({
|
@Associations({
|
||||||
@Association(
|
@Association(
|
||||||
property = "workflowTable",
|
property = "workflowTable",
|
||||||
column = "workflowid",
|
column = "workflow_id",
|
||||||
id = @Id(value = String.class, methodId = 2)
|
id = @Id(value = String.class, methodId = 2)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -41,8 +41,8 @@ public interface TriSubRequestAfterMapper {
|
||||||
* @param billId 流程表id
|
* @param billId 流程表id
|
||||||
* @return 流程表
|
* @return 流程表
|
||||||
*/
|
*/
|
||||||
@Select("select tablename workflow_table from workflow_base wb\n" +
|
@Select("select tablename workflow_table from workflow_base wb " +
|
||||||
"inner join workflow_table_view wv on wv.id = wb.id\n" +
|
"inner join workflow_table_view wv on wv.id = wb.id " +
|
||||||
"where wb.id = #{billId}")
|
"where wb.id = #{billId}")
|
||||||
@AssociationMethod(value = 2, desc = "查询流程对应的表表名")
|
@AssociationMethod(value = 2, desc = "查询流程对应的表表名")
|
||||||
String selectWorkflowTable(@ParamMapper("billId") String billId);
|
String selectWorkflowTable(@ParamMapper("billId") String billId);
|
||||||
|
@ -56,7 +56,7 @@ public interface TriSubRequestAfterMapper {
|
||||||
@Associations({
|
@Associations({
|
||||||
@Association(
|
@Association(
|
||||||
property = "modelTableInfo",
|
property = "modelTableInfo",
|
||||||
column = "model_table",
|
column = "MODEL_TABLE",
|
||||||
select = "aiyh.utils.mapper.UtilMapper.selectModelTableInfo",
|
select = "aiyh.utils.mapper.UtilMapper.selectModelTableInfo",
|
||||||
id = @Id(value = Integer.class)
|
id = @Id(value = Integer.class)
|
||||||
)
|
)
|
||||||
|
@ -87,19 +87,19 @@ public interface TriSubRequestAfterMapper {
|
||||||
@Associations({
|
@Associations({
|
||||||
@Association(
|
@Association(
|
||||||
property = "modelField",
|
property = "modelField",
|
||||||
column = "model_field",
|
column = "MODEL_FIELD",
|
||||||
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
||||||
id = @Id(value = Integer.class)
|
id = @Id(value = Integer.class)
|
||||||
),
|
),
|
||||||
@Association(
|
@Association(
|
||||||
property = "workflowField",
|
property = "workflowField",
|
||||||
column = "workflow_field",
|
column = "WORKFLOW_FIELD",
|
||||||
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
||||||
id = @Id(value = Integer.class)
|
id = @Id(value = Integer.class)
|
||||||
),
|
),
|
||||||
@Association(
|
@Association(
|
||||||
property = "mainWorkflowField",
|
property = "mainWorkflowField",
|
||||||
column = "main_workflow_field",
|
column = "MAIN_WORKFLOW_FIELD",
|
||||||
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
||||||
id = @Id(value = Integer.class)
|
id = @Id(value = Integer.class)
|
||||||
)
|
)
|
||||||
|
@ -117,19 +117,19 @@ public interface TriSubRequestAfterMapper {
|
||||||
@Associations({
|
@Associations({
|
||||||
@Association(
|
@Association(
|
||||||
property = "modelField",
|
property = "modelField",
|
||||||
column = "model_field",
|
column = "MODEL_FIELD",
|
||||||
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
||||||
id = @Id(value = Integer.class)
|
id = @Id(value = Integer.class)
|
||||||
),
|
),
|
||||||
@Association(
|
@Association(
|
||||||
property = "workflowField",
|
property = "workflowField",
|
||||||
column = "workflow_field",
|
column = "WORKFLOW_FIELD",
|
||||||
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
||||||
id = @Id(value = Integer.class)
|
id = @Id(value = Integer.class)
|
||||||
),
|
),
|
||||||
@Association(
|
@Association(
|
||||||
property = "mainWorkflowField",
|
property = "mainWorkflowField",
|
||||||
column = "main_workflow_field",
|
column = "MAIN_WORKFLOW_FIELD",
|
||||||
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
select = "aiyh.utils.mapper.UtilMapper.selectFieldInfo",
|
||||||
id = @Id(value = Integer.class)
|
id = @Id(value = Integer.class)
|
||||||
)
|
)
|
||||||
|
@ -143,7 +143,7 @@ public interface TriSubRequestAfterMapper {
|
||||||
* @param requestId 请求id
|
* @param requestId 请求id
|
||||||
* @return 流程数据
|
* @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);
|
Map<String, Object> selectWorkflowData(@ParamMapper("tableName") String tableName, @ParamMapper("requestId") String requestId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -164,7 +164,7 @@ public interface TriSubRequestAfterMapper {
|
||||||
* @param data 子流程数据
|
* @param data 子流程数据
|
||||||
* @return 流程数据
|
* @return 流程数据
|
||||||
*/
|
*/
|
||||||
@Select("select * from $t{tableName} where $t{conditionUpdate}")
|
@Select("select id from $t{tableName} where $t{conditionUpdate}")
|
||||||
String selectModelId(
|
String selectModelId(
|
||||||
@ParamMapper("conditionUpdate") String conditionUpdate,
|
@ParamMapper("conditionUpdate") String conditionUpdate,
|
||||||
@ParamMapper("tableName") String tableName,
|
@ParamMapper("tableName") String tableName,
|
||||||
|
@ -177,6 +177,7 @@ public interface TriSubRequestAfterMapper {
|
||||||
*
|
*
|
||||||
* @param updateSql 自定义sql
|
* @param updateSql 自定义sql
|
||||||
* @param updateMap 更新值
|
* @param updateMap 更新值
|
||||||
|
* @return 是否更新成功
|
||||||
*/
|
*/
|
||||||
@Update(custom = true)
|
@Update(custom = true)
|
||||||
boolean updateModelData(@SqlString String updateSql, Map<String, Object> updateMap);
|
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}")
|
@Select("select WORKFLOWID from workflow_requestbase where requestid = #{requestId}")
|
||||||
String selectWorkflowId(@ParamMapper("requestId") int i);
|
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);
|
||||||
}
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -124,7 +124,7 @@ public class OFDReader {
|
||||||
keywordInfos.add(keywordNode);
|
keywordInfos.add(keywordNode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
startK = j;
|
startK = k;
|
||||||
startNode = createKeywordNode(pageFolder, keywordInfos, textNode);
|
startNode = createKeywordNode(pageFolder, keywordInfos, textNode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,11 +160,11 @@
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<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="/getlog/js/jquery.js"></script>
|
||||||
<script type="text/javascript" src="js/data.js"></script>
|
<script type="text/javascript" src="/getlog/js/data.js"></script>
|
||||||
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
|
<script type="text/javascript" src="/getlog/js/My97DatePicker/WdatePicker.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
$("#downstartlogDate").val(new Date().format("yyyy-MM-dd"));
|
$("#downstartlogDate").val(new Date().format("yyyy-MM-dd"));
|
||||||
|
|
|
@ -7,6 +7,9 @@ import com.alibaba.fastjson.JSONArray;
|
||||||
import com.api.youhong.ai.taibao.fcuntionlist.service.FunctionListService;
|
import com.api.youhong.ai.taibao.fcuntionlist.service.FunctionListService;
|
||||||
import com.api.youhong.ai.taibao.qikan.service.PeriodicalService;
|
import com.api.youhong.ai.taibao.qikan.service.PeriodicalService;
|
||||||
import com.cloudstore.dev.api.util.Util_DataCache;
|
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.BlackListRegister;
|
||||||
import com.engine.youhong.ai.taibao.email.mapper.InitBlackEmailListMapper;
|
import com.engine.youhong.ai.taibao.email.mapper.InitBlackEmailListMapper;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -179,4 +182,15 @@ public class TestTaiBao extends BaseTest {
|
||||||
}
|
}
|
||||||
System.out.println(set);
|
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));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class PDFODFTest extends BaseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void tesetOfdKeyWorkdasdf() throws Exception {
|
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()));
|
System.out.println(JSON.toJSONString(reader.findKeywords()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
-- 流程类型视图,可用于数据集成或流览按钮
|
-- 流程类型视图,可用于数据集成或流览按钮
|
||||||
create
|
create or replace view workflow_type_info_view as
|
||||||
or replace view workflow_type_info_view as
|
|
||||||
select wb.id,
|
select wb.id,
|
||||||
wb.workflowname,
|
wb.workflowname,
|
||||||
wt.typename,
|
wt.typename,
|
||||||
|
@ -8,11 +7,10 @@ select wb.id,
|
||||||
(case when wb.version is null then 1 else wb.version end) version
|
(case when wb.version is null then 1 else wb.version end) version
|
||||||
from workflow_base wb
|
from workflow_base wb
|
||||||
RIGHT JOIN workflow_type wt on wb.workflowtype = wt.id
|
RIGHT JOIN workflow_type wt on wb.workflowtype = wt.id
|
||||||
/
|
/
|
||||||
|
|
||||||
-- 流程表单视图,用于流览按钮或数据集成,配置流程类型表可以用字段联动获取流程表表名
|
-- 流程表单视图,用于流览按钮或数据集成,配置流程类型表可以用字段联动获取流程表表名
|
||||||
create
|
create or replace view workflow_table_view as
|
||||||
or replace view workflow_table_view as
|
|
||||||
select base.id,
|
select base.id,
|
||||||
base.workflowname,
|
base.workflowname,
|
||||||
base.formid,
|
base.formid,
|
||||||
|
@ -20,11 +18,10 @@ select base.id,
|
||||||
(case when base.version is null then 1 else base.version end) version
|
(case when base.version is null then 1 else base.version end) version
|
||||||
from workflow_bill bill
|
from workflow_bill bill
|
||||||
join workflow_base base on base.formid = bill.id
|
join workflow_base base on base.formid = bill.id
|
||||||
/
|
/
|
||||||
|
|
||||||
-- 流程明细表信息,可用流程主表查询对应的明细表信息,用于流览框
|
-- 流程明细表信息,可用流程主表查询对应的明细表信息,用于流览框
|
||||||
create
|
create or replace view workflow_detail_table_view as
|
||||||
or replace view workflow_detail_table_view as
|
|
||||||
select (bill.id || '-' || base.id) id,
|
select (bill.id || '-' || base.id) id,
|
||||||
bill.id bill_id,
|
bill.id bill_id,
|
||||||
base.id workflow_id,
|
base.id workflow_id,
|
||||||
|
@ -33,22 +30,23 @@ select (bill.id || '-' || base.id) id,
|
||||||
bill.tablename
|
bill.tablename
|
||||||
from workflow_billdetailtable bill
|
from workflow_billdetailtable bill
|
||||||
join workflow_base base on base.formid = bill.billid
|
join workflow_base base on base.formid = bill.billid
|
||||||
/
|
/
|
||||||
|
|
||||||
-- 流程和建模字段视图,更具流程和建模的billid可以查询流程和建模中的字段信息
|
-- 流程和建模字段视图,更具流程和建模的billid可以查询流程和建模中的字段信息
|
||||||
-- 准备基础数据
|
-- 准备基础数据
|
||||||
|
|
||||||
BEGIN
|
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';
|
EXECUTE IMMEDIATE 'DROP TABLE cus_workflow_base_field_assist';
|
||||||
END LOOP;
|
END LOOP;
|
||||||
-- 不存在或删除成功后则创建表
|
-- 不存在或删除成功后则创建表
|
||||||
EXECUTE IMMEDIATE '
|
EXECUTE IMMEDIATE '
|
||||||
CREATE TABLE cus_workflow_base_field_assist
|
CREATE TABLE cus_workflow_base_field_assist
|
||||||
(id NUMBER(10) PRIMARY KEY, fieldname VARCHAR2(255) NOT NULL, indexdesc VARCHAR2(255) NOT NULL, tablename VARCHAR2(255) NOT NULL, billid NUMBER(10) NOT NULL, showtablename VARCHAR2(255) NOT NULL, fieldhtmltype VARCHAR2(255) NOT NULL, fieldtype NUMBER(10) NOT NULL)
|
(id NUMBER(10) PRIMARY KEY, fieldname VARCHAR2(255) NOT NULL, indexdesc VARCHAR2(255) NOT NULL, tablename VARCHAR2(255) NOT NULL, billid NUMBER(10) NOT NULL, showtablename VARCHAR2(255) NOT NULL, fieldhtmltype VARCHAR2(255) NOT NULL, fieldtype NUMBER(10) NOT NULL)
|
||||||
';
|
';
|
||||||
END;
|
END;
|
||||||
/
|
/
|
||||||
INSERT INTO cus_workflow_base_field_assist(id, fieldname, indexdesc, tablename, billid, showtablename, fieldhtmltype,
|
INSERT INTO cus_workflow_base_field_assist(id, fieldname, indexdesc, tablename, billid, showtablename, fieldhtmltype,
|
||||||
|
@ -90,8 +88,7 @@ VALUES (-989, 'workflowid', '工作流id:workflowid', 'workflow_requestbase',
|
||||||
|
|
||||||
|
|
||||||
-- 创建试图
|
-- 创建试图
|
||||||
create
|
create or replace view workflow_field_table_view as
|
||||||
or replace view workflow_field_table_view as
|
|
||||||
select wb.id,
|
select wb.id,
|
||||||
wb.fieldname,
|
wb.fieldname,
|
||||||
(ht.indexdesc || ':' || wb.fieldname) indexdesc,
|
(ht.indexdesc || ':' || wb.fieldname) indexdesc,
|
||||||
|
@ -116,7 +113,8 @@ select wb.id,
|
||||||
when wb.FIELDHTMLTYPE = '3' then '流览框'
|
when wb.FIELDHTMLTYPE = '3' then '流览框'
|
||||||
when wb.FIELDHTMLTYPE = '4' then 'check框'
|
when wb.FIELDHTMLTYPE = '4' then 'check框'
|
||||||
when wb.FIELDHTMLTYPE = '5' then '选择框'
|
when wb.FIELDHTMLTYPE = '5' then '选择框'
|
||||||
else '附件上传' end) fieldhtmltype
|
else '附件上传' end) fieldhtmltype,
|
||||||
|
wb.FIELDHTMLTYPE fieldtype
|
||||||
from workflow_billfield wb
|
from workflow_billfield wb
|
||||||
left join htmllabelindex ht on wb.fieldlabel = ht.id
|
left join htmllabelindex ht on wb.fieldlabel = ht.id
|
||||||
union all
|
union all
|
||||||
|
@ -124,17 +122,15 @@ select *
|
||||||
from cus_workflow_base_field_assist /
|
from cus_workflow_base_field_assist /
|
||||||
|
|
||||||
-- 建模表信息视图
|
-- 建模表信息视图
|
||||||
create
|
create or replace view mode_bill_info_view as
|
||||||
or replace view mode_bill_info_view as
|
|
||||||
select bill.id, bill.tablename, hti.indexdesc
|
select bill.id, bill.tablename, hti.indexdesc
|
||||||
from workflow_bill bill
|
from workflow_bill bill
|
||||||
left join htmllabelindex hti on hti.id = bill.namelabel
|
left join htmllabelindex hti on hti.id = bill.namelabel
|
||||||
where bill.id < 0
|
where bill.id < 0
|
||||||
and bill.tablename like 'uf%'
|
and bill.tablename like 'uf%'
|
||||||
/
|
/
|
||||||
-- 流程建模表信息
|
-- 流程建模表信息
|
||||||
CREATE
|
CREATE or replace VIEW workflow_mode_table_view
|
||||||
or replace VIEW workflow_mode_table_view
|
|
||||||
AS
|
AS
|
||||||
select bill.ID id,
|
select bill.ID id,
|
||||||
bill.TABLENAME tablename,
|
bill.TABLENAME tablename,
|
||||||
|
@ -152,11 +148,10 @@ from (
|
||||||
workflow_bill bill left join htmllabelindex hti on ((hti.ID = bill.NAMELABEL))
|
workflow_bill bill left join htmllabelindex hti on ((hti.ID = bill.NAMELABEL))
|
||||||
)
|
)
|
||||||
where ((bill.ID < 0) and (bill.TABLENAME like 'uf%'))
|
where ((bill.ID < 0) and (bill.TABLENAME like 'uf%'))
|
||||||
/
|
/
|
||||||
|
|
||||||
-- 流程节点信息视图
|
-- 流程节点信息视图
|
||||||
create
|
create or replace view workflow_node_info_view as
|
||||||
or replace view workflow_node_info_view as
|
|
||||||
select distinct nb.id,
|
select distinct nb.id,
|
||||||
nb.nodename,
|
nb.nodename,
|
||||||
(case when wb.version is null then 1 else wb.version end) version,
|
(case when wb.version is null then 1 else wb.version end) version,
|
||||||
|
@ -164,4 +159,4 @@ select distinct nb.id,
|
||||||
from workflow_nodebase nb
|
from workflow_nodebase nb
|
||||||
left join workflow_flownode fn on nb.id = fn.nodeid
|
left join workflow_flownode fn on nb.id = fn.nodeid
|
||||||
left join workflow_base wb on wb.id = fn.workflowid
|
left join workflow_base wb on wb.id = fn.workflowid
|
||||||
/
|
/
|
||||||
|
|
|
@ -117,7 +117,8 @@ select wb.id,
|
||||||
when wb.FIELDHTMLTYPE = '3' then '流览框'
|
when wb.FIELDHTMLTYPE = '3' then '流览框'
|
||||||
when wb.FIELDHTMLTYPE = '4' then 'check框'
|
when wb.FIELDHTMLTYPE = '4' then 'check框'
|
||||||
when wb.FIELDHTMLTYPE = '5' then '选择框'
|
when wb.FIELDHTMLTYPE = '5' then '选择框'
|
||||||
else '附件上传' end) fieldhtmltype
|
else '附件上传' end) fieldhtmltype,
|
||||||
|
wb.FIELDHTMLTYPE fieldtype
|
||||||
from workflow_billfield wb
|
from workflow_billfield wb
|
||||||
left join htmllabelindex ht on wb.fieldlabel = ht.id
|
left join htmllabelindex ht on wb.fieldlabel = ht.id
|
||||||
union all
|
union all
|
||||||
|
|
Loading…
Reference in New Issue