Commit 31c081c536baf1702e467c53c607c980f7d2b037

Authored by changpengfei
1 parent 8e7852b1f8
Exists in master and in 1 other branch dev

增加字典管理

Showing 1 changed file with 38 additions and 0 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java View file @ 31c081c
1 1 package com.lyms.talkonlineweb.controller;
2 2  
3 3 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  4 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 5 import com.lyms.talkonlineweb.domain.LymsDict;
  6 +import com.lyms.talkonlineweb.domain.LymsHdepart;
5 7 import com.lyms.talkonlineweb.domain.Regions;
6 8 import com.lyms.talkonlineweb.result.BaseResponse;
7 9 import com.lyms.talkonlineweb.service.LymsDictService;
... ... @@ -42,6 +44,42 @@
42 44 BaseResponse baseResponse=new BaseResponse();
43 45 List<LymsDict> dictList=lymsDictService.list(Wrappers.query(dict));
44 46 baseResponse.setObject(dictList);
  47 + return baseResponse;
  48 + }
  49 +
  50 + /**
  51 + * 添加或修改字典数据
  52 + * @param dict
  53 + * @return
  54 + */
  55 + @GetMapping("saveDict")
  56 + public BaseResponse saveDict(LymsDict dict){
  57 + BaseResponse baseResponse=new BaseResponse();
  58 + boolean f=lymsDictService.save(dict);
  59 + baseResponse.setErrorcode(f==true?0:1);
  60 + return baseResponse;
  61 + }
  62 +
  63 + /**
  64 + * 删除字典数据
  65 + * @param did
  66 + * @return
  67 + */
  68 + @GetMapping("delDict")
  69 + public BaseResponse saveDict(int did){
  70 + BaseResponse baseResponse=new BaseResponse();
  71 + boolean f=lymsDictService.removeById(did);
  72 + baseResponse.setErrorcode(f==true?0:1);
  73 + return baseResponse;
  74 + }
  75 +
  76 + @GetMapping("sltDict")
  77 + public BaseResponse sltDepartLst(LymsDict dict, int current, int size){
  78 + BaseResponse baseResponse=new BaseResponse();
  79 + Page<LymsDict> page=new Page<>(current,size);
  80 + Page<LymsDict> departPage=lymsDictService.page(page, Wrappers.query(dict).orderByDesc("sort"));
  81 + baseResponse.setObject(departPage);
  82 +
45 83 return baseResponse;
46 84 }
47 85