| | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.service.IClassifyAdministrationService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | |
| | | @Autowired(required = true) |
| | | IClassifyAdministrationService iClassifyAdministrationService; |
| | | |
| | | @Autowired(required = true) |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | |
| | | */ |
| | | @ApiOperation(value = " 获取管理菜单列表(已分级)",response = ClassifyAdministration.class) |
| | | @GetMapping("/getListByParentId") |
| | | @Authorization |
| | | public TableDataInfo selectConfigListByParentId(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "parentId",required = false) String parentId, |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取管理菜单列表 |
| | | * @return |
| | |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "name",required = false) String name) |
| | | @RequestParam(value = "name",required = false) String name, |
| | | @RequestParam(value = "classifyGrade",required = false) String classifyGrade) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<ClassifyAdministration> pageParam = new Page<>(pageNum,pageSize); |
| | | List<ClassifyAdministration> list = iClassifyAdministrationService.selectConfigList(pageParam,pageSize,name,""); |
| | | int num=iClassifyAdministrationService.countNum(name,""); |
| | | List<ClassifyAdministration> list = iClassifyAdministrationService.selectConfigList(pageParam,pageSize,name,classifyGrade); |
| | | int num=iClassifyAdministrationService.countNum(name,classifyGrade); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | |
| | | { |
| | | return ResultData.error("id 不能为空"); |
| | | } |
| | | |
| | | /** |
| | | * 根据上级id查询子分类 |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<String> list=iClassifyAdministrationService.selectParent(Id); |
| | | if(list!=null && list.size()>0) |
| | | { |
| | | return ResultData.error("请先删除其下的二级分类"); |
| | | } |
| | | |
| | | List<String> listIds=iTransactionEventService.selectclassifyId(Id); |
| | | if(listIds!=null && listIds.size()>0) |
| | | { |
| | | return ResultData.error("分类下有办事指南!不能删除"); |
| | | } |
| | | |
| | | return toAjax(iClassifyAdministrationService.deleteConfigById(Id)); |
| | | } |
| | | |
| | | /** |
| | | * 获取分类根据id 如果是二级id则获取的是办事指南 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取分类根据id 如果是二级id则获取的是办事指南,不传参默认是0") |
| | | @GetMapping("/queryListById") |
| | | ResultData queryListById(@RequestParam(value = "id",required = false) Integer id){ |
| | | if(id==null) |
| | | id=0; |
| | | return iClassifyAdministrationService.queryListById(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 树状分类选择列表 |
| | | * @return |
| | | */ |
| | | @ApiOperation("树状分类选择列表") |
| | | @GetMapping("/getClassifyList") |
| | | public TableDataInfo getClassifyList() |
| | | { |
| | | List<ClassifyAdministration> list=iClassifyAdministrationService.selectConfigList("","1"); |
| | | |
| | | for(ClassifyAdministration entity:list) |
| | | { |
| | | entity.setClassifyAdministrationEntityList(iClassifyAdministrationService.selectParentData(entity.getId()+"")); |
| | | } |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |