暂降治理一期工作内容
This commit is contained in:
@@ -35,9 +35,14 @@ public enum AdvanceResponseEnum {
|
|||||||
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","干扰源用户缺失"),
|
||||||
|
|
||||||
|
|
||||||
|
EVENT_EMPTY("A0102","没有查询到未分析事件"),
|
||||||
|
|
||||||
|
SG_USER_NAME_REPEAT("A0102","业务用户名重复"),
|
||||||
|
|
||||||
|
SG_USER_ID_MISS("A0102","业务用户id缺失"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.njcn.advance.pojo.param.govern.voltage;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.PatternRegex;
|
||||||
|
import com.njcn.web.constant.ValidMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IncomingLineParam {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("业务用户id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "userId")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("进线名称")
|
||||||
|
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联监测点id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("业务用户id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "lineId")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新操作实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class IncomingLineUpdateParam extends IncomingLineParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表Id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package com.njcn.advance.pojo.param.govern.voltage;
|
||||||
|
|
||||||
|
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 java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SgEventParam {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("进线id")
|
||||||
|
@NotBlank(message = ValidMessage.MISS_PREFIX + "lineId")
|
||||||
|
private String incomingLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂降起始时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("暂降起始时间")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "startTime")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件类型
|
||||||
|
*/
|
||||||
|
private String eventType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 持续时间(单位:秒)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("持续时间")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "duration")
|
||||||
|
private Float duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特征幅值
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("特征幅值")
|
||||||
|
@NotNull(message = ValidMessage.MISS_PREFIX + "featureAmplitude")
|
||||||
|
private Float featureAmplitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预估损失(单位:万元)
|
||||||
|
*/
|
||||||
|
private Float estimatedLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件描述
|
||||||
|
*/
|
||||||
|
private String eventDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 波形文件是否从装置招到本地(0:未招,1:已招)默认值为0
|
||||||
|
*/
|
||||||
|
private Integer fileFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 波形路径
|
||||||
|
*/
|
||||||
|
private String wavePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据来源(0-离线导入 1-监测点实际数据同步)
|
||||||
|
*/
|
||||||
|
private Integer dataSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SgEventParamQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产线id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("生产线id")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
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.Pattern;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SgUserParam {
|
||||||
|
|
||||||
|
@ApiModelProperty("名称")
|
||||||
|
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.DIC_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("行业")
|
||||||
|
@NotBlank(message = ValidMessage.INDUSTRY_NOT_BLANK)
|
||||||
|
@Pattern(regexp = PatternRegex.DIC_REGEX, message = ValidMessage.INDUSTRY_FORMAT_ERROR)
|
||||||
|
private String industry;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关键用户(0 否,1 是)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("是否关键用户")
|
||||||
|
private Integer keyUser = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属区域
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("所属区域")
|
||||||
|
@NotBlank(message = ValidMessage.ADDR_NOT_BLANK)
|
||||||
|
private String addrStrOption;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String addrDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年均损失(单位:万元)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("年均损失(单位:万元)")
|
||||||
|
private Float averageLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系方式
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("联系方式")
|
||||||
|
private String concact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业用户照片或logo
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("企业用户照片")
|
||||||
|
private String userLogo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新操作实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class SgUserUpdateParam extends SgUserParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表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 SgUserQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属区域
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("所属区域")
|
||||||
|
private List<String> addrStrOption;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
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-02-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("sg_event")
|
||||||
|
public class SgEvent {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂降事件id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线id
|
||||||
|
*/
|
||||||
|
private String incomingLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂降起始时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件类型
|
||||||
|
*/
|
||||||
|
private String eventType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 持续时间(单位:秒)
|
||||||
|
*/
|
||||||
|
private Float duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特征幅值
|
||||||
|
*/
|
||||||
|
private Float featureAmplitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预估损失(单位:万元)
|
||||||
|
*/
|
||||||
|
private Float estimatedLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件描述
|
||||||
|
*/
|
||||||
|
private String eventDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 波形文件是否从装置招到本地(0:未招,1:已招)默认值为0
|
||||||
|
*/
|
||||||
|
private Integer fileFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 波形路径
|
||||||
|
*/
|
||||||
|
private String wavePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据来源(0-离线导入 1-监测点实际数据同步)
|
||||||
|
*/
|
||||||
|
private Integer dataSource;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
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.time.LocalDateTime;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("sg_incoming_line")
|
||||||
|
public class SgIncomingLine extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联监测点id
|
||||||
|
*/
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线状态 0-删除;1-正常;默认正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
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-02-29
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("sg_user")
|
||||||
|
public class SgUser extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业
|
||||||
|
*/
|
||||||
|
private String industry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属区域
|
||||||
|
*/
|
||||||
|
private String addr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String addrDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年均损失(单位:万元)
|
||||||
|
*/
|
||||||
|
private Float averageLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系方式
|
||||||
|
*/
|
||||||
|
private String concact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关键用户(0 否,1 是)
|
||||||
|
*/
|
||||||
|
private Integer keyUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业用户照片或logo
|
||||||
|
*/
|
||||||
|
private String userLogo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户状态 0-删除;1-正常;默认正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.njcn.advance.pojo.vo.govern.voltage;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class IncomingLineVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联监测点id
|
||||||
|
*/
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联监测点名称
|
||||||
|
*/
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.njcn.advance.pojo.vo.govern.voltage;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SgEventVO {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂降事件id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线id
|
||||||
|
*/
|
||||||
|
private String incomingLineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线名称
|
||||||
|
*/
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂降起始时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件类型
|
||||||
|
*/
|
||||||
|
private String eventType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 持续时间(单位:秒)
|
||||||
|
*/
|
||||||
|
private Float duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特征幅值
|
||||||
|
*/
|
||||||
|
private Float featureAmplitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预估损失(单位:万元)
|
||||||
|
*/
|
||||||
|
private Float estimatedLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件描述
|
||||||
|
*/
|
||||||
|
private String eventDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 波形文件是否从装置招到本地(0:未招,1:已招)默认值为0
|
||||||
|
*/
|
||||||
|
private Integer fileFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 波形路径
|
||||||
|
*/
|
||||||
|
private String wavePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据来源(0-离线导入 1-监测点实际数据同步)
|
||||||
|
*/
|
||||||
|
private Integer dataSource;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.njcn.advance.pojo.vo.govern.voltage;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SgUserVO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务用户id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业
|
||||||
|
*/
|
||||||
|
private String industry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属区域
|
||||||
|
*/
|
||||||
|
private String addr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String addrDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年均损失(单位:万元)
|
||||||
|
*/
|
||||||
|
private Float averageLoss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系方式
|
||||||
|
*/
|
||||||
|
private String concact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产线数量
|
||||||
|
*/
|
||||||
|
private Integer productCount = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进线数量
|
||||||
|
*/
|
||||||
|
private Integer lineCount = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关键用户(0 否,1 是)
|
||||||
|
*/
|
||||||
|
private Integer keyUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业用户照片或logo
|
||||||
|
*/
|
||||||
|
private String userLogo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户状态 0-删除;1-正常;默认正常
|
||||||
|
*/
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.njcn.advance.controller.govern.voltage;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgEventParam;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgEventVO;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgUserVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgEventService;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "暂降治理暂降数据控制器")
|
||||||
|
@RequestMapping("/voltage/sgEvent")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SgEventController extends BaseController {
|
||||||
|
|
||||||
|
private final ISgEventService sgEventService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("查询指定生产线的暂降数据")
|
||||||
|
@ApiImplicitParam(name = "sgEventParamQueryParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<Page<SgEventVO>> list(@RequestBody SgEventParam.SgEventParamQueryParam sgEventParamQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sgEventParamQueryParam);
|
||||||
|
Page<SgEventVO> result = sgEventService.sgEventList(sgEventParamQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
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.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.SgUserVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgIncomingLineService;
|
||||||
|
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-02-29
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@Api(tags = "暂降治理业务进线控制器")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sgIncomingLine")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SgIncomingLineController extends BaseController {
|
||||||
|
|
||||||
|
private final ISgIncomingLineService sgIncomingLineService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("查询用户的进线数据")
|
||||||
|
public HttpResult<List<IncomingLineVO>> list(String userId) {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, userId);
|
||||||
|
List<IncomingLineVO> result = sgIncomingLineService.incomingLineList(userId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增业务用户的进线")
|
||||||
|
@ApiImplicitParam(name = "incomingLineParam", value = "进线数据", required = true)
|
||||||
|
public HttpResult<String> add(@RequestBody @Validated IncomingLineParam incomingLineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},进线数据为:{}", methodDescribe, incomingLineParam);
|
||||||
|
String lineId = sgIncomingLineService.addIncomingLine(incomingLineParam);
|
||||||
|
if (StrUtil.isNotBlank(lineId)) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineId, 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 IncomingLineParam.IncomingLineUpdateParam updateParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("update");
|
||||||
|
LogUtil.njcnDebug(log, "{},进线数据为:{}", methodDescribe, updateParam);
|
||||||
|
boolean result = sgIncomingLineService.updateIncomingLine(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 = sgIncomingLineService.deleteIncomingLineData(ids);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
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.SgUserParam;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgUserVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgUserService;
|
||||||
|
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 com.njcn.system.pojo.param.DictDataParam;
|
||||||
|
import com.njcn.system.pojo.vo.DictDataVO;
|
||||||
|
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-02-29
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "暂降治理业务用户控制器")
|
||||||
|
@RequestMapping("/sgUser")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SgUserController extends BaseController {
|
||||||
|
|
||||||
|
private final ISgUserService sgUserService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("查询用户数据")
|
||||||
|
@ApiImplicitParam(name = "sgUserQueryParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<Page<SgUserVO>> list(@RequestBody SgUserParam.SgUserQueryParam sgUserQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("list");
|
||||||
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sgUserQueryParam);
|
||||||
|
Page<SgUserVO> result = sgUserService.sgUserList(sgUserQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增业务用户")
|
||||||
|
@ApiImplicitParam(name = "sgUserParam", value = "用户数据", required = true)
|
||||||
|
public HttpResult<String> add(@RequestBody @Validated SgUserParam sgUserParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
LogUtil.njcnDebug(log, "{},用户数据为:{}", methodDescribe, sgUserParam);
|
||||||
|
String userId = sgUserService.addUserInfo(sgUserParam);
|
||||||
|
if (StrUtil.isNotBlank(userId)) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, userId, 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 SgUserParam.SgUserUpdateParam updateParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("update");
|
||||||
|
LogUtil.njcnDebug(log, "{},用户数据为:{}", methodDescribe, updateParam);
|
||||||
|
boolean result = sgUserService.updateSgUser(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 = sgUserService.deleteSgUserData(ids);
|
||||||
|
if (result) {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.advance.mapper.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
public interface SgEventMapper extends BaseMapper<SgEvent> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.advance.mapper.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgIncomingLine;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.IncomingLineVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
public interface SgIncomingLineMapper extends BaseMapper<SgIncomingLine> {
|
||||||
|
|
||||||
|
List<IncomingLineVO> queryLineByUserId(@Param("userId")String userId);
|
||||||
|
}
|
||||||
@@ -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.SgUser;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgUserVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
public interface SgUserMapper extends BaseMapper<SgUser> {
|
||||||
|
|
||||||
|
Page<SgUserVO> page(@Param("page")Page<SgUserVO> objectPage, @Param("ew") QueryWrapper<SgUserVO> 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.advance.mapper.govern.voltage.SgEventMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?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.SgIncomingLineMapper">
|
||||||
|
|
||||||
|
<select id="queryLineByUserId" resultType="IncomingLineVO">
|
||||||
|
SELECT
|
||||||
|
sg_incoming_line.*,
|
||||||
|
pq_line.NAME lineName
|
||||||
|
FROM
|
||||||
|
sg_incoming_line sg_incoming_line,
|
||||||
|
pq_line pq_line
|
||||||
|
WHERE
|
||||||
|
sg_incoming_line.line_id = pq_line.id
|
||||||
|
AND sg_incoming_line.state = 1
|
||||||
|
AND sg_incoming_line.user_id = #{userId}
|
||||||
|
ORDER BY sg_incoming_line.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</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.advance.mapper.govern.voltage.SgUserMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<!--获取字典分页列表-->
|
||||||
|
<select id="page" resultType="SgUserVO">
|
||||||
|
SELECT sg_user.*
|
||||||
|
FROM sg_user sg_user
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
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.SgEventParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgEvent;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgEventVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
public interface ISgEventService extends IService<SgEvent> {
|
||||||
|
|
||||||
|
Page<SgEventVO> sgEventList(SgEventParam.SgEventParamQueryParam sgEventParamQueryParam);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.advance.service.govern.voltage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.IncomingLineParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgIncomingLine;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.IncomingLineVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
public interface ISgIncomingLineService extends IService<SgIncomingLine> {
|
||||||
|
|
||||||
|
List<IncomingLineVO> incomingLineList(String userId);
|
||||||
|
|
||||||
|
String addIncomingLine(IncomingLineParam incomingLineParam);
|
||||||
|
|
||||||
|
boolean updateIncomingLine(IncomingLineParam.IncomingLineUpdateParam updateParam);
|
||||||
|
|
||||||
|
boolean deleteIncomingLineData(List<String> ids);
|
||||||
|
}
|
||||||
@@ -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.SgUserParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgUser;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgUserVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
public interface ISgUserService extends IService<SgUser> {
|
||||||
|
|
||||||
|
Page<SgUserVO> sgUserList(SgUserParam.SgUserQueryParam sgUserQueryParam);
|
||||||
|
|
||||||
|
String addUserInfo(SgUserParam sgUserParam);
|
||||||
|
|
||||||
|
boolean updateSgUser(SgUserParam.SgUserUpdateParam updateParam);
|
||||||
|
|
||||||
|
boolean deleteSgUserData(List<String> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.advance.service.govern.voltage.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.advance.mapper.govern.voltage.SgEventMapper;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgEventParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgEvent;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgEventVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgEventService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SgEventServiceImpl extends ServiceImpl<SgEventMapper, SgEvent> implements ISgEventService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据查询条件返回分页的暂降数据
|
||||||
|
* @param sgEventParamQueryParam 查询条件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<SgEventVO> sgEventList(SgEventParam.SgEventParamQueryParam sgEventParamQueryParam) {
|
||||||
|
//暂降数据实际跟进线耦合的,需要根据所传的生产线获取进线id
|
||||||
|
String productId = sgEventParamQueryParam.getProductId();
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
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.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||||
|
import com.njcn.advance.mapper.govern.voltage.SgIncomingLineMapper;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.IncomingLineParam;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgIncomingLine;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgUser;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.IncomingLineVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgIncomingLineService;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SgIncomingLineServiceImpl extends ServiceImpl<SgIncomingLineMapper, SgIncomingLine> implements ISgIncomingLineService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户id查询进线数据
|
||||||
|
* @param userId 用户id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<IncomingLineVO> incomingLineList(String userId) {
|
||||||
|
if(StrUtil.isBlank(userId)){
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.SG_USER_ID_MISS);
|
||||||
|
}
|
||||||
|
return this.baseMapper.queryLineByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增业务用户的进线数据
|
||||||
|
*
|
||||||
|
* @param incomingLineParam 业务用户数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String addIncomingLine(IncomingLineParam incomingLineParam) {
|
||||||
|
checkIncomingLineName(incomingLineParam, false);
|
||||||
|
SgIncomingLine sgIncomingLine = new SgIncomingLine();
|
||||||
|
BeanUtil.copyProperties(incomingLineParam, sgIncomingLine);
|
||||||
|
//默认为正常状态
|
||||||
|
sgIncomingLine.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
this.save(sgIncomingLine);
|
||||||
|
return sgIncomingLine.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改业务用户的进线数据
|
||||||
|
*
|
||||||
|
* @param updateParam 业务用户数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean updateIncomingLine(IncomingLineParam.IncomingLineUpdateParam updateParam) {
|
||||||
|
checkIncomingLineName(updateParam, true);
|
||||||
|
SgIncomingLine sgIncomingLine = new SgIncomingLine();
|
||||||
|
BeanUtil.copyProperties(updateParam, sgIncomingLine);
|
||||||
|
return this.updateById(sgIncomingLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除进线数据
|
||||||
|
* @param ids 进线id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean deleteIncomingLineData(List<String> ids) {
|
||||||
|
return this.lambdaUpdate()
|
||||||
|
.set(SgIncomingLine::getState, DataStateEnum.DELETED.getCode())
|
||||||
|
.in(SgIncomingLine::getId, ids)
|
||||||
|
.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验进线名称是否有重复的
|
||||||
|
* @param incomingLineParam 进线数据
|
||||||
|
* @param isExcludeSelf 是否排除自己
|
||||||
|
*/
|
||||||
|
private void checkIncomingLineName(IncomingLineParam incomingLineParam, boolean isExcludeSelf) {
|
||||||
|
LambdaQueryWrapper<SgIncomingLine> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgUserLambdaQueryWrapper
|
||||||
|
.eq(SgIncomingLine::getName, incomingLineParam.getName())
|
||||||
|
.eq(SgIncomingLine::getUserId, incomingLineParam.getUserId())
|
||||||
|
.eq(SgIncomingLine::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (incomingLineParam instanceof IncomingLineParam.IncomingLineUpdateParam) {
|
||||||
|
sgUserLambdaQueryWrapper.ne(SgIncomingLine::getId, ((IncomingLineParam.IncomingLineUpdateParam) incomingLineParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
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.ObjectUtil;
|
||||||
|
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.mapper.govern.voltage.SgUserMapper;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgUser;
|
||||||
|
import com.njcn.advance.pojo.vo.govern.voltage.SgUserVO;
|
||||||
|
import com.njcn.advance.service.govern.voltage.ISgUserService;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.db.constant.DbConstant;
|
||||||
|
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-02-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SgUserServiceImpl extends ServiceImpl<SgUserMapper, SgUser> implements ISgUserService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<SgUserVO> sgUserList(SgUserParam.SgUserQueryParam sgUserQueryParam) {
|
||||||
|
QueryWrapper<SgUserVO> queryWrapper = new QueryWrapper<>();
|
||||||
|
//关键字查询,仅支持用户名、行业模糊查询
|
||||||
|
if (StrUtil.isNotBlank(sgUserQueryParam.getSearchValue())) {
|
||||||
|
queryWrapper
|
||||||
|
.and(param -> param
|
||||||
|
.like("sg_user.user_name", sgUserQueryParam.getSearchValue())
|
||||||
|
.or()
|
||||||
|
.like("sg_user.industry", sgUserQueryParam.getSearchValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
//addr可能是个集合,多选N个区域查询
|
||||||
|
if (CollectionUtil.isNotEmpty(sgUserQueryParam.getAddrStrOption())) {
|
||||||
|
queryWrapper.in("sg_user.addr", sgUserQueryParam.getAddrStrOption());
|
||||||
|
}
|
||||||
|
//排序
|
||||||
|
if (ObjectUtil.isAllNotEmpty(sgUserQueryParam.getSortBy(), sgUserQueryParam.getOrderBy())) {
|
||||||
|
queryWrapper.orderBy(true, sgUserQueryParam.getOrderBy().equals(DbConstant.ASC), StrUtil.toUnderlineCase(sgUserQueryParam.getSortBy()));
|
||||||
|
} else {
|
||||||
|
//没有排序参数,默认根据sort字段排序,没有排序字段的,根据createTime更新时间排序
|
||||||
|
queryWrapper.orderByDesc("sg_user.create_time");
|
||||||
|
}
|
||||||
|
queryWrapper.eq("sg_user.state", DataStateEnum.ENABLE.getCode());
|
||||||
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(sgUserQueryParam), PageFactory.getPageSize(sgUserQueryParam)), queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增业务用户数据
|
||||||
|
*
|
||||||
|
* @param sgUserParam 业务用户数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String addUserInfo(SgUserParam sgUserParam) {
|
||||||
|
checkSgUserName(sgUserParam, false);
|
||||||
|
SgUser sgUser = new SgUser();
|
||||||
|
BeanUtil.copyProperties(sgUserParam, sgUser);
|
||||||
|
//默认为正常状态
|
||||||
|
sgUser.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
sgUser.setAddr(sgUserParam.getAddrStrOption());
|
||||||
|
this.save(sgUser);
|
||||||
|
return sgUser.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新业务用户数据
|
||||||
|
*
|
||||||
|
* @param updateParam 待更新的业务用户数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean updateSgUser(SgUserParam.SgUserUpdateParam updateParam) {
|
||||||
|
checkSgUserName(updateParam, true);
|
||||||
|
SgUser sgUser = new SgUser();
|
||||||
|
BeanUtil.copyProperties(updateParam, sgUser);
|
||||||
|
return this.updateById(sgUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除所有指定的业务用户
|
||||||
|
*
|
||||||
|
* @param ids 用户id集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean deleteSgUserData(List<String> ids) {
|
||||||
|
return this.lambdaUpdate()
|
||||||
|
.set(SgUser::getState, DataStateEnum.DELETED.getCode())
|
||||||
|
.in(SgUser::getId, ids)
|
||||||
|
.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验参数,检查是否存在相同名称的业务用户
|
||||||
|
*/
|
||||||
|
private void checkSgUserName(SgUserParam sgUserParam, boolean isExcludeSelf) {
|
||||||
|
LambdaQueryWrapper<SgUser> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgUserLambdaQueryWrapper
|
||||||
|
.eq(SgUser::getUserName, sgUserParam.getUserName())
|
||||||
|
.eq(SgUser::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (sgUserParam instanceof SgUserParam.SgUserUpdateParam) {
|
||||||
|
sgUserLambdaQueryWrapper.ne(SgUser::getId, ((SgUserParam.SgUserUpdateParam) sgUserParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,9 @@ package com.njcn.web.constant;
|
|||||||
public interface ValidMessage {
|
public interface ValidMessage {
|
||||||
|
|
||||||
|
|
||||||
|
String MISS_PREFIX="字段不能为空,请检查";
|
||||||
|
|
||||||
|
|
||||||
String ID_NOT_BLANK = "id不能为空,请检查id参数";
|
String ID_NOT_BLANK = "id不能为空,请检查id参数";
|
||||||
|
|
||||||
String ID_FORMAT_ERROR = "id格式错误,请检查id参数";
|
String ID_FORMAT_ERROR = "id格式错误,请检查id参数";
|
||||||
@@ -20,6 +23,10 @@ public interface ValidMessage {
|
|||||||
|
|
||||||
String NAME_FORMAT_ERROR = "名称格式错误,请检查name参数";
|
String NAME_FORMAT_ERROR = "名称格式错误,请检查name参数";
|
||||||
|
|
||||||
|
String INDUSTRY_NOT_BLANK = "行业不能为空,请检查industry参数";
|
||||||
|
String INDUSTRY_FORMAT_ERROR = "行业格式错误,请检查industry参数";
|
||||||
|
String ADDR_NOT_BLANK = "所属区域不能为空,请检查addr参数";
|
||||||
|
|
||||||
String CODE_NOT_BLANK = "编号不能为空,请检查code参数";
|
String CODE_NOT_BLANK = "编号不能为空,请检查code参数";
|
||||||
|
|
||||||
String CODE_FORMAT_ERROR = "编号格式错误,请检查code参数";
|
String CODE_FORMAT_ERROR = "编号格式错误,请检查code参数";
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.system.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class FileVO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.njcn.system.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
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.constant.OssPath;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import com.njcn.system.pojo.vo.FileVO;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
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.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hongawen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022年10月16日 19:34
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "文件控制管理器")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/file")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class FileController extends BaseController {
|
||||||
|
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("文件上传")
|
||||||
|
@RequestMapping(value = "/upload", method = RequestMethod.POST)
|
||||||
|
public HttpResult<FileVO> upload(@RequestParam(value = "file") MultipartFile file, @RequestParam("path") String path) {
|
||||||
|
String methodDescribe = getMethodDescribe("upload");
|
||||||
|
String ossPath = fileStorageUtil.uploadMultipart(file, path);
|
||||||
|
String url = fileStorageUtil.getFileUrl(ossPath);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new FileVO(ossPath,url), methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除文件服务器文件")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||||
|
public HttpResult<String> delete(String filePath) {
|
||||||
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
|
fileStorageUtil.deleteFile(filePath);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, CommonResponseEnum.SUCCESS.getMessage(), methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("下载文件")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@RequestMapping(value = "/download", method = RequestMethod.GET)
|
||||||
|
public void download(String filePath, HttpServletResponse response) {
|
||||||
|
fileStorageUtil.downloadStream(response, filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取文件的一个短期url")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@RequestMapping(value = "/getFileUrl", method = RequestMethod.GET)
|
||||||
|
public HttpResult<String> getFileUrl(String filePath) {
|
||||||
|
String methodDescribe = getMethodDescribe("getFileUrl");
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, fileStorageUtil.getFileUrl(filePath), methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user