修改了能源模块没有数据/过滤搜索失败/echarts不显示等问题

cron表达式秒/分两位新增默认为0(原来为*)
新增质量模块质检结果、结果详细、详细的详细
master
zhouhy 2 years ago
parent 01de15feab
commit 50857772d0

@ -150,6 +150,33 @@ public class Seq {
//检修计划序列类型
public static final String planRepairSeqType = "PLANREPAIR";
//检修计划接口序列数
private static AtomicInteger planRepairSeq = new AtomicInteger(1);
//检修记录标识
public static final String planRepairCode = "PR";
//检修工单序列类型
public static final String repairInstanceSeqTupe = "REPAIRINSTANCE";
//检修工单接口序列数
private static AtomicInteger repairInstanceSeq = new AtomicInteger(1);
//检修工单标识
public static final String repairInstanceCode = "RI";
//检修计划序列类型
public static final String planInspectSeqType = "PLANINSPECT";
//检修计划接口序列数
private static AtomicInteger planInspectSeq = new AtomicInteger(1);
//检修记录标识
public static final String planInspectCode = "PIC";
//检修工单序列类型
public static final String InspectInstanceSeqTupe = "INSPECTINSTANCE";
//检修工单接口序列数
private static AtomicInteger INSPECTInstanceSeq = new AtomicInteger(1);
//检修工单标识
public static final String InspectInstanceCode = "IIC";
// 保养计划序列类型
public static final String planMaintSeqType = "PLANMAINT";

@ -30,17 +30,7 @@ public class DmsApiController extends BaseController {
//APS-MyPuRz3G6HfBYcH8dw7Y2ai1D6iZRmXX apifox令牌
/**
* PDA-
*
*
* faultSourceType
* faultSourceId
* faultType
* faultDescription
* designOperations
* id deviceId
* repairType
* id outsrcId()
* imgUrl()
* */
@PostMapping("/PDAFault")
@ResponseBody

@ -48,6 +48,12 @@ public class DmsBaseDeviceSuplierController extends BaseController
}
//todo 新加一个con 拿掉分页
@GetMapping("/selectDmsBaseDeviceSuplierByDeviceId")
public AjaxResult selectDmsBaseDeviceSuplierByDeviceId(Long deviceId){
List<DmsBaseDeviceSuplier> dmsBaseDeviceSupliers = dmsBaseDeviceSuplierService.selectDmsBaseDeviceSuplierDeviceId(deviceId);
return success(dmsBaseDeviceSupliers);
}
/**
*
*/

@ -2,6 +2,7 @@ package com.hw.dms.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
@ -44,6 +45,12 @@ public class DmsPlanInspect extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planTime;
/** 时限*/
@Excel(name ="时限")
private Long timeLimit;
/** 关联sysjob主键id */
@Excel(name = "关联sysjob主键id")
private Long jobId;
/** 循环周期 */
@Excel(name = "循环周期")
@ -59,10 +66,49 @@ public class DmsPlanInspect extends BaseEntity
private String cronExpression;
private Long timeLimitDays;
private Long timeLimitHours;
public Long getTimeLimitDays() {
return timeLimitDays;
}
public void setTimeLimitDays(Long timeLimitDays) {
this.timeLimitDays = timeLimitDays;
}
public Long getTimeLimitHours() {
return timeLimitHours;
}
public void setTimeLimitHours(Long timeLimitHours) {
this.timeLimitHours = timeLimitHours;
}
public String getCronExpression() {
return cronExpression;
}
public Long getTimeLimit() {
return timeLimit;
}
public void setTimeLimit(Long timeLimit) {
this.timeLimit = timeLimit;
}
public Long getJobId() {
return jobId;
}
public void setJobId(Long jobId) {
this.jobId = jobId;
}
public void setCronExpression(String cronExpression) {
this.cronExpression = cronExpression;
}
@ -160,22 +206,20 @@ public class DmsPlanInspect extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("planInspectId", getPlanInspectId())
.append("planInspectCode", getPlanInspectCode())
.append("planInspectName", getPlanInspectName())
.append("inspectType", getInspectType())
.append("inspectRouteId", getInspectRouteId())
.append("deviceAmount", getDeviceAmount())
.append("planTime", getPlanTime())
.append("cyclePeriod", getCyclePeriod())
.append("performer", getPerformer())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
return "DmsPlanInspect{" +
"planInspectId=" + planInspectId +
", planInspectCode='" + planInspectCode + '\'' +
", planInspectName='" + planInspectName + '\'' +
", inspectType='" + inspectType + '\'' +
", inspectRouteId=" + inspectRouteId +
", deviceAmount=" + deviceAmount +
", planTime=" + planTime +
", timeLimit=" + timeLimit +
", jobId=" + jobId +
", cyclePeriod='" + cyclePeriod + '\'' +
", performer='" + performer + '\'' +
", isFlag='" + isFlag + '\'' +
", cronExpression='" + cronExpression + '\'' +
'}';
}
}

@ -10,7 +10,7 @@ import com.hw.common.core.web.domain.BaseEntity;
/**
* dms_record_inspect
*
*
* @author Open Platform
* @date 2024-01-16
*/
@ -25,6 +25,8 @@ public class DmsRecordInspect extends BaseEntity
@Excel(name = "巡检单号")
private String billsInspectCode;
/** 计划ID*/
private Long planInspectId;
/** 检查类型(1巡检,2点检) */
@Excel(name = "检查类型(1巡检,2点检)")
private String inspectType;
@ -40,8 +42,11 @@ public class DmsRecordInspect extends BaseEntity
/** 计划巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planTime;
private Date planBeginTime;
/** 计划巡检结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date planEndTime;
/** 实际开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd")
@ -68,135 +73,148 @@ public class DmsRecordInspect extends BaseEntity
@Excel(name = "是否标识1-是0-否")
private String isFlag;
public void setRecordInspectId(Long recordInspectId)
public void setRecordInspectId(Long recordInspectId)
{
this.recordInspectId = recordInspectId;
}
public Long getRecordInspectId()
public Long getRecordInspectId()
{
return recordInspectId;
}
public void setBillsInspectCode(String billsInspectCode)
public void setBillsInspectCode(String billsInspectCode)
{
this.billsInspectCode = billsInspectCode;
}
public String getBillsInspectCode()
public String getBillsInspectCode()
{
return billsInspectCode;
}
public void setInspectType(String inspectType)
public void setInspectType(String inspectType)
{
this.inspectType = inspectType;
}
public String getInspectType()
public String getInspectType()
{
return inspectType;
}
public void setInspectRouteId(Long inspectRouteId)
public void setInspectRouteId(Long inspectRouteId)
{
this.inspectRouteId = inspectRouteId;
}
public Long getInspectRouteId()
public Long getInspectRouteId()
{
return inspectRouteId;
}
public void setDeviceAmount(Long deviceAmount)
public void setDeviceAmount(Long deviceAmount)
{
this.deviceAmount = deviceAmount;
}
public Long getDeviceAmount()
public Long getDeviceAmount()
{
return deviceAmount;
}
public void setPlanTime(Date planTime)
{
this.planTime = planTime;
}
public Date getPlanTime()
{
return planTime;
}
public void setRealBeginTime(Date realBeginTime)
public void setRealBeginTime(Date realBeginTime)
{
this.realBeginTime = realBeginTime;
}
public Date getRealBeginTime()
public Date getRealBeginTime()
{
return realBeginTime;
}
public void setRealEndTime(Date realEndTime)
public void setRealEndTime(Date realEndTime)
{
this.realEndTime = realEndTime;
}
public Date getRealEndTime()
public Date getRealEndTime()
{
return realEndTime;
}
public void setPerformer(String performer)
public void setPerformer(String performer)
{
this.performer = performer;
}
public String getPerformer()
public String getPerformer()
{
return performer;
}
public void setInspectStatus(Long inspectStatus)
public void setInspectStatus(Long inspectStatus)
{
this.inspectStatus = inspectStatus;
}
public Long getInspectStatus()
public Long getInspectStatus()
{
return inspectStatus;
}
public void setInspectDuration(BigDecimal inspectDuration)
public void setInspectDuration(BigDecimal inspectDuration)
{
this.inspectDuration = inspectDuration;
}
public BigDecimal getInspectDuration()
public BigDecimal getInspectDuration()
{
return inspectDuration;
}
public void setIsFlag(String isFlag)
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
public String getIsFlag()
{
return isFlag;
}
public Long getPlanInspectId() {
return planInspectId;
}
public void setPlanInspectId(Long planInspectId) {
this.planInspectId = planInspectId;
}
public Date getPlanBeginTime() {
return planBeginTime;
}
public void setPlanBeginTime(Date planBeginTime) {
this.planBeginTime = planBeginTime;
}
public Date getPlanEndTime() {
return planEndTime;
}
public void setPlanEndTime(Date planEndTime) {
this.planEndTime = planEndTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordInspectId", getRecordInspectId())
.append("billsInspectCode", getBillsInspectCode())
.append("inspectType", getInspectType())
.append("inspectRouteId", getInspectRouteId())
.append("deviceAmount", getDeviceAmount())
.append("planTime", getPlanTime())
.append("realBeginTime", getRealBeginTime())
.append("realEndTime", getRealEndTime())
.append("performer", getPerformer())
.append("inspectStatus", getInspectStatus())
.append("inspectDuration", getInspectDuration())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
return "DmsRecordInspect{" +
"recordInspectId=" + recordInspectId +
", billsInspectCode='" + billsInspectCode + '\'' +
", planInspectId=" + planInspectId +
", inspectType='" + inspectType + '\'' +
", inspectRouteId=" + inspectRouteId +
", deviceAmount=" + deviceAmount +
", planBeginTime=" + planBeginTime +
", planEndTime=" + planEndTime +
", realBeginTime=" + realBeginTime +
", realEndTime=" + realEndTime +
", performer='" + performer + '\'' +
", inspectStatus=" + inspectStatus +
", inspectDuration=" + inspectDuration +
", isFlag='" + isFlag + '\'' +
'}';
}
}

@ -5,15 +5,15 @@ import com.hw.dms.domain.DmsBaseDeviceSuplier;
/**
* Mapper
*
*
* @author xins
* @date 2023-12-28
*/
public interface DmsBaseDeviceSuplierMapper
public interface DmsBaseDeviceSuplierMapper
{
/**
*
*
*
* @param supplierId
* @return
*/
@ -21,7 +21,7 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -29,7 +29,7 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -37,7 +37,7 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -45,7 +45,7 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param supplierId
* @return
*/
@ -53,9 +53,11 @@ public interface DmsBaseDeviceSuplierMapper
/**
*
*
*
* @param supplierIds
* @return
*/
public int deleteDmsBaseDeviceSuplierBySupplierIds(Long[] supplierIds);
List<DmsBaseDeviceSuplier> selectDmsBaseDeviceSuplierDeviceId(Long deviceId);
}

