|
|
@ -21,25 +21,29 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 在线模板Service业务层处理
|
|
|
|
* 在线模板Service业务层处理
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author farben
|
|
|
|
* @author farben
|
|
|
|
* @date 2023-09-07
|
|
|
|
* @date 2023-09-07
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordMapper,BmsTemplateRecord> implements IBmsTemplateRecordService {
|
|
|
|
public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordMapper, BmsTemplateRecord> implements IBmsTemplateRecordService {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IBmsEnterpriseDirectoryService enterpriseDirectoryService;
|
|
|
|
private IBmsEnterpriseDirectoryService enterpriseDirectoryService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IBmsEnterpriseBasicInfoService iBmsEnterpriseBasicInfoService;
|
|
|
|
private IBmsEnterpriseBasicInfoService iBmsEnterpriseBasicInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询在线模板
|
|
|
|
* 查询在线模板
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param id 在线模板主键
|
|
|
|
* @param id 在线模板主键
|
|
|
|
* @return 在线模板
|
|
|
|
* @return 在线模板
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -54,7 +58,7 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询在线模板列表
|
|
|
|
* 查询在线模板列表
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param bmsTemplateRecordQueryDto 在线模板
|
|
|
|
* @param bmsTemplateRecordQueryDto 在线模板
|
|
|
|
* @return 在线模板
|
|
|
|
* @return 在线模板
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -72,7 +76,7 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
|
|
|
|
public List<BmsTemplateRecordQueryVo> selectBmsTemplateNameList(BmsTemplateQueryDto bmsTemplateQueryDto) {
|
|
|
|
public List<BmsTemplateRecordQueryVo> selectBmsTemplateNameList(BmsTemplateQueryDto bmsTemplateQueryDto) {
|
|
|
|
Long enterpriseId = bmsTemplateQueryDto.getEnterpriseId();
|
|
|
|
Long enterpriseId = bmsTemplateQueryDto.getEnterpriseId();
|
|
|
|
BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo = iBmsEnterpriseBasicInfoService.selectBmsEnterpriseBasicInfoById(enterpriseId);
|
|
|
|
BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo = iBmsEnterpriseBasicInfoService.selectBmsEnterpriseBasicInfoById(enterpriseId);
|
|
|
|
if (BeanUtil.isNotEmpty(bmsEnterpriseBasicInfo)){
|
|
|
|
if (BeanUtil.isNotEmpty(bmsEnterpriseBasicInfo)) {
|
|
|
|
bmsTemplateQueryDto.setCreditCode(bmsEnterpriseBasicInfo.getCreditCode());
|
|
|
|
bmsTemplateQueryDto.setCreditCode(bmsEnterpriseBasicInfo.getCreditCode());
|
|
|
|
return baseMapper.selectBmsTemplateNameList(bmsTemplateQueryDto);
|
|
|
|
return baseMapper.selectBmsTemplateNameList(bmsTemplateQueryDto);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -81,7 +85,7 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增在线模板
|
|
|
|
* 新增在线模板
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param bmsTemplateRecordAddDto 在线模板
|
|
|
|
* @param bmsTemplateRecordAddDto 在线模板
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -94,13 +98,24 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
|
|
|
|
num = baseMapper.insertBmsTemplateRecord(bmsTemplateRecordAddDto);
|
|
|
|
num = baseMapper.insertBmsTemplateRecord(bmsTemplateRecordAddDto);
|
|
|
|
List<BmsEnterpriseDirectory> enterpriseDirectoryList = bmsTemplateRecordAddDto
|
|
|
|
List<BmsEnterpriseDirectory> enterpriseDirectoryList = bmsTemplateRecordAddDto
|
|
|
|
.getEnterpriseDirectoryList();
|
|
|
|
.getEnterpriseDirectoryList();
|
|
|
|
if (null != enterpriseDirectoryList && enterpriseDirectoryList.size()>0){
|
|
|
|
if (null != enterpriseDirectoryList && enterpriseDirectoryList.size() > 0) {
|
|
|
|
enterpriseDirectoryList.forEach(x->{
|
|
|
|
enterpriseDirectoryList.forEach(x -> {
|
|
|
|
x.setTemplateRecordId(bmsTemplateRecordAddDto.getId());
|
|
|
|
x.setTemplateRecordId(bmsTemplateRecordAddDto.getId());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
enterpriseDirectoryService.saveOrUpdateBatch(enterpriseDirectoryList);
|
|
|
|
enterpriseDirectoryService.saveOrUpdateBatch(enterpriseDirectoryList);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
List<BmsEnterpriseBasicInfo> list = iBmsEnterpriseBasicInfoService.list();
|
|
|
|
|
|
|
|
Collection<BmsEnterpriseDirectory> copyList = new ArrayList<>();
|
|
|
|
|
|
|
|
for (BmsEnterpriseBasicInfo items : list) {
|
|
|
|
|
|
|
|
BmsEnterpriseDirectory bms = new BmsEnterpriseDirectory();
|
|
|
|
|
|
|
|
bms.setTemplateRecordId(bmsTemplateRecordAddDto.getId());
|
|
|
|
|
|
|
|
bms.setEnterpriseName(items.getEnterpriseName());
|
|
|
|
|
|
|
|
bms.setCreditCode(items.getCreditCode());
|
|
|
|
|
|
|
|
copyList.add(bms);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
enterpriseDirectoryService.saveBatch(copyList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}catch (Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return num;
|
|
|
|
return num;
|
|
|
@ -108,7 +123,7 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 修改在线模板
|
|
|
|
* 修改在线模板
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param bmsTemplateRecordUpdateDto 在线模板
|
|
|
|
* @param bmsTemplateRecordUpdateDto 在线模板
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -119,13 +134,13 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
|
|
|
|
int num = baseMapper.updateBmsTemplateRecord(bmsTemplateRecordUpdateDto);
|
|
|
|
int num = baseMapper.updateBmsTemplateRecord(bmsTemplateRecordUpdateDto);
|
|
|
|
// 删除企业相关列表
|
|
|
|
// 删除企业相关列表
|
|
|
|
QueryWrapper<BmsEnterpriseDirectory> queryWrapper = new QueryWrapper<>();
|
|
|
|
QueryWrapper<BmsEnterpriseDirectory> queryWrapper = new QueryWrapper<>();
|
|
|
|
queryWrapper.eq("template_record_id",bmsTemplateRecordUpdateDto.getId());
|
|
|
|
queryWrapper.eq("template_record_id", bmsTemplateRecordUpdateDto.getId());
|
|
|
|
enterpriseDirectoryService.remove(queryWrapper);
|
|
|
|
enterpriseDirectoryService.remove(queryWrapper);
|
|
|
|
// 新增企业相关列表
|
|
|
|
// 新增企业相关列表
|
|
|
|
List<BmsEnterpriseDirectory> enterpriseDirectoryList = bmsTemplateRecordUpdateDto
|
|
|
|
List<BmsEnterpriseDirectory> enterpriseDirectoryList = bmsTemplateRecordUpdateDto
|
|
|
|
.getEnterpriseDirectoryList();
|
|
|
|
.getEnterpriseDirectoryList();
|
|
|
|
if (null != enterpriseDirectoryList && enterpriseDirectoryList.size()>0){
|
|
|
|
if (null != enterpriseDirectoryList && enterpriseDirectoryList.size() > 0) {
|
|
|
|
enterpriseDirectoryList.forEach(x->{
|
|
|
|
enterpriseDirectoryList.forEach(x -> {
|
|
|
|
x.setTemplateRecordId(bmsTemplateRecordUpdateDto.getId());
|
|
|
|
x.setTemplateRecordId(bmsTemplateRecordUpdateDto.getId());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
enterpriseDirectoryService.saveOrUpdateBatch(enterpriseDirectoryList);
|
|
|
|
enterpriseDirectoryService.saveOrUpdateBatch(enterpriseDirectoryList);
|
|
|
@ -135,7 +150,7 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 批量删除在线模板
|
|
|
|
* 批量删除在线模板
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param ids 需要删除的在线模板主键
|
|
|
|
* @param ids 需要删除的在线模板主键
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -146,7 +161,7 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 删除在线模板信息
|
|
|
|
* 删除在线模板信息
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param id 在线模板主键
|
|
|
|
* @param id 在线模板主键
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|