Merge remote-tracking branch 'origin/master'

highway
zhaoxiaolin 1 year ago
commit d551bac244

@ -136,4 +136,14 @@ public class DevicePDAController {
public AjaxResult updateMaintenanceRecords(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.updateMaintenanceRecords(equRepairWorkOrder);
}
/**
*
* @param pdadto
* @return
*/
@GetMapping("/startMaintenanceTask")
public AjaxResult startMaintenanceTask(PDADTO pdadto) {
return devicePDAService.startMaintenanceTask(pdadto);
}
}

@ -5,6 +5,26 @@ public class PDADTO {
private String userId;
private String planType;
private String orderCode;
private String shutDown;
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getShutDown() {
return shutDown;
}
public void setShutDown(String shutDown) {
this.shutDown = shutDown;
}
public String getUserId() {
return userId;
}

@ -93,4 +93,11 @@ public interface IDevicePDAService {
//待处理
AjaxResult getMaintenancePendRecords(EquRepairWorkOrder equRepairWorkOrder);
/**
*
* @param pdadto
* @return
*/
AjaxResult startMaintenanceTask(PDADTO pdadto);
}

@ -286,6 +286,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
}
// 保养逻辑
if (equOrder.getPlanType().equals("maintenance")) {
// 设置结束时间
equOrder.setOrderEnd(DateUtils.getNowDate());
}
// 更新工单信息
equOrderMapper.updateEquOrder(equOrder);
return success();
@ -378,6 +384,27 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
}
/**
*
* @param pdadto
* @return
*/
@Override
public AjaxResult startMaintenanceTask(PDADTO pdadto) {
EquOrder order = equOrderMapper.selectEquOrderByOrderCode(pdadto.getOrderCode());
// 改为进行中
order.setOrderStatus("3");
// 设置是否停机保养
order.setShutDown(pdadto.getShutDown());
// 设置开始时间
order.setOrderStart(DateUtils.getNowDate());
// 更新数据表
order.setUpdateBy(SecurityContextHolder.getUserName());
order.setUpdateTime(DateUtils.getNowDate());
equOrderMapper.updateEquOrder(order);
return success();
}
/**
*
*

@ -226,18 +226,13 @@ public class EquOrderServiceImpl implements IEquOrderService {
int up = standard.getActualValue().compareTo(standard.getDetailUpLimit());
int down = standard.getActualValue().compareTo(standard.getDetailDownLimit());
standard.setDetailReach("1");
standard.setErrorFlag("0");
if (!(up != 1 && down != -1)) {
hasError = true;
standard.setErrorFlag("1");
standard.setDetailReach("0");
}
} else {
// TODO 未达标
standard.setErrorFlag("0");
if (standard.getDetailReach().equals("0")) {
hasError = true;
standard.setErrorFlag("1");
}
}
@ -310,6 +305,15 @@ public class EquOrderServiceImpl implements IEquOrderService {
}
}
// 保养逻辑
if (equOrder.getPlanType().equals("maintenance")) {
// 用时
if (equOrder.getOrderStart() != null) {
long diffSeconds = (equOrder.getOrderEnd().getTime() - equOrder.getOrderStart().getTime()) / 60000;
equOrder.setOrderCostTime(String.valueOf(diffSeconds));
}
}
// 更新工单信息
equOrderMapper.updateEquOrder(equOrder);
return success();

Loading…
Cancel
Save