@ -5,15 +5,15 @@ import com.hw.dms.domain.DmsBaseInspectRoute;
/**
* 线Mapper
*
*
* @author Open Platform
* @date 2024-01-16
*/
public interface DmsBaseInspectRouteMapper
public interface DmsBaseInspectRouteMapper
{
/**
* 线
*
*
* @param inspectRouteId 线
* @return 线
*/
@ -21,7 +21,7 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param dmsBaseInspectRoute 线
* @return 线
*/
@ -29,7 +29,7 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param dmsBaseInspectRoute 线
* @return
*/
@ -37,7 +37,7 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param dmsBaseInspectRoute 线
* @return
*/
@ -45,7 +45,7 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param inspectRouteId 线
* @return
*/
@ -53,9 +53,11 @@ public interface DmsBaseInspectRouteMapper
/**
* 线
*
*
* @param inspectRouteIds
* @return
*/
public int deleteDmsBaseInspectRouteByInspectRouteIds(Long[] inspectRouteIds);
Long selectAmountByInspectRouteId(Long InspectRouteId);
}

@ -5,15 +5,15 @@ import com.hw.dms.domain.DmsPlanInspect;
/**
* Mapper
*
*
* @author Open Platform
* @date 2024-01-17
*/
public interface DmsPlanInspectMapper
public interface DmsPlanInspectMapper
{
/**
*
*
*
* @param planInspectId
* @return
*/
@ -21,7 +21,7 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -29,7 +29,7 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -37,7 +37,7 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -45,7 +45,7 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param planInspectId
* @return
*/
@ -53,9 +53,12 @@ public interface DmsPlanInspectMapper
/**
*
*
*
* @param planInspectIds
* @return
*/
public int deleteDmsPlanInspectByPlanInspectIds(Long[] planInspectIds);
DmsPlanInspect selectPlanInspectJoinJobByInspectId(Long planInspectId);
}

@ -1,19 +1,21 @@
package com.hw.dms.service;
import java.util.List;
import com.hw.dms.domain.DmsBaseDeviceBom;
import com.hw.dms.domain.DmsBaseDeviceSuplier;
/**
* Service
*
*
* @author xins
* @date 2023-12-28
*/
public interface IDmsBaseDeviceSuplierService
public interface IDmsBaseDeviceSuplierService
{
/**
*
*
*
* @param supplierId
* @return
*/
@ -21,7 +23,7 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -29,7 +31,7 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -37,7 +39,7 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param dmsBaseDeviceSuplier
* @return
*/
@ -45,7 +47,7 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param supplierIds
* @return
*/
@ -53,9 +55,12 @@ public interface IDmsBaseDeviceSuplierService
/**
*
*
*
* @param supplierId
* @return
*/
public int deleteDmsBaseDeviceSuplierBySupplierId(Long supplierId);
List<DmsBaseDeviceSuplier> selectDmsBaseDeviceSuplierDeviceId(Long deviceId);
}

@ -1,19 +1,21 @@
package com.hw.dms.service;
import java.util.List;
import java.util.function.LongPredicate;
import com.hw.dms.domain.DmsPlanInspect;
/**
* Service
*
*
* @author Open Platform
* @date 2024-01-17
*/
public interface IDmsPlanInspectService
public interface IDmsPlanInspectService
{
/**
*
*
*
* @param planInspectId
* @return
*/
@ -21,7 +23,7 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -29,7 +31,7 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -37,7 +39,7 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param dmsPlanInspect
* @return
*/
@ -45,7 +47,7 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param planInspectIds
* @return
*/
@ -53,9 +55,11 @@ public interface IDmsPlanInspectService
/**
*
*
*
* @param planInspectId
* @return
*/
public int deleteDmsPlanInspectByPlanInspectId(Long planInspectId);
DmsPlanInspect selectPlanInspectJoinJobByInspectId(Long planInspectId);
}

@ -100,4 +100,10 @@ public class DmsBaseDeviceSuplierServiceImpl implements IDmsBaseDeviceSuplierSer
{
return dmsBaseDeviceSuplierMapper.deleteDmsBaseDeviceSuplierBySupplierId(supplierId);
}
@Override
public List<DmsBaseDeviceSuplier> selectDmsBaseDeviceSuplierDeviceId(Long deviceId) {
return dmsBaseDeviceSuplierMapper.selectDmsBaseDeviceSuplierDeviceId(deviceId);
}
}

