|
@@ -9,10 +9,12 @@ import com.zd.common.core.security.TokenService;
|
|
|
import com.zd.common.core.utils.StringUtils;
|
|
import com.zd.common.core.utils.StringUtils;
|
|
|
import com.zd.common.core.web.controller.AbstractController;
|
|
import com.zd.common.core.web.controller.AbstractController;
|
|
|
import com.zd.laboratory.api.dto.WarningNoticeLogDto;
|
|
import com.zd.laboratory.api.dto.WarningNoticeLogDto;
|
|
|
|
|
+import com.zd.laboratory.domain.LabSubject;
|
|
|
import com.zd.laboratory.domain.WarningNoticeLog;
|
|
import com.zd.laboratory.domain.WarningNoticeLog;
|
|
|
import com.zd.laboratory.domain.dto.QueryAppWarningLogParam;
|
|
import com.zd.laboratory.domain.dto.QueryAppWarningLogParam;
|
|
|
import com.zd.laboratory.domain.dto.QueryWarningLogParam;
|
|
import com.zd.laboratory.domain.dto.QueryWarningLogParam;
|
|
|
import com.zd.laboratory.domain.vo.WarningNoticeLogVO;
|
|
import com.zd.laboratory.domain.vo.WarningNoticeLogVO;
|
|
|
|
|
+import com.zd.laboratory.mapper.LabSubjectMapper;
|
|
|
import com.zd.laboratory.service.WarningNoticeLogService;
|
|
import com.zd.laboratory.service.WarningNoticeLogService;
|
|
|
import com.zd.model.domain.ResultData;
|
|
import com.zd.model.domain.ResultData;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -47,6 +49,9 @@ public class WarningNoticeLogController extends AbstractController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LabSubjectMapper labSubjectMapper;
|
|
|
|
|
+
|
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
|
@ApiOperation("新增报警记录日志")
|
|
@ApiOperation("新增报警记录日志")
|
|
|
public ResultData add(@RequestBody WarningNoticeLogDto warningNoticeLogDto){
|
|
public ResultData add(@RequestBody WarningNoticeLogDto warningNoticeLogDto){
|
|
@@ -128,9 +133,24 @@ public class WarningNoticeLogController extends AbstractController {
|
|
|
@PostMapping("/appList")
|
|
@PostMapping("/appList")
|
|
|
@ApiOperation("小程序查询预警通知列表")
|
|
@ApiOperation("小程序查询预警通知列表")
|
|
|
public ResultData appList(@RequestBody QueryAppWarningLogParam queryAppWarningLogParam){
|
|
public ResultData appList(@RequestBody QueryAppWarningLogParam queryAppWarningLogParam){
|
|
|
|
|
+ //查询登录人管理的实验室列表
|
|
|
|
|
+ LabSubject labSubject = new LabSubject();
|
|
|
|
|
+ if(!tokenService.getLoginUser().getUsername().equals("admin")){
|
|
|
|
|
+ labSubject.setLoginUserId(tokenService.getLoginUser().getUserid());
|
|
|
|
|
+ }
|
|
|
|
|
+ List<LabSubject> labSubjectList = labSubjectMapper.selectLabSubjectList(labSubject);
|
|
|
|
|
+ List<Long> subIds = Optional.ofNullable(labSubjectList).orElseGet(Collections::emptyList)
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(a->a.getId())
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ if(subIds.size()==0){
|
|
|
|
|
+ subIds.add(-99L);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
Page<WarningNoticeLogVO> VOPage = new Page<>();
|
|
Page<WarningNoticeLogVO> VOPage = new Page<>();
|
|
|
LambdaQueryWrapper<WarningNoticeLog> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<WarningNoticeLog> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(WarningNoticeLog::getIsDeleted,Boolean.FALSE);
|
|
lambdaQueryWrapper.eq(WarningNoticeLog::getIsDeleted,Boolean.FALSE);
|
|
|
|
|
+ lambdaQueryWrapper.in(WarningNoticeLog::getSubId,subIds);
|
|
|
if(Objects.nonNull(queryAppWarningLogParam.getCollegeId())){
|
|
if(Objects.nonNull(queryAppWarningLogParam.getCollegeId())){
|
|
|
lambdaQueryWrapper.eq(WarningNoticeLog::getCollegeId,queryAppWarningLogParam.getCollegeId());
|
|
lambdaQueryWrapper.eq(WarningNoticeLog::getCollegeId,queryAppWarningLogParam.getCollegeId());
|
|
|
}
|
|
}
|