| | |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Resource |
| | | private TRepairService repairService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Autowired |
| | | private SysUserClient userClient; |
| | | |
| | | /** |
| | | * 添加故障报修管理 |
| | | */ |
| | | @Log(title = "添加故障报修管理", businessType = BusinessType.INSERT,operatorType = OperatorType.MOBILE) |
| | | @ApiOperation(tags = {"小程序-故障报修"},value = "添加故障报修管理") |
| | | @PostMapping(value = "/add") |
| | | 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()); |
| | | } |
| | | repairService.add(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getRepairList") |