微调
This commit is contained in:
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.csdevice.pojo.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/9/12 16:10【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CsEquipmentProcessDTO {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网络设备ID
|
||||||
|
*/
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人员
|
||||||
|
*/
|
||||||
|
private String operator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起始时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备当前流程(1:设备登记,2:功能调试,3:出厂调试,4:设备投运
|
||||||
|
*/
|
||||||
|
private String process;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程状态 0:取消 1:成功
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsEquipmentProcessDTO;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentProcessPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentProcessPO;
|
||||||
import com.njcn.csdevice.service.CsEquipmentProcessPOService;
|
import com.njcn.csdevice.service.CsEquipmentProcessPOService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
@@ -19,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类的介绍:设备调试日志记录
|
* 类的介绍:设备调试日志记录
|
||||||
*
|
*
|
||||||
@@ -49,4 +52,15 @@ public class CsEquipmentProcessController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/query")
|
||||||
|
@ApiOperation("新增记录")
|
||||||
|
@ApiImplicitParam(name = "csEquipmentProcessDTO", value = "逻辑子设备标识", required = true)
|
||||||
|
public HttpResult<List<CsEquipmentProcessDTO>> queryList(@RequestBody @Validated CsEquipmentProcessDTO csEquipmentProcessDTO){
|
||||||
|
String methodDescribe = getMethodDescribe("query");
|
||||||
|
List<CsEquipmentProcessDTO> result = csEquipmentProcessPOService.queryqueryList(csEquipmentProcessDTO);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,5 +228,14 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@ApiOperation("取消联调")
|
||||||
|
@PostMapping(value = "deleteTest")
|
||||||
|
public HttpResult<String> deleteTest(@RequestParam("deviceId") String deviceId,@RequestParam("type") String type){
|
||||||
|
String methodDescribe = getMethodDescribe("testCompletion");
|
||||||
|
csEquipmentDeliveryService.deleteTest(deviceId,type);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,4 +98,6 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
|||||||
void delete(String devId);
|
void delete(String devId);
|
||||||
|
|
||||||
void testCompletion(String deviceId,String type);
|
void testCompletion(String deviceId,String type);
|
||||||
|
|
||||||
|
void deleteTest(String deviceId, String type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.njcn.csdevice.service;
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsEquipmentProcessDTO;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentProcessPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentProcessPO;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
public interface CsEquipmentProcessPOService extends IService<CsEquipmentProcessPO>{
|
public interface CsEquipmentProcessPOService extends IService<CsEquipmentProcessPO>{
|
||||||
|
|
||||||
|
|
||||||
|
List<CsEquipmentProcessDTO> queryqueryList(CsEquipmentProcessDTO csEquipmentProcessDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -391,6 +391,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty (trueCollect)) {
|
if (!CollectionUtils.isEmpty (trueCollect)) {
|
||||||
|
List<CsEquipmentProcessPO> collect1 = new ArrayList<>();
|
||||||
List<CsEquipmentDeliveryPO> collect = trueCollect.stream ( ).map (temp -> {
|
List<CsEquipmentDeliveryPO> collect = trueCollect.stream ( ).map (temp -> {
|
||||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = new CsEquipmentDeliveryPO ( );
|
CsEquipmentDeliveryPO csEquipmentDeliveryPO = new CsEquipmentDeliveryPO ( );
|
||||||
BeanUtils.copyProperties (temp, csEquipmentDeliveryPO);
|
BeanUtils.copyProperties (temp, csEquipmentDeliveryPO);
|
||||||
@@ -401,8 +402,16 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
csEquipmentDeliveryPO.setRunStatus(1);
|
csEquipmentDeliveryPO.setRunStatus(1);
|
||||||
csEquipmentDeliveryPO.setStatus("1");
|
csEquipmentDeliveryPO.setStatus("1");
|
||||||
csEquipmentDeliveryPO.setProcess(1);
|
csEquipmentDeliveryPO.setProcess(1);
|
||||||
|
|
||||||
|
CsEquipmentProcessPO csEquipmentProcess = new CsEquipmentProcessPO();
|
||||||
|
csEquipmentProcess.setDevId(csEquipmentDeliveryPO.getNdid());
|
||||||
|
csEquipmentProcess.setOperator(RequestUtil.getUserIndex());
|
||||||
|
csEquipmentProcess.setStartTime(LocalDateTime.now());
|
||||||
|
csEquipmentProcess.setProcess(1);
|
||||||
|
collect1.add(csEquipmentProcess);
|
||||||
return csEquipmentDeliveryPO;
|
return csEquipmentDeliveryPO;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect (Collectors.toList ( ));
|
||||||
|
csEquipmentProcessPOService.saveBatch(collect1,500);
|
||||||
this.saveOrUpdateBatch (collect, 500);
|
this.saveOrUpdateBatch (collect, 500);
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty (falseCollect)) {
|
if (!CollectionUtils.isEmpty (falseCollect)) {
|
||||||
@@ -463,18 +472,35 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void testCompletion(String deviceId,String type) {
|
public void testCompletion(String deviceId,String type) {
|
||||||
|
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one();
|
||||||
this.lambdaUpdate().eq(CsEquipmentDeliveryPO::getId,deviceId).
|
this.lambdaUpdate().eq(CsEquipmentDeliveryPO::getId,deviceId).
|
||||||
set(CsEquipmentDeliveryPO::getStatus,0).
|
set(CsEquipmentDeliveryPO::getStatus,0).
|
||||||
set(CsEquipmentDeliveryPO::getRunStatus,1).
|
set(CsEquipmentDeliveryPO::getRunStatus,1).
|
||||||
set(CsEquipmentDeliveryPO::getProcess,type+1).update();
|
set(CsEquipmentDeliveryPO::getProcess,type+1).update();
|
||||||
this.delete(deviceId);
|
this.delete(deviceId);
|
||||||
csEquipmentProcessPOService.lambdaUpdate().eq(CsEquipmentProcessPO::getDevId,deviceId).
|
csEquipmentProcessPOService.lambdaUpdate().eq(CsEquipmentProcessPO::getDevId,one.getNdid()).
|
||||||
eq(CsEquipmentProcessPO::getProcess,type).
|
eq(CsEquipmentProcessPO::getProcess,type).
|
||||||
eq(CsEquipmentProcessPO::getStatus,1).
|
eq(CsEquipmentProcessPO::getStatus,1).
|
||||||
set(CsEquipmentProcessPO::getEndTime,LocalDateTime.now()).
|
set(CsEquipmentProcessPO::getEndTime,LocalDateTime.now()).
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTest(String deviceId, String type) {
|
||||||
|
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one();
|
||||||
|
|
||||||
|
this.lambdaUpdate().eq(CsEquipmentDeliveryPO::getId,deviceId).
|
||||||
|
set(CsEquipmentDeliveryPO::getStatus,0).
|
||||||
|
set(CsEquipmentDeliveryPO::getRunStatus,1).
|
||||||
|
set(CsEquipmentDeliveryPO::getProcess,type).update();
|
||||||
|
this.delete(deviceId);
|
||||||
|
csEquipmentProcessPOService.lambdaUpdate().eq(CsEquipmentProcessPO::getDevId,one.getNdid()).
|
||||||
|
eq(CsEquipmentProcessPO::getProcess,type).
|
||||||
|
eq(CsEquipmentProcessPO::getStatus,0).
|
||||||
|
set(CsEquipmentProcessPO::getEndTime,LocalDateTime.now()).
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ndid生成二维码
|
* 根据ndid生成二维码
|
||||||
* @param ndid
|
* @param ndid
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||||
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
|
import com.njcn.csdevice.pojo.dto.CsEquipmentProcessDTO;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.csdevice.mapper.CsEquipmentProcessPOMapper;
|
import com.njcn.csdevice.mapper.CsEquipmentProcessPOMapper;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentProcessPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentProcessPO;
|
||||||
import com.njcn.csdevice.service.CsEquipmentProcessPOService;
|
import com.njcn.csdevice.service.CsEquipmentProcessPOService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -16,4 +24,16 @@ import com.njcn.csdevice.service.CsEquipmentProcessPOService;
|
|||||||
@Service
|
@Service
|
||||||
public class CsEquipmentProcessPOServiceImpl extends ServiceImpl<CsEquipmentProcessPOMapper, CsEquipmentProcessPO> implements CsEquipmentProcessPOService{
|
public class CsEquipmentProcessPOServiceImpl extends ServiceImpl<CsEquipmentProcessPOMapper, CsEquipmentProcessPO> implements CsEquipmentProcessPOService{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CsEquipmentProcessDTO> queryqueryList(CsEquipmentProcessDTO csEquipmentProcessDTO) {
|
||||||
|
List<CsEquipmentProcessPO> list = this.lambdaQuery().eq(StringUtils.isNotBlank(csEquipmentProcessDTO.getId()), CsEquipmentProcessPO::getId, csEquipmentProcessDTO.getId()).
|
||||||
|
eq(StringUtils.isNotBlank(csEquipmentProcessDTO.getDevId()), CsEquipmentProcessPO::getDevId, csEquipmentProcessDTO.getDevId()).
|
||||||
|
eq(StringUtils.isNotBlank(csEquipmentProcessDTO.getProcess()), CsEquipmentProcessPO::getProcess, csEquipmentProcessDTO.getProcess()).list();
|
||||||
|
List<CsEquipmentProcessDTO> collect = list.stream().map(temp -> {
|
||||||
|
CsEquipmentProcessDTO csEquipmentProcessDTO1 = new CsEquipmentProcessDTO();
|
||||||
|
BeanUtils.copyProperties(temp, csEquipmentProcessDTO1);
|
||||||
|
return csEquipmentProcessDTO1;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
return collect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,9 +36,12 @@ public class CsEventUserQueryParam {
|
|||||||
*/
|
*/
|
||||||
private List<String> target;
|
private List<String> target;
|
||||||
|
|
||||||
|
private String type;
|
||||||
/**
|
/**
|
||||||
* 状态(0:未读取 1:已读取)
|
* 状态(0:未读取 1:已读取)
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private String level;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||||
import com.njcn.csharmonic.service.CsEventUserPOService;
|
import com.njcn.csharmonic.service.CsEventUserPOService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/9/4 16:18【需求编号】
|
* Date: 2023/9/4 16:18【需求编号】
|
||||||
@@ -28,7 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/eventUser")
|
@RequestMapping("/eventUser")
|
||||||
@Api(tags = "暂降事件")
|
@Api(tags = "事件")
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EventUserController extends BaseController {
|
public class EventUserController extends BaseController {
|
||||||
private final CsEventUserPOService csEventUserPOService;
|
private final CsEventUserPOService csEventUserPOService;
|
||||||
@@ -42,6 +45,16 @@ public class EventUserController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, count, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, count, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/queryEventList")
|
||||||
|
@ApiOperation("当天暂降事件未读消息")
|
||||||
|
@ApiImplicitParam(name = "csEventUserQueryParam", value = "暂降事件查询参数", required = true)
|
||||||
|
public HttpResult<List<EventDetailVO>> queryEventList(@RequestBody CsEventUserQueryParam csEventUserQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryEventList");
|
||||||
|
List<EventDetailVO> list = csEventUserPOService.queryUserEventList(csEventUserQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/updateStatus")
|
@PostMapping("/updateStatus")
|
||||||
@ApiOperation("已读事件")
|
@ApiOperation("已读事件")
|
||||||
|
|||||||
@@ -182,6 +182,19 @@ public class MqttMessageHandler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
List<ThdDataVO> apfRmsI = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_RmsI_TolOut(A)")).collect(Collectors.toList());
|
||||||
|
Map<String, List<ThdDataVO>> collect2 = apfRmsI.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
||||||
|
collect2.forEach((k,v)->{
|
||||||
|
if(!CollectionUtil.isEmpty(v)){
|
||||||
|
double asDouble = v.stream().mapToDouble(ThdDataVO::getStatisticalData).average().getAsDouble();
|
||||||
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
|
BeanUtils.copyProperties(v.get(0),thdDataVO);
|
||||||
|
thdDataVO.setStatisticalData(Double.valueOf(df.format(asDouble)));
|
||||||
|
thdDataVO.setPhase("avg");
|
||||||
|
result.add(thdDataVO);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
List<ThdDataVO> apfThdISys = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Sys(%)")).collect(Collectors.toList());
|
List<ThdDataVO> apfThdISys = tempList.stream().filter(temp -> Objects.equals(temp.getStatisticalName(), "Apf_ThdA_Sys(%)")).collect(Collectors.toList());
|
||||||
Map<String, List<ThdDataVO>> collect4 = apfThdISys.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
Map<String, List<ThdDataVO>> collect4 = apfThdISys.stream().collect(Collectors.groupingBy(ThdDataVO::getLineId));
|
||||||
collect4.forEach((k,v)->{
|
collect4.forEach((k,v)->{
|
||||||
|
|||||||
@@ -31,16 +31,21 @@
|
|||||||
<select id="queryUserEventList" resultType="com.njcn.csharmonic.pojo.vo.EventDetailVO">
|
<select id="queryUserEventList" resultType="com.njcn.csharmonic.pojo.vo.EventDetailVO">
|
||||||
select a.event_id id,a.user_id userId,a.status status,b.device_id deviceId,b.line_id lineId,
|
select a.event_id id,a.user_id userId,a.status status,b.device_id deviceId,b.line_id lineId,
|
||||||
b.start_time startTime,b.tag tag ,b.wave_path wavePath, b.type type
|
b.start_time startTime,b.tag tag ,b.wave_path wavePath, b.type type
|
||||||
from cs_event_user a inner join cs_event b on a.event_id=b.id where 1=1 and DATE(b.start_time) =DATE(NOW()) and b.tag in
|
from cs_event_user a inner join cs_event b on a.event_id=b.id where 1=1 and DATE(b.start_time) =DATE(NOW())
|
||||||
|
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.target != null and csEventUserQueryParam.target.size()>0">
|
||||||
|
|
||||||
|
and b.tag in
|
||||||
<foreach collection="csEventUserQueryParam.target" index="index" item="item" open="(" separator="," close=")">
|
<foreach collection="csEventUserQueryParam.target" index="index" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
<!-- <if test="csEventUserQueryParam!=null and csEventUserQueryParam.enginnerId != null and csEventUserQueryParam.enginnerId !=''">-->
|
</if>
|
||||||
<!-- AND a.enginner_id =#{ csEventUserQueryParam.enginnerId}-->
|
|
||||||
<!-- </if>-->
|
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.type != null and csEventUserQueryParam.type !=''">
|
||||||
<!-- <if test="csEventUserQueryParam!=null and csEventUserQueryParam.deviceId != null and csEventUserQueryParam.deviceId !=''">-->
|
AND b.type =#{ csEventUserQueryParam.type}
|
||||||
<!-- AND a.device_id =#{ csEventUserQueryParam.deviceId}-->
|
</if>
|
||||||
<!-- </if>-->
|
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.level != null and csEventUserQueryParam.level !=''">
|
||||||
|
AND b.level =#{ csEventUserQueryParam.level}
|
||||||
|
</if>
|
||||||
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.status != null and csEventUserQueryParam.status !=''">
|
<if test="csEventUserQueryParam!=null and csEventUserQueryParam.status != null and csEventUserQueryParam.status !=''">
|
||||||
AND a.status =#{ csEventUserQueryParam.status}
|
AND a.status =#{ csEventUserQueryParam.status}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
package com.njcn.csharmonic.service.impl;
|
package com.njcn.csharmonic.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.csharmonic.pojo.po.CsEventUserPO;
|
import com.njcn.csharmonic.pojo.po.CsEventUserPO;
|
||||||
import com.njcn.csharmonic.mapper.CsEventUserPOMapper;
|
import com.njcn.csharmonic.mapper.CsEventUserPOMapper;
|
||||||
import com.njcn.csharmonic.service.CsEventUserPOService;
|
import com.njcn.csharmonic.service.CsEventUserPOService;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -40,7 +46,16 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
|||||||
@Override
|
@Override
|
||||||
public List<EventDetailVO> queryUserEventList(CsEventUserQueryParam csEventUserQueryParam) {
|
public List<EventDetailVO> queryUserEventList(CsEventUserQueryParam csEventUserQueryParam) {
|
||||||
csEventUserQueryParam.setUserId(RequestUtil.getUserIndex());
|
csEventUserQueryParam.setUserId(RequestUtil.getUserIndex());
|
||||||
if(CollectionUtil.isEmpty(csEventUserQueryParam.getTarget())){
|
String role = RequestUtil.getUserRole();
|
||||||
|
List<String> strings = JSONArray.parseArray(role, String.class);
|
||||||
|
if(CollectionUtils.isEmpty(strings)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
role=strings.get(0);
|
||||||
|
if( Objects.equals(role, AppRoleEnum.APP_VIP_USER.getCode())){
|
||||||
|
csEventUserQueryParam.setLevel("3");
|
||||||
|
}
|
||||||
|
if(CollectionUtil.isEmpty(csEventUserQueryParam.getTarget())&&Objects.equals(csEventUserQueryParam.getType(),"0")){
|
||||||
/*获取所有暂态事件类型*/
|
/*获取所有暂态事件类型*/
|
||||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.APP_EVENT.getCode()).getData();
|
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.APP_EVENT.getCode()).getData();
|
||||||
List<String> collect = data.stream().map(DictData::getCode).collect(Collectors.toList());
|
List<String> collect = data.stream().map(DictData::getCode).collect(Collectors.toList());
|
||||||
|
|||||||
Reference in New Issue
Block a user