判断级别-编辑时选择id,级别查询回显部门id
This commit is contained in:
@@ -8,6 +8,7 @@ import com.jero.modules.sys.service.ILawsGradeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -49,6 +50,9 @@ public class LawsGradeController extends JeroController<LawsGrade, ILawsGradeSer
|
||||
@ApiOperation(value="级别-编辑", notes="级别-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@Validated @RequestBody LawsGrade lawsGrade) {
|
||||
if (StringUtils.isBlank(lawsGrade.getId())){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
lawsGradeService.edit(lawsGrade);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
@@ -49,7 +49,9 @@ public class LawsGradeServiceImpl extends ServiceImpl<LawsGradeMapper, LawsGrade
|
||||
List<String> collect = levels.stream().map(LawsEnterpriseStandardLevel::getDeptId).distinct().collect(Collectors.toList());
|
||||
List<SysDepart> sysDepartList = sysDepartService.listByIds(collect);
|
||||
String departNames = sysDepartList.stream().map(SysDepart::getDepartName).collect(Collectors.joining(","));
|
||||
String departIds = sysDepartList.stream().map(SysDepart::getId).collect(Collectors.joining(","));
|
||||
grade.setDeptNames(departNames);
|
||||
grade.setDeptIds(departIds);
|
||||
}
|
||||
}
|
||||
return grades;
|
||||
|
||||
Reference in New Issue
Block a user