项目库--项目详情(项目名称和中英文切换)

This commit is contained in:
zhn
2022-10-18 13:56:54 +08:00
parent b4705535ec
commit 7ef232e79d
4 changed files with 22 additions and 6 deletions
@@ -160,7 +160,7 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) {
List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id);
List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id,cut);
if(data==null) {
return Result.error("未找到对应数据");
}
@@ -64,7 +64,7 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
* @param id
* @return
*/
List<ProjectLibraryBase> queryById(String id);
List<ProjectLibraryBase> queryById(String id,String cut);
/**
* 列表查询
@@ -8416,7 +8416,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
List<SysRole> sysRoles = new LinkedList<>();
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//项目详情中取R&H Studio和认证工程师
List<ProjectLibraryBase> projectLibraryBases = projectLibraryBaseService.queryById(projectLibraryId);
List<ProjectLibraryBase> projectLibraryBases = projectLibraryBaseService.queryById(projectLibraryId,null);
String certificationEngineerName = "";
if(projectLibraryBases.size() != 0){
certificationEngineerName = projectLibraryBases.get(0).getCertificationEngineerName();
@@ -336,7 +336,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
public void checkData(String id, String cut) {
//判断该条项目是否是自己创建,如果不是则不能删除
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<ProjectLibraryBase> projectLibraryBases = this.queryById(id);
List<ProjectLibraryBase> projectLibraryBases = this.queryById(id,null);
if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy())){
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("该条项目非本人创建,不能删除");
@@ -418,12 +418,28 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
* @return
*/
@Override
public List<ProjectLibraryBase> queryById(String id) {
public List<ProjectLibraryBase> queryById(String id,String cut) {
List<ProjectLibraryBase> records = projectLibraryBaseMapper.queryById(id);
disposeData(records,"",false);
//目标市场数据字典
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
for(ProjectLibraryBase projectLibraryBase: records){
//目标市场
Map<String,Object> param = new HashMap<>();
param.put("cut",cut);
String targetMarket = getMarket(param, targetMarketList, projectLibraryBase);
//主项目的版本号
String projectVersion = "";
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
projectVersion = "00";
}else{
projectVersion = projectLibraryBase.getProjectVersion();
}
if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName());
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName()
+ "-" + projectLibraryBase.getYearName()
+ "-" + targetMarket
+ "-" + projectVersion);
}
}
return records;