1432-新增删除工单的功能
This commit is contained in:
parent
e5ad0d5b5e
commit
37a96bcccd
|
|
@ -1612,7 +1612,7 @@ public class TicketController extends ControllerBase {
|
|||
|
||||
@PostMapping("deleteTicket")
|
||||
public ApiResult<Boolean> deleteTicket(@RequestBody List<String> ticketIds) {
|
||||
ticketService.removeByIds(ticketIds);
|
||||
ticketService.removeTickets(ticketIds);
|
||||
return ApiResult.success(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -1609,7 +1609,7 @@ public class TicketController extends ControllerBase {
|
|||
|
||||
@PostMapping("deleteTicket")
|
||||
public ApiResult<Boolean> deleteTicket(@RequestBody List<String> ticketIds) {
|
||||
ticketService.removeByIds(ticketIds);
|
||||
ticketService.removeTickets(ticketIds);
|
||||
return ApiResult.success(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -37,5 +37,7 @@ public interface IAdminMessageService extends IService<AdminMessage> {
|
|||
|
||||
void remove(Integer source, Long sourceId, Integer userId, Integer subType);
|
||||
|
||||
void remove(Integer source, List<Long> sourceIds);
|
||||
|
||||
AdminNotReadMessageCountVO getNotReadMessageCount1(Integer userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,4 +34,6 @@ public interface IAppMessageService extends IService<AppMessage> {
|
|||
Integer getNotReadMessageCount(Integer userId,String from);
|
||||
|
||||
AppNotReadMessageCountVO getNotReadMessageCount1(Integer userId, String from);
|
||||
|
||||
void removeAppMessage(List<Long> ticketIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,4 +63,6 @@ public interface IGongfuTicketService extends IService<GongfuTicket> {
|
|||
List<EquipmentFailureRankingVO> getEquipmentFailureRanking(EquipmentFailureRankingSearchQuery qo);
|
||||
|
||||
List<CompanyStatisticsVO> companyStatistics(CompanyStatisticsQuery qo);
|
||||
|
||||
void removeTickets(List<String> ticketIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,4 +63,6 @@ public interface ITicketService extends IService<Ticket> {
|
|||
boolean close(Ticket ticket);
|
||||
|
||||
TicketDTO getDto(Long id);
|
||||
|
||||
void removeTickets(List<String> ticketIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,13 @@ public class AdminMessageServiceImpl extends ServiceImpl<AdminMessageMapper, Adm
|
|||
.eq(AdminMessage::getSubType, subType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Integer source, List<Long> sourceIds) {
|
||||
remove(new LambdaQueryWrapper<AdminMessage>()
|
||||
.eq(AdminMessage::getSource, source)
|
||||
.in(AdminMessage::getSourceId, sourceIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdminNotReadMessageCountVO getNotReadMessageCount1(Integer userId) {
|
||||
List<AdminMessage> datas = lambdaQuery()
|
||||
|
|
|
|||
|
|
@ -156,4 +156,10 @@ public class AppMessageServiceImpl extends ServiceImpl<AppMessageMapper, AppMess
|
|||
.count())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAppMessage(List<Long> ticketIds) {
|
||||
remove(new LambdaQueryWrapper<AppMessage>()
|
||||
.in(AppMessage::getTicketId, ticketIds));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,12 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
|
|||
@Resource
|
||||
private IGongfuDeviceTypeService deviceTypeService;
|
||||
|
||||
@Resource
|
||||
private IAdminMessageService adminMessageService;
|
||||
|
||||
@Resource
|
||||
private IAppMessageService appMessageService;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public GongfuTicket add(TicketAddRequest request, Integer userId) {
|
||||
|
|
@ -427,4 +433,16 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
|
|||
public List<CompanyStatisticsVO> companyStatistics(CompanyStatisticsQuery qo) {
|
||||
return baseMapper.companyStatistics(qo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void removeTickets(List<String> ticketIds) {
|
||||
if (CollectionUtil.isEmpty(ticketIds)) {
|
||||
return;
|
||||
}
|
||||
removeByIds(ticketIds);
|
||||
List<Long> ticketIdsLong = ticketIds.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
adminMessageService.remove(3, ticketIdsLong);
|
||||
appMessageService.removeAppMessage(ticketIdsLong);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,12 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||
@Resource
|
||||
private ITBaseCustomerService customerService;
|
||||
|
||||
@Resource
|
||||
private IAdminMessageService adminMessageService;
|
||||
|
||||
@Resource
|
||||
private IAppMessageService appMessageService;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Ticket add(TicketAddRequest request, Integer userId) {
|
||||
|
|
@ -463,4 +469,17 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
|||
public TicketDTO getDto(Long id) {
|
||||
return baseMapper.getDto(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void removeTickets(List<String> ticketIds) {
|
||||
if (CollectionUtil.isEmpty(ticketIds)) {
|
||||
return;
|
||||
}
|
||||
removeByIds(ticketIds);
|
||||
List<Long> ticketIdsLong = ticketIds.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
adminMessageService.remove(0, ticketIdsLong);
|
||||
appMessageService.removeAppMessage(ticketIdsLong);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,7 @@
|
|||
u.user_name AS 'userName',m.is_read AS 'isRead'
|
||||
FROM admin_message m
|
||||
INNER JOIN admin_user u ON m.user_id=u.id
|
||||
LEFT JOIN ticket t ON m.source_id=t.id AND m.source=0 and t.is_delete = 0
|
||||
LEFT JOIN gongfu_ticket gt ON m.source_id=gt.id AND m.source=3 and gt.is_delete = 0
|
||||
WHERE m.user_id=#{userId}
|
||||
and ((m.source=0 and t.id is not null) or (m.source=3 and gt.id is not null) or m.source not in (0,3))
|
||||
<if test="request.type != null">
|
||||
AND m.type=#{request.type}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue