Merge branch 'feature/REQ-5965' into pre
This commit is contained in:
commit
5a8a66c11f
@ -68,9 +68,10 @@ public class WpsUtil {
|
||||
private static final String TRANSPARENT_IMAGE_URL = "https://axzo-obs-public.obs.cn-north-4.myhuaweicloud.com:443/obs-public/obs-public/62F92618016840F89D8810CD1816E04D.png";
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<String> strList = new ArrayList<>();
|
||||
strList.add("[中文]");
|
||||
strList.add("[中文,English,]");
|
||||
// String variableJsonStr = "[{\"desc\":\"审批编号\",\"key\":\"processInstanceId\",\"type\":\"text\",\"value\":\"202512251034200000000\"},{\"desc\":\"发起时间\",\"key\":\"startTime\",\"type\":\"text\",\"value\":\"2025.12.25 10:34:26\"},{\"desc\":\"审批结束时间\",\"key\":\"endTime\",\"type\":\"text\"},{\"desc\":\"业务名称\",\"key\":\"processDefinitionKey\",\"type\":\"text\",\"value\":\"技能培训签字(jinengpeixun)\"},{\"desc\":\"业务变量主讲人单位\",\"key\":\"speakerUnit\",\"type\":\"text\",\"value\":\"四川星腾贸易有限公司\"},{\"desc\":\"业务变量主讲人部门\",\"key\":\"speakerNode\",\"type\":\"text\",\"value\":\"一个小子部门111\"},{\"desc\":\"业务变量接受培训班组\",\"key\":\"acceptTrainingTeam\",\"type\":\"text\"},{\"desc\":\"业务变量项目名称\",\"key\":\"workspaceName\",\"type\":\"text\",\"value\":\"test-0925项目2\"},{\"desc\":\"业务变量签署发起时间\",\"key\":\"signingInitiationTime\",\"type\":\"text\",\"value\":\"20251225\"},{\"desc\":\"业务变量工人签字\",\"key\":\"workerSignature\",\"type\":\"img\"},{\"desc\":\"业务变量主讲人姓名\",\"key\":\"speakerName\",\"type\":\"text\",\"value\":\"宋爱弟\"},{\"desc\":\"默认分组111\",\"key\":\"eeeeee\",\"type\":\"text\"},{\"desc\":\"发起者\",\"key\":\"initiator\",\"type\":\"obj\",\"value\":\"{\\\"assignerName\\\":\\\"宋爱弟\\\",\\\"avatar\\\":\\\"https://axzo-app.oss-cn-chengdu.aliyuncs.com/face/face_test/9ea3b9c81ad042c7bb076d9c7e742d34.jpg\\\",\\\"nodeId\\\":\\\"7402\\\",\\\"ouId\\\":\\\"6158\\\",\\\"personId\\\":\\\"9000398967\\\",\\\"tenantId\\\":\\\"400\\\"}\"},{\"desc\":\"培训日期\",\"key\":\"trainingDate\",\"type\":\"text\",\"value\":\"2025-12-01\"},{\"desc\":\"培训时长\",\"key\":\"trainingDuration\",\"type\":\"text\",\"value\":\"11\"},{\"desc\":\"培训照片\",\"key\":\"trainingPhotos\",\"type\":\"img\",\"value\":\"\"},{\"desc\":\"签字工人\",\"key\":\"worker\",\"type\":\"text\",\"value\":\"张然\"}]";
|
||||
// List<VariableObjectDTO> variableObjectDTOS = JSON.parseArray(variableJsonStr, VariableObjectDTO.class);
|
||||
//
|
||||
// wpsFileVariableReplace(variableObjectDTOS, "", "", "", false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,7 +89,7 @@ public class WpsUtil {
|
||||
if (Objects.equals(Boolean.TRUE, autoReplaceVariables)) {
|
||||
return true;
|
||||
} else {
|
||||
return Objects.nonNull(i.getValue()) && checkNotEmptyColl(i);
|
||||
return Objects.nonNull(i.getValue()) && checkNotEmptyStr(i) && checkNotEmptyColl(i);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
List<FileReplaceContent> fileReplaceContents = BeanMapper.copyList(variables, FileReplaceContent.class, (s, t) -> {
|
||||
@ -189,6 +190,13 @@ public class WpsUtil {
|
||||
|
||||
}
|
||||
|
||||
private static boolean checkNotEmptyStr(VariableObjectDTO i) {
|
||||
if (!(i.getValue() instanceof String)) {
|
||||
return true;
|
||||
}
|
||||
return StringUtils.hasText((String) i.getValue());
|
||||
}
|
||||
|
||||
public List<VariableObjectDTO> getWpsReplaceVariables(ProcessEngineConfigurationImpl processEngineConfiguration, String processInstanceId) {
|
||||
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
|
||||
List<VariableObjectDTO> wpsVariables =
|
||||
|
||||
Loading…
Reference in New Issue
Block a user