|
|
@@ -20,11 +20,13 @@ import com.xunmei.common.core.domain.panel.enums.PanelTypeEnums;
|
|
|
import com.xunmei.common.core.domain.panel.vo.PanelListVo;
|
|
|
import com.xunmei.common.core.domain.panel.vo.WebPanelResult;
|
|
|
import com.xunmei.common.core.util.BeanHelper;
|
|
|
+import com.xunmei.common.core.utils.DateUtils;
|
|
|
import com.xunmei.common.core.web.page.TableDataInfo;
|
|
|
import com.xunmei.common.security.utils.DictUtils;
|
|
|
import com.xunmei.common.security.utils.SecurityUtils;
|
|
|
-import com.xunmei.core.letter.mapper.CoreIntroduceLetterApproveLogMapper;
|
|
|
+import com.xunmei.core.letter.mapper.CoreIntroduceLetterOutInRequestMapper;
|
|
|
import com.xunmei.core.letter.mapper.CoreIntroduceLetterMapper;
|
|
|
+import com.xunmei.core.letter.mapper.CoreIntroduceLetterOutInRequestUserMapper;
|
|
|
import com.xunmei.core.letter.mapper.CoreOutInRecordMapper;
|
|
|
import com.xunmei.core.letter.service.ICoreIntroduceLetterService;
|
|
|
import com.xunmei.system.api.RemoteOrgService;
|
|
|
@@ -50,13 +52,17 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Service
|
|
|
public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLetterMapper, CoreIntroduceLetter> implements ICoreIntroduceLetterService {
|
|
|
- @Resource
|
|
|
+ @Autowired
|
|
|
private CoreIntroduceLetterMapper coreIntroduceLetterMapper;
|
|
|
|
|
|
- @Resource
|
|
|
+ @Autowired
|
|
|
private CoreOutInRecordMapper coreOutInRecordMapper;
|
|
|
- @Resource
|
|
|
- private CoreIntroduceLetterApproveLogMapper approveLogMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CoreIntroduceLetterOutInRequestMapper outInRequestMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CoreIntroduceLetterOutInRequestUserMapper outInRequestUserMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private RemoteRoleService roleService;
|
|
|
@@ -78,7 +84,7 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
// if (ObjectUtil.isNotNull(request.getRequestFromWeb()) && request.getRequestFromWeb() ) {
|
|
|
// request.setType(1);
|
|
|
// }
|
|
|
- if (ObjectUtil.equal(request.getRequestFromWeb(), true)) {
|
|
|
+ if (ObjectUtil.equal(request.getRequestFromWeb(), true)) {
|
|
|
//获取数据
|
|
|
page = coreIntroduceLetterMapper.selectPageList(page, request);
|
|
|
} else {
|
|
|
@@ -97,9 +103,9 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public TableDataInfo<CoreIntroduceLetterApproveVo> selectApproveListPage(CoreIntroduceLetterApproveRequestDto requestDto) {
|
|
|
+ public TableDataInfo<CoreIntroduceLetterOutInRequestVo> selectApproveListPage(CoreIntroduceLetterApproveRequestDto requestDto) {
|
|
|
//未删除
|
|
|
- Page<CoreIntroduceLetterApproveVo> page;
|
|
|
+ Page<CoreIntroduceLetterOutInRequestVo> page;
|
|
|
//分页
|
|
|
if (requestDto.getPageNum() != null && requestDto.getPageSize() != null) {
|
|
|
page = new Page<>(requestDto.getPageNum(), requestDto.getPageSize());
|
|
|
@@ -140,11 +146,14 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void auditLetter(CoreIntroduceLetterApproveLog approveLog) {
|
|
|
- approveLog.setApproveTime(new Date());
|
|
|
- approveLog.setApproveUser(SecurityUtils.getUsername());
|
|
|
- approveLog.setApproveUserId(SecurityUtils.getUserId());
|
|
|
- coreIntroduceLetterMapper.approveLetter(approveLog);
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void auditLetter(CoreIntroduceLetterOutInRequest outInRequest) {
|
|
|
+ outInRequest.setApproveTime(new Date());
|
|
|
+ outInRequest.setApproveUser(SecurityUtils.getUsername());
|
|
|
+ outInRequest.setApproveUserId(SecurityUtils.getUserId());
|
|
|
+ coreIntroduceLetterMapper.approveLetter(outInRequest);
|
|
|
+ coreOutInRecordMapper.updateCoreOutInRecordStatus(outInRequest.getApproveStatus(),outInRequest.getId());
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -152,24 +161,22 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
List<CoreIntroduceLetterVo> records = page.getRecords();
|
|
|
if (ObjectUtil.isNotEmpty(records)) {
|
|
|
List<CoreIntroduceLetterToOrg> toOrgList = coreIntroduceLetterMapper.findToOrgListA(page.getRecords());
|
|
|
- List<CoreOutInRecord> letterOutInRecordList = coreOutInRecordMapper.findLetterOutInRecordList(records.stream().map(x -> x.getId()).collect(Collectors.toList()).toArray(new Long[records.size()]));
|
|
|
+// List<CoreOutInRecord> letterOutInRecordList = coreOutInRecordMapper.findLetterOutInRecordList(records.stream().map(x -> x.getId()).collect(Collectors.toList()).toArray(new Long[records.size()]));
|
|
|
for (CoreIntroduceLetterVo record : records) {
|
|
|
List<Long> orgIds = toOrgList.stream().filter(toOrg -> toOrg.getLetterId().equals(record.getId())).map(CoreIntroduceLetterToOrg::getOrgId).collect(Collectors.toList());
|
|
|
- String orgNames = orgIds.stream().map(orgId ->{
|
|
|
+ String orgNames = orgIds.stream().map(orgId -> {
|
|
|
final SysOrg sysOrg = orgList.stream().filter(org -> org.getId().equals(orgId)).findFirst().get();
|
|
|
- if(ObjectUtil.isNotEmpty(sysOrg))
|
|
|
- {
|
|
|
- if(StringUtil.isNullOrEmpty(sysOrg.getAffiliatedArea()) || sysOrg.getType()<4 || sysOrg.getShortName().endsWith("地区行社"))
|
|
|
- {
|
|
|
+ if (ObjectUtil.isNotEmpty(sysOrg)) {
|
|
|
+ if (StringUtil.isNullOrEmpty(sysOrg.getAffiliatedArea()) || sysOrg.getType() < 4 || sysOrg.getShortName().endsWith("地区行社")) {
|
|
|
return sysOrg.getShortName();
|
|
|
}
|
|
|
- return sysOrg.getAffiliatedBank()+"-"+ sysOrg.getShortName();
|
|
|
+ return sysOrg.getAffiliatedBank() + "-" + sysOrg.getShortName();
|
|
|
}
|
|
|
return StringUtil.EMPTY_STRING;
|
|
|
}).collect(Collectors.joining(","));
|
|
|
record.setReceptionOrgIds(orgIds);
|
|
|
record.setReceptionOrgNames(orgNames);
|
|
|
- record.setHaveOutInRecord(letterOutInRecordList.stream().anyMatch(x -> ObjectUtil.equal(x.getLetterId(), record.getId())));
|
|
|
+// record.setHaveOutInRecord(letterOutInRecordList.stream().anyMatch(x -> ObjectUtil.equal(x.getLetterId(), record.getId())));
|
|
|
}
|
|
|
}
|
|
|
return page;
|
|
|
@@ -205,14 +212,14 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
if (CollectionUtils.isNotEmpty(userList)) {
|
|
|
coreIntroduceLetterVo.setUserInfos(userList);
|
|
|
}
|
|
|
- CoreIntroduceLetterApproveLog
|
|
|
- checkLog = coreIntroduceLetterMapper.findCheckLog(id, SecurityUtils.getLoginUser().getOrgId());
|
|
|
- coreIntroduceLetterVo.setApproveLog(checkLog);
|
|
|
-
|
|
|
- List<CoreIntroduceLetterApproveVo> approveVoList = coreIntroduceLetterMapper.findLetterApproveInfos(id);
|
|
|
- if (CollectionUtils.isNotEmpty(approveVoList)) {
|
|
|
- coreIntroduceLetterVo.setApproveInfos(approveVoList);
|
|
|
- }
|
|
|
+// CoreIntroduceLetterOutInRequest
|
|
|
+// checkLog = coreIntroduceLetterMapper.findCheckLog(id, SecurityUtils.getLoginUser().getOrgId());
|
|
|
+// coreIntroduceLetterVo.setApproveLog(checkLog);
|
|
|
+//
|
|
|
+// List<CoreIntroduceLetterOutInRequestVo> approveVoList = coreIntroduceLetterMapper.findLetterApproveInfos(id);
|
|
|
+// if (CollectionUtils.isNotEmpty(approveVoList)) {
|
|
|
+// coreIntroduceLetterVo.setApproveInfos(approveVoList);
|
|
|
+// }
|
|
|
return coreIntroduceLetterVo;
|
|
|
}
|
|
|
|
|
|
@@ -241,11 +248,11 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
CoreIntroduceLetter introduceLetter = (CoreIntroduceLetter) map.get("introduceLetter");
|
|
|
List<CoreIntroduceLetterUser> userList = (List<CoreIntroduceLetterUser>) map.get("userList");
|
|
|
List<CoreIntroduceLetterToOrg> toOrgList = (List<CoreIntroduceLetterToOrg>) map.get("toOrgList");
|
|
|
- List<CoreIntroduceLetterApproveLog> checkLogs = (List<CoreIntroduceLetterApproveLog>) map.get("checkLogs");
|
|
|
+// List<CoreIntroduceLetterOutInRequest> checkLogs = (List<CoreIntroduceLetterOutInRequest>) map.get("checkLogs");
|
|
|
coreIntroduceLetterMapper.insert(introduceLetter);
|
|
|
coreIntroduceLetterMapper.saveUserList(userList);
|
|
|
coreIntroduceLetterMapper.saveToOrgList(toOrgList);
|
|
|
- coreIntroduceLetterMapper.saveCheckLogs(checkLogs);
|
|
|
+// coreIntroduceLetterMapper.saveCheckLogs(checkLogs);
|
|
|
}
|
|
|
|
|
|
private Map<String, Object> buildEditLetterMap(CoreIntroduceLetterAddDto coreIntroduceLetter) {
|
|
|
@@ -294,7 +301,7 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
});
|
|
|
//封装接待机构
|
|
|
List<CoreIntroduceLetterToOrg> toOrgList = new ArrayList<>();
|
|
|
- List<CoreIntroduceLetterApproveLog> checkLogs = new ArrayList<>();
|
|
|
+ List<CoreIntroduceLetterOutInRequest> checkLogs = new ArrayList<>();
|
|
|
List<Long> orgIds = coreIntroduceLetter.getReceptionOrgIds();
|
|
|
orgIds.forEach(r -> {
|
|
|
CoreIntroduceLetterToOrg toOrg = new CoreIntroduceLetterToOrg();
|
|
|
@@ -302,7 +309,7 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
toOrg.setOrgId(r);
|
|
|
toOrgList.add(toOrg);
|
|
|
|
|
|
- CoreIntroduceLetterApproveLog checkLog = new CoreIntroduceLetterApproveLog();
|
|
|
+ CoreIntroduceLetterOutInRequest checkLog = new CoreIntroduceLetterOutInRequest();
|
|
|
checkLog.setId(IdWorker.getId());
|
|
|
checkLog.setOrgId(r);
|
|
|
checkLog.setLetterId(introduceLetter.getId());
|
|
|
@@ -370,7 +377,7 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
CoreIntroduceLetter introduceLetter = (CoreIntroduceLetter) map.get("introduceLetter");
|
|
|
List<CoreIntroduceLetterUser> userList = (List<CoreIntroduceLetterUser>) map.get("userList");
|
|
|
List<CoreIntroduceLetterToOrg> toOrgList = (List<CoreIntroduceLetterToOrg>) map.get("toOrgList");
|
|
|
- List<CoreIntroduceLetterApproveLog> checkLogs = (List<CoreIntroduceLetterApproveLog>) map.get("checkLogs");
|
|
|
+ List<CoreIntroduceLetterOutInRequest> checkLogs = (List<CoreIntroduceLetterOutInRequest>) map.get("checkLogs");
|
|
|
|
|
|
coreIntroduceLetterMapper.updateById(introduceLetter);
|
|
|
coreIntroduceLetterMapper.deleteUserList(introduceLetter.getId());
|
|
|
@@ -379,8 +386,8 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
coreIntroduceLetterMapper.deleteToOrgList(introduceLetter.getId());
|
|
|
coreIntroduceLetterMapper.saveToOrgList(toOrgList);
|
|
|
//删除审核信息
|
|
|
- coreIntroduceLetterMapper.deleteCheckLogs(introduceLetter.getId());
|
|
|
- coreIntroduceLetterMapper.saveCheckLogs(checkLogs);
|
|
|
+// coreIntroduceLetterMapper.deleteCheckLogs(introduceLetter.getId());
|
|
|
+// coreIntroduceLetterMapper.saveCheckLogs(checkLogs);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -418,34 +425,151 @@ public class CoreIntroduceLetterServiceImpl extends ServiceImpl<CoreIntroduceLet
|
|
|
* 定时任务修改 出入申请状态
|
|
|
*/
|
|
|
@Override
|
|
|
- public void timedTaskUpdateLetterStatus() {
|
|
|
- final LambdaQueryWrapper<CoreIntroduceLetter> oqw = new LambdaQueryWrapper<CoreIntroduceLetter>();
|
|
|
- oqw.ne(CoreIntroduceLetter::getStatus, 2).eq(CoreIntroduceLetter::getDeleted, 0);
|
|
|
- List<CoreIntroduceLetter> coreIntroduceLetters = coreIntroduceLetterMapper.selectList(oqw);
|
|
|
+ public void timedTaskUpdateOutInRequestStatus() {
|
|
|
+
|
|
|
+ final LambdaQueryWrapper<CoreIntroduceLetter> oqwletter = new LambdaQueryWrapper<CoreIntroduceLetter>();
|
|
|
+ oqwletter.ne(CoreIntroduceLetter::getStatus, 2).eq(CoreIntroduceLetter::getDeleted, 0);
|
|
|
+ List<CoreIntroduceLetter> coreIntroduceLetters = coreIntroduceLetterMapper.selectList(oqwletter);
|
|
|
List<CoreIntroduceLetter> overdueLettersList = new ArrayList<>();
|
|
|
- List<CoreIntroduceLetterApproveLog> approveLogs = new ArrayList<>();
|
|
|
if (ObjectUtil.isNotEmpty(coreIntroduceLetters)) {
|
|
|
Date currentDate = DateUtil.beginOfDay(new Date());
|
|
|
-
|
|
|
coreIntroduceLetters.stream().forEach(x -> {
|
|
|
final int result = currentDate.compareTo(x.getEndTime());
|
|
|
if (result > 0) {
|
|
|
x.setStatus(2);
|
|
|
overdueLettersList.add(x);
|
|
|
- CoreIntroduceLetterApproveLog approveLog = new CoreIntroduceLetterApproveLog();
|
|
|
- approveLog.setLetterId(x.getId());
|
|
|
- approveLog.setApproveStatus(3);
|
|
|
- approveLogs.add(approveLog);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- if (ObjectUtil.isNotEmpty(overdueLettersList)) {
|
|
|
- approveLogs.forEach(x -> {
|
|
|
- coreIntroduceLetterMapper.updateApproveLogStatus(x);
|
|
|
+ // 将介绍信过期的设置为 已过期状态
|
|
|
+ saveOrUpdateBatch(overdueLettersList);
|
|
|
+
|
|
|
+ final LambdaQueryWrapper<CoreIntroduceLetterOutInRequest> oqw = new LambdaQueryWrapper<CoreIntroduceLetterOutInRequest>();
|
|
|
+ oqw.eq(CoreIntroduceLetterOutInRequest::getApproveStatus, 0).eq(CoreIntroduceLetterOutInRequest::getDeleted, 0);
|
|
|
+ List<CoreIntroduceLetterOutInRequest> outInRequestList = outInRequestMapper.selectList(oqw);
|
|
|
+ List<CoreIntroduceLetterOutInRequest> overdueOutInRequestList = new ArrayList<>();
|
|
|
+ Date currentDate = DateUtil.beginOfDay(new Date());
|
|
|
+ if (ObjectUtil.isNotEmpty(outInRequestList)) {
|
|
|
+ outInRequestList.stream().forEach(x -> {
|
|
|
+ // 出入申请当天有效
|
|
|
+ final int result = currentDate.compareTo(x.getCreateTime());
|
|
|
+ if (result > 0) {
|
|
|
+ x.setApproveStatus(3);
|
|
|
+ overdueOutInRequestList.add(x);
|
|
|
+ }
|
|
|
});
|
|
|
- // 批量修改需要修改连接字符串添加 &allowMultiQueries=true
|
|
|
- //coreIntroduceLetterMapper.batchUpdateApproveLogStatus(approveLogs);
|
|
|
- saveOrUpdateBatch(overdueLettersList);
|
|
|
}
|
|
|
+
|
|
|
+ // 将出入申请设置为已失效状态
|
|
|
+ if (ObjectUtil.isNotEmpty(overdueOutInRequestList)) {
|
|
|
+ coreIntroduceLetterMapper.batchUpdateOutInRequestStatus(overdueOutInRequestList);
|
|
|
+ }
|
|
|
+
|
|
|
+ final LambdaQueryWrapper<CoreOutInRecord> oqw1 = new LambdaQueryWrapper<CoreOutInRecord>();
|
|
|
+ oqw1.notIn(CoreOutInRecord::getStatus, 2,3)
|
|
|
+ .isNull(CoreOutInRecord::getDepartureTime)
|
|
|
+ .le(CoreOutInRecord::getOutInRequestEffectiveEndTime,currentDate);
|
|
|
+ List<CoreOutInRecord> outInRecords = coreOutInRecordMapper.selectList(oqw1);
|
|
|
+ outInRecords.stream().forEach(x->x.setStatus(3));
|
|
|
+
|
|
|
+ // 将出入记录设置为已失效状态
|
|
|
+ coreOutInRecordMapper.batchUpdateCoreOutInRecordStatus(outInRecords);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void insertOutInRequest(CoreIntroduceLetterAddOutInRequestDto outInRequestDto) {
|
|
|
+
|
|
|
+// SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
|
|
|
+
|
|
|
+ CoreIntroduceLetterInfoVo coreIntroduceLetterVo = coreIntroduceLetterMapper.selectOneById(outInRequestDto.getId());
|
|
|
+ List<CoreIntroduceLetterInfoVo> list = new ArrayList<>();
|
|
|
+ list.add(coreIntroduceLetterVo);
|
|
|
+ List<CoreIntroduceLetterUserAddDto> letterUserList = coreIntroduceLetterMapper.findUserList(list);
|
|
|
+
|
|
|
+ Date date = new Date();
|
|
|
+ CoreIntroduceLetterOutInRequest outInRequest = new CoreIntroduceLetterOutInRequest();
|
|
|
+// BeanHelper.copyProperties(outInRequest, coreIntroduceLetterVo);
|
|
|
+ outInRequest.setId(IdWorker.getId());
|
|
|
+ outInRequest.setLetterId(coreIntroduceLetterVo.getId());
|
|
|
+ outInRequest.setLetterNo(coreIntroduceLetterVo.getLetterNo());
|
|
|
+ outInRequest.setLetterName(coreIntroduceLetterVo.getLetterName());
|
|
|
+ outInRequest.setLetterDescription(coreIntroduceLetterVo.getDescription());
|
|
|
+ outInRequest.setLetterType(coreIntroduceLetterVo.getType());
|
|
|
+ outInRequest.setLetterReasons(coreIntroduceLetterVo.getReasons());
|
|
|
+ outInRequest.setLetterFile(coreIntroduceLetterVo.getLetterFileStr());
|
|
|
+ outInRequest.setStartTime(coreIntroduceLetterVo.getStartTime());
|
|
|
+ outInRequest.setEndTime(coreIntroduceLetterVo.getEndTime());
|
|
|
+ outInRequest.setEffectiveDays(coreIntroduceLetterVo.getEffectiveDays());
|
|
|
+
|
|
|
+
|
|
|
+ outInRequest.setDeleted(0);
|
|
|
+ outInRequest.setApproveStatus(0);
|
|
|
+ outInRequest.setCreateTime(date);
|
|
|
+ outInRequest.setCreateBy(SecurityUtils.getUsername());
|
|
|
+ outInRequest.setOrgId(SecurityUtils.getLoginUser().getOrgId());
|
|
|
+
|
|
|
+ //封装人员信息
|
|
|
+// List<CoreIntroduceLetterUserAddDto> userAddVoList = outInRequestDto.getUserInfos();
|
|
|
+ List<CoreIntroduceLetterOutInRequestUser> outInRequestUserList = new ArrayList<>();
|
|
|
+ List<CoreOutInRecord> outInRecordList = new ArrayList<>();
|
|
|
+ outInRequestDto.getUserInfos().forEach(r -> {
|
|
|
+ CoreIntroduceLetterOutInRequestUser user = new CoreIntroduceLetterOutInRequestUser();
|
|
|
+ final Optional<CoreIntroduceLetterUserAddDto> first = letterUserList.stream().filter(x -> ObjectUtil.equal(x.getId(), r.getId())).findFirst();
|
|
|
+ if(first.isPresent())
|
|
|
+ {
|
|
|
+ BeanHelper.copyProperties(user, first.get());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ BeanHelper.copyProperties(user, r);
|
|
|
+ }
|
|
|
+
|
|
|
+ user.setId(IdWorker.getId());
|
|
|
+ user.setOutInRequestId(outInRequest.getId());
|
|
|
+ user.setCreateTime(date);
|
|
|
+ user.setCreateBy(SecurityUtils.getUsername());
|
|
|
+ outInRequestUserList.add(user);
|
|
|
+
|
|
|
+ CoreOutInRecord coreOutInRecord=new CoreOutInRecord();
|
|
|
+ coreOutInRecord.setId(IdWorker.getId());
|
|
|
+ coreOutInRecord.setOutInRequestId(outInRequest.getId());
|
|
|
+ coreOutInRecord.setOutInRequestUserId(user.getId());
|
|
|
+ coreOutInRecord.setOrgId(SecurityUtils.getLoginUser().getOrgId());
|
|
|
+ coreOutInRecord.setStatus(0);
|
|
|
+ coreOutInRecord.setOutInRequestEffectiveStartTime(date);
|
|
|
+ coreOutInRecord.setOutInRequestEffectiveEndTime(DateUtil.endOfDay(date));
|
|
|
+ coreOutInRecord.setCreateTime(DateUtils.getNowDate());
|
|
|
+ coreOutInRecord.setCreateBy(SecurityUtils.getUsername());
|
|
|
+
|
|
|
+ outInRecordList.add(coreOutInRecord);
|
|
|
+ });
|
|
|
+
|
|
|
+ outInRequestMapper.insert(outInRequest);
|
|
|
+ coreIntroduceLetterMapper.saveOutInRequestUserList(outInRequestUserList);
|
|
|
+ coreOutInRecordMapper.saveOutInRecordList(outInRecordList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CoreIntroduceLetterOutInRequestVo selectOutInRequestInfoById(Long id) {
|
|
|
+ //获取介绍信信息
|
|
|
+ CoreIntroduceLetterOutInRequestVo coreIntroduceLetterVo = coreIntroduceLetterMapper.selectOneOutInRequestById(id);
|
|
|
+ coreIntroduceLetterVo.setLetterFile(ObjectUtil.isNotEmpty(coreIntroduceLetterVo.getLetterFileStr()) ? JSON.parseArray(coreIntroduceLetterVo.getLetterFileStr(), String.class) : null);
|
|
|
+ coreIntroduceLetterVo.setStartTimeStr(coreIntroduceLetterVo.getStartTime());
|
|
|
+ coreIntroduceLetterVo.setEndTimeStr(coreIntroduceLetterVo.getEndTime());
|
|
|
+ //获取机构信息
|
|
|
+ SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
|
|
|
+ coreIntroduceLetterVo.setReceptionOrgNames(sysOrg.getShortName());
|
|
|
+
|
|
|
+ //获取人员信息
|
|
|
+ final LambdaQueryWrapper<CoreIntroduceLetterOutInRequestUser> oqw = new LambdaQueryWrapper<CoreIntroduceLetterOutInRequestUser>();
|
|
|
+ oqw.eq(CoreIntroduceLetterOutInRequestUser::getOutInRequestId, id);
|
|
|
+ List<CoreIntroduceLetterOutInRequestUser> userList = outInRequestUserMapper.selectList(oqw);
|
|
|
+ if (CollectionUtils.isNotEmpty(userList)) {
|
|
|
+ coreIntroduceLetterVo.setUserInfos(userList);
|
|
|
+ }
|
|
|
+ return coreIntroduceLetterVo;
|
|
|
}
|
|
|
}
|