|
|
@ -334,6 +334,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
// 更新设备状态为开机
|
|
|
|
// 更新设备状态为开机
|
|
|
|
equ.setStatus("1");
|
|
|
|
equ.setStatus("1");
|
|
|
|
equOrderMapper.updateEquipmentStatus(equ);
|
|
|
|
equOrderMapper.updateEquipmentStatus(equ);
|
|
|
|
|
|
|
|
// 更新设备运行记录
|
|
|
|
|
|
|
|
updateOperationRecord(equOrder.getEquipmentCode(),"on","");
|
|
|
|
//上传附件
|
|
|
|
//上传附件
|
|
|
|
if (StringUtils.isNotEmpty(equOrder.getPicturePath())) {
|
|
|
|
if (StringUtils.isNotEmpty(equOrder.getPicturePath())) {
|
|
|
|
String[] ids = equOrder.getPicturePath().split(",");
|
|
|
|
String[] ids = equOrder.getPicturePath().split(",");
|
|
|
@ -467,12 +469,19 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
// 创建设备对象用于更新设备状态
|
|
|
|
// 创建设备对象用于更新设备状态
|
|
|
|
Equipment equ = new Equipment();
|
|
|
|
Equipment equ = new Equipment();
|
|
|
|
equ.setEquipmentCode(order.getEquipmentCode());
|
|
|
|
equ.setEquipmentCode(order.getEquipmentCode());
|
|
|
|
|
|
|
|
// 运行记录类型
|
|
|
|
|
|
|
|
String operationType;
|
|
|
|
// 停机保养
|
|
|
|
// 停机保养
|
|
|
|
if (pdadto.getShutDown().equals("1")){
|
|
|
|
if (pdadto.getShutDown().equals("1")){
|
|
|
|
// 更改设备状态为停机
|
|
|
|
// 更改设备状态为停机
|
|
|
|
equ.setStatus("0");
|
|
|
|
equ.setStatus("0");
|
|
|
|
equOrderMapper.updateEquipmentStatus(equ);
|
|
|
|
equOrderMapper.updateEquipmentStatus(equ);
|
|
|
|
|
|
|
|
operationType = "off";
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
operationType = "on";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 更新设备运行记录
|
|
|
|
|
|
|
|
updateOperationRecord(order.getEquipmentCode(),operationType,"upkeep");
|
|
|
|
|
|
|
|
|
|
|
|
// 设置开始时间
|
|
|
|
// 设置开始时间
|
|
|
|
order.setOrderStart(DateUtils.getNowDate());
|
|
|
|
order.setOrderStart(DateUtils.getNowDate());
|
|
|
@ -824,4 +833,31 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
|
|
|
|
return equEquipmentMapper.selectEquEquipmentList(equEquipment);
|
|
|
|
return equEquipmentMapper.selectEquEquipmentList(equEquipment);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 更新设备运行记录
|
|
|
|
|
|
|
|
* @param equipmentCode
|
|
|
|
|
|
|
|
* @param operationType 开机/停机
|
|
|
|
|
|
|
|
* @param type 保养/维修
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void updateOperationRecord(String equipmentCode,String operationType,String type) {
|
|
|
|
|
|
|
|
// 设备最后一条运行记录
|
|
|
|
|
|
|
|
EquOperationRecord lastRecord = equOperationRecordMapper.selectLastOperationRecordByEquipmentCode(equipmentCode);
|
|
|
|
|
|
|
|
lastRecord.setEndTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
lastRecord.setUpdateBy(SecurityContextHolder.getUserName());
|
|
|
|
|
|
|
|
// 更新运行记录
|
|
|
|
|
|
|
|
equOperationRecordMapper.updateEquOperationRecord(lastRecord);
|
|
|
|
|
|
|
|
// 创建新的运行记录
|
|
|
|
|
|
|
|
EquOperationRecord newRecord = new EquOperationRecord();
|
|
|
|
|
|
|
|
newRecord.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
|
|
|
newRecord.setEquipmentCode(equipmentCode);
|
|
|
|
|
|
|
|
newRecord.setStartTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
newRecord.setType(operationType);
|
|
|
|
|
|
|
|
newRecord.setMaintenanceType(type);// 维护类型
|
|
|
|
|
|
|
|
newRecord.setParentId(lastRecord.getId());
|
|
|
|
|
|
|
|
newRecord.setFactoryCode(lastRecord.getFactoryCode());
|
|
|
|
|
|
|
|
newRecord.setCreateBy(SecurityContextHolder.getUserName());
|
|
|
|
|
|
|
|
newRecord.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
equOperationRecordMapper.insertEquOperationRecord(newRecord);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|