gaoluyang
4 天以前 d39e4f7d839167c16425086dfa2f8747bccfdff9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package cn.iocoder.yudao.module.aftersales.service.ticket;
 
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.aftersales.dal.dataobject.ticket.AfterSaleTicketFlowDO;
import cn.iocoder.yudao.module.aftersales.dal.mysql.ticket.AfterSaleTicketFlowMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
 
import java.util.List;
 
/**
 * 售后工单流转记录 Service 实现类
 */
@Service
@Validated
public class AfterSaleTicketFlowServiceImpl implements AfterSaleTicketFlowService {
 
    @Resource
    private AfterSaleTicketFlowMapper ticketFlowMapper;
 
    @Override
    public void record(Long ticketId, String action, String actionName,
                       Integer fromStatus, Integer toStatus, String content) {
        Long operatorId = SecurityFrameworkUtils.getLoginUserId();
        AfterSaleTicketFlowDO flow = AfterSaleTicketFlowDO.builder()
                .ticketId(ticketId)
                .action(action)
                .actionName(actionName)
                .fromStatus(fromStatus)
                .toStatus(toStatus)
                .content(content)
                .operatorId(operatorId)
                .build();
        ticketFlowMapper.insert(flow);
    }
 
    @Override
    public List<AfterSaleTicketFlowDO> getFlowList(Long ticketId) {
        return ticketFlowMapper.selectListByTicketId(ticketId);
    }
 
}