|
@@ -10,6 +10,7 @@ import com.qmth.sop.business.bean.params.FlowApproveParam;
|
|
import com.qmth.sop.business.bean.result.*;
|
|
import com.qmth.sop.business.bean.result.*;
|
|
import com.qmth.sop.business.cache.CommonCacheService;
|
|
import com.qmth.sop.business.cache.CommonCacheService;
|
|
import com.qmth.sop.business.entity.*;
|
|
import com.qmth.sop.business.entity.*;
|
|
|
|
+import com.qmth.sop.business.exec.MySQLExec;
|
|
import com.qmth.sop.business.mapper.SysUserMapper;
|
|
import com.qmth.sop.business.mapper.SysUserMapper;
|
|
import com.qmth.sop.business.service.*;
|
|
import com.qmth.sop.business.service.*;
|
|
import com.qmth.sop.common.contant.SpringContextHolder;
|
|
import com.qmth.sop.common.contant.SpringContextHolder;
|
|
@@ -105,6 +106,9 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
@Resource
|
|
@Resource
|
|
TDFormWidgetMetadataService tdFormWidgetMetadataService;
|
|
TDFormWidgetMetadataService tdFormWidgetMetadataService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ MySQLExec mySQLExec;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 根据deploymentId查找processDefinitionId
|
|
* 根据deploymentId查找processDefinitionId
|
|
*
|
|
*
|
|
@@ -124,13 +128,13 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public Map<String, Object> upload(MultipartFile file) throws IOException {
|
|
|
|
|
|
+ public Map<String, Object> upload(MultipartFile file) throws Exception {
|
|
basicAttachmentService.validateAttachment(file);
|
|
basicAttachmentService.validateAttachment(file);
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
DeploymentBuilder builder = repositoryService.createDeployment();
|
|
DeploymentBuilder builder = repositoryService.createDeployment();
|
|
ZipInputStream zip = new ZipInputStream(file.getInputStream());
|
|
ZipInputStream zip = new ZipInputStream(file.getInputStream());
|
|
builder.addZipInputStream(zip);
|
|
builder.addZipInputStream(zip);
|
|
- Map<String, Object> mapData = formPropertiesGet(builder.deploy().getId(), null, null);
|
|
|
|
|
|
+ Map<String, Object> mapData = formPropertiesGet(builder.deploy().getId(), null, null, true);
|
|
map.put(file.getName(), mapData);
|
|
map.put(file.getName(), mapData);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
@@ -143,7 +147,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public Map<String, Object> createDeployment(List<TFCustomTypeEnum> tfCustomTypeEnumList) throws IOException {
|
|
|
|
|
|
+ public Map<String, Object> createDeployment(List<TFCustomTypeEnum> tfCustomTypeEnumList) throws Exception {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
for (TFCustomTypeEnum tfCustomTypeEnum : tfCustomTypeEnumList) {
|
|
for (TFCustomTypeEnum tfCustomTypeEnum : tfCustomTypeEnumList) {
|
|
List<TFCustomFlow> tfCustomFlowList = tfCustomFlowService.list(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getType, tfCustomTypeEnum));
|
|
List<TFCustomFlow> tfCustomFlowList = tfCustomFlowService.list(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getType, tfCustomTypeEnum));
|
|
@@ -152,10 +156,10 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
ClassPathResource resource = new ClassPathResource(tfCustomTypeEnum.getFileName());
|
|
ClassPathResource resource = new ClassPathResource(tfCustomTypeEnum.getFileName());
|
|
ZipInputStream zip = new ZipInputStream(resource.getInputStream());
|
|
ZipInputStream zip = new ZipInputStream(resource.getInputStream());
|
|
builder.addZipInputStream(zip);
|
|
builder.addZipInputStream(zip);
|
|
- Map<String, Object> mapData = formPropertiesGet(builder.deploy().getId(), null, null);
|
|
|
|
|
|
+ Map<String, Object> mapData = formPropertiesGet(builder.deploy().getId(), null, null, true);
|
|
map.put(tfCustomTypeEnum.name(), mapData);
|
|
map.put(tfCustomTypeEnum.name(), mapData);
|
|
} else {
|
|
} else {
|
|
- Map<String, Object> mapData = formPropertiesGet(tfCustomFlowList.get(0).getFlowDeploymentId(), null, null);
|
|
|
|
|
|
+ Map<String, Object> mapData = formPropertiesGet(tfCustomFlowList.get(0).getFlowDeploymentId(), null, null, true);
|
|
map.put(tfCustomTypeEnum.name(), mapData);
|
|
map.put(tfCustomTypeEnum.name(), mapData);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -396,13 +400,15 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
* @param flowDeploymentId
|
|
* @param flowDeploymentId
|
|
* @param flowId
|
|
* @param flowId
|
|
* @param taskId
|
|
* @param taskId
|
|
|
|
+ * @param dynamicTable
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public Map<String, Object> formPropertiesGet(String flowDeploymentId,
|
|
public Map<String, Object> formPropertiesGet(String flowDeploymentId,
|
|
Long flowId,
|
|
Long flowId,
|
|
- Long taskId) {
|
|
|
|
|
|
+ Long taskId,
|
|
|
|
+ Boolean dynamicTable) throws Exception {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
FlowResult flowResult = null;
|
|
FlowResult flowResult = null;
|
|
TFCustomFlow tfCustomFlow = null;
|
|
TFCustomFlow tfCustomFlow = null;
|
|
@@ -418,7 +424,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
flowResult = JSONObject.parseObject(tfCustomFlow.getFlowProcessVar(), FlowResult.class);
|
|
flowResult = JSONObject.parseObject(tfCustomFlow.getFlowProcessVar(), FlowResult.class);
|
|
if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.QUALITY_PROBLEM_FLOW) {
|
|
if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.QUALITY_PROBLEM_FLOW) {
|
|
map = this.getFlowFormPropertie(flowResult, map, 1);
|
|
map = this.getFlowFormPropertie(flowResult, map, 1);
|
|
- if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
|
|
|
|
|
|
+ if ((Objects.nonNull(dynamicTable) && dynamicTable) && (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW)) {
|
|
Map<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|
|
Map<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|
|
Set<TDFormWidgetMetadata> tdFormWidgetMetadataSet = new LinkedHashSet<>();
|
|
Set<TDFormWidgetMetadata> tdFormWidgetMetadataSet = new LinkedHashSet<>();
|
|
for (Map.Entry<String, FlowTaskResult> entry : setupMap.entrySet()) {
|
|
for (Map.Entry<String, FlowTaskResult> entry : setupMap.entrySet()) {
|
|
@@ -439,6 +445,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
tdFormWidgetMetadataService.deleteAllData(tfCustomFlow.getType());
|
|
tdFormWidgetMetadataService.deleteAllData(tfCustomFlow.getType());
|
|
tdFormWidgetMetadataService.saveBatch(tdFormWidgetMetadataSet);
|
|
tdFormWidgetMetadataService.saveBatch(tdFormWidgetMetadataSet);
|
|
}
|
|
}
|
|
|
|
+ mySQLExec.execCreateSopDynamicTable(SystemConstant.SOP_DYNAMIC_TABLE_FILE_NAME, tfCustomFlow.getType());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (Objects.nonNull(flowId)) {
|
|
} else if (Objects.nonNull(flowId)) {
|