935090232@qq.com
2021-03-19 81a3369395a7cccceb7cd36f5238cc6fe2aa88e5
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
package com.matrix.system.hive.action;
 
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.service.SysUsersService;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.bean.Article;
import com.matrix.system.hive.bean.ArticleType;
import com.matrix.system.hive.service.ArticleService;
import com.matrix.system.hive.service.ArticleTypeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 */
@RequestMapping(value = "/admin/trainingArticle")
@Controller
public class TrainingArticleController extends BaseController {
 
    @Resource
    private SysUsersService usersService;
 
    @Resource
    private ArticleService articleService;
    @Resource
    private ArticleTypeService articleTypeService;
 
    /**
     * 成长学院一级分类
     */
    @RequestMapping(value = "/queryMaterials")
    public String queryMaterials() {
        ArticleType articleType = new ArticleType();
        ArticleType articleType1 = new ArticleType();
        articleType.setArticleTypeName(Dictionary.ARTICEL_TYPE_NAME_MDXY);
        List<ArticleType> articleTypeList = articleTypeService.findByModel(articleType);
        if (articleTypeList.size() > 0) {
            articleType1.setParentId(articleTypeList.get(0).getId());
            WebUtil.getRequest().setAttribute("articleList", articleTypeService.findByModel(articleType1));
        }
 
        return "admin/hive/mobile/personal-trainingMaterials1";
    }
 
    /**
     * 成长学院二级级分类
     */
    @RequestMapping(value = "/queryM")
    public String queryM(long id) {
        ArticleType articleType = new ArticleType();
        articleType.setParentId(id);
        WebUtil.getRequest().setAttribute("articleList", articleTypeService.findByModel(articleType));
        return "admin/hive/mobile/personal-trainingMaterials2";
    }
 
    /**
     * 查询培训资料集合
     */
    @RequestMapping(value = "/queryTrainingMaterials")
    public @ResponseBody
    AjaxResult queryTrainingMaterials(Article article) {
        article.setIsPublish(Dictionary.FLAG_YES);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, articleService.findByModel(article), 0);
    }
 
    /**
     * 查询培训资料详情
     */
    @RequestMapping(value = "/queryOne")
    public String queryOne(long id) {
        Article article = articleService.findById(id);
        WebUtil.getRequest().setAttribute("article", article);
        return "admin/hive/mobile/personal-trainingMaterials-info";
    }
 
 
}