作品分组后台

main
Gitea 4 months ago
parent 96da22b750
commit 5596d57ce2
  1. 6
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java
  2. 63
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java
  3. 219
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java
  4. 77
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/entity/UpfileGroup.java
  5. 17
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/mapper/UpfileGroupMapper.java
  6. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/mapper/xml/UpfileGroupMapper.xml
  7. 14
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/service/IUpfileGroupService.java
  8. 19
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/service/impl/UpfileGroupServiceImpl.java
  9. 173
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/controller/UpfileGroupAssociationController.java
  10. 68
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/entity/UpfileGroupAssociation.java
  11. 17
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/mapper/UpfileGroupAssociationMapper.java
  12. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/mapper/xml/UpfileGroupAssociationMapper.xml
  13. 14
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/service/IUpfileGroupAssociationService.java
  14. 19
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/service/impl/UpfileGroupAssociationServiceImpl.java

@ -98,14 +98,14 @@ public class AnnualCompGroupController extends JeecgController<AnnualCompGroup,
queryWrappercomp.eq("comp_admin",user.getUsername());
List<Comp> list = compService.list(queryWrappercomp);
if(list.size()==0){
return Result.error("未绑定比赛");
return Result.OK(null);
}
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in("compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
if(listAnnual.size()==0){
return Result.error("未创建年度比赛");
return Result.OK(null);
}
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
QueryWrapper<AnnualCompGroup> queryWrapper = QueryGenerator.initQueryWrapper(annualCompGroup, req.getParameterMap());
@ -117,7 +117,7 @@ public class AnnualCompGroupController extends JeecgController<AnnualCompGroup,
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
if(listacp.size()==0){
return Result.error("未创建年度比赛项目");
return Result.OK(null);
}
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in(acpIds.size()!=0,"ann_comp_p",acpIds);

@ -44,6 +44,10 @@ import org.jeecg.modules.demo.topic.entity.Topic;
import org.jeecg.modules.demo.topic.service.ITopicService;
import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion;
import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService;
import org.jeecg.modules.demo.upfilegroup.entity.UpfileGroup;
import org.jeecg.modules.demo.upfilegroup.service.IUpfileGroupService;
import org.jeecg.modules.demo.upfilegroupassociation.entity.UpfileGroupAssociation;
import org.jeecg.modules.demo.upfilegroupassociation.service.IUpfileGroupAssociationService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -92,6 +96,10 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
private IAnnualCompService annualCompService;
@Autowired
private ICompService compService;
@Autowired
private IUpfileGroupService upfileGroupService;
@Autowired
private IUpfileGroupAssociationService upfileGroupAssociationService;
/**
* 分页列表查询
@ -250,6 +258,40 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
}
/**
* 作品组绑定作品
*
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "比赛选题-分页列表查询")
@ApiOperation(value = "作品组绑定作品-分页列表查询", notes = "作品组绑定作品-分页列表查询")
@GetMapping(value = "/zpzbdzp")
public Result<IPage<UpfilePersion>> zpzbdzp(UpfilePersion upfilePersion,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req,@RequestParam(name="zpzid",required=true) String zpzid) {
UpfileGroup upfileGroup = upfileGroupService.getById(zpzid);
QueryWrapper<UpfileGroupAssociation> queryWrapperuga = new QueryWrapper<>();
List<UpfileGroupAssociation> listuga = upfileGroupAssociationService.list(queryWrapperuga);
QueryWrapper<UpfilePersion> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("annual_id",upfileGroup.getAnnid());
queryWrapper.eq("annual_comp_id",upfileGroup.getAnnalComp());
queryWrapper.eq("annual_comp_point_id",upfileGroup.getAnnComP());
String str = "";
for(int i = 0 ; i<listuga.size();i++){
str = str+listuga.get(i).getUpfileId()+",";
}
if(str!=""){
queryWrapper.notIn("id",str.split(","));
}
Page<UpfilePersion> page = new Page<>(pageNo, pageSize);
IPage<UpfilePersion> pageList = upfilePersionService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
@ -298,6 +340,27 @@ public class ChaoseTopicPersionController extends JeecgController<ChaoseTopicPer
return Result.OK("绑定成功!");
}
/**
* 作品组绑定作品添加
*
* @param
* @return
*/
@AutoLog(value = "作品组绑定作品-添加")
@ApiOperation(value = "作品组绑定作品-添加", notes = "作品组绑定作品-添加")
// @RequiresPermissions("chooseTopicPersion:chaose_topic_persion:add")
@GetMapping(value = "/zpzbdzpadd")
public Result<String> zpzbdzpadd(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="zpzid",required=true) String zpzid,HttpServletRequest req) {
String strs[] = ids.split(",");
for (int i = 0 ; i < strs.length ; i++){
UpfileGroupAssociation upfileGroupAssociation = new UpfileGroupAssociation();
upfileGroupAssociation.setUpfileGroupId(zpzid);
upfileGroupAssociation.setUpfileId(strs[i]);
upfileGroupAssociationService.save(upfileGroupAssociation);
}
return Result.OK("绑定成功!");
}
/**
* 添加
*

@ -0,0 +1,219 @@
package org.jeecg.modules.demo.upfilegroup.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService;
import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup;
import org.jeecg.modules.demo.comp.entity.Comp;
import org.jeecg.modules.demo.comp.service.ICompService;
import org.jeecg.modules.demo.upfilegroup.entity.UpfileGroup;
import org.jeecg.modules.demo.upfilegroup.service.IUpfileGroupService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 作品组
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
@Api(tags="作品组")
@RestController
@RequestMapping("/upfilegroup/upfileGroup")
@Slf4j
public class UpfileGroupController extends JeecgController<UpfileGroup, IUpfileGroupService> {
@Autowired
private IUpfileGroupService upfileGroupService;
@Autowired
private ICompService compService;
@Autowired
private IAnnualCompService annualCompService;
@Autowired
private IAnnualCompPointService annualCompPointService;
/**
* 分页列表查询
*
* @param upfileGroup
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "作品组-分页列表查询")
@ApiOperation(value="作品组-分页列表查询", notes="作品组-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<UpfileGroup>> queryPageList(UpfileGroup upfileGroup,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<UpfileGroup> queryWrapper = QueryGenerator.initQueryWrapper(upfileGroup, req.getParameterMap());
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
Comp comp = new Comp();
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap());
queryWrappercomp.eq("comp_admin",user.getUsername());
List<Comp> list = compService.list(queryWrappercomp);
if(list.size()==0){
return Result.OK(null);
}
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in("compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
if(listAnnual.size()==0){
return Result.OK(null);
}
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
queryWrapper.in("annal_comp",annualIds);
AnnualCompPoint annualCompPoint = new AnnualCompPoint();
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap());
queryWrapperacp.in("annual_comp_id",annualIds);
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
if(listacp.size()==0){
return Result.OK(null);
}
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in("ann_com_p",acpIds);
Page<UpfileGroup> page = new Page<UpfileGroup>(pageNo, pageSize);
IPage<UpfileGroup> pageList = upfileGroupService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param upfileGroup
* @return
*/
@AutoLog(value = "作品组-添加")
@ApiOperation(value="作品组-添加", notes="作品组-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody UpfileGroup upfileGroup) {
upfileGroupService.save(upfileGroup);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param upfileGroup
* @return
*/
@AutoLog(value = "作品组-编辑")
@ApiOperation(value="作品组-编辑", notes="作品组-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody UpfileGroup upfileGroup) {
upfileGroupService.updateById(upfileGroup);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "作品组-通过id删除")
@ApiOperation(value="作品组-通过id删除", notes="作品组-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
upfileGroupService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "作品组-批量删除")
@ApiOperation(value="作品组-批量删除", notes="作品组-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.upfileGroupService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "作品组-通过id查询")
@ApiOperation(value="作品组-通过id查询", notes="作品组-通过id查询")
@GetMapping(value = "/queryById")
public Result<UpfileGroup> queryById(@RequestParam(name="id",required=true) String id) {
UpfileGroup upfileGroup = upfileGroupService.getById(id);
if(upfileGroup==null) {
return Result.error("未找到对应数据");
}
return Result.OK(upfileGroup);
}
/**
* 导出excel
*
* @param request
* @param upfileGroup
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, UpfileGroup upfileGroup) {
return super.exportXls(request, upfileGroup, UpfileGroup.class, "作品组");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, UpfileGroup.class);
}
}

@ -0,0 +1,77 @@
package org.jeecg.modules.demo.upfilegroup.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 作品组
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
@Data
@TableName("upfile_group")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="upfile_group对象", description="作品组")
public class UpfileGroup implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@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 createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@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 updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**年度*/
@Excel(name = "年度", width = 15)
@Dict(dictTable = "annual", dicText = "annual_name", dicCode = "id")
@ApiModelProperty(value = "年度")
private java.lang.String annid;
/**年度比赛*/
@Excel(name = "年度比赛", width = 15)
@Dict(dictTable = "annual_comp", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "年度比赛")
private java.lang.String annalComp;
/**年度比赛项目*/
@Excel(name = "年度比赛项目", width = 15)
@Dict(dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id")
@ApiModelProperty(value = "年度比赛项目")
private java.lang.String annComP;
/**作品组名称*/
@Excel(name = "作品组名称", width = 15)
@ApiModelProperty(value = "作品组名称")
private java.lang.String name;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.upfilegroup.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.upfilegroup.entity.UpfileGroup;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 作品组
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
public interface UpfileGroupMapper extends BaseMapper<UpfileGroup> {
}

@ -0,0 +1,5 @@
<?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="org.jeecg.modules.demo.upfilegroup.mapper.UpfileGroupMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.upfilegroup.service;
import org.jeecg.modules.demo.upfilegroup.entity.UpfileGroup;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 作品组
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
public interface IUpfileGroupService extends IService<UpfileGroup> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.upfilegroup.service.impl;
import org.jeecg.modules.demo.upfilegroup.entity.UpfileGroup;
import org.jeecg.modules.demo.upfilegroup.mapper.UpfileGroupMapper;
import org.jeecg.modules.demo.upfilegroup.service.IUpfileGroupService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 作品组
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
@Service
public class UpfileGroupServiceImpl extends ServiceImpl<UpfileGroupMapper, UpfileGroup> implements IUpfileGroupService {
}

@ -0,0 +1,173 @@
package org.jeecg.modules.demo.upfilegroupassociation.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.upfilegroupassociation.entity.UpfileGroupAssociation;
import org.jeecg.modules.demo.upfilegroupassociation.service.IUpfileGroupAssociationService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 作品组与作品关联表
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
@Api(tags="作品组与作品关联表")
@RestController
@RequestMapping("/upfilegroupassociation/upfileGroupAssociation")
@Slf4j
public class UpfileGroupAssociationController extends JeecgController<UpfileGroupAssociation, IUpfileGroupAssociationService> {
@Autowired
private IUpfileGroupAssociationService upfileGroupAssociationService;
/**
* 分页列表查询
*
* @param upfileGroupAssociation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "作品组与作品关联表-分页列表查询")
@ApiOperation(value="作品组与作品关联表-分页列表查询", notes="作品组与作品关联表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<UpfileGroupAssociation>> queryPageList(UpfileGroupAssociation upfileGroupAssociation,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req,@RequestParam(name="zpzid",required=true) String zpzid) {
QueryWrapper<UpfileGroupAssociation> queryWrapper = QueryGenerator.initQueryWrapper(upfileGroupAssociation, req.getParameterMap());
queryWrapper.eq("upfile_group_id",zpzid);
Page<UpfileGroupAssociation> page = new Page<UpfileGroupAssociation>(pageNo, pageSize);
IPage<UpfileGroupAssociation> pageList = upfileGroupAssociationService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param upfileGroupAssociation
* @return
*/
@AutoLog(value = "作品组与作品关联表-添加")
@ApiOperation(value="作品组与作品关联表-添加", notes="作品组与作品关联表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody UpfileGroupAssociation upfileGroupAssociation) {
upfileGroupAssociationService.save(upfileGroupAssociation);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param upfileGroupAssociation
* @return
*/
@AutoLog(value = "作品组与作品关联表-编辑")
@ApiOperation(value="作品组与作品关联表-编辑", notes="作品组与作品关联表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody UpfileGroupAssociation upfileGroupAssociation) {
upfileGroupAssociationService.updateById(upfileGroupAssociation);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "作品组与作品关联表-通过id删除")
@ApiOperation(value="作品组与作品关联表-通过id删除", notes="作品组与作品关联表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
upfileGroupAssociationService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "作品组与作品关联表-批量删除")
@ApiOperation(value="作品组与作品关联表-批量删除", notes="作品组与作品关联表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.upfileGroupAssociationService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "作品组与作品关联表-通过id查询")
@ApiOperation(value="作品组与作品关联表-通过id查询", notes="作品组与作品关联表-通过id查询")
@GetMapping(value = "/queryById")
public Result<UpfileGroupAssociation> queryById(@RequestParam(name="id",required=true) String id) {
UpfileGroupAssociation upfileGroupAssociation = upfileGroupAssociationService.getById(id);
if(upfileGroupAssociation==null) {
return Result.error("未找到对应数据");
}
return Result.OK(upfileGroupAssociation);
}
/**
* 导出excel
*
* @param request
* @param upfileGroupAssociation
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, UpfileGroupAssociation upfileGroupAssociation) {
return super.exportXls(request, upfileGroupAssociation, UpfileGroupAssociation.class, "作品组与作品关联表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, UpfileGroupAssociation.class);
}
}

@ -0,0 +1,68 @@
package org.jeecg.modules.demo.upfilegroupassociation.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 作品组与作品关联表
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
@Data
@TableName("upfile_group_association")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="upfile_group_association对象", description="作品组与作品关联表")
public class UpfileGroupAssociation implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@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 createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@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 updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**作品组*/
@Excel(name = "作品组", width = 15)
@Dict(dictTable = "upfile_group", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "作品组")
private java.lang.String upfileGroupId;
/**作品*/
@Excel(name = "作品", width = 15)
@Dict(dictTable = "upfile_persion", dicText = "topic_name", dicCode = "id")
@ApiModelProperty(value = "作品")
private java.lang.String upfileId;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.upfilegroupassociation.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.upfilegroupassociation.entity.UpfileGroupAssociation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 作品组与作品关联表
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
public interface UpfileGroupAssociationMapper extends BaseMapper<UpfileGroupAssociation> {
}

@ -0,0 +1,5 @@
<?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="org.jeecg.modules.demo.upfilegroupassociation.mapper.UpfileGroupAssociationMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.upfilegroupassociation.service;
import org.jeecg.modules.demo.upfilegroupassociation.entity.UpfileGroupAssociation;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 作品组与作品关联表
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
public interface IUpfileGroupAssociationService extends IService<UpfileGroupAssociation> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.upfilegroupassociation.service.impl;
import org.jeecg.modules.demo.upfilegroupassociation.entity.UpfileGroupAssociation;
import org.jeecg.modules.demo.upfilegroupassociation.mapper.UpfileGroupAssociationMapper;
import org.jeecg.modules.demo.upfilegroupassociation.service.IUpfileGroupAssociationService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 作品组与作品关联表
* @Author: jeecg-boot
* @Date: 2024-08-06
* @Version: V1.0
*/
@Service
public class UpfileGroupAssociationServiceImpl extends ServiceImpl<UpfileGroupAssociationMapper, UpfileGroupAssociation> implements IUpfileGroupAssociationService {
}
Loading…
Cancel
Save