年度比赛项目通过后不可修改和删除

main
王家东 4 months ago
parent c3eb31e9ad
commit 863345ee91
  1. 13
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java

@ -304,7 +304,12 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
// @RequiresPermissions("annualCompPoint:annual_comp_point:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody AnnualCompPoint annualCompPoint) {
boolean isUpdate = annualCompPointService.updateById(annualCompPoint);
boolean isUpdate ;
if(annualCompPoint.getAnnualCompState().equals("0") && annualCompPoint.getAnnualCompState().equals("4") ){
isUpdate = annualCompPointService.updateById(annualCompPoint);
} else {
return Result.error("当前状态不可修改");
}
if (!isUpdate){
return Result.error("编辑失败!");
}
@ -322,7 +327,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
// @RequiresPermissions("annualCompPoint:annual_comp_point:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
AnnualCompPoint annualCompPoint =annualCompPointService.getById(id);
if(annualCompPoint.getAnnualCompState().equals("0") && annualCompPoint.getAnnualCompState().equals("4") ) {
System.out.println(id);
annualCompPointService.removeById(id);
}else {
return Result.error("当前状态不可删除");
}
return Result.OK("删除成功!");
}
/**

Loading…
Cancel
Save