| | |
| | | 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 |
| | |
| | | { |
| | | 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)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation("获取分类根据id 如果是二级id则获取的是办事指南,不传参默认是0") |
| | | @GetMapping("/queryListById") |
| | | @Authorization |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |