专家分组以及绑定成员

main
Gitea 1 year ago
parent 51e0db66db
commit bb06b8d220
  1. 217
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java
  2. 77
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/entity/AnnualCompGroup.java
  3. 17
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/mapper/AnnualCompGroupMapper.java
  4. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/mapper/xml/AnnualCompGroupMapper.xml
  5. 14
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/service/IAnnualCompGroupService.java
  6. 19
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/service/impl/AnnualCompGroupServiceImpl.java
  7. 65
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java
  8. 208
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expgroup/controller/ExpGroupController.java
  9. 72
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expgroup/entity/ExpGroup.java
  10. 17
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expgroup/mapper/ExpGroupMapper.java
  11. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expgroup/mapper/xml/ExpGroupMapper.xml
  12. 14
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expgroup/service/IExpGroupService.java
  13. 19
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expgroup/service/impl/ExpGroupServiceImpl.java

@ -0,0 +1,217 @@
package org.jeecg.modules.demo.annualcompgroup.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.annualcompgroup.entity.AnnualCompGroup;
import org.jeecg.modules.demo.annualcompgroup.service.IAnnualCompGroupService;
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.jeecg.modules.demo.comp.entity.Comp;
import org.jeecg.modules.demo.comp.service.ICompService;
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: 2023-10-13
* @Version: V1.0
*/
@Api(tags="年度比赛项目专家小组")
@RestController
@RequestMapping("/annualcompgroup/annualCompGroup")
@Slf4j
public class AnnualCompGroupController extends JeecgController<AnnualCompGroup, IAnnualCompGroupService> {
@Autowired
private IAnnualCompGroupService annualCompGroupService;
@Autowired
private ICompService compService;
/**
* 分页列表查询
*
* @param annualCompGroup
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "年度比赛项目专家小组-分页列表查询")
@ApiOperation(value="年度比赛项目专家小组-分页列表查询", notes="年度比赛项目专家小组-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AnnualCompGroup>> queryPageList(AnnualCompGroup annualCompGroup,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AnnualCompGroup> queryWrapper = QueryGenerator.initQueryWrapper(annualCompGroup, req.getParameterMap());
Page<AnnualCompGroup> page = new Page<AnnualCompGroup>(pageNo, pageSize);
IPage<AnnualCompGroup> pageList = annualCompGroupService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param annualCompGroup
* @return
*/
@AutoLog(value = "年度比赛项目专家小组-添加")
@ApiOperation(value="年度比赛项目专家小组-添加", notes="年度比赛项目专家小组-添加")
//@RequiresPermissions("annualcompgroup:annual_comp_group:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AnnualCompGroup annualCompGroup) {
annualCompGroupService.save(annualCompGroup);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param annualCompGroup
* @return
*/
@AutoLog(value = "年度比赛项目专家小组-编辑")
@ApiOperation(value="年度比赛项目专家小组-编辑", notes="年度比赛项目专家小组-编辑")
//@RequiresPermissions("annualcompgroup:annual_comp_group:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AnnualCompGroup annualCompGroup) {
annualCompGroupService.updateById(annualCompGroup);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "年度比赛项目专家小组-通过id删除")
@ApiOperation(value="年度比赛项目专家小组-通过id删除", notes="年度比赛项目专家小组-通过id删除")
//@RequiresPermissions("annualcompgroup:annual_comp_group:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
annualCompGroupService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "年度比赛项目专家小组-批量删除")
@ApiOperation(value="年度比赛项目专家小组-批量删除", notes="年度比赛项目专家小组-批量删除")
//@RequiresPermissions("annualcompgroup:annual_comp_group:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.annualCompGroupService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 获取当前登录用户对应的比赛id
*
* @return
*/
@ApiOperation(value="获取当前登录用户对应的比赛id", notes="获取当前登录用户对应的比赛id")
@GetMapping(value = "/queryCompId")
public Result<String> queryCompId(HttpServletRequest req) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
Comp comp = new Comp();
QueryWrapper<Comp> queryWrapper = QueryGenerator.initQueryWrapper(comp, req.getParameterMap());
queryWrapper.like("comp_admin",user.getId());
List<Comp> list = compService.list(queryWrapper);
String str = "";
for(int i = 0 ; i < list.size() ; i++){
if(list.size()==1){
str = "compid='"+list.get(i).getId()+"'";
}else{
if(i==list.size()-1){
str = str + "compid='"+list.get(i).getId()+"'";
}else {
str = "compid='"+list.get(i).getId()+"' or "+str;
}
}
}
return Result.OK(str);
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "年度比赛项目专家小组-通过id查询")
@ApiOperation(value="年度比赛项目专家小组-通过id查询", notes="年度比赛项目专家小组-通过id查询")
@GetMapping(value = "/queryById")
public Result<AnnualCompGroup> queryById(@RequestParam(name="id",required=true) String id) {
AnnualCompGroup annualCompGroup = annualCompGroupService.getById(id);
if(annualCompGroup==null) {
return Result.error("未找到对应数据");
}
return Result.OK(annualCompGroup);
}
/**
* 导出excel
*
* @param request
* @param annualCompGroup
*/
//@RequiresPermissions("annualcompgroup:annual_comp_group:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AnnualCompGroup annualCompGroup) {
return super.exportXls(request, annualCompGroup, AnnualCompGroup.class, "年度比赛项目专家小组");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("annualcompgroup:annual_comp_group:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AnnualCompGroup.class);
}
}

