| | |
| | | public class EquipmentinfoController extends BaseController { |
| | | @Autowired |
| | | private IEquipmentinfoService equipmentinfoService; |
| | | @Autowired |
| | | private DingTalkService dingTalkService; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 问题上报 |
| | | */ |
| | | |
| | | @RequestMapping("/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); |
| | | } |
| | | } |