diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java index 32f5160f..4f72232e 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java @@ -98,14 +98,14 @@ public class AnnualCompGroupController extends JeecgController list = compService.list(queryWrappercomp); if(list.size()==0){ - return Result.error("未绑定比赛"); + return Result.OK(null); } List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); queryWrapperAnnual.in("compid",ids); List listAnnual = annualCompService.list(queryWrapperAnnual); if(listAnnual.size()==0){ - return Result.error("未创建年度比赛"); + return Result.OK(null); } List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompGroup, req.getParameterMap()); @@ -117,7 +117,7 @@ public class AnnualCompGroupController extends JeecgController listacp = annualCompPointService.list(queryWrapperacp); if(listacp.size()==0){ - return Result.error("未创建年度比赛项目"); + return Result.OK(null); } List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); queryWrapper.in(acpIds.size()!=0,"ann_comp_p",acpIds); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java index e6277add..594a4420 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java @@ -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> 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 queryWrapperuga = new QueryWrapper<>(); + List listuga = upfileGroupAssociationService.list(queryWrapperuga); + QueryWrapper 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 page = new Page<>(pageNo, pageSize); + IPage pageList = upfilePersionService.page(page, queryWrapper); + return Result.OK(pageList); + } + /** * 添加 * @@ -298,6 +340,27 @@ public class ChaoseTopicPersionController extends JeecgController 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("绑定成功!"); + } + /** * 添加 * diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java new file mode 100644 index 00000000..b282d1d3 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java @@ -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 { + @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> queryPageList(UpfileGroup upfileGroup, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(upfileGroup, req.getParameterMap()); + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + Comp comp = new Comp(); + QueryWrapper queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); + queryWrappercomp.eq("comp_admin",user.getUsername()); + List list = compService.list(queryWrappercomp); + if(list.size()==0){ + return Result.OK(null); + } + List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.in("compid",ids); + List listAnnual = annualCompService.list(queryWrapperAnnual); + if(listAnnual.size()==0){ + return Result.OK(null); + } + List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); + queryWrapper.in("annal_comp",annualIds); + + AnnualCompPoint annualCompPoint = new AnnualCompPoint(); + QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); + queryWrapperacp.in("annual_comp_id",annualIds); + queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 + List listacp = annualCompPointService.list(queryWrapperacp); + if(listacp.size()==0){ + return Result.OK(null); + } + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in("ann_com_p",acpIds); + Page page = new Page(pageNo, pageSize); + IPage pageList = upfileGroupService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param upfileGroup + * @return + */ + @AutoLog(value = "作品组-添加") + @ApiOperation(value="作品组-添加", notes="作品组-添加") + @PostMapping(value = "/add") + public Result 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 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 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 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 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); + } + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/entity/UpfileGroup.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/entity/UpfileGroup.java new file mode 100644 index 00000000..e20ee4df --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/entity/UpfileGroup.java @@ -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; +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/mapper/UpfileGroupMapper.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/mapper/UpfileGroupMapper.java new file mode 100644 index 00000000..510c1444 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/mapper/UpfileGroupMapper.java @@ -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 { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/mapper/xml/UpfileGroupMapper.xml b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/mapper/xml/UpfileGroupMapper.xml new file mode 100644 index 00000000..88f538d8 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/mapper/xml/UpfileGroupMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/service/IUpfileGroupService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/service/IUpfileGroupService.java new file mode 100644 index 00000000..4d47aa01 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/service/IUpfileGroupService.java @@ -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 { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/service/impl/UpfileGroupServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/service/impl/UpfileGroupServiceImpl.java new file mode 100644 index 00000000..f1b575fb --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/service/impl/UpfileGroupServiceImpl.java @@ -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 implements IUpfileGroupService { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/controller/UpfileGroupAssociationController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/controller/UpfileGroupAssociationController.java new file mode 100644 index 00000000..ec03b246 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/controller/UpfileGroupAssociationController.java @@ -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 { + @Autowired + private IUpfileGroupAssociationService upfileGroupAssociationService; + + /** + * 分页列表查询 + * + * @param upfileGroupAssociation + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "作品组与作品关联表-分页列表查询") + @ApiOperation(value="作品组与作品关联表-分页列表查询", notes="作品组与作品关联表-分页列表查询") + @GetMapping(value = "/list") + public Result> 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 queryWrapper = QueryGenerator.initQueryWrapper(upfileGroupAssociation, req.getParameterMap()); + queryWrapper.eq("upfile_group_id",zpzid); + Page page = new Page(pageNo, pageSize); + IPage pageList = upfileGroupAssociationService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param upfileGroupAssociation + * @return + */ + @AutoLog(value = "作品组与作品关联表-添加") + @ApiOperation(value="作品组与作品关联表-添加", notes="作品组与作品关联表-添加") + @PostMapping(value = "/add") + public Result 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 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 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 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 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); + } + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/entity/UpfileGroupAssociation.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/entity/UpfileGroupAssociation.java new file mode 100644 index 00000000..7fafbf88 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/entity/UpfileGroupAssociation.java @@ -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; +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/mapper/UpfileGroupAssociationMapper.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/mapper/UpfileGroupAssociationMapper.java new file mode 100644 index 00000000..5a7b494f --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/mapper/UpfileGroupAssociationMapper.java @@ -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 { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/mapper/xml/UpfileGroupAssociationMapper.xml b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/mapper/xml/UpfileGroupAssociationMapper.xml new file mode 100644 index 00000000..d74e1bbb --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/mapper/xml/UpfileGroupAssociationMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/service/IUpfileGroupAssociationService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/service/IUpfileGroupAssociationService.java new file mode 100644 index 00000000..ff94e52b --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/service/IUpfileGroupAssociationService.java @@ -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 { + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/service/impl/UpfileGroupAssociationServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/service/impl/UpfileGroupAssociationServiceImpl.java new file mode 100644 index 00000000..3ebd569a --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroupassociation/service/impl/UpfileGroupAssociationServiceImpl.java @@ -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 implements IUpfileGroupAssociationService { + +}