| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | import com.ruoyi.chargingPile.service.TRepairService; |
| | |
| | | private TRepairService repairService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private SysUserClient userClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | /** |
| | | * 添加故障报修管理 |
| | |
| | | public AjaxResult<String> add(@Validated @RequestBody TRepair dto) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 查询报修人员信息 |
| | | SysUser user = userClient.getSysUser(userId).getData(); |
| | | if(Objects.nonNull(user)){ |
| | | dto.setRepairman(user.getUserName()); |
| | | TAppUser user = appUserClient.getUserById(userId).getData(); |
| | | if(Objects.nonNull(user)){ |
| | | dto.setRepairman(user.getName()); |
| | | } |
| | | repairService.add(dto); |
| | | return AjaxResult.success(); |