增加templatecode,优化代码。
This commit is contained in:
parent
d50a189cb7
commit
0cb00f06bf
|
|
@ -210,8 +210,8 @@ public class SysEdFileInfoController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/importPrj")
|
@GetMapping("/importPrj")
|
||||||
@UserOperation(value = "导入本地工程", modelName = UserOperationModuleEnum.SYS_PRJ_DATABASE)
|
@UserOperation(value = "导入本地工程", modelName = UserOperationModuleEnum.SYS_PRJ_DATABASE)
|
||||||
public ElectromagneticResult<?> importPrj(@RequestParam("file") MultipartFile file) {
|
public ElectromagneticResult<?> importPrj(@RequestParam("file") MultipartFile file, @RequestParam(name = "templateCode", defaultValue = "bhdcfzrjzt", required = false) String templateCode) {
|
||||||
return edFileInfoService.importPrj(file);
|
return edFileInfoService.importPrj(file, templateCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,5 +247,5 @@ public interface EdFileInfoService {
|
||||||
/**
|
/**
|
||||||
* 导入工程
|
* 导入工程
|
||||||
*/
|
*/
|
||||||
ElectromagneticResult<?> importPrj(MultipartFile file);
|
ElectromagneticResult<?> importPrj(MultipartFile file, String templateCode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1517,13 +1517,13 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ElectromagneticResult<?> importPrj(MultipartFile file) {
|
public ElectromagneticResult<?> importPrj(MultipartFile file, String templateCode) {
|
||||||
try {
|
try {
|
||||||
// 创建工程
|
// 创建工程
|
||||||
String prjId = updateImportPrj2Db(file);
|
String prjId = updateImportPrj2Db(file);
|
||||||
// 层级沿用,先这样写,后续根据需求扩展
|
// 层级沿用,先这样写,后续根据需求扩展
|
||||||
EdFileInfo prj = this.baseMapper.selectOne(Wrappers.lambdaQuery(EdFileInfo.class)
|
EdFileInfo prj = this.baseMapper.selectOne(Wrappers.lambdaQuery(EdFileInfo.class)
|
||||||
.eq(EdFileInfo::getTemplateCode, "bhdcfzrjzt")
|
.eq(EdFileInfo::getTemplateCode, templateCode)
|
||||||
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code));
|
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code));
|
||||||
commonService.follow(prj.getId(), prjId, DataOwnEnum.SYS_PRJ.code);
|
commonService.follow(prj.getId(), prjId, DataOwnEnum.SYS_PRJ.code);
|
||||||
// 工程发布
|
// 工程发布
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue