1432-新增删除工单的功能

This commit is contained in:
10002617 2026-04-13 11:45:40 +08:00
parent 8d4fcf5ddc
commit e5ad0d5b5e
13 changed files with 72 additions and 17 deletions

View File

@ -399,6 +399,7 @@ public class TicketController extends ControllerBase {
@ApiMark(moduleName = "工单管理", apiName = "分派工单")
public ApiResult<Void> assignmentTicket(@Valid @RequestBody AssignmentTicketRequest request) {
Ticket ticket = ticketService.assignmentTicket(request);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
ticketEventPublisher.publishTicketAssignedEvent(ticket, request.getUserIds());
ChatMessageDTO message = new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
@ -439,6 +440,7 @@ public class TicketController extends ControllerBase {
@ApiMark(moduleName = "工单管理", apiName = "添加工单处理人")
public ApiResult<Void> addTicketHandle(@Valid @RequestBody TicketHandleAddRequest request) {
Ticket ticket = ticketService.getById(request.getTicketId());
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
List<Integer> handleIds = StrUtil.split(ticket.getHandle(), ",").stream().map(Integer::parseInt).collect(Collectors.toList());
// VUtils.trueThrowBusinessError(handleIds.stream().anyMatch(uid -> Objects.equals(uid, AdminUserUtil.getUserId()))
// && request.getUserIds().stream().noneMatch(uid -> Objects.equals(uid, AdminUserUtil.getUserId())))
@ -461,6 +463,7 @@ public class TicketController extends ControllerBase {
public ApiResult<Void> completeTicket(@Valid @RequestBody @NotEmpty List<Integer> ids) {
for (Integer id : ids) {
Ticket ticket = ticketService.completeTicket(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
ticketEventPublisher.publishTicketCompleteEvent(ticket);
ChatMessageDTO message = new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
@ -492,6 +495,7 @@ public class TicketController extends ControllerBase {
public ApiResult<Void> rejectTicket(@Valid @RequestBody @NotEmpty List<Integer> ids) {
for (Integer id : ids) {
Ticket ticket = ticketService.rejectTicket(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
// ticketEventPublisher.publishTicketCompleteEvent(ticket);
ChatMessageDTO message = new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
@ -658,6 +662,7 @@ public class TicketController extends ControllerBase {
@GetMapping("getTicket")
public ApiResult<TicketInfoVO> getTicket(@Valid @RequestParam @NotNull Integer id) {
Ticket ticket = ticketService.getById(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
AdminUser adminUser = StrUtil.equals(ticket.getUserPlatform(), Constant.FROM_ADMIN) ? adminUserService.getById(ticket.getUserId()) : null;
AppUser user = StrUtil.equals(ticket.getUserPlatform(), Constant.FROM_APP) ? appUserService.getById(ticket.getUserId()) : null;
String areaName = "";
@ -1034,6 +1039,7 @@ public class TicketController extends ControllerBase {
public ApiResult<Void> passSolution(@Valid @RequestParam @NotNull Integer ticketId) {
if (ticketSolutionAuditService.pass(ticketId)) {
Ticket ticket = ticketService.getById(ticketId);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
ticketEventPublisher.publishTicketCloseEvent(ticket);
ChatMessageDTO message = new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
@ -1603,4 +1609,10 @@ public class TicketController extends ControllerBase {
public ApiResult<List<Integer>> getShengWangChannelUsers(Long ticketId) throws IOException, InterruptedException {
return ApiResult.success(shengWangService.getChannelUsers("ticket" + ticketId).getUsers());
}
@PostMapping("deleteTicket")
public ApiResult<Boolean> deleteTicket(@RequestBody List<String> ticketIds) {
ticketService.removeByIds(ticketIds);
return ApiResult.success(true);
}
}

View File

@ -187,6 +187,7 @@ public class TicketController extends ControllerBase {
Long ticketId;
if (request.getType() == 0) {
Ticket ticket = ticketService.add(request, AppUserUtil.getUserId());
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
ticketId = Long.valueOf(ticket.getId());
ticketEventPublisher.publishTicketCreateEvent(ticket, MultilingualUtil.getLanguage(), MultilingualUtil.getZone());
} else {

View File

@ -392,6 +392,7 @@ public class TicketController extends ControllerBase {
@ApiMark(moduleName = "工单管理", apiName = "分派工单")
public ApiResult<Void> assignmentTicket(@Valid @RequestBody AssignmentTicketRequest request) {
GongfuTicket ticket = ticketService.assignmentTicket(request);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
ticketEventPublisher.publishTicketAssignedEvent(ticket, request.getUserIds());
ChatMessageDTO message = new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
@ -432,6 +433,7 @@ public class TicketController extends ControllerBase {
@ApiMark(moduleName = "工单管理", apiName = "添加工单处理人")
public ApiResult<Void> addTicketHandle(@Valid @RequestBody TicketHandleAddRequest request) {
GongfuTicket ticket = ticketService.getById(request.getTicketId());
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
List<Integer> handleIds = StrUtil.split(ticket.getHandle(), ",").stream().map(Integer::parseInt).collect(Collectors.toList());
// VUtils.trueThrowBusinessError(handleIds.stream().anyMatch(uid -> Objects.equals(uid, AdminUserUtil.getUserId()))
// && request.getUserIds().stream().noneMatch(uid -> Objects.equals(uid, AdminUserUtil.getUserId())))
@ -454,6 +456,7 @@ public class TicketController extends ControllerBase {
public ApiResult<Void> completeTicket(@Valid @RequestBody @NotEmpty List<Long> ids) {
for (Long id : ids) {
GongfuTicket ticket = ticketService.completeTicket(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
ticketEventPublisher.publishTicketCompleteEvent(ticket);
ChatMessageDTO message = new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
@ -485,6 +488,7 @@ public class TicketController extends ControllerBase {
public ApiResult<Void> rejectTicket(@Valid @RequestBody @NotEmpty List<Long> ids) {
for (Long id : ids) {
GongfuTicket ticket = ticketService.rejectTicket(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
// ticketEventPublisher.publishTicketCompleteEvent(ticket);
ChatMessageDTO message = new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
@ -632,6 +636,7 @@ public class TicketController extends ControllerBase {
@GetMapping("getTicket")
public ApiResult<TicketInfoVO> getTicket(@Valid @RequestParam @NotNull Long id) {
GongfuTicket ticket = ticketService.getById(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
AdminUser adminUser = StrUtil.equals(ticket.getUserPlatform(), Constant.FROM_ADMIN) ? adminUserService.getById(ticket.getUserId()) : null;
AppUser user = StrUtil.equals(ticket.getUserPlatform(), Constant.FROM_APP) ? appUserService.getById(ticket.getUserId()) : null;
String areaName = "";
@ -993,6 +998,7 @@ public class TicketController extends ControllerBase {
public ApiResult<Void> passSolution(@Valid @RequestParam @NotNull Long ticketId) {
if (ticketSolutionAuditService.pass1(ticketId)) {
GongfuTicket ticket = ticketService.getById(ticketId);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
ticketEventPublisher.publishTicketCloseEvent(ticket);
ChatMessageDTO message = new ChatMessageDTO()
.setId(cn.hutool.core.util.IdUtil.getSnowflakeNextIdStr())
@ -1600,4 +1606,10 @@ public class TicketController extends ControllerBase {
// }).collect(Collectors.toList())
// );
}
@PostMapping("deleteTicket")
public ApiResult<Boolean> deleteTicket(@RequestBody List<String> ticketIds) {
ticketService.removeByIds(ticketIds);
return ApiResult.success(true);
}
}

View File

@ -2,6 +2,7 @@ package com.nflg.mobilebroken.repository.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
@ -167,4 +168,10 @@ public class GongfuTicket implements Serializable {
* 产量
*/
private String throughput;
/**
* 是否删除01
*/
@TableLogic(value = "0", delval = "1")
private Integer isDelete;
}

View File

@ -2,6 +2,7 @@ package com.nflg.mobilebroken.repository.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@ -156,4 +157,10 @@ public class Ticket implements Serializable {
* 客户名称
*/
private String customerName;
/**
* 是否删除01
*/
@TableLogic(value = "0", delval = "1")
private Integer isDelete;
}

View File

@ -12,6 +12,7 @@ import com.nflg.mobilebroken.common.pojo.vo.CompanyStatisticsVO;
import com.nflg.mobilebroken.common.pojo.vo.EquipmentFailureRankingVO;
import com.nflg.mobilebroken.common.pojo.vo.TicketVO;
import com.nflg.mobilebroken.repository.entity.GongfuTicket;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ -47,4 +48,7 @@ public interface GongfuTicketMapper extends BaseMapper<GongfuTicket> {
List<EquipmentFailureRankingVO> getEquipmentFailureRanking(EquipmentFailureRankingSearchQuery qo);
List<CompanyStatisticsVO> companyStatistics(CompanyStatisticsQuery qo);
@Select("select * from gongfu_ticket where create_time >= current_date() order by id desc limit 1")
GongfuTicket getLastTicket();
}

View File

@ -9,6 +9,7 @@ import com.nflg.mobilebroken.common.pojo.request.TicketSearchRequest;
import com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO;
import com.nflg.mobilebroken.common.pojo.vo.TicketVO;
import com.nflg.mobilebroken.repository.entity.Ticket;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@ -44,4 +45,7 @@ public interface TicketMapper extends BaseMapper<Ticket> {
IPage<AdminTicketVO> searchByFavouritesId(Integer userId, Integer favouritesId, Page<?> page);
TicketDTO getDto(Long id);
@Select("select * from ticket where create_time >= current_date() order by id desc limit 1")
Ticket getLastTicket();
}

View File

@ -68,11 +68,7 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
@Transactional
@Override
public GongfuTicket add(TicketAddRequest request, Integer userId) {
GongfuTicket lastTicket = lambdaQuery()
.ge(GongfuTicket::getCreateTime, LocalDateTime.now().toLocalDate())
.orderByDesc(GongfuTicket::getId)
.last("LIMIT 1")
.one();
GongfuTicket lastTicket = getBaseMapper().getLastTicket();
String no = lastTicket == null ? TicketUtil.getNextNo("GFGD", null) : TicketUtil.getNextNo("GFGD", lastTicket.getNo());
List<Integer> cqms = deviceTypeService.getCqms(request.getDeviceNo());
GongfuTicket ticket = new GongfuTicket()
@ -232,6 +228,7 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
@Override
public GongfuTicket completeTicket(Long id) {
GongfuTicket ticket = getById(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(!Objects.equals(ticket.getState(), TicketState.Processing.getState()))
.throwMessage("非处理中状态不允许完成");
List<Integer> tickerMangagers = adminUserService.getGongfuTickerMangagers();
@ -291,6 +288,7 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
@Override
public GongfuTicket revokedFromApp(Long id) {
GongfuTicket ticket = lambdaQuery().eq(GongfuTicket::getId, id).one();
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(!(Objects.equals(ticket.getUserId(), AppUserUtil.getUserId()) && StrUtil.equals(ticket.getUserPlatform(), AppUserUtil.getFrom())))
.throwMessage("无权操作该工单");
VUtils.trueThrowBusinessError(ticket.getState() > TicketState.ProcessingCompleted.getState())
@ -306,6 +304,7 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
@Override
public GongfuTicket revokedFromAdmin(Long id) {
GongfuTicket ticket = lambdaQuery().eq(GongfuTicket::getId, id).one();
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(!(StrUtil.equals(ticket.getUserPlatform(), Constant.FROM_ADMIN) && Objects.equals(ticket.getUserId(), AdminUserUtil.getUserId())))
.throwMessage("无权操作该工单");
VUtils.trueThrowBusinessError(ticket.getState() > TicketState.ProcessingCompleted.getState())
@ -321,6 +320,7 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
@Override
public GongfuTicket reopen(Long id) {
GongfuTicket ticket = lambdaQuery().eq(GongfuTicket::getId, id).one();
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(!(Objects.equals(ticket.getUserId(), AppUserUtil.getUserId()) && StrUtil.equals(ticket.getUserPlatform(), AppUserUtil.getFrom())))
.throwMessage("无权操作该工单");
VUtils.trueThrowBusinessError(Byte.compare(ticket.getState(), TicketState.ProcessingCompleted.getState()) > 0)
@ -360,6 +360,7 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
@Override
public List<AdminUserSimpleVO> getTicketHandle(Long id) {
GongfuTicket ticket = lambdaQuery().select(GongfuTicket::getHandle, GongfuTicket::getId).eq(GongfuTicket::getId, id).one();
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
List<Integer> handles = StrUtil.split(ticket.getHandle(), ",").stream().map(Integer::parseInt).collect(Collectors.toList());
if (CollectionUtil.isEmpty(handles)) {
return Collections.emptyList();

View File

@ -66,11 +66,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
@Transactional
@Override
public Ticket add(TicketAddRequest request, Integer userId) {
Ticket lastTicket = lambdaQuery()
.ge(Ticket::getCreateTime, LocalDateTime.now().toLocalDate())
.orderByDesc(Ticket::getId)
.last("LIMIT 1")
.one();
Ticket lastTicket = getBaseMapper().getLastTicket();
String no = lastTicket == null ? TicketUtil.getNextNo("YPSH", null) : TicketUtil.getNextNo("YPSH", lastTicket.getNo());
Ticket ticket = new Ticket()
.setNo(no)
@ -247,6 +243,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
@Override
public Ticket completeTicket(Integer id) {
Ticket ticket = getById(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(!Objects.equals(ticket.getState(), TicketState.Processing.getState()))
.throwMessage("非处理中状态不允许完成");
List<Integer> tickerMangagers = adminUserService.getTickerMangagers();
@ -328,6 +325,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
@Override
public Ticket revokedFromApp(Integer id) {
Ticket ticket = lambdaQuery().eq(Ticket::getId, id).one();
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(!(Objects.equals(ticket.getUserId(), AppUserUtil.getUserId()) && StrUtil.equals(ticket.getUserPlatform(), AppUserUtil.getFrom())))
.throwMessage("无权操作该工单");
VUtils.trueThrowBusinessError(ticket.getState() > TicketState.ProcessingCompleted.getState())
@ -343,6 +341,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
@Override
public Ticket revokedFromAdmin(Integer id) {
Ticket ticket = lambdaQuery().eq(Ticket::getId, id).one();
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(!(StrUtil.equals(ticket.getUserPlatform(), Constant.FROM_ADMIN) && Objects.equals(ticket.getUserId(), AdminUserUtil.getUserId())))
.throwMessage("无权操作该工单");
VUtils.trueThrowBusinessError(ticket.getState() > TicketState.ProcessingCompleted.getState())
@ -358,6 +357,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
@Override
public Ticket reopen(Integer id) {
Ticket ticket = lambdaQuery().eq(Ticket::getId, id).one();
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(!(Objects.equals(ticket.getUserId(), AppUserUtil.getUserId()) && StrUtil.equals(ticket.getUserPlatform(), AppUserUtil.getFrom())))
.throwMessage("无权操作该工单");
VUtils.trueThrowBusinessError(Byte.compare(ticket.getState(), TicketState.ProcessingCompleted.getState()) > 0)

View File

@ -75,6 +75,7 @@ public class TicketSolutionAuditServiceImpl extends ServiceImpl<TicketSolutionAu
List<TicketSolutionAudit> forAdd = new ArrayList<>();
List<TicketSolutionAudit> forUpdate = new ArrayList<>();
Ticket ticket = ticketService.getById(request.getTicketId());
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
request.getDepartments().forEach(detp -> {
TicketSolutionAudit audit = new TicketSolutionAudit();
if (Objects.isNull(detp.getId())) {

View File

@ -7,7 +7,10 @@
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>

View File

@ -37,7 +37,7 @@
<sql id="adminSearchWhereCondition">
<where>
t.state!=4
t.state!=4 AND t.is_delete = 0
<if test="!request.ticketManager">
AND (FIND_IN_SET(#{userId},t.handle)>0 OR (t.user_platform='admin' AND t.user_id=#{userId}))
</if>
@ -105,7 +105,7 @@
LEFT JOIN gongfu_ticket_evaluate te ON t.id=te.ticket_id AND t.state=2
LEFT JOIN gongfu_device_part p ON t.component_id=p.id
LEFT JOIN gongfu_device_part_language_data l ON p.id=l.source_id AND l.language_code=#{language}
WHERE t.user_id=#{userId} AND t.user_platform=#{from} AND t.state!=4
WHERE t.user_id=#{userId} AND t.user_platform=#{from} AND t.state!=4 AND t.is_delete = 0
<include refid="searchWhereCondition"/>
ORDER BY t.id DESC
</select>
@ -122,7 +122,7 @@
LEFT JOIN gongfu_ticket_evaluate te ON t.id=te.ticket_id AND t.state=2
LEFT JOIN gongfu_device_part p ON t.component_id=p.id
LEFT JOIN gongfu_device_part_language_data l ON p.id=l.source_id AND l.language_code=#{language}
WHERE tf.user_id=#{userId} AND t.user_platform=#{from} AND t.state!=4
WHERE tf.user_id=#{userId} AND t.user_platform=#{from} AND t.state!=4 AND t.is_delete = 0
<include refid="searchWhereCondition"/>
ORDER BY t.id DESC
</select>
@ -140,7 +140,7 @@
LEFT JOIN gongfu_device_part p ON t.component_id=p.id
LEFT JOIN gongfu_device_part_language_data l ON p.id=l.source_id AND l.language_code=#{language}
LEFT JOIN v_device vd ON t.device_no=vd.device_no
WHERE t.state!=4
WHERE t.state!=4 AND t.is_delete = 0
<if test="isPrimary==false">
AND FIND_IN_SET(#{companyId},u.company_id) AND vd.service_agent_code=#{companyCode}
</if>
@ -252,7 +252,7 @@
<select id="getAdminFavorites" resultType="com.nflg.mobilebroken.common.pojo.vo.TicketVO">
SELECT t.id, t.no, t.title
FROM ticket_follow tf
INNER JOIN gongfu_ticket t ON tf.ticket_id = t.id
INNER JOIN gongfu_ticket t ON tf.ticket_id = t.id AND t.is_delete = 0
WHERE tf.`from` = 1
AND tf.user_id = #{userId} AND tf.from=IF(#{from}='app',0,1)
AND tf.favorites_id = #{favoritesId}
@ -283,6 +283,7 @@
LEFT JOIN admin_user auc ON t.cqm=auc.id
LEFT JOIN admin_user auh ON t.current_handle=auh.id
LEFT JOIN gongfu_device_part p ON t.component_id=p.id
where t.is_delete = 0
ORDER BY t.state,t.id DESC
</select>
@ -302,7 +303,7 @@
SELECT d.agent_name as name,COUNT(1) as num
FROM gongfu_ticket t
INNER JOIN v_gongfu_device d ON t.device_no=d.device_no
where t.create_time >= #{startDate} and t.create_time &lt; #{endDate}
where t.is_delete = 0 and t.create_time >= #{startDate} and t.create_time &lt; #{endDate}
GROUP BY d.agent_name
ORDER BY COUNT(1) DESC
LIMIT #{num}

View File

@ -40,7 +40,7 @@
<sql id="adminSearchWhereCondition">
<where>
t.state!=4
t.state!=4 and t.is_delete = 0
<if test="!request.ticketManager">
AND (FIND_IN_SET(#{userId},t.handle)>0 OR fun_inAduit(t.id,#{userId})=1 OR (t.user_platform='admin' AND t.user_id=#{userId}))
</if>
@ -261,6 +261,7 @@
AND tf.user_id = #{userId} AND tf.from=IF(#{from}='app',0,1)
AND tf.favorites_id = #{favoritesId}
and tf.ticket_type=0
and t.is_delete = 0
ORDER BY t.state,t.id DESC
</select>
@ -287,6 +288,7 @@
LEFT JOIN admin_user auc ON t.cqm=auc.id
LEFT JOIN admin_user auh ON t.current_handle=auh.id
LEFT JOIN v_device_part p ON t.component_id=p.id
where t.is_delete = 0
ORDER BY t.state,t.id DESC
</select>