fix(dept):部门数据的组织代码不正确

yun-zuoyi
汪云昊 4 years ago
parent 11e6487225
commit e708a99bc4

@ -40,7 +40,7 @@ import java.util.List;
**/
@RestController
@Api(tags = "部门管理服务")
@RequestMapping(PlatformConstWords.BASE_URL +"/department")
@RequestMapping(PlatformConstWords.BASE_URL + "/department")
public class SysDepartmentController extends CrudBaseController<SysDepartment> {
public static final Logger LOGGER = LoggerFactory.getLogger(SysDepartmentController.class);
@ -72,6 +72,7 @@ public class SysDepartmentController extends CrudBaseController<SysDepartment> {
SysOrganize organize = organizeService.get(bean.getOrganizeId());
ValidatorBean.checkNotNull(organize, "不存在的组织信息");
bean.setOrganizeNameRdd(organize.getName());
bean.setOrganizeCode(organize.getOrganizeCode());
if (bean.getParentId() == null || bean.getParentId() <= 0) {
bean.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue());
@ -187,11 +188,11 @@ public class SysDepartmentController extends CrudBaseController<SysDepartment> {
public ResultBean findSysDepartmentList() {
try {
List<SysDepartment> result = null;
if(AuthUtil.getUserType().equals(CommonEnumUtil.USER_TYPE.ADMIN)){
if (AuthUtil.getUserType().equals(CommonEnumUtil.USER_TYPE.ADMIN)) {
result = departmentService.findAll();
}else {
} else {
List<SysRefUserDepartment> refList = personnelService.findSysRefUserDepartmentByOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
if(refList != null && refList.size() > 0){
if (refList != null && refList.size() > 0) {
List<Long> idList = new ArrayList<>(refList.size());
refList.forEach(ref -> idList.add(ref.getDepartmentId()));
result = departmentService.findByOrganizeIdList(idList);

Loading…
Cancel
Save