|
@ -31,6 +31,8 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
import java.util.Arrays; |
|
|
import java.util.Arrays; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 备忘录-难点读点 |
|
|
* 备忘录-难点读点 |
|
@ -84,7 +86,7 @@ public class MemoDifficultyServiceImpl extends BaseServiceImpl<MemoDifficultyDao |
|
|
insert(entity); |
|
|
insert(entity); |
|
|
//2.新增备忘录记录数据
|
|
|
//2.新增备忘录记录数据
|
|
|
MemoAttrEntity memoAttr = new MemoAttrEntity(); |
|
|
MemoAttrEntity memoAttr = new MemoAttrEntity(); |
|
|
memoAttr.setId(entity.getCustomerId()); |
|
|
memoAttr.setId(entity.getId()); |
|
|
memoAttr.setCustomerId(dto.getCustomerId()); |
|
|
memoAttr.setCustomerId(dto.getCustomerId()); |
|
|
memoAttr.setRemindTime(dto.getRemindTime()); |
|
|
memoAttr.setRemindTime(dto.getRemindTime()); |
|
|
memoAttr.setType("difficulty"); |
|
|
memoAttr.setType("difficulty"); |
|
@ -92,8 +94,14 @@ public class MemoDifficultyServiceImpl extends BaseServiceImpl<MemoDifficultyDao |
|
|
memoAttrService.insert(memoAttr); |
|
|
memoAttrService.insert(memoAttr); |
|
|
//3.新增难点堵点附件数据
|
|
|
//3.新增难点堵点附件数据
|
|
|
if (CollectionUtils.isNotEmpty(dto.getAttachmentList())) { |
|
|
if (CollectionUtils.isNotEmpty(dto.getAttachmentList())) { |
|
|
List<MemoAttachmentEntity> list = ConvertUtils.sourceToTarget(dto.getAttachmentList(), MemoAttachmentEntity.class); |
|
|
AtomicInteger i = new AtomicInteger(NumConstant.ZERO); |
|
|
list.forEach(l -> l.setRemindMsgId(entity.getId())); |
|
|
List<MemoAttachmentEntity> list = dto.getAttachmentList().stream().map(item -> { |
|
|
|
|
|
MemoAttachmentEntity e = ConvertUtils.sourceToTarget(item, MemoAttachmentEntity.class); |
|
|
|
|
|
e.setCustomerId(dto.getCustomerId()); |
|
|
|
|
|
e.setRemindMsgId(entity.getId()); |
|
|
|
|
|
e.setSort(i.getAndIncrement()); |
|
|
|
|
|
return e; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
memoAttachmentService.insertBatch(list); |
|
|
memoAttachmentService.insertBatch(list); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -107,8 +115,14 @@ public class MemoDifficultyServiceImpl extends BaseServiceImpl<MemoDifficultyDao |
|
|
//2.附件表数据全删全增
|
|
|
//2.附件表数据全删全增
|
|
|
memoAttachmentService.deleteByMemoId(dto.getId()); |
|
|
memoAttachmentService.deleteByMemoId(dto.getId()); |
|
|
if (CollectionUtils.isNotEmpty(dto.getAttachmentList())) { |
|
|
if (CollectionUtils.isNotEmpty(dto.getAttachmentList())) { |
|
|
List<MemoAttachmentEntity> list = ConvertUtils.sourceToTarget(dto.getAttachmentList(), MemoAttachmentEntity.class); |
|
|
AtomicInteger i = new AtomicInteger(NumConstant.ZERO); |
|
|
list.forEach(l -> l.setRemindMsgId(entity.getId())); |
|
|
List<MemoAttachmentEntity> list = dto.getAttachmentList().stream().map(item -> { |
|
|
|
|
|
MemoAttachmentEntity e = ConvertUtils.sourceToTarget(item, MemoAttachmentEntity.class); |
|
|
|
|
|
e.setCustomerId(dto.getCustomerId()); |
|
|
|
|
|
e.setRemindMsgId(dto.getId()); |
|
|
|
|
|
e.setSort(i.getAndIncrement()); |
|
|
|
|
|
return e; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
memoAttachmentService.insertBatch(list); |
|
|
memoAttachmentService.insertBatch(list); |
|
|
} |
|
|
} |
|
|
//3.判断更新提醒记录表提醒时间
|
|
|
//3.判断更新提醒记录表提醒时间
|
|
|