Merge branch 'fix_20230830'

This commit is contained in:
高嵩
2023-09-01 17:34:08 +08:00
7 changed files with 172 additions and 17 deletions
@@ -169,6 +169,12 @@ public enum TemplateInfoEnum2 {
// 认证参数收集-退回
HOMO_PARAMETER_COLLECTION_BACK("认证参数收集","ctp_AArY5ngxD5cv","Homo Parameter Collection"), // 已同步飞书开放平台
// OTA认证管理-公共-绿色
OTA_MANAGER_G("OTA认证管理","ctp_AAm2fgLqJccz","OTA Manager Green"), // 已同步飞书开放平台
// OTA认证管理-公共-红色
OTA_MANAGER_R("OTA认证管理","ctp_AAmvnNtu20oM","OTA Manager Red"), // 已同步飞书开放平台
;
String nameCn;
@@ -159,4 +159,10 @@ public interface IFeishuService {
*/
void sendMessageHomoParameterCollection(String templeteId,Map<String,Object> params,String flag);
/**
* 飞书消息模板--OTA认证管理(主题颜色为绿色)
*/
public void sendMessageOtaManager(String templeteId, Map<String, Object> params);
}
@@ -1636,4 +1636,52 @@ public class FeishuServiceImpl implements IFeishuService {
}
}
/**
* 飞书消息模板--OTA认证管理(主题颜色为红色或绿色)
*
* @param templeteId
* @param params
*/
@Override
public void sendMessageOtaManager(String templeteId, Map<String, Object> params) {
List<String> userIdList = (List<String>) params.get("userIdList");
if (CollectionUtils.isNotEmpty(userIdList)) {
List<SysUser> userInfoList = this.sysUserService.querySysUserListByIdList(userIdList);
String contentCn = (String) params.get("contentCn");
String contentEn = (String) params.get("contentEn");
String viewBtnUrlCn = (String) params.get("viewBtnUrlCn");
String viewBtnUrlEn = (String) params.get("viewBtnUrlEn");
String viewBtnUrlCnPhone = (String) params.get("viewBtnUrlCnPhone");
String plannedBpLaunchBatch = (String) params.get("plannedBpLaunchBatch");
String appliedVehicleProject = (String) params.get("appliedVehicleProject");
String initiator = (String) params.get("initiator");
try {
for (String userId : userIdList) {
String thirdId = this.sysUserService.getUserThirdIdByUserId(userInfoList, userId);
if (StringUtils.isNotEmpty(thirdId)) {
// 根据结束时间进行排序,获取最近的时间,发消息时使用。
JSONObject larkMesJson = new JSONObject();
larkMesJson.put("template_id", templeteId);
larkMesJson.put("userIds", thirdId);
Map<String, Object> templateVariableMap = new HashMap<>();
templateVariableMap.put("contentCn", contentCn);
templateVariableMap.put("contentEn", contentEn);
templateVariableMap.put("viewBtnUrlCn", viewBtnUrlCn);
templateVariableMap.put("viewBtnUrlEn", viewBtnUrlEn);
templateVariableMap.put("viewBtnUrlCnPhone", viewBtnUrlCnPhone);
templateVariableMap.put("plannedBpLaunchBatch", plannedBpLaunchBatch);
templateVariableMap.put("appliedVehicleProject", appliedVehicleProject);
templateVariableMap.put("Initiator", " " + initiator);
larkMesJson.put("templateVariableMap", templateVariableMap);
batchSendLarkCardMsgByTemplate2(larkMesJson);
}
}
} catch (Exception e) {
log.error("飞书消息推送失败");
}
}
}
}
@@ -9,6 +9,8 @@ import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils;
import com.jero.common.util.oConvertUtils;
import com.jero.modules.dummy.enums.OrderEnum;
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
import com.jero.modules.feishu.service.IFeishuService;
import com.jero.modules.ota.entity.OtaManageApplyEO;
import com.jero.modules.ota.entity.OtaManageHistory;
import com.jero.modules.ota.entity.OtaManagePermission;
@@ -110,9 +112,15 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
private ISysDictService sysDictService;
@Autowired
private ProjectNameInfoEOServiceImpl projectNameInfoEOService;
@Autowired
private IFeishuService feishuService;
@Value(value = "${jero.path.upload}")
private String upLoadPath;
@Value(value = "${jero.backUrl}")
private String backUrl;
@Value(value = "${jero.backUrlPhone}")
private String backUrlPhone;
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
@@ -1278,7 +1286,6 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
}
}
//TODO 给studio发消息
List<OtaManagePermission> ompList = new ArrayList<>();
for (String studioId : matchStudioSet) {
OtaManagePermission omp = new OtaManagePermission();
@@ -1287,6 +1294,26 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
ompList.add(omp);
}
otaManagePermissionService.saveBatch(ompList);
//给studio发消息
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
Map<String, Object> params = new HashMap<>();
List<String> userIdList = new ArrayList<>(matchStudioSet);
params.put("userIdList", userIdList);
params.put("contentCn", "您好,请及时查看处理此项任务,谢谢!-请在PC端查看");
params.put("contentEn", "Hello! Please check and address the task in a timely manner. Thank you!-Check on the PC");
params.put("plannedBpLaunchBatch", id);
params.put("viewBtnUrlCnPhone", backUrlPhone);
String url = backUrl;
if (omrList.size() > 0) {
url = backUrl + "/components/detil?plannedBpLaunchBatch=" + id + "&releaseDate=" + omrList.get(0).getReleaseDate();
}
params.put("viewBtnUrlCn", url);
params.put("viewBtnUrlEn", url);
params.put("appliedVehicleProject", appMap.keySet().stream().collect(Collectors.joining(",")));
params.put("Initiator", " " + currentUser.getUsername());
params.put("initiatorStrCn", "发起人");
params.put("initiatorStrEn", "Initiator");
feishuService.sendMessageOtaManager(TemplateInfoEnum2.OTA_MANAGER_G.getValue(), params);
}
}
@@ -1298,6 +1325,14 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
return isOtaManager() && !isStudio();
}
private List<String> getAllOtaManager() {
List<SysUserRole> omList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getRoleId, RoleEnum.STUDIO.getId()));
List<String> resList = omList.stream()
.filter(e -> StringUtils.isNotBlank(e.getId()))
.map(SysUserRole::getId).distinct().collect(Collectors.toList());
return resList;
}
private boolean isOtaManager() {
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId())); // 查询用户所有角色
@@ -1476,6 +1511,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Override
public List<String> submit(List<OtaManageApplyEO> list, String cut) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//发消息用参数
List<String> userIdList = getAllOtaManager();
//操作历史
List<OtaManageHistory> hisList = new ArrayList<>();
List<String> msgList = new ArrayList<>();
for (OtaManageApplyEO oma : list) {
@@ -1503,10 +1541,27 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
his.setContentCn(user.getUsername() + " 提交了 VDR:" + oma.getVdr());
his.setContentEn(user.getUsername() + " submitted VDR:" + oma.getVdr());
hisList.add(his);
//给manager发消息
Map<String, Object> params = new HashMap<>();
params.put("userIdList", userIdList);
params.put("contentCn", "您好,该任务信息已提交,请及时查看处理此项任务,谢谢!-请在PC端查看");
params.put("contentEn", "Hello! The task information has been submitted, please check and address the task in a timely manner. Thank you!-Check on the PC");
params.put("plannedBpLaunchBatch", oma.getPlannedBpLaunchBatch());
params.put("viewBtnUrlCnPhone", backUrlPhone);
String url = backUrl + "/components/detil?plannedBpLaunchBatch=" + oma.getPlannedBpLaunchBatch() + "&releaseDate=" + oma.getReleaseDate();
params.put("viewBtnUrlCn", url);
params.put("viewBtnUrlEn", url);
params.put("appliedVehicleProject", oma.getVehicleType());
params.put("Initiator", " " + user.getUsername());
params.put("initiatorStrCn", "提交人");
params.put("initiatorStrEn", "Submitter");
feishuService.sendMessageOtaManager(TemplateInfoEnum2.OTA_MANAGER_G.getValue(), params);
}
}
this.temporarySave(list, true, cut);
otaManageHistoryService.saveBatch(hisList);
return msgList;
}
@@ -1627,6 +1682,22 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
his.setContentCn(user.getUsername() + " 确认了 VDR:" + oma.getVdr());
his.setContentEn(user.getUsername() + " confirm VDR:" + oma.getVdr());
hisList.add(his);
//给studio发消息
Map<String, Object> params = new HashMap<>();
params.put("userIdList", oma.getStudio());
params.put("contentCn", "您好,该任务被发起人审查通过。-请在PC端查看");
params.put("contentEn", "Hello! The task has been approved by the initiator.-Check on the PC");
params.put("plannedBpLaunchBatch", oma.getPlannedBpLaunchBatch());
params.put("viewBtnUrlCnPhone", backUrlPhone);
String url = backUrl + "/components/detil?plannedBpLaunchBatch=" + oma.getPlannedBpLaunchBatch() + "&releaseDate=" + oma.getReleaseDate();
params.put("viewBtnUrlCn", url);
params.put("viewBtnUrlEn", url);
params.put("appliedVehicleProject", oma.getVehicleType());
params.put("Initiator", " " + user.getUsername());
params.put("initiatorStrCn", "发起人");
params.put("initiatorStrEn", "Initiator");
feishuService.sendMessageOtaManager(TemplateInfoEnum2.OTA_MANAGER_G.getValue(), params);
} else {
//状态不对
if (CutEnum.CN.getValue().equals(cut)) {
@@ -1659,6 +1730,22 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
his.setContentCn(user.getUsername() + " 退回了 VDR:" + oma.getVdr() + " 退回原因:" + rejectReason);
his.setContentEn(user.getUsername() + " returned VDR:" + oma.getVdr() + " Reason for return:" + rejectReason);
hisList.add(his);
//给studio发消息
Map<String, Object> params = new HashMap<>();
params.put("userIdList", oma.getStudio());
params.put("contentCn", "您好,该任务被发起人审查退回,请重新处理。-请在PC端查看");
params.put("contentEn", "Hello! The task is rejected by the inditiator, please address it again.-Check on the PC");
params.put("plannedBpLaunchBatch", oma.getPlannedBpLaunchBatch());
params.put("viewBtnUrlCnPhone", backUrlPhone);
String url = backUrl + "/components/detil?plannedBpLaunchBatch=" + oma.getPlannedBpLaunchBatch() + "&releaseDate=" + oma.getReleaseDate();
params.put("viewBtnUrlCn", url);
params.put("viewBtnUrlEn", url);
params.put("appliedVehicleProject", oma.getVehicleType());
params.put("Initiator", " " + user.getUsername());
params.put("initiatorStrCn", "发起人");
params.put("initiatorStrEn", "Initiator");
feishuService.sendMessageOtaManager(TemplateInfoEnum2.OTA_MANAGER_R.getValue(), params);
} else {
//状态不对
if (CutEnum.CN.getValue().equals(cut)) {
@@ -14,7 +14,7 @@
<a-row :gutter="24">
<a-col :span="24">
<div class='detail-box'>
<span class='detail-text'>{{'VDR'}}</span>
<span class='detail-text' :title="'VDR'">{{'VDR'}}</span>
<span class="title-text-text" :title="form.vdr">
{{form.vdr}}</span>
</div>
@@ -24,7 +24,7 @@
<a-row :gutter="24">
<a-col :span="24">
<div class='detail-box'>
<span class='detail-text'>{{$t('theme')}}</span>
<span class='detail-text' :title="$t('theme')">{{$t('theme')}}</span>
<span class="title-text-text" :title="form.summary">
{{form.summary}}</span>
</div>
@@ -34,7 +34,7 @@
<a-row :gutter="24">
<a-col :span="24">
<div class='detail-box'>
<span class='detail-text' style='width:300px'>{{$t('authenticationimpact')}}</span>
<span class='detail-text' :title="$t('authenticationimpact')">{{$t('authenticationimpact')}}</span>
<span class="title-text-text" :title="form.homologationImpact">
{{form.homologationImpact}}</span>
</div>
@@ -44,7 +44,7 @@
<a-row :gutter="24">
<a-col :span="24">
<div class='detail-box'>
<span class='detail-text'>{{$t('influencestatute') + '-CN'}}</span>
<span class='detail-text' :title="$t('influencestatute') + '-CN'">{{$t('influencestatute') + '-CN'}}</span>
<span class="title-text-text" :title="form.impactCnHomo">
{{form.impactCnHomo}}</span>
</div>
@@ -54,33 +54,33 @@
<a-row :gutter="24">
<a-col :span="24">
<div class='detail-box'>
<span class='detail-text'>{{$t('influencestatute') + '-EU'}}</span>
<span class='detail-text' :title="$t('influencestatute') + '-EU'">{{$t('influencestatute') + '-EU'}}</span>
<span class="title-text-text" :title="form.impactEuHomo">
{{form.impactEuHomo}}</span>
</div>
</a-col>
</a-row>
<div style='margin-bottom: 10px;font-weight: bold;'>{{$t('applicationprojectversion')}}</div>
<div style='margin-bottom: 20px;font-weight: bold;' :title="$t('applicationprojectversion')">{{$t('applicationprojectversion')}}</div>
<div v-for='(item,index) in vdrList' :key='index'>
<a-row :gutter="24">
<a-col :span="24">
<div class='detail-box'>
<span class='detail-text' style="width: 300px">{{item.versionName}}</span>
<span class='detail-text' style="width: 300px" :title="item.versionName">{{item.versionName}}</span>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class='detail-box'>
<span class='detail-text'>{{$t('certificationStartOne')}}</span>
<span class='detail-text' :title="$t('certificationStartOne')">{{$t('certificationStartOne')}}</span>
<span class="title-text-text" :title="item.attestationStartTime?item.attestationStartTime:'--'">
{{item.attestationStartTime?item.attestationStartTime:'--'}}</span>
</div>
</a-col>
<a-col :span="12">
<div class='detail-box'>
<span class='detail-text'>{{$t('certificationdeclaration')}}</span>
<span class='detail-text' :title="$t('certificationdeclaration')">{{$t('certificationdeclaration')}}</span>
<span class="title-text-text" :title="item.certificationSubmission?item.certificationSubmission:'--'">
{{item.certificationSubmission?item.certificationSubmission:'--'}}</span>
</div>
@@ -89,14 +89,14 @@
<a-row :gutter="24">
<a-col :span="12">
<div class='detail-box'>
<span class='detail-text'>{{$t('certificationEnd')}}</span>
<span class='detail-text' :title="$t('certificationEnd')">{{$t('certificationEnd')}}</span>
<span class="title-text-text" :title="item.attestationEndTime?item.attestationEndTime:'--'">
{{item.attestationEndTime?item.attestationEndTime:'--'}}</span>
</div>
</a-col>
<a-col :span="12">
<div class='detail-box'>
<span class='detail-text'>{{$t('CertificationProgress')}}</span>
<span class='detail-text' :title="$t('CertificationProgress')">{{$t('CertificationProgress')}}</span>
<span class="title-text-text" :title="item.attestationSchedule?item.attestationSchedule:'--'">
{{item.attestationSchedule?item.attestationSchedule:'--'}}</span>
</div>
@@ -198,11 +198,19 @@ export default {
.detail-box{
width: 100%;
margin-bottom: 20px;
position: relative;
}
.detail-text{
display: inline-block;
width: 95px;
width: 153px;
font-weight: bold;
overflow: hidden; /*超出部分隐藏*/
text-overflow: ellipsis; /*超出部分省略号表示*/
white-space: nowrap; /*强制单行显示*/
display: inline-block; /*转换为行内块元素*/
}
.title-text-text{
position: absolute;
}
.title-text {
width: 250px;
@@ -295,6 +295,7 @@
let _this = this
// 先调取接口判断是否有配置信息
if (item.isHistory == '1'){
item.projectName = this.$route.query.projectName
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: {it: item.id,
@@ -146,9 +146,6 @@
},
methods: {
vdrcheckClick(){
},
getData() {
let query = {
...this.queryParam,
@@ -175,7 +172,9 @@
getAction('ota/otaManageApplyEO/getVdrListByProject', { projectId: id }).then((res) => {
if (res.success) {
this.options = res.result
this.queryParam.plannedBpLaunchBatch = this.options[0].plannedBpLaunchBatch
if(this.options.length != 0 ){
this.queryParam.plannedBpLaunchBatch = this.options[0].plannedBpLaunchBatch
}
this.getData()
// this.getData(this.queryParam.ctype)
} else {