资料库代码提交
This commit is contained in:
@@ -26,6 +26,7 @@ public enum SupervisionResponseEnum {
|
|||||||
IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
|
IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
|
||||||
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
||||||
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
||||||
|
NAME_EXISTS("A00550","名称重复"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.njcn.supervision.pojo.param.databank;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:16【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LibAlgorithmParam extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="上级id")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 算法名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message ="名称不能为空")
|
||||||
|
@ApiModelProperty(value="算法名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="定义")
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算周期(0日,1月,2季,3年)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="计算周期(0日,1月,2季,3年)")
|
||||||
|
private String period;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据来源(单体,数据中台....)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="数据来源(单体,数据中台....)")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
private Integer useFLag;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class LibAlgorithmParamUpdate extends LibAlgorithmParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package com.njcn.supervision.pojo.param.databank;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@ApiModel(description="")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LibCaseParam extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="事件名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生事件类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="发生事件类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生地点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="发生地点")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件简介
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="事件简介")
|
||||||
|
private String summary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件经过
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="事件经过")
|
||||||
|
private String process;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理措施
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="处理措施")
|
||||||
|
private String measures;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理效果
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="治理效果")
|
||||||
|
private String effect;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="附件地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 示范案例地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="示范案例地址")
|
||||||
|
private String caseUrl;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class LibCaseParamUpdate extends LibCaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class LibCaseParamQuery extends BaseParam {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.njcn.supervision.pojo.param.databank;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LibStandardParam extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="上级id")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message ="名称不能为空")
|
||||||
|
@ApiModelProperty(value="名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="文件地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class LibStandardParamUpdate extends LibStandardParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.njcn.supervision.pojo.param.databank;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@ApiModel(description="")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LibTemplateParam extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="模板名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="文件地址")
|
||||||
|
private String url;
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class LibTemplateParamUpdate extends LibTemplateParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class LibTemplateParamQuery extends BaseParam {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.njcn.supervision.pojo.po.databank;
|
||||||
|
|
||||||
|
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.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:16【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "lib_algorithm")
|
||||||
|
public class LibAlgorithm extends BaseEntity {
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级id
|
||||||
|
*/
|
||||||
|
@TableField(value = "pid")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级id集合
|
||||||
|
*/
|
||||||
|
@TableField(value = "pids")
|
||||||
|
private String pids;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 算法名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义
|
||||||
|
*/
|
||||||
|
@TableField(value = "`definition`")
|
||||||
|
private String definition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算周期(0日,1月,2季,3年)
|
||||||
|
*/
|
||||||
|
@TableField(value = "period")
|
||||||
|
private String period;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据来源(单体,数据中台....)
|
||||||
|
*/
|
||||||
|
@TableField(value = "source")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(字典 1正常 0停用)
|
||||||
|
*/
|
||||||
|
@TableField(value = "use_flag")
|
||||||
|
private Integer useFLag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(字典 1正常 0删除)
|
||||||
|
*/
|
||||||
|
@TableField(value = "`status`")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子类
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<LibAlgorithm> children;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.njcn.supervision.pojo.po.databank;
|
||||||
|
|
||||||
|
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.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "lib_case")
|
||||||
|
public class LibCase extends BaseEntity {
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生事件类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生地点
|
||||||
|
*/
|
||||||
|
@TableField(value = "location")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件简介
|
||||||
|
*/
|
||||||
|
@TableField(value = "summary")
|
||||||
|
private String summary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件经过
|
||||||
|
*/
|
||||||
|
@TableField(value = "process")
|
||||||
|
private String process;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理措施
|
||||||
|
*/
|
||||||
|
@TableField(value = "measures")
|
||||||
|
private String measures;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理效果
|
||||||
|
*/
|
||||||
|
@TableField(value = "effect")
|
||||||
|
private String effect;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件地址
|
||||||
|
*/
|
||||||
|
@TableField(value = "url")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 示范案例地址
|
||||||
|
*/
|
||||||
|
@TableField(value = "case_url")
|
||||||
|
private String caseUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(字典 1正常 删除)
|
||||||
|
*/
|
||||||
|
@TableField(value = "`status`")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.njcn.supervision.pojo.po.databank;
|
||||||
|
|
||||||
|
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.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "lib_standard")
|
||||||
|
public class LibStandard extends BaseEntity {
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上级id
|
||||||
|
*/
|
||||||
|
@TableField(value = "pid")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级id集合
|
||||||
|
*/
|
||||||
|
@TableField(value = "pids")
|
||||||
|
private String pids;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
@TableField(value = "url")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(字典 1正常 删除)
|
||||||
|
*/
|
||||||
|
@TableField(value = "`status`")
|
||||||
|
private Integer status;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<LibStandard> children;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.njcn.supervision.pojo.po.databank;
|
||||||
|
|
||||||
|
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.njcn.db.bo.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@ApiModel(description="")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "lib_template")
|
||||||
|
public class LibTemplate extends BaseEntity {
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
@TableField(value = "url")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(字典 1正常 删除)
|
||||||
|
*/
|
||||||
|
@TableField(value = "`status`")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.njcn.supervision.controller.databank;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibAlgorithmParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibAlgorithm;
|
||||||
|
import com.njcn.supervision.service.databank.LibAlgorithmService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:26【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/libalgorithm")
|
||||||
|
@Api(tags = "算法库")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LibAlgorithmController extends BaseController {
|
||||||
|
|
||||||
|
private final LibAlgorithmService libAlgorithmService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增")
|
||||||
|
@ApiImplicitParam(name = "libAlgorithmParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<LibAlgorithm> add(@RequestBody @Validated LibAlgorithmParam libAlgorithmParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LibAlgorithm add = libAlgorithmService.add(libAlgorithmParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, add, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/updateAlgorithmLibrary")
|
||||||
|
@ApiOperation("更新")
|
||||||
|
@ApiImplicitParam(name = "paramUpdate", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> updateAlgorithmLibrary(@RequestBody @Validated LibAlgorithmParam.LibAlgorithmParamUpdate paramUpdate) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateAlgorithmLibrary");
|
||||||
|
String id = libAlgorithmService.updateAlgorithmLibrary(paramUpdate);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.QUERY)
|
||||||
|
@GetMapping("/queryAllAlgorithmLibrary")
|
||||||
|
@ApiOperation("查询所有算法库树结构")
|
||||||
|
public HttpResult<List<LibAlgorithm>> queryAllAlgorithmLibrary() {
|
||||||
|
String methodDescribe = getMethodDescribe("queryAll");
|
||||||
|
List<LibAlgorithm> result = libAlgorithmService.queryAll();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.QUERY)
|
||||||
|
@GetMapping("/queryById")
|
||||||
|
@ApiOperation("根据id查询")
|
||||||
|
public HttpResult<LibAlgorithm> queryById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryById");
|
||||||
|
LibAlgorithm result = libAlgorithmService.lambdaQuery().eq(LibAlgorithm::getId,id).one();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
|
||||||
|
@GetMapping("/deleteyById")
|
||||||
|
@ApiOperation("通过id删除")
|
||||||
|
public HttpResult<Boolean> deleteyById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("deleteyById");
|
||||||
|
boolean update = libAlgorithmService.lambdaUpdate().set(LibAlgorithm::getStatus, 0).eq(LibAlgorithm::getId, id).update();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.njcn.supervision.controller.databank;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibCaseParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibCase;
|
||||||
|
import com.njcn.supervision.service.databank.LibCaseService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 16:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/libcase")
|
||||||
|
@Api(tags = "案例库")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LibCaseController extends BaseController {
|
||||||
|
|
||||||
|
private final LibCaseService libCaseService;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增")
|
||||||
|
@ApiImplicitParam(name = "libCaseParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<LibCase> add(@RequestBody @Validated LibCaseParam libCaseParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LibCase add = libCaseService.add(libCaseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, add, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/addStandardCase")
|
||||||
|
@ApiOperation("新增标准案例")
|
||||||
|
public HttpResult<String> addStandardCase(@RequestParam String caseUrl) {
|
||||||
|
String methodDescribe = getMethodDescribe("addStandardCase");
|
||||||
|
redisUtil.saveByKey("StandardCase",caseUrl);
|
||||||
|
String fileUrl = fileStorageUtil.getFileUrl(caseUrl);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, fileUrl, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.QUERY)
|
||||||
|
@PostMapping("/queryStandardCase")
|
||||||
|
@ApiOperation("获取标准案例")
|
||||||
|
public HttpResult<String> queryStandardCase() {
|
||||||
|
String methodDescribe = getMethodDescribe("queryStandardCase");
|
||||||
|
String standardCase = redisUtil.getStringByKey("StandardCase");
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, standardCase, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/updateCaseLibrary")
|
||||||
|
@ApiOperation("更新")
|
||||||
|
@ApiImplicitParam(name = "paramUpdate", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> updateCaseLibrary(@RequestBody @Validated LibCaseParam.LibCaseParamUpdate paramUpdate) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateCaseLibrary");
|
||||||
|
String id = libCaseService.updateCaseLibrary(paramUpdate);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
|
||||||
|
@GetMapping("/deleteyById")
|
||||||
|
@ApiOperation("通过id删除")
|
||||||
|
public HttpResult<Boolean> deleteyById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("deleteyById");
|
||||||
|
boolean update = libCaseService.lambdaUpdate().set(LibCase::getStatus, 0).eq(LibCase::getId, id).update();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.QUERY)
|
||||||
|
@GetMapping("/queryById")
|
||||||
|
@ApiOperation("根据id查询")
|
||||||
|
public HttpResult<LibCase> queryById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryById");
|
||||||
|
LibCase result = libCaseService.lambdaQuery().eq(LibCase::getId,id).one();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/pageQuery")
|
||||||
|
@ApiOperation("分页查询案例库")
|
||||||
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<LibCase>> pageQuery(@RequestBody @Validated LibCaseParam.LibCaseParamQuery param) {
|
||||||
|
String methodDescribe = getMethodDescribe("pageQuery");
|
||||||
|
Page<LibCase> list = libCaseService.pageQuery(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.njcn.supervision.controller.databank;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibStandardParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibStandard;
|
||||||
|
import com.njcn.supervision.service.databank.LibStandardService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 16:26【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/libstandard")
|
||||||
|
@Api(tags = "标准库")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LibStandardController extends BaseController {
|
||||||
|
|
||||||
|
private final LibStandardService libStandardService;
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增")
|
||||||
|
@ApiImplicitParam(name = "libStandardParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<LibStandard> add(@RequestBody @Validated LibStandardParam libStandardParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LibStandard add = libStandardService.add(libStandardParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, add, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/updateStandardLibrary")
|
||||||
|
@ApiOperation("更新")
|
||||||
|
@ApiImplicitParam(name = "paramUpdate", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> updateStandardLibrary(@RequestBody @Validated LibStandardParam.LibStandardParamUpdate paramUpdate) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateStandardLibrary");
|
||||||
|
String id = libStandardService.updateStandardLibrary(paramUpdate);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
|
||||||
|
@GetMapping("/deleteyById")
|
||||||
|
@ApiOperation("通过id删除")
|
||||||
|
public HttpResult<Boolean> deleteyById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("deleteyById");
|
||||||
|
boolean update = libStandardService.lambdaUpdate().set(LibStandard::getStatus, 0).eq(LibStandard::getId, id).update();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.QUERY)
|
||||||
|
@GetMapping("/queryById")
|
||||||
|
@ApiOperation("根据id查询")
|
||||||
|
public HttpResult<LibStandard> queryById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryById");
|
||||||
|
LibStandard result = libStandardService.lambdaQuery().eq(LibStandard::getId,id).one();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.QUERY)
|
||||||
|
@GetMapping("/queryAll")
|
||||||
|
@ApiOperation("查询所有标准库树结构")
|
||||||
|
public HttpResult<List<LibStandard>> queryAll() {
|
||||||
|
String methodDescribe = getMethodDescribe("queryAll");
|
||||||
|
List<LibStandard> result = libStandardService.queryAll();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.njcn.supervision.controller.databank;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibTemplateParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibTemplate;
|
||||||
|
import com.njcn.supervision.service.databank.LibTemplateService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 16:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/libtemplate")
|
||||||
|
@Api(tags = "模版库")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LibTemplateController extends BaseController {
|
||||||
|
|
||||||
|
private final LibTemplateService libTemplateService;
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增")
|
||||||
|
@ApiImplicitParam(name = "libTemplateParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<LibTemplate> add(@RequestBody @Validated LibTemplateParam libTemplateParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LibTemplate add = libTemplateService.add(libTemplateParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, add, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/updateTemplate")
|
||||||
|
@ApiOperation("更新")
|
||||||
|
@ApiImplicitParam(name = "paramUpdate", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> updateTemplate(@RequestBody @Validated LibTemplateParam.LibTemplateParamUpdate paramUpdate) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateTemplate");
|
||||||
|
String id = libTemplateService.updateTemplate(paramUpdate);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
|
||||||
|
@GetMapping("/deleteyById")
|
||||||
|
@ApiOperation("通过id删除")
|
||||||
|
public HttpResult<Boolean> deleteyById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("deleteyById");
|
||||||
|
boolean update = libTemplateService.lambdaUpdate().set(LibTemplate::getStatus, 0).eq(LibTemplate::getId, id).update();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.QUERY)
|
||||||
|
@GetMapping("/queryById")
|
||||||
|
@ApiOperation("根据id查询")
|
||||||
|
public HttpResult<LibTemplate> queryById(@RequestParam("id") String id) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryById");
|
||||||
|
LibTemplate result = libTemplateService.lambdaQuery().eq(LibTemplate::getId,id).one();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/pageQuery")
|
||||||
|
@ApiOperation("分页查询案例库")
|
||||||
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<LibTemplate>> pageQuery(@RequestBody @Validated LibTemplateParam.LibTemplateParamQuery param) {
|
||||||
|
String methodDescribe = getMethodDescribe("pageQuery");
|
||||||
|
Page<LibTemplate> list = libTemplateService.pageQuery(param);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.supervision.mapper.databank;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibAlgorithm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:16【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface LibAlgorithmMapper extends BaseMapper<LibAlgorithm> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.supervision.mapper.databank;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibCase;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface LibCaseMapper extends BaseMapper<LibCase> {
|
||||||
|
Page<LibCase> page(Page<Object> objectPage, @Param("ew") QueryWrapper<LibCase> queryWrapper);
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.supervision.mapper.databank;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibStandard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface LibStandardMapper extends BaseMapper<LibStandard> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.supervision.mapper.databank;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibTemplate;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface LibTemplateMapper extends BaseMapper<LibTemplate> {
|
||||||
|
Page<LibTemplate> page(Page<Object> objectPage,@Param("ew") QueryWrapper<LibTemplate> queryWrapper);
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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="com.njcn.supervision.mapper.databank.LibAlgorithmMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?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="com.njcn.supervision.mapper.databank.LibCaseMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="page"
|
||||||
|
resultType="com.njcn.supervision.pojo.po.databank.LibCase">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM lib_case lib_case
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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="com.njcn.supervision.mapper.databank.LibStandardMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?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="com.njcn.supervision.mapper.databank.LibTemplateMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="page" resultType="com.njcn.supervision.pojo.po.databank.LibTemplate">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM lib_template lib_template
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.supervision.service.databank;
|
||||||
|
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibAlgorithmParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibAlgorithm;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:16【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface LibAlgorithmService extends IService<LibAlgorithm>{
|
||||||
|
|
||||||
|
|
||||||
|
LibAlgorithm add(LibAlgorithmParam libAlgorithmParam);
|
||||||
|
|
||||||
|
String updateAlgorithmLibrary(LibAlgorithmParam.LibAlgorithmParamUpdate paramUpdate);
|
||||||
|
|
||||||
|
List<LibAlgorithm> queryAll();
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.supervision.service.databank;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibCaseParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibCase;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface LibCaseService extends IService<LibCase>{
|
||||||
|
|
||||||
|
|
||||||
|
LibCase add(LibCaseParam libCaseParam);
|
||||||
|
|
||||||
|
String updateCaseLibrary(LibCaseParam.LibCaseParamUpdate paramUpdate);
|
||||||
|
|
||||||
|
Page<LibCase> pageQuery(LibCaseParam.LibCaseParamQuery param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.supervision.service.databank;
|
||||||
|
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibStandardParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibStandard;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface LibStandardService extends IService<LibStandard>{
|
||||||
|
|
||||||
|
|
||||||
|
LibStandard add(LibStandardParam libStandardParam);
|
||||||
|
|
||||||
|
String updateStandardLibrary(LibStandardParam.LibStandardParamUpdate paramUpdate);
|
||||||
|
|
||||||
|
List<LibStandard> queryAll();
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.supervision.service.databank;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibTemplateParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibTemplate;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface LibTemplateService extends IService<LibTemplate>{
|
||||||
|
|
||||||
|
|
||||||
|
LibTemplate add(LibTemplateParam libTemplateParam);
|
||||||
|
|
||||||
|
String updateTemplate(LibTemplateParam.LibTemplateParamUpdate paramUpdate);
|
||||||
|
|
||||||
|
Page<LibTemplate> pageQuery(LibTemplateParam.LibTemplateParamQuery param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.njcn.supervision.service.databank.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
|
import com.njcn.supervision.mapper.databank.LibAlgorithmMapper;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibAlgorithmParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibAlgorithm;
|
||||||
|
import com.njcn.supervision.service.databank.LibAlgorithmService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:16【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class LibAlgorithmServiceImpl extends ServiceImpl<LibAlgorithmMapper, LibAlgorithm> implements LibAlgorithmService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public LibAlgorithm add(LibAlgorithmParam libAlgorithmParam) {
|
||||||
|
|
||||||
|
checkName(libAlgorithmParam,false);
|
||||||
|
LibAlgorithm libAlgorithm = new LibAlgorithm();
|
||||||
|
BeanUtils.copyProperties(libAlgorithmParam, libAlgorithm);
|
||||||
|
libAlgorithm.setStatus(1);
|
||||||
|
if(StringUtils.isEmpty(libAlgorithmParam.getPid())){
|
||||||
|
libAlgorithm.setPid("0");
|
||||||
|
libAlgorithm.setPids("0");
|
||||||
|
}else {
|
||||||
|
LibAlgorithm fatherLibAlgorithm = this.lambdaQuery().eq(LibAlgorithm::getId, libAlgorithmParam.getPid()).one();
|
||||||
|
libAlgorithm.setPids(fatherLibAlgorithm.getPids() + "," + libAlgorithm.getPid());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.save(libAlgorithm);
|
||||||
|
return libAlgorithm;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkName(LibAlgorithmParam libAlgorithmParam, boolean isExcludeSelf) {
|
||||||
|
|
||||||
|
String pid =StringUtils.isEmpty(libAlgorithmParam.getPid())?"0":libAlgorithmParam.getPid();
|
||||||
|
|
||||||
|
LambdaQueryWrapper<LibAlgorithm> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgUserLambdaQueryWrapper
|
||||||
|
.eq(LibAlgorithm::getName, libAlgorithmParam.getName())
|
||||||
|
.eq(LibAlgorithm::getPid,pid)
|
||||||
|
.eq(LibAlgorithm::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (libAlgorithmParam instanceof LibAlgorithmParam.LibAlgorithmParamUpdate) {
|
||||||
|
sgUserLambdaQueryWrapper.ne(LibAlgorithm::getId, (( LibAlgorithmParam.LibAlgorithmParamUpdate) libAlgorithmParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(SupervisionResponseEnum.NAME_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String updateAlgorithmLibrary(LibAlgorithmParam.LibAlgorithmParamUpdate paramUpdate) {
|
||||||
|
checkName(paramUpdate,true);
|
||||||
|
LibAlgorithm libAlgorithm = new LibAlgorithm();
|
||||||
|
BeanUtil.copyProperties(paramUpdate, libAlgorithm);
|
||||||
|
this.updateById(libAlgorithm);
|
||||||
|
return libAlgorithm.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LibAlgorithm> queryAll() {
|
||||||
|
|
||||||
|
List<LibAlgorithm> libAlgorithmList = this.lambdaQuery().eq(LibAlgorithm::getStatus,1).list();
|
||||||
|
List<LibAlgorithm> tree = libAlgorithmList.stream().filter(item -> item.getPid().equals("0")).peek(item -> {
|
||||||
|
item.setChildren(getChildren(item, libAlgorithmList));
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
return tree;
|
||||||
|
}
|
||||||
|
private List<LibAlgorithm> getChildren(LibAlgorithm libAlgorithm, List<LibAlgorithm> all) {
|
||||||
|
return all.stream().filter(item -> item.getPid().equals(libAlgorithm.getId())).peek(item -> {
|
||||||
|
item.setChildren(getChildren(item, all));
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.njcn.supervision.service.databank.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
|
import com.njcn.supervision.mapper.databank.LibCaseMapper;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibCaseParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibCase;
|
||||||
|
import com.njcn.supervision.service.databank.LibCaseService;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LibCaseServiceImpl extends ServiceImpl<LibCaseMapper, LibCase> implements LibCaseService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public LibCase add(LibCaseParam libCaseParam) {
|
||||||
|
checkName(libCaseParam,false);
|
||||||
|
LibCase libCase = new LibCase();
|
||||||
|
BeanUtils.copyProperties(libCaseParam, libCase);
|
||||||
|
libCase.setStatus(1);
|
||||||
|
this.save(libCase);
|
||||||
|
return libCase;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkName(LibCaseParam libCaseParam, boolean isExcludeSelf) {
|
||||||
|
|
||||||
|
|
||||||
|
LambdaQueryWrapper<LibCase> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgUserLambdaQueryWrapper
|
||||||
|
.eq(LibCase::getName, libCaseParam.getName())
|
||||||
|
.eq(LibCase::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (libCaseParam instanceof LibCaseParam.LibCaseParamUpdate) {
|
||||||
|
sgUserLambdaQueryWrapper.ne(LibCase::getId, (( LibCaseParam.LibCaseParamUpdate) libCaseParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(SupervisionResponseEnum.NAME_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String updateCaseLibrary(LibCaseParam.LibCaseParamUpdate paramUpdate) {
|
||||||
|
|
||||||
|
checkName(paramUpdate,true);
|
||||||
|
|
||||||
|
LibCase libCase = new LibCase();
|
||||||
|
BeanUtil.copyProperties(paramUpdate, libCase);
|
||||||
|
this.updateById(libCase);
|
||||||
|
return libCase.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<LibCase> pageQuery(LibCaseParam.LibCaseParamQuery param) {
|
||||||
|
QueryWrapper<LibCase> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper.eq("lib_case.status",1);
|
||||||
|
//添加上时间范围
|
||||||
|
queryWrapper.between("lib_case.Create_Time",
|
||||||
|
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
|
||||||
|
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
|
||||||
|
queryWrapper.orderByDesc("lib_case.Update_Time");
|
||||||
|
Page<LibCase> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package com.njcn.supervision.service.databank.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
|
import com.njcn.supervision.mapper.databank.LibStandardMapper;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibStandardParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibStandard;
|
||||||
|
import com.njcn.supervision.service.databank.LibStandardService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LibStandardServiceImpl extends ServiceImpl<LibStandardMapper, LibStandard> implements LibStandardService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public LibStandard add(LibStandardParam libStandardParam) {
|
||||||
|
|
||||||
|
checkName(libStandardParam,false);
|
||||||
|
LibStandard libStandard = new LibStandard();
|
||||||
|
BeanUtils.copyProperties(libStandardParam, libStandard);
|
||||||
|
libStandard.setStatus(1);
|
||||||
|
if(StringUtils.isEmpty(libStandardParam.getPid())){
|
||||||
|
libStandard.setPid("0");
|
||||||
|
libStandard.setPids("0");
|
||||||
|
}else {
|
||||||
|
LibStandard fatherLibStandard = this.lambdaQuery().eq(LibStandard::getId, libStandardParam.getPid()).one();
|
||||||
|
libStandard.setPids(fatherLibStandard.getPids() + "," + libStandardParam.getPid());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.save(libStandard);
|
||||||
|
return libStandard;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkName(LibStandardParam libStandardParam, boolean isExcludeSelf) {
|
||||||
|
|
||||||
|
String pid =StringUtils.isEmpty(libStandardParam.getPid())?"0":libStandardParam.getPid();
|
||||||
|
|
||||||
|
LambdaQueryWrapper<LibStandard> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgUserLambdaQueryWrapper
|
||||||
|
.eq(LibStandard::getName, libStandardParam.getName())
|
||||||
|
.eq(LibStandard::getPid,pid)
|
||||||
|
.eq(LibStandard::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (libStandardParam instanceof LibStandardParam.LibStandardParamUpdate) {
|
||||||
|
sgUserLambdaQueryWrapper.ne(LibStandard::getId, (( LibStandardParam.LibStandardParamUpdate) libStandardParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(SupervisionResponseEnum.NAME_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String updateStandardLibrary(LibStandardParam.LibStandardParamUpdate paramUpdate) {
|
||||||
|
checkName(paramUpdate,true);
|
||||||
|
|
||||||
|
LibStandard libStandard = new LibStandard();
|
||||||
|
BeanUtil.copyProperties(paramUpdate, libStandard);
|
||||||
|
this.updateById(libStandard);
|
||||||
|
return libStandard.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LibStandard> queryAll() {
|
||||||
|
List<LibStandard> libStandardList = this.lambdaQuery().eq(LibStandard::getStatus,1).list();
|
||||||
|
List<LibStandard> tree = libStandardList.stream().filter(item -> item.getPid().equals("0")).peek(item -> {
|
||||||
|
item.setChildren(getChildren(item, libStandardList));
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
return tree;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<LibStandard> getChildren(LibStandard libStandard, List<LibStandard> all) {
|
||||||
|
return all.stream().filter(item -> item.getPid().equals(libStandard.getId())).peek(item -> {
|
||||||
|
item.setChildren(getChildren(item, all));
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.njcn.supervision.service.databank.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||||
|
import com.njcn.supervision.mapper.databank.LibTemplateMapper;
|
||||||
|
import com.njcn.supervision.pojo.param.databank.LibTemplateParam;
|
||||||
|
import com.njcn.supervision.pojo.po.databank.LibTemplate;
|
||||||
|
import com.njcn.supervision.service.databank.LibTemplateService;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/9/10 14:17【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LibTemplateServiceImpl extends ServiceImpl<LibTemplateMapper, LibTemplate> implements LibTemplateService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public LibTemplate add(LibTemplateParam libTemplateParam) {
|
||||||
|
checkName(libTemplateParam,false);
|
||||||
|
LibTemplate libTemplate = new LibTemplate();
|
||||||
|
BeanUtils.copyProperties(libTemplateParam, libTemplate);
|
||||||
|
libTemplate.setStatus(1);
|
||||||
|
this.save(libTemplate);
|
||||||
|
return libTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkName(LibTemplateParam libTemplateParam, boolean isExcludeSelf) {
|
||||||
|
|
||||||
|
|
||||||
|
LambdaQueryWrapper<LibTemplate> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgUserLambdaQueryWrapper
|
||||||
|
.eq(LibTemplate::getName, libTemplateParam.getName())
|
||||||
|
.eq(LibTemplate::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (libTemplateParam instanceof LibTemplateParam.LibTemplateParamUpdate) {
|
||||||
|
sgUserLambdaQueryWrapper.ne(LibTemplate::getId, (( LibTemplateParam.LibTemplateParamUpdate) libTemplateParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(SupervisionResponseEnum.NAME_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String updateTemplate(LibTemplateParam.LibTemplateParamUpdate paramUpdate) {
|
||||||
|
checkName(paramUpdate,true);
|
||||||
|
|
||||||
|
LibTemplate libTemplate = new LibTemplate();
|
||||||
|
BeanUtil.copyProperties(paramUpdate, libTemplate);
|
||||||
|
this.updateById(libTemplate);
|
||||||
|
return libTemplate.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<LibTemplate> pageQuery(LibTemplateParam.LibTemplateParamQuery param) {
|
||||||
|
QueryWrapper<LibTemplate> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper.eq("lib_template.status",1);
|
||||||
|
//添加上时间范围
|
||||||
|
queryWrapper.between("lib_template.Create_Time",
|
||||||
|
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
|
||||||
|
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
|
||||||
|
queryWrapper.orderByDesc("lib_template.Update_Time");
|
||||||
|
Page<LibTemplate> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user