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; + /**比赛类型*/