@ -4,9 +4,14 @@ import java.util.Date;
import java.util.List;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.dms.domain.DmsBaseInspectRoute;
import com.hw.dms.domain.DmsPlanMaint;
import com.hw.dms.mapper.DmsBaseInspectRouteMapper;
import com.hw.job.api.RemoteJobService;
import com.hw.job.api.domain.SysJob;
import com.hw.job.api.util.CronUtils;
@ -30,6 +35,8 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
private DmsPlanInspectMapper dmsPlanInspectMapper;
@Autowired
private RemoteJobService remoteJobService;
@Autowired
private DmsBaseInspectRouteMapper dmsBaseInspectRouteMapper;
/**
*
@ -40,7 +47,17 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
@Override
public DmsPlanInspect selectDmsPlanInspectByPlanInspectId(Long planInspectId)
{
return dmsPlanInspectMapper.selectDmsPlanInspectByPlanInspectId(planInspectId);
DmsPlanInspect dmsPlanInspect = dmsPlanInspectMapper.selectPlanInspectJoinJobByInspectId(planInspectId);
Long timeLimit = dmsPlanInspect.getTimeLimit();
if (timeLimit != null) {
Long days = timeLimit / (24 * 60 * 60l);
Long hours = timeLimit % (24 * 60 * 60l);
// System.out.println(days);
// System.out.println(hours);
dmsPlanInspect.setTimeLimitDays(days);
dmsPlanInspect.setTimeLimitHours(hours / (60 * 60l));
}
return dmsPlanInspect;
}
/**
@ -52,7 +69,13 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
@Override
public List<DmsPlanInspect> selectDmsPlanInspectList(DmsPlanInspect dmsPlanInspect)
{
return dmsPlanInspectMapper.selectDmsPlanInspectList(dmsPlanInspect);
List<DmsPlanInspect> dmsPlanInspects = dmsPlanInspectMapper.selectDmsPlanInspectList(dmsPlanInspect);
for (DmsPlanInspect d : dmsPlanInspects) {
Long timeLimit = d.getTimeLimit();
d.setTimeLimitDays(timeLimit / (24 * 60 * 60L));
d.setTimeLimitHours((timeLimit % (24 * 60 * 60L)) / (60 * 60l));
}
return dmsPlanInspects;
}
/**
@ -64,29 +87,38 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
@Override
public int insertDmsPlanInspect(DmsPlanInspect dmsPlanInspect)
{
String planInspectCode = Seq.getId(Seq.planInspectSeqType, Seq.planInspectCode);
SysJob job = new SysJob();
job.setJobName("点巡检计划编号" + planInspectCode + "工单任务");
job.setJobGroup("DEFAULT");
job.setInvokeTarget("ryTask.getDmsBillsInstance(\"" + planInspectCode + "\")");
job.setCronExpression(dmsPlanInspect.getCronExpression());
job.setMisfirePolicy("1");
job.setConcurrent("1");
job.setStatus("1");
R<Integer> jobIdR = remoteJobService.add(SecurityConstants.INNER, job);
String time = dmsPlanInspect.getCronExpression();
//通过cron表达式获取下一次执行时间
Date nextExecution = CronUtils.getNextExecution(time);
dmsPlanInspect.setPlanTime(nextExecution);
LoginUser user = SecurityUtils.getLoginUser();
dmsPlanInspect.setCreateBy(user.getUsername());
dmsPlanInspect.setPlanInspectCode(planInspectCode);
dmsPlanInspect.setJobId(jobIdR.getData().longValue());
Long timeLimitDays = dmsPlanInspect.getTimeLimitDays()==null?0L:dmsPlanInspect.getTimeLimitDays();
Long timeLimitHours = dmsPlanInspect.getTimeLimitHours() == null?0L:dmsPlanInspect.getTimeLimitHours();
dmsPlanInspect.setTimeLimit((timeLimitDays * 24 * 60 * 60)
+ (timeLimitHours * 60 * 60));
dmsPlanInspect.setIsFlag("1");
dmsPlanInspect.setCreateBy(SecurityUtils.getUsername());
dmsPlanInspect.setCreateTime(DateUtils.getNowDate());
int i = dmsPlanInspectMapper.insertDmsPlanInspect(dmsPlanInspect);
//获取设备总数
Long aLong = dmsBaseInspectRouteMapper.selectAmountByInspectRouteId(dmsPlanInspect.getInspectRouteId());
dmsPlanInspect.setDeviceAmount(aLong);
return dmsPlanInspectMapper.insertDmsPlanInspect(dmsPlanInspect);
List<DmsPlanInspect> dmsPlanInspects = dmsPlanInspectMapper.selectDmsPlanInspectList(dmsPlanInspect);
DmsPlanInspect dmsPlanInspect1 = dmsPlanInspects.get(0);
SysJob job = new SysJob();
job.setJobName("创建计划编号为"+dmsPlanInspect1.getPlanInspectCode()+"工单");
job.setJobGroup("DEFAULT");
job.setInvokeTarget("ryTask.getDmsRepairInstance(\""+dmsPlanInspect1.getPlanInspectId()+"\")");
job.setCronExpression(dmsPlanInspect1.getCronExpression());
job.setMisfirePolicy("1");
job.setConcurrent("1");
job.setStatus("1");
remoteJobService.add(SecurityConstants.INNER,job);
return i;
}
/**
@ -127,4 +159,10 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
{
return dmsPlanInspectMapper.deleteDmsPlanInspectByPlanInspectId(planInspectId);
}
@Override
public DmsPlanInspect selectPlanInspectJoinJobByInspectId(Long planInspectId) {
return dmsPlanInspectMapper.selectPlanInspectJoinJobByInspectId(planInspectId);
}
}

@ -1,7 +1,15 @@
package com.hw.dms.service.impl;
import java.util.Date;
import java.util.List;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.job.api.RemoteJobService;
import com.hw.job.api.domain.SysJob;
import com.hw.job.api.util.CronUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -24,6 +32,9 @@ public class DmsPlanRepairServiceImpl implements IDmsPlanRepairService
@Autowired
private DmsPlanRepairMapper dmsPlanRepairMapper;
@Autowired
private RemoteJobService remoteJobService;
/**
*
*
@ -85,6 +96,23 @@ public class DmsPlanRepairServiceImpl implements IDmsPlanRepairService
public int insertDmsPlanRepair(DmsPlanRepair dmsPlanRepair)
{
// String planRepairCode = Seq.getId(Seq.planRepairSeqType, Seq.planRepairCode);
//
// SysJob job = new SysJob();
// job.setJobName("保养计划编号" + planRepairCode + "工单任务");
// job.setJobGroup("DEFAULT");
// job.setInvokeTarget("ryTask.getDmsRepairInstance(\"" + planRepairCode + "\")");
// job.setCronExpression(dmsPlanRepair.getCronExpression());
// job.setMisfirePolicy("1");
// job.setConcurrent("1");
// job.setStatus("1");
// R<Integer> jobIdR = remoteJobService.add(SecurityConstants.INNER, job);
//
// String time = dmsPlanRepair.getCronExpression();
// Date nextExecution = CronUtils.getNextExecution(time);
// dmsPlanRepair.setRepairTime(nextExecution);
// dmsPlanRepair.setJobId(jobIdR.getData().longValue());
// dmsPlanRepair.setPlanRepairCode(planRepairCode);
dmsPlanRepair.setTimeLimit((dmsPlanRepair.getTimeLimitDays()*24*60*60)
+(dmsPlanRepair.getTimeLimitHours()*60*60));

@ -27,7 +27,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDmsBaseDeviceSuplierList" parameterType="DmsBaseDeviceSuplier" resultMap="DmsBaseDeviceSuplierResult">
select a.supplier_id, a.suplier_code, a.suplier_name, a.suplier_person, a.suplier_tel, a.suplier_address, a.suplier_status, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time
from dms_base_device_suplier a
left join dms_base_device_ledger b on a.supplier_id = b.supplier_id
<where>
<if test="suplierCode != null and suplierCode != ''"> and suplier_code = #{suplierCode}</if>
<if test="suplierName != null and suplierName != ''"> and suplier_name like concat('%', #{suplierName}, '%')</if>
@ -36,7 +35,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="suplierAddress != null and suplierAddress != ''"> and suplier_address = #{suplierAddress}</if>
<if test="suplierStatus != null "> and suplier_status = #{suplierStatus}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="deviceId != null "> and b.device_id = #{deviceId}</if>
</where>
</select>
@ -106,4 +104,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{supplierId}
</foreach>
</delete>
<select id="selectDmsBaseDeviceSuplierDeviceId" parameterType="Long" resultMap="DmsBaseDeviceSuplierResult">
select * from dms_base_device_suplier where supplier_id =
( SELECT supplier_id from dms_base_device_ledger where device_id = #{deviceId} )
</select>
</mapper>

@ -99,4 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{inspectRouteId}
</foreach>
</delete>
<select id="selectAmountByInspectRouteId" parameterType="Long" resultType="Long">
select count(*) from dms_inspect_route_detail where inspect_route_id = #{inspectRouteId}
</select>
</mapper>

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.dms.mapper.DmsPlanInspectMapper">
<resultMap type="DmsPlanInspect" id="DmsPlanInspectResult">
<result property="planInspectId" column="plan_inspect_id" />
<result property="planInspectCode" column="plan_inspect_code" />
@ -12,6 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inspectRouteId" column="inspect_route_id" />
<result property="deviceAmount" column="device_amount" />
<result property="planTime" column="plan_time" />
<result property="timeLimit" column="time_limit" />
<result property="jobId" column="job_id" />
<result property="cyclePeriod" column="cycle_period" />
<result property="performer" column="performer" />
<result property="isFlag" column="is_flag" />
@ -20,32 +22,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="cronExpression" column="cron_expression" />
</resultMap>
<sql id="selectDmsPlanInspectVo">
select plan_inspect_id, plan_inspect_code, plan_inspect_name, inspect_type, inspect_route_id, device_amount, plan_time, cycle_period, performer, is_flag, remark, create_by, create_time, update_by, update_time from dms_plan_inspect
select plan_inspect_id, plan_inspect_code, plan_inspect_name, inspect_type, inspect_route_id, device_amount, plan_time, cycle_period,time_limit,job_id, performer, is_flag, remark, create_by, create_time, update_by, update_time from dms_plan_inspect
</sql>
<select id="selectDmsPlanInspectList" parameterType="DmsPlanInspect" resultMap="DmsPlanInspectResult">
<include refid="selectDmsPlanInspectVo"/>
<where>
<where>
<if test="planInspectCode != null and planInspectCode != ''"> and plan_inspect_code = #{planInspectCode}</if>
<if test="planInspectName != null and planInspectName != ''"> and plan_inspect_name like concat('%', #{planInspectName}, '%')</if>
<if test="inspectType != null and inspectType != ''"> and inspect_type = #{inspectType}</if>
<if test="inspectRouteId != null "> and inspect_route_id = #{inspectRouteId}</if>
<if test="deviceAmount != null "> and device_amount = #{deviceAmount}</if>
<if test="planTime != null "> and plan_time = #{planTime}</if>
<if test="timeLimit != null "> and time_limit = #{timeLimit}</if>
<if test="jobId != null "> and job_id = #{jobId}</if>
<if test="cyclePeriod != null and cyclePeriod != ''"> and cycle_period = #{cyclePeriod}</if>
<if test="performer != null and performer != ''"> and performer = #{performer}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectDmsPlanInspectByPlanInspectId" parameterType="Long" resultMap="DmsPlanInspectResult">
<include refid="selectDmsPlanInspectVo"/>
where plan_inspect_id = #{planInspectId}
</select>
<insert id="insertDmsPlanInspect" parameterType="DmsPlanInspect" useGeneratedKeys="true" keyProperty="planInspectId">
insert into dms_plan_inspect
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -55,6 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectRouteId != null">inspect_route_id,</if>
<if test="deviceAmount != null">device_amount,</if>
<if test="planTime != null">plan_time,</if>
<if test="timeLimit != null">time_limit,</if>
<if test="jobId != null">job_id,</if>
<if test="cyclePeriod != null">cycle_period,</if>
<if test="performer != null">performer,</if>
<if test="isFlag != null and isFlag != ''">is_flag,</if>
@ -71,6 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectRouteId != null">#{inspectRouteId},</if>
<if test="deviceAmount != null">#{deviceAmount},</if>
<if test="planTime != null">#{planTime},</if>
<if test="timeLimit != null">#{timeLimit},</if>
<if test="jobId != null">#{jobId},</if>
<if test="cyclePeriod != null">#{cyclePeriod},</if>
<if test="performer != null">#{performer},</if>
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
@ -91,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectRouteId != null">inspect_route_id = #{inspectRouteId},</if>
<if test="deviceAmount != null">device_amount = #{deviceAmount},</if>
<if test="planTime != null">plan_time = #{planTime},</if>
<if test="timeLimit != null">time_limit = #{timeLimit},</if>
<if test="jobId != null">job_id = #{jobId},</if>
<if test="cyclePeriod != null">cycle_period = #{cyclePeriod},</if>
<if test="performer != null">performer = #{performer},</if>
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
@ -108,9 +120,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteDmsPlanInspectByPlanInspectIds" parameterType="String">
delete from dms_plan_inspect where plan_inspect_id in
delete from dms_plan_inspect where plan_inspect_id in
<foreach item="planInspectId" collection="array" open="(" separator="," close=")">
#{planInspectId}
</foreach>
</delete>
</mapper>
<select id="selectPlanInspectJoinJobByInspectId" parameterType="Long" resultMap="DmsPlanInspectResult">
select a.plan_inspect_id, a.plan_inspect_code, a.plan_inspect_name, a.inspect_type,
a.inspect_route_id, a.device_amount, a.plan_time, a.cycle_period,a.time_limit,a.job_id,
a.performer, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,b.cron_expression from dms_plan_inspect a
left join sys_job b on a.job_id = b.job_id
where a.plan_inspect_id = #{planInspectId}
</select>
</mapper>

@ -6,11 +6,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="DmsRecordInspect" id="DmsRecordInspectResult">
<result property="recordInspectId" column="record_inspect_id" />
<result property="planInspectId" column="plan_inspect_id" />
<result property="billsInspectCode" column="bills_inspect_code" />
<result property="inspectType" column="inspect_type" />
<result property="inspectRouteId" column="inspect_route_id" />
<result property="deviceAmount" column="device_amount" />
<result property="planTime" column="plan_time" />
<result property="planBeginTime" column="plan_begin_time" />
<result property="planEndTime" column="plan_end_time" />
<result property="realBeginTime" column="real_begin_time" />
<result property="realEndTime" column="real_end_time" />
<result property="performer" column="performer" />
@ -25,7 +27,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDmsRecordInspectVo">
select record_inspect_id, bills_inspect_code, inspect_type, inspect_route_id, device_amount, plan_time, real_begin_time, real_end_time, performer, inspect_status, inspect_duration, is_flag, remark, create_by, create_time, update_by, update_time from dms_record_inspect
select record_inspect_id,plan_inspect_id,bills_inspect_code, inspect_type, inspect_route_id, device_amount,
plan_begin_time,plan_end_time, real_begin_time, real_end_time, performer, inspect_status, inspect_duration,
is_flag, remark, create_by, create_time, update_by, update_time from dms_record_inspect
</sql>
<select id="selectDmsRecordInspectList" parameterType="DmsRecordInspect" resultMap="DmsRecordInspectResult">
@ -35,7 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectType != null and inspectType != ''"> and inspect_type = #{inspectType}</if>
<if test="inspectRouteId != null "> and inspect_route_id = #{inspectRouteId}</if>
<if test="deviceAmount != null "> and device_amount = #{deviceAmount}</if>
<if test="planTime != null "> and plan_time = #{planTime}</if>
<if test="planBeginTime != null "> and #{planBeginTime}>=plan_begin_time</if>
<if test="planEndTime != null "> and planEndTime >= #{plan_end_time}</if>
<if test="realBeginTime != null "> and #{realBeginTime}>=real_begin_time</if>
<if test="realEndTime != null "> and real_end_time >= #{realEndTime}</if>
<if test="performer != null and performer != ''"> and performer = #{performer}</if>
@ -54,10 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into dms_record_inspect
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billsInspectCode != null">bills_inspect_code,</if>
<if test="planInspectId != null">plan_inspect_id,</if>
<if test="inspectType != null and inspectType != ''">inspect_type,</if>
<if test="inspectRouteId != null">inspect_route_id,</if>
<if test="deviceAmount != null">device_amount,</if>
<if test="planTime != null">plan_time,</if>
<if test="planBeginTime != null">plan_begin_time,</if>
<if test="planEndTime != null">plan_begin_time,</if>
<if test="realBeginTime != null">real_begin_time,</if>
<if test="realEndTime != null">real_end_time,</if>
<if test="performer != null">performer,</if>
@ -72,10 +79,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billsInspectCode != null">#{billsInspectCode},</if>
<if test="planInspectId != null">#{planInspectId},</if>
<if test="inspectType != null and inspectType != ''">#{inspectType},</if>
<if test="inspectRouteId != null">#{inspectRouteId},</if>
<if test="deviceAmount != null">#{deviceAmount},</if>
<if test="planTime != null">#{planTime},</if>
<if test="planBeginTime != null">#{planBeginTime},</if>
<if test="planEndTime != null">#{planEndTime},</if>
<if test="realBeginTime != null">#{realBeginTime},</if>
<if test="realEndTime != null">#{realEndTime},</if>
<if test="performer != null">#{performer},</if>
@ -94,10 +103,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update dms_record_inspect
<trim prefix="SET" suffixOverrides=",">
<if test="billsInspectCode != null">bills_inspect_code = #{billsInspectCode},</if>
<if test="planInspectCode != null">plan_inspect_id = #{planInspectCode},</if>
<if test="inspectType != null and inspectType != ''">inspect_type = #{inspectType},</if>
<if test="inspectRouteId != null">inspect_route_id = #{inspectRouteId},</if>
<if test="deviceAmount != null">device_amount = #{deviceAmount},</if>
<if test="planTime != null">plan_time = #{planTime},</if>
<if test="planBeginTime != null">plan_begin_time = #{planBeginTime},</if>
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
<if test="performer != null">performer = #{performer},</if>

@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hw.tdengine.api.domain.AlterTagVo;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
/**
@ -84,6 +85,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
* @param baseMonitorInfo
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
//@DS("#header.poolName")
@ -92,14 +94,21 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
if (baseMonitorInfos.size() != 0) {
throw new ServiceException("计量设备编号重复:" + baseMonitorInfo.getMonitorId());
}
//todo 新增父级为空判断,父级为空时会导致创建子表与创建计量设备与类型的对应对象失效
try {
BaseMonitorInfo monitor = baseMonitorInfoMapper.selectBaseMonitorInfoByObjid(baseMonitorInfo.getParentId());
if (baseMonitorInfo.getParentId()==0){
baseMonitorInfo.setAncestors(baseMonitorInfo.getMonitorId());
}
else {
if (monitor != null) {
monitor.setAncestors(monitor.getAncestors() + "," + monitor.getMonitorId());
String[] split = monitor.getAncestors().split(",");
monitor.setGrade(split.length);
if (monitor != null) {
baseMonitorInfo.setAncestors(monitor.getAncestors() + "," + baseMonitorInfo.getMonitorId());
String[] split = baseMonitorInfo.getAncestors().split(",");
monitor.setGrade(split.length);
}
}
this.insertOrUpdateBaseTypeRelation(baseMonitorInfo.getMonitorId(), baseMonitorInfo.getBuildId(),
baseMonitorInfo.getBusinessId(), baseMonitorInfo.getSubentryId());
@ -109,15 +118,18 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
baseMonitorInfo.setCreateTime(DateUtils.getNowDate());
baseMonitorInfo.setCreateBy(SecurityUtils.getUsername());
//修改父级等级
// baseMonitorInfoMapper.updateBaseMonitorInfo(monitor);
int result = baseMonitorInfoMapper.insertBaseMonitorInfo(baseMonitorInfo);
//创建TDEngine子表
this.createEmsTbale(baseMonitorInfo.getMonitorId(), baseMonitorInfo.getBuildId(), baseMonitorInfo.getMonitorName(), baseMonitorInfo.getObjid());
return result;
} catch (Exception e) {
System.out.println("新增计量设备信息异常1111:" + e.getMessage());
//捕获异常时回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return 0;
@ -235,6 +247,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
return result;
} catch (Exception e) {
e.printStackTrace();
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return 0;
}
@ -265,6 +278,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
* @author xins
* @date 2023-12-30 16:50
*/
private void updateTdEngineTable(BaseMonitorInfo baseMonitorInfo, BaseMonitorInfo dbBaseMonitorInfo) {
String databaseName = TdEngineConstants.EMS_DATABASE_NAME;
String tableName = TdEngineConstants.getEmsTableName(baseMonitorInfo.getMonitorId());
@ -301,6 +315,7 @@ public class BaseMonitorInfo1ServiceImpl implements IBaseMonitorInfo1Service {
tdReturnMsg = this.remoteTdEngineService.alterTableTags(alterTagVos, SecurityConstants.INNER);
if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
throw new RuntimeException(tdReturnMsg.getMsg());
}
}

