From 9fd85881c715265203459204d2280807f09b929f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Tue, 31 Oct 2023 10:58:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=8B=E4=BD=B3=E5=86=AC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/comp/controller/CompController.java | 32 +++++++++++++++++++ .../jeecg/modules/demo/comp/entity/Comp.java | 6 ++++ 2 files changed, 38 insertions(+) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java index e287c378..fc4089df 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java @@ -153,6 +153,22 @@ public class CompController extends JeecgController { } String join = Joiner.on(",").join(list1); comp.setCompAdmin(join); + /*--------------------------王家东添加开始============================*/ + //获取比赛类型 + Double comptypeweight = compTypeService.getById(comp.getCompTypeId()).getScore(); + int comptyp = (int) Math.round(comptypeweight); + //得到排序排序加大一便将比赛类型数据减一,最大值是10 + int csort; + if (comp.getCompOrder()==10 || comp.getCompOrder()>10){ + csort = comptyp - 10; + } else { + csort =comptyp - comp.getCompOrder(); + } + + comp.setCompweight(csort); + + + /*--------------------------王家东添加开始============================*/ compService.save(comp); return Result.OK("添加成功!"); } @@ -168,6 +184,22 @@ public class CompController extends JeecgController { // @RequiresPermissions("comp::comp::update") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody Comp comp) { + /*--------------------------王家东添加开始============================*/ + //获取比赛类型 + Double comptypeweight = compTypeService.getById(comp.getCompTypeId()).getScore(); + int comptyp = (int) Math.round(comptypeweight); + //得到排序排序加大一便将比赛类型数据减一,最大值是10 + int csort; + if (comp.getCompOrder()==10 || comp.getCompOrder()>10){ + csort = comptyp - 10; + } else { + csort =comptyp - comp.getCompOrder(); + } + + comp.setCompweight(csort); + + + /*--------------------------王家东添加开始============================*/ compService.updateById(comp); return Result.OK("编辑成功!"); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/entity/Comp.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/entity/Comp.java index bd57fe77..d44efb1e 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/entity/Comp.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/entity/Comp.java @@ -97,6 +97,12 @@ public class Comp implements Serializable { @ApiModelProperty(value = "负责部门") private String compOrgan; + /**负责部门*/ + /*@Excel(name = "负责部门", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "负责部门")*/ + private Integer compweight; + /**比赛类型*/