jx-bug
This commit is contained in:
parent
fa0deb4ff3
commit
2c3038846e
@ -0,0 +1,97 @@
|
|||||||
|
package cn.iocoder.yudao.module.jx.controller.admin;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback;
|
||||||
|
import cn.iocoder.yudao.module.jx.service.IDriveSchoolFeedbackService;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-27
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/feedback")
|
||||||
|
public class DriveSchoolFeedbackController extends BaseController
|
||||||
|
{
|
||||||
|
@Resource
|
||||||
|
private IDriveSchoolFeedbackService driveSchoolFeedbackService;
|
||||||
|
|
||||||
|
@GetMapping("/insertData/{content}")
|
||||||
|
public void insertData(@PathVariable("content") String content) {
|
||||||
|
driveSchoolFeedbackService.insertData(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询反馈列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public CommonResult<IPage<?>> list(DriveSchoolFeedback driveSchoolFeedback)
|
||||||
|
{
|
||||||
|
Page<DriveSchoolFeedback> page = new Page<>(driveSchoolFeedback.getPageNum(), driveSchoolFeedback.getPageSize());
|
||||||
|
IPage<DriveSchoolFeedback> driveSchoolFeedbackIPage = driveSchoolFeedbackService.selectDriveSchoolFeedbackList(driveSchoolFeedback, page);
|
||||||
|
return CommonResult.success(driveSchoolFeedbackIPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询反馈列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/like")
|
||||||
|
public CommonResult like(DriveSchoolFeedback driveSchoolFeedback)
|
||||||
|
{
|
||||||
|
return CommonResult.success(driveSchoolFeedbackService.selectDriveSchoolFeedbackListAll(driveSchoolFeedback));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出反馈列表
|
||||||
|
*/
|
||||||
|
// @Log(title = "反馈", businessType = BusinessType.EXPORT)
|
||||||
|
// @PostMapping("/export")
|
||||||
|
// public void export(HttpServletResponse response, DriveSchoolFeedback driveSchoolFeedback)
|
||||||
|
// {
|
||||||
|
// List<DriveSchoolFeedback> list = driveSchoolFeedbackService.selectDriveSchoolFeedbackList(driveSchoolFeedback);
|
||||||
|
// ExcelUtil<DriveSchoolFeedback> util = new ExcelUtil<DriveSchoolFeedback>(DriveSchoolFeedback.class);
|
||||||
|
// util.exportExcel(response, list, "反馈数据");
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取反馈详细信息
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public CommonResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(driveSchoolFeedbackService.selectDriveSchoolFeedbackById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增反馈
|
||||||
|
*/
|
||||||
|
@PostMapping
|
||||||
|
public CommonResult add(@RequestBody DriveSchoolFeedback driveSchoolFeedback) throws Exception {
|
||||||
|
return toAjax(driveSchoolFeedbackService.insertDriveSchoolFeedback(driveSchoolFeedback));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改反馈
|
||||||
|
*/
|
||||||
|
@PutMapping
|
||||||
|
public CommonResult edit(@RequestBody DriveSchoolFeedback driveSchoolFeedback)
|
||||||
|
{
|
||||||
|
return toAjax(driveSchoolFeedbackService.updateDriveSchoolFeedback(driveSchoolFeedback));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除反馈
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public CommonResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(driveSchoolFeedbackService.deleteDriveSchoolFeedbackByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.jx.domain;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.annotation.Excel;
|
||||||
|
import cn.iocoder.yudao.module.jx.core.page.TenantBaDO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈对象 drive_school_feedback
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DriveSchoolFeedback extends TenantBaDO
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 用户id */
|
||||||
|
@Excel(name = "用户id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/** 公报内容 */
|
||||||
|
@Excel(name = "公报内容")
|
||||||
|
private String content;
|
||||||
|
private String jlContent;
|
||||||
|
private String likes;
|
||||||
|
private Long jlId;
|
||||||
|
private String jlName;
|
||||||
|
private Long jxId;
|
||||||
|
private String jxName;
|
||||||
|
//评价类型 0:训练评价 1:拿证后评价
|
||||||
|
private String evaluateType;
|
||||||
|
|
||||||
|
//用户姓名
|
||||||
|
private String userName;
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package cn.iocoder.yudao.module.jx.mapper;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-27
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface DriveSchoolFeedbackMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询反馈
|
||||||
|
*
|
||||||
|
* @param id 反馈主键
|
||||||
|
* @return 反馈
|
||||||
|
*/
|
||||||
|
public DriveSchoolFeedback selectDriveSchoolFeedbackById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询反馈列表
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 反馈集合
|
||||||
|
*/
|
||||||
|
public IPage<DriveSchoolFeedback> selectDriveSchoolFeedbackList(@Param("entity") DriveSchoolFeedback driveSchoolFeedback, Page<DriveSchoolFeedback> page);
|
||||||
|
public List<DriveSchoolFeedback> selectDriveSchoolFeedbackListAll(@Param("entity") DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
public Integer likeOne(DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
public Integer likeTwo(DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
public Integer likeThree(DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增反馈
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDriveSchoolFeedback(DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改反馈
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDriveSchoolFeedback(DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除反馈
|
||||||
|
*
|
||||||
|
* @param id 反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDriveSchoolFeedbackById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDriveSchoolFeedbackByIds(Long[] ids);
|
||||||
|
|
||||||
|
void insertData(@Param("userId") Long userId, @Param("content") String content);
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package cn.iocoder.yudao.module.jx.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-27
|
||||||
|
*/
|
||||||
|
public interface IDriveSchoolFeedbackService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询反馈
|
||||||
|
*
|
||||||
|
* @param id 反馈主键
|
||||||
|
* @return 反馈
|
||||||
|
*/
|
||||||
|
public DriveSchoolFeedback selectDriveSchoolFeedbackById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询反馈列表
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 反馈集合
|
||||||
|
*/
|
||||||
|
public IPage<DriveSchoolFeedback> selectDriveSchoolFeedbackList(DriveSchoolFeedback driveSchoolFeedback, Page<DriveSchoolFeedback> page);
|
||||||
|
public List<DriveSchoolFeedback> selectDriveSchoolFeedbackListAll(DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
public Map<Object,Object> like(DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增反馈
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDriveSchoolFeedback(DriveSchoolFeedback driveSchoolFeedback) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改反馈
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDriveSchoolFeedback(DriveSchoolFeedback driveSchoolFeedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的反馈主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDriveSchoolFeedbackByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除反馈信息
|
||||||
|
*
|
||||||
|
* @param id 反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDriveSchoolFeedbackById(Long id);
|
||||||
|
|
||||||
|
void insertData(String content);
|
||||||
|
}
|
@ -45,8 +45,7 @@ import java.util.List;
|
|||||||
* @date 2024-05-07
|
* @date 2024-05-07
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassService
|
public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
@Lazy
|
||||||
private DriveSchoolExamPassMapper driveSchoolExamPassMapper;
|
private DriveSchoolExamPassMapper driveSchoolExamPassMapper;
|
||||||
@ -73,13 +72,13 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
* @return 考试通过
|
* @return 考试通过
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DriveSchoolExamPass selectDriveSchoolExamPassById(Long id)
|
public DriveSchoolExamPass selectDriveSchoolExamPassById(Long id) {
|
||||||
{
|
|
||||||
return driveSchoolExamPassMapper.selectDriveSchoolExamPassById(id);
|
return driveSchoolExamPassMapper.selectDriveSchoolExamPassById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DriveSchoolInfoMapper driveSchoolInfoMapper;
|
private DriveSchoolInfoMapper driveSchoolInfoMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询考试通过列表
|
* 查询考试通过列表
|
||||||
*
|
*
|
||||||
@ -87,11 +86,11 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
* @return 考试通过
|
* @return 考试通过
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<DriveSchoolExamPass> selectDriveSchoolExamPassList(DriveSchoolExamPass driveSchoolExamPass, Page<DriveSchoolExamPass> page)
|
public IPage<DriveSchoolExamPass> selectDriveSchoolExamPassList(DriveSchoolExamPass driveSchoolExamPass, Page<DriveSchoolExamPass> page) {
|
||||||
{
|
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
AdminUserRespDTO user = userApi.getUser(userId);
|
AdminUserRespDTO user = userApi.getUser(userId);
|
||||||
Long deptId = user.getDeptId();
|
Long deptId = user.getDeptId();
|
||||||
|
deptId = 227L;
|
||||||
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
||||||
driveSchoolExamPass.setJxId(schoolInfoByDeptId.getId());
|
driveSchoolExamPass.setJxId(schoolInfoByDeptId.getId());
|
||||||
return driveSchoolExamPassMapper.selectDriveSchoolExamPassList(driveSchoolExamPass, page);
|
return driveSchoolExamPassMapper.selectDriveSchoolExamPassList(driveSchoolExamPass, page);
|
||||||
@ -107,8 +106,7 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertDriveSchoolExamPass(DriveSchoolExamPass driveSchoolExamPass)
|
public int insertDriveSchoolExamPass(DriveSchoolExamPass driveSchoolExamPass) {
|
||||||
{
|
|
||||||
DriveSchoolPay driveSchoolPay1 = new DriveSchoolPay();
|
DriveSchoolPay driveSchoolPay1 = new DriveSchoolPay();
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
DriveSchoolPay driveSchoolPay2 = driveSchoolPayService.selectByUserId(userId);
|
DriveSchoolPay driveSchoolPay2 = driveSchoolPayService.selectByUserId(userId);
|
||||||
@ -154,8 +152,7 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateDriveSchoolExamPass(DriveSchoolExamPass driveSchoolExamPass)
|
public int updateDriveSchoolExamPass(DriveSchoolExamPass driveSchoolExamPass) {
|
||||||
{
|
|
||||||
//driveSchoolExamPass.setUpdateTime(DateUtils.getNowDate());
|
//driveSchoolExamPass.setUpdateTime(DateUtils.getNowDate());
|
||||||
return driveSchoolExamPassMapper.updateDriveSchoolExamPass(driveSchoolExamPass);
|
return driveSchoolExamPassMapper.updateDriveSchoolExamPass(driveSchoolExamPass);
|
||||||
}
|
}
|
||||||
@ -167,8 +164,7 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteDriveSchoolExamPassByIds(Long[] ids)
|
public int deleteDriveSchoolExamPassByIds(Long[] ids) {
|
||||||
{
|
|
||||||
return driveSchoolExamPassMapper.deleteDriveSchoolExamPassByIds(ids);
|
return driveSchoolExamPassMapper.deleteDriveSchoolExamPassByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,8 +175,7 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteDriveSchoolExamPassById(Long id)
|
public int deleteDriveSchoolExamPassById(Long id) {
|
||||||
{
|
|
||||||
return driveSchoolExamPassMapper.deleteDriveSchoolExamPassById(id);
|
return driveSchoolExamPassMapper.deleteDriveSchoolExamPassById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,6 +196,7 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询教练工资
|
* 查询教练工资
|
||||||
|
*
|
||||||
* @param driveSchoolExamPass
|
* @param driveSchoolExamPass
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -213,6 +209,7 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
AdminUserRespDTO user = userApi.getUser(userId);
|
AdminUserRespDTO user = userApi.getUser(userId);
|
||||||
Long deptId = user.getDeptId();
|
Long deptId = user.getDeptId();
|
||||||
|
deptId = 227L;
|
||||||
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.getSchoolInfoByDeptId(deptId);
|
||||||
driveSchoolExamPass.setJxId(schoolInfoByDeptId.getId());
|
driveSchoolExamPass.setJxId(schoolInfoByDeptId.getId());
|
||||||
}
|
}
|
||||||
@ -301,6 +298,7 @@ public class DriveSchoolExamPassServiceImpl implements IDriveSchoolExamPassServi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询教练工资
|
* 查询教练工资
|
||||||
|
*
|
||||||
* @param driveSchoolExamPass
|
* @param driveSchoolExamPass
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,176 @@
|
|||||||
|
package cn.iocoder.yudao.module.jx.service.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback;
|
||||||
|
import cn.iocoder.yudao.module.jx.domain.DriveSchoolInfo;
|
||||||
|
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolFeedbackMapper;
|
||||||
|
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolInfoMapper;
|
||||||
|
import cn.iocoder.yudao.module.jx.payment.entity.DriveSchoolPay;
|
||||||
|
import cn.iocoder.yudao.module.jx.payment.service.DriveSchoolPayService;
|
||||||
|
import cn.iocoder.yudao.module.jx.service.IDriveSchoolFeedbackService;
|
||||||
|
import cn.iocoder.yudao.module.jx.vo.DriveSchoolInfoVO;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反馈Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2024-04-27
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DriveSchoolFeedbackServiceImpl implements IDriveSchoolFeedbackService
|
||||||
|
{
|
||||||
|
@Resource
|
||||||
|
private DriveSchoolFeedbackMapper driveSchoolFeedbackMapper;
|
||||||
|
|
||||||
|
// @Resource
|
||||||
|
// private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdminUserApi userApi;
|
||||||
|
/**
|
||||||
|
* 查询反馈
|
||||||
|
*
|
||||||
|
* @param id 反馈主键
|
||||||
|
* @return 反馈
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DriveSchoolFeedback selectDriveSchoolFeedbackById(Long id)
|
||||||
|
{
|
||||||
|
return driveSchoolFeedbackMapper.selectDriveSchoolFeedbackById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DriveSchoolInfoMapper driveSchoolInfoMapper;
|
||||||
|
/**
|
||||||
|
* 查询反馈列表
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 反馈
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<DriveSchoolFeedback> selectDriveSchoolFeedbackList(DriveSchoolFeedback driveSchoolFeedback, Page<DriveSchoolFeedback> page)
|
||||||
|
{
|
||||||
|
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||||
|
//Long deptId = SecurityUtils.getDeptId();
|
||||||
|
if(deptId !=100L){
|
||||||
|
driveSchoolFeedback.setJxId(deptId);
|
||||||
|
}
|
||||||
|
return driveSchoolFeedbackMapper.selectDriveSchoolFeedbackList(driveSchoolFeedback,page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DriveSchoolFeedback> selectDriveSchoolFeedbackListAll(DriveSchoolFeedback driveSchoolFeedback)
|
||||||
|
{
|
||||||
|
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||||
|
//Long deptId = SecurityUtils.getDeptId();
|
||||||
|
if(deptId !=100L){
|
||||||
|
driveSchoolFeedback.setJxId(deptId);
|
||||||
|
}
|
||||||
|
return driveSchoolFeedbackMapper.selectDriveSchoolFeedbackListAll(driveSchoolFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Object,Object> like(DriveSchoolFeedback driveSchoolFeedback)
|
||||||
|
{
|
||||||
|
HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||||
|
//Long deptId = SecurityUtils.getDeptId();
|
||||||
|
if(deptId !=100L){
|
||||||
|
driveSchoolFeedback.setJxId(deptId);
|
||||||
|
}
|
||||||
|
objectObjectHashMap.put("likeOne",driveSchoolFeedbackMapper.likeOne(driveSchoolFeedback));
|
||||||
|
objectObjectHashMap.put("likeTwo",driveSchoolFeedbackMapper.likeTwo(driveSchoolFeedback));
|
||||||
|
objectObjectHashMap.put("likeThree",driveSchoolFeedbackMapper.likeThree(driveSchoolFeedback));
|
||||||
|
return objectObjectHashMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DriveSchoolPayService driveSchoolPayService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增反馈
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertDriveSchoolFeedback(DriveSchoolFeedback driveSchoolFeedback) throws Exception {
|
||||||
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
// Long userId = SecurityUtils.getUserId();
|
||||||
|
// SysUser sysUser = sysUserMapper.selectUserById(userId);
|
||||||
|
AdminUserRespDTO sysUser = userApi.getUser(userId);
|
||||||
|
if(ObjectUtils.isNotEmpty(sysUser)){
|
||||||
|
driveSchoolFeedback.setUserName(sysUser.getNickname());
|
||||||
|
}
|
||||||
|
DriveSchoolPay driveSchoolPay = driveSchoolPayService.selectByUserId(userId);
|
||||||
|
if (ObjectUtils.isEmpty(driveSchoolPay)){
|
||||||
|
throw new Exception("请先报名!");
|
||||||
|
}
|
||||||
|
driveSchoolFeedback.setUserId(userId);
|
||||||
|
driveSchoolFeedback.setJlId(driveSchoolPay.getJlId());
|
||||||
|
driveSchoolFeedback.setJlName(driveSchoolPay.getJlName());
|
||||||
|
DriveSchoolInfoVO schoolInfoByDeptId = driveSchoolInfoMapper.findInfoByJxId(driveSchoolPay.getJxId());
|
||||||
|
driveSchoolFeedback.setJxId(schoolInfoByDeptId.getDeptId());
|
||||||
|
|
||||||
|
DriveSchoolInfo driveSchoolInfo = driveSchoolInfoMapper.selectDriveSchoolInfoById(driveSchoolPay.getJxId());
|
||||||
|
driveSchoolFeedback.setJxName(driveSchoolInfo.getSchoolName());
|
||||||
|
|
||||||
|
return driveSchoolFeedbackMapper.insertDriveSchoolFeedback(driveSchoolFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改反馈
|
||||||
|
*
|
||||||
|
* @param driveSchoolFeedback 反馈
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateDriveSchoolFeedback(DriveSchoolFeedback driveSchoolFeedback)
|
||||||
|
{
|
||||||
|
//driveSchoolFeedback.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return driveSchoolFeedbackMapper.updateDriveSchoolFeedback(driveSchoolFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除反馈
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDriveSchoolFeedbackByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return driveSchoolFeedbackMapper.deleteDriveSchoolFeedbackByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除反馈信息
|
||||||
|
*
|
||||||
|
* @param id 反馈主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDriveSchoolFeedbackById(Long id)
|
||||||
|
{
|
||||||
|
return driveSchoolFeedbackMapper.deleteDriveSchoolFeedbackById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertData(String content) {
|
||||||
|
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
driveSchoolFeedbackMapper.insertData(loginUserId, content);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,147 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.jx.mapper.DriveSchoolFeedbackMapper">
|
||||||
|
|
||||||
|
<resultMap type="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" id="DriveSchoolFeedbackResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="userId" column="userId" />
|
||||||
|
<result property="content" column="content" />
|
||||||
|
<result property="jlContent" column="jlContent" />
|
||||||
|
<result property="jlId" column="jlId" />
|
||||||
|
<result property="jlName" column="jlName" />
|
||||||
|
<result property="jxId" column="jxId" />
|
||||||
|
<result property="jxName" column="jxName" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="creator" column="create_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="updater" column="update_by" />
|
||||||
|
<result property="evaluateType" column="evaluateType" />
|
||||||
|
<result property="userName" column="userName" />
|
||||||
|
<result property="likes" column="likes" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDriveSchoolFeedbackVo">
|
||||||
|
select * from drive_school_feedback
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDriveSchoolFeedbackList" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultMap="DriveSchoolFeedbackResult">
|
||||||
|
<include refid="selectDriveSchoolFeedbackVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="entity.userId != null "> and userId = #{entity.userId}</if>
|
||||||
|
<if test="entity.jxName != null and entity.jxName != ''"> and jxName like concat('%',#{entity.jxName},'%') </if>
|
||||||
|
<if test="entity.jlName != null and entity.jlName != ''"> and jlName like concat('%',#{entity.jlName},'%')</if>
|
||||||
|
<if test="entity.evaluateType != null "> and evaluateType = #{entity.evaluateType}</if>
|
||||||
|
</where>
|
||||||
|
order by create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDriveSchoolFeedbackListAll" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultMap="DriveSchoolFeedbackResult">
|
||||||
|
<include refid="selectDriveSchoolFeedbackVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="entity.userId != null "> and userId = #{entity.userId}</if>
|
||||||
|
<if test="entity.jxName != null and entity.jxName != ''"> and jxName like concat('%',#{entity.jxName},'%') </if>
|
||||||
|
<if test="entity.jlName != null and entity.jlName != ''"> and jlName like concat('%',#{entity.jlName},'%')</if>
|
||||||
|
<if test="entity.evaluateType != null "> and evaluateType = #{entity.evaluateType}</if>
|
||||||
|
</where>
|
||||||
|
order by create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="likeOne" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultType="Integer">
|
||||||
|
select count(1) total from drive_school_feedback
|
||||||
|
<where>
|
||||||
|
likes = '1'
|
||||||
|
<if test="jxId != null "> and jxId = #{jxId}</if>
|
||||||
|
</where>
|
||||||
|
order by create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="likeTwo" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultType="Integer">
|
||||||
|
select count(1) total from drive_school_feedback
|
||||||
|
<where>
|
||||||
|
likes = '2'
|
||||||
|
<if test="jxId != null "> and jxId = #{jxId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="likeThree" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultType="Integer">
|
||||||
|
<include refid="selectDriveSchoolFeedbackVo"/>
|
||||||
|
select count(1) total from drive_school_feedback
|
||||||
|
<where>
|
||||||
|
likes = '3'
|
||||||
|
<if test="jxId != null "> and jxId = #{jxId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDriveSchoolFeedbackById" parameterType="Long" resultMap="DriveSchoolFeedbackResult">
|
||||||
|
<include refid="selectDriveSchoolFeedbackVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDriveSchoolFeedback" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback">
|
||||||
|
insert into drive_school_feedback
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="userId != null">userId,</if>
|
||||||
|
<if test="content != null">content,</if>
|
||||||
|
<if test="jlContent != null">jlContent,</if>
|
||||||
|
<if test="jlId != null">jlId,</if>
|
||||||
|
<if test="jlName != null">jlName,</if>
|
||||||
|
<if test="jxId != null">jxId,</if>
|
||||||
|
<if test="jxName != null">jxName,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="evaluateType != null">evaluateType,</if>
|
||||||
|
<if test="userName != null">userName,</if>
|
||||||
|
<if test="likes!= null">likes,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="content != null">#{content},</if>
|
||||||
|
<if test="jlContent != null">#{jlContent},</if>
|
||||||
|
<if test="jlId != null">#{jlId},</if>
|
||||||
|
<if test="jlName != null">#{jlName},</if>
|
||||||
|
<if test="jxId != null">#{jxId},</if>
|
||||||
|
<if test="jxName != null">#{jxName},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="evaluateType != null">#{evaluateType},</if>
|
||||||
|
<if test="userName != null">#{userName},</if>
|
||||||
|
<if test="likes != null">#{likes},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<insert id="insertData">
|
||||||
|
insert into drive_school_feedback (userId, content, create_time) values (#{userId}, #{content}, now())
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDriveSchoolFeedback" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback">
|
||||||
|
update drive_school_feedback
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="userId != null">userId = #{userId},</if>
|
||||||
|
<if test="content != null">content = #{content},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="evaluateType != null">evaluateType = #{evaluateType},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDriveSchoolFeedbackById" parameterType="Long">
|
||||||
|
delete from drive_school_feedback where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDriveSchoolFeedbackByIds" parameterType="String">
|
||||||
|
delete from drive_school_feedback where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user