@ -77,9 +77,9 @@ public class RecordDnbInstantController extends BaseController {
*
*/
@RequiresPermissions("record:dnbInstant:list")
@GetMapping("/list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(RecordDnbInstant recordDnbInstant)
public TableDataInfo list(@RequestBody RecordDnbInstant recordDnbInstant)
{
startPage();
RecordDnbInstantDataVo recordDnbInstantDataVo = recordDnbInstantService.selectRecordDnbInstantList(recordDnbInstant);

@ -28,6 +28,7 @@ import com.hw.ems.report.service.IReportPointDnbService;
import com.hw.tdengine.api.RemoteTdEngineService;
import com.hw.tdengine.api.domain.*;
import com.hw.tdengine.api.domain.ems.TdSuperTableEmsSelectVo;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -84,10 +85,24 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
// @DataScope(deptAlias = "null")
public RecordDnbInstantDataVo selectRecordDnbInstantList(RecordDnbInstant recordDnbInstant) {
RecordDnbInstantDataVo recordDnbInstantDataVo = new RecordDnbInstantDataVo();
// recordDnbInstant.setMonitorId(recordDnbInstant.getMonitorSubset());
try {
Integer pageNum = Integer.valueOf((String) recordDnbInstant.getParams().get("pageNum"));
Integer pageSize = Integer.valueOf((String) recordDnbInstant.getParams().get("pageSize"));
// Integer pageNum = Integer.valueOf((String) recordDnbInstant.getParams().get("pageNum"));
Integer pageNum = null;
Integer pageSize = null;
if (recordDnbInstant.getParams().get("pageNum")!=null){
Object pageNum1 = recordDnbInstant.getParams().get("pageNum");
pageNum = Integer.valueOf(String.valueOf(pageNum1));
// pageNum = (Integer) recordDnbInstant.getParams().get("pageNum");
}
if (recordDnbInstant.getParams().get("pageSize")!=null){
//一步转出会导致导出时出现无法转换的错误
Object pageSize1 = recordDnbInstant.getParams().get("pageSize");
pageSize = Integer.valueOf(String.valueOf(pageSize1));
// pageSize = (Integer) recordDnbInstant.getParams().get("pageSize");
}
// Integer pageSize = Integer.valueOf((String) recordDnbInstant.getParams().get("pageSize"));
Integer offset = (pageNum - 1) * pageSize;
List<RecordDnbInstant> records = new ArrayList<RecordDnbInstant>();
BaseMonitorInfo queryMonitorInfo = new BaseMonitorInfo();
@ -97,11 +112,11 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
String endTime = (String) recordDnbInstant.getParams().get("endTime");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//todo 因为手动补录采集时间默认为空,且手动补录页面初始化需要展示出所有的历史数据
if (stratTime==null){
if (stratTime==null||stratTime == ""){
//开始事件设置的足够远,确保可以查询到所有数据
stratTime ="2023-01-01 00:00:00";
}
if (endTime==null){
if (endTime==null || endTime == ""){
//结束事件设置为当前时间
endTime = sdf.format(new Date(System.currentTimeMillis()));
}
@ -119,8 +134,9 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
tdSuperTableCommonSelectVo.setOffset(offset);
tdSuperTableCommonSelectVo.setLimit(pageSize);
Object monitorObjidValue = recordDnbInstant.getParams().get("monitorObjid");
if (monitorObjidValue != null) {
// Object monitorObjidValue = recordDnbInstant.getParams().get("monitorObjid");
Object monitorObjidValue = recordDnbInstant.getObjid();
if (monitorObjidValue != null&&monitorObjidValue !="") {
tdSuperTableCommonSelectVo.setMonitorObjid(Long.valueOf(String.valueOf(monitorObjidValue)));
}
@ -129,11 +145,13 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
return recordDnbInstantDataVo;
}
List<Map<String, Object>> dataList = tdReturnDataVo.getDataList();
//用于记录返回条数来正确分页
Integer flag = 0;
for (Map<String, Object> data : dataList) {
RecordDnbInstant recordDnbInstant1 = new RecordDnbInstant();
recordDnbInstant1.setObjid(Long.valueOf(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITOROBJID))));
recordDnbInstant1.setMonitorId(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITORID)));
recordDnbInstant1.setObjid(Long.valueOf(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITOROBJID))));
recordDnbInstant1.setMonitorName(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITORNAME)));
if (data.get("volatagea")!=null ){
recordDnbInstant1.setVA(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatagea")))));
@ -170,12 +188,24 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
String substring = String.valueOf(data.get("ts")).replaceAll("T", " ").substring(0, 19);
recordDnbInstant1.setCollectTime(sdf.parse(substring));
// recordDnbInstant.setConsumption(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("consumption")))));
if (data.get("reactivepower")!=null ){
if (data.get("collecttype")!=null ){
recordDnbInstant1.setCollectType(Long.valueOf(String.valueOf(data.get("collecttype"))));
}
records.add(recordDnbInstant1);
//从手动补录进入时,会传入一个参数,如果时从手动补录进入,就过滤自动的数据
//目前定义 状态为1是自动的其他都是手动
if (recordDnbInstant.getCollectType()!=null){
if (data.get("collecttype")!=null && recordDnbInstant.getCollectType()==0)
{
if (recordDnbInstant1.getCollectType()!=1){ records.add(recordDnbInstant1);flag+=1;}
}
}
else{
flag+=1;
records.add(recordDnbInstant1);
}
}
recordDnbInstantDataVo.setCount(tdReturnDataVo.getCount());
recordDnbInstantDataVo.setCount(flag);
recordDnbInstantDataVo.setRecordDnbInstants(records);
return recordDnbInstantDataVo;
} catch (ParseException e) {
@ -438,14 +468,21 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
//获取当前数据以及一小时前的数据
tdHistorySelectDto.setTableName(emsTableName);
List<Map<String, Object>> dnbInstant = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER).getData().getDataList();
if (dnbInstant.size()==0){
return;
}
R<TdReturnDataVo> historyData = remoteTdEngineService.getHistoryData(tdHistorySelectDto, SecurityConstants.INNER);
ReportPointDnb report = new ReportPointDnb();
report.setMonitorId(baseMonitorInfo.getMonitorId());
report.setMonitorName(baseMonitorInfo.getMonitorName());
report.setpMonitorId(String.valueOf(baseMonitorInfo.getParentId()));
report.setAddress(baseMonitorInfo.getMonitorAddr());
BigDecimal MaxZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(dnbInstant.size() - 1).get("zxyg"))));
BigDecimal MinZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(0).get("zxyg"))));
BigDecimal MaxZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(dnbInstant.size() - 1).get("zxyg"))));
BigDecimal MinZXYG = BigDecimal.valueOf(Double.valueOf(String.valueOf(dnbInstant.get(0).get("zxyg"))));
//pt ct值暂时无用默认为1 需要时从计量设备信息中根据id获取
int pt = 1;
int ct = 1;
@ -477,5 +514,5 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
}
}

