| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZExperience; |
| | | import com.ruoyi.service.ZExperienceService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Autowired |
| | | private ZExperienceService zExperienceService; |
| | | |
| | | @Autowired |
| | | private ISysUserService iSysUserService; |
| | | |
| | | |
| | | |
| | | @GetMapping("/all") |
| | | public AjaxResult listAll(){ |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | |
| | | |
| | | |
| | | List<ZExperience> list = zExperienceService.selectExperienceList(userId); |
| | | log.info("导出记录为:{}",list); |
| | | ExcelUtil<ZExperience> util = new ExcelUtil<>(ZExperience.class); |
| | |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | |
| | | if(iSysUserService.findUserStatus(userId)) |
| | | return AjaxResult.error("您的试用期已经结束,请付费继续使用"); |
| | | |
| | | boolean flag=zExperienceService.importExcel(file,userId); |
| | | if(flag){ |
| | | return AjaxResult.success("导入数据成功"); |
| | | } |
| | | }else |
| | | return AjaxResult.error("导入数据失败"); |
| | | } |
| | | |
| | |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | |
| | | if(iSysUserService.findUserStatus(userId)) |
| | | return AjaxResult.error("您的试用期已经结束,请付费继续使用"); |
| | | |
| | | zExperience.setUserId(userId); |
| | | return toAjax(zExperienceService.save(zExperience)); |
| | | } |
| | |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ZExperience zExperience) |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | |
| | | if(iSysUserService.findUserStatus(userId)) |
| | | return AjaxResult.error("您的试用期已经结束,请付费继续使用"); |
| | | return toAjax(zExperienceService.updateById(zExperience)); |
| | | } |
| | | // |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | |
| | | if(iSysUserService.findUserStatus(userId)) |
| | | return AjaxResult.error("您的试用期已经结束,请付费继续使用"); |
| | | return toAjax(zExperienceService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |