ic_excellent 2023-07-03 13:46:07 +08:00
commit 2ce07ae713
461 changed files with 61701 additions and 641 deletions

View File

@ -159,13 +159,13 @@ logPath=/Users/aoey.oct.22/company/Fan_wei/code/idea/ecology9-project/log
lib/classbeanLib/下的jar包对应ecology/classbean下的class文件具体更换方式需要先进入到ecology/classbean目录中打开终端处于当前ecology/classbean目录中执行一下代码 lib/classbeanLib/下的jar包对应ecology/classbean下的class文件具体更换方式需要先进入到ecology/classbean目录中打开终端处于当前ecology/classbean目录中执行一下代码
```shell ```shell
jar -cvf ecology-dev-lib.jar com DBstep weaver jar -cvf ecology-dev-lib.jar getLogFilePath DBstep weaver
``` ```
进入ecology/web-inf/classes执行如下代码 进入ecology/web-inf/classes执行如下代码
```shell ```shell
jar -cvf web-inf-class-lib.jar com weaver org jar -cvf web-inf-class-lib.jar getLogFilePath weaver org
``` ```
将生成的jar包替换掉原来的jar包即可 将生成的jar包替换掉原来的jar包即可

View File

@ -9,6 +9,42 @@ const WfForm = {
isMobile: () => { isMobile: () => {
// true表示是eMobile、微信、钉钉等移动终端false代表PC端 // true表示是eMobile、微信、钉钉等移动终端false代表PC端
}, },
/**
* 4.6 函数式自定义渲染表单字段
* 最低版本要求KB900190701
*
* 以函数返回值方式自定义渲染表单字段支持全部的字段类型可实现基于原组件追加/复写/重新布局等等
*
* 建议结合ecode工具放到模块加载前调用使用JSX可实现与表单字段渲染有关的二次开发
*
* 此接口的优先级高于4.44.5即使用此接口代理的字段如再使用4.44.5会直接无效
*
* proxyFieldContentComp: function(fieldid,fn)
* @param convertFieldNameToId
* @param customerRender
*/
proxyFieldContentComp(convertFieldNameToId, customerRender = (info, compFn) => {
// console.log("字段id",info.fieldid);
// console.log("明细行号:",info.rowIndex);
// console.log("字段只读必填属性:",info.viewAttr);
// console.log("字段值:",info.fieldValue);
// //返回自定义渲染的组件
// return React.createElement("div", {}, ["想怎么玩就怎么玩"]);
// //返回原组件
// return compFn();
// //返回基于原组件的复写组件
// return React.createElement("div", {}, ["前置组件",compFn(),"后置组件"]);
}
) {
},
/**
* //如果此接口调用在代码块、custompage等(非模块加载前调用),需强制渲染字段一次
* WfForm.forceRenderField("field111");
* @param field
*/
forceRenderField(field) {
}
} }
WfForm.OPER_SAVE = '保存' WfForm.OPER_SAVE = '保存'
WfForm.OPER_SUBMIT = '提交/批准/提交需反馈/不需反馈等' WfForm.OPER_SUBMIT = '提交/批准/提交需反馈/不需反馈等'

View File

@ -59,7 +59,7 @@ function initTimeoutDate(){
console.log('计算下次超时日期 ', computeTimeoutDate); console.log('计算下次超时日期 ', computeTimeoutDate);
var trackingLine = parseInt(WfForm.getFieldValue(trackingLineField)); var trackingLine = parseInt(WfForm.getFieldValue(trackingLineField));
var detail2LineNum = WfForm.getDetailRowCount("detail_2"); var detail2LineNum = WfForm.getDetailRowCount("detail_2");
setTimeout(()=>{ setTimeout(function (){
WfForm.changeFieldValue(timeoutRemindDateFiled, {value: computeTimeoutDate}); WfForm.changeFieldValue(timeoutRemindDateFiled, {value: computeTimeoutDate});
// 判断流程提交走向 // 判断流程提交走向
console.log('主表跟踪触发行数 : ', trackingLine) console.log('主表跟踪触发行数 : ', trackingLine)
@ -102,6 +102,9 @@ function getCurrentDate() {
function parseDate(date) { function parseDate(date) {
var currentYear = date.getFullYear(); var currentYear = date.getFullYear();
var currentMonth = date.getMonth() + 1;// getMonth()返回0~11需要加1 var currentMonth = date.getMonth() + 1;// getMonth()返回0~11需要加1
if(currentMonth < 10){
currentMonth = '0' + currentMonth;
}
var currentDay = date.getDate(); var currentDay = date.getDate();
return currentYear + '-' + currentMonth + '-' + currentDay; return currentYear + '-' + currentMonth + '-' + currentDay;
} }

View File

@ -788,3 +788,125 @@ $(() => {
} }
}) })
/* ******************* 年假计算 end ******************* */ /* ******************* 年假计算 end ******************* */
/* ******************* youhong.ai 明细字段合并主表,序号内容换行展示 start ******************* */
$(() => {
const config = {
// 明细表
detail: 'detail_3',
// 明细字段
detailField: 'jbxxnr',
// 主表字段
mainField: 'jbxxnr'
}
function runJs() {
let rowIndexStr = WfForm.getDetailAllRowIndexStr(config.detail);
let rowIndexArr = rowIndexStr.split(",");
let value = ""
rowIndexArr.forEach(item => {
let fieldId = WfForm.convertFieldNameToId(config.detailField, config.detail) + "_" + item
let fieldValue = WfForm.getFieldValue(fieldId);
value += (+item + 1) + "、" + fieldValue + "\n";
})
WfForm.changeFieldValue(WfForm.convertFieldNameToId(config.mainField), {value})
}
WfForm.registerCheckEvent(WfForm.OPER_SUBMIT, (callback) => {
runJs()
callback()
})
})
/* ******************* youhong.ai 明细字段合并主表,序号内容换行展示 end ******************* */
/* ******************* youhong.ai 取明细行中最早时间的一行,将数据放到主表 start ******************* */
$(() => {
const config = {
// 明细表
detail: 'detail_1',
// 映射关系
mapping: [{
// 明细表字段
detailField: 'jbsj',
// 主表字段
mainField: 'zzjsrq',
}, {
// 明细表字段
detailField: 'jbtd',
// 主表字段
mainField: 'jbqd',
}],
dateSort: 'jbsj'
}
function runJs() {
let rowIndexStr = WfForm.getDetailAllRowIndexStr(config.detail);
let rowIndexArray = rowIndexStr.split(",");
const detailData = []
rowIndexArray.forEach(item => {
let obj = {}
config.mapping.forEach(mapping => {
obj[mapping.detailField] = WfForm.getFieldValue(WfForm.convertFieldNameToId(mapping.detailField, config.detail) + "_" + item)
})
detailData.push(obj)
})
console.log(detailData)
let minDateObj = filterByMinDate(detailData, config.dateSort);
console.log(minDateObj)
config.mapping.forEach(item => {
WfForm.changeFieldValue(WfForm.convertFieldNameToId(item.mainField), {
value: minDateObj[item.detailField]
})
})
}
function filterByMinDate(arr, key) {
return arr.reduce((min, obj) => {
if (!min || new Date(obj[key]) <= new Date(min[key])) {
return obj;
}
return min;
}, null);
}
WfForm.registerCheckEvent(WfForm.OPER_SUBMIT, (callback) => {
runJs()
callback()
})
})
/* ******************* youhong.ai 取明细行中最早时间的一行,将数据放到主表 end ******************* */
/* ******************* youhong.ai 主表选择框自定义渲染为进度条 start ******************* */
$(() => {
const field = 'jz'
const config = {
'-1': 0,
'0': 20,
'1': 40,
'2': 60,
'3': 80,
'4': 100,
}
function customerRender(info, compFn) {
let fieldValue = info.fieldValue;
if (!fieldValue) {
fieldValue = '-1'
}
let {WeaProgress} = ecCom
return React.createElement(WeaProgress, {
strokeColor: '#6c8dc1',
percent: config[fieldValue]
})
}
WfForm.proxyFieldContentComp(WfForm.convertFieldNameToId(field).replace("field", ""), customerRender)
setTimeout(() => {
WfForm.forceRenderField(WfForm.convertFieldNameToId(field));
}, 500)
})
/* ******************* youhong.ai 主表选择框自定义渲染为进度条 end ******************* */

View File

@ -107,3 +107,121 @@ $(() => {
}) })
/* ******************* youhong.ai 流程部分 end ******************* */ /* ******************* youhong.ai 流程部分 end ******************* */
/* ******************* youhong.ai 编号验证是否存在 start ******************* */
$(() => {
const config = {
ecId: '',
tableName: '',
field: 'fwbh',
}
/**
* @author youhong.ai
* @desc 发起请求
*/
function api(requestOptions = {
url: "",
type: "GET",
data: "",
isAsync: true,
success: () => {
},
error: () => {
},
complete: () => {
},
contentType: 'application/json',
beforeSend: () => {
}
}) {
let options = Object.assign({
url: "",
type: "GET",
data: "",
isAsync: true,
success: () => {
},
error: () => {
},
complete: () => {
},
contentType: 'application/json',
beforeSend: () => {
}
}, requestOptions)
return $.ajax(options)
}
function findReact(dom, traverseUp = 0) {
const key = Object.keys(dom).find(key => {
return key.startsWith("__reactFiber$") // react 17+
|| key.startsWith("__reactInternalInstance$")
|| key.startsWith("__reactEventHandlers$"); // react <17
});
const domFiber = dom[key];
if (domFiber == null) return null;
// react <16
if (domFiber._currentElement) {
let compFiber = domFiber._currentElement._owner;
for (let i = 0; i < traverseUp; i++) {
compFiber = compFiber._currentElement._owner;
}
return compFiber._instance;
}
// react 16+
const GetCompFiber = fiber => {
let parentFiber = fiber.return;
while (typeof parentFiber.type == "string") {
parentFiber = parentFiber.return;
}
return parentFiber;
};
let compFiber = GetCompFiber(domFiber);
for (let i = 0; i < traverseUp; i++) {
compFiber = GetCompFiber(compFiber);
}
return compFiber.stateNode;
}
function runJs() {
let node = findReact($(`button[ecid='${config.ecId}']`)[0])
let baseInfo = WfForm.getBaseInfo();
baseInfo.workflowid
if (baseInfo.requestid == -1) {
return
}
if (node) {
let click = node.props.onClick;
node.props.onClick = (e) => {
api({
url: `/api/aiyh/taibao/bh/check-number?tableName=${config.tableName}&field=${config.field}&requestId=${baseInfo.requestid}`,
success(res) {
if (res && res.code == 200) {
if (res.data) {
// 存在编号,提示是否需要编号
WfForm.showConfirm("编号一存在,是否重新编号?", function () {
click(e)
}, function () {
// 不重新编号,刷新
window.location.reload()
}, {
title: "编号确认", //弹确认框的title仅PC端有效
okText: "确认", //自定义确认按钮名称
cancelText: "取消" //自定义取消按钮名称
});
} else {
click(e)
}
}
}
})
};
}
}
runJs()
})
/* ******************* youhong.ai 编号验证是否存在 end ******************* */

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/jinweiLib/model16.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/jinweiLib/util16.jar Normal file

Binary file not shown.

Binary file not shown.

View File

@ -85,10 +85,11 @@ public class GenerateFileUtil {
if (hasRequired) { if (hasRequired) {
// 必填参数 // 必填参数
RequiredMark requiredMark = declaredField.getAnnotation(RequiredMark.class); RequiredMark requiredMark = declaredField.getAnnotation(RequiredMark.class);
String fieldDesc = requiredMark.value(); String fieldDesc = requiredMark.desc();
Map<String, String> param = new HashMap<>(); Map<String, String> param = new HashMap<>(8);
param.put("name", name); param.put("name", name);
param.put("desc", fieldDesc); param.put("desc", fieldDesc);
param.put("example", requiredMark.value());
param.put("isRequired", "是"); param.put("isRequired", "是");
boolean hasDefaultTestValue = declaredField.isAnnotationPresent(ActionDefaultTestValue.class); boolean hasDefaultTestValue = declaredField.isAnnotationPresent(ActionDefaultTestValue.class);
if (hasDefaultTestValue) { if (hasDefaultTestValue) {
@ -105,9 +106,10 @@ public class GenerateFileUtil {
ActionOptionalParam actionOptionalParam = declaredField.getAnnotation(ActionOptionalParam.class); ActionOptionalParam actionOptionalParam = declaredField.getAnnotation(ActionOptionalParam.class);
String fieldDesc = actionOptionalParam.desc(); String fieldDesc = actionOptionalParam.desc();
String defaultValue = actionOptionalParam.value(); String defaultValue = actionOptionalParam.value();
Map<String, String> param = new HashMap<>(); Map<String, String> param = new HashMap<>(8);
param.put("name", name); param.put("name", name);
param.put("desc", fieldDesc); param.put("desc", fieldDesc);
param.put("example", defaultValue);
param.put("isRequired", "否"); param.put("isRequired", "否");
param.put("defaultValue", defaultValue); param.put("defaultValue", defaultValue);
paramList.add(param); paramList.add(param);

View File

@ -12,14 +12,14 @@ import java.util.Map;
* @author youHong.ai * @author youHong.ai
*/ */
public class ScriptUtil { public class ScriptUtil {
private static final JexlEngine jexl = new JexlBuilder().create(); private static final JexlEngine JEXL = new JexlBuilder().create();
public static Object invokeScript(String script, Map<String, Object> params) { public static Object invokeScript(String script, Map<String, Object> params) {
JexlContext jc = new MapContext(); JexlContext jc = new MapContext();
for (Map.Entry<String, Object> entry : params.entrySet()) { for (Map.Entry<String, Object> entry : params.entrySet()) {
jc.set(entry.getKey(), entry.getValue()); jc.set(entry.getKey(), entry.getValue());
} }
JexlExpression expression = jexl.createExpression(script); JexlExpression expression = JEXL.createExpression(script);
return expression.evaluate(jc); return expression.evaluate(jc);
} }
} }

View File

@ -244,7 +244,7 @@ public class Util extends weaver.general.Util {
str = str.substring(0, str.length() - 1); str = str.substring(0, str.length() - 1);
} }
if (str.trim().startsWith(removeSeparator)) { if (str.trim().startsWith(removeSeparator)) {
str = str.substring(1); str = str.substring(removeSeparator.length());
} }
return str; return str;
} }
@ -1210,9 +1210,15 @@ public class Util extends weaver.general.Util {
Properties prop = new Properties(); Properties prop = new Properties();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
InputStream inputStream = null; InputStream inputStream = null;
InputStreamReader reader = null;
try { try {
inputStream = new BufferedInputStream(new FileInputStream(path)); inputStream = new BufferedInputStream(new FileInputStream(path));
prop.load(inputStream); /**
* <h2> </h2>
* <h2>xuanran.wang 2023-06-26 10:16</h2>
**/
reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
prop.load(reader);
Enumeration<?> enumeration = prop.propertyNames(); Enumeration<?> enumeration = prop.propertyNames();
while (enumeration.hasMoreElements()) { while (enumeration.hasMoreElements()) {
String key = String.valueOf(enumeration.nextElement()); String key = String.valueOf(enumeration.nextElement());
@ -1222,6 +1228,9 @@ public class Util extends weaver.general.Util {
throw new RuntimeException("找不到文件:" + path); throw new RuntimeException("找不到文件:" + path);
} finally { } finally {
try { try {
if (reader != null) {
reader.close();
}
if (inputStream != null) { if (inputStream != null) {
inputStream.close(); inputStream.close();
} }
@ -3025,6 +3034,10 @@ public class Util extends weaver.general.Util {
return mapper.selectDocImageInfo(docId); return mapper.selectDocImageInfo(docId);
} }
public static DocImageInfo selectImageInfoByImageId(String imageFileId) {
return mapper.selectImageInfoByImageId(imageFileId);
}
/** /**
* *
* *
@ -3578,15 +3591,99 @@ public class Util extends weaver.general.Util {
String field = matcher.group("field"); String field = matcher.group("field");
String otherKeyStr = matcher.group("other"); String otherKeyStr = matcher.group("other");
Object o = valueHandler(arg, field); Object o = valueHandler(arg, field);
if (null == o) { if (null == o) {
throw new CustomerException(Util.logStr("can not get value of [{}] from [{}], this keyStr is [{}]", throw new CustomerException(Util.logStr("can not get value of [{}] from [{}], this keyStr is [{}]",
field, JSON.toJSONString(arg), keyStr)); field, JSON.toJSONString(arg), keyStr));
} }
if (o instanceof Collection) {
return new CustomerException("can not supper array value!");
}
return getValueByKeyStr(otherKeyStr, o); return getValueByKeyStr(otherKeyStr, o);
} }
throw new CustomerException("Unable to find value of key [" + keyStr + "]"); throw new CustomerException("Unable to find value of key [" + keyStr + "]");
} }
/**
* <h2>keyStrvalue</h2>
*
* @param keyStr keyString
* @param arg map
* @return value
*/
public static ValueOrList getValueOrListByKeyStr(String keyStr, Object arg) {
if (arg == null) {
return null;
}
if (!keyStr.contains(".")) {
Object o = valueHandler(arg, keyStr);
ValueOrList valueOrList = new ValueOrList();
valueOrList.setValue(o);
valueOrList.setKey(keyStr);
return valueOrList;
}
String pattern = "(?<field>^[\\w]+[\\w$]*)\\.*(?<other>(\\S+)*)";
Pattern compile = Pattern.compile(pattern);
Matcher matcher = compile.matcher(keyStr);
if (matcher.find()) {
String field = matcher.group("field");
String otherKeyStr = matcher.group("other");
Object o = valueHandler(arg, field);
if (null == o) {
throw new CustomerException(Util.logStr("can not get value of [{}] from [{}], this keyStr is [{}]",
field, JSON.toJSONString(arg), keyStr));
}
if (o instanceof Collection) {
ValueOrList valueOrList = new ValueOrList();
valueOrList.setValue(o);
valueOrList.setArray(true);
valueOrList.setKey(field);
return valueOrList;
}
return getValueOrListByKeyStr(otherKeyStr, o);
}
throw new CustomerException("Unable to find value of key [" + keyStr + "]");
}
public static class ValueOrList {
private String key;
private boolean isArray;
private Object value;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public boolean isArray() {
return isArray;
}
public void setArray(boolean array) {
isArray = array;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
@Override
public String toString() {
return "ValueOrList{" +
"key='" + key + '\'' +
", isArray=" + isArray +
", value=" + value +
'}';
}
}
/** /**
* <h2>value</h2> * <h2>value</h2>
* *
@ -3970,4 +4067,6 @@ public class Util extends weaver.general.Util {
} }
} }
} }
} }

View File

@ -200,6 +200,7 @@ public abstract class SafeCusBaseAction implements Action {
String billTable = requestManager.getBillTableName(); String billTable = requestManager.getBillTableName();
String id = mapper.selectIdByRequest(billTable, requestInfo.getRequestid()); String id = mapper.selectIdByRequest(billTable, requestInfo.getRequestid());
result.put("id", id); result.put("id", id);
result.put("requestid", requestInfo.getRequestid());
return result; return result;
} }

View File

@ -41,4 +41,18 @@ public class DocImageInfo {
/** 文件类型 */ /** 文件类型 */
@SqlOracleDbFieldAnn("DOC_FILE_TYPE") @SqlOracleDbFieldAnn("DOC_FILE_TYPE")
private Integer docFileType; private Integer docFileType;
/** 文件路径 */
@SqlOracleDbFieldAnn("PATH")
private String path;
/** 加密code */
@SqlOracleDbFieldAnn("AES_CODE")
private String aesCode;
/** 文件token */
@SqlOracleDbFieldAnn("TOKEN_KEY")
private String tokenKey;
/** 缩略图 */
@SqlOracleDbFieldAnn("MINI_IMG_PATH")
private String miniImgPath;
} }

View File

@ -46,4 +46,7 @@ public class FieldViewInfo {
@SqlOracleDbFieldAnn("FIELD_HTML_TYPE") @SqlOracleDbFieldAnn("FIELD_HTML_TYPE")
private String fieldHtmlType; private String fieldHtmlType;
private Object value;
} }

View File

@ -121,7 +121,7 @@ public class HttpUtils {
return getUrl; return getUrl;
} }
private static String serializeParams(Map<String, Object> params) { public static String serializeParams(Map<String, Object> params) {
if (params != null && params.size() > 0) { if (params != null && params.size() > 0) {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (Map.Entry<String, Object> entry : params.entrySet()) { for (Map.Entry<String, Object> entry : params.entrySet()) {
@ -1113,6 +1113,9 @@ public class HttpUtils {
} }
private boolean isBean(Object o) { private boolean isBean(Object o) {
if (Objects.isNull(o)) {
return false;
}
if (o instanceof Number) { if (o instanceof Number) {
return false; return false;
} }
@ -1122,9 +1125,6 @@ public class HttpUtils {
if (o instanceof Boolean) { if (o instanceof Boolean) {
return false; return false;
} }
if (Objects.isNull(o)) {
return false;
}
return !o.getClass().isPrimitive(); return !o.getClass().isPrimitive();
} }

View File

@ -56,28 +56,34 @@ public interface UtilMapper {
@Select("select di.id id,dc.id doc_id," + @Select("select di.id id,dc.id doc_id," +
"img.FILEREALPATH path,img.AESCODE aes_code,img.TOKENKEY token_key,MINIIMGPATH mini_img_path," +
"di.imagefileid image_file_id," + "di.imagefileid image_file_id," +
"dc.DOCCREATEDATE doc_create_date,dc.DOCCREATETIME doc_create_time," + "dc.DOCCREATEDATE doc_create_date,dc.DOCCREATETIME doc_create_time," +
"(case when imagefilename = '' or imagefilename is null then dc.DOCSUBJECT else imagefilename end) image_file_name " + "(case when di.imagefilename = '' or di.imagefilename is null then dc.DOCSUBJECT else di.imagefilename end) image_file_name " +
"from DocDetail dc " + "from DocDetail dc " +
"left join imagefile img on img.IMAGEFILEID = di.IMAGEFILEID " +
"left join docimagefile di on (dc.id = #{docId} and dc.id = di.docid) " + "left join docimagefile di on (dc.id = #{docId} and dc.id = di.docid) " +
"where dc.id = #{docId} ") "where dc.id = #{docId} ")
DocImageInfo selectDocImageInfo(@ParamMapper("docId") String docId); DocImageInfo selectDocImageInfo(@ParamMapper("docId") String docId);
@Select("select di.id id,dc.id doc_id," + @Select("select di.id id,dc.id doc_id," +
"img.FILEREALPATH path,img.AESCODE aes_code,img.TOKENKEY token_key,MINIIMGPATH mini_img_path," +
"di.imagefileid image_file_id, di.docfiletype doc_file_type," + "di.imagefileid image_file_id, di.docfiletype doc_file_type," +
"dc.DOCCREATEDATE doc_create_date,dc.DOCCREATETIME doc_create_time," + "dc.DOCCREATEDATE doc_create_date,dc.DOCCREATETIME doc_create_time," +
"(case when imagefilename = '' or imagefilename is null then dc.DOCSUBJECT else imagefilename end) image_file_name " + "(case when di.imagefilename = '' or di.imagefilename is null then dc.DOCSUBJECT else di.imagefilename end) image_file_name " +
"from DocDetail dc " + "from DocDetail dc " +
"left join imagefile img on img.IMAGEFILEID = di.IMAGEFILEID " +
"left join docimagefile di on (dc.id in ($t{docIds}) and dc.id = di.docid )" + "left join docimagefile di on (dc.id in ($t{docIds}) and dc.id = di.docid )" +
"where dc.id in ($t{docIds})") "where dc.id in ($t{docIds})")
List<DocImageInfo> selectDocImageInfos(@ParamMapper("docIds") String docIds); List<DocImageInfo> selectDocImageInfos(@ParamMapper("docIds") String docIds);
@Select("select di.id id,dc.id doc_id," + @Select("select di.id id,dc.id doc_id," +
"img.FILEREALPATH path,img.AESCODE aes_code,img.TOKENKEY token_key,MINIIMGPATH mini_img_path," +
"di.imagefileid image_file_id, di.docfiletype doc_file_type," + "di.imagefileid image_file_id, di.docfiletype doc_file_type," +
"dc.DOCCREATEDATE doc_create_date,dc.DOCCREATETIME doc_create_time," + "dc.DOCCREATEDATE doc_create_date,dc.DOCCREATETIME doc_create_time," +
"(case when imagefilename = '' or imagefilename is null then dc.DOCSUBJECT else imagefilename end) image_file_name " + "(case when di.imagefilename = '' or di.imagefilename is null then dc.DOCSUBJECT else di.imagefilename end) image_file_name " +
"from DocDetail dc " + "from DocDetail dc " +
"left join imagefile img on img.IMAGEFILEID = di.IMAGEFILEID " +
"left join docimagefile di on (dc.id in ($t{docIds}) and dc.id = di.docid )" + "left join docimagefile di on (dc.id in ($t{docIds}) and dc.id = di.docid )" +
"where dc.id in ($t{docIds})") "where dc.id in ($t{docIds})")
List<DocImageInfo> selectDocImageInfos(@ParamMapper("docIds") String[] docIds); List<DocImageInfo> selectDocImageInfos(@ParamMapper("docIds") String[] docIds);
@ -197,4 +203,20 @@ public interface UtilMapper {
@Select("select id, tablename table_name, indexdesc index_desc from mode_bill_info_view where id = #{id}") @Select("select id, tablename table_name, indexdesc index_desc from mode_bill_info_view where id = #{id}")
ModelTableInfo selectModelTableInfo(Integer id); ModelTableInfo selectModelTableInfo(Integer id);
@Select("select di.id id,dc.id doc_id, " +
"img.FILEREALPATH path,img.AESCODE aes_code,img.TOKENKEY token_key,img.MINIIMGPATH mini_img_path," +
" di.imagefileid image_file_id, " +
" dc.DOCCREATEDATE doc_create_date, " +
" dc.DOCCREATETIME doc_create_time, " +
" (case when " +
" di.imagefilename = '' or di.imagefilename is null " +
" then dc.DOCSUBJECT " +
" else di.imagefilename end " +
" ) image_file_name " +
"from imagefile img " +
"left join docimagefile di on img.IMAGEFILEID = di.IMAGEFILEID " +
"left join docdetail dc on di.DOCID = dc.ID " +
" where img.IMAGEFILEID = #{imageId}")
DocImageInfo selectImageInfoByImageId(String imageFileId);
} }

View File

@ -336,18 +336,18 @@ public class ResultMapper {
if ("FLOAT".equalsIgnoreCase(columnType) || "DOUBLE".equalsIgnoreCase(columnType) || "DECIMAL".equalsIgnoreCase(columnType)) { if ("FLOAT".equalsIgnoreCase(columnType) || "DOUBLE".equalsIgnoreCase(columnType) || "DECIMAL".equalsIgnoreCase(columnType)) {
if (Objects.nonNull(toLowerCase)) { if (Objects.nonNull(toLowerCase)) {
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getFloat(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getString(i + 1));
} else { } else {
if (enable) { if (enable) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getFloat(i + 1)); ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(i + 1));
continue; continue;
} }
if (DBConstant.DB_TYPE_ORACLE.equals(rs.getDBType())) { if (DBConstant.DB_TYPE_ORACLE.equals(rs.getDBType())) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getFloat(i + 1)); ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(i + 1));
} }
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getFloat(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getString(i + 1));
((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), rs.getFloat(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), rs.getString(i + 1));
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getFloat(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getString(i + 1));
} }
continue; continue;
} }
@ -475,39 +475,58 @@ public class ResultMapper {
} else { } else {
columnType = columnTypeName[i]; columnType = columnTypeName[i];
} }
String value = rs.getString(i + 1);
String valueCloumn = rs.getString(columnName[i]);
if ("int".equalsIgnoreCase(columnType) || "long".equalsIgnoreCase(columnType) || "number".equalsIgnoreCase(columnType) || "MEDIUMINT".equalsIgnoreCase(columnType) || "TINYINT".equalsIgnoreCase(columnType) || "SMALLINT".equalsIgnoreCase(columnType) || "BIGINT".equalsIgnoreCase(columnType) || "INTEGER".equalsIgnoreCase(columnType)) { if ("int".equalsIgnoreCase(columnType) || "long".equalsIgnoreCase(columnType) || "number".equalsIgnoreCase(columnType) || "MEDIUMINT".equalsIgnoreCase(columnType) || "TINYINT".equalsIgnoreCase(columnType) || "SMALLINT".equalsIgnoreCase(columnType) || "BIGINT".equalsIgnoreCase(columnType) || "INTEGER".equalsIgnoreCase(columnType)) {
if (Objects.nonNull(toLowerCase)) { if (Objects.nonNull(toLowerCase)) {
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getInt(i + 1)); try {
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), Integer.parseInt(value));
} catch (Exception e) {
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), value);
}
} else { } else {
if (enable) { if (enable) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getInt(columnName[i])); try {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), Integer.parseInt(valueCloumn));
} catch (Exception e) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), valueCloumn);
}
continue; continue;
} }
if (DBConstant.DB_TYPE_ORACLE.equals(rs.getDBType())) { if (DBConstant.DB_TYPE_ORACLE.equals(rs.getDBType())) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getInt(i + 1)); try {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), Integer.parseInt(value));
} catch (Exception e) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), value);
}
}
try {
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), Integer.parseInt(value));
((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), Integer.parseInt(value));
((Map<? super Object, ? super Object>) o).put(columnName[i], Integer.parseInt(value));
} catch (Exception e) {
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), value);
((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), value);
((Map<? super Object, ? super Object>) o).put(columnName[i], value);
} }
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getInt(i + 1));
((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), rs.getInt(i + 1));
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getInt(i + 1));
} }
continue; continue;
} }
if ("FLOAT".equalsIgnoreCase(columnType) || "DOUBLE".equalsIgnoreCase(columnType) || "DECIMAL".equalsIgnoreCase(columnType)) { if ("FLOAT".equalsIgnoreCase(columnType) || "DOUBLE".equalsIgnoreCase(columnType) || "DECIMAL".equalsIgnoreCase(columnType)) {
if (Objects.nonNull(toLowerCase)) { if (Objects.nonNull(toLowerCase)) {
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), value);
} else { } else {
if (enable) { if (enable) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(columnName[i])); ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), valueCloumn);
continue; continue;
} }
if (DBConstant.DB_TYPE_ORACLE.equals(rs.getDBType())) { if (DBConstant.DB_TYPE_ORACLE.equals(rs.getDBType())) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(columnName[i])); ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), valueCloumn);
} }
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), value);
((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), value);
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i], value);
} }
continue; continue;
} }
@ -535,18 +554,18 @@ public class ResultMapper {
} }
if (Objects.nonNull(toLowerCase)) { if (Objects.nonNull(toLowerCase)) {
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), value);
} else { } else {
if (enable) { if (enable) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(columnName[i])); ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), valueCloumn);
continue; continue;
} }
if (DBConstant.DB_TYPE_ORACLE.equals(rs.getDBType())) { if (DBConstant.DB_TYPE_ORACLE.equals(rs.getDBType())) {
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), value);
} }
((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toLowerCase(), value);
((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i].toUpperCase(), value);
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getString(i + 1)); ((Map<? super Object, ? super Object>) o).put(columnName[i], value);
} }

