提交
This commit is contained in:
@@ -14,9 +14,11 @@ import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
||||
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
|
||||
import com.njcn.csdevice.service.ICsLedgerService;
|
||||
import com.njcn.csdevice.service.RoleEngineerDevService;
|
||||
import com.njcn.cswarn.api.CsEquipmentAlarmFeignClient;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmParm;
|
||||
@@ -28,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -46,7 +49,7 @@ import static java.util.Objects.*;
|
||||
@RequiredArgsConstructor
|
||||
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
||||
|
||||
private final CsLedgerMapper csLedgerMapper;
|
||||
private final ICsLedgerService iCsLedgerService;
|
||||
private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient;
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final RoleEngineerDevService roleEngineerDevService;
|
||||
@@ -93,6 +96,10 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
||||
|
||||
DevCountVO devCountVO = new DevCountVO();
|
||||
List<String> device = roleEngineerDevService.getDevice();
|
||||
List<CsLedgerVO> deviceTree = iCsLedgerService.getDeviceTree();
|
||||
List<String> collect1 = deviceTree.stream().filter(temp -> temp.getId().equals(id)).map(CsLedgerVO::getChildren).flatMap(Collection::stream).map(CsLedgerVO::getChildren).flatMap(Collection::stream).map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
//求交集
|
||||
device.retainAll(collect1);
|
||||
if(CollectionUtils.isEmpty(device)){
|
||||
devCountVO.setOnLineCount(0);
|
||||
devCountVO.setOnLineDevs(new ArrayList<>());
|
||||
@@ -107,14 +114,15 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
||||
|
||||
QueryWrapper<CsEquipmentDeliveryPO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("id",device);
|
||||
|
||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectList(queryWrapper);
|
||||
devCountVO.setAllDevs(csEquipmentDeliveryPOS);
|
||||
List<CsEquipmentDeliveryPO> collect = csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 1).collect(Collectors.toList());
|
||||
List<CsEquipmentDeliveryPO> collect2= csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 2).collect(Collectors.toList());
|
||||
devCountVO.setOnLineCount(collect.size());
|
||||
devCountVO.setOnLineDevs(collect);
|
||||
devCountVO.setOffLineCount(collect2.size());
|
||||
devCountVO.setOffLineDevs(collect2);
|
||||
devCountVO.setOnLineCount(collect2.size());
|
||||
devCountVO.setOnLineDevs(collect2);
|
||||
devCountVO.setOffLineCount(collect.size());
|
||||
devCountVO.setOffLineDevs(collect);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class CsEventDetailPOController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryList")
|
||||
@ApiOperation("暂态警告分页查询")
|
||||
@ApiImplicitParam(name = "csEventDetailPageParm", value = "暂态警告查询参数", required = true)
|
||||
@ApiImplicitParam(name = "csEventDetailParm", value = "暂态警告查询参数", required = true)
|
||||
public HttpResult<List<CsEventDetailVO>> queryList(@RequestBody @Validated CsEventDetailParm csEventDetailParm ){
|
||||
String methodDescribe = getMethodDescribe("queryList");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user