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