View File

@ -268,7 +268,8 @@ public class SqlHandler {
} }
Object o = ((Map<?, ?>) arg).get(key); Object o = ((Map<?, ?>) arg).get(key);
if (null == o) { if (null == o) {
return ""; // 如果值是null 则直接返回hull
return null;
} }
if (o instanceof Character || o instanceof String) { if (o instanceof Character || o instanceof String) {
// 处理字符类型 // 处理字符类型

View File

@ -21,7 +21,7 @@ import java.util.stream.Collectors;
/** /**
* stream * stream
* *
* @author 528910437@QQ.COM, VampireAchao&lt;achao1441470436@gmail.com&gt;Lion Li&gt; * @author 528910437@QQ.COM, VampireAchao&lt;achao1441470436@gmail.getLogFilePath&gt;Lion Li&gt;
* @since 5.5.2 * @since 5.5.2
*/ */
public class CollStreamUtil { public class CollStreamUtil {

View File

@ -8,7 +8,7 @@ package aiyh.utils.tool.cn.hutool.core.date;
* @see #Q3 * @see #Q3
* @see #Q4 * @see #Q4
* *
* @author zhfish(https://github.com/zhfish) * @author zhfish(https://github.getLogFilePath/zhfish)
* *
*/ */
public enum Quarter { public enum Quarter {

View File

@ -60,7 +60,7 @@ public class ColorUtil {
* 3. RGB13,148,252 * 3. RGB13,148,252
* </pre> * </pre>
* <p> * <p>
* com.lnwazg.kit * getLogFilePath.lnwazg.kit
* *
* @param colorName 16RGB * @param colorName 16RGB
* @return {@link Color} * @return {@link Color}

View File

@ -2015,7 +2015,7 @@ public class ImgUtil {
* 3. RGB13,148,252 * 3. RGB13,148,252
* </pre> * </pre>
* <p> * <p>
* com.lnwazg.kit * getLogFilePath.lnwazg.kit
* *
* @param colorName 16RGB * @param colorName 16RGB
* @return {@link Color} * @return {@link Color}

View File

@ -992,7 +992,7 @@ public class FileUtil extends PathUtil {
/** /**
* <br> * <br>
* prefix[Randon].suffix From com.jodd.io.FileUtil * prefix[Randon].suffix From getLogFilePath.jodd.io.FileUtil
* *
* @param prefix 3 * @param prefix 3
* @param suffix null使.tmp * @param suffix null使.tmp

View File

@ -116,9 +116,9 @@ public class NioUtil {
* @param outChannel * @param outChannel
* @return * @return
* @throws IOException IO * @throws IOException IO
* @link http://androidxref.com/6.0.1_r10/xref/libcore/luni/src/main/java/java/nio/FileChannelImpl.java * @link http://androidxref.getLogFilePath/6.0.1_r10/xref/libcore/luni/src/main/java/java/nio/FileChannelImpl.java
* @link http://androidxref.com/7.0.0_r1/xref/libcore/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java * @link http://androidxref.getLogFilePath/7.0.0_r1/xref/libcore/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java
* @link http://androidxref.com/7.0.0_r1/xref/libcore/ojluni/src/main/native/FileChannelImpl.c * @link http://androidxref.getLogFilePath/7.0.0_r1/xref/libcore/ojluni/src/main/native/FileChannelImpl.c
* @author z8g * @author z8g
* @since 5.7.21 * @since 5.7.21
*/ */

View File

@ -77,8 +77,8 @@ public class WatchServer extends Thread implements Closeable, Serializable {
* *
* *
* <pre> * <pre>
* 1com.sun.nio.file.StandardWatchEventKinds * 1getLogFilePath.sun.nio.file.StandardWatchEventKinds
* 2com.sun.nio.file.SensitivityWatchEventModifier * 2getLogFilePath.sun.nio.file.SensitivityWatchEventModifier
* </pre> * </pre>
* *
* @param modifiers * @param modifiers

View File

@ -144,7 +144,7 @@ public class ClassScanner implements Serializable {
/** /**
* class * class
* *
* @param packageName com | com. | com.abs | com.abs. * @param packageName getLogFilePath | getLogFilePath. | getLogFilePath.abs | getLogFilePath.abs.
* @return * @return
*/ */
public static Set<Class<?>> scanPackage(String packageName) { public static Set<Class<?>> scanPackage(String packageName) {
@ -153,10 +153,10 @@ public class ClassScanner implements Serializable {
/** /**
* classpathclassclass<br> * classpathclassclass<br>
* com.abs + A.class absclassNotFoundException<br> * getLogFilePath.abs + A.class absclassNotFoundException<br>
* className com.abs.A abs.A,<br> * className getLogFilePath.abs.A abs.A,<br>
* *
* @param packageName com | com. | com.abs | com.abs. * @param packageName getLogFilePath | getLogFilePath. | getLogFilePath.abs | getLogFilePath.abs.
* @param classFilter classclass * @param classFilter classclass
* @return * @return
* @since 5.7.5 * @since 5.7.5
@ -167,10 +167,10 @@ public class ClassScanner implements Serializable {
/** /**
* classclass<br> * classclass<br>
* com.abs + A.class absclassNotFoundException<br> * getLogFilePath.abs + A.class absclassNotFoundException<br>
* className com.abs.A abs.A,<br> * className getLogFilePath.abs.A abs.A,<br>
* *
* @param packageName com | com. | com.abs | com.abs. * @param packageName getLogFilePath | getLogFilePath. | getLogFilePath.abs | getLogFilePath.abs.
* @param classFilter classclass * @param classFilter classclass
* @return * @return
*/ */

View File

@ -19,7 +19,7 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.getLogFilePath if you need additional information or have any
* questions. * questions.
*/ */
package aiyh.utils.tool.cn.hutool.core.lang; package aiyh.utils.tool.cn.hutool.core.lang;

View File

@ -26,12 +26,12 @@ import java.util.regex.Pattern;
* *
* <p>: </p> * <p>: </p>
* <ul> * <ul>
* <li>{@code com/t?st.jsp} &mdash; {@code com/test.jsp} {@code com/tast.jsp} {@code com/txst.jsp}</li> * <li>{@code getLogFilePath/t?st.jsp} &mdash; {@code getLogFilePath/test.jsp} {@code getLogFilePath/tast.jsp} {@code getLogFilePath/txst.jsp}</li>
* <li>{@code com/*.jsp} &mdash; {@code com} {@code .jsp}</li> * <li>{@code getLogFilePath/*.jsp} &mdash; {@code getLogFilePath} {@code .jsp}</li>
* <li>{@code com/&#42;&#42;/test.jsp} &mdash; {@code com} {@code test.jsp}</li> * <li>{@code getLogFilePath/&#42;&#42;/test.jsp} &mdash; {@code getLogFilePath} {@code test.jsp}</li>
* <li>{@code cn/hutool/&#42;&#42;/*.jsp} &mdash; {@code cn/hutool}{@code .jsp} </li> * <li>{@code cn/hutool/&#42;&#42;/*.jsp} &mdash; {@code cn/hutool}{@code .jsp} </li>
* <li>{@code org/&#42;&#42;/servlet/bla.jsp} &mdash; {@code cn/hutool/servlet/bla.jsp} {@code cn/hutool/testing/servlet/bla.jsp} {@code org/servlet/bla.jsp}</li> * <li>{@code org/&#42;&#42;/servlet/bla.jsp} &mdash; {@code cn/hutool/servlet/bla.jsp} {@code cn/hutool/testing/servlet/bla.jsp} {@code org/servlet/bla.jsp}</li>
* <li>{@code com/{filename:\\w+}.jsp} {@code com/test.jsp} {@code test} {@code filename} </li> * <li>{@code getLogFilePath/{filename:\\w+}.jsp} {@code getLogFilePath/test.jsp} {@code test} {@code filename} </li>
* </ul> * </ul>
* *
* <p><strong>:</strong> * <p><strong>:</strong>

View File

@ -3830,11 +3830,11 @@ public class CharSequenceUtil {
* <pre> * <pre>
* StrUtil.hide(null,*,*)=null * StrUtil.hide(null,*,*)=null
* StrUtil.hide("",0,*)="" * StrUtil.hide("",0,*)=""
* StrUtil.hide("jackduan@163.com",-1,4) ****duan@163.com * StrUtil.hide("jackduan@163.getLogFilePath",-1,4) ****duan@163.getLogFilePath
* StrUtil.hide("jackduan@163.com",2,3) ja*kduan@163.com * StrUtil.hide("jackduan@163.getLogFilePath",2,3) ja*kduan@163.getLogFilePath
* StrUtil.hide("jackduan@163.com",3,2) jackduan@163.com * StrUtil.hide("jackduan@163.getLogFilePath",3,2) jackduan@163.getLogFilePath
* StrUtil.hide("jackduan@163.com",16,16) jackduan@163.com * StrUtil.hide("jackduan@163.getLogFilePath",16,16) jackduan@163.getLogFilePath
* StrUtil.hide("jackduan@163.com",16,17) jackduan@163.com * StrUtil.hide("jackduan@163.getLogFilePath",16,17) jackduan@163.getLogFilePath
* </pre> * </pre>
* *
* @param str * @param str
@ -3857,7 +3857,7 @@ public class CharSequenceUtil {
* StrUtil.desensitized("09157518479", DesensitizedUtil.DesensitizedType.FIXED_PHONE)) = "0915*****79" * StrUtil.desensitized("09157518479", DesensitizedUtil.DesensitizedType.FIXED_PHONE)) = "0915*****79"
* StrUtil.desensitized("18049531999", DesensitizedUtil.DesensitizedType.MOBILE_PHONE)) = "180****1999" * StrUtil.desensitized("18049531999", DesensitizedUtil.DesensitizedType.MOBILE_PHONE)) = "180****1999"
* StrUtil.desensitized("北京市海淀区马连洼街道289号", DesensitizedUtil.DesensitizedType.ADDRESS)) = "北京市海淀区马********" * StrUtil.desensitized("北京市海淀区马连洼街道289号", DesensitizedUtil.DesensitizedType.ADDRESS)) = "北京市海淀区马********"
* StrUtil.desensitized("duandazhi-jack@gmail.com.cn", DesensitizedUtil.DesensitizedType.EMAIL)) = "d*************@gmail.com.cn" * StrUtil.desensitized("duandazhi-jack@gmail.getLogFilePath.cn", DesensitizedUtil.DesensitizedType.EMAIL)) = "d*************@gmail.getLogFilePath.cn"
* StrUtil.desensitized("1234567890", DesensitizedUtil.DesensitizedType.PASSWORD)) = "**********" * StrUtil.desensitized("1234567890", DesensitizedUtil.DesensitizedType.PASSWORD)) = "**********"
* StrUtil.desensitized("苏D40000", DesensitizedUtil.DesensitizedType.CAR_LICENSE)) = "苏D4***0" * StrUtil.desensitized("苏D40000", DesensitizedUtil.DesensitizedType.CAR_LICENSE)) = "苏D4***0"
* StrUtil.desensitized("11011111222233333256", DesensitizedType.BANK_CARD)) = "1101 **** **** **** 3256" * StrUtil.desensitized("11011111222233333256", DesensitizedType.BANK_CARD)) = "1101 **** **** **** 3256"

View File

@ -8,7 +8,7 @@ import java.util.concurrent.ExecutionException;
* {@link CompletableFuture}<br> * {@link CompletableFuture}<br>
* {@link CompletableFuture} Future * {@link CompletableFuture} Future
* *
* @author achao1441470436@gmail.com * @author achao1441470436@gmail.getLogFilePath
* @since 5.7.17 * @since 5.7.17
*/ */
public class AsyncUtil { public class AsyncUtil {

View File

@ -94,7 +94,7 @@ public class ClassUtil {
* ClassUtil<br> * ClassUtil<br>
* *
* <pre> * <pre>
* isSimplefalse: "com.xiaoleilu.hutool.util.ClassUtil" * isSimplefalse: "getLogFilePath.xiaoleilu.hutool.util.ClassUtil"
* isSimpletrue: "ClassUtil" * isSimpletrue: "ClassUtil"
* </pre> * </pre>
* *
@ -216,7 +216,7 @@ public class ClassUtil {
/** /**
* class * class
* *
* @param packageName com | com. | com.abs | com.abs. * @param packageName getLogFilePath | getLogFilePath. | getLogFilePath.abs | getLogFilePath.abs.
* @return * @return
* @see ClassScanner#scanPackage(String) * @see ClassScanner#scanPackage(String)
*/ */
@ -226,10 +226,10 @@ public class ClassUtil {
/** /**
* classclass<br> * classclass<br>
* com.abs + A.class absclassNotFoundException<br> * getLogFilePath.abs + A.class absclassNotFoundException<br>
* className com.abs.A abs.A,,<br> * className getLogFilePath.abs.A abs.A,,<br>
* *
* @param packageName com | com. | com.abs | com.abs. * @param packageName getLogFilePath | getLogFilePath. | getLogFilePath.abs | getLogFilePath.abs.
* @param classFilter classclass * @param classFilter classclass
* @return * @return
*/ */
@ -626,7 +626,7 @@ public class ClassUtil {
* *
* *
* @param <T> * @param <T>
* @param classNameWithMethodName {@code .}{@code #} com.xiaoleilu.hutool.StrUtil.isEmpty com.xiaoleilu.hutool.StrUtil#isEmpty * @param classNameWithMethodName {@code .}{@code #} getLogFilePath.xiaoleilu.hutool.StrUtil.isEmpty getLogFilePath.xiaoleilu.hutool.StrUtil#isEmpty
* @param args * @param args
* @return * @return
*/ */
@ -640,7 +640,7 @@ public class ClassUtil {
* static<br> * static<br>
* *
* @param <T> * @param <T>
* @param classNameWithMethodName com.xiaoleilu.hutool.StrUtil#isEmptycom.xiaoleilu.hutool.StrUtil.isEmpty * @param classNameWithMethodName getLogFilePath.xiaoleilu.hutool.StrUtil#isEmptycom.xiaoleilu.hutool.StrUtil.isEmpty
* @param isSingleton false * @param isSingleton false
* @param args * @param args
* @return * @return
@ -956,7 +956,7 @@ public class ClassUtil {
/** /**
* <br> * <br>
* <br> * <br>
* com.xiaoleilu.hutool.util.ClassUtil = com.xiaoleilu.hutool.util * getLogFilePath.xiaoleilu.hutool.util.ClassUtil = getLogFilePath.xiaoleilu.hutool.util
* *
* @param clazz * @param clazz
* @return * @return
@ -976,7 +976,7 @@ public class ClassUtil {
/** /**
* <br> * <br>
* <br> * <br>
* com.xiaoleilu.hutool.util.ClassUtil = com/xiaoleilu/hutool/util * getLogFilePath.xiaoleilu.hutool.util.ClassUtil = getLogFilePath/xiaoleilu/hutool/util
* *
* @param clazz * @param clazz
* @return * @return

View File

@ -14,7 +14,7 @@ import java.util.Objects;
* : https://tool.lu/coordinate/<br> * : https://tool.lu/coordinate/<br>
* https://github.com/JourWon/coordinate-transform * https://github.com/JourWon/coordinate-transform
* *
* @author hongzhe.qin(qin462328037at163.com), looly * @author hongzhe.qin(qin462328037at163.getLogFilePath), looly
* @since 5.7.16 * @since 5.7.16
*/ */
public class CoordinateUtil { public class CoordinateUtil {

View File

@ -90,7 +90,7 @@ public class DesensitizedUtil {
* DesensitizedUtil.desensitized("09157518479", DesensitizedUtil.DesensitizedType.FIXED_PHONE)) = "0915*****79" * DesensitizedUtil.desensitized("09157518479", DesensitizedUtil.DesensitizedType.FIXED_PHONE)) = "0915*****79"
* DesensitizedUtil.desensitized("18049531999", DesensitizedUtil.DesensitizedType.MOBILE_PHONE)) = "180****1999" * DesensitizedUtil.desensitized("18049531999", DesensitizedUtil.DesensitizedType.MOBILE_PHONE)) = "180****1999"
* DesensitizedUtil.desensitized("北京市海淀区马连洼街道289号", DesensitizedUtil.DesensitizedType.ADDRESS)) = "北京市海淀区马********" * DesensitizedUtil.desensitized("北京市海淀区马连洼街道289号", DesensitizedUtil.DesensitizedType.ADDRESS)) = "北京市海淀区马********"
* DesensitizedUtil.desensitized("duandazhi-jack@gmail.com.cn", DesensitizedUtil.DesensitizedType.EMAIL)) = "d*************@gmail.com.cn" * DesensitizedUtil.desensitized("duandazhi-jack@gmail.getLogFilePath.cn", DesensitizedUtil.DesensitizedType.EMAIL)) = "d*************@gmail.getLogFilePath.cn"
* DesensitizedUtil.desensitized("1234567890", DesensitizedUtil.DesensitizedType.PASSWORD)) = "**********" * DesensitizedUtil.desensitized("1234567890", DesensitizedUtil.DesensitizedType.PASSWORD)) = "**********"
* DesensitizedUtil.desensitized("苏D40000", DesensitizedUtil.DesensitizedType.CAR_LICENSE)) = "苏D4***0" * DesensitizedUtil.desensitized("苏D40000", DesensitizedUtil.DesensitizedType.CAR_LICENSE)) = "苏D4***0"
* DesensitizedUtil.desensitized("11011111222233333256", DesensitizedUtil.DesensitizedType.BANK_CARD)) = "1101 **** **** **** 3256" * DesensitizedUtil.desensitized("11011111222233333256", DesensitizedUtil.DesensitizedType.BANK_CARD)) = "1101 **** **** **** 3256"
@ -252,7 +252,7 @@ public class DesensitizedUtil {
} }
/** /**
* @d**@126.com * @d**@126.getLogFilePath
* *
* @param email * @param email
* @return * @return

View File

@ -14,7 +14,7 @@ package aiyh.utils.tool.cn.hutool.core.util;
* <li>....</li> * <li>....</li>
* </ul> * </ul>
* *
* @author xl7@qq.com * @author xl7@qq.getLogFilePath
* @since 5.5.8 * @since 5.5.8
*/ */

View File

@ -111,7 +111,7 @@ public class XmlUtil {
/** /**
* DocumentBuilderFactory * DocumentBuilderFactory
*/ */
private static String defaultDocumentBuilderFactory = "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"; private static String defaultDocumentBuilderFactory = "getLogFilePath.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl";
/** /**
* *
@ -621,7 +621,7 @@ public class XmlUtil {
/** /**
* {@link DocumentBuilderFactory} * {@link DocumentBuilderFactory}
* <p> * <p>
* 使"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"<br> * 使"getLogFilePath.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"<br>
* 使{@link #disableDefaultDocumentBuilderFactory()} * 使{@link #disableDefaultDocumentBuilderFactory()}
* </p> * </p>
* *

View File

@ -124,7 +124,7 @@ public final class InternalJSONUtil {
/** /**
* PropertyJSON<br> * PropertyJSON<br>
* com.luxiaolei.package.hutool<br> * getLogFilePath.luxiaolei.package.hutool<br>
* JSONObject * JSONObject
* *
* @param jsonObject JSONObject * @param jsonObject JSONObject

View File

@ -4,7 +4,7 @@ package aiyh.utils.tool.org.apache.commons.jexl3.parser;
/** /**
* Token literal values and constants. * Token literal values and constants.
* Generated by com.helger.pgcc.output.java.OtherFilesGenJava#start() * Generated by getLogFilePath.helger.pgcc.output.java.OtherFilesGenJava#start()
*/ */
public interface ParserConstants { public interface ParserConstants {

View File

@ -1,13 +1,13 @@
package com.api.chaoyang.he.hcy_xintiantongxin.projectorder.controller;//package com.api.hcy_xintiantongxin.projectorder.controller; package com.api.chaoyang.he.hcy_xintiantongxin.projectorder.controller;//package getLogFilePath.api.hcy_xintiantongxin.projectorder.controller;
// //
//import aiyh.utils.ApiResult; //import aiyh.utils.ApiResult;
//import aiyh.utils.Util; //import aiyh.utils.Util;
//import com.api.hcy_xintiantongxin.projectorder.service.ExportExcelAVPNService; //import getLogFilePath.api.hcy_xintiantongxin.projectorder.service.ExportExcelAVPNService;
//import com.api.hcy_xintiantongxin.projectorder.service.ExportExcelL3NSService; //import getLogFilePath.api.hcy_xintiantongxin.projectorder.service.ExportExcelL3NSService;
//import com.api.hcy_xintiantongxin.projectorder.service.ExportExcelOtherService; //import getLogFilePath.api.hcy_xintiantongxin.projectorder.service.ExportExcelOtherService;
//import com.api.hcy_xintiantongxin.projectorder.service.impl.ExportExcelAVPNServiceImpl; //import getLogFilePath.api.hcy_xintiantongxin.projectorder.service.impl.ExportExcelAVPNServiceImpl;
//import com.api.hcy_xintiantongxin.projectorder.service.impl.ExportExcelL3NSServiceImpl; //import getLogFilePath.api.hcy_xintiantongxin.projectorder.service.impl.ExportExcelL3NSServiceImpl;
//import com.api.hcy_xintiantongxin.projectorder.service.impl.ExportExcelOtherServiceImpl; //import getLogFilePath.api.hcy_xintiantongxin.projectorder.service.impl.ExportExcelOtherServiceImpl;
//import org.apache.log4j.Logger; //import org.apache.log4j.Logger;
//import weaver.conn.RecordSet; //import weaver.conn.RecordSet;
//import weaver.wechat.util.Utils; //import weaver.wechat.util.Utils;
@ -30,7 +30,7 @@ package com.api.chaoyang.he.hcy_xintiantongxin.projectorder.controller;//package
//import java.util.zip.ZipEntry; //import java.util.zip.ZipEntry;
//import java.util.zip.ZipOutputStream; //import java.util.zip.ZipOutputStream;
// //
//import static com.caucho.server.log.AccessLog.BUFFER_SIZE; //import static getLogFilePath.caucho.server.log.AccessLog.BUFFER_SIZE;
// //
//@Path("/export") //@Path("/export")
//public class ExportExcelApi_copy { //public class ExportExcelApi_copy {

View File

@ -0,0 +1,108 @@
package com.api.customization.ey.jiahx.web;
import com.alibaba.fastjson.JSONObject;
import com.api.nonstandardext.model_field_async.service.ModelFieldAsyncServiceImpl;
import com.weaver.general.TimeUtil;
import weaver.conn.RecordSet;
import weaver.formmode.setup.ModeRightInfo;
import weaver.general.BaseBean;
import weaver.general.Util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.ArrayList;
import java.util.List;
/**
* @Description
* @Author
* @Date 2023/5/22
* @Other
* @Version
*/
@Path("/pushData")
public class ButtonTriggeringGenerateData {
private static final BaseBean baseBean = new BaseBean();
private static weaver.formmode.setup.ModeRightInfo ModeRightInfo = new ModeRightInfo();//模块信息
private static String currentdate = TimeUtil.getCurrentDateString();//当前日期
private static String currenttime = TimeUtil.getOnlyCurrentTimeString();//当前时间
private final ModelFieldAsyncServiceImpl service = new ModelFieldAsyncServiceImpl();
@GET
@Path("/doPushData")
@Produces({MediaType.TEXT_PLAIN})
public JSONObject doPushData(@Context HttpServletRequest request, @Context HttpServletResponse response){
baseBean.writeLog("点击按钮获得进行流程主表数据传递到明细表开始>>>>>>>>");
RecordSet rs = new RecordSet();
String sql = "select m.invoiceNo invoiceNo,d.mainid mainid,d.totalAmount totalAmount,m.yjthzje yjthzje,m.customerCode customerCode" +
",m.customerName customerName,m.groupinvoiceno groupinvoiceno,m.finishedTime finishedTime,m.orifinishedTime orifinishedTime," +
"m.hzjtyqz hzjtyqz,m.arState arState,m.yskje yskje,m.qskje qskje,m.wskje wskje,m.kpzt kpzt,m.sckprq sckprq,m.ykpje ykpje,m.wkpje wkpje from uf_zdjmbd_dt2 d left join uf_zdjmbd m on m.id = d.mainid ";
baseBean.writeLog("查询明细表2的数据sql为=====" + sql);
rs.executeQuery(sql);
JSONObject jsonObject = new JSONObject();
List<Boolean> list = new ArrayList<>();
boolean flag = false;
while (rs.next()) {
String invoiceNo = Util.null2String(rs.getString("invoiceNo"));
if (!invoiceNo.equals("")) {
String mainid = Util.null2String(rs.getString("mainid"));//id
String zdje = Util.null2String(rs.getString("totalAmount"));//总金额
String jyjtje = Util.null2String(rs.getString("yjthzje"));//计划计提金额
String customerCode = Util.null2String(rs.getString("customerCode"));//客户编码
String customerName = Util.null2String(rs.getString("customerName"));//客户名称
String group_invoice_no = Util.null2String(rs.getString("groupinvoiceno"));//组账单ID
String finishedTime = Util.null2String(rs.getString("finishedTime"));//账单开具日期
String orifinishedTime = Util.null2String(rs.getString("orifinishedTime"));//原账单开具日期
String sqjtyqrq = Util.null2String(rs.getString("hzjtyqz"));//坏账计提延期至
String skzt = Util.null2String(rs.getString("arState"));//实收状态
String yskje = Util.null2String(rs.getString("yskje"));//收款金额
String qskje = Util.null2String(rs.getString("qskje"));//其他收款金额
String wskje = Util.null2String(rs.getString("wskje"));//未收款金额
String kpzt = Util.null2String(rs.getString("kpzt"));//开票状态
String sckprq = Util.null2String(rs.getString("sckprq"));//首次开票日期
String ykpje = Util.null2String(rs.getString("ykpje"));//已开票金额
String wkpje = Util.null2String(rs.getString("wkpje"));//客户编码
String fbmxzt = "0";//客户编码
String sjjtje = wskje;//实际计提金额
RecordSet recordSet = new RecordSet();
String insertSql = "insert into uf_zdjmbd_dt4 (mainid,group_invoice_no,invoiceNo,finishedTime," +
"orifinishedTime,sqjtyqrq,zdje,skzt,yskje,qskje,wskje,kpzt,sckprq,ykpje,wkpje,jyjtje,sjjtje,customerCode,customerName,fbmxzt) values (?,?,?,?,?,?," +
"?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
baseBean.writeLog("插入的明细表的sql为" + insertSql);
if (!"".equals(skzt)) {
baseBean.writeLog("我进入判断了>>>>>");
boolean b = recordSet.executeUpdate(insertSql, mainid, group_invoice_no, invoiceNo, finishedTime, orifinishedTime, sqjtyqrq, zdje, skzt, yskje, qskje, wskje, kpzt, sckprq, ykpje, wkpje, jyjtje, sjjtje, customerCode, customerName, fbmxzt);
list.add(b);
}
/**
*
* @author xuanran.wang
* @date 2023-06-27
*/
service.asyncDataByClassName(this.getClass().getSimpleName(), mainid);
}
}
baseBean.writeLog("list===" + list);
if(!list.isEmpty()){
if (list.contains(false)) {
baseBean.writeLog("aaaaaaaaaaaaa");
jsonObject.put("result", flag);
}else {
flag = true;
jsonObject.put("result", flag);
}
}else {
jsonObject.put("result", flag);
}
return jsonObject;
}
}

View File

@ -0,0 +1,83 @@
package com.api.ebu7dev1.common.getlog.controller;
import aiyh.utils.ApiResult;
import aiyh.utils.Util;
import com.alibaba.fastjson.JSONObject;
import com.api.ebu7dev1.common.getlog.service.GetLogService;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.log4j.Logger;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.HashMap;
import java.util.Map;
/**
* <h1></h1>
*
* <p>create: 2023/7/1 10:27</p>
*
* @author youHong.ai
*/
@Path("/ebu7-dev1/common/log/")
public class GetLogController {
private final Logger log = Util.getLogger();
private final GetLogService service = new GetLogService();
@GET
@Path("ipList")
@Produces(MediaType.APPLICATION_JSON)
public String getIpList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User loginUser = HrmUserVarify.getUser(request, response);
String path = request.getRealPath("/");
return ApiResult.success(service.getIpList(loginUser, path));
} catch (Exception e) {
log.error("获取ip节点出错 : " + e.getMessage());
log.error(Util.getErrString(e));
return ApiResult.error("获取ip节点出错!");
}
}
@GET
@Path("get")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response getLogger(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User loginUser = HrmUserVarify.getUser(request, response);
return service.get(loginUser);
} catch (Exception e) {
log.error("下载文件出错:" + Util.getErrString(e));
return Response.ok(ApiResult.error("system error!"), MediaType.APPLICATION_JSON).build();
}
}
@POST
@Path("collect")
@Produces(MediaType.APPLICATION_JSON)
public String collectLogInfo(@Context HttpServletRequest request,
@Context HttpServletResponse response,
@RequestBody Map<String, Object> params) {
try {
User loginUser = HrmUserVarify.getUser(request, response);
String path = request.getRealPath("/");
params.put("ecologyPath", path);
return ApiResult.success(service.collectLogInfo(loginUser, params));
} catch (Exception e) {
log.error("下载文件出错:" + Util.getErrString(e));
return ApiResult.error("system error!");
}
}
}

View File

@ -0,0 +1,58 @@
package com.api.ebu7dev1.common.getlog.enums;
import weaver.xiao.commons.config.enumtype.DataSourceEnum;
import java.io.File;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/7/1 16:24
*/
public enum LogTypeEnum {
THREAD(1, "0", "log" + File.separator + "thread","thread"),
ECOLOGY(1, "1", "log","ecology"),
RESIN(0, "2", "log","Resin"),
SECURITY(1, "3","WEB-INF" + File.separator + "securitylog","security"),
INTEGRATION(1,"4", "log" + File.separator + "integration","integration"),
SQL(1, "5", "log" + File.separator + "sql","sql"),
UTIL_CUS(1,"6", "log" + File.separator + "cus" + File.separator + "util_cus","util_cus"),
SQL_LOG(1,"7","log" + File.separator + "cus" + File.separator + "sql_log","sql_log"),
HTTP_UTIL(1,"8","log" + File.separator + "cus" + File.separator + "http_util","http_util");
private final Integer logBelongType;
private final String value;
private final String logPath;
private final String key;
LogTypeEnum(Integer logBelongType, String value, String logPath,String key) {
this.logBelongType = logBelongType;
this.value = value;
this.logPath = logPath;
this.key = key;
}
public final static Map<String, LogTypeEnum> ENUMS = new HashMap<>(16);
static {
for (LogTypeEnum typeEnum : EnumSet.allOf(LogTypeEnum.class)){
ENUMS.put(typeEnum.value,typeEnum);
}
}
public String getValue() {
return value;
}
public Integer getLogBelongType() {
return logBelongType;
}
public String getLogPath() {
return logPath;
}
public String getKey() {
return key;
}
}

View File

@ -0,0 +1,79 @@
package com.api.ebu7dev1.common.getlog.service;
import aiyh.utils.Util;
import com.api.ebu7dev1.common.getlog.util.GetLogUtil;
import org.apache.commons.collections.CollectionUtils;
import weaver.hrm.User;
import javax.ws.rs.core.Response;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* <h1></h1>
*
* <p>create: 2023/7/1 10:28</p>
*
* @author youHong.ai
*/
public class GetLogService {
public Response get(User loginUser) {
return null;
}
/**
* <h1>ip</h1>
* @author xuanran.wang
* @dateTime 2023/7/1 14:19
* @param ecologyPath ec
* @return ip ip
**/
public Set<String> getIpList(User loginUser, String ecologyPath){
GetLogUtil.checkUser(loginUser);
String weaverPropertiesPath;
String resinPath = System.getProperty("user.dir") + File.separator;
if (ecologyPath.endsWith(File.separator)) {
weaverPropertiesPath = ecologyPath + "WEB-INF" + File.separator + "prop" + File.separator + "weaver.properties";
} else {
weaverPropertiesPath = ecologyPath + File.separator + "WEB-INF" + File.separator + "prop" + File.separator + "weaver.properties";
}
String localIp = GetLogUtil.getInnerIp();
Set<String> ipList = GetLogUtil.readEcologyProp(weaverPropertiesPath);
if(CollectionUtils.isEmpty(ipList)){
String resinBinPath = resinPath + "bin" + File.separator + "startresin.sh";
ipList.addAll(GetLogUtil.readResinProp(resinBinPath));
}
if (ipList.size() != 0) {//没有集群的时候
boolean status = false;
for (String ip : ipList) {
if (ip.contains(localIp) || "127.0.0.1".equals(ip) || "127.0.0.1".equals(localIp)) {
status = true;
break;
}
}
if (!status) {
ipList.add(localIp);
}
}else {
ipList.add(localIp);
}
return ipList;
}
public String collectLogInfo(User loginUser, Map<String, Object> params) throws FileNotFoundException {
GetLogUtil.checkUser(loginUser);
String startDate = Util.null2String(params.get("startDate"));
String endDate = Util.null2String(params.get("endDate"));
String ecologyPath = Util.null2String(params.get("ecologyPath"));
List<String> logTypeList = (List<String>) params.get("selectLogType");
String resinPath = System.getProperty("user.dir") + File.separator;
List<Map<String, String>> path = GetLogUtil.getLogPathByLogType(ecologyPath, resinPath, logTypeList);
Map<String, Map<String, List<String>>> map = GetLogUtil.getLogFilePath(path, startDate, endDate);
return GetLogUtil.collectLog(ecologyPath, map);
}
}

View File

@ -0,0 +1,565 @@
package com.api.ebu7dev1.common.getlog.util;
import java.io.*;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import aiyh.utils.excention.CustomerException;
import com.api.ebu7dev1.common.getlog.enums.LogTypeEnum;
import org.apache.commons.io.IOUtils;
import weaver.hrm.User;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/7/1 14:00
*/
public class GetLogUtil {
public static void checkUser(User loginUser) {
if (loginUser.getUID() != 1) {
throw new CustomerException("无权限查看!");
}
}
/**
* <h1>ec weaver.properties ip</h1>
*
* @param weaverPropertiesPath ec weaver.properties
* @return ip
* @author xuanran.wang
* @dateTime 2023/7/1 14:08
**/
public static Set<String> readEcologyProp(String weaverPropertiesPath) {
File file = new File(weaverPropertiesPath);
Set<String> res = new HashSet<>();
try {
if (!file.exists()) {
return res;
}
Properties registerProp = new Properties();
InputStreamReader reader = new InputStreamReader(Files.newInputStream(file.toPath()));
registerProp.load(reader);
String initialHost = registerProp.getProperty("initial_hosts");
if (initialHost != null && !"".equals(initialHost)) {
String[] initialHosts = initialHost.split(",");
for (String initial_hostStr : initialHosts) {
if (!initial_hostStr.isEmpty()) {
res.add(initial_hostStr);
}
}
}
IOUtils.closeQuietly(reader);
} catch (IOException e) {
e.printStackTrace();
}
return res;
}
/**
* <h1> resin </h1>
*
* @param resinStartPath resin
* @return ip
* @author xuanran.wang
* @dateTime 2023/7/1 14:10
**/
public static Set<String> readResinProp(String resinStartPath) {
File resinFile = new File(resinStartPath);
Set<String> res = new HashSet<>();
if (!resinFile.exists()) {
return res;
}
if (resinFile.isFile() && resinFile.length() > 0) {
FileInputStream fileInput = null;
BufferedReader bufferedReader = null;
try {
fileInput = new FileInputStream(resinFile);
bufferedReader = new BufferedReader(new InputStreamReader(fileInput));
String str;
while ((str = bufferedReader.readLine()) != null) {
if (str.contains("-Dinitial_hosts") || str.contains("-J-Dinitial_hosts")) {
if (str.contains("-J-Dinitial_hosts")) {
str = str.substring(str.indexOf("-J-Dinitial_hosts") + 17);
}
if (str.contains("-Dinitial_hosts")) {
str = str.substring(str.indexOf("-Dinitial_hosts") + 15);
}
str = str.contains("=") ? str.substring(str.indexOf("=") + 1) : str;
str = str.contains("-") ? str.substring(0, str.indexOf("-")) : str;
str = str.contains(" ") ? str.substring(0, str.indexOf(" ")) : str;
String[] ips = str.split(",");
for (String ip : ips) {
try {
String tmpIp = ip.replace(".", "").replace(":", "");
Long.parseLong(tmpIp.trim());
res.add(ip.trim());
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
} catch (Throwable t) {
t.printStackTrace();
} finally {
IOUtils.closeQuietly(fileInput);
IOUtils.closeQuietly(bufferedReader);
}
}
return res;
}
/**
* <h1>ip</h1>
*
* @return ip
* @author xuanran.wang
* @dateTime 2023/7/1 14:17
**/
public static String getInnerIp() {
try {
Enumeration<NetworkInterface> netInterfaces = NetworkInterface.getNetworkInterfaces();
while (netInterfaces.hasMoreElements()) {
NetworkInterface ni = netInterfaces.nextElement();
Enumeration<InetAddress> nii = ni.getInetAddresses();
while (nii.hasMoreElements()) {
InetAddress inetAddress = nii.nextElement();
if (!inetAddress.getHostAddress().contains(":")) {
String ip = inetAddress.getHostAddress();
if (ip.startsWith("10.") || ip.startsWith("192.168.")) {// ||
return ip;
} else {
if (ip.startsWith("172.")) {
return ip;
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return "127.0.0.1";
}
/**
* <h1></h1>
*
* @param ecPath ec
* @param resinPath resin
* @param logTypeList
* @return
* @author xuanran.wang
* @dateTime 2023/7/1 16:56
**/
public static List<Map<String, String>> getLogPathByLogType(String ecPath, String resinPath, List<String> logTypeList) {
List<Map<String, String>> list = new ArrayList<>();
for (String logType : logTypeList) {
Map<String, String> map = new HashMap<>();
LogTypeEnum typeEnum = LogTypeEnum.ENUMS.get(logType);
Integer logBelongType = typeEnum.getLogBelongType();
String logPath = typeEnum.getLogPath();
String basePath = ecPath;
if (logBelongType == 0) {
basePath = resinPath;
}
map.put("logType", logType);
map.put("path", basePath + File.separator + logPath);
map.put("key", typeEnum.getKey());
list.add(map);
}
return list;
}
/**
* <h1></h1>
*
* @param logPath
* @param startDate
* @param endDate
* @return <p>
* {
* "2023-07-01":{
* "http_util":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/cus/http_util/cus.log"
* ],
* "ecology":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/ecology"
* ],
* "security":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/WEB-INF/securitylog/systemRunInfo2023-07-01.log",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/WEB-INF/securitylog/systemSecurity2023-07-01.log"
* ],
* "util_cus":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/cus/util_cus/cus.log"
* ],
* "Resin":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/stdout.log",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/stderr.log",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/watchdog-manager.log",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/jvm-default.log"
* ],
* "integration":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/integration/integration.log"
* ],
* "thread":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/thread/2023-07-01"
* ],
* "sql_log":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/cus/sql_log/cus.log"
* ],
* "sql":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/sql/sqlcount_2023-07-01.log",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/sql/sqltime_2023-07-01.log"
* ]
* },
* "2023-07-02":{
* "http_util":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/cus/http_util/cus.log_20230702.log"
* ],
* "ecology":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/ecology_20230702.log"
* ],
* "security":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/WEB-INF/securitylog/systemRunInfo2023-07-02.log",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/WEB-INF/securitylog/systemSecurity2023-07-02.log"
* ],
* "util_cus":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/cus/util_cus/cus.log_20230702.log"
* ],
* "Resin":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/stdout-20230702.log.gz",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/stderr-20230702.log.gz",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/watchdog-manager.log",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/jvm-default.log"
* ],
* "integration":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/integration/integration.log_20230702.log"
* ],
* "thread":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/thread/2023-07-02"
* ],
* "sql_log":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/cus/sql_log/cus.log_20230702.log"
* ],
* "sql":[
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/sql/sqlcount_2023-07-02.log",
* "/Users/wangxuanran/company/project/ebu_ecology_dev1/log/sql/sqltime_2023-07-02.log"
* ]
* }
* }
* </p>
* @author xuanran.wang
* @dateTime 2023/7/1 18:26
**/
public static Map<String, Map<String, List<String>>> getLogFilePath(List<Map<String, String>> logPath, String startDate, String endDate) {
Map<String, Map<String, List<String>>> res = new HashMap<>();
List<String> dateList = getDateList(startDate, endDate);
for (String date : dateList) {
Map<String, List<String>> keyMap = new HashMap<>();
for (Map<String, String> map : logPath) {
boolean isToDay = isToDay(date);
String key = map.get("key");
List<String> pathList = parseLogFilePath(key, map.get("path"), date, isToDay);
keyMap.put(key, pathList);
}
res.put(date, keyMap);
}
return res;
}
public static String collectLog(String ecologyPath, Map<String, Map<String, List<String>>> pathListKeyMap) throws FileNotFoundException {
FileOutputStream fos;
String outPath = ecologyPath + File.separator + "getlog" + File.separator + "log" + File.separator + (System.currentTimeMillis() / 1000);
File outFile = null;
try {
outFile = new File(outPath);
if (!outFile.exists()) {
outFile.mkdirs();
}
} catch (Exception e) {
e.printStackTrace();
}
String outLogPath = outFile + File.separator + getInnerIp() + "_downLog.zip";
fos = new FileOutputStream(outLogPath);
try {
ZipOutputStream zos = new ZipOutputStream(fos);
zos.setLevel(1);
for (Map.Entry<String, Map<String, List<String>>> entry : pathListKeyMap.entrySet()) {
String date = entry.getKey();
Map<String, List<String>> value = entry.getValue();
for (Map.Entry<String, List<String>> pathKeyList : value.entrySet()) {
String key = pathKeyList.getKey();
String basePath = date + File.separator;
List<String> pathList = pathKeyList.getValue();
for (String path : pathList) {
if ("sqllog".equals(key)) {
basePath += ("sqllog" + File.separator);
}
if ("monitorevent".equals(key)) {
basePath += ("event" + File.separator);
}
if ("monitorlog".equals(key)) {
basePath += ("monitorlog" + File.separator);
}
if (key.equals("cus")) {
basePath += ("cus" + File.separator);
}
if (key.equals("util_cus")) {
basePath += ("util_cus" + File.separator);
}
if (key.equals("sql_log")) {
basePath += ("sql_log" + File.separator);
}
if (key.equals("http_util")) {
basePath += ("http_util" + File.separator);
}
compressbyType(path, zos, basePath);
}
}
}
System.out.println("日志文件地址 : " + outLogPath);
try {
zos.close();
} catch (Exception es) {
}
if (fos != null) {
fos.close();
}
} catch (Exception e) {
}
return outLogPath;
}
/**
*
*
* @param src
* @param zos
* @param baseDir
*/
private static void compressbyType(String src, ZipOutputStream zos, String baseDir) {
File srcFile = new File(src);
if (!srcFile.exists()) {
return;
}
//判断文件是否是文件如果是文件调用compressFile方法,如果是路径则调用compressDir方法
if (srcFile.isFile()) {
//src是文件调用此方法
compressFile(srcFile, zos, baseDir);
} else if (srcFile.isDirectory()) {
compressDir(srcFile, zos, baseDir);
}
}
/**
* 80M
*/
private static void compressFile(File file, ZipOutputStream zos, String baseDir) {
if (!file.exists())
return;
try {
RandomAccessFile fileRead = new RandomAccessFile(file, "r"); //用读模式
long fileLength = fileRead.length();//获得文件长度
if (file.getName().endsWith(".log") && fileLength > 1073741820) {//如果文件超过80M则只取文件倒数80M内容
fileRead.seek(fileLength - 1073741820);
} else {
fileRead.seek(0);
}
ZipEntry entry = new ZipEntry(baseDir + file.getName());
zos.putNextEntry(entry);
int hasRead;
byte[] buf = new byte[1024];
while ((hasRead = fileRead.read(buf)) != -1) {
zos.write(buf, 0, hasRead);
}
fileRead.close();
} catch (Exception e) {
}
}
/**
*
*/
private static void compressDir(File dir, ZipOutputStream zos, String baseDir) {
if (!dir.exists())
return;
File[] files = dir.listFiles();
for (int i = 0; i < files.length; i++) {
File file = files[i];
compressFile(file, zos, baseDir + dir.getName() + File.separator);
}
}
public static List<String> parseLogFilePath(String key, String path, String date, boolean isToDay) {
List list = new ArrayList();
if ("thread".equals(key)) {
list.add(path + File.separator + date);
} else if ("mem".equals(key)) {
list.add(path + File.separator + "memory_" + date + ".log");
} else if ("ecology".equals(key)) {
if (isToDay) {
list.add(path + File.separator + "ecology");
} else {
list.add(path + File.separator + "ecology_" + getDateStr(date) + ".log");
}
} else if ("sql".equals(key)) {
list.add(path + File.separator + "sqlcount_" + date + ".log");
list.add(path + File.separator + "sqltime_" + date + ".log");
} else if ("integration".equals(key)) {
if (isToDay) {
list.add(path + File.separator + "integration.log");
} else {
list.add(path + File.separator + "integration.log_" + getDateStr(date) + ".log");
}
} else if ("security".equals(key)) {
list.add(path + File.separator + "systemRunInfo" + date + ".log");
list.add(path + File.separator + "systemSecurity" + date + ".log");
} else if ("Resin".equals(key)) {
if (isToDay) {
list.add(path + File.separator + "stdout.log");
list.add(path + File.separator + "stderr.log");
} else {
list.add(path + File.separator + "stdout-" + getDateStr(date) + ".log.gz");
list.add(path + File.separator + "stderr-" + getDateStr(date) + ".log.gz");
}
list.add(path + File.separator + "watchdog-manager.log");
list.add(path + File.separator + "jvm-default.log");
} else if ("sqllog".equals(key)) {
list.add(path + File.separator + getSqlPathByDate(date));
list.add(path + File.separator);
} else if ("monitorevent".equals(key)) {
list.addAll(eventLog(path, date));
} else if ("monitorPool".equals(key)) {
list.add(path + File.separator + "pool_" + getDateStr(date) + "_ecology.log");
list.add(path + File.separator + "pool_" + getDateStr(date) + "_ecology.zip");
} else if ("monitorlog".equals(key)) {
if (isToDay) {
list.add(path + File.separator + "stdout.log");
list.add(path + File.separator + "stderr-log");
} else {
list.add(path + File.separator + "stdout-" + getDateStr(date) + ".log.gz");
list.add(path + File.separator + "stderr-" + getDateStr(date) + ".log.gz");
}
} else if ("monitorconcurrent".equals(key)) {
list.add(path + File.separator + "concurrent_" + getDateStr(date) + ".log");
list.add(path + File.separator + "concurrent_" + getDateStr(date) + ".zip");
} else if ("monitorcpu".equals(key)) {
list.add(path + File.separator + "cpu_" + getDateStr(date) + ".log");
list.add(path + File.separator + "cpu_" + getDateStr(date) + ".zip");
} else if ("resinconf".equals(key)) {
list.add(path);
} else if ("ecoloyweaver".equals(key)) {
dealWidthWeaverProp(path + "weaver.properties", new File(path + "weaversecurity.properties"));
list.add(path + "weaversecurity.properties");
} else if ("cus".equals(key) || "util_cus".equals(key) || "sql_log".equals(key) || "http_util".equals(key)) {
if (isToDay) {
list.add(path + File.separator + "cus.log");
} else {
list.add(path + File.separator + "cus.log_" + getDateStr(date) + ".log");
}
}
return list;
}
private static List eventLog(String path, String date) {
List list = new ArrayList();
File file = new File(path);
if (!file.exists()) {
return list;
}
File[] filelists = new File(path).listFiles();
date = getDateStr(date);
for (int i = 0; i < filelists.length; i++) {
File filelist = filelists[i];
if (filelist.getName().indexOf(date) != -1) {
list.add(filelist.getAbsolutePath());
}
}
return list;
}
private static String getSqlPathByDate(String date) {
return date.replace("-", File.separator);
}
private static String getDateStr(String date) {
date = date.replaceAll("-", "");
return date;
}
private static boolean isToDay(String date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String toDay = sdf.format(new Date());
return date.equals(toDay);
}
private static List<String> getDateList(String startDate, String endDate) {
List<String> list = new ArrayList<>();
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date start = sdf.parse(startDate);
Date end = sdf.parse(endDate);
Calendar tempStart = Calendar.getInstance();
tempStart.setTime(start);
while (start.getTime() <= end.getTime()) {
list.add(sdf.format(tempStart.getTime()));
tempStart.add(Calendar.DAY_OF_YEAR, 1);
start = tempStart.getTime();
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
private static void dealWidthWeaverProp(String path, File outFile) {//处理weaver.prop密码问题
File file = new File(path);
if (!file.exists()) {
return;
}
InputStreamReader reader = null;
java.io.Writer outWriter = null;
try {
if (!file.exists()) {
file.createNewFile();
}
Properties registerProp = new Properties();
reader = new InputStreamReader(new FileInputStream(file));
registerProp.load(reader);
reader.close();
outWriter = new FileWriter(outFile);
registerProp.put("ecology.password", "***********");
registerProp.store(outWriter, "");
outWriter.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (reader != null) {
reader.close();
}
if (outWriter != null) {
outWriter.close();
}
} catch (Exception e) {
}
}
}
}

View File

@ -0,0 +1,145 @@
package com.api.nonstandardext.ey.job;
import com.api.nonstandardext.ey.mode.BadDebtProvisionDt3;
import com.api.nonstandardext.ey.utils.EyLogger;
import com.api.nonstandardext.model_field_async.service.ModelFieldAsyncServiceImpl;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.interfaces.schedule.BaseCronJob;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.Date;
/**
*
* 3
*
* -
*
* uf_zdjmbd invoiceStatus 0Open ->=180
*
* 3
*
* .3 4
* @Description
* @Author
* @Date 2023/3/21
* @Other
* @Version
*/
public class BadDebtProvisionSynJob extends BaseCronJob {
private static final EyLogger logger = new EyLogger();
private final static String JobName = " BadDebtProvisionSynJob V2 , ";
private final ModelFieldAsyncServiceImpl service = new ModelFieldAsyncServiceImpl();
@Override
public void execute() {
logger.writeLogInfo( this.getClass().getName(),JobName + " >>>>>>");
//首先查询账单台账,在其中进行查询获得到指定的数据
//账单请求类型只取0、1、2、3、5
//以及账单号前三个字母,包含MCN、MHK
RecordSet rs = new RecordSet();
RecordSet innerRs = new RecordSet();
RecordSet updateRs = new RecordSet();
try {
String dateSql = "select * from uf_gbrqgz";
innerRs.executeQuery(dateSql);
int gbscts = 0;
while (innerRs.next()) {
gbscts = Util.getIntValue(innerRs.getString("gbscts"), 0);
}
String sql = "select m.id, d.bu bu,m.customerCode customerCode,m.requestType requestType,m.invoiceNo invoiceNo," +
"m.customerName customerName," +
"m.finishedTime finishedTime,m.orifinishedTime orifinishedTime,m.hzjtyqz hzjtyqz," +
"d.totalAmount totalAmount,d.skzt skzt,d.yskje yskje,d.qskje qskje,d.wskje wskje," +
"m.kpzt kpzt,m.sckprq sckprq,m.ykpje ykpje,m.wkpje wkpje,d.jtksjsrq as computeDate " +
"from uf_zdjmbd m left join uf_zdjmbd_dt1 d on d.mainid = m.id where m.invoiceStatus = 0";
rs.executeQuery(sql);
logger.writeLogInfo( this.getClass().getName(),JobName + " gbscts:" + gbscts + ", rs count:" + rs.getCounts() + " , sql=====" + sql);
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
String format = sf.format(new Date());
while (rs.next()) {
String id = rs.getString("id");
String customerName = rs.getString("customerName");//客户名称
String computeDate = rs.getString("computeDate");
String requestType = rs.getString("requestType");
String invoiceNo = rs.getString("invoiceNo");
logger.writeLogInfo( this.getClass().getName(),JobName + "customerName:" + customerName + ", computeDate:" + computeDate + ", requestType:" + requestType + ", invoiceNo:" + invoiceNo);
long daysBetween = 0;
if (!"".equals(computeDate)) {
LocalDate date1 = LocalDate.parse(format);
LocalDate date2 = LocalDate.parse(computeDate);
daysBetween = Math.abs(ChronoUnit.DAYS.between(date1, date2));
logger.writeLogInfo( this.getClass().getName(),JobName + ", computeDate:" + computeDate + ", daysBetween:" + daysBetween + ", gbscts:" + gbscts);
if (daysBetween >= gbscts) {
String existSql = "select * from uf_zdjmbd_dt3 where (tszt is null or tszt=0) and mainid=" + id;
innerRs.execute(existSql);
logger.writeLogInfo( this.getClass().getName(),JobName + " innerRs count : " + innerRs.getCounts() + ",existSql:" + existSql);
if (innerRs.getCounts() > 0){
updateRs.execute("update uf_zdjmbd_dt3 set tszt=1 where (tszt is null or tszt=0) and mainid=" + id);
continue;
}
String customerCode = rs.getString("customerCode");//客户编码
String bu = rs.getString("bu");//客户编码
BadDebtProvisionDt3 dt3 = new BadDebtProvisionDt3();
dt3.setMainId(id);
dt3.setCustomerCode(customerCode);
dt3.setCustomerName(customerName);
dt3.setGroup_invoice_no(rs.getString("groupinvoiceno")); //组账单ID
dt3.setInvoiceNo(rs.getString("invoiceNo")); //账单ID
dt3.setFinishedTime(rs.getString("finishedTime")); //账单开具日期
dt3.setOrifinishedTime(rs.getString("orifinishedTime")); //原账单开具日期
dt3.setSqjtyqrq(rs.getString("hzjtyqz")); //申请计提延期日期 取 坏账计提延期至
dt3.setZdje(rs.getString("totalAmount")); //账单金额
dt3.setSkzt(rs.getString("skzt")); //收款状态
dt3.setYskje(rs.getString("yskje")); //已收款金额
dt3.setQskje(rs.getString("qskje")); //其他收款金额
dt3.setWskje(rs.getString("wskje")); //未收款金额
dt3.setKpzt(rs.getString("kpzt")); //开票状态
dt3.setSckprq(rs.getString("sckprq")); //首次开票日期
dt3.setYkpje(rs.getString("ykpje")); //已开票金额
dt3.setWkpje(rs.getString("wkpje")); //未开票金额
dt3.setJyjtje(dt3.getWskje()); //建议计提金额
dt3.setSjjtje(dt3.getWskje()); //实际计提金额
dt3.setBu(bu); //bu
dt3.setTszt("1"); //状态
dt3.save(dt3, "uf_zdjmbd_dt3");
logger.writeLogInfo( this.getClass().getName(),JobName + " dt3 : " + dt3.toString());
/**
*
* @author xuanran.wang
* @date 2023-06-27
*/
service.asyncDataByClassName(this.getClass().getSimpleName(), id);
}
}
}
} catch (Exception e){
logger.writeLogInfo( this.getClass().getName(),JobName + " exception : " + e.getMessage());
}
}
}

View File

@ -0,0 +1,251 @@
package com.api.nonstandardext.ey.job;
import com.api.nonstandardext.ey.utils.EyLogger;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.interfaces.schedule.BaseCronJob;
import weaver.workflow.webservices.*;
import java.text.SimpleDateFormat;
import java.util.*;
/**
*
* :
* @Description
* @Author
* @Date 2023/3/20
* @Other
* @Version
*/
public class BankJournalToCollectSynJob extends BaseCronJob {
private static final EyLogger logger = new EyLogger();
private final static String JobName = " BankJournalToCollectSynJob V1 ,";
private String workflowId;
public String getWorkflowId() {
return workflowId;
}
public void setWorkflowId(String workflowId) {
this.workflowId = workflowId;
}
/**
*
*/
@Override
public void execute() {
logger.writeLogInfo( this.getClass().getName(),JobName + " >>>>>> start");
RecordSet rs = new RecordSet();
RecordSet innerRs = new RecordSet();
try {
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
String format = sf.format(new Date());
String sql = "select * from uf_yhjylsjmbd where szfx = '0'";
rs.executeQuery(sql);
while (rs.next()) {
String jylsh = rs.getString("jylsh");//交易流水号对应流程表单上的银行流水id
String qsql = "select * from formtable_main_257 where yhlsid = ?";
innerRs.executeQuery(qsql, jylsh);
if (innerRs.next()) {
logger.writeLogInfo( this.getClass().getName(), JobName + " exists receipt workflow can not create >>>>");
} else {
Map<String, String> map = new HashMap<>();
String dfhm = rs.getString("dfhm");//对方账户名fkrmc
String dfzh = rs.getString("dfzh");//对方账号fkrzh
String dfyhmc = rs.getString("dfyhmc");//对方银行名称fkrkhh
String jyhm = rs.getString("jyhm");//交易户名skfmc
String jyzh = rs.getString("jyzh");//交易账号skfzh
String jyyhmc = rs.getString("jyyhmc");//交易银行名称skrkhh
String bb = rs.getString("bb");//币别bb
String szlx = rs.getString("szfx");//收支方向szlx
String jyfse = rs.getString("jyfse");//交易发生额jyje
String zy = rs.getString("zy");//摘要zy
String jyrq = rs.getString("jyrq");//交易日期jyrq
String jysj = rs.getString("jysj");//交易时间jysj
String jylsh1 = rs.getString("jylsh");//交易流水号yhlsid
String bz = rs.getString("bz");//备注bz
String ywrq = format;
map.put("fkrmc", dfhm);
map.put("fkrzh", dfzh);
map.put("fkrkhh", dfyhmc);
map.put("skfmc", jyhm);
map.put("skfzh", jyzh);
map.put("skrkhh", jyyhmc);
map.put("bb", bb);
map.put("szlx", szlx);
map.put("jyje", jyfse);
map.put("jyrq", jyrq);
map.put("jysj", jysj);
map.put("yhlsid", jylsh1);
map.put("bz", bz);
map.put("zy", zy);
map.put("ywrq", ywrq);
map.put("sfyyhls", "0");
map.put("sfxyepemqr", "1");
logger.writeLogInfo( this.getClass().getName(),JobName + " main data map=" + map);
//将摘要zy字段进行拆分
List<Map<String, String>> zyMap = cfzy(zy);
logger.writeLogInfo( this.getClass().getName(),JobName + "zyMap=====" + zyMap);
//创建流程
//获得主表信息
WorkflowMainTableInfo workflowMainTableInfo = getMainInfo(map);
//获得明细表信息
WorkflowDetailTableInfo[] detail_tableinfo = null;
if (!zyMap.isEmpty()) {
detail_tableinfo = getDetailInfo(zyMap);
}
//创建流程工作 创建流程时为必输项
String requestName = "收款认领流程";
WorkflowRequestInfo workflowRequestInfo = new WorkflowRequestInfo();//工作流程请求信息
WorkflowBaseInfo workflowBaseInfo = new WorkflowBaseInfo();//工作流信息
workflowRequestInfo.setWorkflowMainTableInfo(workflowMainTableInfo);//添加主表字段数据
if (detail_tableinfo != null) {
workflowRequestInfo.setWorkflowDetailTableInfos(detail_tableinfo);//添加明细数据
}
workflowRequestInfo.setCreatorId("1");//创建者ID 创建流程时为必输项
workflowRequestInfo.setRequestName(requestName);
workflowBaseInfo.setWorkflowId(getWorkflowId());//流程ID
workflowRequestInfo.setWorkflowBaseInfo(workflowBaseInfo);//工作流信息
workflowRequestInfo.setIsnextflow("0");//停留在当前节点,1代表流转下一节点
/**提交流程*/
WorkflowService service = new WorkflowServiceImpl();
String requestid1 = service.doCreateWorkflowRequest(workflowRequestInfo, 1);
String statusCode = Util.null2String(service.submitWorkflowRequest(workflowRequestInfo, Integer.parseInt(requestid1), 1, "save", ""));
String statusCode1 = Util.null2String(service.submitWorkflowRequest(workflowRequestInfo, Integer.parseInt(requestid1), 1, "submit", ""));
logger.writeLogInfo( this.getClass().getName(),JobName + " submit requestid1 : " + requestid1 + " statusCode: " + statusCode + " statusCode1 : " + statusCode1);
}
}
} catch (Exception e){
logger.writeLogInfo( this.getClass().getName(), JobName + " exception: " + e.getMessage());
}
}
/**
*
* @return
* @param zyMap
*/
public WorkflowDetailTableInfo[] getDetailInfo(List<Map<String, String>> zyMap) throws Exception{
//设置明细表字段
int index = Integer.parseInt("1"); //获取子表封装的表
logger.writeLogInfo( this.getClass().getName(), JobName + ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>create detail data>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
WorkflowDetailTableInfo[] detail_tableinfo = new WorkflowDetailTableInfo[index];//定义一个明细表对象
WorkflowRequestTableRecord[] detil_wrtri = new WorkflowRequestTableRecord[zyMap.size()];//创建多少行明细数据
List<WorkflowRequestTableField> dwrs = null; //一行
WorkflowRequestTableField det_wrti = null; //一个字段
int rownum = 0;
for (Map<String, String> map : zyMap) {
logger.writeLogInfo( this.getClass().getName(), JobName + "get map data" + map);
dwrs = new ArrayList<>();
for (String key : map.keySet()) {
logger.writeLogInfo( this.getClass().getName(), JobName + "current map key" + key);
det_wrti = new WorkflowRequestTableField();
String value = Util.null2String(map.get(key));//原字段字段值
logger.writeLogInfo( this.getClass().getName(), JobName + "value==="+value);
det_wrti.setFieldName(key);//目标字段字段
det_wrti.setFieldValue(value);
det_wrti.setView(true);
det_wrti.setEdit(true);
dwrs.add(det_wrti);
}
WorkflowRequestTableField[] workflowRequestTableFields = new WorkflowRequestTableField[dwrs.size()];
for (int i = 0; i < dwrs.size(); i++) {
workflowRequestTableFields[i] = dwrs.get(i);
}
detil_wrtri[rownum] = new WorkflowRequestTableRecord();
detil_wrtri[rownum].setWorkflowRequestTableFields(workflowRequestTableFields);
rownum++;
//将明细数据加入明细表index - 1中 从0开始
detail_tableinfo[index - 1] = new WorkflowDetailTableInfo();
detail_tableinfo[index - 1].setWorkflowRequestTableRecords(detil_wrtri);
logger.writeLogInfo( this.getClass().getName(), JobName + "create detail data end " + detail_tableinfo);
}
return detail_tableinfo;
}
/**
*
* @param zy
*/
public List<Map<String, String>> cfzy(String zy) throws Exception{
// 账单号ICSV*******;客户编号:***;客户名称:****;账单号ICSV*******;客户编号:***;客户名称:****;
logger.writeLogInfo( this.getClass().getName(), JobName + " zhai yao : " + zy);
String[] strings = zy.split(" ");
List<Map<String, String>> list = new ArrayList<>();
for (int i = 0; i < strings.length; i++) {
Map<String, String> map = new HashMap<>();
if(strings[i].toLowerCase().length()==14){
if (strings[i].toUpperCase().contains("ICN")
||strings[i].toUpperCase().contains("XCN")
||strings[i].toUpperCase().contains("RCN")
||strings[i].toUpperCase().contains("MCN")
||strings[i].toUpperCase().contains("WCN")) {
String zdh = strings[i].toUpperCase();
logger.writeLogInfo( this.getClass().getName(), JobName + "zdh===" + zdh);
RecordSet rs = new RecordSet();
String sql = "select id from uf_zdjmbd where invoiceNo = ?";
rs.executeQuery(sql, zdh);
String id = "";
while (rs.next()) {
id = rs.getString("id");
}
//TODO 流程明细表没有对应字段
map.put("zdh", id);
// map.put("khbh", khbh);
// map.put("khmc", khmc);
map.put("zdhwb", zdh);
list.add(map);
} else {
return new ArrayList<>();
}
} else {
return new ArrayList<>();
}
logger.writeLogInfo( this.getClass().getName(), JobName + ", map size:" + map.size());
}
logger.writeLogInfo( this.getClass().getName(), JobName + ",list size:" + list.size());
return list;
}
/**
*
* @param map
* @return
*/
public WorkflowMainTableInfo getMainInfo(Map<String, String> map) {
logger.writeLogInfo( this.getClass().getName(), JobName + ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>create main data start>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
WorkflowMainTableInfo workflowMainTableInfo = new WorkflowMainTableInfo();//定义一个主表对象
WorkflowRequestTableRecord[] workflowRequestTableRecord = new WorkflowRequestTableRecord[1];//创建多少行主表数据
List<WorkflowRequestTableField> main_dwrs = new ArrayList<WorkflowRequestTableField>();//一行
WorkflowRequestTableField main_det_wrti = null;
for (String s : map.keySet()) {
main_det_wrti = new WorkflowRequestTableField();//一个字段
String value = map.get(s);
main_det_wrti.setFieldName(s);
main_det_wrti.setFieldValue(value);
main_det_wrti.setView(true);
main_det_wrti.setEdit(true);
main_dwrs.add(main_det_wrti);
}
WorkflowRequestTableField[] workflowRequestTableFields = new WorkflowRequestTableField[main_dwrs.size()];
for (int i = 0; i < main_dwrs.size(); i++) {
workflowRequestTableFields[i] = main_dwrs.get(i);
}
workflowRequestTableRecord[0] = new WorkflowRequestTableRecord();
workflowRequestTableRecord[0].setWorkflowRequestTableFields(workflowRequestTableFields);
workflowMainTableInfo.setRequestRecords(workflowRequestTableRecord);
logger.writeLogInfo( this.getClass().getName(), JobName + "create main data end>>>>>>>>>>>>>>>>>>>>>>>>>" + workflowMainTableInfo);
return workflowMainTableInfo;
}
}

View File

@ -0,0 +1,313 @@
package com.api.nonstandardext.ey.mode;
import com.api.nonstandardext.ey.utils.EyLogger;
import com.weaver.general.BaseBean;
import weaver.conn.RecordSet;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class BadDebtProvisionDt3 extends BaseBean {
private static final EyLogger logger = new EyLogger();
private String mainId;
private String customerCode;
private String customerName;
private String group_invoice_no;
private String invoiceNo;
private String finishedTime;
private String orifinishedTime;
private String sqjtyqrq;
private String zdje;
private String skzt;
private String yskje;
private String qskje;
private String wskje;
private String kpzt;
private String sckprq;
private String ykpje;
private String wkpje;
private String jyjtje;
private String sjjtje;
private String bu;
private String tszt;
public Integer save(BadDebtProvisionDt3 ufModel, String tableName) {
String modelName = "管报明细";
Integer mainId = null;
try {
RecordSet rs = new RecordSet();
String fieldSql = "";
String valueSql = "";
boolean result = false;
// 获取实体类的所有属性返回Field数组
Field[] field = ufModel.getClass().getDeclaredFields();
// 遍历所有属性
for (int i = 0; i < field.length; i++) {
// 获取属性的名字,并将属性第一个字符大写
String name = field[i].getName();
name = name.substring(0, 1).toUpperCase() + name.substring(1);
// 得到属性类型
String type = field[i].getGenericType().toString();
if (type.equals("class java.lang.String")) {
Method m = ufModel.getClass().getMethod("get" + name);
// 调用getter方法获取属性值
String value = (String) m.invoke(ufModel);
if (value != null) {
if ("".equals(value)){
fieldSql += "," + name;
valueSql += ",null";
} else {
fieldSql += "," + name;
valueSql += ",'" + value.trim() + "'";
}
}
}
if (type.equals("class java.lang.Integer")) {
Method m = ufModel.getClass().getMethod("get" + name);
// 调用getter方法获取属性值
Integer value = (Integer) m.invoke(ufModel);
if (value != null) {
fieldSql += "," + name;
valueSql += "," + value + "";
}
}
}
if (!"".equals(fieldSql)) {
fieldSql = fieldSql.substring(1);
valueSql = valueSql.substring(1);
String insertSql = "insert into " + tableName + " (" + fieldSql + ") values (" + valueSql + ")";
logger.writeLogInfo( this.getClass().getName()," insertSql : " + insertSql);
result = rs.execute(insertSql);
if (!result) {
return null;
}
writeLog(modelName + ", insertSql ->" + insertSql + ", result:" + result);
}
} catch (Exception e) {
writeLog(modelName + ", 新增报错 ->" + e.getMessage());
e.printStackTrace();
return null;
}
return mainId;
}
public String getMainId() {
return mainId;
}
public void setMainId(String mainId) {
this.mainId = mainId;
}
public String getCustomerCode() {
return customerCode;
}
public void setCustomerCode(String customerCode) {
this.customerCode = customerCode;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getGroup_invoice_no() {
return group_invoice_no;
}
public void setGroup_invoice_no(String group_invoice_no) {
this.group_invoice_no = group_invoice_no;
}
public String getInvoiceNo() {
return invoiceNo;
}
public void setInvoiceNo(String invoiceNo) {
this.invoiceNo = invoiceNo;
}
public String getFinishedTime() {
return finishedTime;
}
public void setFinishedTime(String finishedTime) {
this.finishedTime = finishedTime;
}
public String getOrifinishedTime() {
return orifinishedTime;
}
public void setOrifinishedTime(String orifinishedTime) {
this.orifinishedTime = orifinishedTime;
}
public String getSqjtyqrq() {
return sqjtyqrq;
}
public void setSqjtyqrq(String sqjtyqrq) {
this.sqjtyqrq = sqjtyqrq;
}
public String getZdje() {
return zdje;
}
public void setZdje(String zdje) {
this.zdje = zdje;
}
public String getSkzt() {
return skzt;
}
public void setSkzt(String skzt) {
this.skzt = skzt;
}
public String getYskje() {
return yskje;
}
public void setYskje(String yskje) {
this.yskje = yskje;
}
public String getQskje() {
return qskje;
}
public void setQskje(String qskje) {
this.qskje = qskje;
}
public String getWskje() {
return wskje;
}
public void setWskje(String wskje) {
this.wskje = wskje;
}
public String getKpzt() {
return kpzt;
}
public void setKpzt(String kpzt) {
this.kpzt = kpzt;
}
public String getSckprq() {
return sckprq;
}
public void setSckprq(String sckprq) {
this.sckprq = sckprq;
}
public String getYkpje() {
return ykpje;
}
public void setYkpje(String ykpje) {
this.ykpje = ykpje;
}
public String getWkpje() {
return wkpje;
}
public void setWkpje(String wkpje) {
this.wkpje = wkpje;
}
public String getJyjtje() {
return jyjtje;
}
public void setJyjtje(String jyjtje) {
this.jyjtje = jyjtje;
}
public String getSjjtje() {
return sjjtje;
}
public void setSjjtje(String sjjtje) {
this.sjjtje = sjjtje;
}
public String getBu() {
return bu;
}
public void setBu(String bu) {
this.bu = bu;
}
public String getTszt() {
return tszt;
}
public void setTszt(String tszt) {
this.tszt = tszt;
}
@Override
public String toString() {
return "BadDebtProvisionDt3{" +
"mainId='" + mainId + '\'' +
", customerCode='" + customerCode + '\'' +
", customerName='" + customerName + '\'' +
", group_invoice_no='" + group_invoice_no + '\'' +
", invoiceNo='" + invoiceNo + '\'' +
", finishedTime='" + finishedTime + '\'' +
", orifinishedTime='" + orifinishedTime + '\'' +
", sqjtyqrq='" + sqjtyqrq + '\'' +
", zdje='" + zdje + '\'' +
", skzt='" + skzt + '\'' +
", yskje='" + yskje + '\'' +
", qskje='" + qskje + '\'' +
", wskje='" + wskje + '\'' +
", kpzt='" + kpzt + '\'' +
", sckprq='" + sckprq + '\'' +
", ykpje='" + ykpje + '\'' +
", wkpje='" + wkpje + '\'' +
", jyjtje='" + jyjtje + '\'' +
", sjjtje='" + sjjtje + '\'' +
", bu='" + bu + '\'' +
", tszt='" + tszt + '\'' +
'}';
}
}

View File

@ -0,0 +1,93 @@
package com.api.nonstandardext.ey.utils;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.GCONST;
import weaver.general.TimeUtil;
import weaver.general.Util;
import java.io.*;
public class EyLogger extends BaseBean{
boolean isDebug = false;
public EyLogger() {
}
/**
*
*/
public EyLogger(RecordSet rs) {
String logSql = "select value from uf_systemconfig where config_key = 'DebugLogger'";
rs.execute(logSql);
if (rs.next()){
String valule = Util.null2String(rs.getString("value"));
if("1".equals(valule)){
isDebug = true;
}
}
}
/**
*
*/
public void writeLogInfo(String o,String s){
BufferedWriter out = null;
try {
String filename = "ey_" + TimeUtil.getCurrentDateString() + "_ecology.log";
String folder = GCONST.getRootPath() + "log" + File.separatorChar + "ey_dev_log";
//this.writeDebugLog("folder:[" + folder + "]");
File f = new File(folder);
// 创建文件夹
if (!f.exists()) {
f.mkdirs();
}
f = new File(folder + File.separatorChar + filename);
if(!f.exists()){//文件不存在,则直接创建
f.createNewFile();
}
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f, true)));
out.write("[" + o.getClass() + "][" + TimeUtil.getCurrentTimeString() + "]:"+ s + "\r\n");
//关闭写入流
if (out != null){
out.close();
}
} catch (IOException e) {
if (out != null){
try {
out.close();
} catch (IOException ioException) {
ioException.printStackTrace();
}
}
e.printStackTrace();
this.writeDebugLog("创建日志文件存在异常:[" + e.getMessage() + "/" + e.toString() + "]");
} finally {
if (out != null){
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public void writeDebugLog(Object logstr){
if(isDebug){
this.writeLog(logstr.toString());
}
}
}

View File

@ -0,0 +1,24 @@
package com.api.nonstandardext.model_field_async.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/6/26 14:33
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ModelFieldAsyncConfig {
private String modelTable;
private String onlyMark;
private String cusWhereSql;
private String tableName;
private List<ModelFieldAsyncConfigDetail> configDetailList;
}

View File

@ -0,0 +1,20 @@
package com.api.nonstandardext.model_field_async.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/6/27 10:18
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ModelFieldAsyncConfigClass {
private String onlyMark;
private String className;
private String detailIndex;
}

View File

@ -0,0 +1,24 @@
package com.api.nonstandardext.model_field_async.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/6/26 14:34
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ModelFieldAsyncConfigDetail {
private String detailIndex;
private String targetField;
private String valueField;
private int getValueType;
private String valueContext;
private String targetFieldName;
private String valueFieldName;
}

View File

@ -0,0 +1,12 @@
package com.api.nonstandardext.model_field_async.interfaces;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/6/28 10:06
*/
@FunctionalInterface
public interface TriFunction<T, U, V, R> {
R apply(T t, U u, V v);
}

View File

@ -0,0 +1,105 @@
package com.api.nonstandardext.model_field_async.mapper;
import aiyh.utils.annotation.recordset.*;
import com.api.nonstandardext.model_field_async.entity.ModelFieldAsyncConfig;
import com.api.nonstandardext.model_field_async.entity.ModelFieldAsyncConfigClass;
import com.api.nonstandardext.model_field_async.entity.ModelFieldAsyncConfigDetail;
import java.util.List;
import java.util.Map;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/6/26 14:39
*/
@SqlMapper
public interface ModelFieldAsyncMapper {
@Select("select * from uf_model_filed_async_class_config where class_name = #{className}")
ModelFieldAsyncConfigClass selectModelFieldAsyncConfigClass(@ParamMapper("className") String className);
@Select("SELECT a.*,b.tablename as table_name, c.id as model_id " +
"FROM uf_model_field_async a " +
"left join workflow_mode_table_view b " +
"on a.model_table = b.id " +
"left join modeinfo c " +
"on a.model_table = c.formid " +
"where only_mark = #{onlyMark}")
@CollectionMappings({
@CollectionMapping(property = "configDetailList",
column = "id",
id = @Id(value = Integer.class, methodId = 1))
})
ModelFieldAsyncConfig selectConfigByOnlyMark(@ParamMapper("onlyMark") String onlyMark);
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/3/1 16:39
* @param mainId id
* @return
**/
@Select("select a.*,b.fieldname target_field_name, c.fieldname value_field_name " +
"from uf_model_field_async_dt1 a " +
"left join workflow_field_table_view b " +
"on a.target_field = b.id " +
"left join workflow_field_table_view c " +
"on a.value_field = c.id " +
"where mainid = #{mainId} " +
"and ( enable is null or enable = 0 )")
@CollectionMethod(1)
List<ModelFieldAsyncConfigDetail> selectConfigDetail(@ParamMapper("mainId") int mainId);
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/26 15:15
* @param modelTableName
* @param where
* @return
**/
@Select("select count(*) from $t{modelTableName} $t{where}")
Integer selectModelTableCount(@ParamMapper("modelTableName") String modelTableName,
@ParamMapper("where") String where);
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/26 15:15
* @param modelTableName
* @param offset
* @param pageSize
* @return
**/
@Select("SELECT * " +
"FROM $t{modelTableName} " +
"$t{where} " +
"LIMIT $t{offset}, $t{pageSize}")
@CaseConversion(value = false)
List<Map<String, Object>> selectModelContent(@ParamMapper("modelTableName") String modelTableName,
@ParamMapper("where") String where,
@ParamMapper("offset") Integer offset,
@ParamMapper("pageSize") Integer pageSize);
@Select("SELECT * " +
"FROM $t{modelTableName} " +
"$t{where}")
@CaseConversion(value = false)
List<Map<String, Object>> selectModelContent(@ParamMapper("modelTableName")String modelTableName, @ParamMapper("where")String where);
@Select("SELECT * " +
"FROM $t{modelTableName} " +
"$t{cusWhere}")
@CaseConversion(value = false)
Map<String, Object> selectMainModelContent(@ParamMapper("modelTableName")String modelTableName,
@ParamMapper("id") String id,
@ParamMapper("cusWhere")String where);
@Select(custom = true)
String selectCustomerSql(@SqlString String sql,
@ParamMapper("detail") Map<String, Object> detailMap,
@ParamMapper("main") Map<String, Object> mainMap);
}

View File

@ -0,0 +1,247 @@
package com.api.nonstandardext.model_field_async.service;
import aiyh.utils.Util;
import aiyh.utils.excention.CustomerException;
import aiyh.utils.recordset.MapperBuilderSql;
import com.alibaba.fastjson.JSONObject;
import lombok.Setter;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import weaver.xuanran.wang.common.mapper.CommonMapper;
import com.api.nonstandardext.model_field_async.entity.ModelFieldAsyncConfig;
import com.api.nonstandardext.model_field_async.entity.ModelFieldAsyncConfigClass;
import com.api.nonstandardext.model_field_async.entity.ModelFieldAsyncConfigDetail;
import com.api.nonstandardext.model_field_async.mapper.ModelFieldAsyncMapper;
import com.api.nonstandardext.model_field_async.util.EyCusModelFieldValueRuleMethod;
import java.util.*;
import java.util.stream.Collectors;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/6/26 14:31
*/
@Setter
public class ModelFieldAsyncServiceImpl {
private final ModelFieldAsyncMapper asyncMapper = Util.getMapper(ModelFieldAsyncMapper.class);
private final CommonMapper commonMapper = Util.getMapper(CommonMapper.class);
private Integer pageSize = 1000;
private final Logger logger = Util.getLogger();
/**
* <h1></h1>
*
* @param className
* @return
* @author xuanran.wang
* @dateTime 2023/6/7 11:28
**/
public ModelFieldAsyncConfigClass getConfigClass(String className) {
ModelFieldAsyncConfigClass config = asyncMapper.selectModelFieldAsyncConfigClass(className);
if(Objects.isNull(config)){
throw new CustomerException("该className [ " + className + " ] 在uf_model_filed_async_class_config配置表中未找到对应的配置!");
}
return config;
}
/**
* <h1>id</h1>
*
* @param onlyMark
* @return
* @author xuanran.wang
* @dateTime 2023/6/7 11:28
**/
public ModelFieldAsyncConfig getConfig(String onlyMark) {
ModelFieldAsyncConfig config = asyncMapper.selectConfigByOnlyMark(onlyMark);
if(Objects.isNull(config) || CollectionUtils.isEmpty(config.getConfigDetailList())){
throw new CustomerException("该唯一标识在 [ " + onlyMark+ " +uf_model_field_async配置表中未找到对应的配置!或存在该配置但是明细数据为空!");
}
return config;
}
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/27 11:45
* @param className
* @param dataIds ids
**/
public void asyncDataByClassName(String className, String dataIds){
if(StringUtils.isBlank(dataIds)){
logger.error("dataIds can not be empty!");
return;
}
try {
ModelFieldAsyncConfigClass configClass = getConfigClass(className);
String onlyMark = configClass.getOnlyMark();
ModelFieldAsyncConfig asyncConfig = getConfig(onlyMark);
for (String dataId : dataIds.split(",")) {
asyncModelField(configClass.getDetailIndex(), dataId, asyncConfig);
}
}catch (Exception e){
logger.error("============== asyncDataByClassName error : " + e.getMessage() + " ==============");
logger.error(Util.getErrString(e));
}
}
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/26 17:18
* @param detailIndexList -1 -1,1,2 : , 1, 2
* @param config
**/
public void asyncAllModelField(String detailIndexList, ModelFieldAsyncConfig config){
asyncModelField(detailIndexList, "", config);
}
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/26 17:18
* @param detailIndexList -1 -1,1,2 : , 1, 2
* @param dataId id
* @param config
**/
public void asyncModelField(String detailIndexList, String dataId, ModelFieldAsyncConfig config){
List<ModelFieldAsyncConfigDetail> configDetailList = config.getConfigDetailList();
Map<String, List<ModelFieldAsyncConfigDetail>> groups = configDetailList.stream()
.collect(Collectors.groupingBy(ModelFieldAsyncConfigDetail::getDetailIndex));
String preSuffix = " id ";
boolean limit = StringUtils.isBlank(dataId);
for (String index : detailIndexList.split(",")) {
if(StringUtils.isBlank(index)){
continue;
}
// 该明细/主表的配置集合
List<ModelFieldAsyncConfigDetail> configDetails = groups.get(index);
if(CollectionUtils.isEmpty(configDetailList)){
logger.error("index = " + index + " not found config! current configs : " + JSONObject.toJSONString(groups));
continue;
}
String tableName = config.getTableName();
String mainTableName = config.getTableName();
// 如果是-1则代表同步主表数据
if(!"-1".equals(index)){
tableName += "_dt" + index;
preSuffix = " mainid ";
}
String cusWhereSql = buildWhereSql(Util.null2DefaultStr(config.getCusWhereSql(),""), dataId, preSuffix);
String cusMainWhereSql = buildWhereSql(Util.null2DefaultStr(config.getCusWhereSql(),""), dataId, "id");
// 获取主表数据
Map<String, Object> mainMap = asyncMapper.selectMainModelContent(mainTableName, dataId, cusMainWhereSql);
asyncAllData(tableName, cusWhereSql, configDetails, limit, mainMap);
}
}
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/27 11:44
* @param tableName
* @param cusWhereSql where sql
* @param configDetails
* @param limit
* @param mainMap
**/
public void asyncAllData(String tableName,
String cusWhereSql,
List<ModelFieldAsyncConfigDetail> configDetails,
boolean limit,
Map<String, Object> mainMap){
// 数据总条数
int count = limit ? asyncMapper.selectModelTableCount(tableName, cusWhereSql) : 1;
// 总页数
int pageCount = (int) Math.ceil((double) count / pageSize);
int pageNumber = 1;
while (pageNumber <= pageCount){
int offset = (pageNumber - 1) * pageSize;
// 分页查数据
List<Map<String, Object>> dataList = asyncMapper.selectModelContent(tableName, cusWhereSql, offset, pageSize);
if(CollectionUtils.isEmpty(dataList)){
pageNumber++;
continue;
}
convertDataList(tableName, dataList, configDetails, mainMap);
pageNumber++;
}
}
/**
* <h1>where</h1>
* @author xuanran.wang
* @dateTime 2023/6/27 11:44
* @param modelWhereSql where sql
* @param dataId id
* @param preSuffix mainId or id
* @return where
**/
public String buildWhereSql(String modelWhereSql, String dataId, String preSuffix){
StringBuilder sb = new StringBuilder();
if(StringUtils.isNotBlank(modelWhereSql)){
modelWhereSql = Util.sbc2dbcCase(modelWhereSql);
sb.append(modelWhereSql);
}
if(StringUtils.isNotBlank(dataId)){
if(sb.length() > 0){
sb.append(" and ");
}
sb.append(preSuffix).append(" = ").append(dataId);
}
sb.insert(0, " where ");
return sb.toString();
}
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/26 17:20
* @param tableName
* @param dataList
* @param configDetails
* @param mainMap
**/
public void convertDataList(String tableName, List<Map<String, Object>> dataList,
List<ModelFieldAsyncConfigDetail> configDetails, Map<String, Object> mainMap){
List<Map<String, Object>> res = new ArrayList<>();
for (Map<String, Object> data : dataList) {
res.add(convertData(data, configDetails, mainMap));
}
// 需要进行更新的字段集合
Map<String, Object> fields = configDetails.stream().collect(Collectors.toMap(ModelFieldAsyncConfigDetail::getTargetFieldName, item -> ""));
String updateSql = MapperBuilderSql.builderUpdateSql(tableName, fields,"item");
updateSql += " where id = #{item.id}";
if (!commonMapper.updateModelInfoList(updateSql, res)) {
throw new CustomerException("出错了... 更新 " + tableName + " 失败!");
}
}
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/26 17:20
* @param data
* @param configDetails
* @param mainMap
* @return map
**/
public Map<String, Object> convertData(Map<String, Object> data, List<ModelFieldAsyncConfigDetail> configDetails, Map<String, Object> mainMap){
Map<String, Object> res = new HashMap<>();
for (ModelFieldAsyncConfigDetail detail : configDetails) {
Object convert = EyCusModelFieldValueRuleMethod.VALUE_RULE_FUNCTION.get(detail.getGetValueType()).apply(detail, data, mainMap);
res.put(detail.getTargetFieldName(), convert);
}
res.put("id", data.get("id"));
return res;
}
}

View File

@ -0,0 +1,18 @@
package com.api.nonstandardext.model_field_async.service.convert;
import aiyh.utils.Util;
import com.api.nonstandardext.model_field_async.entity.ModelFieldAsyncConfigDetail;
import org.apache.log4j.Logger;
import java.util.Map;
/**
* <h1></h1>
*
* @author xuanran.wang
* @date 2023/4/11 16:49
*/
public interface CusModelFieldAsyncConvert {
Logger log = Util.getLogger();
Object cusConvert(ModelFieldAsyncConfigDetail configDetail, Map<String, Object> detailMap, Map<String, Object> mainMap, Map<String, String> pathParam);
}

View File

@ -0,0 +1,104 @@
package com.api.nonstandardext.model_field_async.util;
import aiyh.utils.Util;
import aiyh.utils.excention.CustomerException;
import com.api.nonstandardext.model_field_async.entity.ModelFieldAsyncConfigDetail;
import com.api.nonstandardext.model_field_async.interfaces.TriFunction;
import com.api.nonstandardext.model_field_async.mapper.ModelFieldAsyncMapper;
import com.google.common.base.Strings;
import org.apache.log4j.Logger;
import weaver.xuanran.wang.eny.data_async.service.convert.CusAsyncConvert;
import com.api.nonstandardext.model_field_async.service.convert.CusModelFieldAsyncConvert;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
/**
* <h1></h1>
*
* <p>create: 2023-02-02 15:15</p>
*
* @author youHong.ai
*/
public class EyCusModelFieldValueRuleMethod {
public static final Map<Integer, TriFunction<ModelFieldAsyncConfigDetail, Map<String, Object>, Map<String, Object>, Object>> VALUE_RULE_FUNCTION = new HashMap<>();
private final ModelFieldAsyncMapper mapper = Util.getMapper(ModelFieldAsyncMapper.class);
private final Logger log = Util.getLogger();
static {
Class<EyCusModelFieldValueRuleMethod> valueRuleMethodClass = EyCusModelFieldValueRuleMethod.class;
Method[] methods = valueRuleMethodClass.getMethods();
for (Method method : methods) {
if (method.isAnnotationPresent(ValueRuleMethodNo.class)) {
ValueRuleMethodNo annotation = method.getAnnotation(ValueRuleMethodNo.class);
int value = annotation.value();
VALUE_RULE_FUNCTION.put(value, (detail, detailmap, mainMap) -> {
try {
EyCusModelFieldValueRuleMethod eyCusModelFieldValueRuleMethod = new EyCusModelFieldValueRuleMethod();
return method.invoke(eyCusModelFieldValueRuleMethod, detail, detailmap, mainMap);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
});
}
}
}
@ValueRuleMethodNo(value = 0, desc = "明细表数据不转换")
public Object getFixValue(ModelFieldAsyncConfigDetail configDetail,Map<String, Object> detailMap, Map<String, Object> mainMap) {
return Util.null2DefaultStr(detailMap.get(configDetail.getValueFieldName()),"");
}
@ValueRuleMethodNo(value = 1, desc = "默认值")
public Object getCusText(ModelFieldAsyncConfigDetail configDetail, Map<String, Object> detailMap, Map<String, Object> mainMap) {
return Util.null2DefaultStr(configDetail.getValueContext(),"");
}
@ValueRuleMethodNo(value = 2, desc = "自定义sql")
public Object getCustomerSqlValue(ModelFieldAsyncConfigDetail configDetail, Map<String, Object> detailMap, Map<String, Object> mainMap) {
String cusText = configDetail.getValueContext();
cusText = Util.sbc2dbcCase(cusText);
if (Strings.isNullOrEmpty(cusText)) {
return null;
}
if (!cusText.startsWith("select")) {
return null;
}
return Util.null2DefaultStr(mapper.selectCustomerSql(cusText, detailMap, mainMap),"");
}
@ValueRuleMethodNo(value = 3, desc = "自定义接口")
public Object getCusConvertInterface(ModelFieldAsyncConfigDetail configDetail, Map<String, Object> detailMap, Map<String, Object> mainMap) {
String cusText = configDetail.getValueContext();
if(Strings.isNullOrEmpty(cusText)){
return null;
}
try {
Class<?> clazz = Class.forName(cusText);
if(!CusAsyncConvert.class.isAssignableFrom(clazz)){
throw new CustomerException(cusText + " not implements getLogFilePath.api.nonstandardext.model_field_async.service.convert");
}
CusModelFieldAsyncConvert o = (CusModelFieldAsyncConvert) clazz.newInstance();
Map<String, String> pathParam = Util.parseCusInterfacePathParam(cusText);
return o.cusConvert(configDetail, detailMap, mainMap, pathParam);
}catch (Exception e){
log.error("getCusConvertInterface error! " + e.getMessage());
return null;
}
}
@ValueRuleMethodNo(value = 4, desc = "转主表数据")
public Object getMainTableFieldValue(ModelFieldAsyncConfigDetail configDetail, Map<String, Object> detailMap, Map<String, Object> mainMap) {
return Util.null2DefaultStr(mainMap.get(configDetail.getValueFieldName()),"");
}
}

View File

@ -0,0 +1,19 @@
package com.api.nonstandardext.model_field_async.util;
import java.lang.annotation.*;
/**
* <h1></h1>
*
* <p>create: 2023-02-02 15:18</p>
*
* @author youHong.ai
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ValueRuleMethodNo {
int value();
String desc();
}

View File

@ -69,7 +69,7 @@ public class SAPWebserviceTool extends BaseBean {
public String callParams_011(String comCode, String period, String year, String glAccount){ public String callParams_011(String comCode, String period, String year, String glAccount){
String params = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-com:document:sap:soap:functions:mc-style\">\n" + String params = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-getLogFilePath:document:sap:soap:functions:mc-style\">\n" +
" <soapenv:Header/>\n" + " <soapenv:Header/>\n" +
" <soapenv:Body>\n" + " <soapenv:Body>\n" +
" <urn:ZoaGlGetglaccperiodbalances>\n" + " <urn:ZoaGlGetglaccperiodbalances>\n" +
@ -92,7 +92,7 @@ public class SAPWebserviceTool extends BaseBean {
/** /**
* { * {
* "@xmlns:n0": "urn:sap-com:document:sap:soap:functions:mc-style", * "@xmlns:n0": "urn:sap-getLogFilePath:document:sap:soap:functions:mc-style",
* "EsReturn": { * "EsReturn": {
* "Type": [], * "Type": [],
* "Code": [], * "Code": [],

View File

@ -0,0 +1,49 @@
package com.api.xuanran.wang.immc.controller;
import aiyh.utils.ApiResult;
import aiyh.utils.Util;
import com.alibaba.fastjson.JSONObject;
import com.api.xuanran.wang.immc.dto.ImmcWorkFlowToKafkaDto;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.log4j.Logger;
import weaver.xuanran.wang.immc.service.WorkFlowToVmsAndMQService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* <h1>kafka</h1>
*
* @author xuanran.wang
* @date 2023/6/21 15:40
*/
@Path("/wxr/immc/workflow/kafka")
public class ApiImmcWorkFlowToKafka {
private final Logger log = Util.getLogger();
private final WorkFlowToVmsAndMQService service = new WorkFlowToVmsAndMQService();
@Path("/del")
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public String delWorkFlowToKafka(@Context HttpServletRequest request,
@Context HttpServletResponse response,
@RequestBody ImmcWorkFlowToKafkaDto config){
try {
log.info("删除流程下发kafka配置对象 : " + JSONObject.toJSONString(config));
// ImmcWorkFlowToKafkaDto dto = JSONObject.parseObject(JSONObject.toJSONString(config), ImmcWorkFlowToKafkaDto.class);
service.workFlowToKafkaByDto(config);
return ApiResult.successNoData();
}catch (Exception e){
log.error("删除流程下发kafka执行失败 : [ " + e.getMessage() + " ]");
log.error(Util.getErrString(e));
return ApiResult.error("下发kafka失败! " + e.getMessage());
}
}
}

View File

@ -0,0 +1,24 @@
package com.api.xuanran.wang.immc.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* <h1>vo kafka</h1>
*
* @author xuanran.wang
* @date 2023/6/21 16:08
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ImmcWorkFlowToKafkaDto {
private String onlyMark;
private Integer billTable;
private String config;
private Integer requestId;
private String skip;
}

View File

@ -17,8 +17,13 @@ import weaver.hrm.User;
import weaver.workflow.webservices.WorkflowRequestTableField; import weaver.workflow.webservices.WorkflowRequestTableField;
import weaver.xuanran.wang.common.util.CommonUtil; import weaver.xuanran.wang.common.util.CommonUtil;
import java.util.*; import java.util.ArrayList;
import java.util.concurrent.*; import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -39,11 +44,13 @@ public class BatchCreateWorkflowService {
private static final String CUSTOM_ID = "customId"; private static final String CUSTOM_ID = "customId";
// private final MeetingMapper meetingTransMapper = Util.getTransMapper(MeetingMapper.class); // private final MeetingMapper meetingTransMapper = Util.getTransMapper(MeetingMapper.class);
private final MeetingService meetingService = new MeetingService(); private final MeetingService meetingService = new MeetingService();
/** /**
* <h1> </h1> * <h1> </h1>
*
* @param ids id
* @author xuanran.wang * @author xuanran.wang
* @dateTime 2023/2/24 10:21 * @dateTime 2023/2/24 10:21
* @param ids id
**/ **/
public void cancelMeeting(String ids) { public void cancelMeeting(String ids) {
meetingService.cancelMeeting(ids); meetingService.cancelMeeting(ids);
@ -51,10 +58,11 @@ public class BatchCreateWorkflowService {
/** /**
* <h1></h1> * <h1></h1>
* @author xuanran.wang *
* @dateTime 2023/2/22 17:10
* @param array * @param array
* @return * @return
* @author xuanran.wang
* @dateTime 2023/2/22 17:10
**/ **/
public List<CreateWfVO> batchCreateWorkflow(User user, JSONArray array) { public List<CreateWfVO> batchCreateWorkflow(User user, JSONArray array) {
List<Future<CusCreateWfInfo>> list = new ArrayList<>(); List<Future<CusCreateWfInfo>> list = new ArrayList<>();
@ -121,12 +129,13 @@ public class BatchCreateWorkflowService {
/** /**
* <h1></h1> * <h1></h1>
* @author xuanran.wang *
* @dateTime 2023/2/24 14:33
* @param user * @param user
* @param requestEntity * @param requestEntity
* @param index * @param index
* @return * @return
* @author xuanran.wang
* @dateTime 2023/2/24 14:33
**/ **/
public CusCreateWfInfo createWorkflow(User user, public CusCreateWfInfo createWorkflow(User user,
ReqOperateRequestEntity requestEntity, ReqOperateRequestEntity requestEntity,
@ -155,10 +164,11 @@ public class BatchCreateWorkflowService {
/** /**
* <h1>jsonReqOperateRequestEntity</h1> * <h1>jsonReqOperateRequestEntity</h1>
* @author xuanran.wang *
* @dateTime 2023/2/24 13:36
* @param array json * @param array json
* @return * @return
* @author xuanran.wang
* @dateTime 2023/2/24 13:36
**/ **/
public List<ReqOperateRequestEntity> checkParams(JSONArray array) { public List<ReqOperateRequestEntity> checkParams(JSONArray array) {
ArrayList<ReqOperateRequestEntity> res = new ArrayList<>(); ArrayList<ReqOperateRequestEntity> res = new ArrayList<>();

View File

@ -143,4 +143,5 @@ public class TaskElementController {
return ApiResult.error("system error!"); return ApiResult.error("system error!");
} }
} }
} }

View File

@ -168,4 +168,22 @@ public interface TaskElementMapper {
*/ */
@Update("update uf_rwtzeq_dt1 set zjwczt = 0 where zjr = #{userId} and mainid = #{mainId}") @Update("update uf_rwtzeq_dt1 set zjwczt = 0 where zjr = #{userId} and mainid = #{mainId}")
boolean updateTaskHandoverStatus(@ParamMapper("userId") String userId, @ParamMapper("mainId") String mainId); boolean updateTaskHandoverStatus(@ParamMapper("userId") String userId, @ParamMapper("mainId") String mainId);
/**
* <h2></h2>
*
* @param nameLike like
* @return likeid
*/
@Select("select id from hrmresource where lastname like #{nameLike}")
List<Integer> selectUserNameLike(String nameLike);
/**
* <h2></h2>
*
* @param value
* @return id
*/
@Select("select id from hrmresource where lastname = #{nameLike}")
Integer selectUserName(String value);
} }

View File

@ -106,7 +106,10 @@ public class TaskElementService {
for (Map<String, Object> item : authorityList) { for (Map<String, Object> item : authorityList) {
if ("0".equals(dataSource)) { if ("0".equals(dataSource)) {
// 自定义sql // 自定义sql
customerValue += " " + whereStr; // customerValue += " " + whereStr;
if (StrUtil.isNotBlank(whereStr)) {
customerValue = "select * from (" + customerValue + ") temp where " + whereStr;
}
List<Map<String, Object>> list = mapper.selectWorkList(customerValue, item, user, whereMap, currentMap); List<Map<String, Object>> list = mapper.selectWorkList(customerValue, item, user, whereMap, currentMap);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
result.addAll(list); result.addAll(list);
@ -179,8 +182,10 @@ public class TaskElementService {
Map<String, Object> map = new HashMap<>(8); Map<String, Object> map = new HashMap<>(8);
map.put("currentDate", Util.getTime("yyyy-MM-dd")); map.put("currentDate", Util.getTime("yyyy-MM-dd"));
map.put("currentTime", Util.getTime("HH:mm:ss")); map.put("currentTime", Util.getTime("HH:mm:ss"));
Map<String, Object> searchParam = (Map<String, Object>) params.get("searchParam");
Map<String, Object> allSearch = (Map<String, Object>) params.get("allSearch");
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (Map.Entry<String, Object> entry : params.entrySet()) { for (Map.Entry<String, Object> entry : searchParam.entrySet()) {
Map<String, Object> valueMap = (Map<String, Object>) entry.getValue(); Map<String, Object> valueMap = (Map<String, Object>) entry.getValue();
String key = Util.null2String(valueMap.get("key")); String key = Util.null2String(valueMap.get("key"));
String value = Util.null2String(valueMap.get("value")); String value = Util.null2String(valueMap.get("value"));
@ -196,6 +201,49 @@ public class TaskElementService {
} }
} }
String whereStr = builder.toString(); String whereStr = builder.toString();
if (StrUtil.isNotBlank(whereStr)) {
String trim = whereStr.trim();
if (trim.startsWith("and")) {
whereStr = trim.substring(3);
}
}
if (CollectionUtil.isNotEmpty(allSearch)) {
StringBuilder orWhere = new StringBuilder();
String value = Util.null2String(allSearch.get("value"));
if (StrUtil.isNotBlank(value)) {
List<Map<String, Object>> fields = (List<Map<String, Object>>) allSearch.get("fields");
for (Map<String, Object> field : fields) {
String key = Util.null2String(field.get("key"));
String type = Util.null2String(field.get("type"));
if ("like".equalsIgnoreCase(type)) {
orWhere.append(" or ").append(key).append(" like ").append("concat('%',#{where._allValue},'%')");
} else if ("hrm like".equalsIgnoreCase(type)) {
List<Integer> hrmList = mapper.selectUserNameLike("%" + value + "%");
orWhere.append(" or ").append(key).append(" in ( ").append(Util.intJoin(hrmList, ",")).append(") ");
} else if ("hrm".equalsIgnoreCase(type)) {
Integer hrmId = mapper.selectUserName(value);
orWhere.append(" or ").append(key).append(" = ").append(hrmId);
} else {
orWhere.append(" or ").append(key).append(" = ").append("#{where._allValue}");
}
}
map.put("_allValue", value);
String orWhereStr = orWhere.toString();
if (StrUtil.isNotBlank(orWhereStr)) {
String trim = orWhereStr.trim();
if (trim.startsWith("or")) {
orWhereStr = trim.substring(2);
}
if (StrUtil.isNotBlank(whereStr)) {
whereStr = whereStr + " or ( " + orWhereStr + " )";
} else {
whereStr = orWhereStr;
}
}
}
}
// 查询可查看权限并进行过滤 // 查询可查看权限并进行过滤
String viewAuthoritySql = ihgTaskElementConfItem.getViewAuthority(); String viewAuthoritySql = ihgTaskElementConfItem.getViewAuthority();
List<Map<String, Object>> authorityList = mapper.selectAuthority(viewAuthoritySql, user, map); List<Map<String, Object>> authorityList = mapper.selectAuthority(viewAuthoritySql, user, map);

View File

@ -44,7 +44,7 @@ public interface UserInfoMapper {
"or concat(',',fbleader,',') like concat(',',#{uID},',')\n" + "or concat(',',fbleader,',') like concat(',',#{uID},',')\n" +
"or concat(',',hrleader,',') like concat(',',#{uID},',')\n" + "or concat(',',hrleader,',') like concat(',',#{uID},',')\n" +
"or concat(',',generalmanager,',') like concat(',', #{uID},',')")*/ "or concat(',',generalmanager,',') like concat(',', #{uID},',')")*/
@Select("select count(id) from uf_hotelinfo where\n" + @Select("select * from uf_hotelinfo where\n" +
"concat(',',olt,',') like concat(',',#{userId},',')\n" + "concat(',',olt,',') like concat(',',#{userId},',')\n" +
"or concat(',',vpo,',') like concat(',',#{userId},',')\n" + "or concat(',',vpo,',') like concat(',',#{userId},',')\n" +
"or concat(',',opsconsultant,',') like concat(',',#{userId},',')\n" + "or concat(',',opsconsultant,',') like concat(',',#{userId},',')\n" +
@ -61,7 +61,7 @@ public interface UserInfoMapper {
"or concat(',',headoffinancebusinesssupport,',') like concat(',',#{userId},',')\n" + "or concat(',',headoffinancebusinesssupport,',') like concat(',',#{userId},',')\n" +
"or concat(',',headofrbeoperations,',') like concat(',',#{userId},',')\n" + "or concat(',',headofrbeoperations,',') like concat(',',#{userId},',')\n" +
"or concat(',',headofengineering,',') like concat(',',#{userId},',')") "or concat(',',headofengineering,',') like concat(',',#{userId},',')")
Integer selectIsHotel(int uid); List<Map<String, Object>> selectIsHotel(int uid);
/** /**
* <h2></h2> * <h2></h2>
@ -86,11 +86,10 @@ public interface UserInfoMapper {
* <h2></h2> * <h2></h2>
* *
* @param uid * @param uid
* @param hotelIndex
* @return * @return
*/ */
@Select("select * from uf_hotelinfo where\n" + @Select("select * from uf_hotelinfo where\n" +
"(concat(',',olt,',') like concat(',',#{userId},',')\n" + "concat(',',olt,',') like concat(',',#{userId},',')\n" +
"or concat(',',vpo,',') like concat(',',#{userId},',')\n" + "or concat(',',vpo,',') like concat(',',#{userId},',')\n" +
"or concat(',',subregionadmin,',') like concat(',',#{userId},',')\n" + "or concat(',',subregionadmin,',') like concat(',',#{userId},',')\n" +
"or concat(',',opsconsultant,',') like concat(',',#{userId},',')\n" + "or concat(',',opsconsultant,',') like concat(',',#{userId},',')\n" +
@ -112,9 +111,8 @@ public interface UserInfoMapper {
"or concat(',',revenueleader,',') like concat(',',#{userId},',')\n" + "or concat(',',revenueleader,',') like concat(',',#{userId},',')\n" +
"or concat(',',financeleader,',') like concat(',',#{userId},',')\n" + "or concat(',',financeleader,',') like concat(',',#{userId},',')\n" +
"or concat(',',fbleader,',') like concat(',',#{userId},',')\n" + "or concat(',',fbleader,',') like concat(',',#{userId},',')\n" +
"or concat(',',hrleader,',') like concat(',',#{userId},',')) " + "or concat(',',hrleader,',') like concat(',',#{userId},',')")
"and holidex = #{hotelIndex}") List<Map<String, Object>> selectRoles(@ParamMapper("userId") int uid);
List<Map<String, Object>> selectRoles(@ParamMapper("userId") int uid, @ParamMapper("hotelIndex") String hotelIndex);
/** /**
* <h2></h2> * <h2></h2>

View File

@ -43,7 +43,6 @@ public class UserInfoService {
userInfoVo.setTaskAcceptance(true); userInfoVo.setTaskAcceptance(true);
} }
} }
// 查询用户信息 // 查询用户信息
Map<String, Object> userInfo = this.mapper.selectHrmInfo(user.getUID()); Map<String, Object> userInfo = this.mapper.selectHrmInfo(user.getUID());
if (CollectionUtil.isNotEmpty(userInfo)) { if (CollectionUtil.isNotEmpty(userInfo)) {
@ -70,8 +69,32 @@ public class UserInfoService {
// 支持中心,显示部门信息 // 支持中心,显示部门信息
userInfoVo.setDepartmentInfo(department); userInfoVo.setDepartmentInfo(department);
} }
List<Map<String, Object>> hotelList = mapper.selectRoles(user.getUID());
// 如果存在酒店信息 // 如果存在酒店信息
if (StrUtil.isNotBlank(hotelIndex)) { Set<String> roleNames = new HashSet<>();
if (CollectionUtil.isNotEmpty(hotelList)) {
for (Map<String, Object> hotel : hotelList) {
// 循环酒店角色名称
for (Map.Entry<String, String> entry : ROLES_MAP.entrySet()) {
String key = entry.getKey();
if (!hotel.containsKey(key)) {
continue;
}
String value = Util.null2String(hotel.get(key));
// 如果在酒店名称中找到对应的人,则为角色名
if (StrUtil.isBlank(value)) {
continue;
}
String[] split = value.split(",");
List<String> strings = Arrays.asList(split);
if (strings.contains(Util.null2String(user.getUID()))) {
roleNames.add(entry.getValue());
}
}
}
}
userInfoVo.setRoleNames(roleNames);
/*if (StrUtil.isNotBlank(hotelIndex)) {
List<Map<String, Object>> hotelRoles = this.mapper.selectRoles(user.getUID(), hotelIndex); List<Map<String, Object>> hotelRoles = this.mapper.selectRoles(user.getUID(), hotelIndex);
if (CollectionUtil.isEmpty(hotelRoles)) { if (CollectionUtil.isEmpty(hotelRoles)) {
return userInfoVo; return userInfoVo;
@ -98,7 +121,7 @@ public class UserInfoService {
} }
} }
userInfoVo.setRoleNames(roleNames); userInfoVo.setRoleNames(roleNames);
} }*/
} }
return userInfoVo; return userInfoVo;
} }

View File

@ -0,0 +1,40 @@
package com.api.youhong.ai.pcn.download.controller;
import aiyh.utils.ApiResult;
import aiyh.utils.Util;
import com.api.youhong.ai.pcn.download.service.DownloadFileService;
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;
import javax.ws.rs.core.Response;
/**
* <h1></h1>
*
* <p>create: 2023/6/26 23:30</p>
*
* @author youHong.ai
*/
@Path("aiyh/download-file")
public class DownloadFileController {
private final Logger log = Util.getLogger();
private final DownloadFileService service = new DownloadFileService();
@GET
@Path("download")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response downloadFile(@QueryParam("fieldId") String fieldId) {
try {
return service.downloadFile(fieldId);
} catch (Exception e) {
log.error("下载文件出错:" + Util.getErrString(e));
return Response.ok(ApiResult.error("system error!"), MediaType.APPLICATION_JSON).build();
}
}
}

View File

@ -0,0 +1,74 @@
package com.api.youhong.ai.pcn.download.service;
import aiyh.utils.ApiResult;
import aiyh.utils.Util;
import aiyh.utils.entity.DocImageInfo;
import aiyh.utils.excention.CustomerException;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
import weaver.file.ImageFileManager;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* <h1></h1>
*
* <p>create: 2023/6/26 23:33</p>
*
* @author youHong.ai
*/
public class DownloadFileService {
public static final String SUFFIX = "==";
/**
* <h2></h2>
*
* @param encryptionFileId id docid
* @return
*/
public Response downloadFile(String encryptionFileId) {
if (StrUtil.isBlank(encryptionFileId)) {
return Response.ok(ApiResult.error("fileId is blank!"), MediaType.APPLICATION_JSON).build();
}
String fieldId = null;
try {
String decode = URLDecoder.decode(encryptionFileId, "UTF-8");
if (encryptionFileId.endsWith(SUFFIX)) {
decode = encryptionFileId;
}
fieldId = EncryptionFileIdUtil.decrypt(decode);
} catch (Exception e) {
throw new CustomerException("解密附件id失败", e);
}
DocImageInfo docImageInfo = Util.selectImageInfoByDocId(fieldId);
StreamingOutput stream = outputStream -> {
Integer imageFileId = docImageInfo.getImageFileId();
InputStream inputStreamById = ImageFileManager.getInputStreamById(imageFileId);
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = inputStreamById.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
};
String imageFileName = docImageInfo.getImageFileName();
try {
imageFileName = URLEncoder.encode(imageFileName, "UTF-8");
} catch (UnsupportedEncodingException ignore) {
}
return Response
.ok(stream)
.header("Content-Disposition", "attachment; filename=\"" + imageFileName + "\"")
.build();
}
}

View File

@ -0,0 +1,70 @@
package com.api.youhong.ai.pcn.download.service;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Base64;
/**
* <h1></h1>
*
* <p>create: 2023/6/26 23:43</p>
*
* @author youHong.ai
*/
public class EncryptionFileIdUtil {
private static final String PASSWORD = "H6f9T4x2jL8E3K7Y";
/**
*
*
* @param password
* @return
*/
public static String padPassword(String password) {
byte[] passwordBytes = password.getBytes(StandardCharsets.UTF_8);
// AES-128
int validKeyLength = 16;
if (passwordBytes.length < validKeyLength) {
byte[] paddedBytes = Arrays.copyOf(passwordBytes, validKeyLength);
return new String(paddedBytes, StandardCharsets.UTF_8);
} else if (passwordBytes.length > validKeyLength) {
return new String(Arrays.copyOf(passwordBytes, validKeyLength), StandardCharsets.UTF_8);
}
return password;
}
/**
* <h2>使AESBase64</h2>
*
* @param plaintext
* @return
* @throws Exception
*/
public static String encrypt(String plaintext) throws Exception {
String password = padPassword(PASSWORD);
SecretKeySpec secretKey = new SecretKeySpec(password.getBytes(StandardCharsets.UTF_8), "AES");
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
byte[] encryptedData = cipher.doFinal(plaintext.getBytes(StandardCharsets.UTF_8));
return Base64.getEncoder().encodeToString(encryptedData);
}
/**
* <h2>使AESBase64</h2>
*
* @param encryptedText
* @return
* @throws Exception
*/
public static String decrypt(String encryptedText) throws Exception {
String password = padPassword(PASSWORD);
SecretKeySpec secretKey = new SecretKeySpec(password.getBytes(StandardCharsets.UTF_8), "AES");
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, secretKey);
byte[] decryptedData = cipher.doFinal(Base64.getDecoder().decode(encryptedText));
return new String(decryptedData, StandardCharsets.UTF_8);
}
}

View File

@ -0,0 +1,41 @@
package com.api.youhong.ai.taibao.checknumber.controller;
import aiyh.utils.ApiResult;
import aiyh.utils.Util;
import com.api.youhong.ai.taibao.checknumber.service.CheckNumberService;
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/26 11:03</p>
*
* @author youHong.ai
*/
@Path("/aiyh/taibao/bh")
public class CheckNumberController {
private final Logger log = Util.getLogger();
private final CheckNumberService service = new CheckNumberService();
@Path("check-number")
@GET
@Produces(MediaType.APPLICATION_JSON)
public String checkNumber(@QueryParam("tableName") String tableName,
@QueryParam("field") String field,
@QueryParam("requestId") String requestId) {
try {
return ApiResult.success(service.checkNumber(tableName, field, requestId));
} catch (Exception e) {
log.error("检查是否存在编号出错:" + Util.getErrString(e));
return ApiResult.error("system error!");
}
}
}

View File

@ -0,0 +1,29 @@
package com.api.youhong.ai.taibao.checknumber.mapper;
import aiyh.utils.annotation.recordset.ParamMapper;
import aiyh.utils.annotation.recordset.Select;
import aiyh.utils.annotation.recordset.SqlMapper;
/**
* <h1></h1>
*
* <p>create: 2023/6/26 11:08</p>
*
* @author youHong.ai
*/
@SqlMapper
public interface CheckNumberMapper {
/**
* <h3></h3>
*
* @param field
* @param tableName
* @param requestId id
* @return
*/
@Select("select $t{field} from $t{tableName} where requestid = #{requestId}")
String selectNumber(@ParamMapper("field") String field,
@ParamMapper("tableName") String tableName,
@ParamMapper("requestId") String requestId);
}

View File

@ -0,0 +1,31 @@
package com.api.youhong.ai.taibao.checknumber.service;
import aiyh.utils.Util;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
import com.api.youhong.ai.taibao.checknumber.mapper.CheckNumberMapper;
/**
* <h1></h1>
*
* <p>create: 2023/6/26 11:06</p>
*
* @author youHong.ai
*/
public class CheckNumberService {
private final CheckNumberMapper mapper = Util.getMapper(CheckNumberMapper.class);
/**
* <h2></h2>
*
* @param tableName
* @param field
* @param requestId id
* @return
*/
public boolean checkNumber(String tableName, String field, String requestId) {
String number = mapper.selectNumber(field, tableName, requestId);
return StrUtil.isNotBlank(number);
}
}

View File

@ -2,7 +2,6 @@ package com.customization.youhong.pcn.createrworkflow.impl;
import aiyh.utils.Util; import aiyh.utils.Util;
import com.customization.youhong.pcn.createrworkflow.CreateRequestException; import com.customization.youhong.pcn.createrworkflow.CreateRequestException;
import com.customization.youhong.pcn.createrworkflow.mapper.CheckWorkflowRequestParamsMapper;
import com.customization.youhong.pcn.createrworkflow.util.CheckWorkflowRequestParamsUtil; import com.customization.youhong.pcn.createrworkflow.util.CheckWorkflowRequestParamsUtil;
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.cfg.annotation.ServiceMethodDynamicProxy;
@ -31,12 +30,11 @@ public class CheckWorkflowRequestParamsImpl extends AbstractServiceProxy impleme
private final Logger log = Util.getLogger("workflow"); private final Logger log = Util.getLogger("workflow");
private final CheckWorkflowRequestParamsMapper mapper = Util.getMapper(CheckWorkflowRequestParamsMapper.class);
private final CheckWorkflowRequestParamsUtil checkUtil = new CheckWorkflowRequestParamsUtil(); private final CheckWorkflowRequestParamsUtil checkUtil = new CheckWorkflowRequestParamsUtil();
@Override @Override
@ServiceMethodDynamicProxy(desc = "子流程触发时,做流程转数据") @ServiceMethodDynamicProxy(desc = "流程创建校验流程参数")
public PAResponseEntity doCreateRequest(User user, ReqOperateRequestEntity requestParam) { public PAResponseEntity doCreateRequest(User user, ReqOperateRequestEntity requestParam) {
try { try {
try { try {

View File

@ -2,6 +2,7 @@ package com.customization.youhong.pcn.createrworkflow.util;
import aiyh.utils.Util; import aiyh.utils.Util;
import aiyh.utils.tool.cn.hutool.core.collection.CollectionUtil; import aiyh.utils.tool.cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.customization.youhong.pcn.createrworkflow.CreateRequestException; import com.customization.youhong.pcn.createrworkflow.CreateRequestException;
import com.customization.youhong.pcn.createrworkflow.mapper.CheckWorkflowRequestParamsMapper; import com.customization.youhong.pcn.createrworkflow.mapper.CheckWorkflowRequestParamsMapper;
import com.customization.youhong.pcn.createrworkflow.pojo.CheckConditionItem; import com.customization.youhong.pcn.createrworkflow.pojo.CheckConditionItem;
@ -51,6 +52,8 @@ public class CheckWorkflowRequestParamsUtil {
if (CollectionUtil.isEmpty(detailList)) { if (CollectionUtil.isEmpty(detailList)) {
return; return;
} }
log.info("checkCreateConfig: " + JSON.toJSONString(checkCreateConfig));
log.info("detailList " + JSON.toJSONString(detailList));
Map<String, CheckConditionItem> checkConditionItemMap; Map<String, CheckConditionItem> checkConditionItemMap;
List<CheckConditionItem> conditionGroupItems = checkCreateConfig.getConditionGroupItems(); List<CheckConditionItem> conditionGroupItems = checkCreateConfig.getConditionGroupItems();
if (CollectionUtil.isNotEmpty(conditionGroupItems)) { if (CollectionUtil.isNotEmpty(conditionGroupItems)) {
@ -133,6 +136,7 @@ public class CheckWorkflowRequestParamsUtil {
if (Objects.isNull(checkCreateConfigDetail)) { if (Objects.isNull(checkCreateConfigDetail)) {
continue; continue;
} }
// TODO 主表明细表字段一致可能出现问题
checkDetailMap.remove(fieldName); checkDetailMap.remove(fieldName);
CheckFunctionParam checkFunctionParam = new CheckFunctionParam(); CheckFunctionParam checkFunctionParam = new CheckFunctionParam();
checkFunctionParam.setCheckCreateConfigDetail(checkCreateConfigDetail); checkFunctionParam.setCheckCreateConfigDetail(checkCreateConfigDetail);

View File

@ -0,0 +1,85 @@
package com.customization.youhong.taibao.compresspicture.impl;
import aiyh.utils.Util;
import aiyh.utils.entity.DocImageInfo;
import aiyh.utils.tool.cn.hutool.core.collection.CollectionUtil;
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
import com.api.doc.detail.util.DocDownloadCheckUtil;
import com.customization.youhong.taibao.compresspicture.mapper.CompressDocPictureMapper;
import com.customization.youhong.taibao.compresspicture.util.CompressPictureUtil;
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocReplaceComponent;
import com.weaverboot.frame.ioc.anno.methodAnno.WeaReplaceAfter;
import com.weaverboot.frame.ioc.handler.replace.weaReplaceParam.impl.WeaAfterReplaceParam;
import org.apache.log4j.Logger;
import weaver.file.ImageFileManager;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* <h1></h1>
*
* <p>create: 2023/7/1 16:17</p>
*
* @author youHong.ai
*/
@WeaIocReplaceComponent("CompressDocPictureService")
public class CompressDocPictureImpl {
private final CompressDocPictureMapper mapper = Util.getMapper(CompressDocPictureMapper.class);
private final Logger log = Util.getLogger();
/**
*
* WeaReplaceAfter
* String
* WeaAfterReplaceParamdataString
* return
*/
@WeaReplaceAfter(value = "/api/doc/save/save", order = 1)
public String after(WeaAfterReplaceParam weaAfterReplaceParam) {
String data = weaAfterReplaceParam.getData();
try {
Map<String, Object> paramMap = weaAfterReplaceParam.getParamMap();
String doccontent = Util.null2String(paramMap.get("doccontent"));
if (StrUtil.isBlank(doccontent)) {
return data;
}
List<String> imgSrcList = CompressPictureUtil.parseImageSrc(doccontent);
if (CollectionUtil.isEmpty(imgSrcList)) {
return data;
}
for (String imgSrc : imgSrcList) {
String imageFileIdEncrypt = CompressPictureUtil.extractFileId(imgSrc);
String imageFileId = DocDownloadCheckUtil.DncodeFileid(imageFileIdEncrypt);
DocImageInfo docImageInfo = Util.selectImageInfoByImageId(imageFileId);
if (StrUtil.isNotBlank(docImageInfo.getMiniImgPath())) {
continue;
}
InputStream inputStreamById = ImageFileManager.getInputStreamById(Integer.parseInt(imageFileId));
InputStream quality = CompressPictureUtil.compressImage(inputStreamById, docImageInfo.getImageFileName(),
Float.parseFloat(Util.getCusConfigValueNullOrEmpty("quality", "0.5")));
if (Objects.isNull(quality)) {
continue;
}
int newImageFileId = Util.createFileByInputSteam(quality, docImageInfo.getImageFileName());
if (newImageFileId <= 0) {
continue;
}
DocImageInfo newDocImageInfo = Util.selectImageInfoByImageId(Util.null2String(newImageFileId));
boolean flag = mapper.updateImageInfo(docImageInfo, newDocImageInfo);
if (flag) {
mapper.updateImageInfo(docImageInfo, newDocImageInfo);
}
}
} catch (Exception e) {
log.error("压缩文件出现异常:" + Util.getErrString(e));
}
// 这个就是接口执行完的报文
return data;
}
}

View File

@ -0,0 +1,30 @@
package com.customization.youhong.taibao.compresspicture.mapper;
import aiyh.utils.annotation.recordset.ParamMapper;
import aiyh.utils.annotation.recordset.SqlMapper;
import aiyh.utils.annotation.recordset.Update;
import aiyh.utils.entity.DocImageInfo;
/**
* <h1></h1>
*
* <p>create: 2023/7/1 16:41</p>
*
* @author youHong.ai
*/
@SqlMapper
public interface CompressDocPictureMapper {
/**
* <h2></h2>
* @param docImageInfo
* @param newDocImageInfo
* @return
*/
@Update("update imagefile set FILEREALPATH = #{new.path},AESCODE = #{new.aesCode}," +
"TOKENKEY = #{new.tokenKey},FILESIZE = #{new.fileSize}," +
"MINIIMGPATH= #{old.imageFileId} where IMAGEFILEID = #{old.imageFileId}")
boolean updateImageInfo(@ParamMapper("old") DocImageInfo docImageInfo,
@ParamMapper("new") DocImageInfo newDocImageInfo);
}

View File

@ -0,0 +1,214 @@
package com.customization.youhong.taibao.compresspicture.util;
import aiyh.utils.excention.CustomerException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageOutputStream;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* <h1></h1>
*
* <p>create: 2023/7/1 16:20</p>
*
* @author youHong.ai
*/
public class CompressPictureUtil {
/**
* <h2></h2>
*
* @param inputStream
* @param fileName
* @param quality
* @return
*/
public static InputStream compressImage(InputStream inputStream, String fileName, float quality) {
try {
// 读取输入图像流
BufferedImage image = ImageIO.read(inputStream);
// 获取图像格式
String formatName = getFormatName(fileName);
// 根据图像格式进行不同的压缩处理
if (formatName.equalsIgnoreCase("png")) {
return compressPNG(image, quality);
} else if (formatName.equalsIgnoreCase("jepg")) {
return compressJPEG(image, quality);
} else {
return null;
}
} catch (IOException e) {
throw new CustomerException(e);
}
}
/**
* <h2>png</h2>
*
* @param image
* @param quality
* @return
* @throws IOException io
*/
private static InputStream compressPNG(BufferedImage image, float quality) throws IOException {
int originalWidth = image.getWidth();
int originalHeight = image.getHeight();
// 计算压缩后的宽度和高度
int compressedWidth = (int) (originalWidth * quality);
int compressedHeight = (int) (originalHeight * quality);
// 创建压缩后的图像
BufferedImage compressedImage = new BufferedImage(compressedWidth, compressedHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = compressedImage.createGraphics();
g2d.drawImage(image, 0, 0, compressedWidth, compressedHeight, null);
g2d.dispose();
// 将压缩后的图像保存到字节数组输出流
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ImageIO.write(compressedImage, "png", outputStream);
return new ByteArrayInputStream(outputStream.toByteArray());
}
/**
* <h2>jpeg</h2>
*
* @param image
* @param quality
* @return
* @throws IOException io
*/
private static InputStream compressJPEG(BufferedImage image, float quality) throws IOException {
// 创建压缩参数
ImageWriter writer = ImageIO.getImageWritersByFormatName("jpeg").next();
ImageWriteParam writeParam = writer.getDefaultWriteParam();
writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
writeParam.setCompressionQuality(quality);
// 将压缩后的图像保存到字节数组输出流
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ImageOutputStream imageOutputStream = ImageIO.createImageOutputStream(outputStream);
writer.setOutput(imageOutputStream);
writer.write(null, new IIOImage(image, null, null), writeParam);
// 关闭资源
writer.dispose();
imageOutputStream.close();
outputStream.close();
return new ByteArrayInputStream(outputStream.toByteArray());
}
/**
* <h2></h2>
*
* @param fileName
* @return
*/
private static String getFormatName(String fileName) {
String formatName = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
if (formatName.equals("jpg") || formatName.equals("jpeg")) {
return "jpeg";
}
return formatName;
}
/**
* <h2>htmlimgsrc</h2>
*
* @param html html
* @return src
*/
public static List<String> parseImageSrc(String html) {
List<String> srcList = new ArrayList<>();
// 使用 Jsoup 解析 HTML 字符串
Document document = Jsoup.parse(html);
// 获取所有的 img 标签
Elements imgElements = document.select("img");
// 使用迭代器遍历 img 标签,并获取其 src 属性值
Iterator<Element> iterator = imgElements.iterator();
while (iterator.hasNext()) {
Element imgElement = iterator.next();
String src = imgElement.attr("src");
srcList.add(src);
}
return srcList;
}
/**
* <h2>id</h2>
*
* @param input
* @return id
*/
public static String extractFileId(String input) {
String fileId = null;
// 寻找 "fileid=" 的索引位置
int index = input.indexOf("fileid=");
if (index != -1) {
// 截取 "fileid=" 后面的部分
String substring = input.substring(index + 7);
// 查找第一个 "&" 符号的索引位置
int endIndex = substring.indexOf("&");
if (endIndex != -1) {
// 截取从 "fileid=" 后面到第一个 "&" 符号之前的部分
fileId = substring.substring(0, endIndex);
} else {
// 如果没有 "&" 符号,截取从 "fileid=" 后面到字符串末尾的部分
fileId = substring;
}
}
return fileId;
}
/**
* <h2>fieldId</h2>
*
* @param input
* @param newFileId id
* @return
*/
public static String replaceFileId(String input, String newFileId) {
// 寻找 "fileid=" 的索引位置
int index = input.indexOf("fileid=");
if (index != -1) {
// 查找第一个 "&" 符号的索引位置
int endIndex = input.indexOf("&", index);
if (endIndex != -1) {
// 替换 "fileid=" 后面到第一个 "&" 符号之前的部分
return input.substring(0, index + 7) + newFileId + input.substring(endIndex);
} else {
// 替换 "fileid=" 后面到字符串末尾的部分
return input.substring(0, index + 7) + newFileId;
}
}
return input;
}
}

View File

@ -36,7 +36,7 @@ public class ReadMail extends ToolUtil {
/** /**
* host ( * host (
*/ */
private static final String host = "imap.exmail.qq.com"; private static final String host = "imap.exmail.qq.getLogFilePath";
/** /**
* *

View File

@ -0,0 +1,130 @@
package weaver.formmode.customjavacode.modeexpand.ey.jiahx;
import com.api.nonstandardext.model_field_async.service.ModelFieldAsyncServiceImpl;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.RequestInfo;
import java.util.HashMap;
import java.util.Map;
/**
* @Description
* @Author
* @Date 2023/4/6
* @Other
* @Version
*/
public class TransferSelect extends AbstractModeExpandJavaCodeNew {
private final ModelFieldAsyncServiceImpl service = new ModelFieldAsyncServiceImpl();
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
BaseBean baseBean = new BaseBean();
// src/weaver/formmode/customjavacode/modeexpand/getKmmb.java
baseBean.writeLog("保存自定义接口开始TransferSelect>>>>>");
Map<String, String> result = new HashMap<String, String>();
try {
User user = (User) param.get("user");
int billid = -1;//数据id
int modeid = -1;//模块id
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billid = Util.getIntValue(requestInfo.getRequestid());
modeid = Util.getIntValue(requestInfo.getWorkflowid());
RecordSet upRs = new RecordSet();
if (billid > 0 && modeid > 0) {
//------请在下面编写业务逻辑代码------
// billingType,requestType,billingIssueType,clientType,multipleBilling,serviceType,LeType
String sql = "select * from uf_zdjmbd where id = ?";
RecordSet rs = new RecordSet();
rs.executeQuery(sql, billid);
while (rs.next()) {
String billingTypewb = Util.null2String(rs.getString("billingTypewb"));
String requestTypewb = Util.null2String(rs.getString("requestTypewb"));
String billingIssueTypewb = Util.null2String(rs.getString("billingIssueTypewb"));
String clientTypewb = Util.null2String(rs.getString("clientTypewb"));
String multipleBillingwb = Util.null2String(rs.getString("multipleBillingwb"));
String serviceTypewb = Util.null2String(rs.getString("serviceTypewb"));
String LeTypewb = Util.null2String(rs.getString("LeTypewb"));
//2023年6月7日新增engCodewb转换engCode --cds
String engCodewb = Util.null2String(rs.getString("engCodewb"));
if (!engCodewb.equals("")) {
String Upsql = "update uf_zdjmbd uf ,uf_xmjbxxjmbd xm set uf.engCode = xm.engagement_code " +
"where uf.engCodewb = xm.engagement_code1 and uf.engCodewb=? and uf.id = ?";
upRs.executeUpdate(Upsql, engCodewb, billid);
}
if (!billingTypewb.equals("")) {
String Upsql = "update uf_zdjmbd uf ,uf_vmschange_dt1 uv set uf.billingType = uv.zdid" +
" where uf.billingTypewb = uv.zdnr and uf.billingType is null and uf.id = ?";
upRs.executeUpdate(Upsql, billid);
}
if (!requestTypewb.equals("")) {
String Upsql = "update uf_zdjmbd uf ,uf_vmschange_dt1 uv set uf.requestType = uv.zdid " +
" where uf.requestTypewb = uv.zdnr and uf.requestType is null and uf.id = ?";
upRs.executeUpdate(Upsql, billid);
}
if (!billingIssueTypewb.equals("")) {
String Upsql = "update uf_zdjmbd uf ,uf_vmschange_dt1 uv set uf.billingIssueType = uv.zdid " +
" where uf.billingIssueTypewb = uv.zdnr and uf.billingIssueType is null and uf.id = ?";
upRs.executeUpdate(Upsql, billid);
}
if (!clientTypewb.equals("")) {
String Upsql = "update uf_zdjmbd uf ,uf_vmschange_dt1 uv set uf.clientType = uv.zdid " +
" where uf.clientTypewb = uv.zdnr and uf.clientType is null and uf.id = ?";
upRs.executeUpdate(Upsql, billid);
}
if (!multipleBillingwb.equals("")) {
String Upsql = "update uf_zdjmbd uf ,uf_vmschange_dt1 uv set uf.multipleBilling = uv.zdid " +
" where uf.multipleBillingwb = uv.zdnr and uf.multipleBilling is null and uf.id = ?";
upRs.executeUpdate(Upsql, billid);
}
if (!serviceTypewb.equals("")) {
String Upsql = "update uf_zdjmbd uf ,uf_vmschange_dt1 uv set uf.serviceType = uv.zdid " +
" where uf.serviceTypewb = uv.zdnr and uf.serviceType is null and uf.id = ?";
upRs.executeUpdate(Upsql, billid);
}
if (!LeTypewb.equals("")) {
String Upsql = "update uf_zdjmbd uf ,uf_vmschange_dt1 uv set uf.LeType = uv.zdid " +
" where uf.LeTypewb = uv.zdnr and uf.LeType is null and uf.id = ?";
upRs.executeUpdate(Upsql, billid);
}
}
rs.executeQuery("select dt1.engCodewb,dt1.id from uf_zdjmbd_dt1 dt1 left join uf_zdjmbd m on dt1.mainid=m.id where m.id = ?", billid);
//更新uf_zdjmbd_dt1,engCode
String Upsql = "update uf_zdjmbd_dt1 uf ,uf_xmjbxxjmbd xm set uf.engCode = xm.engagement_code " +
"where uf.engCodewb = xm.engagement_code1 and uf.engCodewb=? and uf.id = ?";
while (rs.next()) {
String engCodewb = Util.null2String(rs.getString("engCodewb"));
String id = Util.null2String(rs.getString("id"));
if (!"".equals(engCodewb)) {
boolean b = upRs.executeUpdate(Upsql, engCodewb, id);
baseBean.writeLog("TransferSelect转换明细engCode-----Flag:" + b);
}
}
/**
*
* @author xuanran.wang
* @date 2023-06-27
*/
service.asyncDataByClassName(this.getClass().getSimpleName(), String.valueOf(billid));
}
}
} catch (Exception e) {
baseBean.writeLog("TransferSelect catch exception:" + e);
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
}

View File

@ -0,0 +1,73 @@
package weaver.formmode.customjavacode.modeexpand.ey.jiahx;
import com.api.nonstandardext.model_field_async.service.ModelFieldAsyncServiceImpl;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.RequestInfo;
import java.util.HashMap;
import java.util.Map;
/**
* @Description
* @Author
* @Date 2023/4/6
* @Other
* @Version
*/
//更新 uf_fptbjmbd_dt1 ,engCode
public class TransferSelect_fp extends AbstractModeExpandJavaCodeNew {
private final ModelFieldAsyncServiceImpl service = new ModelFieldAsyncServiceImpl();
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
BaseBean baseBean = new BaseBean();
// src/weaver/formmode/customjavacode/modeexpand/getKmmb.java
baseBean.writeLog("保存自定义接口开始TransferSelect_fp>>>>>");
Map<String, String> result = new HashMap<String, String>();
try {
User user = (User) param.get("user");
int billid = -1;//数据id
int modeid = -1;//模块id
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billid = Util.getIntValue(requestInfo.getRequestid());
modeid = Util.getIntValue(requestInfo.getWorkflowid());
RecordSet upRs = new RecordSet();
if (billid > 0 && modeid > 0) {
RecordSet rs = new RecordSet();
rs.executeQuery("select dt1.engCodewb,dt1.id from uf_fptbjmbd_dt1 dt1 left join uf_fptbjmbd m on dt1.mainid=m.id where m.id = ?", billid);
//更新uf_fptbjmbd_dt1,engCode
String Upsql = "update uf_fptbjmbd_dt1 uf ,uf_fptbjmbd xm set uf.engCode = xm.engagement_code " +
"where uf.engCodewb = xm.engagement_code1 and uf.engCodewb=? and uf.id = ?";
while (rs.next()) {
String engCodewb = Util.null2String(rs.getString("engCodewb"));
String id = Util.null2String(rs.getString("id"));
if (!"".equals(engCodewb)) {
boolean b = upRs.executeUpdate(Upsql, engCodewb, id);
baseBean.writeLog("TransferSelect_fp转换明细engCode-----Flag:" + b);
}
}
/**
*
* @author xuanran.wang
* @date 2023-06-27
*/
service.asyncDataByClassName(this.getClass().getSimpleName(), String.valueOf(billid));
}
}
} catch (Exception e) {
baseBean.writeLog("TransferSelect_fp catch exception:" + e);
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
}

View File

@ -10,15 +10,13 @@ import org.apache.axis2.databinding.types.xsd._float;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.tools.ant.taskdefs.Pack;
import weaver.formmode.data.ModeDataIdUpdate; import weaver.formmode.data.ModeDataIdUpdate;
import weaver.formmode.setup.ModeRightInfo; import weaver.formmode.setup.ModeRightInfo;
import weaver.xuanran.wang.common.mapper.CommonMapper; import weaver.xuanran.wang.common.mapper.CommonMapper;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -102,7 +100,10 @@ public class CusData2OA {
return modelDataList; return modelDataList;
} }
public static void baseInsertAndUpdate(String modelId, List<Map<String, Object>> params, CountDownLatch latch){ public static boolean baseInsertAndUpdate(String modelId, List<Map<String, Object>> params, CountDownLatch latch){
if(CollectionUtils.isEmpty(params)){
return true;
}
int modelIdInt = Util.getIntValue(modelId, -1); int modelIdInt = Util.getIntValue(modelId, -1);
String tableName = CommonUtil.checkModelId(modelIdInt); String tableName = CommonUtil.checkModelId(modelIdInt);
if(modelIdInt < 0 || StringUtils.isBlank(tableName)){ if(modelIdInt < 0 || StringUtils.isBlank(tableName)){
@ -127,21 +128,23 @@ public class CusData2OA {
updateSql = buildUpdateSql(tableName, param); updateSql = buildUpdateSql(tableName, param);
} }
if(StringUtils.isBlank(insertSql)){ if(StringUtils.isBlank(insertSql)){
insertSql = buildInsertSql(tableName, modelId, param); insertSql = buildInsertSql(tableName, param);
} }
} }
try { try {
if(CollectionUtils.isNotEmpty(updateParams)){ if(CollectionUtils.isNotEmpty(updateParams)){
if (!commonMapper.updateModelInfoList(updateSql, params)) { if (!commonMapper.updateModelInfoList(updateSql, updateParams)) {
throw new CustomerException("update model data sql execute error!"); throw new CustomerException("update model data sql execute error!");
} }
} }
if(CollectionUtils.isNotEmpty(insertParams)){ if(CollectionUtils.isNotEmpty(insertParams)){
if (!commonMapper.batchInsertModel(insertSql, params)) { if (!commonMapper.batchInsertModel(insertSql, insertParams)) {
throw new CustomerException("insert model data sql execute error!"); throw new CustomerException("insert model data sql execute error!");
} }
} }
return true;
}catch (Exception e){ }catch (Exception e){
log.error("更新数据失败! : " + e.getMessage());
throw new CustomerException(e); throw new CustomerException(e);
}finally { }finally {
if(latch != null){ if(latch != null){
@ -153,10 +156,12 @@ public class CusData2OA {
} }
public static String buildUpdateSql(String tableName, Map<String, Object> params) { public static String buildUpdateSql(String tableName, Map<String, Object> params) {
Map<String, Object> copy = new HashMap<>(params);
copy.remove("id");
StringBuilder sqlSb = new StringBuilder("update ") StringBuilder sqlSb = new StringBuilder("update ")
.append(tableName) .append(tableName)
.append(" set "); .append(" set ");
for (Map.Entry<String, Object> entry : params.entrySet()) { for (Map.Entry<String, Object> entry : copy.entrySet()) {
sqlSb.append(entry.getKey()) sqlSb.append(entry.getKey())
.append(" = #{item.") .append(" = #{item.")
.append(entry.getKey()) .append(entry.getKey())
@ -167,13 +172,15 @@ public class CusData2OA {
return sqlSb.toString(); return sqlSb.toString();
} }
public static String buildInsertSql(String tableName, String modelId,Map<String, Object> params) { public static String buildInsertSql(String tableName, Map<String, Object> params) {
Map<String, Object> copy = new HashMap<>(params);
copy.remove("id");
StringBuilder sqlSb = new StringBuilder("insert into ") StringBuilder sqlSb = new StringBuilder("insert into ")
.append(tableName) .append(tableName)
.append(" ("); .append(" (");
StringBuilder fields = new StringBuilder(); StringBuilder fields = new StringBuilder();
StringBuilder values = new StringBuilder(); StringBuilder values = new StringBuilder();
for (Map.Entry<String, Object> entry : params.entrySet()) { for (Map.Entry<String, Object> entry : copy.entrySet()) {
fields.append(entry.getKey()).append(","); fields.append(entry.getKey()).append(",");
values.append("#{item.") values.append("#{item.")
.append(entry.getKey()) .append(entry.getKey())

View File

@ -6,6 +6,7 @@ import aiyh.utils.annotation.ActionDesc;
import aiyh.utils.annotation.ActionOptionalParam; import aiyh.utils.annotation.ActionOptionalParam;
import aiyh.utils.annotation.PrintParamMark; import aiyh.utils.annotation.PrintParamMark;
import aiyh.utils.annotation.RequiredMark; import aiyh.utils.annotation.RequiredMark;
import com.alibaba.fastjson.JSONObject;
import weaver.hrm.User; import weaver.hrm.User;
import weaver.soa.workflow.request.RequestInfo; import weaver.soa.workflow.request.RequestInfo;
import weaver.xuanran.wang.cssc.cms.entity.CusSuccess; import weaver.xuanran.wang.cssc.cms.entity.CusSuccess;
@ -59,7 +60,7 @@ public class WorkflowToCms extends SafeCusBaseAction {
.errorMsg(Util.null2DefaultStr(msg, "error")) .errorMsg(Util.null2DefaultStr(msg, "error"))
.dataKey(Util.null2DefaultStr(dataKey, "")) .dataKey(Util.null2DefaultStr(dataKey, ""))
.build(); .build();
log.info(""); log.info("cmsResponseVoField : " + JSONObject.toJSONString(cmsResponseVoField));
CusSuccess tokenSuccess = CusSuccess CusSuccess tokenSuccess = CusSuccess
.builder() .builder()
@ -68,6 +69,7 @@ public class WorkflowToCms extends SafeCusBaseAction {
.errorMsg(Util.null2DefaultStr(tokenMsg, "error")) .errorMsg(Util.null2DefaultStr(tokenMsg, "error"))
.dataKey(Util.null2DefaultStr(tokenDataKey,"")) .dataKey(Util.null2DefaultStr(tokenDataKey,""))
.build(); .build();
log.info("tokenSuccess : " + JSONObject.toJSONString(tokenSuccess));
workflowToCmsService.workflowToCms(onlyMark,tokenOnlyMark, billTable, requestId,cmsResponseVoField, tokenSuccess); workflowToCmsService.workflowToCms(onlyMark,tokenOnlyMark, billTable, requestId,cmsResponseVoField, tokenSuccess);
} }

View File

@ -4,7 +4,6 @@ import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import weaver.xuanran.wang.sh_bigdata.common.service.CusDataDecipher;
/** /**
@ -23,5 +22,4 @@ public class CusSuccess {
private String errorMsg; private String errorMsg;
private String dataKey; private String dataKey;
private Object response; private Object response;
private CusDataDecipher cusDataDecipher;
} }

View File

@ -1,17 +1,24 @@
package weaver.xuanran.wang.cssc.cms.service.impl; package weaver.xuanran.wang.cssc.cms.service.impl;
import aiyh.utils.Util; import aiyh.utils.Util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.xiao.commons.config.entity.RequestMappingConfig; import weaver.xiao.commons.config.entity.RequestMappingConfig;
import weaver.xiao.commons.config.entity.ResponseMapping;
import weaver.xiao.commons.config.service.DealWithMapping; import weaver.xiao.commons.config.service.DealWithMapping;
import weaver.xiao.commons.utils.SqlUtil;
import weaver.xuanran.wang.common.util.CommonUtil; import weaver.xuanran.wang.common.util.CommonUtil;
import weaver.xuanran.wang.cssc.cms.entity.CusSuccess; import weaver.xuanran.wang.cssc.cms.entity.CusSuccess;
import weaver.xuanran.wang.cssc.cms.service.WorkflowToCmsService; import weaver.xuanran.wang.cssc.cms.service.WorkflowToCmsService;
import weaver.xuanran.wang.cssc.cms.util.RequestMasterPlate; import weaver.xuanran.wang.cssc.cms.util.RequestMasterPlate;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -24,6 +31,7 @@ public class WorkFlowToCmsServiceImpl implements WorkflowToCmsService {
private final DealWithMapping dealWithMapping = new DealWithMapping(); private final DealWithMapping dealWithMapping = new DealWithMapping();
private final Logger log = Util.getLogger(); // 获取日志对象 private final Logger log = Util.getLogger(); // 获取日志对象
private final RequestMasterPlate requestMasterPlate = new RequestMasterPlate(); private final RequestMasterPlate requestMasterPlate = new RequestMasterPlate();
private final SqlUtil sqlUtil = new SqlUtil();
@Override @Override
public String getToken(String onlyMark,String billTable, public String getToken(String onlyMark,String billTable,
String requestId, CusSuccess cusSuccess) { String requestId, CusSuccess cusSuccess) {
@ -57,7 +65,20 @@ public class WorkFlowToCmsServiceImpl implements WorkflowToCmsService {
String url = requestMappingConfig.getRequestUrl(); String url = requestMappingConfig.getRequestUrl();
dealWithMapping.setMainTable(billTable); dealWithMapping.setMainTable(billTable);
Map<String, Object> param = dealWithMapping.getRequestParam(recordSet, requestMappingConfig); Map<String, Object> param = dealWithMapping.getRequestParam(recordSet, requestMappingConfig);
requestMasterPlate.apiPost(url, param, headers, cusSuccess); Map<String, Object> result = requestMasterPlate.apiPost(url, param, headers, cusSuccess);
List<ResponseMapping> responseMappingList = requestMappingConfig.getResponseMappingList();
if(CollectionUtils.isEmpty(responseMappingList) || MapUtils.isEmpty(result)){
return;
}
Map<String, Map<String, Object>> writeBackMessage = dealWithMapping.dealResponse(responseMappingList, result);
log.info("回写信息 writeBackMessage ==>"+ JSON.toJSONString(writeBackMessage));
Map<String, Object> updateMsg = writeBackMessage.get(billTable);
Map<String,Object> whereParam = new HashMap<>();
whereParam.put("requestid",requestId);
boolean success = sqlUtil.updateMode(billTable, updateMsg, whereParam);
if(!success){
log.error("数据回写表单失败!");
}
} }
public RecordSet initRs( RequestMappingConfig requestMappingConfig, String billTable, String requestId){ public RecordSet initRs( RequestMappingConfig requestMappingConfig, String billTable, String requestId){

View File

@ -53,12 +53,7 @@ public class RequestMasterPlate {
responseVo.getEntityString())); // 相应内容 responseVo.getEntityString())); // 相应内容
throw new CustomerException(Util.logStr("can not fetch [{}]", url)); // 自定义异常类 create 2022/3/9 2:20 PM 构建日志字符串 throw new CustomerException(Util.logStr("can not fetch [{}]", url)); // 自定义异常类 create 2022/3/9 2:20 PM 构建日志字符串
} }
Map<String, Object> response; Map<String, Object> response = responseVo.getResponseMap(); // 根据相应结果转化为map集合
if(cusSuccess.getCusDataDecipher() != null){
response = cusSuccess.getCusDataDecipher().decoder(responseVo);
}else {
response = responseVo.getResponseMap(); // 根据相应结果转化为map集合
}
cusSuccess.setResponse(response); cusSuccess.setResponse(response);
String responseValue = Util.null2DefaultStr(response.get(cusSuccess.getSuccessField()), ""); String responseValue = Util.null2DefaultStr(response.get(cusSuccess.getSuccessField()), "");
if (!cusSuccess.getSuccessValue().equals(responseValue)) { if (!cusSuccess.getSuccessValue().equals(responseValue)) {

View File

@ -1,6 +1,7 @@
package weaver.xuanran.wang.eny.data_async.mapper; package weaver.xuanran.wang.eny.data_async.mapper;
import aiyh.utils.annotation.recordset.*; import aiyh.utils.annotation.recordset.*;
import io.swagger.models.auth.In;
import weaver.xuanran.wang.eny.data_async.entity.DataAsyncConfigDetail; import weaver.xuanran.wang.eny.data_async.entity.DataAsyncConfigDetail;
import weaver.xuanran.wang.eny.data_async.entity.DataAsyncConfigMain; import weaver.xuanran.wang.eny.data_async.entity.DataAsyncConfigMain;
@ -53,6 +54,17 @@ public interface DataAsyncMapper {
@ParamMapper("min") Integer min, @ParamMapper("min") Integer min,
@ParamMapper("max") Integer max); @ParamMapper("max") Integer max);
@Select("select id from $t{tableName} where $t{foreignKey} between #{min} and #{max}")
@CaseConversion(value = false)
List<Integer> selectDataIdsByForeignKey(@ParamMapper("tableName") String tableName,
@ParamMapper("foreignKey") String foreignKey,
@ParamMapper("min") Integer min,
@ParamMapper("max") Integer max);
@Select(custom = true) @Select(custom = true)
String selectCustomerSql(@SqlString String sql, Map<String, Object> map); String selectCustomerSql(@SqlString String sql, Map<String, Object> map);
@Select("select id from $t{tableName} where modedatacreatedate = #{date}")
List<Integer> selectDataIdListByCreateDate(@ParamMapper("tableName") String tableName,
@ParamMapper("date") String date);
} }

View File

@ -4,17 +4,14 @@ import aiyh.utils.ThreadPoolConfig;
import aiyh.utils.Util; import aiyh.utils.Util;
import aiyh.utils.excention.CustomerException; import aiyh.utils.excention.CustomerException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ServiceUtil; import io.swagger.models.auth.In;
import com.engine.cube.service.ModeAppService;
import com.engine.cube.service.impl.ModeAppServiceImpl;
import lombok.Setter; import lombok.Setter;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import weaver.formmode.setup.ModeRightInfoThread; import weaver.formmode.setup.ModeRightInfo;
import weaver.general.TimeUtil; import weaver.general.TimeUtil;
import weaver.hrm.User;
import weaver.xuanran.wang.common.entity.CusSuccess; import weaver.xuanran.wang.common.entity.CusSuccess;
import weaver.xuanran.wang.common.util.CommonUtil; import weaver.xuanran.wang.common.util.CommonUtil;
import weaver.xuanran.wang.common.util.CusData2OA; import weaver.xuanran.wang.common.util.CusData2OA;
@ -25,9 +22,6 @@ import weaver.xuanran.wang.eny.data_async.mapper.DataAsyncMapper;
import weaver.xuanran.wang.eny.data_async.util.EyDataAsyncTokenUtil; import weaver.xuanran.wang.eny.data_async.util.EyDataAsyncTokenUtil;
import weaver.xuanran.wang.eny.data_async.util.ValueRuleMethod; import weaver.xuanran.wang.eny.data_async.util.ValueRuleMethod;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionContext;
import java.util.*; import java.util.*;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -56,6 +50,8 @@ public class DataAsyncServiceImpl {
.errorMsg("msg") .errorMsg("msg")
.build(); .build();
private static final ModeRightInfo moderightinfo = new ModeRightInfo();
private int pageSize = 100; private int pageSize = 100;
private int pageNo = 1; private int pageNo = 1;
@ -84,11 +80,12 @@ public class DataAsyncServiceImpl {
/** /**
* <h1> </h1> * <h1> </h1>
* @author xuanran.wang *
* @dateTime 2023/6/9 13:28
* @param config * @param config
* @param tokenUrl token * @param tokenUrl token
* @param params token * @param params token
* @author xuanran.wang
* @dateTime 2023/6/9 13:28
**/ **/
public void asyncData(DataAsyncConfigMain config, String tokenUrl, Map<String, Object> params) { public void asyncData(DataAsyncConfigMain config, String tokenUrl, Map<String, Object> params) {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
@ -110,6 +107,12 @@ public class DataAsyncServiceImpl {
count += (pageNo - 1) * pageSize; count += (pageNo - 1) * pageSize;
preNum = count; preNum = count;
} }
List<DataAsyncConfigDetail> configDetailList = config.getConfigDetailList();
List<DataAsyncConfigDetail> primaryKeyList = configDetailList.stream().filter(item -> item.getPrimary_key() == 0).collect(Collectors.toList());
if (CollectionUtils.isEmpty(primaryKeyList)) {
throw new CustomerException("请先配置主键字段!");
}
DataAsyncConfigDetail primaryKey = primaryKeyList.get(0);
boolean show = true; boolean show = true;
while (count < total) { while (count < total) {
// 从缓存中获取token // 从缓存中获取token
@ -135,7 +138,7 @@ public class DataAsyncServiceImpl {
count += pageSize; count += pageSize;
List<Map<String, Object>> list = (List<Map<String, Object>>) data.get("list"); List<Map<String, Object>> list = (List<Map<String, Object>>) data.get("list");
// 进行数据处理 // 进行数据处理
maps = dealData(config, list); maps = dealData(config, list, primaryKey);
show = false; show = false;
} catch (Exception e) { } catch (Exception e) {
for (int i = 0; i < pageSize; i++) { for (int i = 0; i < pageSize; i++) {
@ -154,9 +157,24 @@ public class DataAsyncServiceImpl {
// 异步提交数据库处理 // 异步提交数据库处理
threadPoolInstance.execute(() -> { threadPoolInstance.execute(() -> {
log.info("======================================================================================="); log.info("=======================================================================================");
// 查询当天同步的数据
Map<String, Integer> map = parseMaxAndMin(maps, primaryKey);
Integer max = map.get("max");
Integer min = map.get("min");
log.info(Thread.currentThread().getName() + " 入库之前信号数量 : " + finalLatch.getCount()); log.info(Thread.currentThread().getName() + " 入库之前信号数量 : " + finalLatch.getCount());
CusData2OA.baseInsertAndUpdate(config.getModel_id(), maps, finalLatch); boolean success = CusData2OA.baseInsertAndUpdate(config.getModel_id(), maps, finalLatch);
log.info("数据库更新标识 : " + success);
if (!success) {
throw new CustomerException("更新数据失败!");
}
log.info(Thread.currentThread().getName() + " 入库之后信号数量 : " + finalLatch.getCount()); log.info(Thread.currentThread().getName() + " 入库之后信号数量 : " + finalLatch.getCount());
List<Integer> dataIdList = asyncMapper.selectDataIdsByForeignKey(config.getTable_name(), primaryKey.getModel_field_name(), min, max);
if (CollectionUtils.isNotEmpty(dataIdList)) {
log.info("需要权限重构的数据条数 : " + dataIdList.size());
for (Integer id : dataIdList) {
moderightinfo.rebuildModeDataShareByEdit(1, Util.getIntValue(config.getModel_id(), -1), id);
}
}
log.info("======================================================================================="); log.info("=======================================================================================");
}); });
} }
@ -171,9 +189,8 @@ public class DataAsyncServiceImpl {
if (!await) { if (!await) {
throw new CustomerException("线程等待时间超过最大时间限制!"); throw new CustomerException("线程等待时间超过最大时间限制!");
} }
long endTime = System.currentTimeMillis();
log.info("数据结束同步时间 : " + TimeUtil.getCurrentTimeString()); log.info("数据结束同步时间 : " + TimeUtil.getCurrentTimeString());
rebuildRight(Util.getIntValue(config.getModel_id())); long endTime = System.currentTimeMillis();
log.info("同步耗时时间 " + (endTime - startTime) / 1000 + " s");// 等待所有转换操作完成 log.info("同步耗时时间 " + (endTime - startTime) / 1000 + " s");// 等待所有转换操作完成
} }
} catch (Exception e) { } catch (Exception e) {
@ -183,35 +200,32 @@ public class DataAsyncServiceImpl {
/** /**
* <h1></h1> * <h1></h1>
* @author xuanran.wang *
* @dateTime 2023/6/8 16:50
* @param config * @param config
* @param data * @param data
* @author xuanran.wang
* @dateTime 2023/6/8 16:50
**/ **/
public List<Map<String, Object>> dealData(DataAsyncConfigMain config, List<Map<String, Object>> data) { public List<Map<String, Object>> dealData(DataAsyncConfigMain config,
List<Map<String, Object>> data,
DataAsyncConfigDetail primaryKey) {
List<DataAsyncConfigDetail> configDetailList = config.getConfigDetailList(); List<DataAsyncConfigDetail> configDetailList = config.getConfigDetailList();
List<DataAsyncConfigDetail> primaryKey = configDetailList.stream().filter(item -> item.getPrimary_key() == 0).collect(Collectors.toList()); // List<DataAsyncConfigDetail> primaryKey = configDetailList.stream().filter(item -> item.getPrimary_key() == 0).collect(Collectors.toList());
List<Map<String, Object>> maps = new ArrayList<>(); List<Map<String, Object>> maps;
if(CollectionUtils.isNotEmpty(primaryKey)){
// 模版-接口外键 // 模版-接口外键
String modelFieldName = primaryKey.get(0).getModel_field_name(); String primaryKeyModelFieldName = primaryKey.getModel_field_name();
maps = data.stream().map(item -> convert(item, primaryKey.get(0).getInterface_field(), configDetailList)).filter(MapUtils::isNotEmpty).collect(Collectors.toList()); maps = data.stream().map(item -> convert(item, primaryKey.getInterface_field(), configDetailList)).filter(MapUtils::isNotEmpty).collect(Collectors.toList());
// 进行排序 // 进行排序
Optional<Integer> minClassId = maps.stream() Map<String, Integer> map = parseMaxAndMin(maps, primaryKey);
.map(map -> Util.getIntValue(Util.null2DefaultStr(map.get(modelFieldName),""),-1)) Integer max = map.get("max");
.min(Comparator.naturalOrder()); Integer min = map.get("min");
Optional<Integer> maxClassId = maps.stream()
.map(map -> Util.getIntValue(Util.null2DefaultStr(map.get(modelFieldName),""),-1))
.max(Comparator.naturalOrder());
Integer min = minClassId.orElse(0);
Integer max = maxClassId.orElse(0);
// 按照外键排序并且在oa中范围查询出外键与oa数据的对应关系 // 按照外键排序并且在oa中范围查询出外键与oa数据的对应关系
List<Map<String, String>> dataIdList = asyncMapper.selectDataIds(modelFieldName, config.getTable_name(), min, max); List<Map<String, String>> dataIdList = asyncMapper.selectDataIds(primaryKeyModelFieldName, config.getTable_name(), min, max);
if ("1".equals(debug)) { if ("1".equals(debug)) {
log.info("dataIdList : " + JSONObject.toJSONString(dataIdList)); log.info("dataIdList : " + JSONObject.toJSONString(dataIdList));
} }
if (CollectionUtils.isNotEmpty(dataIdList)) { if (CollectionUtils.isNotEmpty(dataIdList)) {
HashMap<String, String> idMap = parseListMap2Map(modelFieldName, "id", dataIdList); HashMap<String, String> idMap = parseListMap2Map(primaryKeyModelFieldName, "id", dataIdList);
if ("1".equals(debug)) { if ("1".equals(debug)) {
log.info("idMap : " + JSONObject.toJSONString(idMap)); log.info("idMap : " + JSONObject.toJSONString(idMap));
} }
@ -219,7 +233,7 @@ public class DataAsyncServiceImpl {
if ("1".equals(debug)) { if ("1".equals(debug)) {
log.info("item : " + JSONObject.toJSONString(item)); log.info("item : " + JSONObject.toJSONString(item));
} }
String id = Util.null2DefaultStr(item.get(modelFieldName),""); String id = Util.null2DefaultStr(item.get(primaryKeyModelFieldName), "");
if ("1".equals(debug)) { if ("1".equals(debug)) {
log.info("id : " + id); log.info("id : " + id);
} }
@ -229,18 +243,36 @@ public class DataAsyncServiceImpl {
} }
}); });
} }
}
return maps; return maps;
} }
public Map<String, Integer> parseMaxAndMin(List<Map<String, Object>> maps, DataAsyncConfigDetail primaryKey) {
String primaryKeyModelFieldName = primaryKey.getModel_field_name();
// 进行排序
Optional<Integer> minClassId = maps.stream()
.map(map -> Util.getIntValue(Util.null2DefaultStr(map.get(primaryKeyModelFieldName), ""), -1))
.min(Comparator.naturalOrder());
Optional<Integer> maxClassId = maps.stream()
.map(map -> Util.getIntValue(Util.null2DefaultStr(map.get(primaryKeyModelFieldName), ""), -1))
.max(Comparator.naturalOrder());
Integer min = minClassId.orElse(0);
Integer max = maxClassId.orElse(0);
Map<String, Integer> map = new HashMap<>();
map.put("max", max);
map.put("min", min);
return map;
}
/** /**
* <h1></h1> * <h1></h1>
* @author xuanran.wang *
* @dateTime 2023/6/9 13:27
* @param data * @param data
* @param foreignKey * @param foreignKey
* @param configDetailList * @param configDetailList
* @return * @return
* @author xuanran.wang
* @dateTime 2023/6/9 13:27
**/ **/
public Map<String, Object> convert(Map<String, Object> data, public Map<String, Object> convert(Map<String, Object> data,
String foreignKey, String foreignKey,
@ -258,9 +290,10 @@ public class DataAsyncServiceImpl {
/** /**
* <h1></h1> * <h1></h1>
*
* @param listMap
* @author xuanran.wang * @author xuanran.wang
* @dateTime 2023/4/10 18:33 * @dateTime 2023/4/10 18:33
* @param listMap
**/ **/
public static HashMap<String, String> parseListMap2Map(String key, String value, List<Map<String, String>> listMap) { public static HashMap<String, String> parseListMap2Map(String key, String value, List<Map<String, String>> listMap) {
if (CollectionUtils.isEmpty(listMap)) { if (CollectionUtils.isEmpty(listMap)) {
@ -277,109 +310,5 @@ public class DataAsyncServiceImpl {
return res; return res;
} }
public static ModeAppService modeAppService = ServiceUtil.getService(ModeAppServiceImpl.class, new User(1));
/**
* <h1></h1>
* @author xuanran.wang
* @dateTime 2023/6/9 13:28
* @param modeId id
**/
public static void rebuildRight(int modeId){
ModeRightInfoThread var5 = new ModeRightInfoThread();
var5.setModeId(modeId);
var5.setRebulidFlag("1");
var5.setSession(new HttpSession() {
@Override
public String getId() {
return null;
}
@Override
public boolean isNew() {
return false;
}
@Override
public long getCreationTime() {
return 0;
}
@Override
public long getLastAccessedTime() {
return 0;
}
@Override
public void setMaxInactiveInterval(int i) {
}
@Override
public int getMaxInactiveInterval() {
return 0;
}
@Override
public Object getAttribute(String s) {
return null;
}
@Override
public Enumeration getAttributeNames() {
return null;
}
@Override
public void setAttribute(String s, Object o) {
}
@Override
public void removeAttribute(String s) {
}
@Override
public void invalidate() {
}
@Override
public HttpSessionContext getSessionContext() {
return null;
}
@Override
public ServletContext getServletContext() {
return null;
}
@Override
public Object getValue(String s) {
return null;
}
@Override
public String[] getValueNames() {
return new String[0];
}
@Override
public void putValue(String s, Object o) {
}
@Override
public void removeValue(String s) {
}
});
var5.setUser(new User(1));
var5.resetModeRight();
}
} }

View File

@ -52,7 +52,12 @@ public class ValueRuleMethod {
@ValueRuleMethodNo(value = 0, desc = "不转换") @ValueRuleMethodNo(value = 0, desc = "不转换")
public Object getFixValue(DataAsyncConfigDetail configDetail,Map<String, Object> map) { public Object getFixValue(DataAsyncConfigDetail configDetail,Map<String, Object> map) {
return Util.null2DefaultStr(map.get(configDetail.getInterface_field()),""); String interfaceField = configDetail.getInterface_field();
String value = Util.null2DefaultStr(map.get(interfaceField),"");
if(StringUtils.isBlank(value)){
return null;
}
return map.get(interfaceField);
} }
@ -90,7 +95,7 @@ public class ValueRuleMethod {
try { try {
Class<?> clazz = Class.forName(cusText); Class<?> clazz = Class.forName(cusText);
if(!CusAsyncConvert.class.isAssignableFrom(clazz)){ if(!CusAsyncConvert.class.isAssignableFrom(clazz)){
throw new CustomerException(cusText + " not implements weaver.xuanran.wang.sh_bigdata.org_hrm_async.annotations.CusOrgHrmAsyncConvert"); throw new CustomerException(cusText + " not implements weaver.xuanran.wang.eny.data_async.service.convert.CusAsyncConvert!");
} }
CusAsyncConvert o = (CusAsyncConvert) clazz.newInstance(); CusAsyncConvert o = (CusAsyncConvert) clazz.newInstance();
Map<String, String> pathParam = Util.parseCusInterfacePathParam(cusText); Map<String, String> pathParam = Util.parseCusInterfacePathParam(cusText);

View File

@ -49,6 +49,10 @@ public class WorkFlowToVmsAndMQ extends SafeCusBaseAction {
@PrintParamMark @PrintParamMark
@ActionOptionalParam(value = "message", desc = "报错返回信息字段") @ActionOptionalParam(value = "message", desc = "报错返回信息字段")
private String msg; private String msg;
@PrintParamMark
@ActionOptionalParam(value = "0", desc = "发送mq跳过校验")
private String mqSkip;
@Override @Override
public void doSubmit(String requestId, String billTable, int workflowId, User user, RequestInfo requestInfo) { public void doSubmit(String requestId, String billTable, int workflowId, User user, RequestInfo requestInfo) {
@ -59,6 +63,6 @@ public class WorkFlowToVmsAndMQ extends SafeCusBaseAction {
.successVal(Util.null2DefaultStr(successVal, "200")) .successVal(Util.null2DefaultStr(successVal, "200"))
.message(Util.null2DefaultStr(msg, "message")) .message(Util.null2DefaultStr(msg, "message"))
.build(); .build();
workFlowToVmsAndMQService.workFlowToVmsAndMQ(onlyMark, billTable, requestId, vmsResponseVoField, kafkaConfig); workFlowToVmsAndMQService.workFlowToVmsAndMQ(onlyMark, billTable, requestId, vmsResponseVoField, kafkaConfig, mqSkip);
} }
} }

View File

@ -32,19 +32,20 @@ public class CusListValue implements CusInterfaceGetValue {
// 如果fileName不为空则对集合中每个map添加"fileName":value value则是附件字段名称 // 如果fileName不为空则对集合中每个map添加"fileName":value value则是附件字段名称
String fileName = Util.null2DefaultStr(pathParam.get("fileName"), ""); String fileName = Util.null2DefaultStr(pathParam.get("fileName"), "");
if(StringUtils.isNotBlank(cusSql)){ if(StringUtils.isNotBlank(cusSql)){
cusSql = cusSql.replace("{?requestid}",Util.null2DefaultStr(mainMap.get("requestid"),""));
if (StringUtils.isNotBlank(attachmentField)) { if (StringUtils.isNotBlank(attachmentField)) {
for (String item : attachmentField.split(",")) { String[] fields = attachmentField.split(",");
for (String item : fields) {
String filedValue = Util.null2DefaultStr(mainMap.get(item),""); String filedValue = Util.null2DefaultStr(mainMap.get(item),"");
if(StringUtils.isNotBlank(Util.null2DefaultStr(mainMap.get(filedValue),""))){ String fileSql = cusSql;
cusSql = cusSql if(StringUtils.isNotBlank(filedValue)){
.replace("{?docIds}", "( " + filedValue + " )") fileSql = fileSql.replace("{?docIds}", "( " + filedValue + " )");
.replace("{?requestid}",Util.null2DefaultStr(mainMap.get("requestid"),"")); List<Map<String, String>> attachmentInfo = mapper.getAttachmentInfo(fileSql);
List<Map<String, String>> attachmentInfo = mapper.getAttachmentInfo(cusSql);
if(CollectionUtils.isEmpty(attachmentInfo)){ if(CollectionUtils.isEmpty(attachmentInfo)){
continue; continue;
} }
// 往map中put附件字段名 // 往map中put附件字段名
if(StringUtils.isBlank(fileName)){ if(StringUtils.isNotBlank(fileName)){
attachmentInfo.forEach(file ->{ attachmentInfo.forEach(file ->{
file.put(fileName, item); file.put(fileName, item);
}); });
@ -52,6 +53,11 @@ public class CusListValue implements CusInterfaceGetValue {
list.addAll(attachmentInfo); list.addAll(attachmentInfo);
} }
} }
}else {
List<Map<String, String>> attachmentInfo = mapper.getAttachmentInfo(cusSql);
if(CollectionUtils.isNotEmpty(attachmentInfo)){
list.addAll(attachmentInfo);
}
} }
} }
return list; return list;

View File

@ -0,0 +1,26 @@
package weaver.xuanran.wang.immc.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import weaver.conn.RecordSet;
import java.util.Map;
/**
* <h1>url, </h1>
*
* @author xuanran.wang
* @date 2023/6/21 15:50
*/
@Setter
@Builder
@AllArgsConstructor
@Getter
public class CusRequestParam {
private String url;
private RecordSet rs;
private Map<String, Object> param;
private String requestId;
}

Some files were not shown because too many files have changed in this diff Show More