OTA 列表和按钮对接

This commit is contained in:
高嵩
2023-08-19 18:47:14 +08:00
parent 08ee88c4e2
commit 2b2ba21f20
11 changed files with 472 additions and 46 deletions
@@ -6,8 +6,10 @@ public enum RoleEnum {
COUNTRU_CARD_MANAGE("countryCard管理员","countryCardManage","countryCardManage","1564916346120916993",4),
ENGINEERING_INTERFACE_PERSON("工程接口人","engineeringInterfacePerson","engineeringInterfacePerson","1534020084667674626",5),
ENGINEER("工程师","engineer","engineer","1534020318437208065",6),
HOMOLOGATION_ENGINEER("认证工程师","homologationEngineer","homologationEngineer","1534019729326239745",8),
REGULATION_OWNER("法规工程师","regulationOwner","regulationOwner","1534021004067500034",7),
HOMOLOGATION_ENGINEER("认证工程师","homologationEngineer","homologationEngineer","1534019729326239745",8),
OTA_MANAGER("OTA Manager","OTA Manager","OTA Manager","1664108901072678913",9),
STUDIO("R&H Studio","R&H Studio","R&H Studio","1534019911296118786",10),
;
String name;
@@ -1,5 +1,7 @@
package com.jero.modules.ota.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
@@ -10,15 +12,13 @@ import com.jero.modules.ota.vo.VersionVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -69,9 +69,10 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
@GetMapping(value = "/getOtaCarPage")
public Result<?> getOtaCarPage(OtaManageApplyEO otaManageApplyEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
String cut) {
IPage<OtaManageApplyEO> pageList = otaManageApplyEOService.getOtaCarPage(otaManageApplyEO,pageNo,pageSize);
IPage<OtaManageApplyEO> pageList = otaManageApplyEOService.getOtaCarPage(otaManageApplyEO,pageNo,pageSize,cut);
return Result.OK(pageList);
}
/**
@@ -165,4 +166,87 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
return Result.OK(result);
}
@AutoLog(value = "下发通知")
@ApiOperation(value="下发通知", notes="下发通知")
@GetMapping(value = "/issueNotice")
public Result<?> issueNotice(String id) {
otaManageApplyEOService.issueNotice(id);
return Result.OK("下发通知成功!");
}
@AutoLog(value = "保存")
@ApiOperation(value = "保存", notes = "保存")
@PostMapping(value = "/temporarySave")
public Result<?> temporarySave(@RequestBody JSONObject jsonObject) {
JSONArray array = jsonObject.getJSONArray("list");
String cut = jsonObject.getString("cut");
List<OtaManageApplyEO> list = new ArrayList<>();
OtaManageApplyEO oma = null;
for (Object obj : array) {
oma = JSONObject.parseObject(JSONObject.toJSONString(obj), OtaManageApplyEO.class);
if (ObjectUtils.isNotEmpty(oma)) {
list.add(oma);
}
}
otaManageApplyEOService.temporarySave(list, cut);
return Result.OK("保存成功!");
}
@AutoLog(value = "提交")
@ApiOperation(value = "提交", notes = "提交")
@PostMapping(value = "/submit")
public Result<?> submit(@RequestBody JSONObject jsonObject) {
JSONArray array = jsonObject.getJSONArray("list");
String cut = jsonObject.getString("cut");
List<OtaManageApplyEO> list = new ArrayList<>();
OtaManageApplyEO oma = null;
for (Object obj : array) {
oma = JSONObject.parseObject(JSONObject.toJSONString(obj), OtaManageApplyEO.class);
if (ObjectUtils.isNotEmpty(oma)) {
list.add(oma);
}
}
List<String> msgList = otaManageApplyEOService.submit(list, cut);
return Result.OK("提交成功!",msgList);
}
@AutoLog(value = "批量设置")
@ApiOperation(value = "批量设置", notes = "批量设置")
@PostMapping(value = "/updateVdrBatch")
public Result<?> updateVdrBatch(@RequestBody JSONObject jsonObject) {
String ids = jsonObject.getString("ids");
String projectVersion = jsonObject.getString("projectVersion");
String attestationSchedule = jsonObject.getString("attestationSchedule");
String remark = jsonObject.getString("remark");
String cut = jsonObject.getString("cut");
List<String> msgList = otaManageApplyEOService.updateVdrBatch(ids, projectVersion, attestationSchedule, remark, cut);
return Result.OK("操作成功!", msgList);
}
@AutoLog(value = "申请重新匹配")
@ApiOperation(value = "申请重新匹配", notes = "申请重新匹配")
@GetMapping(value = "/applyRematch")
public Result<?> applyRematch(String ids,String cut) {
List<String> msgList = otaManageApplyEOService.applyRematch(ids, cut);
return Result.OK("操作成功!", msgList);
}
@AutoLog(value = "确认")
@ApiOperation(value = "确认", notes = "确认")
@GetMapping(value = "/confirm")
public Result<?> confirm(String ids,String cut) {
List<String> msgList = otaManageApplyEOService.confirm(ids, cut);
return Result.OK("操作成功!", msgList);
}
@AutoLog(value = "退回")
@ApiOperation(value = "退回", notes = "退回")
@GetMapping(value = "/reject")
public Result<?> reject(String ids,String cut) {
List<String> msgList = otaManageApplyEOService.reject(ids, cut);
return Result.OK("操作成功!", msgList);
}
}
@@ -62,8 +62,8 @@ public class OtaManageApplyEO implements Serializable {
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
@ApiModelProperty(value = "外键")
private java.lang.String issueKey;
@ApiModelProperty(value = "VDR")
private java.lang.String vdr;
/**项目版本*/
@Excel(name = "项目版本", width = 15)
@@ -80,6 +80,10 @@ public class OtaManageApplyEO implements Serializable {
@ApiModelProperty(value = "匹配状态")
private java.lang.String matchStatus;
@TableField(exist = false)
@ApiModelProperty(value = "匹配状态显示文字")
private java.lang.String matchStatusText;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
@@ -87,9 +91,6 @@ public class OtaManageApplyEO implements Serializable {
//--------------------------------------------------------
@TableField(exist = false)
@ApiModelProperty(value = "VDR")
private java.lang.String vdr;
@TableField(exist = false)
@ApiModelProperty(value = "软件版本")
@@ -165,14 +166,20 @@ public class OtaManageApplyEO implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "认证开始")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date attestationStartTime;
@TableField(exist = false)
@ApiModelProperty(value = "认证申报")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date certificationSubmission;
@TableField(exist = false)
@ApiModelProperty(value = "认证批准")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date attestationEndTime;
@TableField(exist = false)
@@ -183,7 +190,9 @@ public class OtaManageApplyEO implements Serializable {
@TableField(exist = false)
private java.lang.String projectVersionText;
@ApiModelProperty(value = "是否禁用版本和进度编辑")
@TableField(exist = false)
private boolean disabled;
}
@@ -0,0 +1,39 @@
package com.jero.modules.ota.enums;
import java.util.ArrayList;
import java.util.List;
public enum OtaHomoImpactEnum {
YES("Yes", "Yes"),
INTER_VALID("Internal Validation", "Internal Validation"),
HOMOEX_RETEST("Homo Extension - Retest", "Homo Extension - Retest"),
HOMOEX_PAPERWORK("Homo Extension - Paperwork", "Homo Extension - Paperwork");
String name;
String value;
OtaHomoImpactEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@@ -0,0 +1,60 @@
package com.jero.modules.ota.enums;
import org.apache.commons.lang3.StringUtils;
public enum OtaStatusEnum {
//待匹配、待审批、锁定、退回、待重新匹配
TO_BE_MATCHED("to_be_matched", "待匹配","To be matched"),
TO_BE_APPROVED("to_be_approved", "待审批","To be approved"),
LOCKED("locked", "锁定","Locked"),
REJECTED("rejected", "退回","Rejected"),
TO_BE_REMATCHED("to_be_rematched", "待重新匹配","To be rematched"),
NA("-", "-","-");
String key;
String nameCN;
String nameEN;
OtaStatusEnum(String key, String nameCN,String nameEN) {
this.key = key;
this.nameCN = nameCN;
this.nameEN = nameEN;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getNameCN() {
return nameCN;
}
public void setNameCN(String nameCN) {
this.nameCN = nameCN;
}
public String getNameEN() {
return nameEN;
}
public void setNameEN(String nameEN) {
this.nameEN = nameEN;
}
public static OtaStatusEnum getByKey(String key){
String result = "";
for (OtaStatusEnum enu : OtaStatusEnum.values()) {
if(StringUtils.equals(enu.key,key)){
return enu;
}
}
return OtaStatusEnum.NA;
}
}
@@ -72,10 +72,14 @@
<!-- order by create_time desc-->
<!-- </select>-->
<select id="getOtaCarPage" resultType="com.jero.modules.ota.entity.OtaManageApplyEO">
select omr.*,
oma.project_version,oma.attestation_schedule,oma.match_status,oma.remark
select omr.id as vdr,omr.planned_bp_launch_batch_,omr.update_date,
omr.summary,omr.status,
omr.homologation_impact,omr.homologation,
omr.impact_cn_homo,omr.impact_eu_homo,
omr.master_domain,omr.applied_vehicle_project,
oma.id,oma.project_version,oma.attestation_schedule,oma.match_status,oma.remark
from ota_manage_receive omr
left join ota_manage_apply oma on oma.issue_key = omr.id
left join ota_manage_apply oma on oma.vdr = omr.id
<where>
1=1
<if test="otaManageApplyEO.plannedBpLaunchBatch != null and otaManageApplyEO.plannedBpLaunchBatch != ''">
@@ -93,7 +97,7 @@
and omr.impact_eu_homo LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.impactHomo}),'%'))
</if>
</where>
order by create_time desc
order by omr.id desc
</select>
@@ -79,7 +79,7 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
* @param pageSize
* @return
*/
IPage<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO,Integer pageNo,Integer pageSize);
IPage<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO,Integer pageNo,Integer pageSize,String cut);
/**
* 下拉数据-软件版本,适用车型,市场
* @return
@@ -105,4 +105,18 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
* @return
*/
List<VersionVO> getVersionInfo(String vdr);
void issueNotice(String id);
List<String> submit(List<OtaManageApplyEO> list, String cut);
void temporarySave(List<OtaManageApplyEO> list, String cut);
List<String> updateVdrBatch(String ids, String projectVersion, String attestationSchedule, String remark, String cut);
List<String> applyRematch(String ids, String cut);
List<String> confirm(String ids, String cut);
List<String> reject(String ids, String cut);
}
@@ -1,39 +1,42 @@
package com.jero.modules.ota.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.PageUtil;
import com.jero.modules.ota.entity.OtaManageApplyEO;
import com.jero.modules.ota.entity.OtaManageReceiveNsdpEO;
import com.jero.modules.ota.enums.OtaCarEnum;
import com.jero.modules.ota.enums.OtaHomoImpactEnum;
import com.jero.modules.ota.enums.OtaStatusEnum;
import com.jero.modules.ota.mapper.OtaManageApplyEOMapper;
import com.jero.modules.ota.service.IOtaManageApplyEOService;
import com.jero.modules.ota.vo.VersionVO;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.entity.ProjectTaskPlanning;
import com.jero.modules.project.service.IProjectLibraryBaseService;
import com.jero.modules.project.service.impl.ProjectTaskPlanningServiceImpl;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.entity.SysUserRole;
import com.jero.modules.system.enums.RoleEnum;
import com.jero.modules.system.mapper.SysUserRoleMapper;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysBaseApiImpl;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -53,6 +56,15 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
private SysBaseApiImpl sysBaseApi;
@Autowired
private SysDictItemServiceImpl sysDictItemServiceImpl;
@Autowired
private IProjectLibraryBaseService projectLibraryBaseService;
@Autowired
private SysUserRoleMapper sysUserRoleMapper;
@Autowired
private ISysUserService sysUserService;
/**
* 保存
*
@@ -211,7 +223,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
* @return
*/
@Override
public IPage<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO, Integer pageNo, Integer pageSize) {
public IPage<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO, Integer pageNo, Integer pageSize,String cut) {
List<OtaManageApplyEO> otaManageApplyEOList = otaManageApplyEOMapper.getOtaCarPage(otaManageApplyEO);
List<OtaManageApplyEO> list = new ArrayList<>();
String carMarket = otaManageApplyEO.getAppliedVehicleProject();
@@ -220,7 +232,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
String[] conditionSplit = carMarket.split(" ");
for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) {
manageApplyEO.setVdr(manageApplyEO.getId());
if (StringUtils.isEmpty(manageApplyEO.getId())||manageApplyEO.getId().length() < 20) {
manageApplyEO.setId(UUID.randomUUID().toString().replace("-", ""));
}
String appliedVehicleProject = manageApplyEO.getAppliedVehicleProject();
if(StringUtils.isNotBlank(appliedVehicleProject)){
String[] appliedVehicleProjectArr = appliedVehicleProject.split(",");
@@ -228,15 +242,18 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
String[] split = appliedVehicleProjectTemp.split(" ");
if(split.length == 1){
list.add(manageApplyEO);
break;
}else if(split.length == 2){
if(Arrays.equals(conditionSplit, split)){
list.add(manageApplyEO);
break;
}
}else if(split.length == 3){
List<String> listTemp = Arrays.asList(split);
List<String> conditionList = Arrays.asList(conditionSplit);
if(listTemp.containsAll(conditionList)){
list.add(manageApplyEO);
break;
}
}
}
@@ -248,14 +265,12 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
List<String> projectVersionList = list.stream()
.map(OtaManageApplyEO::getProjectVersion).distinct().collect(Collectors.toList());
//studio
List<String> userIdList = list.stream().map(OtaManageApplyEO::getStudio).distinct().collect(Collectors.toList());
List<LoginUser> loginUserList = new ArrayList<>();
if(!userIdList.isEmpty()){
loginUserList = sysBaseApi.queryAllUserByIds(userIdList.toArray(new String[userIdList.size()]));
}
List<ProjectLibraryBase> projectList = projectLibraryBaseService.queryList(projectVersionList);
List<String> studioEngineerUserIdList = projectList.stream().map(ProjectLibraryBase::getStudioEngineer).distinct().collect(Collectors.toList());
List<SysUser> studioEngineerUserInfo = this.sysUserService.querySysUserListByIdList(studioEngineerUserIdList);
List<ProjectTaskPlanning> projectTaskPlanningList = projectTaskPlanningService.queryList(StringUtils.join(projectVersionList,","));
boolean isDisabled = isDisabled();
for (OtaManageApplyEO manageApplyEO : list) {
if(StringUtils.isNotBlank(manageApplyEO.getProjectVersion())){
List<ProjectTaskPlanning> taskPlanningList = projectTaskPlanningList.stream()
@@ -270,19 +285,52 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
manageApplyEO.setCertificationSubmission(certificationSubmission);
}
//设置studio
if(StringUtils.isNotBlank(manageApplyEO.getStudio())){
List<LoginUser> userList = loginUserList.stream()
.filter(e -> manageApplyEO.getStudio().equals(e.getId())).collect(Collectors.toList());
if(!userList.isEmpty()){
manageApplyEO.setStudioText(userList.get(0).getUsername());
for (ProjectLibraryBase pro : projectList) {
if(pro.getId().equals(manageApplyEO.getProjectVersion())){
manageApplyEO.setStudio(pro.getStudioEngineer());
break;
}
}
if(StringUtils.isNotEmpty(manageApplyEO.getStudio())){
if(CollectionUtils.isNotEmpty(studioEngineerUserInfo)){
String studioEngineerUserName = studioEngineerUserInfo.stream().filter(studioEngineerUser -> {
boolean flag = false;
if (StringUtils.equals(manageApplyEO.getStudio(), studioEngineerUser.getId())) {
flag = true;
}
return flag;
}).map(SysUser::getUsername).collect(Collectors.joining(","));
manageApplyEO.setStudioText(studioEngineerUserName);
}
}
}
manageApplyEO.setDisabled(isDisabled);
if(StringUtils.isBlank(manageApplyEO.getRemark())){
manageApplyEO.setRemark("-");
}
if (OtaHomoImpactEnum.YES.getValue().equals(manageApplyEO.getHomologationImpact())
|| OtaHomoImpactEnum.INTER_VALID.getValue().equals(manageApplyEO.getHomologationImpact())) {
manageApplyEO.setMatchStatus(OtaStatusEnum.NA.getKey());
manageApplyEO.setDisabled(true);
}
if (StringUtils.isBlank(manageApplyEO.getMatchStatus())) {
manageApplyEO.setMatchStatus(OtaStatusEnum.TO_BE_MATCHED.getKey());
if (CutEnum.CN.getValue().equals(cut)) {
manageApplyEO.setMatchStatusText(OtaStatusEnum.TO_BE_MATCHED.getNameCN());
} else {
manageApplyEO.setMatchStatusText(OtaStatusEnum.TO_BE_MATCHED.getNameEN());
}
} else {
OtaStatusEnum osEnum = OtaStatusEnum.getByKey(manageApplyEO.getMatchStatus());
if (CutEnum.CN.getValue().equals(cut)) {
manageApplyEO.setMatchStatusText(osEnum.getNameCN());
} else {
manageApplyEO.setMatchStatusText(osEnum.getNameEN());
}
}
}
}
Page pages = PageUtil.getPages(pageNo, pageSize, list);
return pages;
}
@@ -378,6 +426,15 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
String[] conditionSplit = carMarket.split(" ");
String car = conditionSplit[0];
String market = conditionSplit[1];
if (StringUtils.isNotBlank(market)) {
if (market.equals("CN")) {
//项目库里市场存的是China 不是CN
market = "China";
} else if (market.equals("RHD")) {
//RHD目前代表UK
market = "UK";
}
}
versionVOList = otaManageApplyEOMapper.getProjectVersion(car, market);
List<VersionVO> oneList = versionVOList.stream().filter(e -> StringUtils.isBlank(e.getParentId())).collect(Collectors.toList());
List<VersionVO> twoList = versionVOList.stream().filter(e -> StringUtils.isNotBlank(e.getParentId())).collect(Collectors.toList());
@@ -444,4 +501,150 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
return result;
}
/**
* 下发通知
*/
@Override
public void issueNotice(String id) {
}
/**
* 是否为OTA管理员并且不是STUDIO
*/
private boolean isDisabled() {
boolean isOtaManager = false;
boolean isStudio = false;
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId())); // 查询用户所有角色
if (CollectionUtils.isNotEmpty(userRoleList)) {
for (SysUserRole role : userRoleList) {
if (role.getRoleId().equals(RoleEnum.OTA_MANAGER.getId())) {
isOtaManager = true;
}
if (role.getRoleId().equals(RoleEnum.STUDIO.getId())) {
isStudio = true;
}
}
}
if (isOtaManager && !isStudio) {
return true;
}
return false;
}
@Override
public void temporarySave(List<OtaManageApplyEO> list, String cut) {
this.saveOrUpdateBatch(list);
}
@Override
public List<String> submit(List<OtaManageApplyEO> list, String cut) {
List<String> msgList = new ArrayList<>();
for (OtaManageApplyEO oma : list) {
if (StringUtils.isBlank(oma.getProjectVersion())) {
//需要先选版本
msgList.add("VDR:" + oma.getVdr() + " 需要先选择版本!");
} else if (oma.getStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())
|| oma.getStatus().equals(OtaStatusEnum.LOCKED.getKey())
|| oma.getStatus().equals(OtaStatusEnum.NA.getKey())) {
//状态不对
msgList.add("VDR:" + oma.getVdr() + " 状态不对!");
} else {
oma.setMatchStatus(OtaStatusEnum.TO_BE_APPROVED.getKey());
}
}
this.saveOrUpdateBatch(list);
return msgList;
}
@Override
public List<String> updateVdrBatch(String ids, String projectVersion, String attestationSchedule, String remark, String cut) {
List<String> msgList = new ArrayList<>();
//TODO 需要根据数据判断是否可以编辑
if (StringUtils.isNotEmpty(ids)) {
List<String> idList = Arrays.asList(ids.split(","));
List<OtaManageApplyEO> omaList = this.getListByIds(idList);
for (OtaManageApplyEO oma : omaList) {
if (StringUtils.isNotEmpty(projectVersion)) {
oma.setProjectVersion(projectVersion);
}
if (StringUtils.isNotEmpty(attestationSchedule)) {
oma.setAttestationSchedule(attestationSchedule);
}
if (StringUtils.isNotEmpty(remark)) {
oma.setRemark(remark);
}
}
}
return msgList;
}
@Override
public List<String> applyRematch(String ids, String cut) {
List<String> msgList = new ArrayList<>();
if (StringUtils.isNotEmpty(ids)) {
List<String> idList = Arrays.asList(ids.split(","));
List<OtaManageApplyEO> omaList = this.getListByIds(idList);
for (OtaManageApplyEO oma : omaList) {
if (oma.getStatus().equals(OtaStatusEnum.LOCKED.getKey())) {
oma.setMatchStatus(OtaStatusEnum.TO_BE_REMATCHED.getKey());
} else {
//状态不对
msgList.add("VDR:" + oma.getVdr() + " 状态不对!");
}
}
this.saveOrUpdateBatch(omaList);
}
return msgList;
}
@Override
public List<String> confirm(String ids, String cut) {
List<String> msgList = new ArrayList<>();
if (StringUtils.isNotEmpty(ids)) {
List<String> idList = Arrays.asList(ids.split(","));
List<OtaManageApplyEO> omaList = this.getListByIds(idList);
for (OtaManageApplyEO oma : omaList) {
if (oma.getStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) {
oma.setMatchStatus(OtaStatusEnum.TO_BE_REMATCHED.getKey());
} else {
//状态不对
msgList.add("VDR:" + oma.getVdr() + " 状态不对!");
}
}
this.saveOrUpdateBatch(omaList);
}
return msgList;
}
@Override
public List<String> reject(String ids, String cut) {
List<String> msgList = new ArrayList<>();
if (StringUtils.isNotEmpty(ids)) {
List<String> idList = Arrays.asList(ids.split(","));
List<OtaManageApplyEO> omaList = this.getListByIds(idList);
for (OtaManageApplyEO oma : omaList) {
if (oma.getStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) {
oma.setMatchStatus(OtaStatusEnum.REJECTED.getKey());
} else {
//状态不对
msgList.add("VDR:" + oma.getVdr() + " 状态不对!");
}
}
this.saveOrUpdateBatch(omaList);
}
return msgList;
}
private List<OtaManageApplyEO> getListByIds(List<String> idList) {
QueryWrapper<OtaManageApplyEO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(OtaManageApplyEO::getId, idList);
return this.list(queryWrapper);
}
}
@@ -184,4 +184,6 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
* @return
*/
Result<?> overallReplacementUser(JSONObject json);
List<ProjectLibraryBase> queryList(List<String> projectIdList);
}
@@ -3423,6 +3423,15 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
return result != 0 ? df.format(result) : "0";
}
@Override
public List<ProjectLibraryBase> queryList(List<String> projectIdList) {
QueryWrapper<ProjectLibraryBase> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id",projectIdList);
List<ProjectLibraryBase> res = this.list(queryWrapper);
return res;
}
}
+1 -1
View File
@@ -1946,6 +1946,6 @@ module.exports = {
Matchingstatestatistics:'Matching state statistics',
OTaauthenticationprogressstatistics:'OTA authentication progress statistics',
tobematched:'To be matched',
Pendingapproval:'Pending approval',
Pendingapproval:'To be approved',
lock:'lock',
}