修改OTAbug
This commit is contained in:
+3
@@ -58,4 +58,7 @@ public interface IOtaManagePermissionService extends IService<OtaManagePermissio
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaManagePermission> queryList();
|
List<OtaManagePermission> queryList();
|
||||||
|
|
||||||
|
|
||||||
|
List<OtaManagePermission> queryByUserId(String userId);
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-3
@@ -207,9 +207,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
|||||||
if (otaManager) {
|
if (otaManager) {
|
||||||
dataList = otaManageApplyEOList;
|
dataList = otaManageApplyEOList;
|
||||||
} else {
|
} else {
|
||||||
LambdaQueryWrapper<OtaManagePermission> wrapper = new LambdaQueryWrapper<>();
|
List<OtaManagePermission> managePermissionList = otaManagePermissionService.queryByUserId(currentUser.getId());
|
||||||
wrapper.eq(OtaManagePermission::getUserId, currentUser.getId());
|
|
||||||
List<OtaManagePermission> managePermissionList = otaManagePermissionService.list(wrapper);
|
|
||||||
if (!managePermissionList.isEmpty()) {
|
if (!managePermissionList.isEmpty()) {
|
||||||
List<String> applyIdList = managePermissionList.stream().map(OtaManagePermission::getApplyId).distinct().collect(Collectors.toList());
|
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());
|
List<OtaManageApplyEO> collect = otaManageApplyEOList.stream().filter(e -> applyIdList.contains(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
|
||||||
@@ -297,6 +295,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OtaManageApplyEO> getAllCarPage(OtaManageApplyEO otaManageApplyEO) {
|
public List<OtaManageApplyEO> getAllCarPage(OtaManageApplyEO otaManageApplyEO) {
|
||||||
|
if(!hasPermission(otaManageApplyEO.getPlannedBpLaunchBatch())){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
|
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
|
||||||
//studio数据权限
|
//studio数据权限
|
||||||
if (isOtaManager()) {
|
if (isOtaManager()) {
|
||||||
@@ -674,6 +675,21 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasPermission(String plannedBpLaunchBatch){
|
||||||
|
if(isOtaManager()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
List<OtaManagePermission> managePermissionList = otaManagePermissionService.queryByUserId(currentUser.getId());
|
||||||
|
if (!managePermissionList.isEmpty()) {
|
||||||
|
List<String> applyIdList = managePermissionList.stream().map(OtaManagePermission::getApplyId).distinct().collect(Collectors.toList());
|
||||||
|
if(applyIdList.contains(plannedBpLaunchBatch)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分车型列表-分页列表查询
|
* 分车型列表-分页列表查询
|
||||||
*
|
*
|
||||||
@@ -682,6 +698,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO, String cut) {
|
public List<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO, String cut) {
|
||||||
|
if(!hasPermission(otaManageApplyEO.getPlannedBpLaunchBatch())){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO);
|
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO);
|
||||||
List<OtaManageApplyEO> list = new ArrayList<>();
|
List<OtaManageApplyEO> list = new ArrayList<>();
|
||||||
Map<String, OtaManageApplyEO> omaMap = new HashMap<>();
|
Map<String, OtaManageApplyEO> omaMap = new HashMap<>();
|
||||||
|
|||||||
+8
@@ -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.jero.modules.ota.entity.OtaManagePermission;
|
import com.jero.modules.ota.entity.OtaManagePermission;
|
||||||
import com.jero.modules.ota.mapper.OtaManagePermissionMapper;
|
import com.jero.modules.ota.mapper.OtaManagePermissionMapper;
|
||||||
import com.jero.modules.ota.service.IOtaManagePermissionService;
|
import com.jero.modules.ota.service.IOtaManagePermissionService;
|
||||||
@@ -86,4 +87,11 @@ public class OtaManagePermissionServiceImpl extends ServiceImpl<OtaManagePermiss
|
|||||||
public List<OtaManagePermission> queryList() {
|
public List<OtaManagePermission> queryList() {
|
||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OtaManagePermission> queryByUserId(String userId) {
|
||||||
|
LambdaQueryWrapper<OtaManagePermission> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(OtaManagePermission::getUserId, userId);
|
||||||
|
return this.list(wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user