Commit d0b75b48 by HlQ

[chg] 项目合并新增巡检服务单合并

1 parent 5ac12cce
......@@ -48,6 +48,7 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
private final IFileService fileService;
private final IFaultLogService faultLogService;
private final IFormService formService;
private final IInspectService inspectService;
private final Converter converter;
// 引入 taskService 会循环依赖
private final TaskMapper taskMapper;
......@@ -233,6 +234,7 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
public String mergeStore(StoreDTO dto) {
// targetId 合并到 sourceId
Long sourceId = dto.getSourceId();
Store store = this.getById(sourceId);
Long targetId = dto.getTargetId();
// 项目关联合同合并
Opt.ofEmptyAble(contractStoreService.lambdaQuery().select(RContractStore::getContractId).eq(RContractStore::getStoreId, targetId).list())
......@@ -253,7 +255,8 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
taskMapper.update(new Task(), Wrappers.lambdaUpdate(Task.class).set(Task::getStoreId, sourceId).eq(Task::getStoreId, targetId));
fileService.lambdaUpdate().set(FileInfo::getStoreId, sourceId).eq(FileInfo::getStoreId, targetId).eq(FileInfo::getSourceType, 3).update();
faultLogService.lambdaUpdate().set(FaultLog::getStoreId, sourceId).eq(FaultLog::getStoreId, targetId).update();
formService.lambdaUpdate().set(Form::getStoreId, sourceId).eq(Form::getStoreId, targetId).update(new Form());
formService.lambdaUpdate().set(Form::getStoreId, sourceId).set(Form::getAccountId, store.getAccountId()).eq(Form::getStoreId, targetId).update(new Form());
inspectService.lambdaUpdate().set(Inspect::getStoreId, sourceId).set(Inspect::getAccountId, store.getAccountId()).eq(Inspect::getStoreId, targetId).update(new Inspect());
// 删除 targetId 对应的项目
this.removeById(targetId);
return "合并成功";
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!