@ -58,9 +58,9 @@ public class ReportPointDnbController extends BaseController {
*
*/
@RequiresPermissions("record:dnbInstant:list")
@GetMapping("/lists")
@PostMapping("/lists")
@ResponseBody
public TableDataInfo lists(ReportPointDnb reportPointDnb)
public TableDataInfo lists(@RequestBody ReportPointDnb reportPointDnb)
{
startPage();
List<ReportPointDnb> list = reportPointDnbService.selectReportPointDnbList(reportPointDnb);

@ -304,7 +304,8 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
*/
@Override
// //@DS("#header.poolName")
public List<Map<String, String>> lineLossAnalysisData(@RequestBody BaseLineLoss baseLineLoss) {
// public List<Map<String, String>> lineLossAnalysisData(@RequestBody BaseLineLoss baseLineLoss) {
public List<Map<String, String>> lineLossAnalysisData(BaseLineLoss baseLineLoss) {
List<Map<String, String>> result = new ArrayList<>();
//todo

@ -65,6 +65,8 @@ public class QmsCheckResultDetail extends BaseEntity
private String saleorderCode;
private List<QmsCheckResultDetailProject> checkResultDetailProjectLists;
/** 质检结果详情项目信息信息 */
private List<QmsCheckResultDetailProject> qmsCheckResultDetailProjectList;

@ -55,7 +55,18 @@ public class QmsCheckResultDetailServiceImpl implements IQmsCheckResultDetailSer
*/
@Override
public List<QmsCheckResultDetail> selectQmsCheckResultDetailList(QmsCheckResultDetail qmsCheckResultDetail) {
return qmsCheckResultDetailMapper.selectQmsCheckResultDetailList(qmsCheckResultDetail);
List<QmsCheckResultDetail> qmsCheckResultDetails = qmsCheckResultDetailMapper.selectQmsCheckResultDetailList(qmsCheckResultDetail);
for (QmsCheckResultDetail q:qmsCheckResultDetails){
QmsCheckResultDetailProject qmsCheckResultDetailProject = new QmsCheckResultDetailProject();
qmsCheckResultDetailProject.setCheckResultDetailId(q.getCheckResultDetailId());
List<QmsCheckResultDetailProject> qmsCheckResultDetailProjects = qmsCheckResultDetailProjectMapper.selectQmsCheckResultDetailProjectList(qmsCheckResultDetailProject);
q.setQmsCheckResultDetailProjectList(qmsCheckResultDetailProjects);
}
return qmsCheckResultDetails;
}
/**

@ -48,23 +48,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectQmsCheckResultVo">
select check_result_id, material_type, material_id, material_batch, check_mode, check_sample, plan_code, plan_detail_code, saleorder_code, po_no, po_line, project_no, check_status, remark, create_by, create_time, update_by, update_time, check_rule_name from qms_check_result
select check_result_id,check_rule_id, material_type, material_id, material_batch, check_mode, check_sample, plan_code, plan_detail_code, saleorder_code, po_no, po_line, project_no, check_status, remark, create_by, create_time, update_by, update_time, check_rule_name from qms_check_result
</sql>
<select id="selectQmsCheckResultList" parameterType="QmsCheckResult" resultMap="QmsCheckResultResult">
<include refid="selectQmsCheckResultVo"/>
<where>
<if test="checkResultId != null and checkResultId != ''"> and check_result_id = #{checkResultId}</if>
<if test="checkRuleName != null and checkRuleName != ''"> and check_rule_name like concat('%',#{checkRuleName},'%') </if>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="materialBatch != null and materialBatch != ''"> and material_batch = #{materialBatch}</if>
<if test="checkMode != null and checkMode != ''"> and check_mode = #{checkMode}</if>
<if test="checkSample != null "> and check_sample = #{checkSample}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planCode != null and planCode != ''"> and plan_code like concat('%',#{planCode},'%') </if>
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code like concat ('%',#{saleorderCode},'%') </if>
<if test="poNo != null and poNo != ''"> and po_no like concat('%',#{poNo},'%') </if>
<if test="poLine != null and poLine != ''"> and po_line = #{poLine}</if>
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
<if test="projectNo != null and projectNo != ''"> and project_no like concat('%',#{projectNo},'%') </if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
</where>
</select>

@ -8,6 +8,14 @@ export function listSuplier(query) {
params: query
})
}
//
export function selectDmsBaseDeviceSuplierByDeviceId(query) {
return request({
url: '/dms/suplier/selectDmsBaseDeviceSuplierByDeviceId',
method: 'get',
params: query
})
}
// 查询设备供应商信息详细
export function getSuplier(supplierId) {

@ -14,7 +14,9 @@ export function listUser(data) {
export function listUsers(data) {
return request({
url: '/ems/report/pointDnb/lists',
method: 'get',
method: 'post',
// data: qs.stringify(data),
// contentType:'application/x-www-form-urlencoded',
data: data,
})
}
@ -28,7 +30,7 @@ export function listUser2(data) {
// contentType:'application/x-www-form-urlencoded',
})
}
// 柱状图1
// 柱状图1-电整点数据能耗统计
export function dnbCountingData(query) {
return request({
url: '/ems/report/board/dnbCountingData',

@ -6,8 +6,8 @@ export function listHistory(query) {
console.log("listUser1:", query);
return request({
url: '/ems/record/dnbInstant/list',
method: 'get',
params: query
method: 'post',
data: query
})
}

@ -57,6 +57,7 @@ export default {
let DDate = this.dateArr[3];
let MDate = this.dateArr[4];
let YDate = this.dateArr[5];
//
let sIdx = this.getIndex(sDate, nSecond);
let mIdx = this.getIndex(mDate, nMin);
@ -448,9 +449,11 @@ export default {
this.dateArr[1] = this.getCycleArr(rule, 60, true)
} else if (rule.indexOf('/') >= 0) {
this.dateArr[1] = this.getAverageArr(rule, 59)
} else if (rule !== '*') {
} else if (rule !== '*' && rule !=='0') {
this.dateArr[1] = this.getAssignArr(rule)
}
} else if (rule =='*'){
this.dateArr[1] = '0';
}
},
// ""
getSecondArr(rule) {
@ -459,9 +462,13 @@ export default {
this.dateArr[0] = this.getCycleArr(rule, 60, true)
} else if (rule.indexOf('/') >= 0) {
this.dateArr[0] = this.getAverageArr(rule, 59)
} else if (rule !== '*') {
} else if (rule !== '*' &&rule!=='0') {
this.dateArr[0] = this.getAssignArr(rule)
}
//0
else if (rule=='*'){
this.dateArr[0] = '0';
}
},
// min-max
getOrderArr(min, max) {

@ -388,6 +388,7 @@ export const dynamicRoutes = [
},
],
},
//审批保养工单路由
{
path: "/dms/dmsMaintInstanceActivity",
@ -513,6 +514,21 @@ export const dynamicRoutes = [
}
]
},
//质检结果详细
{
path: "/qms/base/checkresultdetail",
component: Layout,
hidden: true,
permissions: ["tool:gen:edit"],
children: [
{
path: "index/:checkResultId(\\d+)",
component: () => import("@/views/qms/base/checkresultdetail/index"),
name: "checkResultDetail",
meta: { title: "质检结果详细", activeMenu: "/qms/base/checkresultdetail" },
},
],
},
]

@ -169,7 +169,8 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="父级标识" prop="parentId">
<treeselect v-model="form.parentId" :options="bomOptions" :normalizer="normalizer" placeholder="请选择父级标识" />
<treeselect @input="change" v-model="form.parentId" :options="bomOptions" :normalizer="normalizer"
placeholder="请选择父级标识" />
</el-form-item>
<!-- <el-form-item label="设备ID">-->
<!-- <el-input v-model="form.deviceId" placeholder="请输入设备ID关联dms_base_device_ledger的device_id" />-->
@ -184,7 +185,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="bom数量" prop="bomAmount">
<el-form-item label="bom数量" prop="bomAmount" v-if="isShowBom">
<el-input v-model="form.bomAmount" placeholder="请输入bom数量" />
</el-form-item>
<!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
@ -232,6 +233,7 @@ export default {
children: "children",
label: "typeName"
},
isShowBom:false,
deptName:undefined,
ledgerList:[],
//
@ -286,6 +288,16 @@ export default {
this.getTreeselectDeviceType();
},
methods: {
change(){
if (this.form.parentId != 0){
this.isShowBom = true;
this.form.bomAmount = null;
}
if (this.form.parentId ==0){
this.isShowBom = false;
this.form.bomAmount = 1;
}
},
/** 查询设备台账信息列表 */
getDeviceLedger() {
@ -437,6 +449,7 @@ export default {
this.getList();
});
} else {
addBom(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;

@ -197,7 +197,7 @@
<!-- <el-input v-model="form.deviceId" placeholder="请输入设备ID。关联dms_base_device_ledger的device_id" />-->
<!-- </el-form-item>-->
<el-form-item label="设备名称" prop="deviceId" >
<el-select v-model="form.deviceId" placeholder="请选择设备" :disabled=isDis>
<el-select v-model="form.deviceId" placeholder="请选择设备" >
<el-option
v-for="item in ledgerList"
:key="item.deviceId"

@ -133,18 +133,18 @@
</template>
</el-table-column>
<!-- <el-table-column label="设备类型ID关联dms_base_device_type的device_type_id" align="center" prop="deviceTypeId" />-->
<el-table-column label="设备类型" align="center" prop="deviceTypeId" >
<template slot-scope="scope">
<span
v-for="(item, index) in devicetypeList"
:key="index"
:value="item.devicetypeList"
v-if="scope.row.deviceTypeId == item.deviceTypeId"
>
{{ item.typeName }}
</span>
</template>
</el-table-column>
<!-- <el-table-column label="设备类型" align="center" prop="deviceTypeId" >-->
<!-- <template slot-scope="scope">-->
<!-- <span-->
<!-- v-for="(item, index) in devicetypeList"-->
<!-- :key="index"-->
<!-- :value="item.devicetypeList"-->
<!-- v-if="scope.row.deviceTypeId == item.deviceTypeId"-->
<!-- >-->
<!-- {{ item.typeName }}-->
<!-- </span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="是否标识1-是0-否" align="center" prop="isFlag" />-->
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -199,16 +199,16 @@
<!-- <el-form-item label="设备类型ID关联dms_base_device_type的device_type_id" prop="deviceTypeId">-->
<!-- <el-input v-model="form.deviceTypeId" placeholder="请输入设备类型ID关联dms_base_device_type的device_type_id" />-->
<!-- </el-form-item>-->
<el-form-item label="设备类型" prop="deviceTypeId" >
<el-select v-model="form.deviceTypeId" placeholder="请输入设备类型">
<el-option
v-for="item in devicetypeList"
:key="item.deviceTypeId"
:label="item.typeName"
:value="item.deviceTypeId">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="设备类型" prop="deviceTypeId" >-->
<!-- <el-select v-model="form.deviceTypeId" placeholder="请输入设备类型">-->
<!-- <el-option-->
<!-- v-for="item in devicetypeList"-->
<!-- :key="item.deviceTypeId"-->
<!-- :label="item.typeName"-->
<!-- :value="item.deviceTypeId">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="线路类型" prop="checkState">
<el-radio-group v-model="form.inspectType">
<el-radio

@ -166,8 +166,8 @@
<!-- <el-form-item label="巡检项目ID关联dms_base_inspect_project的inspect_project_id" prop="inspectProjectId">-->
<!-- <el-input v-model="form.inspectProjectId" placeholder="请输入巡检项目ID关联dms_base_inspect_project的inspect_project_id" />-->
<!-- </el-form-item>-->
<el-form-item label="巡检线路" prop="inspectProjectId" >
<el-select v-model="form.inspectProjectId" placeholder="请输入设备类型">
<el-form-item label="巡检项目" prop="inspectProjectId" >
<el-select v-model="form.inspectProjectId" placeholder="请选择巡检项目">
<el-option
v-for="item in dmsBaseInspectProjectList"
:key="item.inspectProjectId"

@ -219,13 +219,13 @@
<!-- <el-form-item label="巡检标准" prop="inspectStandard">-->
<!-- <el-input v-model="form.inspectStandard" placeholder="请输入巡检标准" />-->
<!-- </el-form-item>-->
<el-form-item label="巡检标准" prop="inspectStandard" >
<el-form-item label="巡检标准" prop="inspectStandardId" >
<el-select v-model="form.inspectStandard" placeholder="请输入巡检标准">
<el-option
v-for="item in dmsBaseInspectStandardList"
:key="item.inspectStandardId"
:key="item.inspectStandardId.toString()"
:label="item.standardName"
:value="item.inspectStandardId">
:value="item.inspectStandardId.toString()">
</el-option>
</el-select>
</el-form-item>
@ -321,6 +321,7 @@ export default {
getInspectStandard() {
listDmsBaseInspectStandard(this.queryParams).then(response => {
this.dmsBaseInspectStandardList = response.rows;
console.log(this.dmsBaseInspectStandardList)
});
},
//

@ -64,12 +64,12 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="润滑组别" prop="maintGroup">
<el-form-item label="保养组别" prop="maintGroup">
<el-input v-model="form.maintGroup" placeholder="请输入检修组别" :disabled=true />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="润滑负责人" prop="maintSupervisor">
<el-form-item label="保养负责人" prop="maintSupervisor">
<el-input v-model="form.maintSupervisor" placeholder="请输入检修负责人" :disabled=true />
</el-form-item>
</el-col>

@ -163,6 +163,14 @@
<span>{{ parseTime(scope.row.planTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="时限" align="center" prop="timeLimit" >
<template slot-scope="scope">
<span v-show="scope.row.timeLimitDays!=0&&scope.row.timeLimitDays!=null">{{scope.row.timeLimitDays}}</span>
<span v-show="scope.row.timeLimitHours!=0&&scope.row.timeLimitHours!=null">{{scope.row.timeLimitHours}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="循环周期" align="center" prop="cyclePeriod" />-->
<!-- <el-table-column label="循环周期" align="center" prop="cyclePeriod">-->
<!-- <template slot-scope="scope">-->
@ -213,7 +221,7 @@
<!-- <el-input v-model="form.inspectRouteId" placeholder="请输入巡检线路ID关联dm_base_inspect_route的inspect_route_id" />-->
<!-- </el-form-item>-->
<el-form-item label="巡检线路" prop="inspectRouteId" >
<el-select v-model="form.inspectRouteId" placeholder="请输入设备类型">
<el-select v-model="form.inspectRouteId" placeholder="请选择巡检线路">
<el-option
v-for="item in dmsBaseInspectRouteList"
:key="item.inspectRouteId"
@ -231,9 +239,18 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="设备总数" prop="deviceAmount">
<el-input v-model="form.deviceAmount" placeholder="请输入设备总数" />
<el-form-item label="设备总数" prop="deviceAmount" >
<el-input v-model="form.deviceAmount" placeholder="请输入设备总数" :disabled=true >
</el-input>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="时限" prop="timeLimitDays">
<el-input-number v-model="form.timeLimitDays" placeholder="请输入天数" :precision="0" :min="0" :max="10000"/>
<el-input-number v-model="form.timeLimitHours" placeholder="请输入小时" :precision="0" :min="0" :max="23"/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="计划巡检时间" prop="planTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.planTime"-->

@ -364,7 +364,8 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
</el-table>
<el-table v-loading="loading" :data="supplierList" v-if=deviceSuplierIf>
<el-table v-loading="loading" :data="supplierLists" v-if=deviceSuplierIf>
<!-- <el-table v-loading="loading" :data="supplierLists">-->
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键标识" align="center" prop="supplierId" key="sup5"/>-->
<el-table-column label="供应商编号" align="center" prop="suplierCode" key="sup1"/>
@ -625,7 +626,7 @@
<script>
import { listLedger, getLedger, delLedger, addLedger, updateLedger } from "@/api/dms/ledger";
import { listDevicetype ,selectDevicetypeByDeviceId}from "@/api/dms/devicetype";
import { getSuplier, listSuplier } from '@/api/dms/suplier'
import { getSuplier, listSuplier,selectDmsBaseDeviceSuplierByDeviceId } from '@/api/dms/suplier'
import { listDevicedepreciation } from '@/api/dms/devicedepreciation'
import Treeselect from '@riophae/vue-treeselect'
import { listCheckplan } from '@/api/dms/checkplan'
@ -682,6 +683,7 @@ export default {
installList:[],
//
supplierList:[],
supplierLists:[],
//
title: "",
//
@ -1223,11 +1225,13 @@ export default {
getSuplier(){
listSuplier().then(response => {
this.supplierList = response.rows;
// this.supplierLists = this.supplierList;
})
},
getSuplier2(){
listSuplier(this.queryParams).then(response => {
this.supplierList = response.rows;
selectDmsBaseDeviceSuplierByDeviceId(this.queryParams).then(response => {
this.supplierLists = response.data;
console.log(response)
this.deviceTypeIf = false;
this.deviceSuplierIf = true;
this.deviceInstallIf = false;

@ -98,7 +98,7 @@
<el-form-item label="计划编号" prop="planLubeCode">
<el-input v-model="form.planLubeCode" :disabled="true"/>
</el-form-item>
<el-form-item label="保养级别" prop="lubeLevel">
<el-form-item label="润滑级别" prop="lubeLevel">
<el-radio-group v-model="form.lubeLevel" :disabled="true">
<el-radio
v-for="dict in dict.type.dms_lube_level"
@ -107,8 +107,8 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="保养组别" prop="lubeGroup" >
<el-input v-model="form.lubeGroup" placeholder="请输入保养组别":disabled="true" />
<el-form-item label="润滑组别" prop="lubeGroup" >
<el-input v-model="form.lubeGroup" placeholder="请输入润滑组别":disabled="true" />
</el-form-item>
<el-form-item label="循环周期" prop="cyclePeriod" >
@ -127,19 +127,19 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="保养负责人" prop="lubeSupervisor">
<el-input v-model="form.lubeSupervisor" placeholder="请输入保养负责人" />
<el-form-item label="润滑负责人" prop="lubeSupervisor">
<el-input v-model="form.lubeSupervisor" placeholder="请输入润滑负责人" />
</el-form-item>
<el-form-item label="本次保养时间" prop="lubeTime">
<el-form-item label="本次润滑时间" prop="lubeTime">
<el-date-picker clearable
v-model="form.lubeTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择本次保养时间">
placeholder="请选择本次润滑时间">
</el-date-picker>
</el-form-item>
<el-form-item label="保养状态" prop="lubeStatus">
<el-form-item label="润滑状态" prop="lubeStatus">
<el-radio-group v-model="form.lubeStatus">
<el-radio
v-for="dict in dict.type.dms_lube_status"
@ -175,7 +175,7 @@
</el-select>
</el-form-item>
<el-form-item label="保养部位" prop="lubeStationId" >
<el-form-item label="润滑部位" prop="lubeStationId" >
<el-select v-model="form.lubeStationId" placeholder="请选择设备">
<el-option
v-for="item in stationList"
@ -187,7 +187,7 @@
</el-form-item>
<el-form-item label="保养标准" prop="lubeStandardId" >
<el-form-item label="润滑标准" prop="lubeStandardId" >
<el-select v-model="form.lubeStandardId" placeholder="请选择标准">
<el-option
v-for="item in standardList"
@ -364,7 +364,7 @@ export default {
this.reset();
this.form.planLubeId = this.planLubeId;
this.open = true;
this.title = "添加保养计划明细";
this.title = "添加润滑计划明细";
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -373,7 +373,7 @@ export default {
getDmsPlanLubeDetail(planLubeDetailId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改保养计划明细信息";
this.title = "修改润滑计划明细信息";
});
},
/** 修改按钮操作 */
@ -383,7 +383,7 @@ export default {
getLube(planLubeId).then(response => {
this.form = response.data;
this.openCheck = true;
this.titleCheck = "修改保养计划信息";
this.titleCheck = "修改润滑计划信息";
});
},
/** 提交按钮 */
@ -409,7 +409,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const planLubeDetailIds = row.planLubeDetailId || this.ids;
this.$modal.confirm('是否确认删除保养计划明细编号为"' + planLubeDetailIds + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除润滑计划明细编号为"' + planLubeDetailIds + '"的数据项?').then(function() {
return delDmsPlanLubeDetail(planLubeDetailIds);
}).then(() => {
this.getList();

@ -264,6 +264,7 @@ export default {
getList() {
this.loading = true;
listSuplier(this.queryParams).then(response => {
console.log(response)
this.suplierList = response.rows;
this.total = response.total;
this.loading = false;

@ -32,7 +32,8 @@
<!-- <el-input disabled v-model="unitIdname" />-->
<!-- </div>-->
<!-- </el-form-item>-->
<el-form-item label="统计时间段" prop="status" label-width="auto">
<!-- <el-form-item label="统计时间段" prop="status" label-width="auto">-->
<el-form-item label="统计时间段" prop="status" >
<el-select
v-model="queryParams.type"
placeholder="请选择"
@ -144,27 +145,28 @@
></div>
</el-card>
</el-col>
</el-row>
<el-card style="margin-bottom: 30px" class="box-card">
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
:columns="columns"
></right-toolbar>
</el-row>
<!-- <el-row :gutter="10" class="mb8">-->
<!--&lt;!&ndash; <el-col :span="1.5">&ndash;&gt;-->
<!--&lt;!&ndash; <el-button&ndash;&gt;-->
<!--&lt;!&ndash; type="warning"&ndash;&gt;-->
<!--&lt;!&ndash; plain&ndash;&gt;-->
<!--&lt;!&ndash; icon="el-icon-download"&ndash;&gt;-->
<!--&lt;!&ndash; size="mini"&ndash;&gt;-->
<!--&lt;!&ndash; @click="handleExport"&ndash;&gt;-->
<!--&lt;!&ndash; >导出</el-button&ndash;&gt;-->
<!--&lt;!&ndash; >&ndash;&gt;-->
<!--&lt;!&ndash; </el-col>&ndash;&gt;-->
<!-- <right-toolbar-->
<!-- :showSearch.sync="showSearch"-->
<!-- @queryTable="getList"-->
<!-- :columns="columns"-->
<!-- ></right-toolbar>-->
<!-- </el-row>-->
<!-- 用户表格 -->
<el-table
header-cell-class-name="columnclassname"
@ -628,9 +630,13 @@ export default {
":" +
s1;
//this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1;
this.dateRangeone = this.queryParams.startTime;
this.dateRangetwo = this.queryParams.endTime;
console.log(this.queryParams.startTime)
},
mounted() {
this.handleQuery();
},
methods: {
canceltwo() {
@ -795,12 +801,20 @@ export default {
// console.log('expendSum',this.hejidata)
this.total = response.total;
this.loading = false;
let xData = [];
// console.log('response.rows[0].expendSum', response.rows[0].expendSum)
//echart
let xData = Object.keys(response.rows?.[0]);
// let xData = Object.keys(response.rows?.[0]);
for (var i = 0; i < response.rows.length; i++) {
if (response.rows[i].expendSum != undefined) {
xData = Object.keys(response.rows[i]);
}
}
let xData1 = xData.filter(
(val) =>
!!val && !["unitName", "state", "expendSum", "type"].includes(val)
);
// console.log('xData1',xData1)
let yData = [];
xData1.forEach((val) => {
let num = 0;
@ -810,6 +824,9 @@ export default {
yData.push(parseFloat(num.toFixed(2)) || 0);
});
let xData2 = xData1.map((val) => val.split("expend")[1] + ":00:00");
console.log(xData2);
console.log("============================================================")
let arr = xData2.map((e, index) => {
return {
name: e,
@ -820,7 +837,7 @@ export default {
arr.sort((a, b) => {
return a.time - b.time;
});
let yData1 = arr.map((e) => e.value);
let yData1 = arr.map((e) => e.value);
console.log("///", yData1);
myChart.setOption({
dataZoom: [
@ -864,13 +881,13 @@ export default {
// this.handleQuery();
},
//
canceltwo() {
this.formaaa.monitorName = "";
this.formaaa.monitorId = "";
this.opentwo = false;
//this.reset();
},
// //
// canceltwo() {
// this.formaaa.monitorName = "";
// this.formaaa.monitorId = "";
// this.opentwo = false;
// //this.reset();
// },
//
submitFormtwo: function () {
this.opentwo = false;
@ -888,12 +905,12 @@ export default {
this.timeList = [];
this.energyList = [];
this.timeList.push(
{
title: "用电类型",
field: "type",
align: "center",
rowspan: 2,
},
// {
// title: "",
// field: "type",
// align: "center",
// rowspan: 2,
// },
{
title: "用电类型名称",
field: "unitName",
@ -907,12 +924,20 @@ export default {
rowspan: 2,
}
);
console.log(columns.length);
//
if(columns.length>750){
columns = columns.slice(0,751)
}
for (let i in columns) {
this.timeList.push({
title: columns[i],
align: "center",
colspan: 1,
field: "expend" + columns[i].substring(0, 13),
});
this.energyList.push({
field: "expend" + columns[i].substring(0, 13),
@ -1027,8 +1052,8 @@ export default {
//this.dateRange = [];
this.unitIdname = "";
this.queryParams.unit = "";
this.queryParams.startTime = "";
this.queryParams.endTime = "";
this.queryParams.startTime = this.dateRangeone;
this.queryParams.endTime = this.dateRangetwo;
//this.resetForm("queryForm");
//this.queryParams.deptId = undefined;
//this.$refs.tree.setCurrentKey(null);

@ -85,16 +85,16 @@
>筛选计量设备</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- >导出</el-button-->
<!-- >-->
<!-- </el-col>-->
<div class="total">
<div class="number">合计电量:</div>
<div class="alltotal">
@ -310,6 +310,8 @@ export default {
dateRange: [],
dateRangeone: "",
dateRangetwo: "",
dateRangeoneSelect:"",
dateRangetwoSelect:"",
//
postOptions: [],
deptOptionsselect: [],
@ -428,6 +430,7 @@ export default {
console.log("d", d);
this.dateRangeone = d.getFullYear() + "-" + m + "-" + tian;
this.dateRangeoneSelect = this.dateRangeone;
this.dateRangetwo = new Date(
new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1
);
@ -439,6 +442,7 @@ export default {
let s1 = ("0" + d1.getSeconds()).slice(-2);
console.log("tian1.length", tian1);
this.dateRangetwo = d1.getFullYear() + "-" + m1 + "-" + tian1;
this.dateRangetwoSelect = this.dateRangetwo
//this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1;
this.getList();
@ -466,9 +470,10 @@ export default {
this.queryParams.type = 0;
this.queryParams.energyType = 2;
this.queryParams.relationId = 1;
previewPolyline(this.queryParams).then((res) => {
this.number = res.data.sumEnergyValue;
})
// previewPolyline(this.queryParams).then((res) => {
// this.number = res.data.sumEnergyValue;
// alert("1")
// })
}
this.loading = false;
});
@ -511,7 +516,7 @@ export default {
item, (item.oid = item.id), (item.lable = item.name);
});
this.deptOptionsselect = this.tranListToTreeData(response);
console.log(this.deptOptionsselect);
// console.log(this.deptOptionsselect);
this.opentwo = true;
this.title2 = "设备计量信息选择";
//this.deptOptions = response.data;
@ -604,8 +609,9 @@ export default {
/** 重置按钮操作 */
resetQuery() {
//this.dateRange = [];
this.dateRangeone = "";
this.dateRangetwo = "";
this.dateRangeone = this.dateRangeoneSelect;
this.dateRangetwo = this.dateRangetwoSelect;
this.queryParams.monitorIdList = "";
//this.resetForm("queryForm");
//this.queryParams.deptId = undefined;
//this.$refs.tree.setCurrentKey(null);

@ -189,8 +189,8 @@ export default {
//
queryParams: {
collectType: '',
objid:"",
params:{
monitorObjid:'',
pageNum: 1,
pageSize: 10,
}
@ -349,7 +349,7 @@ export default {
},
//
handleNodeClick(data) {
this.queryParams.params.monitorObjid = data.id;
this.queryParams.objid = data.id;
this.getList();
},
//
@ -391,7 +391,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.params.monitorObjid = '';
this.queryParams.objid = '';
this.dateRangeone = '';
this.dateRangetwo = '';
this.setDataRange();

@ -469,8 +469,19 @@ export default {
//
handleNodeClick(data) {
console.log("data", data);
var flag = 1;
this.queryParams.monitorId = data.monitorId;
this.dynamicTags.push({ label: data.name, value: data.monitorId });
for (var i = 0; i < this.dynamicTags.length; i++) {
if (this.dynamicTags[i].value==this.queryParams.monitorId){
flag = 0;
}
}
if (flag == 1){
this.dynamicTags.push({ label: data.name, value: data.monitorId });
}
console.log(this.dynamicTags)
console.log("====================================================================================")
this.handleQuery();
},
//tag

@ -521,6 +521,8 @@ export default {
//
handleNodeClick(data) {
this.queryParams.monitorSubset = data.monitorId;
console.log(this.queryParams.monitorSubset);
console.log("===================================");
this.getList();
this.dnbCountingData();
},
@ -629,7 +631,7 @@ export default {
delete paramsexport.pageNum;
delete paramsexport.pageSize;
this.download(
"/energy/report/pointDnb/export",
"ems/report/pointDnb/export",
{
...paramsexport,
orderByColumn: null,

@ -378,9 +378,10 @@ export default {
pageNum: 1,
pageSize: 10,
// orderByColumn: "collectTime",
objid:"",
collectType: 0,
// isAsc: "desc",
monitorSubset: "",
monitorId: "",
params: {
beginCollectTime: "",
endCollectTime: "",
@ -451,6 +452,7 @@ export default {
this.queryParams.params.pageNum = this.queryParams.pageNum;
this.queryParams.params.pageSize = this.queryParams.pageSize;
listUser(this.queryParams).then((response) => {
// console.log(response)
this.userList = response.rows;
this.total = response.total;
this.loading = false;
@ -505,7 +507,9 @@ export default {
},
//
handleNodeClick(data) {
this.queryParams.monitorSubset = data.monitorId;
console.log(data)
this.queryParams.objid = data.id;
this.queryParams.monitorId = data.monitorId;
this.handleQuery();
},
//
@ -702,7 +706,7 @@ export default {
delete paramsexport.pageSize;
delete paramsexport.pageNum;
this.download(
"/energy/record/dnbInstant/export",
"ems/record/dnbInstant/export",
{
...paramsexport,
},

@ -128,7 +128,9 @@
/>
</template>
</el-table-column>
<el-table-column label="仪表状态" align="center" prop="meterStatus" />
<!-- 能源也没找到对应的字典也为使用暂时先不使用-->
<!-- <el-table-column label="仪表状态" align="center" prop="meterStatus" />-->
<el-table-column label="终端地址" align="center" prop="meterIp" />
<el-table-column label="心跳频率" align="center" prop="heartInterval" />
<el-table-column
@ -579,7 +581,7 @@ export default {
/** 导出按钮操作 */
handleExport() {
this.download(
"energy/communicate/export",
"ems/communicate/export",
{
...this.queryParams,
},

@ -631,16 +631,16 @@ export default {
children: node.children,
};
},
/** 查询计量设备信息下拉树结构 */
getTreeselect() {
this.queryParams.monitorType = 2;
listShuiMeasurement(this.queryParams).then((response) => {
this.ShuiMeasurementOptions = [];
const data = { objid: 0, monitorName: "顶级节点", children: [] };
data.children = this.handleTree(response.data, "objid", "parentId");
this.ShuiMeasurementOptions.push(data);
});
},
// /** */
// getTreeselect() {
// this.queryParams.monitorType = 2;
// listShuiMeasurement(this.queryParams).then((response) => {
// this.ShuiMeasurementOptions = [];
// const data = { objid: 0, monitorName: "", children: [] };
// data.children = this.handleTree(response.data, "objid", "parentId");
// this.ShuiMeasurementOptions.push(data);
// });
// },
//
cancel() {
this.open = false;

Loading…
Cancel
Save