王佳冬修改

dev
王家东 1 year ago
parent 8b4abf4a91
commit 9fd85881c7
  1. 32
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/controller/CompController.java
  2. 6
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/comp/entity/Comp.java

@ -153,6 +153,22 @@ public class CompController extends JeecgController<Comp, ICompService> {
} }
String join = Joiner.on(",").join(list1); String join = Joiner.on(",").join(list1);
comp.setCompAdmin(join); 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); compService.save(comp);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@ -168,6 +184,22 @@ public class CompController extends JeecgController<Comp, ICompService> {
// @RequiresPermissions("comp::comp::update") // @RequiresPermissions("comp::comp::update")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody Comp comp) { public Result<String> 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); compService.updateById(comp);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }

@ -97,6 +97,12 @@ public class Comp implements Serializable {
@ApiModelProperty(value = "负责部门") @ApiModelProperty(value = "负责部门")
private String compOrgan; 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;
/**比赛类型*/ /**比赛类型*/

Loading…
Cancel
Save