|
|
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xunmei.common.core.constant.CacheConstants;
|
|
|
import com.xunmei.common.core.domain.worktime.domain.SysWorkTime;
|
|
|
+import com.xunmei.common.core.enums.OrgTypeEnum;
|
|
|
import com.xunmei.common.core.thread.ThreadPoolConfig;
|
|
|
import com.xunmei.common.core.util.BeanHelper;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
@@ -22,6 +23,7 @@ import com.xunmei.common.core.web.domain.AjaxResult;
|
|
|
import com.xunmei.common.core.web.page.TableDataInfo;
|
|
|
import com.xunmei.common.redis.utils.RedisUtils;
|
|
|
import com.xunmei.common.security.utils.SecurityUtils;
|
|
|
+import com.xunmei.system.api.domain.SysOrg;
|
|
|
import com.xunmei.system.api.vo.SysOrgVO;
|
|
|
import com.xunmei.system.domain.SysWorkTimeSet;
|
|
|
import com.xunmei.system.domain.SysWorkTimeSetDayofweek;
|
|
|
@@ -160,11 +162,14 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
|
|
|
|
|
|
List<SysWorkTimeSet> list = page.getRecords();
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
+ List<Long> orgIds = new ArrayList<>();
|
|
|
list.forEach(l -> {
|
|
|
ids.add(l.getId());
|
|
|
+ orgIds.add(l.getOrgId());
|
|
|
});
|
|
|
if (list.size() > 0) {
|
|
|
List<SysWorkTimeSetDayofweek> dayOfWeeks = sysWorkTimeSetDayofweekMapper.findByWorkTimeSetIdIn(ids);
|
|
|
+ List<SysOrg> sysOrgs = orgService.selectByOrgIdList(orgIds);
|
|
|
list.forEach(l -> {
|
|
|
List<SysWorkTimeSetDayofweek> dayOfWeekList = dayOfWeeks.stream().filter(d -> d.getWorkTimeSetId().equals(l.getId())).collect(Collectors.toList());
|
|
|
String workDay = "";
|
|
|
@@ -199,7 +204,20 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ Optional<SysOrg> any = sysOrgs.stream().filter(r -> ObjectUtil.equal(r.getId(), l.getOrgId())).findAny();
|
|
|
+ if (!any.isPresent()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ SysOrg sysOrg = any.get();
|
|
|
+ if (OrgTypeEnum.DIQU_HANG_SHE.getCode().toString().equals(sysOrg.getOrgType()) || OrgTypeEnum.SHEGN_LIAN_SHE.getCode().toString().equals(sysOrg.getOrgType())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (OrgTypeEnum.HANG_SHE.getCode().toString().equals(sysOrg.getOrgType())) {
|
|
|
+ l.setAffiliatedArea(sysOrg.getAffiliatedArea());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ l.setAffiliatedArea(sysOrg.getAffiliatedArea());
|
|
|
+ l.setAffiliatedBank(sysOrg.getAffiliatedBank());
|
|
|
// if(l.getEffectiveDate().before(new Date()) || month == month1 || month+1 == month1) {
|
|
|
// l.setTimeCheck(1);
|
|
|
// }else{
|
|
|
@@ -396,7 +414,7 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
|
|
|
List<SysWorkTimeSetDayofweek> dayofweekList = workTimeSet.getDayOfWeeks();
|
|
|
|
|
|
for (Long orgId : orgIds) {
|
|
|
- CompletableFuture.runAsync(()->{
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
List<SysWorkTime> workTimeEditDtoList = new ArrayList<SysWorkTime>();
|
|
|
for (DateTime dateTime : dateTimeList) {
|
|
|
Optional<SysWorkTimeSetDayofweek> sameDayOfWeek = dayofweekList.stream().filter(w -> ObjectUtil.equal(String.valueOf(w.getDayOfWeek()), String.valueOf(dateTime.dayOfWeek()))).findFirst();
|
|
|
@@ -436,7 +454,7 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
|
|
|
workTimeEditDtoList.add(workTime);
|
|
|
}
|
|
|
sysWorkTimeMapper.batchInsertByXML(workTimeEditDtoList);
|
|
|
- },threadPoolTaskExecutor);
|
|
|
+ }, threadPoolTaskExecutor);
|
|
|
}
|
|
|
log.info("===== 构建SysWorkTime作息模板数据完成 ====");
|
|
|
|