xuhy
2024-12-13 381bd9f6a9525b11d574b4a4f79925d99d3ad626
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.ruoyi.web.controller.api;
 
 
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.query.CommentQuery;
import com.ruoyi.system.query.MessageQuery;
import com.ruoyi.system.service.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.Arrays;
 
/**
 * <p>
 * 咨询留言 前端控制器
 * </p>
 *
 * @author luodangjia
 * @since 2024-09-19
 */
@RestController
@RequestMapping("/t-consultation-message")
public class TConsultationMessageController {
    @Resource
    private TConsultationMessageService consultationMessageService;
    @Resource
    private TConsultationService consultationService;
    @Resource
    private TTechnicalTitleService tTechnicalTitleService;
    @Resource
    private TTitleMajorService majorService;
    @Resource
    private TLevelService levelService;
 
    //列表
    @ApiOperation(value = "列表",tags = "后台-需求留言管理")
    @PostMapping("/list")
    public R<PageInfo<TConsultationMessage>> list(@RequestBody MessageQuery messageQuery){
        PageInfo<TConsultationMessage> tConsultationMessagePageInfo = consultationMessageService.pageQuery(messageQuery);
        for (TConsultationMessage record : tConsultationMessagePageInfo.getRecords()) {
            TConsultation byId = consultationService.getById(record.getConsultationId());
            record.setTitle(byId.getClassificationName());
 
 
            TTechnicalTitle byId1 = tTechnicalTitleService.getById(byId.getTitleId() );
            TTitleMajor byId2 = majorService.getById(byId.getMajorId());
            TLevel byId3 = levelService.getById(byId.getLevel());
            record.setClassName(byId1.getTitileName()+"-"+byId2.getMajorName()+"-"+byId3.getName());
        }
        return R.ok(tConsultationMessagePageInfo);
    }
    //删除
    @ApiOperation(value = "删除",tags = "后台-需求留言管理")
    @PostMapping("/deleteByIds")
    public R deleteById(String ids){
        consultationMessageService.removeByIds(Arrays.asList(ids.split(",")));
        return R.ok();
    }
}