waring
parent
17f0090036
commit
52484c8be7
|
|
@ -0,0 +1,71 @@
|
||||||
|
package org.qinan.safetyeval.adapter.web;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.Response;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import org.qinan.safetyeval.app.waring.service.EvalProjectWaringServiceI;
|
||||||
|
import org.qinan.safetyeval.client.waring.response.EvalProjectWaringCo;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringAddCmd;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringUpdateCmd;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
/**
|
||||||
|
*项目预警
|
||||||
|
* @Author: ltq
|
||||||
|
* @Date: 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Api(tags = "项目预警")
|
||||||
|
@RequestMapping("/safetyEval/project-waring")
|
||||||
|
public class EvalProjectWaringController implements Serializable{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private final EvalProjectWaringServiceI evalProjectWaringServiceI;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@ApiOperation("查询项目预警列表-分页")
|
||||||
|
public PageResponse<EvalProjectWaringCo> list(@Validated EvalProjectWaringPageQry qry){
|
||||||
|
return evalProjectWaringServiceI.listEvalProjectWaringPage(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
@ApiOperation("查询项目预警详情页面")
|
||||||
|
public SingleResponse<EvalProjectWaringCo> getInfo(@PathVariable("id") Long id){
|
||||||
|
return SingleResponse.of(evalProjectWaringServiceI.getEvalProjectWaringById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@ApiOperation("新增项目预警")
|
||||||
|
public Response save(@Validated @RequestBody EvalProjectWaringAddCmd evalProjectWaringAddCmd){
|
||||||
|
evalProjectWaringServiceI.saveEvalProjectWaring(evalProjectWaringAddCmd);
|
||||||
|
return Response.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@ApiOperation("修改项目预警")
|
||||||
|
public Response update(@Validated @RequestBody EvalProjectWaringUpdateCmd evalProjectWaringUpdateCmd){
|
||||||
|
evalProjectWaringServiceI.updateEvalProjectWaring(evalProjectWaringUpdateCmd);
|
||||||
|
return Response.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
@ApiOperation("删除项目预警(单个)")
|
||||||
|
public Response deletedById(@PathVariable("id") Long id){
|
||||||
|
evalProjectWaringServiceI.deletedEvalProjectWaringById(id);
|
||||||
|
return Response.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/ids")
|
||||||
|
@ApiOperation("删除项目预警(多个)")
|
||||||
|
public Response deletedByIds(@RequestParam Long[] ids){
|
||||||
|
evalProjectWaringServiceI.deletedEvalProjectWaringByIds(ids);
|
||||||
|
return Response.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
package org.qinan.safetyeval.app.waring.convertor;
|
||||||
|
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringAddCmd;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringUpdateCmd;
|
||||||
|
import org.qinan.safetyeval.domain.waring.model.EvalProjectWaringE;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警转换
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface EvalProjectWaringCmdConvertor {
|
||||||
|
/**
|
||||||
|
* cmd_add转领域模型
|
||||||
|
* @param evalProjectWaringAddCmd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Mapping(target = "evalProjectWaringGateway",ignore = true)
|
||||||
|
EvalProjectWaringE convertCmdToE(EvalProjectWaringAddCmd evalProjectWaringAddCmd);
|
||||||
|
/**
|
||||||
|
* cmd_update转领域模型
|
||||||
|
* @param evalProjectWaringUpdateCmd
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Mapping(target = "evalProjectWaringGateway",ignore = true)
|
||||||
|
EvalProjectWaringE convertCmdToE(EvalProjectWaringUpdateCmd evalProjectWaringUpdateCmd);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package org.qinan.safetyeval.app.waring.executor.command;
|
||||||
|
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import org.qinan.safetyeval.app.waring.convertor.EvalProjectWaringCmdConvertor;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringAddCmd;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.queryservice.EvalProjectWaringQueryService;
|
||||||
|
import org.qinan.safetyeval.domain.waring.ability.EvalProjectWaringAbility;
|
||||||
|
import org.qinan.safetyeval.domain.waring.model.EvalProjectWaringE;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目预警执行器
|
||||||
|
* @author ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringAddCmdExe{
|
||||||
|
|
||||||
|
private final EvalProjectWaringQueryService evalProjectWaringQueryService;
|
||||||
|
private final EvalProjectWaringCmdConvertor evalProjectWaringCmdConvertor;
|
||||||
|
private final EvalProjectWaringAbility evalProjectWaringAbility;
|
||||||
|
/**
|
||||||
|
* 新增项目预警
|
||||||
|
* @param evalProjectWaringAddCmd 新增项目预警对象
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(EvalProjectWaringAddCmd evalProjectWaringAddCmd){
|
||||||
|
EvalProjectWaringE evalProjectWaringE = evalProjectWaringCmdConvertor.convertCmdToE(evalProjectWaringAddCmd);
|
||||||
|
boolean res = evalProjectWaringE.add();
|
||||||
|
if(!res){
|
||||||
|
throw new BizException("保存失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package org.qinan.safetyeval.app.waring.executor.command;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import org.qinan.safetyeval.domain.waring.ability.EvalProjectWaringAbility;
|
||||||
|
import org.qinan.safetyeval.domain.waring.model.EvalProjectWaringE;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
/**
|
||||||
|
* 删除项目预警询执行器
|
||||||
|
* @author ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringDelCmdExe{
|
||||||
|
private final EvalProjectWaringAbility evalProjectWaringAbility;
|
||||||
|
/**
|
||||||
|
* 根据IDS删除项目预警对象
|
||||||
|
* @param ids 项目预警ID数组
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long[] ids){
|
||||||
|
if(ObjectUtil.isEmpty(ids)){
|
||||||
|
throw new BizException("请传入正确的ID");
|
||||||
|
}
|
||||||
|
boolean deleteRes = evalProjectWaringAbility.deletedEvalProjectWaringByIds(ids);
|
||||||
|
if(!deleteRes){
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID删除项目预警对象
|
||||||
|
* @param id 删除项目预警对象ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long id){
|
||||||
|
boolean deleteRes = evalProjectWaringAbility.deletedEvalProjectWaringById(id);
|
||||||
|
if(!deleteRes){
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package org.qinan.safetyeval.app.waring.executor.command;
|
||||||
|
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import org.qinan.safetyeval.app.waring.convertor.EvalProjectWaringCmdConvertor;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringUpdateCmd;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.queryservice.EvalProjectWaringQueryService;
|
||||||
|
import org.qinan.safetyeval.domain.waring.ability.EvalProjectWaringAbility;
|
||||||
|
import org.qinan.safetyeval.domain.waring.model.EvalProjectWaringE;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目预警资源执行器
|
||||||
|
* @author ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringUpdateCmdExe {
|
||||||
|
private final EvalProjectWaringQueryService evalProjectWaringQueryService;
|
||||||
|
private final EvalProjectWaringCmdConvertor evalProjectWaringCmdConvertor;
|
||||||
|
private final EvalProjectWaringAbility evalProjectWaringAbility;
|
||||||
|
/**
|
||||||
|
* 修改项目预警
|
||||||
|
* @param evalProjectWaringUpdateCmd 修改项目预警对象
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(EvalProjectWaringUpdateCmd evalProjectWaringUpdateCmd){
|
||||||
|
EvalProjectWaringE evalProjectWaringE = evalProjectWaringCmdConvertor.convertCmdToE(evalProjectWaringUpdateCmd);
|
||||||
|
Boolean updateRes = evalProjectWaringE.update();
|
||||||
|
if(!updateRes){
|
||||||
|
throw new BizException("数据已被更新,请刷新重试");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
package org.qinan.safetyeval.app.waring.executor.query;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import org.qinan.safetyeval.client.waring.response.EvalProjectWaringCo;
|
||||||
|
import org.qinan.safetyeval.infrastructure.convertor.EvalProjectWaringDoConvertor;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.queryservice.EvalProjectWaringQueryService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警查询执行器
|
||||||
|
* @author ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringListQueryExe {
|
||||||
|
|
||||||
|
private final EvalProjectWaringQueryService evalProjectWaringQueryService;
|
||||||
|
private final EvalProjectWaringDoConvertor evalProjectWaringDoConvertor;
|
||||||
|
/**
|
||||||
|
* 根据ID查找项目预警对象
|
||||||
|
* @param id 项目预警ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public EvalProjectWaringCo execute(Long id){
|
||||||
|
EvalProjectWaringDO evalProjectWaringDO = evalProjectWaringQueryService.getById(id);
|
||||||
|
return evalProjectWaringDoConvertor.converDoToCo(evalProjectWaringDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package org.qinan.safetyeval.app.waring.executor.query;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import org.qinan.safetyeval.client.waring.response.EvalProjectWaringCo;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.queryservice.EvalProjectWaringQueryService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警分页查询执行器
|
||||||
|
* @author ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringPageQueryExe {
|
||||||
|
|
||||||
|
private final EvalProjectWaringQueryService evalProjectWaringQueryService;
|
||||||
|
/**
|
||||||
|
* 分页查找项目预警
|
||||||
|
* @param evalProjectWaringPageQry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageResponse<EvalProjectWaringCo> execute(EvalProjectWaringPageQry evalProjectWaringPageQry){
|
||||||
|
return evalProjectWaringQueryService.listEvalProjectWaringPage(evalProjectWaringPageQry);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package org.qinan.safetyeval.app.waring.service;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import org.qinan.safetyeval.client.waring.response.EvalProjectWaringCo;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringAddCmd;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringUpdateCmd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
public interface EvalProjectWaringServiceI {
|
||||||
|
/**
|
||||||
|
* 分页获取项目预警列表
|
||||||
|
* @param evalProjectWaringPageQry 查找条件对象
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
PageResponse<EvalProjectWaringCo> listEvalProjectWaringPage(EvalProjectWaringPageQry evalProjectWaringPageQry);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID获取项目预警详情
|
||||||
|
* @param id 项目预警ID
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
EvalProjectWaringCo getEvalProjectWaringById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目预警
|
||||||
|
* @param evalProjectWaringAddCmd 项目预警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean saveEvalProjectWaring(EvalProjectWaringAddCmd evalProjectWaringAddCmd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目预警
|
||||||
|
* @param evalProjectWaringUpdateCmd 项目预警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean updateEvalProjectWaring(EvalProjectWaringUpdateCmd evalProjectWaringUpdateCmd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目预警
|
||||||
|
* @param id 项目预警ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean deletedEvalProjectWaringById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目预警
|
||||||
|
* @param ids 项目预警IDs
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean deletedEvalProjectWaringByIds(Long[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package org.qinan.safetyeval.app.waring.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import org.qinan.safetyeval.app.waring.executor.command.EvalProjectWaringAddCmdExe;
|
||||||
|
import org.qinan.safetyeval.app.waring.executor.command.EvalProjectWaringDelCmdExe;
|
||||||
|
import org.qinan.safetyeval.app.waring.executor.command.EvalProjectWaringUpdateCmdExe;
|
||||||
|
import org.qinan.safetyeval.app.waring.executor.query.EvalProjectWaringListQueryExe;
|
||||||
|
import org.qinan.safetyeval.app.waring.executor.query.EvalProjectWaringPageQueryExe;
|
||||||
|
import org.qinan.safetyeval.app.waring.service.EvalProjectWaringServiceI;
|
||||||
|
import org.qinan.safetyeval.client.waring.response.EvalProjectWaringCo;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringAddCmd;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringUpdateCmd;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringServiceImpl implements EvalProjectWaringServiceI {
|
||||||
|
|
||||||
|
private final EvalProjectWaringListQueryExe evalProjectWaringListQueryExe;
|
||||||
|
private final EvalProjectWaringUpdateCmdExe evalProjectWaringUpdateCommandExe;
|
||||||
|
private final EvalProjectWaringAddCmdExe evalProjectWaringAddCommandExe;
|
||||||
|
private final EvalProjectWaringDelCmdExe evalProjectWaringDelCommandExe;
|
||||||
|
private final EvalProjectWaringPageQueryExe evalProjectWaringPageQueryExe;
|
||||||
|
@Override
|
||||||
|
public PageResponse<EvalProjectWaringCo> listEvalProjectWaringPage(EvalProjectWaringPageQry evalProjectWaringPageQry) {
|
||||||
|
return evalProjectWaringPageQueryExe.execute(evalProjectWaringPageQry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EvalProjectWaringCo getEvalProjectWaringById(Long id) {
|
||||||
|
return evalProjectWaringListQueryExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean saveEvalProjectWaring(EvalProjectWaringAddCmd evalProjectWaringAddCmd) {
|
||||||
|
return evalProjectWaringAddCommandExe.execute(evalProjectWaringAddCmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateEvalProjectWaring(EvalProjectWaringUpdateCmd evalProjectWaringUpdateCmd) {
|
||||||
|
return evalProjectWaringUpdateCommandExe.execute(evalProjectWaringUpdateCmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deletedEvalProjectWaringById(Long id) {
|
||||||
|
return evalProjectWaringDelCommandExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deletedEvalProjectWaringByIds(Long[] ids) {
|
||||||
|
return evalProjectWaringDelCommandExe.execute(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package org.qinan.safetyeval.client.waring.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警新增Cmd
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EvalProjectWaringAddCmd implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 项目id */
|
||||||
|
@ApiModelProperty(value = "项目id",required = true)
|
||||||
|
@NotNull(message = "项目id不能为空")
|
||||||
|
private Long projectId;
|
||||||
|
/** 项目归档时间 */
|
||||||
|
@ApiModelProperty(value = "项目归档时间",required = true)
|
||||||
|
@NotNull(message = "项目归档时间不能为空")
|
||||||
|
private LocalDateTime archiveDate;
|
||||||
|
/** 项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警 */
|
||||||
|
@ApiModelProperty(value = "项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警",required = true)
|
||||||
|
@NotBlank(message = "项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警不能为空")
|
||||||
|
private String waringStatus;
|
||||||
|
/** 预警开始时间 */
|
||||||
|
@ApiModelProperty(value = "预警开始时间",required = true)
|
||||||
|
@NotNull(message = "预警开始时间不能为空")
|
||||||
|
private LocalDateTime waringStartTime;
|
||||||
|
/** 重新评估时间 */
|
||||||
|
@ApiModelProperty(value = "重新评估时间",required = true)
|
||||||
|
@NotNull(message = "重新评估时间不能为空")
|
||||||
|
private LocalDateTime reassessmentDate;
|
||||||
|
/** 周期年份 */
|
||||||
|
@ApiModelProperty(value = "周期年份",required = true)
|
||||||
|
@NotNull(message = "周期年份不能为空")
|
||||||
|
private Long cycleDate;
|
||||||
|
/** 环境 */
|
||||||
|
@ApiModelProperty(value = "环境")
|
||||||
|
private String env;
|
||||||
|
/** 项目节点完成进度 */
|
||||||
|
@ApiModelProperty(value = "项目节点完成进度",required = true)
|
||||||
|
@NotBlank(message = "项目节点完成进度不能为空")
|
||||||
|
private String projectNode;
|
||||||
|
/** 所属行业编码(见 IndustryEnum) */
|
||||||
|
@ApiModelProperty(value = "所属行业编码(见 IndustryEnum)")
|
||||||
|
private String industryCode;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package org.qinan.safetyeval.client.waring.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
/**
|
||||||
|
* 项目预警分页查询Qry
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EvalProjectWaringPageQry extends PageQuery{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 项目id */
|
||||||
|
@ApiModelProperty(value = "项目id")
|
||||||
|
private Long projectId;
|
||||||
|
/** 项目归档时间 */
|
||||||
|
@ApiModelProperty(value = "项目归档时间")
|
||||||
|
private LocalDateTime archiveDate;
|
||||||
|
/** 项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警 */
|
||||||
|
@ApiModelProperty(value = "项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警")
|
||||||
|
private String waringStatus;
|
||||||
|
/** 预警开始时间 */
|
||||||
|
@ApiModelProperty(value = "预警开始时间")
|
||||||
|
private LocalDateTime waringStartTime;
|
||||||
|
/** 重新评估时间 */
|
||||||
|
@ApiModelProperty(value = "重新评估时间")
|
||||||
|
private LocalDateTime reassessmentDate;
|
||||||
|
/** 周期年份 */
|
||||||
|
@ApiModelProperty(value = "周期年份")
|
||||||
|
private Long cycleDate;
|
||||||
|
/** 环境 */
|
||||||
|
@ApiModelProperty(value = "环境")
|
||||||
|
private String env;
|
||||||
|
/** 项目节点完成进度 */
|
||||||
|
@ApiModelProperty(value = "项目节点完成进度")
|
||||||
|
private String projectNode;
|
||||||
|
/** 所属行业编码(见 IndustryEnum) */
|
||||||
|
@ApiModelProperty(value = "所属行业编码(见 IndustryEnum)")
|
||||||
|
private String industryCode;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package org.qinan.safetyeval.client.waring.request;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
/**
|
||||||
|
* 项目预警修改Cmd
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EvalProjectWaringUpdateCmd implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
/** 项目id */
|
||||||
|
@ApiModelProperty(value = "项目id",required = true)
|
||||||
|
@NotNull(message = "项目id不能为空")
|
||||||
|
private Long projectId;
|
||||||
|
/** 项目归档时间 */
|
||||||
|
@ApiModelProperty(value = "项目归档时间",required = true)
|
||||||
|
@NotNull(message = "项目归档时间不能为空")
|
||||||
|
private LocalDateTime archiveDate;
|
||||||
|
/** 项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警 */
|
||||||
|
@ApiModelProperty(value = "项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警",required = true)
|
||||||
|
@NotBlank(message = "项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警不能为空")
|
||||||
|
private String waringStatus;
|
||||||
|
/** 预警开始时间 */
|
||||||
|
@ApiModelProperty(value = "预警开始时间",required = true)
|
||||||
|
@NotNull(message = "预警开始时间不能为空")
|
||||||
|
private LocalDateTime waringStartTime;
|
||||||
|
/** 重新评估时间 */
|
||||||
|
@ApiModelProperty(value = "重新评估时间",required = true)
|
||||||
|
@NotNull(message = "重新评估时间不能为空")
|
||||||
|
private LocalDateTime reassessmentDate;
|
||||||
|
/** 周期年份 */
|
||||||
|
@ApiModelProperty(value = "周期年份",required = true)
|
||||||
|
@NotNull(message = "周期年份不能为空")
|
||||||
|
private Long cycleDate;
|
||||||
|
/** 环境 */
|
||||||
|
@ApiModelProperty(value = "环境")
|
||||||
|
private String env;
|
||||||
|
/** 项目节点完成进度 */
|
||||||
|
@ApiModelProperty(value = "项目节点完成进度",required = true)
|
||||||
|
@NotBlank(message = "项目节点完成进度不能为空")
|
||||||
|
private String projectNode;
|
||||||
|
/** 所属行业编码(见 IndustryEnum) */
|
||||||
|
@ApiModelProperty(value = "所属行业编码(见 IndustryEnum)")
|
||||||
|
private String industryCode;
|
||||||
|
@NotNull(message = "version不能为空")
|
||||||
|
@ApiModelProperty(value = "version")
|
||||||
|
private Integer version;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package org.qinan.safetyeval.client.waring.response;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.ClientObject;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
/**
|
||||||
|
* 项目预警Co
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EvalProjectWaringCo extends ClientObject {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long id;
|
||||||
|
/** 项目id */
|
||||||
|
@ApiModelProperty(value = "项目id")
|
||||||
|
private Long projectId;
|
||||||
|
/** 项目归档时间 */
|
||||||
|
@ApiModelProperty(value = "项目归档时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private LocalDateTime archiveDate;
|
||||||
|
/** 项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警 */
|
||||||
|
@ApiModelProperty(value = "项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警")
|
||||||
|
private String waringStatus;
|
||||||
|
/** 预警开始时间 */
|
||||||
|
@ApiModelProperty(value = "预警开始时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private LocalDateTime waringStartTime;
|
||||||
|
/** 重新评估时间 */
|
||||||
|
@ApiModelProperty(value = "重新评估时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private LocalDateTime reassessmentDate;
|
||||||
|
/** 周期年份 */
|
||||||
|
@ApiModelProperty(value = "周期年份")
|
||||||
|
private Long cycleDate;
|
||||||
|
/** 环境 */
|
||||||
|
@ApiModelProperty(value = "环境")
|
||||||
|
private String env;
|
||||||
|
/** 项目节点完成进度 */
|
||||||
|
@ApiModelProperty(value = "项目节点完成进度")
|
||||||
|
private String projectNode;
|
||||||
|
/** 所属行业编码(见 IndustryEnum) */
|
||||||
|
@ApiModelProperty(value = "所属行业编码(见 IndustryEnum)")
|
||||||
|
private String industryCode;
|
||||||
|
@ApiModelProperty(value = "version")
|
||||||
|
private Integer version;
|
||||||
|
}
|
||||||
|
|
@ -32,10 +32,6 @@ public class QualOnSiteReviewFileE extends BaseE {
|
||||||
* 文件url
|
* 文件url
|
||||||
*/
|
*/
|
||||||
private String url;
|
private String url;
|
||||||
/**
|
|
||||||
* 审查意见
|
|
||||||
*/
|
|
||||||
private String reviewOpinion;
|
|
||||||
/**
|
/**
|
||||||
* 环境
|
* 环境
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package org.qinan.safetyeval.domain.waring.ability;
|
||||||
|
|
||||||
|
import org.qinan.safetyeval.domain.waring.ability.EvalProjectWaringAbility;
|
||||||
|
import org.qinan.safetyeval.domain.waring.gateway.EvalProjectWaringGateway;
|
||||||
|
import org.qinan.safetyeval.domain.waring.model.EvalProjectWaringE;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringAbility{
|
||||||
|
/**网关**/
|
||||||
|
private final EvalProjectWaringGateway evalProjectWaringGateway;
|
||||||
|
|
||||||
|
|
||||||
|
public boolean deletedEvalProjectWaringById(Long id) {
|
||||||
|
return evalProjectWaringGateway.deletedEvalProjectWaringById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean deletedEvalProjectWaringByIds(Long[] ids) {
|
||||||
|
return evalProjectWaringGateway.deletedEvalProjectWaringByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package org.qinan.safetyeval.domain.waring.gateway;
|
||||||
|
|
||||||
|
import org.qinan.safetyeval.domain.waring.model.EvalProjectWaringE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警网关
|
||||||
|
* @Author: WGG
|
||||||
|
* @Date: 2022/3/22 16:49
|
||||||
|
*/
|
||||||
|
public interface EvalProjectWaringGateway {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目预警
|
||||||
|
* @param evalProjectWaringE 项目预警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean add(EvalProjectWaringE evalProjectWaringE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目预警
|
||||||
|
* @param evalProjectWaringE 项目预警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean update(EvalProjectWaringE evalProjectWaringE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目预警
|
||||||
|
* @param id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean deletedEvalProjectWaringById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目预警
|
||||||
|
* @param ids
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean deletedEvalProjectWaringByIds(Long[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package org.qinan.safetyeval.domain.waring.model;
|
||||||
|
|
||||||
|
import com.alibaba.cola.domain.Entity;
|
||||||
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
|
import com.alibaba.cola.domain.DomainFactory;
|
||||||
|
import com.jjb.saas.framework.enums.enums.BooleanEnum;
|
||||||
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
|
import org.qinan.safetyeval.domain.waring.gateway.EvalProjectWaringGateway;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
/**
|
||||||
|
* 项目预警领域模型
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class EvalProjectWaringE extends BaseE{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 项目id */
|
||||||
|
private Long projectId;
|
||||||
|
/** 项目归档时间 */
|
||||||
|
private LocalDateTime archiveDate;
|
||||||
|
/** 项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警 */
|
||||||
|
private String waringStatus;
|
||||||
|
/** 预警开始时间 */
|
||||||
|
private LocalDateTime waringStartTime;
|
||||||
|
/** 重新评估时间 */
|
||||||
|
private LocalDateTime reassessmentDate;
|
||||||
|
/** 周期年份 */
|
||||||
|
private Long cycleDate;
|
||||||
|
/** 环境 */
|
||||||
|
private String env;
|
||||||
|
/** 项目节点完成进度 */
|
||||||
|
private String projectNode;
|
||||||
|
/** 所属行业编码(见 IndustryEnum) */
|
||||||
|
private String industryCode;
|
||||||
|
private transient EvalProjectWaringGateway evalProjectWaringGateway;
|
||||||
|
|
||||||
|
public EvalProjectWaringE(){
|
||||||
|
this. evalProjectWaringGateway = SpringUtil.getBean(EvalProjectWaringGateway.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EvalProjectWaringE of(){
|
||||||
|
return DomainFactory.create(EvalProjectWaringE.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean add(){
|
||||||
|
return evalProjectWaringGateway.add(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean update(){
|
||||||
|
return evalProjectWaringGateway.update(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package org.qinan.safetyeval.infrastructure.convertor;
|
||||||
|
|
||||||
|
import org.qinan.safetyeval.client.waring.response.EvalProjectWaringCo;
|
||||||
|
import java.util.List;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
import org.qinan.safetyeval.domain.waring.model.EvalProjectWaringE;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警对象转换
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface EvalProjectWaringDoConvertor {
|
||||||
|
/**
|
||||||
|
* 领域对象转DO
|
||||||
|
* @param evalProjectWaringE
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
EvalProjectWaringDO convertEeToDo(EvalProjectWaringE evalProjectWaringE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DO转Co
|
||||||
|
* @param evalProjectWaringDo DO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
EvalProjectWaringCo converDoToCo(EvalProjectWaringDO evalProjectWaringDo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qry TO DO
|
||||||
|
* @param evalProjectWaringPageQry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
EvalProjectWaringDO convertQryToDo(EvalProjectWaringPageQry evalProjectWaringPageQry);
|
||||||
|
/**
|
||||||
|
* DOs转Cos
|
||||||
|
* @param evalProjectWaringDos dos
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EvalProjectWaringCo> converDosToCos(List<EvalProjectWaringDO> evalProjectWaringDos);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package org.qinan.safetyeval.infrastructure.gateway;
|
||||||
|
|
||||||
|
import org.qinan.safetyeval.domain.waring.gateway.EvalProjectWaringGateway;
|
||||||
|
import org.qinan.safetyeval.domain.waring.model.EvalProjectWaringE;
|
||||||
|
import org.qinan.safetyeval.infrastructure.convertor.EvalProjectWaringDoConvertor;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.repository.EvalProjectWaringRepository;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
/**
|
||||||
|
* 项目预警网关实现
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringGatewayImpl implements EvalProjectWaringGateway {
|
||||||
|
private final EvalProjectWaringRepository evalProjectWaringRepository;
|
||||||
|
private final EvalProjectWaringDoConvertor evalProjectWaringDoConvertor;
|
||||||
|
@Override
|
||||||
|
public Boolean add(EvalProjectWaringE evalProjectWaringE) {
|
||||||
|
EvalProjectWaringDO evalProjectWaringDO = evalProjectWaringDoConvertor.convertEeToDo(evalProjectWaringE);
|
||||||
|
boolean res = evalProjectWaringRepository.addEvalProjectWaring(evalProjectWaringDO);
|
||||||
|
if(res){
|
||||||
|
evalProjectWaringE.setId(evalProjectWaringDO.getId());
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(EvalProjectWaringE evalProjectWaringE) {
|
||||||
|
boolean res = evalProjectWaringRepository.updateEvalProjectWaring(evalProjectWaringDoConvertor.convertEeToDo(evalProjectWaringE));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedEvalProjectWaringById(Long id) {
|
||||||
|
return evalProjectWaringRepository.deletedEvalProjectWaringById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedEvalProjectWaringByIds(Long[] ids) {
|
||||||
|
return evalProjectWaringRepository.deletedEvalProjectWaringByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package org.qinan.safetyeval.infrastructure.persistence.domainobject;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警领域模型
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("eval_project_waring")
|
||||||
|
public class EvalProjectWaringDO extends BaseDO {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 项目id */
|
||||||
|
private Long projectId;
|
||||||
|
/** 项目归档时间 */
|
||||||
|
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime archiveDate;
|
||||||
|
/** 项目 预警 状态: non_warn 暂时不预警,first_waring 首次预警,second_waring 二次预警,emergency_waring 紧急预警,overdue_warning 逾期预警 ,end_warning 结束预警 */
|
||||||
|
private String waringStatus;
|
||||||
|
/** 预警开始时间 */
|
||||||
|
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime waringStartTime;
|
||||||
|
/** 重新评估时间 */
|
||||||
|
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime reassessmentDate;
|
||||||
|
/** 周期年份 */
|
||||||
|
private Long cycleDate;
|
||||||
|
/** 环境 */
|
||||||
|
private String env;
|
||||||
|
/** 项目节点完成进度 */
|
||||||
|
private String projectNode;
|
||||||
|
/** 所属行业编码(见 IndustryEnum) */
|
||||||
|
private String industryCode;
|
||||||
|
}
|
||||||
|
|
@ -29,10 +29,6 @@ public class QualOnSiteReviewFileDO extends BaseDO {
|
||||||
* 文件url
|
* 文件url
|
||||||
*/
|
*/
|
||||||
private String url;
|
private String url;
|
||||||
/**
|
|
||||||
* 审查意见
|
|
||||||
*/
|
|
||||||
private String reviewOpinion;
|
|
||||||
/**
|
/**
|
||||||
* 环境
|
* 环境
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.qinan.safetyeval.infrastructure.persistence.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警Mapper
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface EvalProjectWaringMapper extends BaseMapper<EvalProjectWaringDO> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package org.qinan.safetyeval.infrastructure.persistence.queryservice;
|
||||||
|
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import org.qinan.safetyeval.client.waring.response.EvalProjectWaringCo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
public interface EvalProjectWaringQueryService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查找
|
||||||
|
* @param id 项目预警ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
EvalProjectWaringDO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询项目预警
|
||||||
|
* @param evalProjectWaringPageQry 分页Qry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageResponse<EvalProjectWaringCo> listEvalProjectWaringPage(EvalProjectWaringPageQry evalProjectWaringPageQry);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package org.qinan.safetyeval.infrastructure.persistence.queryservice.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.jjb.saas.framework.enums.enums.BooleanEnum;
|
||||||
|
import org.qinan.safetyeval.infrastructure.convertor.EvalProjectWaringDoConvertor;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.repository.EvalProjectWaringRepository;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.queryservice.EvalProjectWaringQueryService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import org.qinan.safetyeval.client.waring.response.EvalProjectWaringCo;
|
||||||
|
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringQueryServiceImpl implements EvalProjectWaringQueryService {
|
||||||
|
|
||||||
|
private final EvalProjectWaringRepository evalProjectWaringRepository;
|
||||||
|
private final EvalProjectWaringDoConvertor evalProjectWaringDoConvertor;
|
||||||
|
@Override
|
||||||
|
public EvalProjectWaringDO getById(Long id) {
|
||||||
|
return evalProjectWaringRepository.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<EvalProjectWaringCo> listEvalProjectWaringPage(EvalProjectWaringPageQry evalProjectWaringPageQry) {
|
||||||
|
IPage<EvalProjectWaringDO> evalProjectWaringDoPage = evalProjectWaringRepository.listEvalProjectWaringPage(PageHelper.queryToPage(evalProjectWaringPageQry),evalProjectWaringPageQry);
|
||||||
|
List<EvalProjectWaringCo> evalProjectWaringCoS = evalProjectWaringDoConvertor.converDosToCos(evalProjectWaringDoPage.getRecords());
|
||||||
|
return PageHelper.pageToResponse(evalProjectWaringDoPage,evalProjectWaringCoS);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package org.qinan.safetyeval.infrastructure.persistence.repository;
|
||||||
|
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
public interface EvalProjectWaringRepository extends BaseRepository<EvalProjectWaringDO>{
|
||||||
|
/**
|
||||||
|
* 根据ID查找
|
||||||
|
* @param id 项目预警ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
EvalProjectWaringDO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查找项目预警对象
|
||||||
|
* @param iPage 分页对象
|
||||||
|
* @param evalProjectWaringPageQry 条件对象
|
||||||
|
* @return ipage
|
||||||
|
*/
|
||||||
|
IPage<EvalProjectWaringDO> listEvalProjectWaringPage(IPage iPage,EvalProjectWaringPageQry evalProjectWaringPageQry);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目预警
|
||||||
|
* @param evalProjectWaringDO 项目预警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean addEvalProjectWaring(EvalProjectWaringDO evalProjectWaringDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改项目预警
|
||||||
|
* @param evalProjectWaringDO 项目预警
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean updateEvalProjectWaring(EvalProjectWaringDO evalProjectWaringDO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目预警
|
||||||
|
* @param id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean deletedEvalProjectWaringById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除项目预警
|
||||||
|
* @param ids
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean deletedEvalProjectWaringByIds(Long[] ids);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
package org.qinan.safetyeval.infrastructure.persistence.repository.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.jjb.saas.framework.enums.enums.BooleanEnum;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.qinan.safetyeval.client.waring.request.EvalProjectWaringPageQry;
|
||||||
|
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.mapper.EvalProjectWaringMapper;
|
||||||
|
import org.qinan.safetyeval.infrastructure.persistence.repository.EvalProjectWaringRepository;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目预警
|
||||||
|
* @Author: ltq
|
||||||
|
* @date 2026-07-22 12:00:49
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class EvalProjectWaringRepositoryImpl extends BaseRepositoryImpl<EvalProjectWaringMapper,EvalProjectWaringDO> implements EvalProjectWaringRepository {
|
||||||
|
|
||||||
|
private final EvalProjectWaringMapper evalProjectWaringMapper;
|
||||||
|
@Override
|
||||||
|
public EvalProjectWaringDO getById(Long id) {
|
||||||
|
return super.lambdaQuery().eq(EvalProjectWaringDO::getId,id).eq(EvalProjectWaringDO::getDeleteEnum,BooleanEnum.FALSE.getValue()).one();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<EvalProjectWaringDO> listEvalProjectWaringPage(IPage iPage, EvalProjectWaringPageQry evalProjectWaringPageQry) {
|
||||||
|
QueryWrapper<EvalProjectWaringDO> evalProjectWaringDoQueryWrapper = new QueryWrapper<>();
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getProjectId())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("project_id",evalProjectWaringPageQry.getProjectId());
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getArchiveDate())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("archive_date",evalProjectWaringPageQry.getArchiveDate());
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getWaringStatus())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("waring_status",evalProjectWaringPageQry.getWaringStatus());
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getWaringStartTime())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("waring_start_time",evalProjectWaringPageQry.getWaringStartTime());
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getReassessmentDate())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("reassessment_date",evalProjectWaringPageQry.getReassessmentDate());
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getCycleDate())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("cycle_date",evalProjectWaringPageQry.getCycleDate());
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getEnv())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("env",evalProjectWaringPageQry.getEnv());
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getProjectNode())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("project_node",evalProjectWaringPageQry.getProjectNode());
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isNotEmpty(evalProjectWaringPageQry.getIndustryCode())){
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("industry_code",evalProjectWaringPageQry.getIndustryCode());
|
||||||
|
}
|
||||||
|
evalProjectWaringDoQueryWrapper.eq("delete_enum", BooleanEnum.FALSE.getValue());
|
||||||
|
return evalProjectWaringMapper.selectPage(iPage,evalProjectWaringDoQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addEvalProjectWaring(EvalProjectWaringDO evalProjectWaringDO) {
|
||||||
|
return super.save(evalProjectWaringDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateEvalProjectWaring(EvalProjectWaringDO evalProjectWaringDO) {
|
||||||
|
return super.updateById(evalProjectWaringDO);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Boolean deletedEvalProjectWaringById(Long id) {
|
||||||
|
return super.removeEnById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedEvalProjectWaringByIds(Long[] ids) {
|
||||||
|
return super.removeBatchEnByIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.qinan.safetyeval.infrastructure.persistence.mapper.EvalProjectWaringMapper">
|
||||||
|
|
||||||
|
<resultMap type="org.qinan.safetyeval.infrastructure.persistence.domainobject.EvalProjectWaringDO" id="EvalProjectWaringResult">
|
||||||
|
<id property="id" column="id" />
|
||||||
|
<result property="orgId" column="org_id" />
|
||||||
|
<result property="projectId" column="project_id" />
|
||||||
|
<result property="archiveDate" column="archive_date" />
|
||||||
|
<result property="waringStatus" column="waring_status" />
|
||||||
|
<result property="waringStartTime" column="waring_start_time" />
|
||||||
|
<result property="reassessmentDate" column="reassessment_date" />
|
||||||
|
<result property="cycleDate" column="cycle_date" />
|
||||||
|
<result property="deleteEnum" column="delete_enum" />
|
||||||
|
<result property="remarks" column="remarks" />
|
||||||
|
<result property="createName" column="create_name" />
|
||||||
|
<result property="updateName" column="update_name" />
|
||||||
|
<result property="tenantId" column="tenant_id" />
|
||||||
|
<result property="version" column="version" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="createId" column="create_id" />
|
||||||
|
<result property="updateId" column="update_id" />
|
||||||
|
<result property="env" column="env" />
|
||||||
|
<result property="projectNode" column="project_node" />
|
||||||
|
<result property="industryCode" column="industry_code" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectEvalProjectWaring">
|
||||||
|
select id, org_id, project_id, archive_date, waring_status, waring_start_time, reassessment_date, cycle_date, delete_enum, remarks, create_name, update_name, tenant_id, version, create_time, update_time, create_id, update_id, env, project_node, industry_code from eval_project_waring
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue