|
|
@ -33,8 +33,6 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EquOrderMapper equOrderMapper;
|
|
|
|
private EquOrderMapper equOrderMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EquOrderEquSpareMapper equOrderEquSpareMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private EquOrderStandardMapper equOrderStandardMapper;
|
|
|
|
private EquOrderStandardMapper equOrderStandardMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EquOrderDetailMapper equOrderDetailMapper;
|
|
|
|
private EquOrderDetailMapper equOrderDetailMapper;
|
|
|
@ -42,6 +40,10 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
|
|
|
|
private EquOrderPersonMapper equOrderPersonMapper;
|
|
|
|
private EquOrderPersonMapper equOrderPersonMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EquOrderEquMapper equOrderEquMapper;
|
|
|
|
private EquOrderEquMapper equOrderEquMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private EquSpareApplyMapper equSpareApplyMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SparePartsLedgerMapper sparePartsLedgerMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询保养工单
|
|
|
|
* 查询保养工单
|
|
|
@ -68,7 +70,7 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* TODO 快速工单
|
|
|
|
* 快速工单
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param equPlan 保养工单
|
|
|
|
* @param equPlan 保养工单
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
@ -92,8 +94,10 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
|
|
|
|
String serialNum = String.format("%03d",equOrderMapper.selectSerialNumber());
|
|
|
|
String serialNum = String.format("%03d",equOrderMapper.selectSerialNumber());
|
|
|
|
equOrder.setOrderCode("F"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+serialNum);
|
|
|
|
equOrder.setOrderCode("F"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+serialNum);
|
|
|
|
equOrder.setPlanLoopType("");
|
|
|
|
equOrder.setPlanLoopType("");
|
|
|
|
|
|
|
|
if (equPlan.getPlanTimeArray() != null) {
|
|
|
|
equOrder.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));
|
|
|
|
equOrder.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));
|
|
|
|
equOrder.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));
|
|
|
|
equOrder.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));
|
|
|
|
|
|
|
|
}
|
|
|
|
// 设置工单状态
|
|
|
|
// 设置工单状态
|
|
|
|
equOrder.setOrderStatus("0");
|
|
|
|
equOrder.setOrderStatus("0");
|
|
|
|
equOrder.setFactoryCode(factory);
|
|
|
|
equOrder.setFactoryCode(factory);
|
|
|
@ -109,22 +113,32 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
|
|
|
|
EquPlanEqu equPlanEqu = equPlan.getEquipmentItem().get(0);
|
|
|
|
EquPlanEqu equPlanEqu = equPlan.getEquipmentItem().get(0);
|
|
|
|
|
|
|
|
|
|
|
|
// 生成工单-备件
|
|
|
|
// 生成工单-备件
|
|
|
|
List<EquOrderEquSpare> spareList = new ArrayList<>();
|
|
|
|
|
|
|
|
List<EquPlanEquSpare> equSpareList = equPlanEqu.getSpareList();
|
|
|
|
List<EquPlanEquSpare> equSpareList = equPlanEqu.getSpareList();
|
|
|
|
if (equSpareList != null) {
|
|
|
|
if (equSpareList != null) {
|
|
|
|
|
|
|
|
// 获取流水单号
|
|
|
|
|
|
|
|
int applySerialNum = equSpareApplyMapper.selectSerialNumber();
|
|
|
|
|
|
|
|
|
|
|
|
for (EquPlanEquSpare spare : equSpareList) {
|
|
|
|
for (EquPlanEquSpare spare : equSpareList) {
|
|
|
|
EquOrderEquSpare spareTemp = new EquOrderEquSpare();
|
|
|
|
EquSpareApply apply = new EquSpareApply();
|
|
|
|
BeanUtils.copyProperties(spare,spareTemp);
|
|
|
|
apply.setApplyId(IdUtils.fastSimpleUUID());
|
|
|
|
spareTemp.setId(IdUtils.fastSimpleUUID());
|
|
|
|
apply.setApplyCode("A"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+String.format("%03d",applySerialNum));
|
|
|
|
spareTemp.setOrderCode(equOrder.getOrderCode());
|
|
|
|
applySerialNum++;
|
|
|
|
spareTemp.setFactoryCode(factory);
|
|
|
|
apply.setSpareCode(spare.getMaterialCode());
|
|
|
|
spareTemp.setCreateBy(SecurityContextHolder.getUserName());
|
|
|
|
apply.setSpareName(spare.getMaterialDesc());
|
|
|
|
spareTemp.setCreateTime(DateUtils.getNowDate());
|
|
|
|
apply.setSpareModel(spare.getSpareType());
|
|
|
|
spareTemp.setUpdateBy(SecurityContextHolder.getUserName());
|
|
|
|
apply.setSpareQuantity(spare.getApplyNum());
|
|
|
|
spareTemp.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
apply.setFactoryCode(factory);
|
|
|
|
|
|
|
|
apply.setApplyPeople(SecurityContextHolder.getUserName());
|
|
|
|
|
|
|
|
apply.setParentCode(equOrder.getOrderCode());
|
|
|
|
|
|
|
|
apply.setCreateBy(SecurityContextHolder.getUserName());
|
|
|
|
|
|
|
|
apply.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
apply.setSpareUseEquipment(equOrder.getEquipmentCode());
|
|
|
|
|
|
|
|
apply.setApplyTime(DateUtils.getNowDate());
|
|
|
|
// 插入备件信息
|
|
|
|
// 插入备件信息
|
|
|
|
equOrderEquSpareMapper.insertEquOrderEquSpare(spareTemp);
|
|
|
|
equSpareApplyMapper.insertEquSpareApply(apply);
|
|
|
|
spareList.add(spareTemp);
|
|
|
|
|
|
|
|
|
|
|
|
// TODO 减少备件仓库中备件数量
|
|
|
|
|
|
|
|
sparePartsLedgerMapper.updateSpareNumReduce(apply);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|