认证清单-催办消息完善。

This commit is contained in:
wangzhijiang
2023-03-10 11:06:27 +08:00
parent b4f9099875
commit 810f1ffd7b
4 changed files with 64 additions and 7 deletions
@@ -145,6 +145,14 @@ public class ProjectLibraryBase implements Comparable<ProjectLibraryBase> {
@TableField(exist = false)
private String brandTextEn;
/**项目名称 英文*/
@TableField(exist = false)
private String projectNameEn;
/**项目名称 中文**/
@TableField(exist = false)
private String projectNameCn;
@Override
public int compareTo(ProjectLibraryBase o) {
return Integer.valueOf(this.projectVersion)-Integer.valueOf(o.projectVersion);//升序
@@ -139,4 +139,11 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
* @return
*/
List<ProjectLibraryBase> getParentAndChildern(String parentId);
/**
* 根据id查询项目库详情信息 发送飞书消息时使用,之前的 queryById不太兼容
* @param projectLibraryId
* @return
*/
ProjectLibraryBase selectById(String projectLibraryId);
}
@@ -1328,13 +1328,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
String projectLibraryId = json.getString("projectLibraryId");
ProjectLibraryBase projectLibraryBase = projectLibraryBaseService.queryById(projectLibraryId, CutEnum.EN.getValue()).get(0);
String PRN_EN = projectLibraryBase.getProjectName();//项目名称
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId);
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
if(ObjectUtils.isEmpty(projectLibraryBase)){
throw new JeroBootException("无法获取项目库信息,项目库id为:" + projectLibraryId + " 请联系管理员!");
}
// ProjectLibraryBase projectLibraryBaseCn = projectLibraryBaseService.queryById(projectLibraryId, CutEnum.CN.getValue()).get(0);
// String PRN_CN = projectLibraryBase.getProjectName();//项目名称
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> idList = Arrays.asList(ids.split(","));
@@ -1350,7 +1349,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
+ JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getLink()
+ projectLibraryId
+ JumpLinkEnum.CERTIFICATION_INVENTORY_LINK.getType()
+ "&projectName=" + PRN_EN;
+ "&projectName=" + PRN_CN;
//飞书跳转链接
String hrefFeishu_EN = backUrl
@@ -1424,7 +1423,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
larkMesJson.put("userIds",thirdId);
Map<String,Object> templateVariableMap = new HashMap<>();
templateVariableMap.put("projectNameCn",PRN_EN);
templateVariableMap.put("projectNameCn",PRN_CN);
templateVariableMap.put("projectNameEn",PRN_EN);
templateVariableMap.put("standName",standName);
templateVariableMap.put("itemName",itemName);
@@ -1501,7 +1500,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
larkMesJson.put("userIds",thirdId);
Map<String,Object> templateVariableMap = new HashMap<>();
templateVariableMap.put("projectNameCn",PRN_EN);
templateVariableMap.put("projectNameCn",PRN_CN);
templateVariableMap.put("projectNameEn",PRN_EN);
templateVariableMap.put("standName",standName);
templateVariableMap.put("itemName",itemName);
@@ -1857,6 +1857,49 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
List<ProjectLibraryBase> list = this.list(wrapper);
return list;
}
@Override
public ProjectLibraryBase selectById(String projectLibraryId) {
List<ProjectLibraryBase> records = this.projectLibraryBaseMapper.queryById(projectLibraryId);
disposeData(records,"",false);
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
for(ProjectLibraryBase projectLibraryBase: records){
//历史数据的主版本没有版本号,所以默认给00
if(StringUtils.isBlank(projectLibraryBase.getParentId()) && StringUtils.isBlank(projectLibraryBase.getProjectVersion())){
projectLibraryBase.setProjectVersion("00");
}
//目标市场 英文
Map<String,Object> paramEn = new HashMap<>();
paramEn.put("cut",CutEnum.EN.getValue());
String targetMarketEn = getMarket(paramEn, targetMarketList, projectLibraryBase);
//目标市场 中文
Map<String,Object> paramCn = new HashMap<>();
paramCn.put("cut",CutEnum.CN.getValue());
String targetMarketCn = getMarket(paramCn, targetMarketList, projectLibraryBase);
//主项目的版本号
String projectVersion = "";
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
projectVersion = "00";
}else{
projectVersion = projectLibraryBase.getProjectVersion();
}
if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
projectLibraryBase.setProjectNameEn(projectLibraryBase.getProjectName()
+ "-" + projectLibraryBase.getYearName()
+ "-" + targetMarketEn
+ "-" + projectVersion);
projectLibraryBase.setProjectNameCn(projectLibraryBase.getProjectName()
+ "-" + projectLibraryBase.getYearName()
+ "-" + targetMarketCn
+ "-" + projectVersion);
}
}
return records.get(0);
}
}