Merge remote-tracking branch 'origin/master'
commit
352fba7ee2
@ -0,0 +1,197 @@
|
||||
package com.op.system.api.domain.mes;
|
||||
|
||||
import com.op.common.core.annotation.Excel;
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 生产报工物料消耗对象 mes_report_work_consume
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public class MesReportWorkConsumeDTO extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private String recordId;
|
||||
|
||||
/** 工单编码 */
|
||||
@Excel(name = "工单编码")
|
||||
private String workorderCode;
|
||||
|
||||
/** 物料编号 */
|
||||
@Excel(name = "物料编号")
|
||||
private String materialCode;
|
||||
|
||||
/** 物料名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/** 物料规格型号 */
|
||||
@Excel(name = "物料规格型号")
|
||||
private String materialSpc;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private Long quantity;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
/** 预留字段1 */
|
||||
@Excel(name = "预留字段1")
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
@Excel(name = "预留字段2")
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
@Excel(name = "预留字段3")
|
||||
private String attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
@Excel(name = "预留字段4")
|
||||
private String attr4;
|
||||
|
||||
/** 工厂编码 */
|
||||
@Excel(name = "工厂编码")
|
||||
private String factoryCode;
|
||||
|
||||
/** 工厂编码 */
|
||||
@Excel(name = "报工编码")
|
||||
private String reportCode;
|
||||
|
||||
//虚拟字段
|
||||
private String id;
|
||||
|
||||
public void setRecordId(String recordId) {
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public String getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
|
||||
public void setWorkorderCode(String workorderCode) {
|
||||
this.workorderCode = workorderCode;
|
||||
}
|
||||
public String getWorkorderCode() {
|
||||
return workorderCode;
|
||||
}
|
||||
|
||||
public void setReportCode(String reportCode) {
|
||||
this.reportCode = reportCode;
|
||||
}
|
||||
public String getReportCode() {
|
||||
return reportCode;
|
||||
}
|
||||
|
||||
public void setMaterialCode(String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public String getMaterialCode() {
|
||||
return materialCode;
|
||||
}
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
public void setMaterialSpc(String materialSpc) {
|
||||
this.materialSpc = materialSpc;
|
||||
}
|
||||
|
||||
public String getMaterialSpc() {
|
||||
return materialSpc;
|
||||
}
|
||||
public void setQuantity(Long quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Long getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
public void setAttr1(String attr1) {
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1() {
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2) {
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2() {
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(String attr3) {
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public String getAttr3() {
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(String attr4) {
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public String getAttr4() {
|
||||
return attr4;
|
||||
}
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
public String getFactoryCode() {
|
||||
return factoryCode;
|
||||
}
|
||||
|
||||
//虚拟字段
|
||||
public void setId(String factoryCode) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("recordId", getRecordId())
|
||||
.append("id", getId())
|
||||
.append("reportCode", getReportCode())
|
||||
.append("workorderCode", getWorkorderCode())
|
||||
.append("materialCode", getMaterialCode())
|
||||
.append("materialName", getMaterialName())
|
||||
.append("materialSpc", getMaterialSpc())
|
||||
.append("quantity", getQuantity())
|
||||
.append("unit", getUnit())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("factoryCode", getFactoryCode())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.op.system.api.domain.quality;
|
||||
|
||||
import com.op.common.core.annotation.Excel;
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*echart 图标实体
|
||||
* @author zxl
|
||||
* @date 2023-07-18
|
||||
*/
|
||||
public class ChartDTO {
|
||||
private String name;
|
||||
private String type;
|
||||
private List<Double> data;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public List<Double> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<Double> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.op.system.api.domain.sap;
|
||||
|
||||
|
||||
public class SapCloseOrderQuery {
|
||||
private String leadOrder;
|
||||
private String order;
|
||||
|
||||
public String getLeadOrder() {
|
||||
return leadOrder;
|
||||
}
|
||||
|
||||
public void setLeadOrder(String leadOrder) {
|
||||
this.leadOrder = leadOrder;
|
||||
}
|
||||
|
||||
public String getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public void setOrder(String order) {
|
||||
this.order = order;
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.op.device.domain.dto;
|
||||
|
||||
// 看板传参实体
|
||||
public class InterfaceDTO {
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.op.device.domain.vo;
|
||||
|
||||
// 设备信息VO、设备维修质量VO
|
||||
public class IEquipmentVO {
|
||||
// 设备名称
|
||||
private String equipmentName;
|
||||
// 设备编码
|
||||
private String equipmentCode;
|
||||
// 所在部门
|
||||
private String department;
|
||||
// 设备故障率
|
||||
private Double failureRate;
|
||||
// 设备有效利用率
|
||||
private Double utilizationRatio;
|
||||
// 设备维修质量
|
||||
private Double rapairQuantity;
|
||||
// 设备状态
|
||||
private String equipmentStatus;
|
||||
|
||||
public String getEquipmentStatus() {
|
||||
return equipmentStatus;
|
||||
}
|
||||
|
||||
public void setEquipmentStatus(String equipmentStatus) {
|
||||
this.equipmentStatus = equipmentStatus;
|
||||
}
|
||||
|
||||
public Double getRapairQuantity() {
|
||||
return rapairQuantity;
|
||||
}
|
||||
|
||||
public void setRapairQuantity(Double rapairQuantity) {
|
||||
this.rapairQuantity = rapairQuantity;
|
||||
}
|
||||
|
||||
public String getEquipmentName() {
|
||||
return equipmentName;
|
||||
}
|
||||
|
||||
public void setEquipmentName(String equipmentName) {
|
||||
this.equipmentName = equipmentName;
|
||||
}
|
||||
|
||||
public String getEquipmentCode() {
|
||||
return equipmentCode;
|
||||
}
|
||||
|
||||
public void setEquipmentCode(String equipmentCode) {
|
||||
this.equipmentCode = equipmentCode;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public Double getFailureRate() {
|
||||
return failureRate;
|
||||
}
|
||||
|
||||
public void setFailureRate(Double failureRate) {
|
||||
this.failureRate = failureRate;
|
||||
}
|
||||
|
||||
public Double getUtilizationRatio() {
|
||||
return utilizationRatio;
|
||||
}
|
||||
|
||||
public void setUtilizationRatio(Double utilizationRatio) {
|
||||
this.utilizationRatio = utilizationRatio;
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.op.device.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
// 看板维修工单返回VO
|
||||
public class IRepairWorkOrderVO {
|
||||
// 设备名称
|
||||
private String equipmentName;
|
||||
// 设备编码
|
||||
private String equipmentCode;
|
||||
// 故障描述
|
||||
private String workFaultDesc;
|
||||
// 维修班组
|
||||
private String teamName;
|
||||
// 是否立即维修
|
||||
private String workHandle;
|
||||
// 计划维修时间
|
||||
private Date workPlanTime;
|
||||
// 设备位置
|
||||
private String equipmentLocation;
|
||||
|
||||
public String getEquipmentName() {
|
||||
return equipmentName;
|
||||
}
|
||||
|
||||
public void setEquipmentName(String equipmentName) {
|
||||
this.equipmentName = equipmentName;
|
||||
}
|
||||
|
||||
public String getEquipmentCode() {
|
||||
return equipmentCode;
|
||||
}
|
||||
|
||||
public void setEquipmentCode(String equipmentCode) {
|
||||
this.equipmentCode = equipmentCode;
|
||||
}
|
||||
|
||||
public String getWorkFaultDesc() {
|
||||
return workFaultDesc;
|
||||
}
|
||||
|
||||
public void setWorkFaultDesc(String workFaultDesc) {
|
||||
this.workFaultDesc = workFaultDesc;
|
||||
}
|
||||
|
||||
public String getTeamName() {
|
||||
return teamName;
|
||||
}
|
||||
|
||||
public void setTeamName(String teamName) {
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getWorkHandle() {
|
||||
return workHandle;
|
||||
}
|
||||
|
||||
public void setWorkHandle(String workHandle) {
|
||||
this.workHandle = workHandle;
|
||||
}
|
||||
|
||||
public Date getWorkPlanTime() {
|
||||
return workPlanTime;
|
||||
}
|
||||
|
||||
public void setWorkPlanTime(Date workPlanTime) {
|
||||
this.workPlanTime = workPlanTime;
|
||||
}
|
||||
|
||||
public String getEquipmentLocation() {
|
||||
return equipmentLocation;
|
||||
}
|
||||
|
||||
public void setEquipmentLocation(String equipmentLocation) {
|
||||
this.equipmentLocation = equipmentLocation;
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.op.device.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.device.domain.EquOperationRecord;
|
||||
|
||||
/**
|
||||
* 设备运行记录Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-11-27
|
||||
*/
|
||||
public interface EquOperationRecordMapper {
|
||||
/**
|
||||
* 查询设备运行记录
|
||||
*
|
||||
* @param id 设备运行记录主键
|
||||
* @return 设备运行记录
|
||||
*/
|
||||
public EquOperationRecord selectEquOperationRecordById(String id);
|
||||
|
||||
/**
|
||||
* 查询设备运行记录列表
|
||||
*
|
||||
* @param equOperationRecord 设备运行记录
|
||||
* @return 设备运行记录集合
|
||||
*/
|
||||
public List<EquOperationRecord> selectEquOperationRecordList(EquOperationRecord equOperationRecord);
|
||||
|
||||
/**
|
||||
* 新增设备运行记录
|
||||
*
|
||||
* @param equOperationRecord 设备运行记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEquOperationRecord(EquOperationRecord equOperationRecord);
|
||||
|
||||
/**
|
||||
* 修改设备运行记录
|
||||
*
|
||||
* @param equOperationRecord 设备运行记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEquOperationRecord(EquOperationRecord equOperationRecord);
|
||||
|
||||
/**
|
||||
* 删除设备运行记录
|
||||
*
|
||||
* @param id 设备运行记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquOperationRecordById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除设备运行记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquOperationRecordByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 通过设备编码查询设备运行记录
|
||||
* @param equipmentCode
|
||||
* @return
|
||||
*/
|
||||
List<EquOperationRecord> selectEquOperationRecordByEquipmentCode(String equipmentCode);
|
||||
|
||||
//设备稳定性 MTBF设备平均故障间隔
|
||||
List<EquOperationRecord> getMTBFList(EquOperationRecord equOperationRecord);
|
||||
|
||||
//设备完好率
|
||||
EquOperationRecord getEquipmentIntactRate(EquOperationRecord equOperationRecord);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
<?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.op.device.mapper.DeviceInterfaceMapper">
|
||||
|
||||
<select id="selectEquRepairWorkOrderList" resultType="com.op.device.domain.vo.IRepairWorkOrderVO">
|
||||
select be.equipment_name AS "equipmentName",
|
||||
wo.equipment_code AS "equipmentCode",
|
||||
wo.work_fault_desc AS "workFaultDesc",
|
||||
et.team_name AS "teamName",
|
||||
wo.work_handle AS "workHandle",
|
||||
wo.work_plan_time AS "workPlanTime",
|
||||
be.equipment_location AS "equipmentLocation"
|
||||
from equ_repair_work_order wo
|
||||
left join base_equipment be
|
||||
on wo.equipment_code = be.equipment_code
|
||||
left join equ_team et
|
||||
on wo.work_team = et.team_code
|
||||
where wo.work_status = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO">
|
||||
select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName',be.equipment_status AS 'equipmentStatus'
|
||||
from base_equipment be
|
||||
where be.equipment_code in (select wo.equipment_code
|
||||
from equ_repair_work_order wo
|
||||
where wo.del_flag = '0'
|
||||
and wo.work_status = '1'
|
||||
GROUP BY wo.equipment_code)
|
||||
</select>
|
||||
|
||||
<select id="selectRepairEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO">
|
||||
select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName'
|
||||
from base_equipment be
|
||||
where be.equipment_code in (select wo.equipment_code
|
||||
from equ_repair_work_order wo
|
||||
where wo.del_flag = '0'
|
||||
and wo.work_status = '1'
|
||||
GROUP BY wo.equipment_code)
|
||||
</select>
|
||||
|
||||
<select id="selectReportWorkByEquipmentCode" resultType="com.op.device.domain.MesReportWork">
|
||||
select SUM(mrw.quantity) AS "quantity",
|
||||
SUM(mrw.quantity_feedback) AS "quantityFeedback"
|
||||
from mes_report_work mrw
|
||||
where mrw.del_flag = '0'
|
||||
and mrw.status = 'PREPARE'
|
||||
and mrw.machine_code = #{equipmentCode}
|
||||
and mrw.feedback_time >= DATEADD(MONTH, -1, GETDATE())
|
||||
</select>
|
||||
|
||||
<select id="selectRepairRecordByEquipmentCode" resultType="com.op.device.domain.EquRepairWorkOrder">
|
||||
select wo.work_start_time AS "workStartTime", wo.work_end_time AS "workEndTime"
|
||||
from equ_repair_work_order wo
|
||||
where wo.del_flag = '0'
|
||||
and wo.equipment_code = #{equipmentCode}
|
||||
and wo.work_status = '1'
|
||||
</select>
|
||||
|
||||
<select id="getDeviceRefreshTime" resultType="java.lang.String">
|
||||
select dict_value
|
||||
from sys_dict_data
|
||||
where dict_label = 'device_refresh_time'
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,182 @@
|
||||
<?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.op.device.mapper.EquOperationRecordMapper">
|
||||
|
||||
<resultMap type="EquOperationRecord" id="EquOperationRecordResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="equipmentCode" column="equipment_code"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="maintenanceType" column="maintenance_type"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="factoryCode" column="factory_code"/>
|
||||
<result property="attr1" column="attr1"/>
|
||||
<result property="attr2" column="attr2"/>
|
||||
<result property="attr3" column="attr3"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEquOperationRecordVo">
|
||||
select id,
|
||||
equipment_code,
|
||||
start_time,
|
||||
end_time,
|
||||
type,
|
||||
maintenance_type,
|
||||
parent_id,
|
||||
factory_code,
|
||||
attr1,
|
||||
attr2,
|
||||
attr3,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from equ_operation_record
|
||||
</sql>
|
||||
|
||||
<select id="selectEquOperationRecordList" parameterType="EquOperationRecord" resultMap="EquOperationRecordResult">
|
||||
<include refid="selectEquOperationRecordVo"/>
|
||||
<where>
|
||||
<if test="equipmentCode != null and equipmentCode != ''">and equipment_code = #{equipmentCode}</if>
|
||||
<if test="startTime != null ">and start_time = #{startTime}</if>
|
||||
<if test="endTime != null ">and end_time = #{endTime}</if>
|
||||
<if test="type != null and type != ''">and type = #{type}</if>
|
||||
<if test="maintenanceType != null and maintenanceType != ''">and maintenance_type = #{maintenanceType}</if>
|
||||
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
|
||||
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
|
||||
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
|
||||
<if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEquOperationRecordById" parameterType="String" resultMap="EquOperationRecordResult">
|
||||
<include refid="selectEquOperationRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectEquOperationRecordByEquipmentCode" resultType="com.op.device.domain.EquOperationRecord">
|
||||
select eor.start_time AS "startTime",
|
||||
eor.end_time AS "endTime",
|
||||
eor.maintenance_type AS "maintenanceType",
|
||||
eor.type AS "type"
|
||||
from equ_operation_record eor
|
||||
where eor.del_flag = '0'
|
||||
and eor.end_time is not null
|
||||
and eor.equipment_code = #{equipmentCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertEquOperationRecord" parameterType="EquOperationRecord">
|
||||
insert into equ_operation_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="equipmentCode != null">equipment_code,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="maintenanceType != null">maintenance_type,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="equipmentCode != null">#{equipmentCode},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="maintenanceType != null">#{maintenanceType},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEquOperationRecord" parameterType="EquOperationRecord">
|
||||
update equ_operation_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="maintenanceType != null">maintenance_type = #{maintenanceType},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEquOperationRecordById" parameterType="String">
|
||||
delete
|
||||
from equ_operation_record
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEquOperationRecordByIds" parameterType="String">
|
||||
delete from equ_operation_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!--设备稳定性 MTBF-->
|
||||
<select id="getMTBFList" parameterType="EquOperationRecord" resultType="com.op.device.domain.EquOperationRecord">
|
||||
select
|
||||
row_number() over (ORDER BY sum(CASE WHEN eor.type = 'on' THEN cast(datediff(minute, eor.start_time,eor.end_time)*1.0/60 as decimal(10,2)) ELSE null END )/sum(CASE WHEN type = 'off' THEN 1 ELSE 0 END) DESC) AS serialNumber,
|
||||
eor.equipment_code AS equipmentCode,
|
||||
sum(CASE WHEN eor.type = 'on' THEN cast(datediff(minute, eor.start_time,eor.end_time)*1.0/60 as decimal(10,2)) ELSE null END ) AS onTime,
|
||||
sum(CASE WHEN eor.type = 'off' THEN 1 ELSE 0 END) AS shutDownNumber,
|
||||
cast(sum(CASE WHEN eor.type = 'on' THEN datediff(minute, eor.start_time,eor.end_time)*1.0/60 ELSE null END )/sum(CASE WHEN type = 'off' THEN 1 ELSE 0 END)as decimal(10,2)) as mtbf
|
||||
from equ_operation_record eor
|
||||
left join base_equipment be on eor.equipment_code = be.equipment_code
|
||||
where be.status = '1'
|
||||
and be.del_flag = '0'
|
||||
and eor.start_time is not null
|
||||
and eor.end_time is not null
|
||||
GROUP BY eor.equipment_code
|
||||
ORDER BY onTime desc
|
||||
</select>
|
||||
|
||||
<!--完好设备占比-->
|
||||
<select id="getEquipmentIntactRate" parameterType="EquOperationRecord" resultType="com.op.device.domain.EquOperationRecord">
|
||||
SELECT
|
||||
SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END) AS operationEquipment,
|
||||
SUM(CASE WHEN equipment_status = '0' or equipment_status = '0' THEN 1 Else 0 END) AS faultEquipment,
|
||||
COUNT(*) AS totalEquipment,
|
||||
CONCAT(cast(SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END)*100/COUNT(*)as decimal(10,2)),'%') AS intactRate
|
||||
FROM base_equipment
|
||||
WHERE del_flag = '0' AND status = '1'
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,51 @@
|
||||
package com.op.energy.base.config;
|
||||
|
||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
|
||||
import com.op.common.core.domain.R;
|
||||
import com.op.common.datasource.creator.DynamicDatasourceCreator;
|
||||
import com.op.system.api.RemoteUserService;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 初始化动态数据源
|
||||
*
|
||||
* @ClassName: DynamicDatasource
|
||||
* @Description: TODO
|
||||
* @author shichangzhou
|
||||
* @date 2023年4月19日 下午1:01:30
|
||||
*/
|
||||
@Component
|
||||
public class DynamicDatasource {
|
||||
|
||||
@Resource
|
||||
private DynamicDatasourceCreator dynamicDatasourceCreator;
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// 加载sf-cloud库的sys_datasource
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserId(1L);
|
||||
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
|
||||
List<Map<String, String>> dateSources = dateSources0.getData();
|
||||
for (Map<String, String> dateSource : dateSources) {
|
||||
DataSourceProperty sdp = new DataSourceProperty();
|
||||
sdp.setUrl(dateSource.get("url"));
|
||||
sdp.setUsername(dateSource.get("userName"));
|
||||
sdp.setPassword(dateSource.get("password"));
|
||||
sdp.setDriverClassName(dateSource.get("driveClassName"));
|
||||
sdp.setPoolName(dateSource.get("poolName"));// 这是数据源的key
|
||||
sdp.setLazy(false);
|
||||
dynamicDatasourceCreator.createDynamicDataSource(sdp);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.op.energy.base.controller;
|
||||
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.energy.base.domain.BaseBuildInfo;
|
||||
import com.op.energy.base.domain.Ztree;
|
||||
import com.op.energy.base.service.IBaseBuildInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 建筑信息管理Controller
|
||||
*
|
||||
* @author YinQ
|
||||
* @date 2023-05-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/buildInfo")
|
||||
public class BaseBuildInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseBuildInfoService baseBuildInfoService;
|
||||
|
||||
/**
|
||||
* 查询建筑信息管理列表
|
||||
*/
|
||||
@RequiresPermissions("base:buildInfo:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BaseBuildInfo baseBuildInfo) {
|
||||
List<BaseBuildInfo> list = baseBuildInfoService.selectBaseBuildInfoList(baseBuildInfo);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出建筑信息管理列表
|
||||
*/
|
||||
@RequiresPermissions("base:buildInfo:export")
|
||||
@Log(title = "建筑信息管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseBuildInfo baseBuildInfo) {
|
||||
List<BaseBuildInfo> list = baseBuildInfoService.selectBaseBuildInfoList(baseBuildInfo);
|
||||
ExcelUtil<BaseBuildInfo> util = new ExcelUtil<BaseBuildInfo>(BaseBuildInfo.class);
|
||||
util.exportExcel(response, list, "建筑信息管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取建筑信息管理详细信息
|
||||
*/
|
||||
@RequiresPermissions("base:buildInfo:query")
|
||||
@GetMapping(value = "/{objid}")
|
||||
public AjaxResult getInfo(@PathVariable("objid") Long objid) {
|
||||
return success(baseBuildInfoService.selectBaseBuildInfoByObjid(objid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增建筑信息管理
|
||||
*/
|
||||
@RequiresPermissions("base:buildInfo:add")
|
||||
@Log(title = "建筑信息管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseBuildInfo baseBuildInfo) {
|
||||
return toAjax(baseBuildInfoService.insertBaseBuildInfo(baseBuildInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改建筑信息管理
|
||||
*/
|
||||
@RequiresPermissions("base:buildInfo:edit")
|
||||
@Log(title = "建筑信息管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseBuildInfo baseBuildInfo) {
|
||||
return toAjax(baseBuildInfoService.updateBaseBuildInfo(baseBuildInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除建筑信息管理
|
||||
*/
|
||||
@RequiresPermissions("base:buildInfo:remove")
|
||||
@Log(title = "建筑信息管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objids}")
|
||||
public AjaxResult remove(@PathVariable Long[] objids) {
|
||||
return toAjax(baseBuildInfoService.deleteBaseBuildInfoByObjids(objids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载建筑信息管理树列表
|
||||
*/
|
||||
@GetMapping("/treeData")
|
||||
@ResponseBody
|
||||
public List<Ztree> treeData() {
|
||||
List<Ztree> ztrees = baseBuildInfoService.selectBaseBuildInfoTree();
|
||||
return ztrees;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package com.op.energy.base.controller;
|
||||
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.energy.base.domain.BaseBusinessType;
|
||||
import com.op.energy.base.domain.Ztree;
|
||||
import com.op.energy.base.service.IBaseBusinessTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业态类型管理Controller
|
||||
*
|
||||
* @author YinQ
|
||||
* @date 2023-05-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/businessType")
|
||||
public class BaseBusinessTypeController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseBusinessTypeService baseBusinessTypeService;
|
||||
|
||||
/**
|
||||
* 查询业态类型管理列表
|
||||
*/
|
||||
@RequiresPermissions("base:businessType:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BaseBusinessType baseBusinessType) {
|
||||
List<BaseBusinessType> list = baseBusinessTypeService.selectBaseBusinessTypeList(baseBusinessType);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出业态类型管理列表
|
||||
*/
|
||||
@RequiresPermissions("base:businessType:export")
|
||||
@Log(title = "业态类型管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseBusinessType baseBusinessType) {
|
||||
List<BaseBusinessType> list = baseBusinessTypeService.selectBaseBusinessTypeList(baseBusinessType);
|
||||
ExcelUtil<BaseBusinessType> util = new ExcelUtil<BaseBusinessType>(BaseBusinessType.class);
|
||||
util.exportExcel(response, list, "业态类型管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取业态类型管理详细信息
|
||||
*/
|
||||
@RequiresPermissions("base:businessType:query")
|
||||
@GetMapping(value = "/{objid}")
|
||||
public AjaxResult getInfo(@PathVariable("objid") Long objid) {
|
||||
return success(baseBusinessTypeService.selectBaseBusinessTypeByObjid(objid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增业态类型管理
|
||||
*/
|
||||
@RequiresPermissions("base:businessType:add")
|
||||
@Log(title = "业态类型管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseBusinessType baseBusinessType) {
|
||||
return toAjax(baseBusinessTypeService.insertBaseBusinessType(baseBusinessType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改业态类型管理
|
||||
*/
|
||||
@RequiresPermissions("base:businessType:edit")
|
||||
@Log(title = "业态类型管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseBusinessType baseBusinessType) {
|
||||
return toAjax(baseBusinessTypeService.updateBaseBusinessType(baseBusinessType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除业态类型管理
|
||||
*/
|
||||
@RequiresPermissions("base:businessType:remove")
|
||||
@Log(title = "业态类型管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objids}")
|
||||
public AjaxResult remove(@PathVariable Long[] objids) {
|
||||
return toAjax(baseBusinessTypeService.deleteBaseBusinessTypeByObjids(objids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载业态类型管理树列表
|
||||
*/
|
||||
@GetMapping("/treeData")
|
||||
@ResponseBody
|
||||
public List<Ztree> treeData() {
|
||||
List<Ztree> ztrees = baseBusinessTypeService.selectBaseBusinessTypeTree();
|
||||
return ztrees;
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.op.energy.base.controller;
|
||||
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.energy.base.domain.BaseCollectCommunicate;
|
||||
import com.op.energy.base.service.IBaseCollectCommunicateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 集中器通讯信息Controller
|
||||
*
|
||||
* @author sf
|
||||
* @date 2023-04-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/communicate")
|
||||
public class BaseCollectCommunicateController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseCollectCommunicateService baseCollectCommunicateService;
|
||||
|
||||
/**
|
||||
* 查询集中器通讯信息列表
|
||||
*/
|
||||
@RequiresPermissions("energy:communicate:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseCollectCommunicate baseCollectCommunicate) {
|
||||
startPage();
|
||||
List<BaseCollectCommunicate> list = baseCollectCommunicateService.selectBaseCollectCommunicateList(baseCollectCommunicate);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出集中器通讯信息列表
|
||||
*/
|
||||
@RequiresPermissions("energy:communicate:export")
|
||||
@Log(title = "集中器通讯信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseCollectCommunicate baseCollectCommunicate) {
|
||||
List<BaseCollectCommunicate> list = baseCollectCommunicateService.selectBaseCollectCommunicateList(baseCollectCommunicate);
|
||||
ExcelUtil<BaseCollectCommunicate> util = new ExcelUtil<BaseCollectCommunicate>(BaseCollectCommunicate.class);
|
||||
util.exportExcel(response, list, "集中器通讯信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取集中器通讯信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("energy:communicate:query")
|
||||
@GetMapping(value = "/{objid}")
|
||||
public AjaxResult getInfo(@PathVariable("objid") Long objid) {
|
||||
return success(baseCollectCommunicateService.selectBaseCollectCommunicateByObjid(objid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增集中器通讯信息
|
||||
*/
|
||||
@RequiresPermissions("energy:communicate:add")
|
||||
@Log(title = "集中器通讯信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseCollectCommunicate baseCollectCommunicate) {
|
||||
return toAjax(baseCollectCommunicateService.insertBaseCollectCommunicate(baseCollectCommunicate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改集中器通讯信息
|
||||
*/
|
||||
@RequiresPermissions("energy:communicate:edit")
|
||||
@Log(title = "集中器通讯信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseCollectCommunicate baseCollectCommunicate) {
|
||||
return toAjax(baseCollectCommunicateService.updateBaseCollectCommunicate(baseCollectCommunicate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除集中器通讯信息
|
||||
*/
|
||||
@RequiresPermissions("energy:communicate:remove")
|
||||
@Log(title = "集中器通讯信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objids}")
|
||||
public AjaxResult remove(@PathVariable Long[] objids) {
|
||||
return toAjax(baseCollectCommunicateService.deleteBaseCollectCommunicateByObjids(objids));
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.op.energy.base.controller;
|
||||
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.energy.base.domain.BaseCollectDeviceInfo;
|
||||
import com.op.energy.base.service.IBaseCollectDeviceInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采集设备信息Controller
|
||||
*
|
||||
* @author sf
|
||||
* @date 2023-04-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
public class BaseCollectDeviceInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseCollectDeviceInfoService baseCollectDeviceInfoService;
|
||||
|
||||
/**
|
||||
* 查询采集设备信息列表
|
||||
*/
|
||||
@RequiresPermissions("energy:info:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseCollectDeviceInfo baseCollectDeviceInfo) {
|
||||
startPage();
|
||||
List<BaseCollectDeviceInfo> list = baseCollectDeviceInfoService.selectBaseCollectDeviceInfoList(baseCollectDeviceInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出采集设备信息列表
|
||||
*/
|
||||
@RequiresPermissions("energy:info:export")
|
||||
@Log(title = "采集设备信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseCollectDeviceInfo baseCollectDeviceInfo) {
|
||||
List<BaseCollectDeviceInfo> list = baseCollectDeviceInfoService.selectBaseCollectDeviceInfoList(baseCollectDeviceInfo);
|
||||
ExcelUtil<BaseCollectDeviceInfo> util = new ExcelUtil<BaseCollectDeviceInfo>(BaseCollectDeviceInfo.class);
|
||||
util.exportExcel(response, list, "采集设备信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采集设备信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("energy:info:query")
|
||||
@GetMapping(value = "/{objid}")
|
||||
public AjaxResult getInfo(@PathVariable("objid") Long objid) {
|
||||
return success(baseCollectDeviceInfoService.selectBaseCollectDeviceInfoByObjid(objid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采集设备信息
|
||||
*/
|
||||
@RequiresPermissions("energy:info:add")
|
||||
@Log(title = "采集设备信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseCollectDeviceInfo baseCollectDeviceInfo) {
|
||||
return toAjax(baseCollectDeviceInfoService.insertBaseCollectDeviceInfo(baseCollectDeviceInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采集设备信息
|
||||
*/
|
||||
@RequiresPermissions("energy:info:edit")
|
||||
@Log(title = "采集设备信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseCollectDeviceInfo baseCollectDeviceInfo) {
|
||||
return toAjax(baseCollectDeviceInfoService.updateBaseCollectDeviceInfo(baseCollectDeviceInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除采集设备信息
|
||||
*/
|
||||
@RequiresPermissions("energy:info:remove")
|
||||
@Log(title = "采集设备信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objids}")
|
||||
public AjaxResult remove(@PathVariable Long[] objids) {
|
||||
return toAjax(baseCollectDeviceInfoService.deleteBaseCollectDeviceInfoByObjids(objids));
|
||||
}
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package com.op.energy.base.controller;
|
||||
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.energy.base.domain.BaseDnbThreshold;
|
||||
import com.op.energy.base.domain.BaseMonitorInfo;
|
||||
import com.op.energy.base.service.IBaseDnbThresholdService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电阈值信息Controller
|
||||
*
|
||||
* @author sf
|
||||
* @date 2023-04-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dnbThreshold")
|
||||
public class BaseDnbThresholdController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseDnbThresholdService baseDnbThresholdService;
|
||||
|
||||
/**
|
||||
* 查询电阈值信息列表
|
||||
*/
|
||||
@RequiresPermissions("energy:dnbThreshold:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseDnbThreshold baseDnbThreshold) {
|
||||
startPage();
|
||||
List<BaseDnbThreshold> list = baseDnbThresholdService.selectBaseDnbThresholdList(baseDnbThreshold);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电阈值信息列表
|
||||
*/
|
||||
@RequiresPermissions("energy:dnbThreshold:export")
|
||||
@Log(title = "电阈值信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseDnbThreshold baseDnbThreshold) {
|
||||
List<BaseDnbThreshold> list = baseDnbThresholdService.selectBaseDnbThresholdList(baseDnbThreshold);
|
||||
ExcelUtil<BaseDnbThreshold> util = new ExcelUtil<BaseDnbThreshold>(BaseDnbThreshold.class);
|
||||
util.exportExcel(response, list, "电阈值信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电阈值信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("energy:dnbThreshold:query")
|
||||
@GetMapping(value = "/{objid}")
|
||||
public AjaxResult getInfo(@PathVariable("objid") Long objid) {
|
||||
return success(baseDnbThresholdService.selectBaseDnbThresholdByObjid(objid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电阈值信息
|
||||
*/
|
||||
@RequiresPermissions("energy:dnbThreshold:add")
|
||||
@Log(title = "电阈值信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseDnbThreshold baseDnbThreshold) {
|
||||
return toAjax(baseDnbThresholdService.insertBaseDnbThreshold(baseDnbThreshold));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电阈值信息
|
||||
*/
|
||||
@RequiresPermissions("energy:dnbThreshold:edit")
|
||||
@Log(title = "电阈值信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseDnbThreshold baseDnbThreshold) {
|
||||
return toAjax(baseDnbThresholdService.updateBaseDnbThreshold(baseDnbThreshold));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电阈值信息
|
||||
*/
|
||||
@RequiresPermissions("energy:dnbThreshold:remove")
|
||||
@Log(title = "电阈值信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objids}")
|
||||
public AjaxResult remove(@PathVariable Long[] objids) {
|
||||
return toAjax(baseDnbThresholdService.deleteBaseDnbThresholdByObjids(objids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计量设备树列表
|
||||
*/
|
||||
@GetMapping("/monitorTree")
|
||||
public AjaxResult monitorTree(BaseMonitorInfo baseMonitorInfo) {
|
||||
return success(baseDnbThresholdService.selectMonitorTreeList(baseMonitorInfo));
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue