diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/alitygroup/controller/AlitygroupController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/alitygroup/controller/AlitygroupController.java index dcfeae3c..376ed763 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/alitygroup/controller/AlitygroupController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/alitygroup/controller/AlitygroupController.java @@ -20,6 +20,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.demo.basicsskill.entity.Basicsskill; +import org.jeecg.modules.demo.basicsskill.service.IBasicsskillService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -50,6 +52,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; public class AlitygroupController extends JeecgController { @Autowired private IAlitygroupService alitygroupService; + @Autowired + private IBasicsskillService basicsskillService; /** * 分页列表查询 @@ -97,8 +101,24 @@ public class AlitygroupController extends JeecgController edit(@RequestBody Alitygroup alitygroup) { - alitygroupService.updateById(alitygroup); - return Result.OK("编辑成功!"); + if(alitygroup.getIsopen().equals("Y")) { + alitygroupService.updateById(alitygroup); + return Result.OK("编辑成功!"); + } else if (alitygroup.getIsopen().equals("N")){ + // 使用逗号分割字符串 + String[] numberArray = alitygroup.getAlityid().split(","); + List numberList = Arrays.asList(numberArray); + List basicsskillList = basicsskillService.query().in("id",numberList).list(); + for (Basicsskill skill : basicsskillList) { + skill.setStartstop("N"); + basicsskillService.updateById(skill); + } + alitygroupService.updateById(alitygroup); + return Result.OK("编辑成功!"); + }else { + return Result.OK("编辑失败!"); + } + } /**