|
@@ -1,12 +1,14 @@
|
|
|
package com.fjhx.common.service.documentary.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.common.entity.documentary.bo.DocumentaryData;
|
|
|
+import com.fjhx.common.entity.documentary.dto.DocumentaryRecordDto;
|
|
|
import com.fjhx.common.entity.documentary.dto.DocumentaryRecordSelectDto;
|
|
|
import com.fjhx.common.entity.documentary.eums.DocumentaryTypeEnum;
|
|
|
import com.fjhx.common.entity.documentary.po.Documentary;
|
|
@@ -129,6 +131,31 @@ public class DocumentaryRecordServiceImpl extends ServiceImpl<DocumentaryRecordM
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
+ @DSTransactional
|
|
|
+ @Override
|
|
|
+ public void add(DocumentaryRecordDto dto) {
|
|
|
+ save(dto);
|
|
|
+ ObsFileUtil.saveFile(dto.getFileList(), dto.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @DSTransactional
|
|
|
+ @Override
|
|
|
+ public void edit(DocumentaryRecordDto dto) {
|
|
|
+ if (dto.getId() == null) {
|
|
|
+ throw new ServiceException("跟单记录id不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ updateById(dto);
|
|
|
+ ObsFileUtil.editFile(dto.getFileList(), dto.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @DSTransactional
|
|
|
+ @Override
|
|
|
+ public void delete(Long id) {
|
|
|
+ removeById(id);
|
|
|
+ ObsFileUtil.removeFile(id);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取跟单配置
|
|
|
*
|
|
@@ -177,10 +204,10 @@ public class DocumentaryRecordServiceImpl extends ServiceImpl<DocumentaryRecordM
|
|
|
}
|
|
|
|
|
|
// 业务id
|
|
|
- List<Long> businessId = records.stream().map(DocumentaryData::getId).collect(Collectors.toList());
|
|
|
+ List<Long> businessIdList = records.stream().map(DocumentaryData::getId).collect(Collectors.toList());
|
|
|
|
|
|
// 根据业务id查询跟单记录
|
|
|
- List<DocumentaryRecord> list = list(q -> q.eq(DocumentaryRecord::getBusinessId, businessId));
|
|
|
+ List<DocumentaryRecord> list = list(q -> q.in(DocumentaryRecord::getBusinessId, businessIdList));
|
|
|
|
|
|
// 查询跟单记录文件
|
|
|
List<Long> documentaryRecordList = list.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|