@ -0,0 +1,77 @@
package org.jeecg.modules.demo.annualcompgroup.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: 2023-10-13
* @Version: V1.0
*/
@Data
@TableName("annual_comp_group")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="annual_comp_group对象", description="年度比赛项目专家小组")
public class AnnualCompGroup 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, dictTable = "annual", dicText = "annual_name", dicCode = "id")
@Dict(dictTable = "annual", dicText = "annual_name", dicCode = "id")
@ApiModelProperty(value = "年度")
private java.lang.String annal;
/**年度比赛项目*/
@Excel(name = "年度比赛项目", width = 15, dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id")
@Dict(dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id")
@ApiModelProperty(value = "年度比赛项目")
private java.lang.String annCompP;
/**小组名称*/
@Excel(name = "小组名称", width = 15)
@ApiModelProperty(value = "小组名称")
private java.lang.String name;
/**年度比赛*/
@Excel(name = "年度比赛", width = 15, dictTable = "annual_comp", dicText = "name", dicCode = "id")
@Dict(dictTable = "annual_comp", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "年度比赛")
private java.lang.String annalComp;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.annualcompgroup.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 年度比赛项目专家小组
* @Author: jeecg-boot
* @Date: 2023-10-13
* @Version: V1.0
*/
public interface AnnualCompGroupMapper extends BaseMapper<AnnualCompGroup> {
}

@ -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.annualcompgroup.mapper.AnnualCompGroupMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.annualcompgroup.service;
import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 年度比赛项目专家小组
* @Author: jeecg-boot
* @Date: 2023-10-13
* @Version: V1.0
*/
public interface IAnnualCompGroupService extends IService<AnnualCompGroup> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.annualcompgroup.service.impl;
import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup;
import org.jeecg.modules.demo.annualcompgroup.mapper.AnnualCompGroupMapper;
import org.jeecg.modules.demo.annualcompgroup.service.IAnnualCompGroupService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 年度比赛项目专家小组
* @Author: jeecg-boot
* @Date: 2023-10-13
* @Version: V1.0
*/
@Service
public class AnnualCompGroupServiceImpl extends ServiceImpl<AnnualCompGroupMapper, AnnualCompGroup> implements IAnnualCompGroupService {
}

@ -18,6 +18,9 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.PasswordUtil; import org.jeecg.common.util.PasswordUtil;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService;
import org.jeecg.modules.demo.annualcompgroup.service.IAnnualCompGroupService;
import org.jeecg.modules.demo.compexp.entity.CompExp; import org.jeecg.modules.demo.compexp.entity.CompExp;
import org.jeecg.modules.demo.compexp.service.ICompExpService; import org.jeecg.modules.demo.compexp.service.ICompExpService;
import org.jeecg.modules.demo.expert.entity.Expert; import org.jeecg.modules.demo.expert.entity.Expert;
@ -28,6 +31,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.expgroup.entity.ExpGroup;
import org.jeecg.modules.demo.expgroup.service.IExpGroupService;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.system.service.ISysUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
@ -70,6 +75,19 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
@Autowired @Autowired
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired
private IAnnualCompService annualCompService;
@Autowired
private IAnnualCompGroupService annualCompGroupService;
@Autowired
private IExpGroupService expGroupService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -85,8 +103,26 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
public Result<IPage<Expert>> queryPageList(Expert expert, public Result<IPage<Expert>> queryPageList(Expert expert,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req,@RequestParam(name="ndbsxzid",required=true) String ndbsxzid) {
AnnualComp annualComp = annualCompService.getById(annualCompGroupService.getById(ndbsxzid).getAnnalComp());
CompExp compExp = new CompExp();
QueryWrapper<CompExp> queryWrapperce = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap());
queryWrapperce.eq("compid",annualComp.getCompid());
queryWrapperce.eq("stat","Y");
List<CompExp> listce = compExpService.list(queryWrapperce);
String expids= "";
for (int i = 0 ; i <listce.size() ; i++){
ExpGroup expGroup = new ExpGroup();
QueryWrapper<ExpGroup> queryWrappereg = QueryGenerator.initQueryWrapper(expGroup, req.getParameterMap());
queryWrappereg.eq("grouid",listce.get(i).getExpid());
//queryWrappereg.eq("ann_comp_groupid",ndbsxzid);
List<ExpGroup> listeg = expGroupService.list(queryWrappereg);
if(listeg.size()==0){
expids = expids+listce.get(i).getExpid()+",";
}
}
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap()); QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap());
queryWrapper.in("id",expids.split(","));
Page<Expert> page = new Page<Expert>(pageNo, pageSize); Page<Expert> page = new Page<Expert>(pageNo, pageSize);
IPage<Expert> pageList = expertService.page(page, queryWrapper); IPage<Expert> pageList = expertService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
@ -95,15 +131,22 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
/** /**
* 添加 * 添加
* *
* @param expert * @param ids
* @return * @return
*/ */
@AutoLog(value = "专家表-添加") @AutoLog(value = "专家表-添加")
@ApiOperation(value="专家表-添加", notes="专家表-添加") @ApiOperation(value="专家表-添加", notes="专家表-添加")
@RequiresPermissions("expert:expert:add") //@RequiresPermissions("expert:expert:add")
@PostMapping(value = "/add") @GetMapping(value = "/add")
public Result<String> add(@RequestBody Expert expert) { public Result<String> add(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="ndbsxzid",required=true) String ndbsxzid) {
expertService.save(expert); String str[] =ids.split(",");
for (int i = 0 ; i < str.length;i++){
ExpGroup expGroup = new ExpGroup();
expGroup.setGrouid(str[i]);
expGroup.setIslead("N");
expGroup.setAnnCompGroupid(ndbsxzid);
expGroupService.save(expGroup);
}
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@ -115,7 +158,7 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
*/ */
@AutoLog(value = "专家表-编辑") @AutoLog(value = "专家表-编辑")
@ApiOperation(value="专家表-编辑", notes="专家表-编辑") @ApiOperation(value="专家表-编辑", notes="专家表-编辑")
@RequiresPermissions("expert:expert:edit") //@RequiresPermissions("expert:expert:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody Expert expert) { public Result<String> edit(@RequestBody Expert expert) {
expertService.updateById(expert); expertService.updateById(expert);
@ -130,7 +173,7 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
*/ */
@AutoLog(value = "专家表-通过id删除") @AutoLog(value = "专家表-通过id删除")
@ApiOperation(value="专家表-通过id删除", notes="专家表-通过id删除") @ApiOperation(value="专家表-通过id删除", notes="专家表-通过id删除")
@RequiresPermissions("expert:expert:delete") //@RequiresPermissions("expert:expert:delete")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) { public Result<String> delete(@RequestParam(name="id",required=true) String id) {
expertService.removeById(id); expertService.removeById(id);
@ -145,7 +188,7 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
*/ */
@AutoLog(value = "专家表-批量删除") @AutoLog(value = "专家表-批量删除")
@ApiOperation(value="专家表-批量删除", notes="专家表-批量删除") @ApiOperation(value="专家表-批量删除", notes="专家表-批量删除")
@RequiresPermissions("expert:expert:deleteBatch") //@RequiresPermissions("expert:expert:deleteBatch")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.expertService.removeByIds(Arrays.asList(ids.split(","))); this.expertService.removeByIds(Arrays.asList(ids.split(",")));
@ -317,7 +360,7 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
* @param request * @param request
* @param expert * @param expert
*/ */
@RequiresPermissions("expert:expert:exportXls") //@RequiresPermissions("expert:expert:exportXls")
@RequestMapping(value = "/exportXls") @RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, Expert expert) { public ModelAndView exportXls(HttpServletRequest request, Expert expert) {
return super.exportXls(request, expert, Expert.class, "专家表"); return super.exportXls(request, expert, Expert.class, "专家表");
@ -330,7 +373,7 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
* @param response * @param response
* @return * @return
*/ */
@RequiresPermissions("expert:expert:importExcel") //@RequiresPermissions("expert:expert:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, Expert.class); return super.importExcel(request, response, Expert.class);

@ -0,0 +1,208 @@
package org.jeecg.modules.demo.expgroup.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.expgroup.entity.ExpGroup;
import org.jeecg.modules.demo.expgroup.service.IExpGroupService;
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: 2023-10-16
* @Version: V1.0
*/
@Api(tags="专家组成员")
@RestController
@RequestMapping("/expgroup/expGroup")
@Slf4j
public class ExpGroupController extends JeecgController<ExpGroup, IExpGroupService> {
@Autowired
private IExpGroupService expGroupService;
/**
* 分页列表查询
*
* @param expGroup
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "专家组成员-分页列表查询")
@ApiOperation(value="专家组成员-分页列表查询", notes="专家组成员-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ExpGroup>> queryPageList(ExpGroup expGroup,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req,@RequestParam(name="ndbsxzid",required=true) String ndbsxzid) {
QueryWrapper<ExpGroup> queryWrapper = QueryGenerator.initQueryWrapper(expGroup, req.getParameterMap());
queryWrapper.eq("ann_comp_groupid",ndbsxzid);
Page<ExpGroup> page = new Page<ExpGroup>(pageNo, pageSize);
IPage<ExpGroup> pageList = expGroupService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param expGroup
* @return
*/
@AutoLog(value = "专家组成员-添加")
@ApiOperation(value="专家组成员-添加", notes="专家组成员-添加")
//@RequiresPermissions("expgroup:exp_group:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ExpGroup expGroup) {
expGroupService.save(expGroup);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param expGroup
* @return
*/
@AutoLog(value = "专家组成员-编辑")
@ApiOperation(value="专家组成员-编辑", notes="专家组成员-编辑")
//@RequiresPermissions("expgroup:exp_group:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ExpGroup expGroup) {
expGroupService.updateById(expGroup);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "专家组成员-通过id删除")
@ApiOperation(value="专家组成员-通过id删除", notes="专家组成员-通过id删除")
//@RequiresPermissions("expgroup:exp_group:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
expGroupService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "专家组成员-批量删除")
@ApiOperation(value="专家组成员-批量删除", notes="专家组成员-批量删除")
//@RequiresPermissions("expgroup:exp_group:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.expGroupService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 设置队长
*
* @param id,ndbsxzid
* @return
*/
//@AutoLog(value = "设置队长")
@ApiOperation(value="设置队长", notes="设置队长")
@GetMapping(value = "/szOne")
public Result<ExpGroup> szOne(@RequestParam(name="id",required=true) String id,@RequestParam(name="ndbsxzid",required=true) String ndbsxzid,HttpServletRequest req) {
ExpGroup expGroup = new ExpGroup();
QueryWrapper<ExpGroup> queryWrapper = QueryGenerator.initQueryWrapper(expGroup, req.getParameterMap());
queryWrapper.eq("ann_comp_groupid",ndbsxzid);
List<ExpGroup> list = expGroupService.list(queryWrapper);
for (int i = 0 ; i < list.size() ; i++){
ExpGroup expGroup1 = list.get(i);
expGroup1.setIslead("N");
expGroupService.updateById(expGroup1);
}
expGroup = expGroupService.getById(id);
if(expGroup==null) {
return Result.error("未找到对应数据");
}else {
expGroup.setIslead("Y");
expGroupService.updateById(expGroup);
}
return Result.OK("设置成功");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "专家组成员-通过id查询")
@ApiOperation(value="专家组成员-通过id查询", notes="专家组成员-通过id查询")
@GetMapping(value = "/queryById")
public Result<ExpGroup> queryById(@RequestParam(name="id",required=true) String id) {
ExpGroup expGroup = expGroupService.getById(id);
if(expGroup==null) {
return Result.error("未找到对应数据");
}
return Result.OK(expGroup);
}
/**
* 导出excel
*
* @param request
* @param expGroup
*/
//@RequiresPermissions("expgroup:exp_group:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ExpGroup expGroup) {
return super.exportXls(request, expGroup, ExpGroup.class, "专家组成员");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("expgroup:exp_group:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ExpGroup.class);
}
}

@ -0,0 +1,72 @@
package org.jeecg.modules.demo.expgroup.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: 2023-10-16
* @Version: V1.0
*/
@Data
@TableName("exp_group")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="exp_group对象", description="专家组成员")
public class ExpGroup 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, dictTable = "expert", dicText = "name", dicCode = "id")
@Dict(dictTable = "expert", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "成员")
private java.lang.String grouid;
/**是否队长*/
@Excel(name = "是否队长", width = 15)
@ApiModelProperty(value = "是否队长")
private java.lang.String islead;
/**年度比赛项目专家小组*/
@Excel(name = "年度比赛项目专家小组", width = 15, dictTable = "annual_comp_group", dicText = "name", dicCode = "id")
@Dict(dictTable = "annual_comp_group", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "年度比赛项目专家小组")
private java.lang.String annCompGroupid;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.expgroup.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.expgroup.entity.ExpGroup;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 专家组成员
* @Author: jeecg-boot
* @Date: 2023-10-16
* @Version: V1.0
*/
public interface ExpGroupMapper extends BaseMapper<ExpGroup> {
}

@ -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.expgroup.mapper.ExpGroupMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.expgroup.service;
import org.jeecg.modules.demo.expgroup.entity.ExpGroup;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 专家组成员
* @Author: jeecg-boot
* @Date: 2023-10-16
* @Version: V1.0
*/
public interface IExpGroupService extends IService<ExpGroup> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.expgroup.service.impl;
import org.jeecg.modules.demo.expgroup.entity.ExpGroup;
import org.jeecg.modules.demo.expgroup.mapper.ExpGroupMapper;
import org.jeecg.modules.demo.expgroup.service.IExpGroupService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 专家组成员
* @Author: jeecg-boot
* @Date: 2023-10-16
* @Version: V1.0
*/
@Service
public class ExpGroupServiceImpl extends ServiceImpl<ExpGroupMapper, ExpGroup> implements IExpGroupService {
}
Loading…
Cancel
Save