|
|
|
@ -23,6 +23,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.error;
|
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.success;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -67,7 +68,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
timeArray.add(order.getOrderEnd());
|
|
|
|
|
order.setTimeArray(timeArray);
|
|
|
|
|
|
|
|
|
|
order.setPlanName(equOrderMapper.selectPlanNameByPlanCode(orderCode));
|
|
|
|
|
order.setPlanName(equOrderMapper.selectPlanNameByPlanCode(order.getPlanCode()));
|
|
|
|
|
|
|
|
|
|
order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop()));
|
|
|
|
|
|
|
|
|
@ -135,6 +136,21 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public AjaxResult updateEquOrder(EquOrder equOrder) {
|
|
|
|
|
|
|
|
|
|
// 检验如果审核通过则不允许修改记录
|
|
|
|
|
if (equOrder.getRepairCode() != null) {
|
|
|
|
|
if (!equOrder.getRepairCode().isEmpty()) {
|
|
|
|
|
EquRepairOrder repairOrder = equRepairOrderMapper.selectEquRepairOrderByRepairCode(equOrder.getRepairCode());
|
|
|
|
|
if (repairOrder==null) {
|
|
|
|
|
return error(500,"未查询到报修单信息!");
|
|
|
|
|
}else {
|
|
|
|
|
if (!repairOrder.getOrderStatus().equals("待审核")){
|
|
|
|
|
return error(500,"报修单已审核,不可修改记录!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean hasError = false;
|
|
|
|
|
|
|
|
|
|
EquOrderEqu equ = equOrder.getEqu();
|
|
|
|
@ -165,13 +181,19 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
if (standard.getStandardType().equals("quantify")) {
|
|
|
|
|
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 未达标
|
|
|
|
|
if (standard.getDetailReach().equals("1")) {
|
|
|
|
|
standard.setErrorFlag("0");
|
|
|
|
|
if (standard.getDetailReach().equals("0")) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
standard.setErrorFlag("1");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -187,6 +209,10 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
|
|
|
|
|
equOrder.setPlanPerson(SecurityContextHolder.getUserName());
|
|
|
|
|
equOrder.setPlanPerson(SecurityContextHolder.getUserName());
|
|
|
|
|
if (equOrder.getTimeArray().size() > 0) {
|
|
|
|
|
equOrder.setOrderStart(equOrder.getTimeArray().get(0));
|
|
|
|
|
equOrder.setOrderEnd(equOrder.getTimeArray().get(1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean checkRepair = false;
|
|
|
|
|
|
|
|
|
@ -198,6 +224,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 报修信息
|
|
|
|
|
if (checkRepair && hasError ) {
|
|
|
|
|
// 获取故障报修流水号
|
|
|
|
|
EquRepairOrder equRepairOrder = new EquRepairOrder();
|
|
|
|
@ -229,6 +256,16 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!hasError) {
|
|
|
|
|
// TODO 删除报修单
|
|
|
|
|
if (equOrder.getRepairCode() != null) {
|
|
|
|
|
if (!equOrder.getRepairCode().isEmpty()) {
|
|
|
|
|
equRepairOrderMapper.deleteEquRepairOrderByRepairCode(equOrder.getRepairCode());
|
|
|
|
|
equOrder.setRepairCode("");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新工单信息
|
|
|
|
|
equOrderMapper.updateEquOrder(equOrder);
|
|
|
|
|
return success();
|
|
|
|
|