|
|
@@ -46,6 +46,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -79,6 +80,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
@Autowired
|
|
|
private SysOrgExtendMapper sysOrgExtendMapper;
|
|
|
@Autowired
|
|
|
+ @Lazy
|
|
|
private ISysWorkTimeSetService workTimeSetService;
|
|
|
|
|
|
private static List<SysOrg> handleTree(Map<Long, List<SysOrg>> map, Long parentId) {
|
|
|
@@ -873,7 +875,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
}
|
|
|
if (ObjectUtil.equal(1,org.getIsLock())){
|
|
|
//停用机构
|
|
|
- disableOrg(org);
|
|
|
+ disableOrg(Arrays.asList(org.getId()));
|
|
|
}
|
|
|
|
|
|
isOk = this.updateById(org);
|
|
|
@@ -899,12 +901,12 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
return isOk;
|
|
|
}
|
|
|
|
|
|
- private void disableOrg(SysOrg org) {
|
|
|
+ @Override
|
|
|
+ public void disableOrg(List<Long> orgList) {
|
|
|
// 815版本
|
|
|
//1、停用机构,停用时删除停用当天及之后的作息时间和作息配置及作息模板数据。
|
|
|
//2、停用机构不影响 履职,安全检查,教育培训,预案演练,监控调阅等模块的 业务数据和统计报表数据的查看
|
|
|
- Long orgId = org.getId();
|
|
|
- workTimeSetService.deleteSysWorkTimeSetByOrgIds(Arrays.asList(org.getId()), new Date());
|
|
|
+ workTimeSetService.deleteSysWorkTimeSetByOrgIds(orgList, new Date());
|
|
|
}
|
|
|
|
|
|
// 获取机构所属行社、地区的名称
|
|
|
@@ -1566,4 +1568,16 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void findDisableOrgAndClearData() {
|
|
|
+ List<SysOrg> list = lambdaQuery()
|
|
|
+ .eq(SysOrg::getIsLock, 1)
|
|
|
+ .select(SysOrg::getId, SysOrg::getType)
|
|
|
+ .list();
|
|
|
+ if (list.isEmpty()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<Long> collect = list.stream().map(SysOrg::getId).collect(Collectors.toList());
|
|
|
+ this.disableOrg(collect);
|
|
|
+ }
|
|
|
}
|