能力分组当关闭时候,关联的能力也关闭

gst4base
王家东 2 months ago
parent e1ae79c1d8
commit 700e4cc44a
  1. 24
      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 com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; 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.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -50,6 +52,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class AlitygroupController extends JeecgController<Alitygroup, IAlitygroupService> { public class AlitygroupController extends JeecgController<Alitygroup, IAlitygroupService> {
@Autowired @Autowired
private IAlitygroupService alitygroupService; private IAlitygroupService alitygroupService;
@Autowired
private IBasicsskillService basicsskillService;
/** /**
* 分页列表查询 * 分页列表查询
@ -97,8 +101,24 @@ public class AlitygroupController extends JeecgController<Alitygroup, IAlitygrou
@ApiOperation(value="能力分组-编辑", notes="能力分组-编辑") @ApiOperation(value="能力分组-编辑", notes="能力分组-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody Alitygroup alitygroup) { public Result<String> edit(@RequestBody Alitygroup alitygroup) {
alitygroupService.updateById(alitygroup); if(alitygroup.getIsopen().equals("Y")) {
return Result.OK("编辑成功!"); alitygroupService.updateById(alitygroup);
return Result.OK("编辑成功!");
} else if (alitygroup.getIsopen().equals("N")){
// 使用逗号分割字符串
String[] numberArray = alitygroup.getAlityid().split(",");
List<String> numberList = Arrays.asList(numberArray);
List<Basicsskill> 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("编辑失败!");
}
} }
/** /**

Loading…
Cancel
Save