forked from wangjiadong/comp
parent
d7e84844e5
commit
43a483ed64
12 changed files with 1117 additions and 575 deletions
@ -0,0 +1,162 @@ |
||||
package org.jeecg.modules.demo.teamseq.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.modules.demo.teamseq.entity.TeamSeq; |
||||
import org.jeecg.modules.demo.teamseq.service.ITeamSeqService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* @Description: 团队赛队员积分计算配置 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-08-22 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags = "团队赛队员积分计算配置") |
||||
@RestController |
||||
@RequestMapping("/teamSeq") |
||||
@Slf4j |
||||
public class TeamSeqController extends JeecgController<TeamSeq, ITeamSeqService> { |
||||
@Autowired |
||||
private ITeamSeqService teamSeqService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param teamSeq |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "团队赛队员积分计算配置-分页列表查询") |
||||
@ApiOperation(value = "团队赛队员积分计算配置-分页列表查询", notes = "团队赛队员积分计算配置-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<IPage<TeamSeq>> queryPageList(TeamSeq teamSeq, |
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<TeamSeq> queryWrapper = QueryGenerator.initQueryWrapper(teamSeq, req.getParameterMap()); |
||||
Page<TeamSeq> page = new Page<TeamSeq>(pageNo, pageSize); |
||||
IPage<TeamSeq> pageList = teamSeqService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param teamSeq |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "团队赛队员积分计算配置-添加") |
||||
@ApiOperation(value = "团队赛队员积分计算配置-添加", notes = "团队赛队员积分计算配置-添加") |
||||
// @RequiresPermissions("teamseq:team_seq:add")
|
||||
@PostMapping(value = "/add") |
||||
public Result<String> add(@RequestBody TeamSeq teamSeq) { |
||||
teamSeqService.save(teamSeq); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param teamSeq |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "团队赛队员积分计算配置-编辑") |
||||
@ApiOperation(value = "团队赛队员积分计算配置-编辑", notes = "团队赛队员积分计算配置-编辑") |
||||
// @RequiresPermissions("teamseq:team_seq:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.POST}) |
||||
public Result<String> edit(@RequestBody TeamSeq teamSeq) { |
||||
teamSeqService.updateById(teamSeq); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "团队赛队员积分计算配置-通过id删除") |
||||
@ApiOperation(value = "团队赛队员积分计算配置-通过id删除", notes = "团队赛队员积分计算配置-通过id删除") |
||||
// @RequiresPermissions("teamseq:team_seq:delete")
|
||||
@DeleteMapping(value = "/delete") |
||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
||||
teamSeqService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "团队赛队员积分计算配置-批量删除") |
||||
@ApiOperation(value = "团队赛队员积分计算配置-批量删除", notes = "团队赛队员积分计算配置-批量删除") |
||||
// @RequiresPermissions("teamseq:team_seq:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
||||
this.teamSeqService.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<TeamSeq> queryById(@RequestParam(name = "id", required = true) String id) { |
||||
TeamSeq teamSeq = teamSeqService.getById(id); |
||||
if (teamSeq == null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(teamSeq); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param teamSeq |
||||
*/ |
||||
@RequiresPermissions("teamseq:team_seq:exportXls") |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, TeamSeq teamSeq) { |
||||
return super.exportXls(request, teamSeq, TeamSeq.class, "团队赛队员积分计算配置"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequiresPermissions("teamseq:team_seq:importExcel") |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, TeamSeq.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,128 @@ |
||||
package org.jeecg.modules.demo.teamseq.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @Description: 团队赛队员积分计算配置 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-08-22 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("team_seq") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value = "team_seq对象", description = "团队赛队员积分计算配置") |
||||
public class TeamSeq implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/** |
||||
* 创建人 |
||||
*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/** |
||||
* 创建日期 |
||||
*/ |
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/** |
||||
* 更新人 |
||||
*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/** |
||||
* 更新日期 |
||||
*/ |
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 年度比赛项目id |
||||
*/ |
||||
@Excel(name = "年度比赛项目id", width = 15) |
||||
@ApiModelProperty(value = "年度比赛项目id") |
||||
private String pointId; |
||||
|
||||
|
||||
/** |
||||
* 第1序号 |
||||
*/ |
||||
@Excel(name = "第1序号", width = 15) |
||||
@ApiModelProperty(value = "第1序号") |
||||
private Integer teamSeqFirst; |
||||
/** |
||||
* 第1序号比值 |
||||
*/ |
||||
@Excel(name = "第1序号比值", width = 15) |
||||
@ApiModelProperty(value = "第1序号比值") |
||||
private Integer teamSeqFirstVal; |
||||
|
||||
/** |
||||
* 第2序号 |
||||
*/ |
||||
@ApiModelProperty(value = "第1序号") |
||||
private Integer teamSeqSecond; |
||||
/** |
||||
* 第2序号比值 |
||||
*/ |
||||
@ApiModelProperty(value = "第2序号比值") |
||||
private Integer teamSeqSecondVal; |
||||
|
||||
/** |
||||
* 第3序号 |
||||
*/ |
||||
@ApiModelProperty(value = "第3序号") |
||||
private Integer teamSeqThird; |
||||
/** |
||||
* 第3序号比值 |
||||
*/ |
||||
@ApiModelProperty(value = "第3序号比值") |
||||
private Integer teamSeqThirdVal; |
||||
|
||||
/** |
||||
* 第4序号 |
||||
*/ |
||||
@ApiModelProperty(value = "第4序号") |
||||
private Integer teamSeqFourth; |
||||
/** |
||||
* 第4序号比值 |
||||
*/ |
||||
@ApiModelProperty(value = "第4序号比值") |
||||
private Integer teamSeqFourthVal; |
||||
|
||||
/** |
||||
* 第5序号 |
||||
*/ |
||||
@ApiModelProperty(value = "第5序号") |
||||
private Integer teamSeqFifth; |
||||
/** |
||||
* 第5序号比值 |
||||
*/ |
||||
@ApiModelProperty(value = "第5序号比值") |
||||
private Integer teamSeqFifthVal; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.teamseq.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.teamseq.entity.TeamSeq; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 团队赛队员积分计算配置 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-08-22 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface TeamSeqMapper extends BaseMapper<TeamSeq> { |
||||
|
||||
} |
@ -0,0 +1,16 @@ |
||||
package org.jeecg.modules.demo.teamseq.service; |
||||
|
||||
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; |
||||
import org.jeecg.modules.demo.teamseq.entity.TeamSeq; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 团队赛队员积分计算配置 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-08-22 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ITeamSeqService extends IService<TeamSeq> { |
||||
|
||||
void saveOrUpdate4TeamSeq(AnnualCompPoint point); |
||||
} |
@ -0,0 +1,31 @@ |
||||
package org.jeecg.modules.demo.teamseq.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; |
||||
import org.jeecg.modules.demo.teamseq.entity.TeamSeq; |
||||
import org.jeecg.modules.demo.teamseq.mapper.TeamSeqMapper; |
||||
import org.jeecg.modules.demo.teamseq.service.ITeamSeqService; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 团队赛队员积分计算配置 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2024-08-22 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class TeamSeqServiceImpl extends ServiceImpl<TeamSeqMapper, TeamSeq> implements ITeamSeqService { |
||||
|
||||
@Override |
||||
public void saveOrUpdate4TeamSeq(AnnualCompPoint point) { |
||||
this.remove(new LambdaQueryWrapper<TeamSeq>().eq(TeamSeq::getPointId,point.getId())); |
||||
TeamSeq teamSeq = new TeamSeq(); |
||||
BeanUtils.copyProperties(point,teamSeq); |
||||
teamSeq.setId(null); |
||||
teamSeq.setPointId(point.getId()); |
||||
this.save(teamSeq); |
||||
} |
||||
} |
Loading…
Reference in new issue