暂降治理一期工作内容+1
This commit is contained in:
@@ -31,16 +31,28 @@ public enum AdvanceResponseEnum {
|
|||||||
RESPONSIBILITY_PARAMETER_ERROR("A0101","调用接口程序计算失败,参数非法"),
|
RESPONSIBILITY_PARAMETER_ERROR("A0101","调用接口程序计算失败,参数非法"),
|
||||||
|
|
||||||
EVENT_EMPTY("A0102","没有查询到未分析事件"),
|
EVENT_EMPTY("A0102","没有查询到未分析事件"),
|
||||||
|
|
||||||
USER_NAME_EXIST("A0103","用户名已存在"),
|
USER_NAME_EXIST("A0103","用户名已存在"),
|
||||||
|
|
||||||
DATA_NOT_FOUND("A0104","数据缺失,请根据模版上传近两周数据"),
|
DATA_NOT_FOUND("A0104","数据缺失,请根据模版上传近两周数据"),
|
||||||
|
|
||||||
DATA_UNDERRUN("A0104","数据量不足,请根据模版上传充足近两周数据"),
|
DATA_UNDERRUN("A0104","数据量不足,请根据模版上传充足近两周数据"),
|
||||||
|
|
||||||
DOCUMENT_FORMAT_ERROR("A0105","数据缺失,导入失败!请检查导入文档的格式是否正确"),
|
DOCUMENT_FORMAT_ERROR("A0105","数据缺失,导入失败!请检查导入文档的格式是否正确"),
|
||||||
|
|
||||||
USER_LOST("A0106","干扰源用户缺失"),
|
USER_LOST("A0106","干扰源用户缺失"),
|
||||||
UNCOMPLETE_STRATEGY("A0106","配置安全,III级预警,II级预警,I级预警4条完整策略"),
|
UNCOMPLETE_STRATEGY("A0106","配置安全,III级预警,II级预警,I级预警4条完整策略"),
|
||||||
EXISTENCE_EVALUATION_RESULT("A0104","存在评结果结果,如要评估,请删除后评估"),
|
EXISTENCE_EVALUATION_RESULT("A0104","存在评结果结果,如要评估,请删除后评估"),
|
||||||
|
|
||||||
SG_USER_NAME_REPEAT("A0102","业务用户名重复"),
|
SG_USER_NAME_REPEAT("A0102","业务用户名重复"),
|
||||||
|
|
||||||
|
SG_PRODUCT_LINE_NAME_REPEAT("A0102","生产线名重复"),
|
||||||
|
|
||||||
SG_USER_ID_MISS("A0102","业务用户id缺失"),
|
SG_USER_ID_MISS("A0102","业务用户id缺失"),
|
||||||
|
|
||||||
|
SG_PRODUCT_LINE_ID_MISS("A0102","生产线id缺失"),
|
||||||
|
|
||||||
|
SG_MACHINE_ID_MISS("A0102","设备id缺失"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -47,19 +47,19 @@ public class SgEventParam {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty("持续时间")
|
@ApiModelProperty("持续时间")
|
||||||
@NotNull(message = ValidMessage.MISS_PREFIX + "duration")
|
@NotNull(message = ValidMessage.MISS_PREFIX + "duration")
|
||||||
private Float duration;
|
private Double duration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征幅值
|
* 特征幅值
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("特征幅值")
|
@ApiModelProperty("特征幅值")
|
||||||
@NotNull(message = ValidMessage.MISS_PREFIX + "featureAmplitude")
|
@NotNull(message = ValidMessage.MISS_PREFIX + "featureAmplitude")
|
||||||
private Float featureAmplitude;
|
private Double featureAmplitude;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预估损失(单位:万元)
|
* 预估损失(单位:万元)
|
||||||
*/
|
*/
|
||||||
private Float estimatedLoss;
|
private Double estimatedLoss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事件描述
|
* 事件描述
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.njcn.advance.pojo.param.govern.voltage;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SgMachineParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("生产线id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "productLineId")
|
||||||
|
private String productLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("设备名称")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备型号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("设备型号")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已安装补偿装置进行治理,默认为0(0 否;1 是)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("是否已安装补偿装置")
|
||||||
|
private Integer governFlag = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的设备损失(默认为0)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("中断导致的设备损失")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "machineLoss")
|
||||||
|
private Double machineLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的原料损失(默认为0)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("中断导致的原料损失")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "materialLoss")
|
||||||
|
private Double materialLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功率(默认为0)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("功率")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "machinePower")
|
||||||
|
private Double machinePower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新操作实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SgMachineUpdateParam extends SgMachineParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表Id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SgMachineQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("生产线id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "productLineId")
|
||||||
|
private String productLineId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package com.njcn.advance.pojo.param.govern.voltage;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SgProductLineParam {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("业务用户id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "userId")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("进线id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "incomingLineId")
|
||||||
|
private String incomingLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("生产线名称")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算模式 0-模式一(单次中断不计算设备、原料损失);1-模式二(计算)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("计算模式")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "calcMode")
|
||||||
|
private Integer calcMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的产能损失(默认为0)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("中断导致的产能损失")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "capacityLoss")
|
||||||
|
private Double capacityLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新操作实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SgProductLineUpdateParam extends SgProductLineParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表Id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SgProductLineQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("业务用户id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "userId")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package com.njcn.advance.pojo.param.govern.voltage;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SgSensitiveUnitParam {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("设备id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "machineId")
|
||||||
|
private String machineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 元器件名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("元器件名称")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 灵敏度(0 平均,1 高,2 中,3 低)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("灵敏度")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "sensitivity")
|
||||||
|
private Integer sensitivity = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耐受能力是否为标准值(0 否,1 是)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("耐受能力是否为标准值(0 否,1 是)")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "standardFlag")
|
||||||
|
private Integer standardFlag = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上限曲线-持续时间(ms)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("上限曲线-持续时间(ms)")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "vtcTimeUpper")
|
||||||
|
private Double vtcTimeUpper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上限曲线-暂降幅值(p.u.)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("上限曲线-暂降幅值(p.u.)")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "vtcAmpUpper")
|
||||||
|
private Double vtcAmpUpper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下限曲线-持续时间(ms)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("下限曲线-持续时间(ms)")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "vtcTimeLower")
|
||||||
|
private Double vtcTimeLower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下限曲线-暂降幅值(p.u.)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("下限曲线-暂降幅值(p.u.)")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "vtcAmpLower")
|
||||||
|
private Double vtcAmpLower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新操作实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SgSensitiveUnitUpdateParam extends SgMachineParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表Id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SgSensitiveUnitQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("设备id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "machineId")
|
||||||
|
private String machineId;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,7 +60,7 @@ public class SgUserParam {
|
|||||||
* 年均损失(单位:万元)
|
* 年均损失(单位:万元)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("年均损失(单位:万元)")
|
@ApiModelProperty("年均损失(单位:万元)")
|
||||||
private Float averageLoss;
|
private Double averageLoss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联系方式
|
* 联系方式
|
||||||
|
|||||||
@@ -46,17 +46,17 @@ public class SgEvent {
|
|||||||
/**
|
/**
|
||||||
* 持续时间(单位:秒)
|
* 持续时间(单位:秒)
|
||||||
*/
|
*/
|
||||||
private Float duration;
|
private Double duration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征幅值
|
* 特征幅值
|
||||||
*/
|
*/
|
||||||
private Float featureAmplitude;
|
private Double featureAmplitude;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预估损失(单位:万元)
|
* 预估损失(单位:万元)
|
||||||
*/
|
*/
|
||||||
private Float estimatedLoss;
|
private Double estimatedLoss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事件描述
|
* 事件描述
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package com.njcn.advance.pojo.po.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("sg_machine")
|
||||||
|
public class SgMachine extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线id
|
||||||
|
*/
|
||||||
|
private String productLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备型号
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已安装补偿装置进行治理,默认为0(0 否;1 是)
|
||||||
|
*/
|
||||||
|
private Integer governFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的设备损失(默认为0)
|
||||||
|
*/
|
||||||
|
private Double machineLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的原料损失(默认为0)
|
||||||
|
*/
|
||||||
|
private Double materialLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功率(默认为0)
|
||||||
|
*/
|
||||||
|
private Double machinePower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户状态 0-删除;1-正常;默认正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.advance.pojo.po.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("sg_product_line")
|
||||||
|
public class SgProductLine extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线id
|
||||||
|
*/
|
||||||
|
private String incomingLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算模式 0-模式一(单次中断不计算设备、原料损失);1-模式二(计算)
|
||||||
|
*/
|
||||||
|
private Integer calcMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的产能损失(默认为0)
|
||||||
|
*/
|
||||||
|
private Float capacityLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户状态 0-删除;1-正常;默认正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.njcn.advance.pojo.po.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("sg_sensitive_unit")
|
||||||
|
public class SgSensitiveUnit extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感元器件id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
private String machineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 元器件名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 灵敏度(0 平均,1 高,2 中,3 低)
|
||||||
|
*/
|
||||||
|
private Integer sensitivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耐受能力是否为标准值(0 否,1 是)
|
||||||
|
*/
|
||||||
|
private Integer standardFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上限曲线-持续时间(ms)
|
||||||
|
*/
|
||||||
|
private Double vtcTimeUpper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上限曲线-暂降幅值(p.u.)
|
||||||
|
*/
|
||||||
|
private Double vtcAmpUpper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下限曲线-持续时间(ms)
|
||||||
|
*/
|
||||||
|
private Double vtcTimeLower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下限曲线-暂降幅值(p.u.)
|
||||||
|
*/
|
||||||
|
private Double vtcAmpLower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户状态 0-删除;1-正常;默认正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -51,7 +51,7 @@ public class SgUser extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 年均损失(单位:万元)
|
* 年均损失(单位:万元)
|
||||||
*/
|
*/
|
||||||
private Float averageLoss;
|
private Double averageLoss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联系方式
|
* 联系方式
|
||||||
|
|||||||
@@ -45,17 +45,17 @@ public class SgEventVO {
|
|||||||
/**
|
/**
|
||||||
* 持续时间(单位:秒)
|
* 持续时间(单位:秒)
|
||||||
*/
|
*/
|
||||||
private Float duration;
|
private Double duration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征幅值
|
* 特征幅值
|
||||||
*/
|
*/
|
||||||
private Float featureAmplitude;
|
private Double featureAmplitude;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预估损失(单位:万元)
|
* 预估损失(单位:万元)
|
||||||
*/
|
*/
|
||||||
private Float estimatedLoss;
|
private Double estimatedLoss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事件描述
|
* 事件描述
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.njcn.advance.pojo.vo.govern.voltage;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SgMachineVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线id
|
||||||
|
*/
|
||||||
|
private String productLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备型号
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已安装补偿装置进行治理,默认为0(0 否;1 是)
|
||||||
|
*/
|
||||||
|
private Integer governFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的设备损失(默认为0)
|
||||||
|
*/
|
||||||
|
private Double machineLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的原料损失(默认为0)
|
||||||
|
*/
|
||||||
|
private Double materialLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功率(默认为0)
|
||||||
|
*/
|
||||||
|
private Double machinePower;
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.njcn.advance.pojo.vo.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SgProductLineVO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线id
|
||||||
|
*/
|
||||||
|
private String incomingLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线名称
|
||||||
|
*/
|
||||||
|
private String incomingLineName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算模式 0-模式一(单次中断不计算设备、原料损失);1-模式二(计算)
|
||||||
|
*/
|
||||||
|
private Integer calcMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中断导致的产能损失(默认为0)
|
||||||
|
*/
|
||||||
|
private Double capacityLoss = 0.0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线下所有设备该数据求和
|
||||||
|
* 中断导致的设备损失(默认为0)
|
||||||
|
*/
|
||||||
|
private Double machineLoss = 0.0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线下所有设备该数据求和
|
||||||
|
* 中断导致的原料损失(默认为0)
|
||||||
|
*/
|
||||||
|
private Double materialLoss = 0.0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线下所有设备该数据求和
|
||||||
|
* 功率(默认为0)
|
||||||
|
*/
|
||||||
|
private Double machinePower = 0.0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.njcn.advance.pojo.vo.govern.voltage;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SgSensitiveUnitVO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感元器件id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
private String machineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 元器件名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 灵敏度(0 平均,1 高,2 中,3 低)
|
||||||
|
*/
|
||||||
|
private Integer sensitivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耐受能力是否为标准值(0 否,1 是)
|
||||||
|
*/
|
||||||
|
private Integer standardFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上限曲线-持续时间(ms)
|
||||||
|
*/
|
||||||
|
private Double vtcTimeUpper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上限曲线-暂降幅值(p.u.)
|
||||||
|
*/
|
||||||
|
private Double vtcAmpUpper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下限曲线-持续时间(ms)
|
||||||
|
*/
|
||||||
|
private Double vtcTimeLower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下限曲线-暂降幅值(p.u.)
|
||||||
|
*/
|
||||||
|
private Double vtcAmpLower;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,7 +45,7 @@ public class SgUserVO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 年均损失(单位:万元)
|
* 年均损失(单位:万元)
|
||||||
*/
|
*/
|
||||||
private Float averageLoss;
|
private Double averageLoss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联系方式
|
* 联系方式
|
||||||
|
|||||||
@@ -2,11 +2,8 @@ package com.njcn.advance.controller.govern.voltage;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.njcn.advance.pojo.param.govern.voltage.IncomingLineParam;
|
import com.njcn.advance.pojo.param.govern.voltage.IncomingLineParam;
|
||||||
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
|
|
||||||
import com.njcn.advance.pojo.vo.govern.voltage.IncomingLineVO;
|
import com.njcn.advance.pojo.vo.govern.voltage.IncomingLineVO;
|
||||||
import com.njcn.advance.pojo.vo.govern.voltage.SgUserVO;
|
|
||||||
import com.njcn.advance.service.govern.voltage.ISgIncomingLineService;
|
import com.njcn.advance.service.govern.voltage.ISgIncomingLineService;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
@@ -50,7 +47,7 @@ public class SgIncomingLineController extends BaseController {
|
|||||||
@ApiOperation("查询用户的进线数据")
|
@ApiOperation("查询用户的进线数据")
|
||||||
public HttpResult<List<IncomingLineVO>> list(String userId) {
|
public HttpResult<List<IncomingLineVO>> list(String userId) {
|
||||||
String methodDescribe = getMethodDescribe("list");
|
String methodDescribe = getMethodDescribe("list");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, userId);
|
LogUtil.njcnDebug(log, "{},查询进线数据为:{}", methodDescribe, userId);
|
||||||
List<IncomingLineVO> result = sgIncomingLineService.incomingLineList(userId);
|
List<IncomingLineVO> result = sgIncomingLineService.incomingLineList(userId);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.njcn.advance.controller.govern.voltage;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
||||||
|
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.common.utils.LogUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@Api(tags = "暂降治理设备控制器")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sgMachine")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SgMachineController extends BaseController {
|
||||||
|
|
||||||
|
private final ISgMachineService sgMachineService;
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("查询设备数据")
|
||||||
|
@ApiImplicitParam(name = "sgMachineQueryParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<Page<SgMachineVO>> list(@RequestBody SgMachineParam.SgMachineQueryParam sgMachineQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询设备数据为:{}", methodDescribe, sgMachineQueryParam);
|
||||||
|
Page<SgMachineVO> result = sgMachineService.sgMachineListByProductLineId(sgMachineQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增设备")
|
||||||
|
@ApiImplicitParam(name = "sgMachineParam", value = "设备数据", required = true)
|
||||||
|
public HttpResult<String> add(@RequestBody @Validated SgMachineParam sgMachineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},设备数据:{}", methodDescribe, sgMachineParam);
|
||||||
|
String machineId = sgMachineService.addMachine(sgMachineParam);
|
||||||
|
if (StrUtil.isNotBlank(machineId)) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, machineId, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation("更新设备")
|
||||||
|
@ApiImplicitParam(name = "updateParam", value = "设备数据", required = true)
|
||||||
|
public HttpResult<Object> update(@RequestBody @Validated SgMachineParam.SgMachineUpdateParam updateParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("update");
|
||||||
|
LogUtil.njcnDebug(log, "{},设备数据:{}", methodDescribe, updateParam);
|
||||||
|
boolean result = sgMachineService.updateSgMachine(updateParam);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@ApiOperation("删除设备")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "设备索引", required = true, dataTypeClass = List.class)
|
||||||
|
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
|
LogUtil.njcnDebug(log, "{},设备ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
|
boolean result = sgMachineService.deleteSgMachineData(ids);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.njcn.advance.controller.govern.voltage;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgProductLineParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgProductLine;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgProductLineVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgProductLineService;
|
||||||
|
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.common.utils.LogUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@Api(tags = "暂降治理生产线控制器")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sgProductLine")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SgProductLineController extends BaseController {
|
||||||
|
|
||||||
|
private final ISgProductLineService sgProductLineService;
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("查询用户生产线数据")
|
||||||
|
@ApiImplicitParam(name = "sgProductLineQueryParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<Page<SgProductLineVO>> list(@RequestBody SgProductLineParam.SgProductLineQueryParam sgProductLineQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sgProductLineQueryParam);
|
||||||
|
Page<SgProductLineVO> result = sgProductLineService.sgProductLineListByUserId(sgProductLineQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/querySgProductLineByUserId")
|
||||||
|
@ApiOperation("根据用户id查询所有的生产线信息")
|
||||||
|
@ApiImplicitParam(name = "userId", value = "用户id", required = true)
|
||||||
|
public HttpResult<List<SgProductLine>> querySgProductLineByUserId(String userId) {
|
||||||
|
String methodDescribe = getMethodDescribe("querySgProductLineByUserId");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, userId);
|
||||||
|
List<SgProductLine> result = sgProductLineService.querySgProductLineByUserId(userId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增生产线")
|
||||||
|
@ApiImplicitParam(name = "sgProductLineParam", value = "生产线数据", required = true)
|
||||||
|
public HttpResult<String> add(@RequestBody @Validated SgProductLineParam sgProductLineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},生产线数据:{}", methodDescribe, sgProductLineParam);
|
||||||
|
String productLineId = sgProductLineService.addProductLine(sgProductLineParam);
|
||||||
|
if (StrUtil.isNotBlank(productLineId)) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, productLineId, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation("更新生产线")
|
||||||
|
@ApiImplicitParam(name = "updateParam", value = "生产线数据", required = true)
|
||||||
|
public HttpResult<Object> update(@RequestBody @Validated SgProductLineParam.SgProductLineUpdateParam updateParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("update");
|
||||||
|
LogUtil.njcnDebug(log, "{},生产线数据:{}", methodDescribe, updateParam);
|
||||||
|
boolean result = sgProductLineService.updateSgProductLine(updateParam);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@ApiOperation("删除生产线")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "生产线索引", required = true, dataTypeClass = List.class)
|
||||||
|
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
|
LogUtil.njcnDebug(log, "{},生产线ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
|
boolean result = sgProductLineService.deleteSgProductData(ids);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package com.njcn.advance.controller.govern.voltage;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||||
|
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.common.utils.LogUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@Api(tags = "暂降治理元器件控制器")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sgSensitiveUnit")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SgSensitiveUnitController extends BaseController {
|
||||||
|
|
||||||
|
private final ISgSensitiveUnitService sgSensitiveUnitService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("查询元器件数据")
|
||||||
|
@ApiImplicitParam(name = "sgSensitiveUnitQueryParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<Page<SgSensitiveUnitVO>> list(@RequestBody SgSensitiveUnitParam.SgSensitiveUnitQueryParam sgSensitiveUnitQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询元器件数据为:{}", methodDescribe, sgSensitiveUnitQueryParam);
|
||||||
|
Page<SgSensitiveUnitVO> result = sgSensitiveUnitService.sgSensitiveListByMachineId(sgSensitiveUnitQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增元器件")
|
||||||
|
@ApiImplicitParam(name = "sgSensitiveUnitParam", value = "元器件数据", required = true)
|
||||||
|
public HttpResult<String> add(@RequestBody @Validated SgSensitiveUnitParam sgSensitiveUnitParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},元器件数据:{}", methodDescribe, sgSensitiveUnitParam);
|
||||||
|
String sensitiveUnitId = sgSensitiveUnitService.addSensitiveUnit(sgSensitiveUnitParam);
|
||||||
|
if (StrUtil.isNotBlank(sensitiveUnitId)) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, sensitiveUnitId, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ApiOperation("更新元器件")
|
||||||
|
@ApiImplicitParam(name = "updateParam", value = "元器件数据", required = true)
|
||||||
|
public HttpResult<Object> update(@RequestBody @Validated SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("update");
|
||||||
|
LogUtil.njcnDebug(log, "{},元器件数据:{}", methodDescribe, updateParam);
|
||||||
|
boolean result = sgSensitiveUnitService.updateSgSensitiveUnit(updateParam);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@ApiOperation("删除元器件")
|
||||||
|
@ApiImplicitParam(name = "ids", value = "元器件索引", required = true, dataTypeClass = List.class)
|
||||||
|
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||||
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
|
LogUtil.njcnDebug(log, "{},元器件ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
|
boolean result = sgSensitiveUnitService.deleteSgSensitiveUnitData(ids);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -13,8 +13,6 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.common.utils.LogUtil;
|
import com.njcn.common.utils.LogUtil;
|
||||||
import com.njcn.system.pojo.param.DictDataParam;
|
|
||||||
import com.njcn.system.pojo.vo.DictDataVO;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.advance.mapper.govern.voltage;
|
||||||
|
|
||||||
|
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.advance.pojo.po.govern.voltage.SgMachine;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
public interface SgMachineMapper extends BaseMapper<SgMachine> {
|
||||||
|
|
||||||
|
Page<SgMachineVO> page(@Param("page") Page<Object> objectPage, @Param("ew") QueryWrapper<SgMachineVO> queryWrapper);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.advance.mapper.govern.voltage;
|
||||||
|
|
||||||
|
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.advance.pojo.po.govern.voltage.SgProductLine;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgProductLineVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
public interface SgProductLineMapper extends BaseMapper<SgProductLine> {
|
||||||
|
|
||||||
|
Page<SgProductLineVO> page(@Param("page")Page<SgProductLineVO> objectPage, @Param("ew") QueryWrapper<SgProductLineVO> queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.advance.mapper.govern.voltage;
|
||||||
|
|
||||||
|
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.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
public interface SgSensitiveUnitMapper extends BaseMapper<SgSensitiveUnit> {
|
||||||
|
|
||||||
|
Page<SgSensitiveUnitVO> page(@Param("page") Page<Object> objectPage, @Param("ew")QueryWrapper<SgSensitiveUnitVO> queryWrapper);
|
||||||
|
}
|
||||||
@@ -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.advance.mapper.govern.voltage.SgMachineMapper">
|
||||||
|
|
||||||
|
<!--获取设备分页列表-->
|
||||||
|
<select id="page" resultType="SgMachineVO">
|
||||||
|
SELECT sg_machine.*
|
||||||
|
FROM sg_machine sg_machine
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?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.advance.mapper.govern.voltage.SgProductLineMapper">
|
||||||
|
|
||||||
|
<!--获取生产线分页列表-->
|
||||||
|
<select id="page" resultType="SgProductLineVO">
|
||||||
|
SELECT
|
||||||
|
sg_product_line.*,
|
||||||
|
sg_user.user_name userName,
|
||||||
|
sg_incoming_line.name incomingLineName
|
||||||
|
FROM
|
||||||
|
sg_product_line sg_product_line ,
|
||||||
|
sg_user sg_user ,
|
||||||
|
sg_incoming_line sg_incoming_line
|
||||||
|
WHERE sg_product_line.user_id = sg_user.id
|
||||||
|
AND sg_product_line.incoming_line_id = sg_incoming_line.id
|
||||||
|
AND ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?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.advance.mapper.govern.voltage.SgSensitiveUnitMapper">
|
||||||
|
<!--获取元器件分页列表-->
|
||||||
|
<select id="page" resultType="SgSensitiveUnitVO">
|
||||||
|
SELECT sg_sensitive_unit.*
|
||||||
|
FROM sg_sensitive_unit sg_sensitive_unit
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<mapper namespace="com.njcn.advance.mapper.govern.voltage.SgUserMapper">
|
<mapper namespace="com.njcn.advance.mapper.govern.voltage.SgUserMapper">
|
||||||
|
|
||||||
|
|
||||||
<!--获取字典分页列表-->
|
<!--获取业务用户分页列表-->
|
||||||
<select id="page" resultType="SgUserVO">
|
<select id="page" resultType="SgUserVO">
|
||||||
SELECT sg_user.*
|
SELECT sg_user.*
|
||||||
FROM sg_user sg_user
|
FROM sg_user sg_user
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.advance.service.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
public interface ISgMachineService extends IService<SgMachine> {
|
||||||
|
|
||||||
|
Page<SgMachineVO> sgMachineListByProductLineId(SgMachineParam.SgMachineQueryParam sgMachineQueryParam);
|
||||||
|
|
||||||
|
String addMachine(SgMachineParam sgMachineParam);
|
||||||
|
|
||||||
|
boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam);
|
||||||
|
|
||||||
|
boolean deleteSgMachineData(List<String> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.advance.service.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgProductLineParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgProductLine;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgProductLineVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
public interface ISgProductLineService extends IService<SgProductLine> {
|
||||||
|
|
||||||
|
Page<SgProductLineVO> sgProductLineListByUserId(SgProductLineParam.SgProductLineQueryParam sgProductLineQueryParam);
|
||||||
|
|
||||||
|
String addProductLine(SgProductLineParam sgProductLineParam);
|
||||||
|
|
||||||
|
boolean updateSgProductLine(SgProductLineParam.SgProductLineUpdateParam updateParam);
|
||||||
|
|
||||||
|
boolean deleteSgProductData(List<String> ids);
|
||||||
|
|
||||||
|
List<SgProductLine> querySgProductLineByUserId(String userId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.advance.service.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
public interface ISgSensitiveUnitService extends IService<SgSensitiveUnit> {
|
||||||
|
|
||||||
|
Page<SgSensitiveUnitVO> sgSensitiveListByMachineId(SgSensitiveUnitParam.SgSensitiveUnitQueryParam sgSensitiveUnitQueryParam);
|
||||||
|
|
||||||
|
String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam);
|
||||||
|
|
||||||
|
boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam);
|
||||||
|
|
||||||
|
boolean deleteSgSensitiveUnitData(List<String> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.njcn.advance.service.govern.voltage.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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.advance.enums.AdvanceResponseEnum;
|
||||||
|
import com.njcn.advance.mapper.govern.voltage.SgMachineMapper;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgProductLineParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgProductLine;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgProductLineVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine> implements ISgMachineService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<SgMachineVO> sgMachineListByProductLineId(SgMachineParam.SgMachineQueryParam sgMachineQueryParam) {
|
||||||
|
if(StrUtil.isBlank(sgMachineQueryParam.getProductLineId())){
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.SG_PRODUCT_LINE_ID_MISS);
|
||||||
|
}
|
||||||
|
QueryWrapper<SgMachineVO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("sg_machine.product_line_id",sgMachineQueryParam.getProductLineId())
|
||||||
|
.eq("sg_machine.state", DataStateEnum.ENABLE.getCode())
|
||||||
|
.orderByDesc("sg_machine.create_time");
|
||||||
|
|
||||||
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(sgMachineQueryParam), PageFactory.getPageSize(sgMachineQueryParam)), queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备
|
||||||
|
* @param sgMachineParam 设备数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String addMachine(SgMachineParam sgMachineParam) {
|
||||||
|
SgMachine sgMachine = new SgMachine();
|
||||||
|
BeanUtil.copyProperties(sgMachineParam, sgMachine);
|
||||||
|
//默认为正常状态
|
||||||
|
sgMachine.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
this.save(sgMachine);
|
||||||
|
return sgMachine.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新设备
|
||||||
|
* @param updateParam 设备数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) {
|
||||||
|
SgMachine sgMachine = new SgMachine();
|
||||||
|
BeanUtil.copyProperties(updateParam, sgMachine);
|
||||||
|
return this.updateById(sgMachine);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id逻辑删除设备
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean deleteSgMachineData(List<String> ids) {
|
||||||
|
return this.lambdaUpdate()
|
||||||
|
.set(SgMachine::getState, DataStateEnum.DELETED.getCode())
|
||||||
|
.in(SgMachine::getId, ids)
|
||||||
|
.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
package com.njcn.advance.service.govern.voltage.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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.advance.enums.AdvanceResponseEnum;
|
||||||
|
import com.njcn.advance.mapper.govern.voltage.SgProductLineMapper;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgProductLineParam;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgProductLine;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgUser;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgProductLineVO;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgUserVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgProductLineService;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.poi.util.StringUtil;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SgProductLineServiceImpl extends ServiceImpl<SgProductLineMapper, SgProductLine> implements ISgProductLineService {
|
||||||
|
|
||||||
|
private final ISgMachineService machineService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 因为理论上不会超过5条生产线,所以该分页其实也没有多大的必要
|
||||||
|
* 根据业务用户id查询该用户下的所有生产线信息
|
||||||
|
*
|
||||||
|
* @param sgProductLineQueryParam 查询条件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<SgProductLineVO> sgProductLineListByUserId(SgProductLineParam.SgProductLineQueryParam sgProductLineQueryParam) {
|
||||||
|
String userId = sgProductLineQueryParam.getUserId();
|
||||||
|
QueryWrapper<SgProductLineVO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("sg_product_line.user_id", userId)
|
||||||
|
.eq("sg_product_line.state", DataStateEnum.ENABLE.getCode())
|
||||||
|
.orderByDesc("sg_product_line.create_time");
|
||||||
|
Page<SgProductLineVO> data = this.baseMapper.page(new Page<>(PageFactory.getPageNum(sgProductLineQueryParam), PageFactory.getPageSize(sgProductLineQueryParam)), queryWrapper);
|
||||||
|
List<SgProductLineVO> records = data.getRecords();
|
||||||
|
//循环遍历处理下生产线总功率、设备损失、原料损失
|
||||||
|
if(CollectionUtil.isNotEmpty(records)){
|
||||||
|
//根据生产线获取下面所有设备
|
||||||
|
List<String> productLineIdList = records.stream().map(SgProductLineVO::getId).collect(Collectors.toList());
|
||||||
|
LambdaQueryWrapper<SgMachine> sgMachineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgMachineLambdaQueryWrapper.in(SgMachine::getProductLineId,productLineIdList)
|
||||||
|
.eq(SgMachine::getState,DataStateEnum.ENABLE.getCode());
|
||||||
|
List<SgMachine> machineList = machineService.list(sgMachineLambdaQueryWrapper);
|
||||||
|
//判断是否有设备数据,有的话,进行java分组,以生产线id为key
|
||||||
|
Map<String, List<SgMachine>> stringListMap = machineList.stream().collect(Collectors.groupingBy(SgMachine::getProductLineId));
|
||||||
|
for (SgProductLineVO sgProductLineVO : records) {
|
||||||
|
String productLineId = sgProductLineVO.getId();
|
||||||
|
List<SgMachine> machineListTemp = stringListMap.get(productLineId);
|
||||||
|
if(CollectionUtil.isNotEmpty(machineListTemp)){
|
||||||
|
//设备总损失
|
||||||
|
double machineLossSum = machineListTemp.stream().mapToDouble(SgMachine::getMachineLoss).sum();
|
||||||
|
sgProductLineVO.setMachineLoss(machineLossSum);
|
||||||
|
//原料总损失
|
||||||
|
double materialLossSum = machineListTemp.stream().mapToDouble(SgMachine::getMaterialLoss).sum();
|
||||||
|
sgProductLineVO.setMaterialLoss(materialLossSum);
|
||||||
|
//总功率
|
||||||
|
double machinePowerSum = machineListTemp.stream().mapToDouble(SgMachine::getMachinePower).sum();
|
||||||
|
sgProductLineVO.setMachinePower(machinePowerSum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增生产线
|
||||||
|
* @param sgProductLineParam 数据内容
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String addProductLine(SgProductLineParam sgProductLineParam) {
|
||||||
|
checkSgProductName(sgProductLineParam, false);
|
||||||
|
SgProductLine sgProductLine = new SgProductLine();
|
||||||
|
BeanUtil.copyProperties(sgProductLineParam, sgProductLine);
|
||||||
|
//默认为正常状态
|
||||||
|
sgProductLine.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
this.save(sgProductLine);
|
||||||
|
return sgProductLine.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新生产线
|
||||||
|
* @param updateParam 数据内容
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean updateSgProductLine(SgProductLineParam.SgProductLineUpdateParam updateParam) {
|
||||||
|
checkSgProductName(updateParam, true);
|
||||||
|
SgProductLine sgProductLine = new SgProductLine();
|
||||||
|
BeanUtil.copyProperties(updateParam, sgProductLine);
|
||||||
|
return this.updateById(sgProductLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id逻辑删除生产线数据
|
||||||
|
* @param ids id集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean deleteSgProductData(List<String> ids) {
|
||||||
|
return this.lambdaUpdate()
|
||||||
|
.set(SgProductLine::getState, DataStateEnum.DELETED.getCode())
|
||||||
|
.in(SgProductLine::getId, ids)
|
||||||
|
.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户id获取生产线信息
|
||||||
|
* @param userId 用户id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SgProductLine> querySgProductLineByUserId(String userId) {
|
||||||
|
LambdaQueryWrapper<SgProductLine> sgProductLineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgProductLineLambdaQueryWrapper
|
||||||
|
.eq(SgProductLine::getUserId, userId)
|
||||||
|
.eq(SgProductLine::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.list(sgProductLineLambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验参数,检查是否存在相同名称的生产线
|
||||||
|
*/
|
||||||
|
private void checkSgProductName(SgProductLineParam sgProductLineParam, boolean isExcludeSelf) {
|
||||||
|
LambdaQueryWrapper<SgProductLine> sgProductLineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgProductLineLambdaQueryWrapper
|
||||||
|
.eq(SgProductLine::getName, sgProductLineParam.getName())
|
||||||
|
.eq(SgProductLine::getUserId, sgProductLineParam.getUserId())
|
||||||
|
.eq(SgProductLine::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (sgProductLineParam instanceof SgProductLineParam.SgProductLineUpdateParam) {
|
||||||
|
sgProductLineLambdaQueryWrapper.ne(SgProductLine::getId, ((SgProductLineParam.SgProductLineUpdateParam) sgProductLineParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgProductLineLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.SG_PRODUCT_LINE_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.njcn.advance.service.govern.voltage.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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.advance.enums.AdvanceResponseEnum;
|
||||||
|
import com.njcn.advance.mapper.govern.voltage.SgSensitiveUnitMapper;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-03-14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMapper, SgSensitiveUnit> implements ISgSensitiveUnitService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备id查询下属所有的元器件数据
|
||||||
|
*
|
||||||
|
* @param sgSensitiveUnitQueryParam 查询条件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<SgSensitiveUnitVO> sgSensitiveListByMachineId(SgSensitiveUnitParam.SgSensitiveUnitQueryParam sgSensitiveUnitQueryParam) {
|
||||||
|
if(StrUtil.isBlank(sgSensitiveUnitQueryParam.getMachineId())){
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.SG_MACHINE_ID_MISS);
|
||||||
|
}
|
||||||
|
QueryWrapper<SgSensitiveUnitVO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("sg_sensitive_unit.machine_id",sgSensitiveUnitQueryParam.getMachineId())
|
||||||
|
.eq("sg_sensitive_unit.state", DataStateEnum.ENABLE.getCode())
|
||||||
|
.orderByDesc("sg_sensitive_unit.create_time");
|
||||||
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(sgSensitiveUnitQueryParam), PageFactory.getPageSize(sgSensitiveUnitQueryParam)), queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增元器件
|
||||||
|
* @param sgSensitiveUnitParam 元器件数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) {
|
||||||
|
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
||||||
|
BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit);
|
||||||
|
//默认为正常状态
|
||||||
|
sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
this.save(sgSensitiveUnit);
|
||||||
|
return sgSensitiveUnit.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新元器件
|
||||||
|
*
|
||||||
|
* @param updateParam 元器件数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
|
||||||
|
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
||||||
|
BeanUtil.copyProperties(updateParam, sgSensitiveUnit);
|
||||||
|
return this.updateById(sgSensitiveUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除元器件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean deleteSgSensitiveUnitData(List<String> ids) {
|
||||||
|
return this.lambdaUpdate()
|
||||||
|
.set(SgSensitiveUnit::getState, DataStateEnum.DELETED.getCode())
|
||||||
|
.in(SgSensitiveUnit::getId, ids)
|
||||||
|
.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user