puzhibing
2023-08-01 36ee24623731cb8421f58dc8750d471562106d02
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.dsh.guns.modular.system.controller.code;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsh.course.feignClient.course.CoursePackageTypeClient;
import com.dsh.course.feignClient.course.model.TCoursePackageType;
import com.dsh.guns.modular.system.service.ICoursePackageService;
import com.dsh.guns.modular.system.service.IStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
 
/**
 * @author zhibing.pu
 * @Date 2023/8/1 11:50
 */
@Controller
@RequestMapping("/coursePackage")
public class TCoursePackageController {
 
    private String PREFIX = "/system/coursePackage/";
 
    @Autowired
    private ICoursePackageService coursePackageService;
 
    @Resource
    private CoursePackageTypeClient coursePackageTypeClient;
 
    @Autowired
    private IStoreService storeService;
 
 
 
 
 
    /**
     * 跳转到列表页
     * @param model
     * @return
     */
    @GetMapping("/openCoursePackageListPage")
    public String openCoursePackageListPage(Model model){
        List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType();
        model.addAttribute("coursePackageType", tCoursePackageTypes);
        List<Map<String, Object>> list = storeService.queryProvince();
        model.addAttribute("province", list);
        return PREFIX + "coursePackage.html";
    }
 
 
    /**
     * 获取城市列表
     * @param code
     * @return
     */
    @ResponseBody
    @PostMapping("/queryCity")
    public List<Map<String, Object>> queryCity(Integer code){
        return storeService.queryCity(code);
    }
 
 
    /**
     * 获取列表数据
     * @param provinceCode
     * @param cityCode
     * @param coursePackageTypeId
     * @param name
     * @param status
     * @param state
     * @return
     */
    @ResponseBody
    @PostMapping("/queryCoursePackageLists")
    public Object queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, String name, Integer status, Integer state){
        Page<Map<String, Object>> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, cityCode, coursePackageTypeId, name, status, state);
        return mapPage;
    }
 
}