Merge remote-tracking branch 'origin/dev_20230808_OTA' into dev_20230808_OTA

This commit is contained in:
高嵩
2023-08-24 15:55:36 +08:00
4 changed files with 29 additions and 8 deletions
@@ -81,7 +81,7 @@
and omr.impact_eu_homo LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.impactHomo}),'%')) and omr.impact_eu_homo LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.impactHomo}),'%'))
</if> </if>
<if test="otaManageApplyEO.appliedVehicleProject != null and otaManageApplyEO.appliedVehicleProject != ''"> <if test="otaManageApplyEO.appliedVehicleProject != null and otaManageApplyEO.appliedVehicleProject != ''">
and omr.vehicle_type LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.appliedVehicleProject}),'%') and omr.applied_vehicle_project LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.appliedVehicleProject}),'%')
</if> </if>
</where> </where>
order by omr.id desc order by omr.id desc
@@ -1,5 +1,6 @@
package com.jero.modules.ota.service.impl; package com.jero.modules.ota.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.CutEnum;
@@ -189,19 +190,38 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
*/ */
@Override @Override
public List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO) { public List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO) {
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
boolean otaManager = isOtaManager();
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO); List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
List<OtaManageApplyEO> dataList = new ArrayList<>();
//去跟manager和studio权限
if(otaManager){
dataList = otaManageApplyEOList;
}else{
LambdaQueryWrapper<OtaManagePermission> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OtaManagePermission::getUserId,currentUser.getId());
List<OtaManagePermission> managePermissionList = otaManagePermissionService.list(wrapper);
if(!managePermissionList.isEmpty()){
List<String> applyIdList = managePermissionList.stream().map(OtaManagePermission::getApplyId).distinct().collect(Collectors.toList());
List<OtaManageApplyEO> collect = otaManageApplyEOList.stream().filter(e -> applyIdList.contains(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
dataList = collect;
}
}
List<OtaManageApplyEO> result = new ArrayList<>(); List<OtaManageApplyEO> result = new ArrayList<>();
if (!otaManageApplyEOList.isEmpty()) { if (!dataList.isEmpty()) {
List<String> otaNameList = OtaCarEnum.getOtaNameList(); List<String> otaNameList = OtaCarEnum.getOtaNameList();
List<String> plannedBpLaunchBatchList = otaManageApplyEOList.stream() List<String> plannedBpLaunchBatchList = dataList.stream()
.filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch())) .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()))
.map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList()); .map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
if (!plannedBpLaunchBatchList.isEmpty()) { if (!plannedBpLaunchBatchList.isEmpty()) {
for (String plannedBpLaunchBatch : plannedBpLaunchBatchList) { for (String plannedBpLaunchBatch : plannedBpLaunchBatchList) {
OtaManageApplyEO manageApplyEO = new OtaManageApplyEO(); OtaManageApplyEO manageApplyEO = new OtaManageApplyEO();
manageApplyEO.setPlannedBpLaunchBatch(plannedBpLaunchBatch); manageApplyEO.setPlannedBpLaunchBatch(plannedBpLaunchBatch);
manageApplyEO.setId(plannedBpLaunchBatch);
List<OtaManageApplyEO> otaManageApplyEOS = otaManageApplyEOList.stream() List<OtaManageApplyEO> otaManageApplyEOS = dataList.stream()
.filter(e -> plannedBpLaunchBatch.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList()); .filter(e -> plannedBpLaunchBatch.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
if(!otaManageApplyEOS.isEmpty()){ if(!otaManageApplyEOS.isEmpty()){
//发布时间 //发布时间
@@ -614,7 +634,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO); List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO);
List<OtaManageApplyEO> list = new ArrayList<>(); List<OtaManageApplyEO> list = new ArrayList<>();
String carMarket = otaManageApplyEO.getAppliedVehicleProject(); String carMarket = otaManageApplyEO.getAppliedVehicleProject();
if (StringUtils.isNotBlank(carMarket) && !"全部".equals(carMarket) && !otaManageApplyEOList.isEmpty()) { if (StringUtils.isNotBlank(carMarket) && !"全部".equals(carMarket) && !"All".equals(carMarket) && !otaManageApplyEOList.isEmpty()) {
String[] conditionSplit = carMarket.split(" "); String[] conditionSplit = carMarket.split(" ");
@@ -164,11 +164,12 @@ export default {
this.confirmLoading = true this.confirmLoading = true
postAction('/ota/otaManageApplyEO/updateVdrBatch', query).then((res) => { postAction('/ota/otaManageApplyEO/updateVdrBatch', query).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) // this.$message.success(this.$t('OperationSuccessful'))
this.visible = false this.visible = false
this.confirmLoading = false this.confirmLoading = false
this.ids = [] this.ids = []
this.$emit('getList') this.$emit('msgForm',res.result.msgList)
// this.$emit('getList')
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false this.confirmLoading = false
@@ -247,7 +247,7 @@
@showSizeChange="SizeChange" /> @showSizeChange="SizeChange" />
</div> </div>
</div> </div>
<batSetting :url="url" @getList="getList" ref="batSettingRef"/> <batSetting :url="url" @getList="getList" @msgForm='msgForm' ref="batSettingRef"/>
<applyforrematch :url="url" @getList="getList" ref="applyforrematchRef"/> <applyforrematch :url="url" @getList="getList" ref="applyforrematchRef"/>
<rejectReason :url="url" @getList="getList" @msgForm='msgForm' ref="rejectReasonRef"/> <rejectReason :url="url" @getList="getList" @msgForm='msgForm' ref="rejectReasonRef"/>
<remark @remarkForm='remarkForm' ref="remarkRef"/> <remark @remarkForm='remarkForm' ref="remarkRef"/>