干预功能优化
This commit is contained in:
parent
6a70b64dfa
commit
60f028c086
|
@ -10,6 +10,8 @@ import org.dromara.common.excel.utils.ExcelUtil;
|
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.scale.domain.bo.SysInterveneRecordBo;
|
||||
import org.dromara.scale.domain.vo.SysInterveneRecordVo;
|
||||
|
@ -32,7 +34,19 @@ import java.util.List;
|
|||
@RequestMapping("/scale/intervene")
|
||||
public class InterveneRecordController extends BaseController {
|
||||
|
||||
private final ISysInterveneRecordService sysInterveneRecordService;
|
||||
private final ISysInterveneRecordService interveneRecordService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取干预时间轴信息
|
||||
*
|
||||
* @param userId 主键
|
||||
*/
|
||||
@SaCheckPermission("intervene:record:pageList")
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo<SysInterveneRecordVo> list(@NotNull(message = "用户id不能为空") Long userId, PageQuery pageQuery) {
|
||||
return interveneRecordService.queryPageList(userId, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出干预记录列表
|
||||
|
@ -41,7 +55,7 @@ public class InterveneRecordController extends BaseController {
|
|||
@Log(title = "干预记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SysInterveneRecordBo bo, HttpServletResponse response) {
|
||||
List<SysInterveneRecordVo> list = sysInterveneRecordService.queryList(bo);
|
||||
List<SysInterveneRecordVo> list = interveneRecordService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "干预记录", SysInterveneRecordVo.class, response);
|
||||
}
|
||||
|
||||
|
@ -53,7 +67,7 @@ public class InterveneRecordController extends BaseController {
|
|||
@SaCheckPermission("intervene:record:query")
|
||||
@GetMapping("/{interveneId}")
|
||||
public R<SysInterveneRecordVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long interveneId) {
|
||||
return R.ok(sysInterveneRecordService.queryById(interveneId));
|
||||
return R.ok(interveneRecordService.queryById(interveneId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,7 +78,7 @@ public class InterveneRecordController extends BaseController {
|
|||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysInterveneRecordBo bo) {
|
||||
return toAjax(sysInterveneRecordService.insertByBo(bo));
|
||||
return toAjax(interveneRecordService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +89,7 @@ public class InterveneRecordController extends BaseController {
|
|||
@SaCheckPermission("intervene:record:list")
|
||||
@GetMapping("/times")
|
||||
public R<List<TimeAxisVo>> getTimes(@NotNull(message = "用户id不能为空") Long userId) {
|
||||
return R.ok(sysInterveneRecordService.queryInterveneTimeList(userId));
|
||||
return R.ok(interveneRecordService.queryInterveneTimeList(userId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,11 +26,18 @@ public class SysInterveneRecord {
|
|||
@TableId(value = "intervene_id")
|
||||
private Long interveneId;
|
||||
|
||||
private Long batchNo;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 严重度
|
||||
*/
|
||||
private Integer situation;
|
||||
|
||||
/**
|
||||
* 诊断
|
||||
*/
|
||||
|
@ -39,7 +46,17 @@ public class SysInterveneRecord {
|
|||
/**
|
||||
* 诊断附件
|
||||
*/
|
||||
private Long annex;
|
||||
private Long diagnoseAnnex;
|
||||
|
||||
/**
|
||||
* 通知状态
|
||||
*/
|
||||
private Integer noticeStatus;
|
||||
|
||||
/**
|
||||
* 通知附件
|
||||
*/
|
||||
private Long noticeAnnex;
|
||||
|
||||
/**
|
||||
* 咨询师id
|
||||
|
@ -49,5 +66,7 @@ public class SysInterveneRecord {
|
|||
|
||||
private Date createTime;
|
||||
|
||||
private Date warnTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 干预记录业务对象 sys_intervene_record
|
||||
*
|
||||
|
@ -26,23 +28,40 @@ public class SysInterveneRecordBo extends BaseEntity {
|
|||
//@NotNull(message = "干预记录id不能为空", groups = { EditGroup.class })
|
||||
private Long interveneId;
|
||||
|
||||
private Long batchNo;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotNull(message = "用户id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 严重度
|
||||
*/
|
||||
private Integer situation;
|
||||
|
||||
/**
|
||||
* 诊断
|
||||
*/
|
||||
@NotBlank(message = "诊断不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "诊断不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String diagnose;
|
||||
|
||||
/**
|
||||
* 诊断附件
|
||||
*/
|
||||
//@NotNull(message = "诊断附件不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long annex;
|
||||
private Long diagnoseAnnex;
|
||||
|
||||
/**
|
||||
* 通知状态
|
||||
*/
|
||||
private Integer noticeStatus;
|
||||
|
||||
/**
|
||||
* 通知附件
|
||||
*/
|
||||
private Long noticeAnnex;
|
||||
|
||||
/**
|
||||
* 咨询师id
|
||||
|
@ -54,5 +73,9 @@ public class SysInterveneRecordBo extends BaseEntity {
|
|||
*/
|
||||
private Integer status;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date warnTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,12 +3,15 @@ package org.dromara.scale.domain.vo;
|
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import io.github.linpeilie.annotations.AutoMapping;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.scale.domain.SysInterveneRecord;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -31,12 +34,19 @@ public class SysInterveneRecordVo implements Serializable {
|
|||
@ExcelProperty(value = "干预记录id")
|
||||
private Long interveneId;
|
||||
|
||||
private Long batchNo;
|
||||
|
||||
/**
|
||||
* 预警记录id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 严重度
|
||||
*/
|
||||
private Integer situation;
|
||||
|
||||
/**
|
||||
* 诊断
|
||||
*/
|
||||
|
@ -46,13 +56,34 @@ public class SysInterveneRecordVo implements Serializable {
|
|||
/**
|
||||
* 诊断附件
|
||||
*/
|
||||
@ExcelProperty(value = "诊断附件")
|
||||
private Long annex;
|
||||
private Long diagnoseAnnex;
|
||||
@Translation(type = TransConstant.OSS_ID_TO_URL)
|
||||
@AutoMapping(target = "diagnoseAnnex")
|
||||
private Long diagnoseAnnexUrl;
|
||||
|
||||
/**
|
||||
* 通知状态
|
||||
*/
|
||||
private Integer noticeStatus;
|
||||
|
||||
/**
|
||||
* 通知附件
|
||||
*/
|
||||
private Long noticeAnnex;
|
||||
@Translation(type = TransConstant.OSS_ID_TO_URL)
|
||||
@AutoMapping(target = "noticeAnnex")
|
||||
private Long noticeAnnexUrl;
|
||||
/**
|
||||
* 咨询师id
|
||||
*/
|
||||
private Long counselorId;
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME)
|
||||
@AutoMapping(target = "counselorId")
|
||||
private Long counselorName;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
private Date warnTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ package org.dromara.scale.service;
|
|||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.scale.domain.bo.SysInterveneRecordBo;
|
||||
import org.dromara.scale.domain.vo.TimeAxisVo;
|
||||
import org.dromara.scale.domain.vo.SysInterveneRecordVo;
|
||||
import org.dromara.scale.domain.vo.TimeAxisVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -16,6 +16,11 @@ import java.util.List;
|
|||
*/
|
||||
public interface ISysInterveneRecordService {
|
||||
|
||||
/**
|
||||
* 查询干预列表
|
||||
*/
|
||||
TableDataInfo<SysInterveneRecordVo> queryPageList(Long userId, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询干预记录
|
||||
*/
|
||||
|
|
|
@ -45,6 +45,19 @@ public class SysInterveneRecordServiceImpl implements ISysInterveneRecordService
|
|||
|
||||
private final SysWarnRecordMapper warnMapper;
|
||||
|
||||
/**
|
||||
* 查询干预列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SysInterveneRecordVo> queryPageList(Long userId, PageQuery pageQuery) {
|
||||
Page<SysInterveneRecordVo> result = baseMapper.selectVoPage(pageQuery.build(),
|
||||
new LambdaQueryWrapper<SysInterveneRecord>()
|
||||
.eq(SysInterveneRecord::getUserId, userId)
|
||||
.orderByDesc(SysInterveneRecord::getCreateTime)
|
||||
);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询干预记录
|
||||
*/
|
||||
|
@ -77,7 +90,6 @@ public class SysInterveneRecordServiceImpl implements ISysInterveneRecordService
|
|||
LambdaQueryWrapper<SysInterveneRecord> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getUserId() != null, SysInterveneRecord::getUserId, bo.getUserId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDiagnose()), SysInterveneRecord::getDiagnose, bo.getDiagnose());
|
||||
lqw.eq(bo.getAnnex() != null, SysInterveneRecord::getAnnex, bo.getAnnex());
|
||||
lqw.eq(bo.getCounselorId() != null, SysInterveneRecord::getCounselorId, bo.getCounselorId());
|
||||
return lqw;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue