工单做了操作以后,排列顺序都要到第一位。

This commit is contained in:
xiaofajia 2024-11-27 14:56:54 +08:00
parent a4fad99298
commit c0a85a7f75
2 changed files with 40 additions and 6 deletions

View File

@ -510,6 +510,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
repairOrderInfoService.updateById(repairOrderInfo);
// 记录日志
repairRecordsService.saveRepairRecord(one.getGoodsId(), null, RecordTypeEnum.JS.getCode(), "线下支付结算", null);
// 更新工单主表时间
refreshUpdateTime(repairTicketsRespVO.getId());
}
/**
@ -607,6 +610,10 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
@Override
@DSTransactional
public void print(HttpServletResponse response, String id) {
// 更新工单时间
refreshUpdateTime(id);
// 开始之前先计算一次工单
boolean flag = computeTicket(id);
if (!flag) {
@ -1031,6 +1038,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
DictDataRespDTO dictDataRespDTO = dataList.stream().filter(item -> item.getValue().equals(worker.getWorkType())).findFirst().orElse(null);
String message = String.format("您的爱车%s已由%s %s接单了", tickets.getCarNo(), (dictDataRespDTO != null ? dictDataRespDTO.getLabel() : "维修工"), worker.getUserName());
repairWorkerService.sentMessageToCus(id, message, false);
// 更新工单主表时间
refreshUpdateTime(id);
}
/**
@ -1075,6 +1085,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
//最后记录操作日志--指派施工
repairRecordsService.saveRepairRecord(reqVO.getId(), null, code, remark, null);
}
// 更新工单主表时间
refreshUpdateTime(reqVO.getId());
}
/**
@ -1235,6 +1248,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
);
repairWorkerService.sentMessageToCus(tickets.getId(), newMessage, false);
}
// 更新工单主表时间
refreshUpdateTime(respVO.getId());
}
private String createMessage(String who, String no, String projectName, String type, String finishType, String nextName) {
@ -1285,6 +1301,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
dlRepairTickets.setId(id);
dlRepairTickets.setPartShow(show);
baseMapper.updateById(dlRepairTickets);
refreshUpdateTime(id);
}
/**
@ -1358,6 +1376,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
DictDataRespDTO repairType = dictDataApi.getDictData("repair_type", tickets.getRepairType());
String message = String.format("您的爱车%s已%s完成", tickets.getCarNo(), (repairType != null ? repairType.getLabel() : "维修保养"));
repairWorkerService.sentMessageToCus(tickets.getId(), message, true);
// 更新工单主表状态
refreshUpdateTime(respVO.getId());
}
/**
@ -1449,6 +1470,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
// 记录日志
repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.JSGD.getCode(), respVO.getRemark(), respVO.getImage());
// 更新工单时间
refreshUpdateTime(respVO.getId());
}
/**
@ -1558,6 +1582,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
String recordStr = noticeCusVO.getName()
+ "通知客户取车:" + message;
repairRecordsService.saveRepairRecord(noticeCusVO.getId(), null, RecordTypeEnum.TZQC.getCode(), recordStr, null);
// 更新工单主表时间
refreshUpdateTime(noticeCusVO.getId());
}
/**
@ -1666,6 +1693,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
repairOrderInfoService.updateById(orderInfo);
Long time2 = System.currentTimeMillis();
System.out.println("时间差:"+(time2-time1));
// 更新主表时间
refreshUpdateTime(ticketId);
return true;
}
@ -1843,6 +1873,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
// 记录日志
repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.JC.getCode(), respVO.getRemark(), respVO.getImage());
refreshUpdateTime(respVO.getId());
}
/**
@ -1876,10 +1908,12 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
**/
@Override
public void refreshUpdateTime(String id){
baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
.set(DlRepairTickets::getUpdateTime, LocalDateTime.now())
.eq(DlRepairTickets::getId, id)
);
if (ObjectUtil.isNotEmpty(id)){
baseMapper.update(new LambdaUpdateWrapper<DlRepairTickets>()
.set(DlRepairTickets::getUpdateTime, LocalDateTime.now())
.eq(DlRepairTickets::getId, id)
);
}
}
}

View File

@ -57,7 +57,7 @@ public class DlRepairTitemServiceImpl extends ServiceImpl<DlRepairTitemMapper, D
**/
@Override
public List<DlRepairTitem> getProjectList(String ticketId){
return baseMapper.selectList(new LambdaQueryWrapper<DlRepairTitem>().and(item -> {
return baseMapper.selectList(new LambdaQueryWrapper<DlRepairTitem>().and(item -> {
item.eq(DlRepairTitem::getItemType, "01")
.eq(DlRepairTitem::getTicketId, ticketId);
}));
@ -162,7 +162,7 @@ public class DlRepairTitemServiceImpl extends ServiceImpl<DlRepairTitemMapper, D
@Override
public List<DlRepairTitemRespVO> getProjList(String ticketId,String isOpen) {
// 更新工单主表时间
repairTicketsService.removeTicketById(ticketId);
repairTicketsService.refreshUpdateTime(ticketId);
return dlRepairTitemMapper.selectProjList(ticketId,isOpen);
}
}