| | |
| | | import com.dg.core.db.manual.pojo.QueryResults; |
| | | import com.dg.core.db.manual.pojo.RecommendResult; |
| | | import com.dg.core.db.manual.pojo.Search; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Autowired(required = true) |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | |
| | | @Autowired(required = true) |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | /** |
| | | * 查询导办事务详情 |
| | | * @param Id |
| | |
| | | */ |
| | | @ApiOperation("查询导办事务详情") |
| | | @GetMapping("/getData") |
| | | @Authorization |
| | | |
| | | public ResultData selectConfigData(@RequestParam("Id") String Id,@CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | |
| | | */ |
| | | @ApiOperation("导办事物列表") |
| | | @GetMapping("/getList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "matterAndUser",required = false) String matterAndUser, |
| | | @RequestParam(value = "classifyGrade",required = false) String classifyGrade) |
| | | @RequestParam(value = "keyword",required = false) String keyword, |
| | | @RequestParam(value = "classifyGrade",required = false) String classifyGrade, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | | Page<TransactionEvent> pageParam = new Page<>(pageNum,pageSize); |
| | | List<TransactionEvent> list = iTransactionEventService.selectConfigList(pageParam,pageSize,matterAndUser,classifyGrade); |
| | | int num=iTransactionEventService.countNum(matterAndUser,classifyGrade); |
| | | List<String> ids=iOrganizationChartService.getIds(sysUser.getDepartmentId()); |
| | | List<TransactionEvent> list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | classifyGrade,ids); |
| | | int num=iTransactionEventService.countNum(keyword,classifyGrade,ids); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody TransactionEvent entity) |
| | | { |
| | | if(StringUtils.isEmpty(entity.getDepartmentId())) |
| | | { |
| | | return ResultData.error("部门id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getMatterName())) |
| | | { |
| | | return ResultData.error("事件名称不能为空"); |
| | | } |
| | | |
| | | String id=iTransactionEventService.selectDataIfExist(entity.getDepartmentId(),entity.getMatterName()); |
| | | if(!StringUtils.isEmpty(id)) |
| | | { |
| | | return ResultData.error("事件名称已存在"); |
| | | } |
| | | |
| | | return toAjax(iTransactionEventService.insertConfig(entity)); |
| | | } |
| | | |
| | |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody TransactionEvent entity) |
| | | { |
| | | if(StringUtils.isEmpty(entity.getDepartmentId())) |
| | | { |
| | | return ResultData.error("部门id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(entity.getMatterName())) |
| | | { |
| | | return ResultData.error("事件名称不能为空"); |
| | | } |
| | | |
| | | |
| | | |
| | | return toAjax(iTransactionEventService.updateConfig(entity)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/smartConsulting") |
| | | public RecommendResult smartConsulting(@RequestParam("keyWord") String keyWord){ |
| | | return iTransactionEventService.smartConsulting(keyWord); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 办事指南复制 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "办事指南复制",response = ResultData.class) |
| | | @GetMapping("/copy") |
| | | public ResultData copy(@RequestParam("Id") String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | | { |
| | | return ResultData.error("Id不能为空"); |
| | | } |
| | | |
| | | TransactionEvent transactionEvent=iTransactionEventService.selectConfigData(Id,null); |
| | | if(transactionEvent==null) |
| | | { |
| | | return ResultData.error("复制项不存在"); |
| | | } |
| | | transactionEvent.setMatterName(transactionEvent.getMatterName()+"(副本)"); |
| | | |
| | | transactionEvent.setId(null); |
| | | return toAjax(iTransactionEventService.insertConfig(transactionEvent)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |