Browse Source

0701v1.2

master
zy_Java 6 years ago
parent
commit
31548a1d69
  1. 2
      tall/src/main/java/com/ccsens/tall/bean/vo/DeliverVo.java
  2. 31
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java

2
tall/src/main/java/com/ccsens/tall/bean/vo/DeliverVo.java

@ -29,7 +29,7 @@ public class DeliverVo {
public static class FilePath { public static class FilePath {
@ApiModelProperty("文件ID") @ApiModelProperty("文件ID")
private Long fileId; private Long fileId;
@JsonIgnore @ApiModelProperty("交付物上传的记录id")
private Long postLogId; private Long postLogId;
@JsonIgnore @JsonIgnore
private Date updateTime; private Date updateTime;

31
tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java

@ -697,8 +697,13 @@ public class TaskDeliverService implements ITaskDeliverService {
*/ */
@Override @Override
public void deleteDeliver(Long currentUserId, Long deliverId, Long taskId) throws Exception { public void deleteDeliver(Long currentUserId, Long deliverId, Long taskId) throws Exception {
ProTaskDeliver deliver = taskDeliverDao.selectByPrimaryKey(deliverId); // ProTaskDeliver deliver = taskDeliverDao.selectByPrimaryKey(deliverId);
if(ObjectUtil.isNull(deliver)){ // if(ObjectUtil.isNull(deliver)){
// throw new BaseException(CodeEnum.NOT_DELIVER);
// }
ProTaskDeliverPostLog deliverPostLog = deliverPostLogDao.selectByPrimaryKey(deliverId);
if(ObjectUtil.isNull(deliverPostLog)){
throw new BaseException(CodeEnum.NOT_DELIVER); throw new BaseException(CodeEnum.NOT_DELIVER);
} }
Long subTimeId = isTaskOrSubTime(taskId); Long subTimeId = isTaskOrSubTime(taskId);
@ -708,13 +713,13 @@ public class TaskDeliverService implements ITaskDeliverService {
List<Long> userIdList = new ArrayList<>(); List<Long> userIdList = new ArrayList<>();
//同步锁,防止多个用户同时操作该数据 //同步锁,防止多个用户同时操作该数据
synchronized (this) { synchronized (this) {
//查找此交付物与文件的中间表 // //查找此交付物与文件的中间表
ProTaskDeliverPostLogExample deliverPostLogExample = new ProTaskDeliverPostLogExample(); // ProTaskDeliverPostLogExample deliverPostLogExample = new ProTaskDeliverPostLogExample();
deliverPostLogExample.createCriteria().andDeliverIdEqualTo(deliverId).andTaskSubTimeIdEqualTo(subTimeId); // deliverPostLogExample.createCriteria().andDeliverIdEqualTo(deliverId).andTaskSubTimeIdEqualTo(subTimeId);
List<ProTaskDeliverPostLog> deliverPostLogList = deliverPostLogDao.selectByExample(deliverPostLogExample); // List<ProTaskDeliverPostLog> deliverPostLogList = deliverPostLogDao.selectByExample(deliverPostLogExample);
if (CollectionUtil.isNotEmpty(deliverPostLogList)) { // if (ObjectUtil.isNotNull(deliverPostLog)) {
for (ProTaskDeliverPostLog deliverPostLog : deliverPostLogList) { // for (ProTaskDeliverPostLog deliverPostLog : deliverPostLogList) {
if (currentUserId.longValue() == deliverPostLog.getUserId().longValue()) { if (currentUserId.longValue() == deliverPostLog.getUserId().longValue()) {
if (deliverPostLog.getIsHistory() == 0) { if (deliverPostLog.getIsHistory() == 0) {
deliverPostLog.setIsHistory(1); deliverPostLog.setIsHistory(1);
@ -732,8 +737,9 @@ public class TaskDeliverService implements ITaskDeliverService {
} else { } else {
throw new BaseException("您无法删除别人上传的交付物"); throw new BaseException("您无法删除别人上传的交付物");
} }
} // }
} // }
ProTaskDeliver deliver = taskDeliverDao.selectByPrimaryKey(deliverPostLog.getDeliverId());
deliver.setIsUpload(0); deliver.setIsUpload(0);
taskDeliverDao.updateByPrimaryKeySelective(deliver); taskDeliverDao.updateByPrimaryKeySelective(deliver);
@ -768,11 +774,6 @@ public class TaskDeliverService implements ITaskDeliverService {
deleteMessage.setReceivers(messageUserList); deleteMessage.setReceivers(messageUserList);
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME, rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(deleteMessage)); JacksonUtil.beanToJson(deleteMessage));
// MessageRule messageRule = MessageRule.defaultRule(MessageConstant.DomainType.User);
// String s = JacksonUtil.beanToJson(deleteMessage);
// InMessage inMessage = InMessage.newToUserMessage(currentUserId.toString(),userIdSet,null,messageRule,s);
//
// messageService.sendDeliverMessageWithDelete(inMessage);
//用智能助手发送消息 //用智能助手发送消息
robotService.deleteDeliverRobotSend(currentUserId,deliver.getName(),subTimeId); robotService.deleteDeliverRobotSend(currentUserId,deliver.getName(),subTimeId);

Loading…
Cancel
Save