配置一周视频信息
This commit is contained in:
parent
74f9fce37e
commit
10889f8b6e
@ -0,0 +1,122 @@
|
|||||||
|
package com.zhgd.xmgl.modules.xz.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.EducationConfigWeekVideo;
|
||||||
|
import com.zhgd.xmgl.modules.xz.service.IEducationConfigWeekVideoService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
|
import org.simpleframework.xml.core.Validate;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title: Controller
|
||||||
|
* @Description: 安全教育-配置一周视频
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2024-06-13
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/xmgl/educationConfigWeekVideo")
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "安全教育-配置一周视频相关Api")
|
||||||
|
public class EducationConfigWeekVideoController {
|
||||||
|
@Autowired
|
||||||
|
private IEducationConfigWeekVideoService educationConfigWeekVideoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "分页列表查询安全教育-配置一周视频信息", notes = "分页列表查询安全教育-配置一周视频信息", httpMethod = "GET")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||||
|
})
|
||||||
|
@GetMapping(value = "/page")
|
||||||
|
public Result<IPage<EducationConfigWeekVideo>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||||
|
return Result.success(educationConfigWeekVideoService.queryPageList(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "列表查询安全教育-配置一周视频信息", notes = "列表查询安全教育-配置一周视频信息", httpMethod = "GET")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<List<EducationConfigWeekVideo>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> param) {
|
||||||
|
return Result.success(educationConfigWeekVideoService.queryList(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param educationConfigWeekVideo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "添加安全教育-配置一周视频信息", notes = "添加安全教育-配置一周视频信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<EducationConfigWeekVideo> add(@RequestBody @Validate EducationConfigWeekVideo educationConfigWeekVideo) {
|
||||||
|
educationConfigWeekVideoService.add(educationConfigWeekVideo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param educationConfigWeekVideo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "编辑安全教育-配置一周视频信息", notes = "编辑安全教育-配置一周视频信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<EducationConfigWeekVideo> edit(@RequestBody EducationConfigWeekVideo educationConfigWeekVideo) {
|
||||||
|
educationConfigWeekVideoService.edit(educationConfigWeekVideo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "保存安全教育-配置一周视频信息", notes = "保存安全教育-配置一周视频信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/save")
|
||||||
|
public Result save(@RequestBody @Validate EducationConfigWeekVideo educationConfigWeekVideo) {
|
||||||
|
educationConfigWeekVideoService.saveObj(educationConfigWeekVideo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除安全教育-配置一周视频信息", notes = "删除安全教育-配置一周视频信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParam(name = "id", value = "安全教育-配置一周视频ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||||
|
@PostMapping(value = "/delete")
|
||||||
|
public Result<EducationConfigWeekVideo> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||||
|
educationConfigWeekVideoService.delete(MapUtils.getString(map, "id"));
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "通过id查询安全教育-配置一周视频信息", notes = "通过id查询安全教育-配置一周视频信息", httpMethod = "GET")
|
||||||
|
@ApiImplicitParam(name = "id", value = "安全教育-配置一周视频ID", paramType = "query", required = true, dataType = "Integer")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<EducationConfigWeekVideo> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
return Result.success(educationConfigWeekVideoService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
package com.zhgd.xmgl.modules.xz.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 安全教育-配置一周视频
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2024-06-13
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("education_config_week_video")
|
||||||
|
@ApiModel(value = "EducationConfigWeekVideo实体类", description = "EducationConfigWeekVideo")
|
||||||
|
public class EducationConfigWeekVideo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private java.lang.Long id;
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
@Excel(name = "项目编号", width = 15)
|
||||||
|
@ApiModelProperty(value = "项目编号")
|
||||||
|
private java.lang.String projectSn;
|
||||||
|
/**
|
||||||
|
* 周一配置视频
|
||||||
|
*/
|
||||||
|
@Excel(name = "周一配置视频", width = 15)
|
||||||
|
@ApiModelProperty(value = "周一配置视频")
|
||||||
|
private java.lang.Object mon;
|
||||||
|
/**
|
||||||
|
* 周二配置视频
|
||||||
|
*/
|
||||||
|
@Excel(name = "周二配置视频", width = 15)
|
||||||
|
@ApiModelProperty(value = "周二配置视频")
|
||||||
|
private java.lang.Object tues;
|
||||||
|
/**
|
||||||
|
* 周三配置视频
|
||||||
|
*/
|
||||||
|
@Excel(name = "周三配置视频", width = 15)
|
||||||
|
@ApiModelProperty(value = "周三配置视频")
|
||||||
|
private java.lang.Object wed;
|
||||||
|
/**
|
||||||
|
* 周四配置视频
|
||||||
|
*/
|
||||||
|
@Excel(name = "周四配置视频", width = 15)
|
||||||
|
@ApiModelProperty(value = "周四配置视频")
|
||||||
|
private java.lang.Object thur;
|
||||||
|
/**
|
||||||
|
* 周五配置视频
|
||||||
|
*/
|
||||||
|
@Excel(name = "周五配置视频", width = 15)
|
||||||
|
@ApiModelProperty(value = "周五配置视频")
|
||||||
|
private java.lang.Object fri;
|
||||||
|
/**
|
||||||
|
* 周六配置视频
|
||||||
|
*/
|
||||||
|
@Excel(name = "周六配置视频", width = 15)
|
||||||
|
@ApiModelProperty(value = "周六配置视频")
|
||||||
|
private java.lang.Object sat;
|
||||||
|
/**
|
||||||
|
* 周日配置视频
|
||||||
|
*/
|
||||||
|
@Excel(name = "周日配置视频", width = 15)
|
||||||
|
@ApiModelProperty(value = "周日配置视频")
|
||||||
|
private java.lang.Object sun;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private java.util.Date createDate;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private java.util.Date updateDate;
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.zhgd.xmgl.modules.xz.mapper;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.EducationConfigWeekVideo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 安全教育-配置一周视频
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2024-06-13
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface EducationConfigWeekVideoMapper extends BaseMapper<EducationConfigWeekVideo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<?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="com.zhgd.xmgl.modules.xz.mapper.EducationConfigWeekVideoMapper">
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.zhgd.xmgl.modules.xz.service;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.EducationConfigWeekVideo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 安全教育-配置一周视频
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2024-06-13
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IEducationConfigWeekVideoService extends IService<EducationConfigWeekVideo> {
|
||||||
|
|
||||||
|
IPage<EducationConfigWeekVideo> queryPageList(HashMap<String, Object> param);
|
||||||
|
|
||||||
|
List<EducationConfigWeekVideo> queryList(HashMap<String, Object> param);
|
||||||
|
|
||||||
|
void add(EducationConfigWeekVideo educationConfigWeekVideo);
|
||||||
|
|
||||||
|
void edit(EducationConfigWeekVideo educationConfigWeekVideo);
|
||||||
|
|
||||||
|
void delete(String id);
|
||||||
|
|
||||||
|
EducationConfigWeekVideo queryById(String id);
|
||||||
|
|
||||||
|
void saveObj(EducationConfigWeekVideo educationConfigWeekVideo);
|
||||||
|
}
|
||||||
@ -0,0 +1,104 @@
|
|||||||
|
package com.zhgd.xmgl.modules.xz.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.EducationConfigWeekVideo;
|
||||||
|
import com.zhgd.xmgl.modules.xz.mapper.EducationConfigWeekVideoMapper;
|
||||||
|
import com.zhgd.xmgl.modules.xz.service.IEducationConfigWeekVideoService;
|
||||||
|
import com.zhgd.xmgl.util.PageUtil;
|
||||||
|
import com.zhgd.xmgl.util.RefUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 安全教育-配置一周视频
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2024-06-13
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class EducationConfigWeekVideoServiceImpl extends ServiceImpl<EducationConfigWeekVideoMapper, EducationConfigWeekVideo> implements IEducationConfigWeekVideoService {
|
||||||
|
@Autowired
|
||||||
|
private EducationConfigWeekVideoMapper educationConfigWeekVideoMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<EducationConfigWeekVideo> queryPageList(HashMap<String, Object> param) {
|
||||||
|
QueryWrapper<EducationConfigWeekVideo> queryWrapper = getQueryWrapper(param);
|
||||||
|
Page<EducationConfigWeekVideo> page = PageUtil.getPage(param);
|
||||||
|
IPage<EducationConfigWeekVideo> pageList = this.page(page, queryWrapper);
|
||||||
|
pageList.setRecords(dealList(pageList.getRecords()));
|
||||||
|
return pageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EducationConfigWeekVideo> queryList(HashMap<String, Object> param) {
|
||||||
|
QueryWrapper<EducationConfigWeekVideo> queryWrapper = getQueryWrapper(param);
|
||||||
|
return dealList(this.list(queryWrapper));
|
||||||
|
}
|
||||||
|
|
||||||
|
private QueryWrapper<EducationConfigWeekVideo> getQueryWrapper(HashMap<String, Object> param) {
|
||||||
|
String alias = "";
|
||||||
|
QueryWrapper<EducationConfigWeekVideo> queryWrapper = QueryGenerator.initPageQueryWrapper(EducationConfigWeekVideo.class, param, alias);
|
||||||
|
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(EducationConfigWeekVideo::getId));
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<EducationConfigWeekVideo> dealList(List<EducationConfigWeekVideo> list) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(EducationConfigWeekVideo educationConfigWeekVideo) {
|
||||||
|
educationConfigWeekVideo.setId(null);
|
||||||
|
baseMapper.insert(educationConfigWeekVideo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void edit(EducationConfigWeekVideo educationConfigWeekVideo) {
|
||||||
|
EducationConfigWeekVideo oldEducationConfigWeekVideo = baseMapper.selectById(educationConfigWeekVideo.getId());
|
||||||
|
if (oldEducationConfigWeekVideo == null) {
|
||||||
|
throw new OpenAlertException("未找到对应实体");
|
||||||
|
}
|
||||||
|
baseMapper.updateById(educationConfigWeekVideo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(String id) {
|
||||||
|
EducationConfigWeekVideo educationConfigWeekVideo = baseMapper.selectById(id);
|
||||||
|
if (educationConfigWeekVideo == null) {
|
||||||
|
throw new OpenAlertException("未找到对应实体");
|
||||||
|
}
|
||||||
|
baseMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EducationConfigWeekVideo queryById(String id) {
|
||||||
|
EducationConfigWeekVideo entity = getById(id);
|
||||||
|
if (entity == null) {
|
||||||
|
throw new OpenAlertException("未找到对应实体");
|
||||||
|
}
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveObj(EducationConfigWeekVideo educationConfigWeekVideo) {
|
||||||
|
EducationConfigWeekVideo v = educationConfigWeekVideoMapper.selectOne(new LambdaQueryWrapper<EducationConfigWeekVideo>()
|
||||||
|
.eq(EducationConfigWeekVideo::getProjectSn, educationConfigWeekVideo.getProjectSn()));
|
||||||
|
if (v != null) {
|
||||||
|
edit(educationConfigWeekVideo);
|
||||||
|
} else {
|
||||||
|
add(educationConfigWeekVideo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user