| | |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.AjaxResult; |
| | | import com.dg.core.db.gen.entity.AutomessageSmartConsulting; |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | |
| | | import com.dg.core.file.FtpConstants; |
| | | import com.dg.core.file.MimeTypeUtils; |
| | | import com.dg.core.file.SFTPUtil; |
| | | import com.dg.core.service.IAutomessageSmartConsultingService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.util.TableDataInfo; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.InputStream; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | |
| | | |
| | | @Autowired(required = true) |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | @Autowired(required = true) |
| | | IAutomessageSmartConsultingService iAutomessageSmartConsultingService; |
| | | |
| | | /** |
| | | * 查询导办事务详情 |
| | |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "keyword",required = false) String keyword, |
| | | @RequestParam(value = "classifyGrade",required = false) String classifyGrade, |
| | | @RequestParam(value = "departmentId",required = false) String departmentId, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | | Page<TransactionEvent> pageParam = new Page<>(pageNum,pageSize); |
| | | // List<String> ids=iOrganizationChartService.getIds(sysUser.getDepartmentId()); |
| | | List<TransactionEvent> list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | List<TransactionEvent> list; |
| | | int num; |
| | | if (departmentId!=null&&departmentId.length()>0){ |
| | | List<String> ids=iOrganizationChartService.getDepartmentId(departmentId); |
| | | list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | classifyGrade,ids); |
| | | num=iTransactionEventService.countNum(keyword,classifyGrade,ids); |
| | | |
| | | }else { |
| | | list = iTransactionEventService.selectConfigList(pageParam,pageSize,keyword, |
| | | classifyGrade,null); |
| | | int num=iTransactionEventService.countNum(keyword,classifyGrade,null); |
| | | num=iTransactionEventService.countNum(keyword,classifyGrade,null); |
| | | } |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | /** |
| | | * 导办事物列表 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation("根据部门id获取导办事物列表") |
| | | @PostMapping("/department/getList") |
| | | @Authorization |
| | | public TableDataInfo<TransactionEvent> selectConfigList(@RequestBody List<String> DepartmentId, |
| | | @CurrentUser SysUser sysUser) |
| | | { |
| | | if(DepartmentId==null||DepartmentId.size()<1) |
| | | { |
| | | DepartmentId=null; |
| | | } |
| | | List<TransactionEvent> list = iTransactionEventService.selectConfigList(null,null,DepartmentId); |
| | | int num=iTransactionEventService.countNum(null,null,DepartmentId); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | int i = iTransactionEventService.deleteConfigById(Id); |
| | | if (i>0) |
| | | return toAjax(iTransactionEventService.deleteConfigById(Id)); |
| | | return ResultData.success("删除成功"); |
| | | else |
| | | return ResultData.error("删除失败可能该工单有单据"); |
| | | } |
| | |
| | | @GetMapping("/queryByClassifyIdConfigList") |
| | | public TableDataInfo queryByClassifyIdConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam("classifyId") String classifyId, |
| | | @RequestParam(value = "classifyId",required = false) String classifyId, |
| | | @RequestParam(required = false,name="departmentId") Integer departmentId){ |
| | | Assert.notNull(pageNum, "pageNum 不能为空"); |
| | | Assert.notNull(pageSize, "pageSize 不能为空"); |
| | |
| | | */ |
| | | @ApiOperation(value = "智能咨询",response = RecommendResult.class) |
| | | @GetMapping("/smartConsulting") |
| | | public RecommendResult smartConsulting(@RequestParam("keyWord") String keyWord){ |
| | | public RecommendResult smartConsulting(@RequestParam("keyWord") String keyWord,@CurrentUser SysUser sysUser){ |
| | | AutomessageSmartConsulting automessageSmartConsulting = new AutomessageSmartConsulting(); |
| | | if (sysUser!=null){ |
| | | automessageSmartConsulting.setCreateUserId(sysUser.getUserId()); |
| | | } |
| | | automessageSmartConsulting.setType(2); |
| | | automessageSmartConsulting.setCreateTime(LocalDateTime.now()); |
| | | iAutomessageSmartConsultingService.add(automessageSmartConsulting); |
| | | return iTransactionEventService.smartConsulting(keyWord); |
| | | } |
| | | |
| | |
| | | { |
| | | boolean a = false; |
| | | String fileName = file.getOriginalFilename(); |
| | | return null; |
| | | |
| | | Integer b = iTransactionEventService.batchImport(fileName, file); |
| | | if (b == 3) {// |
| | | return ResultData.success("全部导入成功");//全部导入成功 |
| | | } else if (b == 2) { |
| | | return ResultData.success("部分导入成功");//部分导入成功 |
| | | } else if (b == 0) { |
| | | return ResultData.error("部分失败");//导入失败 |
| | | } |
| | | return ResultData.error("部分失败");//导入失败 |
| | | } |
| | | |
| | | |