|
|
|
@ -82,7 +82,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
equ.setDetailList(detailList);
|
|
|
|
|
|
|
|
|
|
List<EquOrderEquSpare> spareList = equOrderEquSpareMapper.selectEquOrderEquSpareByParentCode(equ.getCode());
|
|
|
|
|
if (spareList.size()>0) {
|
|
|
|
|
if (spareList.size() > 0) {
|
|
|
|
|
equ.setSpareList(spareList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -111,7 +111,13 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public List<EquOrder> selectEquOrderList(EquOrder equOrder) {
|
|
|
|
|
return equOrderMapper.selectEquOrderList(equOrder);
|
|
|
|
|
List<EquOrder> orderList = equOrderMapper.selectEquOrderList(equOrder);
|
|
|
|
|
for (EquOrder order : orderList) {
|
|
|
|
|
EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode());
|
|
|
|
|
order.setEquipmentCode(equ.getEquipmentCode());
|
|
|
|
|
order.setEquipmentName(equ.getEquipmentName());
|
|
|
|
|
}
|
|
|
|
|
return orderList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -141,11 +147,11 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
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,"报修单已审核,不可修改记录!");
|
|
|
|
|
if (repairOrder == null) {
|
|
|
|
|
return error(500, "未查询到报修单信息!");
|
|
|
|
|
} else {
|
|
|
|
|
if (!repairOrder.getOrderStatus().equals("待审核")) {
|
|
|
|
|
return error(500, "报修单已审核,不可修改记录!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -188,7 +194,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
standard.setErrorFlag("1");
|
|
|
|
|
standard.setDetailReach("0");
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
// TODO 未达标
|
|
|
|
|
standard.setErrorFlag("0");
|
|
|
|
|
if (standard.getDetailReach().equals("0")) {
|
|
|
|
@ -216,44 +222,44 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
|
|
|
|
|
boolean checkRepair = false;
|
|
|
|
|
|
|
|
|
|
if (equOrder.getRepairCode() == null){
|
|
|
|
|
if (equOrder.getRepairCode() == null) {
|
|
|
|
|
checkRepair = true;
|
|
|
|
|
}else {
|
|
|
|
|
if (equOrder.getRepairCode().isEmpty()){
|
|
|
|
|
} else {
|
|
|
|
|
if (equOrder.getRepairCode().isEmpty()) {
|
|
|
|
|
checkRepair = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 报修信息
|
|
|
|
|
if (checkRepair && hasError ) {
|
|
|
|
|
// 获取故障报修流水号
|
|
|
|
|
EquRepairOrder equRepairOrder = new EquRepairOrder();
|
|
|
|
|
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
|
|
|
|
|
String equipmentCode = equOrder.getEquipmentCode();
|
|
|
|
|
//报修单号
|
|
|
|
|
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
|
|
|
|
|
//在主表中存入报修单号信息
|
|
|
|
|
equOrder.setRepairCode(equRepairOrder.getOrderCode());
|
|
|
|
|
|
|
|
|
|
//新增报修记录
|
|
|
|
|
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
|
|
|
|
|
equRepairOrder.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
// 报修来源
|
|
|
|
|
if (equOrder.getPlanType().equals("inspection")){
|
|
|
|
|
equRepairOrder.setOrderSource("巡检");
|
|
|
|
|
}
|
|
|
|
|
if (equOrder.getPlanType().equals("spotInspection")){
|
|
|
|
|
equRepairOrder.setOrderSource("点检");
|
|
|
|
|
}
|
|
|
|
|
if (equOrder.getPlanType().equals("maintenance")){
|
|
|
|
|
equRepairOrder.setOrderSource("保养");
|
|
|
|
|
}
|
|
|
|
|
equRepairOrder.setOrderStatus("待审核");
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
String key = "#header.poolName";
|
|
|
|
|
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
|
|
|
|
|
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
|
|
|
|
|
if (checkRepair && hasError) {
|
|
|
|
|
// 获取故障报修流水号
|
|
|
|
|
EquRepairOrder equRepairOrder = new EquRepairOrder();
|
|
|
|
|
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
|
|
|
|
|
String equipmentCode = equOrder.getEqu().getEquipmentCode();
|
|
|
|
|
//报修单号
|
|
|
|
|
equRepairOrder.setOrderCode("BX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
|
|
|
|
|
//在主表中存入报修单号信息
|
|
|
|
|
equOrder.setRepairCode(equRepairOrder.getOrderCode());
|
|
|
|
|
|
|
|
|
|
//新增报修记录
|
|
|
|
|
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
|
|
|
|
|
equRepairOrder.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
// 报修来源
|
|
|
|
|
if (equOrder.getPlanType().equals("inspection")) {
|
|
|
|
|
equRepairOrder.setOrderSource("巡检");
|
|
|
|
|
}
|
|
|
|
|
if (equOrder.getPlanType().equals("spotInspection")) {
|
|
|
|
|
equRepairOrder.setOrderSource("点检");
|
|
|
|
|
}
|
|
|
|
|
if (equOrder.getPlanType().equals("maintenance")) {
|
|
|
|
|
equRepairOrder.setOrderSource("保养");
|
|
|
|
|
}
|
|
|
|
|
equRepairOrder.setOrderStatus("待审核");
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
String key = "#header.poolName";
|
|
|
|
|
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
|
|
|
|
|
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!hasError) {
|
|
|
|
|