物联用户权限功能优化
This commit is contained in:
@@ -407,10 +407,11 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getRunPortableDev")
|
@PostMapping("/getRunPortableDev")
|
||||||
@ApiOperation("获取在运的便携式设备")
|
@ApiOperation("获取用户未绑定的在运的便携式设备")
|
||||||
public HttpResult<List<CsEquipmentDeliveryPO>> getRunPortableDev(){
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
|
public HttpResult<List<CsEquipmentDeliveryPO>> getRunPortableDev(@RequestParam("userId") String userId){
|
||||||
String methodDescribe = getMethodDescribe("getRunPortableDev");
|
String methodDescribe = getMethodDescribe("getRunPortableDev");
|
||||||
List<CsEquipmentDeliveryPO> result = csEquipmentDeliveryService.getRunPortableDev();
|
List<CsEquipmentDeliveryPO> result = csEquipmentDeliveryService.getRunPortableDev(userId);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
|||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
||||||
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.csdevice.service.CsEngineeringService;
|
import com.njcn.csdevice.service.CsEngineeringService;
|
||||||
@@ -94,4 +95,14 @@ public class EngineeringController extends BaseController {
|
|||||||
CsEngineeringPO po = csEngineeringService.queryEngineeringById(id);
|
CsEngineeringPO po = csEngineeringService.queryEngineeringById(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getUnlinkedEngineering")
|
||||||
|
@ApiOperation("获取用户未绑定的工程信息")
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
|
public HttpResult<List<CsEngineeringPO>> getUnlinkedEngineering(@RequestParam("userId") String userId){
|
||||||
|
String methodDescribe = getMethodDescribe("getUnlinkedEngineering");
|
||||||
|
List<CsEngineeringPO> result = csEngineeringService.getUnlinkedEngineering(userId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,4 +57,6 @@ public interface CsEngineeringService extends IService<CsEngineeringPO>{
|
|||||||
List<CsEngineeringPO> getEngineerings(List<String> list);
|
List<CsEngineeringPO> getEngineerings(List<String> list);
|
||||||
|
|
||||||
CsEngineeringPO queryEngineeringById(String id);
|
CsEngineeringPO queryEngineeringById(String id);
|
||||||
|
|
||||||
|
List<CsEngineeringPO> getUnlinkedEngineering(String userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,6 +193,6 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
|||||||
|
|
||||||
List<CsEquipmentDeliveryPO> getListByIds(List<String> devList);
|
List<CsEquipmentDeliveryPO> getListByIds(List<String> devList);
|
||||||
|
|
||||||
List<CsEquipmentDeliveryPO> getRunPortableDev();
|
List<CsEquipmentDeliveryPO> getRunPortableDev(String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,20 @@ package com.njcn.csdevice.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.Query;
|
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.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.csdevice.api.CsDeviceUserFeignClient;
|
||||||
|
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.mapper.CsEngineeringMapper;
|
import com.njcn.csdevice.mapper.CsEngineeringMapper;
|
||||||
import com.njcn.csdevice.mapper.CsEngineeringUserMapper;
|
import com.njcn.csdevice.mapper.CsEngineeringUserMapper;
|
||||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||||
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
import com.njcn.csdevice.mapper.CsMarketDataMapper;
|
||||||
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringAddParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringAuditParm;
|
||||||
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
import com.njcn.csdevice.pojo.param.CsEngineeringQueryPageParm;
|
||||||
@@ -20,7 +23,6 @@ import com.njcn.csdevice.pojo.param.CsEngineeringQueryParm;
|
|||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
import com.njcn.csdevice.pojo.vo.CsEngineeringVO;
|
||||||
import com.njcn.csdevice.service.CsEngineeringService;
|
import com.njcn.csdevice.service.CsEngineeringService;
|
||||||
import com.njcn.csdevice.service.CsMarketDataService;
|
|
||||||
import com.njcn.csdevice.service.CsTouristDataPOService;
|
import com.njcn.csdevice.service.CsTouristDataPOService;
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.system.api.AreaFeignClient;
|
import com.njcn.system.api.AreaFeignClient;
|
||||||
@@ -58,12 +60,10 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
private final CsLedgerMapper csLedgerMapper;
|
private final CsLedgerMapper csLedgerMapper;
|
||||||
private final CsEngineeringUserMapper csEngineeringUserMapper;
|
private final CsEngineeringUserMapper csEngineeringUserMapper;
|
||||||
private final RoleEngineerDevServiceImpl roleEngineerDevService;
|
private final RoleEngineerDevServiceImpl roleEngineerDevService;
|
||||||
|
|
||||||
private final CsMarketDataMapper csMarketDataMapper;
|
private final CsMarketDataMapper csMarketDataMapper;
|
||||||
private final CsTouristDataPOService csTouristDataPOService;
|
private final CsTouristDataPOService csTouristDataPOService;
|
||||||
|
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||||
|
private final CsDeviceUserFeignClient csDeviceUserFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
@@ -222,6 +222,29 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
return this.lambdaQuery().eq(CsEngineeringPO::getId,id).eq(CsEngineeringPO::getStatus,"1").one();
|
return this.lambdaQuery().eq(CsEngineeringPO::getId,id).eq(CsEngineeringPO::getStatus,"1").one();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CsEngineeringPO> getUnlinkedEngineering(String userId) {
|
||||||
|
List<String> list1 = new ArrayList<>();
|
||||||
|
//根据用户信息获取设备信息
|
||||||
|
List<String> devList = csDeviceUserFeignClient.findDevByUserId(userId).getData();
|
||||||
|
//根据设备查询工程信息
|
||||||
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
|
List<DevDetailDTO> ledger = csLedgerFeignClient.getInfoByIds(devList).getData();
|
||||||
|
ledger.forEach(item->{
|
||||||
|
if (!Objects.equals(item.getEngineeringid(),"/")) {
|
||||||
|
list1.add(item.getEngineeringid());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//获取所有工程信息
|
||||||
|
LambdaQueryWrapper<CsEngineeringPO> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper2.eq(CsEngineeringPO::getStatus,"1");
|
||||||
|
if (CollectionUtil.isNotEmpty(list1)) {
|
||||||
|
queryWrapper2.notIn(CsEngineeringPO::getId,list1);
|
||||||
|
}
|
||||||
|
return this.baseMapper.selectList(queryWrapper2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getAreaById(String id){
|
public String getAreaById(String id){
|
||||||
|
|
||||||
|
|||||||
@@ -987,7 +987,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsEquipmentDeliveryPO> getRunPortableDev() {
|
public List<CsEquipmentDeliveryPO> getRunPortableDev(String userId) {
|
||||||
List<CsEquipmentDeliveryPO> result = new ArrayList<>();
|
List<CsEquipmentDeliveryPO> result = new ArrayList<>();
|
||||||
DictTreeVO vo = dictTreeFeignClient.queryByCode(DicDataEnum.PORTABLE.getCode()).getData();
|
DictTreeVO vo = dictTreeFeignClient.queryByCode(DicDataEnum.PORTABLE.getCode()).getData();
|
||||||
if (ObjectUtil.isNotNull(vo)) {
|
if (ObjectUtil.isNotNull(vo)) {
|
||||||
@@ -995,6 +995,11 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getDevType,vo.getId())
|
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getDevType,vo.getId())
|
||||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||||
.eq(CsEquipmentDeliveryPO::getUsageStatus,1);
|
.eq(CsEquipmentDeliveryPO::getUsageStatus,1);
|
||||||
|
//获取用户已经绑定的便携式设备
|
||||||
|
List<String> devList = csDeviceUserPOService.findDevByUserId(userId);
|
||||||
|
if (CollectionUtil.isNotEmpty(devList)) {
|
||||||
|
lambdaQueryWrapper.notIn(CsEquipmentDeliveryPO::getId,devList);
|
||||||
|
}
|
||||||
result = this.list(lambdaQueryWrapper);
|
result = this.list(lambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user