| | |
| | | public class EquipmentinfoController extends BaseController { |
| | | @Autowired |
| | | private IEquipmentinfoService equipmentinfoService; |
| | | @Autowired |
| | | private DingTalkService dingTalkService; |
| | | |
| | | |
| | | /** |
| | | * 查询【请填写功能名称】列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:equipmentinfo:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(Equipmentinfo equipmentinfo) { |
| | | //@PreAuthorize("@ss.hasPermi('system:equipmentinfo:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody Equipmentinfo equipmentinfo) { |
| | | startPage(); |
| | | List<Equipmentinfo> list = equipmentinfoService.selectEquipmentinfoList(equipmentinfo); |
| | | return getDataTable(list); |
| | |
| | | /** |
| | | * 导出【请填写功能名称】列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:equipmentinfo:export')") |
| | | //@PreAuthorize("@ss.hasPermi('system:equipmentinfo:export')") |
| | | @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, Equipmentinfo equipmentinfo) { |
| | |
| | | /** |
| | | * 获取【请填写功能名称】详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:equipmentinfo:query')") |
| | | //@PreAuthorize("@ss.hasPermi('system:equipmentinfo:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(equipmentinfoService.selectEquipmentinfoById(id)); |
| | |
| | | /** |
| | | * 新增【请填写功能名称】 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:equipmentinfo:add')") |
| | | //@PreAuthorize("@ss.hasPermi('system:equipmentinfo:add')") |
| | | @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody Equipmentinfo equipmentinfo) { |
| | | return toAjax(equipmentinfoService.insertEquipmentinfo(equipmentinfo)); |
| | | } |
| | |
| | | /** |
| | | * 修改【请填写功能名称】 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:equipmentinfo:edit')") |
| | | //@PreAuthorize("@ss.hasPermi('system:equipmentinfo:edit')") |
| | | @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody Equipmentinfo equipmentinfo) { |
| | | return toAjax(equipmentinfoService.updateEquipmentinfo(equipmentinfo)); |
| | | } |
| | |
| | | /** |
| | | * 删除【请填写功能名称】 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:equipmentinfo:remove')") |
| | | //@PreAuthorize("@ss.hasPermi('system:equipmentinfo:remove')") |
| | | @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(equipmentinfoService.deleteEquipmentinfoByIds(ids)); |
| | | } |
| | |
| | | /** |
| | | * 问题上报 |
| | | */ |
| | | |
| | | @RequestMapping("/reportContent") |
| | | @PostMapping("/reportContent") |
| | | public AjaxResult reportContent(@RequestBody ReportReqVo reportReqVo) { |
| | | if (StringUtils.isEmpty(reportReqVo.getDealDept()) && StringUtils.isEmpty(reportReqVo.getDealPersionNO())) { |
| | | return error("处理人和处理部门不能同时为空!"); |
| | | } |
| | | Boolean aBoolean = false; |
| | | //1.判断处理人的工号是否为空,如果不为空,获取用户的的联系方式 |
| | | if (StringUtils.isNotEmpty(reportReqVo.getDealPersionNO())) { |
| | | |
| | | //2.如何处理人不为空,根据通知方式,调用对应的接口,将上报问题发出 |
| | | if (reportReqVo.getNoticeWay() == "钉钉") { |
| | | //调用钉钉接口,进行消息发送 |
| | | } else if (reportReqVo.getNoticeWay() == "微信") { |
| | | //需要企业微信,后期再做 |
| | | } else if (reportReqVo.getNoticeWay() == "电话") { |
| | | //调用电话的接口 |
| | | } |
| | | } |
| | | |
| | | //3.获取处理部门,调用钉钉接口,将上报问题发出 |
| | | if (StringUtils.isNotEmpty(reportReqVo.getDealDept())) { |
| | | DingTalkReqVo dingTalkReqVo = new DingTalkReqVo(); |
| | | //设置发送内容 |
| | | dingTalkReqVo.setContents(null); |
| | | dingTalkReqVo.setDeptId(reportReqVo.getDealDeptID()); |
| | | dingTalkReqVo.setUserId(reportReqVo.getDealPersionDingNO()); |
| | | aBoolean = dingTalkService.sendNotification(dingTalkReqVo); |
| | | } |
| | | |
| | | // 将工作流推至下一节点 |
| | | |
| | | //返回结果 |
| | | Boolean aBoolean = equipmentinfoService.reportContent(reportReqVo); |
| | | return toAjax(aBoolean); |
| | | } |
| | | } |