|
|
@ -206,19 +206,43 @@ public class TaskDeliverService implements ITaskDeliverService { |
|
|
|
if (!role.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase) && !isBelongRole){ |
|
|
|
throw new BaseException(CodeEnum.IS_NOT_EXECUTOR); |
|
|
|
} |
|
|
|
//查找以前上传的不为历史信息的文件。改为历史信息
|
|
|
|
ProTaskDeliverPostLogExample logExample = new ProTaskDeliverPostLogExample(); |
|
|
|
logExample.createCriteria().andTaskSubTimeIdEqualTo(subTimeId).andDeliverIdEqualTo(uploadDeliver.getDeliverId()) |
|
|
|
.andUserIdEqualTo(currentUserId).andIsHistoryEqualTo(0); |
|
|
|
List<ProTaskDeliverPostLog> deliverPostLogList = deliverPostLogDao.selectByExample(logExample); |
|
|
|
if (CollectionUtil.isNotEmpty(deliverPostLogList)) { |
|
|
|
for (ProTaskDeliverPostLog deliverPostLog : deliverPostLogList) { |
|
|
|
deliverPostLog.setIsHistory(1); |
|
|
|
deliverPostLogDao.updateByPrimaryKeySelective(deliverPostLog); |
|
|
|
// //查找以前上传的不为历史信息的文件。改为历史信息
|
|
|
|
// ProTaskDeliverPostLogExample logExample = new ProTaskDeliverPostLogExample();
|
|
|
|
// logExample.createCriteria().andTaskSubTimeIdEqualTo(subTimeId).andDeliverIdEqualTo(uploadDeliver.getDeliverId())
|
|
|
|
// .andUserIdEqualTo(currentUserId).andIsHistoryEqualTo(0);
|
|
|
|
// List<ProTaskDeliverPostLog> deliverPostLogList = deliverPostLogDao.selectByExample(logExample);
|
|
|
|
// if (CollectionUtil.isNotEmpty(deliverPostLogList)) {
|
|
|
|
// for (ProTaskDeliverPostLog deliverPostLog : deliverPostLogList) {
|
|
|
|
// deliverPostLog.setIsHistory(1);
|
|
|
|
// deliverPostLogDao.updateByPrimaryKeySelective(deliverPostLog);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//将文件信息与交付物绑定,添加记录deliverPostLog
|
|
|
|
if (CollectionUtil.isNotEmpty(uploadDeliver.getFileInfo()) || StrUtil.isNotEmpty(uploadDeliver.getDescription())) { |
|
|
|
if(CollectionUtil.isEmpty(uploadDeliver.getFileInfo())){ |
|
|
|
ProTaskDeliverPostLog deliverPostLog = new ProTaskDeliverPostLog(); |
|
|
|
deliverPostLog.setId(snowflake.nextId()); |
|
|
|
deliverPostLog.setDeliverId(uploadDeliver.getDeliverId()); |
|
|
|
deliverPostLog.setTaskSubTimeId(subTimeId); |
|
|
|
deliverPostLog.setUserId(currentUserId); |
|
|
|
deliverPostLog.setDescription(uploadDeliver.getDescription()); |
|
|
|
deliverPostLog.setTime(now); |
|
|
|
deliverPostLog.setIsHistory(0); |
|
|
|
deliverPostLogDao.insertSelective(deliverPostLog); |
|
|
|
//添加交付物检查人表
|
|
|
|
if (CollectionUtil.isNotEmpty(uploadDeliver.getCheckerIdList())) { |
|
|
|
ProTaskDeliverPostLogChecker postLogChecker; |
|
|
|
for (Long checkerId : uploadDeliver.getCheckerIdList()) { |
|
|
|
postLogChecker = new ProTaskDeliverPostLogChecker(); |
|
|
|
postLogChecker.setId(snowflake.nextId()); |
|
|
|
postLogChecker.setDeliverPostLogId(deliverPostLog.getId()); |
|
|
|
postLogChecker.setCheckerId(checkerId); |
|
|
|
postLogCheckerDao.insertSelective(postLogChecker); |
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new BaseException(CodeEnum.NOT_CHECKER); |
|
|
|
} |
|
|
|
//将文件信息与交付物绑定,添加记录deliverPostLog
|
|
|
|
if (CollectionUtil.isNotEmpty(uploadDeliver.getFileInfo())) { |
|
|
|
}else { |
|
|
|
for (DeliverDto.FileInfo fileInfo : uploadDeliver.getFileInfo()) { |
|
|
|
// SysCommitedFile file = commitedFileDao.selectByPrimaryKey(fileInfo.getId());
|
|
|
|
// if(ObjectUtil.isNull(file)){
|
|
|
@ -248,7 +272,8 @@ public class TaskDeliverService implements ITaskDeliverService { |
|
|
|
throw new BaseException(CodeEnum.NOT_CHECKER); |
|
|
|
} |
|
|
|
//保存wps的文件消息
|
|
|
|
saveWpsFile(currentUserId,deliverPostLog.getId(),fileInfo); |
|
|
|
saveWpsFile(currentUserId, deliverPostLog.getId(), fileInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
//修改交付物状态
|
|
|
|
ProTaskDeliver deliver = new ProTaskDeliver(); |
|
|
|