|
@@ -86,7 +86,7 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public Boolean saveDingApply(TBDingApply tbDingApply) throws InterruptedException {
|
|
|
+ public Boolean saveDingApply(TBDingApply tbDingApply) throws Exception {
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
TBDing tbDing = tbDingService.getById(tbDingApply.getDingId());
|
|
|
String sopNo = Objects.nonNull(tbDing) ? tbDing.getSopNo() : tbDingApply.getSopNo();
|
|
@@ -101,6 +101,14 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
|
|
|
flowApproveParam.setApproveRemark(FlowApprovePassEnum.START.getTitle());
|
|
|
Map<String, Object> map = activitiService.taskApprove(flowApproveParam);
|
|
|
TFCustomFlowEntity tfCustomFlowEntity = (TFCustomFlowEntity) map.get(SystemConstant.FLOW_ENTITY);
|
|
|
+ if (!CollectionUtils.isEmpty(tbDingApply.getAttachmentIdList())) {
|
|
|
+ List<BasicAttachment> basicAttachmentList = basicAttachmentService.listByIds(tbDingApply.getAttachmentIdList());
|
|
|
+ List<String> paths = new ArrayList<>(basicAttachmentList.size());
|
|
|
+ for (BasicAttachment b : basicAttachmentList) {
|
|
|
+ paths.add(basicAttachmentService.filePreview(b));
|
|
|
+ }
|
|
|
+ tbDingApply.setAttachmentPaths(StringUtils.join(paths, ";"));
|
|
|
+ }
|
|
|
tbDingApply.setCode(tfCustomFlowEntity.getCode(), tbDingApply.getAttachmentIdList(), sysUser.getId());
|
|
|
tfCustomFlowEntity.setObjId(tbDingApply.getId());
|
|
|
tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
|
|
@@ -128,26 +136,17 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
|
|
|
IPage<DingApplyUnDoneResult> dingApplyUnDoneResultIPage = this.baseMapper.flowTaskUnDoneList(iPage, serviceId, name, supplierId, customName, startTime, endTime, applyStartTime, applyEndTime, dpr);
|
|
|
if (Objects.nonNull(dingApplyUnDoneResultIPage) && !CollectionUtils.isEmpty(dingApplyUnDoneResultIPage.getRecords())) {
|
|
|
for (DingApplyUnDoneResult d : dingApplyUnDoneResultIPage.getRecords()) {
|
|
|
- if (Objects.nonNull(d.getAttachmentPaths())) {
|
|
|
- List<BasicAttachment> basicAttachmentList = basicAttachmentService.listByIds(Arrays.asList(d.getAttachmentPaths().split(",")));
|
|
|
- StringJoiner stringJoiner = new StringJoiner(";");
|
|
|
- for (BasicAttachment b : basicAttachmentList) {
|
|
|
- String path = basicAttachmentService.filePreview(b.getPath());
|
|
|
- stringJoiner.add(path);
|
|
|
- }
|
|
|
- d.setAttachmentPaths(stringJoiner.toString());
|
|
|
- }
|
|
|
TFFlowLog tfFlowLog = tfFlowLogService.findByLastFlowLog(d.getFlowId());
|
|
|
if (Objects.nonNull(tfFlowLog) && Objects.nonNull(tfFlowLog.getPendApproveId())) {
|
|
|
List<SysUser> sysUserList = sysUserService.listByIds(Arrays.asList(tfFlowLog.getPendApproveId().split(",")));
|
|
|
List<String> userName = sysUserList.stream().map(s -> s.getRealName()).collect(Collectors.toList());
|
|
|
- d.setApproveUserName(StringUtils.join(userName, ","));
|
|
|
+ d.setApproveUserName(StringUtils.join(userName, SystemConstant.LIST_JOIN_SPLIT));
|
|
|
} else {
|
|
|
d.setApproveUserName("--");
|
|
|
}
|
|
|
String taskIds = d.getTaskIdArray();
|
|
|
- if (Objects.nonNull(taskIds) && taskIds.contains(",")) {
|
|
|
- String[] taskStrs = taskIds.split(",");
|
|
|
+ if (Objects.nonNull(taskIds) && taskIds.contains(SystemConstant.LIST_JOIN_SPLIT)) {
|
|
|
+ String[] taskStrs = taskIds.split(SystemConstant.LIST_JOIN_SPLIT);
|
|
|
boolean match = false;
|
|
|
for (int i = 0; i < taskStrs.length; i++) {
|
|
|
Task task = taskService.createTaskQuery().taskId(taskStrs[i]).singleResult();
|
|
@@ -205,20 +204,11 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
|
|
|
IPage<DingApplyDoneResult> dingApplyDoneResultIPage = this.baseMapper.flowTaskDoneList(iPage, serviceId, name, supplierId, Objects.nonNull(dingExceptionApprove) ? dingExceptionApprove.getTitle() : null, customName, startTime, endTime, applyStartTime, applyEndTime, dpr);
|
|
|
if (Objects.nonNull(dingApplyDoneResultIPage) && !CollectionUtils.isEmpty(dingApplyDoneResultIPage.getRecords())) {
|
|
|
for (DingApplyDoneResult d : dingApplyDoneResultIPage.getRecords()) {
|
|
|
- if (Objects.nonNull(d.getAttachmentPaths())) {
|
|
|
- List<BasicAttachment> basicAttachmentList = basicAttachmentService.listByIds(Arrays.asList(d.getAttachmentPaths().split(",")));
|
|
|
- StringJoiner stringJoiner = new StringJoiner(";");
|
|
|
- for (BasicAttachment b : basicAttachmentList) {
|
|
|
- String path = basicAttachmentService.filePreview(b.getPath());
|
|
|
- stringJoiner.add(path);
|
|
|
- }
|
|
|
- d.setAttachmentPaths(stringJoiner.toString());
|
|
|
- }
|
|
|
String string = tfFlowLogService.findByLastFlowLogApproveUser(d.getFlowId());
|
|
|
if (Objects.nonNull(string)) {
|
|
|
- List<SysUser> sysUserList = sysUserService.listByIds(Arrays.asList(string.split(",")));
|
|
|
+ List<SysUser> sysUserList = sysUserService.listByIds(Arrays.asList(string.split(SystemConstant.LIST_JOIN_SPLIT)));
|
|
|
List<String> userName = sysUserList.stream().map(s -> s.getRealName()).collect(Collectors.toList());
|
|
|
- d.setApproveUsersName(StringUtils.join(userName, ","));
|
|
|
+ d.setApproveUsersName(StringUtils.join(userName, SystemConstant.LIST_JOIN_SPLIT));
|
|
|
} else {
|
|
|
d.setApproveUsersName("--");
|
|
|
}
|