|
|
|
@ -55,6 +55,8 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
private EquPlanMapper equPlanMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private EquSpareApplyMapper equSpareApplyMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SparePartsLedgerMapper sparePartsLedgerMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询计划工单
|
|
|
|
@ -91,7 +93,7 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
order.setDetailList(detailList);
|
|
|
|
|
|
|
|
|
|
// 备件
|
|
|
|
|
List<EquSpareApply> spareList = equSpareApplyMapper.selectEquSpareApplyListByParentCode(order.getOrderCode());
|
|
|
|
|
List<EquSpareApply> spareList = equSpareApplyMapper.selectEquSpareApplyListByWorkCode(order.getOrderCode());
|
|
|
|
|
if (spareList.size() > 0) {
|
|
|
|
|
order.setSpareList(spareList);
|
|
|
|
|
}
|
|
|
|
@ -361,8 +363,32 @@ public class EquOrderServiceImpl implements IEquOrderService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public int deleteEquOrderByOrderIds(String[] orderIds) {
|
|
|
|
|
return equOrderMapper.deleteEquOrderByOrderIds(orderIds);
|
|
|
|
|
public AjaxResult deleteEquOrderByOrderIds(String[] orderIds) {
|
|
|
|
|
// 保养-备件逻辑
|
|
|
|
|
for (String orderId : orderIds) {
|
|
|
|
|
EquOrder order = equOrderMapper.selectEquOrderByOrderId(orderId);
|
|
|
|
|
if (!order.getOrderStatus().equals("0")) {
|
|
|
|
|
return error(500,"工单已进行修改!不可删除!");
|
|
|
|
|
}
|
|
|
|
|
if (order.getPlanType().equals("maintenance")) {
|
|
|
|
|
List<EquSpareApply> applyList = equSpareApplyMapper.selectEquSpareApplyListByWorkCode(order.getWorkCode());
|
|
|
|
|
for (EquSpareApply apply : applyList) {
|
|
|
|
|
// 返回备件数量
|
|
|
|
|
sparePartsLedgerMapper.updateSpareNumAdd(apply);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 逻辑删除工单
|
|
|
|
|
equOrderMapper.delEquOrderByOrderIds(orderIds);
|
|
|
|
|
// 逻辑删除获取人员
|
|
|
|
|
equOrderPersonMapper.delEquOrderPersonByorderIds(orderIds);
|
|
|
|
|
// 逻辑删除标准信息
|
|
|
|
|
equOrderStandardMapper.delEquOrderStandardByorderIds(orderIds);
|
|
|
|
|
// 逻辑删除检查项信息
|
|
|
|
|
equOrderDetailMapper.delEquOrderDetailByorderIds(orderIds);
|
|
|
|
|
// 逻辑删除备件信息
|
|
|
|
|
equSpareApplyMapper.delEquSpareApplyByorderIds(orderIds);
|
|
|
|
|
return success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|