|
|
@@ -9,6 +9,10 @@ import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskApproveR
|
|
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.entry.OaEntryDO;
|
|
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.entry.OaEntryMapper;
|
|
|
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
|
|
|
+import cn.iocoder.yudao.module.infra.api.file.dto.FileDTO;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
|
|
|
import org.flowable.engine.RuntimeService;
|
|
|
import org.flowable.engine.TaskService;
|
|
|
import org.flowable.engine.runtime.ProcessInstance;
|
|
|
@@ -60,6 +64,8 @@ public class OaEntryServiceImpl implements OaEntryService {
|
|
|
public Integer startOaEntry(Long userId, OaEntrySaveReqVO createReqVO) {
|
|
|
//判断是否已经发起流程
|
|
|
Boolean auditPass = createReqVO.getAuditPass();
|
|
|
+ //创建单据uuid
|
|
|
+ String uuid = IdUtil.fastSimpleUUID();
|
|
|
// 插入
|
|
|
OaEntryDO oaEntry = BeanUtils.toBean(createReqVO, OaEntryDO.class);
|
|
|
oaEntryMapper.insert(oaEntry);
|
|
|
@@ -78,12 +84,15 @@ public class OaEntryServiceImpl implements OaEntryService {
|
|
|
|
|
|
// 将工作流的编号,单据状态 表单uuid 最后一次审批时间 当前审批人 更新到 OA 入职中
|
|
|
oaEntryMapper.updateById(new OaEntryDO().setId(oaEntry.getId()).setProcInstId(processInstanceId).setAuditStatus("1")
|
|
|
- .setEntryId(IdUtil.fastSimpleUUID()).setFinalAuditDate(new Date()).setCurrentAuditEmployeeId(task.getAssignee()));
|
|
|
+ .setEntryId(uuid).setFinalAuditDate(new Date()).setCurrentAuditEmployeeId(task.getAssignee()));
|
|
|
}else {
|
|
|
// 将单据状态 表单uuid 更新到 OA入职中
|
|
|
- oaEntryMapper.updateById(new OaEntryDO().setId(oaEntry.getId()).setAuditStatus("0").setEntryId(UUID.randomUUID().toString()));
|
|
|
+ oaEntryMapper.updateById(new OaEntryDO().setId(oaEntry.getId()).setAuditStatus("0").setEntryId(uuid));
|
|
|
}
|
|
|
|
|
|
+ //保存附件uuid
|
|
|
+ LambdaUpdateWrapper<FileDTO> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.in(FileDTO::getId, createReqVO.getFileIdList()).set(FileDTO::getServiceId, uuid);
|
|
|
// todo 站内信发送
|
|
|
// loanInfoService.sendMassage(actBaseInfo);
|
|
|
// 返回
|
|
|
@@ -138,6 +147,11 @@ public class OaEntryServiceImpl implements OaEntryService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //保存附件uuid
|
|
|
+ LambdaUpdateWrapper<FileDTO> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.in(FileDTO::getId, createReqVO.getFileIdList()).set(FileDTO::getServiceId, createReqVO.getEntryId());
|
|
|
+
|
|
|
// todo 站内信发送
|
|
|
// loanInfoService.sendMassage(actBaseInfo);
|
|
|
// 返回
|
|
|
@@ -158,9 +172,7 @@ public class OaEntryServiceImpl implements OaEntryService {
|
|
|
// 校验存在
|
|
|
validateOaEntryExists(id);
|
|
|
// 删除
|
|
|
-// oaEntryMapper.deleteById(id);
|
|
|
- // 将单据状态 更新到 OA 入职中
|
|
|
- oaEntryMapper.updateById((OaEntryDO) new OaEntryDO().setId(id).setDeleted(true));
|
|
|
+ oaEntryMapper.deleteById(id);
|
|
|
}
|
|
|
|
|
|
private void validateOaEntryExists(Integer id) {
|