修改设备维修工单导出数据

master
Yangwl 3 days ago
parent 85f13340ed
commit 5c2c127964

@ -51,4 +51,7 @@ public interface RemoteMesService {
@PostMapping("/reportWorks/mesProTask")
public R mesProTask();
@PostMapping("/reportWorks/updateEquRunTime")
public R updateEquRunTime();
}

@ -77,6 +77,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
return R.fail("+生产情况企业微信提醒失败:" + throwable.getMessage());
}
@Override
public R updateEquRunTime() {
return R.fail("+更新设备的运行时间失败:" + throwable.getMessage());
}
};
}

@ -20,85 +20,75 @@ import com.op.common.core.web.domain.BaseEntity;
public class EquRepairWorkOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "维修主键")
private String workId;
@Excel(name = "报修主键")
private String orderId;
@Excel(name = "维修单号")
private String workCode;
//0待维修 1维修完成 2维修中 3维修未完成
@Excel(name = "维修状态",readConverterExp = "0=待维修,1=维修完成,2=维修中,3=维修未完成")
private String workStatus;
@Excel(name = "审核状态",readConverterExp = "1=审核通过,0=未通过,2待检验")
private String resultInspect;
@Excel(name = "审核意见")
private String auditOpinion;
@Excel(name = "报修单号")
private String orderCode;
@Excel(name = "是否立即处理")
private String workHandle;
@Excel(name = "设备名称")
private String equipmentName;//设备名称
@Excel(name = "设备编码")
private String equipmentCode;
@Excel(name = "故障描述")
private String workFaultDesc;
private String orderDesc;//故障描述
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanTime;
@Excel(name = "是否停机维修",readConverterExp = "1=是,0=否")
private String workDownMachine;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanDownTime;
@Excel(name = "关联计划")
private String orderRelevance;
@Excel(name = "维修人员工号")
private String workPerson;
@Excel(name = "维修人员姓名")
private String workPersonName;
@Excel(name = "维修组")
private String workTeam;
@Excel(name = "是否委外")
@Excel(name = "班组名称")
private String teamName;//班组名称
@Excel(name = "班组人员")
private String teamPerson;//班组人员
@Excel(name = "是否立即处理")
private String workHandle;
@Excel(name = "是否委外",readConverterExp = "1=转委外,0=不委外")
private String workOutsource;
@Excel(name = "是否停机维修")
private String workDownMachine;
@Excel(name = "设备编码")
private String equipmentCode;
@Excel(name = "委外工单编码")
private String outWorkCode;
@Excel(name = "原因分析")
private String workReason;
@Excel(name = "故障描述")
private String workFaultDesc;
@Excel(name = "维修用时")
private String workCostTime;
@Excel(name = "维修费用")
private String workCost;
@Excel(name = "委外工单id")
private String outWorkId;
@Excel(name = "委外工单编码")
private String outWorkCode;
@Excel(name = "备用字段1")
private String attr1;
@Excel(name = "备用字段2")
private String attr2;
@Excel(name = "备用字段3")
private String attr3;
@Excel(name = "删除标志")
private String delFlag;
@Excel(name = "工厂编码")
private String factoryCode;
@Excel(name = "维修状态")
private String workStatus;
@Excel(name = "维修处理措施")
private String repairMeasures;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ -108,6 +98,39 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workEndTime;
@Excel(name = "维修用时")
private String workCostTime;
@Excel(name = "维修费用")
private String workCost;
private String orderRelevance;
private String outWorkId;
private String attr1;
private String attr2;
private String attr3;
private String delFlag;
@Excel(name = "工厂编码")
private String factoryCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修实际开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualDownStartTime;
@ -116,37 +139,33 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "维修实际结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualDownEndTime;
@Excel(name = "联系方式")
private String workConnection;
@Excel(name = "故障类型")
private String faultType;
@Excel(name = "设备状态描述")
private String faultType;
private String equipmentStatusDescription;
@Excel(name = "维修措施")
private String repairMeasures;
@Excel(name = "故障停机时间")
private String faultDownTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "故障开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date faultStartTime;
@Excel(name = "结果检验")//也就是审核
private String resultInspect;
@Excel(name = "备注")
private String remark;
@Excel(name = "审核意见")
private String auditOpinion;
/////////////////////////////////////////////////////////设备表字段
@Excel(name = "设备名称")
private String equipmentName;//设备名称
private String bindEquipmentName;
private String equipmentSpec;//规格型号
private String equipmentTypeName;//设备类型名称
@ -156,7 +175,7 @@ public class EquRepairWorkOrder extends BaseEntity {
private String workshopName;//所属工作中心名称
/////////////////////////////////////////////////////////////报修表
private String orderDesc;//故障描述
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderBreakdownTime;//故障时间
private String orderSource;//报修来源
@ -166,10 +185,8 @@ public class EquRepairWorkOrder extends BaseEntity {
private String orderConnection;//报修人联系方式
//////////////////////////////////////////////////////////////班组表
@Excel(name = "班组名称")
private String teamName;//班组名称
@Excel(name = "班组人员")
private String teamPerson;//班组人员
/////////////////////////////////////////////////////////////时间列表 虚拟字段
private List<Date> workPlanTimeArray;

@ -138,7 +138,7 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
}
/**
*
*
**/
@Override
public AjaxResult createPatrolCheckPlanTask() {

@ -493,17 +493,19 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
EquOperation equOperation = equOperationMapper.selectEquipmentIntegrityRate(time, equRepairWorkOrder.getEquipmentCode());
if (equOperation != null) {
if (equRepairWorkOrder.getWorkDownMachine().equals("1")) {
DecimalFormat df = new DecimalFormat("#.##");
// DecimalFormat df = new DecimalFormat("#.##");
//实际运行时间 = 实际运行时间 - 故障时间
double result = Double.parseDouble(equOperation.getActualOperationTime()) - Double.parseDouble(hours);
// double result = Double.parseDouble(equOperation.getActualOperationTime()) - Double.parseDouble(hours);
//故障时间 = 原来的故障时间 + 这次的故障时间
double faultTime = Double.parseDouble(equOperation.getFaultTime()) + Double.parseDouble(hours);
BigDecimal faultTimeBD = new BigDecimal(faultTime);// 故障时间
BigDecimal operationTimeBD = new BigDecimal(equOperation.getOperationTime());//运行时间
equOperation.setFaultTime(String.valueOf(faultTime));//故障时间
equOperation.setActualOperationTime(String.valueOf(df.format(result)));//实际运行时间
DecimalFormat dfs = new DecimalFormat("#.00");
String formattedFaultTime = dfs.format(faultTime);
// BigDecimal faultTimeBD = new BigDecimal(faultTime);// 故障时间
// BigDecimal operationTimeBD = new BigDecimal(equOperation.getOperationTime());//运行时间
equOperation.setFaultTime(formattedFaultTime);//故障时间
//equOperation.setActualOperationTime(String.valueOf(df.format(result)));//实际运行时间
//故障率计算(故障时间/运行时间)
equOperation.setFailureRate(faultTimeBD.multiply(new BigDecimal(100)).divide(operationTimeBD, 2, RoundingMode.HALF_UP).toString() + "%");
// equOperation.setFailureRate(faultTimeBD.multiply(new BigDecimal(100)).divide(operationTimeBD, 2, RoundingMode.HALF_UP).toString() + "%");
equOperation.setShutdownTimes(equOperation.getShutdownTimes() + 1);//停机次数加1
}

@ -250,5 +250,11 @@ public class RyTask {
logger.info("++留样复检定时任务+开始++syncQcCheckSampleTask+++++");
remoteQualityService.createCheckSampleTask();
}
/**********更新设备的运行时间,第二天更新前一天的*********/
public void updateEquRunTime(){
logger.info("++更新设备的运行时间+开始++updateEquRunTime+++++");
remoteMesService.updateEquRunTime();
}
}

@ -179,4 +179,11 @@ public class MesReportWorksController extends BaseController {
}
}
}
/**
*
**/
@PostMapping("/mesProTask")
public R updateEquRunTime() {
return mesReportWorksService.updateEquRunTime();
}
}

@ -25,4 +25,6 @@ public interface IMesReportWorksService {
List<DynamicColumnVo> getCXJProductionTitle(HFProduction dto);
List<Map<String, Object>> getCXJProductionList(HFProduction dto);
R updateEquRunTime();
}

@ -329,6 +329,8 @@ public class MesReportWorksServiceImpl implements IMesReportWorksService {
return results;
}
private List<String> getDateInterval(String start, String end) {
start = start.substring(0,10);
end = end.substring(0,10);
@ -348,4 +350,15 @@ public class MesReportWorksServiceImpl implements IMesReportWorksService {
return dateList;
}
@Override
public R updateEquRunTime() {
DynamicDataSourceContextHolder.push("ds_1000");
try {
}finally {
DynamicDataSourceContextHolder.poll();
}
return R.ok();
}
}

Loading…
Cancel
Save