项目库--项目详情(项目名称和中英文切换)
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
|
|||||||
@GetMapping(value = "/queryById")
|
@GetMapping(value = "/queryById")
|
||||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id,
|
public Result<?> queryById(@RequestParam(name="id",required=true) String id,
|
||||||
@RequestParam(name="cut",required=true) String cut) {
|
@RequestParam(name="cut",required=true) String cut) {
|
||||||
List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id);
|
List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id,cut);
|
||||||
if(data==null) {
|
if(data==null) {
|
||||||
return Result.error("未找到对应数据");
|
return Result.error("未找到对应数据");
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -64,7 +64,7 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
|
|||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ProjectLibraryBase> queryById(String id);
|
List<ProjectLibraryBase> queryById(String id,String cut);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
|
|||||||
+1
-1
@@ -8416,7 +8416,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
List<SysRole> sysRoles = new LinkedList<>();
|
List<SysRole> sysRoles = new LinkedList<>();
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
//项目详情中取R&H Studio和认证工程师
|
//项目详情中取R&H Studio和认证工程师
|
||||||
List<ProjectLibraryBase> projectLibraryBases = projectLibraryBaseService.queryById(projectLibraryId);
|
List<ProjectLibraryBase> projectLibraryBases = projectLibraryBaseService.queryById(projectLibraryId,null);
|
||||||
String certificationEngineerName = "";
|
String certificationEngineerName = "";
|
||||||
if(projectLibraryBases.size() != 0){
|
if(projectLibraryBases.size() != 0){
|
||||||
certificationEngineerName = projectLibraryBases.get(0).getCertificationEngineerName();
|
certificationEngineerName = projectLibraryBases.get(0).getCertificationEngineerName();
|
||||||
|
|||||||
+19
-3
@@ -336,7 +336,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
public void checkData(String id, String cut) {
|
public void checkData(String id, String cut) {
|
||||||
//判断该条项目是否是自己创建,如果不是则不能删除
|
//判断该条项目是否是自己创建,如果不是则不能删除
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
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(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy())){
|
||||||
if(CutEnum.CN.getValue().equals(cut)){
|
if(CutEnum.CN.getValue().equals(cut)){
|
||||||
throw new JeroBootException("该条项目非本人创建,不能删除");
|
throw new JeroBootException("该条项目非本人创建,不能删除");
|
||||||
@@ -418,12 +418,28 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<ProjectLibraryBase> queryById(String id) {
|
public List<ProjectLibraryBase> queryById(String id,String cut) {
|
||||||
List<ProjectLibraryBase> records = projectLibraryBaseMapper.queryById(id);
|
List<ProjectLibraryBase> records = projectLibraryBaseMapper.queryById(id);
|
||||||
disposeData(records,"",false);
|
disposeData(records,"",false);
|
||||||
|
//目标市场数据字典
|
||||||
|
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
|
||||||
for(ProjectLibraryBase projectLibraryBase: records){
|
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())){
|
if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
|
||||||
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName());
|
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName()
|
||||||
|
+ "-" + projectLibraryBase.getYearName()
|
||||||
|
+ "-" + targetMarket
|
||||||
|
+ "-" + projectVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return records;
|
return records;
|
||||||
|
|||||||
Reference in New Issue
Block a user