|
@@ -12,20 +12,13 @@ import com.ym.mec.auth.api.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.dao.SysMessageConfigDao;
|
|
|
import com.ym.mec.biz.dal.dao.CooperationOrganDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
-import com.ym.mec.biz.dal.entity.CooperationOrgan;
|
|
|
-import com.ym.mec.biz.dal.entity.SchoolStaff;
|
|
|
-import com.ym.mec.biz.dal.entity.SysConfig;
|
|
|
-import com.ym.mec.biz.dal.entity.SysMessageConfig;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.school.ESchoolStaffType;
|
|
|
import com.ym.mec.biz.dal.mapper.SchoolStaffMapper;
|
|
|
import com.ym.mec.biz.dal.wrapper.SchoolStaffWrapper;
|
|
|
import com.ym.mec.biz.dal.wrapper.StatGroupWrapper;
|
|
|
-import com.ym.mec.biz.service.CooperationOrganService;
|
|
|
-import com.ym.mec.biz.service.SchoolStaffService;
|
|
|
-import com.ym.mec.biz.service.SmsCodeService;
|
|
|
-import com.ym.mec.biz.service.SysConfigService;
|
|
|
-import com.ym.mec.biz.service.SysMessageService;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
import com.ym.mec.util.string.MessageFormatter;
|
|
@@ -80,6 +73,9 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
|
|
|
@Autowired
|
|
|
private SysMessageConfigDao sysMessageConfigDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private OrganizationService organizationService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询详情
|
|
|
* @param id 详情ID
|
|
@@ -99,8 +95,33 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
|
|
|
*/
|
|
|
@Override
|
|
|
public IPage<SchoolStaffWrapper.SchoolStaff> selectPage(IPage<SchoolStaffWrapper.SchoolStaff> page, SchoolStaffWrapper.SchoolStaffQuery query) {
|
|
|
-
|
|
|
- return page.setRecords(baseMapper.selectPage(page, query));
|
|
|
+ List<SchoolStaffWrapper.SchoolStaff> schoolStaffs = baseMapper.selectPage(page, query);
|
|
|
+ if (CollectionUtils.isEmpty(schoolStaffs)) {
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置分部名称
|
|
|
+
|
|
|
+ // 分部ID集合
|
|
|
+ List<Integer> organIds = schoolStaffs.stream()
|
|
|
+ .flatMap(o -> Arrays.stream(o.getOrganId().split(",")))
|
|
|
+ .map(Integer::parseInt)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ Map<Integer, Organization> organizationMap = organizationService.getMapByIds(organIds);
|
|
|
+
|
|
|
+ for (SchoolStaffWrapper.SchoolStaff schoolStaff : schoolStaffs) {
|
|
|
+ String collect = Arrays.stream(schoolStaff.getOrganId().split(","))
|
|
|
+ .map(Integer::parseInt)
|
|
|
+ .map(organizationMap::get)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .map(o -> o.getName())
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ schoolStaff.setOrganName(collect);
|
|
|
+ }
|
|
|
+
|
|
|
+ return page.setRecords(schoolStaffs);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -425,6 +446,7 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
|
|
|
@Override
|
|
|
public void updateCooperation(SchoolStaffWrapper.Cooperation info) {
|
|
|
|
|
|
+ info.setStatus("0");
|
|
|
// 合作单位信息
|
|
|
cooperationOrganDao.update(JSON.parseObject(info.jsonString(), CooperationOrgan.class));
|
|
|
}
|