From 7484625f08002cded068e47e8fa73d491382ae76 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Fri, 23 Aug 2024 10:08:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A2=E9=98=9F=E8=B5=9B=E9=98=9F=E5=91=98?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualCompPointController.java | 9 ++- .../impl/PersonalCompScoreServiceImpl.java | 56 ++++++++++--- .../entity/TeamManagement.java | 2 +- .../service/impl/TeamSeqServiceImpl.java | 8 +- .../modules/demo/teamseq/vo/TeamSeqVo.java | 80 +++++++++++++++++++ 5 files changed, 139 insertions(+), 16 deletions(-) create mode 100644 jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/vo/TeamSeqVo.java diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java index 7fa877a9..ac96dfb2 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java @@ -51,6 +51,7 @@ import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; import org.jeecg.modules.demo.scorepersion.service.IScorePersionService; import org.jeecg.modules.demo.teamseq.entity.TeamSeq; import org.jeecg.modules.demo.teamseq.service.ITeamSeqService; +import org.jeecg.modules.demo.teamseq.vo.TeamSeqVo; import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion; import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService; import org.jeecg.modules.system.entity.SysUser; @@ -188,7 +189,9 @@ public class AnnualCompPointController extends JeecgController()).stream().forEach(point -> { TeamSeq teamSeq = iTeamSeqService.getOne(new LambdaQueryWrapper().eq(TeamSeq::getPointId, point.getId())); if (!ObjectUtils.isEmpty(teamSeq)) { - BeanUtils.copyProperties(teamSeq, point); + TeamSeqVo teamSeqVo = new TeamSeqVo(); + BeanUtils.copyProperties(teamSeq, teamSeqVo); + BeanUtils.copyProperties(teamSeqVo, point); } }); return Result.OK(pageList); @@ -402,12 +405,12 @@ public class AnnualCompPointController extends JeecgController() // .eq(AnnualCompPoint::getAnnualCompId, annualCompId) - .eq(AnnualCompPoint::getId, personalCompScore.getAnnualCompP()) - .eq(AnnualCompPoint::getIsPj, new Integer(1)) + .eq(AnnualCompPoint::getId, personalCompScore.getAnnualCompP()) + .eq(AnnualCompPoint::getIsPj, new Integer(1)) ); List saveList = new LinkedList<>(); @@ -157,7 +157,7 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl score = new AtomicReference<>((double) 0); if (StringUtils.equals("Y", entryForm)) { //团队赛 Optional.ofNullable(managementList).orElse(new ArrayList<>()).forEach(e -> { - // 参与形式是团队时,队长积分*0.5,职员积分*0.2 + /*// 参与形式是团队时,队长积分*0.5,职员积分*0.2 //captain 是否队长 if (StringUtils.equals("0", e.getCaptain())) { score.set(ComputeUtils.mul2(baseScore, ZERO_POINT_FIVE)); } else { score.set(ComputeUtils.mul2(baseScore, ZERO_POINT_TWO)); - } + }*/ + //modify by zhc 8.23 + score.set(ComputeUtils.mul2(baseScore, this.covertVal(annualCompPoint, e))); PersonalCompScore bean = new PersonalCompScore(); bean.setAnnualCompId(annualCompId); bean.setAnnualCompP(annualCompPoint.getId()); @@ -180,7 +182,7 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl().eq(SysDepart::getOrgCode,sysUser.getOrgCode())); + SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper().eq(SysDepart::getOrgCode, sysUser.getOrgCode())); bean.setDepet(sysDepart.getId()); bean.setScore(score.get()); saveList.add(bean); @@ -195,7 +197,7 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl().eq(SysDepart::getOrgCode,sysUser.getOrgCode())); + SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper().eq(SysDepart::getOrgCode, sysUser.getOrgCode())); bean.setDepet(sysDepart.getId()); bean.setScore(score.get()); saveList.add(bean); @@ -215,4 +217,40 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl impl @Override public void saveOrUpdate4TeamSeq(AnnualCompPoint point) { this.remove(new LambdaQueryWrapper().eq(TeamSeq::getPointId,point.getId())); + TeamSeqVo vo = new TeamSeqVo(); + BeanUtils.copyProperties(point,vo); + vo.setPointId(point.getId()); TeamSeq teamSeq = new TeamSeq(); - BeanUtils.copyProperties(point,teamSeq); - teamSeq.setId(null); - teamSeq.setPointId(point.getId()); + BeanUtils.copyProperties(vo,teamSeq); this.save(teamSeq); } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/vo/TeamSeqVo.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/vo/TeamSeqVo.java new file mode 100644 index 00000000..7d633711 --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/vo/TeamSeqVo.java @@ -0,0 +1,80 @@ +package org.jeecg.modules.demo.teamseq.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.jeecgframework.poi.excel.annotation.Excel; + +/** + * @Description: TODO + * @Author: Z.H.C + * @CreateTime: 2024-08-23 09:24 + * @Version: 1.0 + */ +@Data +public class TeamSeqVo { + + /** + * 年度比赛项目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; +}