人员同步失败处理
This commit is contained in:
parent
bca18576bf
commit
d177acd242
@ -25,7 +25,7 @@ public interface IWorkerInfoAuditRecordService extends IService<WorkerInfoAuditR
|
|||||||
|
|
||||||
void editWorkerInfoAuditRecord(WorkerInfoAuditRecord workerInfoAuditRecord);
|
void editWorkerInfoAuditRecord(WorkerInfoAuditRecord workerInfoAuditRecord);
|
||||||
|
|
||||||
Long adoptWorkerInfo(Map<String, Object> map);
|
String adoptWorkerInfo(Map<String, Object> map);
|
||||||
|
|
||||||
void rejectWorkerInfo(Map<String, Object> map);
|
void rejectWorkerInfo(Map<String, Object> map);
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,7 @@ public class WorkerInfoAuditRecordServiceImpl extends ServiceImpl<WorkerInfoAudi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long adoptWorkerInfo(Map<String, Object> map) {
|
public String adoptWorkerInfo(Map<String, Object> map) {
|
||||||
WorkerInfoAuditRecord workerInfoAuditRecord=workerInfoAuditRecordMapper.selectById(MapUtils.getString(map,"id"));
|
WorkerInfoAuditRecord workerInfoAuditRecord=workerInfoAuditRecordMapper.selectById(MapUtils.getString(map,"id"));
|
||||||
if(workerInfoAuditRecord==null){
|
if(workerInfoAuditRecord==null){
|
||||||
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
||||||
@ -125,7 +125,7 @@ public class WorkerInfoAuditRecordServiceImpl extends ServiceImpl<WorkerInfoAudi
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("同步人员信息失败:" + workerInfo.getWorkerName() + e.getMessage());
|
log.error("同步人员信息失败:" + workerInfo.getWorkerName() + e.getMessage());
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
return workerInfoAuditRecord.getId();
|
return workerInfoAuditRecord.getId() + "#" + e.getMessage();
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(workerInfoAuditRecord.getContractInfo())) {
|
if (StringUtils.isNotBlank(workerInfoAuditRecord.getContractInfo())) {
|
||||||
List<WorkerContract> workerContracts = JSONArray.parseArray(workerInfoAuditRecord.getContractInfo(), WorkerContract.class);
|
List<WorkerContract> workerContracts = JSONArray.parseArray(workerInfoAuditRecord.getContractInfo(), WorkerContract.class);
|
||||||
|
|||||||
@ -11,6 +11,9 @@ import com.zhgd.annotation.OperLog;
|
|||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.entity.vo.SafeEducationQuestionAnswerDataVo;
|
import com.zhgd.xmgl.entity.vo.SafeEducationQuestionAnswerDataVo;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||||
import com.zhgd.xmgl.modules.edu.service.ISafeEducationQuestionAnswerService;
|
import com.zhgd.xmgl.modules.edu.service.ISafeEducationQuestionAnswerService;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.*;
|
import com.zhgd.xmgl.modules.worker.entity.*;
|
||||||
import com.zhgd.xmgl.modules.worker.service.IUfaceDevService;
|
import com.zhgd.xmgl.modules.worker.service.IUfaceDevService;
|
||||||
@ -49,6 +52,12 @@ public class XzWorkerInfoAuditRecordController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IWorkerInfoAuditRecordService workerInfoAuditRecordService;
|
private IWorkerInfoAuditRecordService workerInfoAuditRecordService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INoticeService noticeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISystemUserService systemUserService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISafeEducationQuestionAnswerService safeEducationQuestionAnswerService;
|
private ISafeEducationQuestionAnswerService safeEducationQuestionAnswerService;
|
||||||
|
|
||||||
@ -330,12 +339,22 @@ public class XzWorkerInfoAuditRecordController {
|
|||||||
paramMap.put("ufaceDevId", ufaceDevIds);
|
paramMap.put("ufaceDevId", ufaceDevIds);
|
||||||
paramMap.put("accountType", 2);
|
paramMap.put("accountType", 2);
|
||||||
paramMap.put("registerType", 2);
|
paramMap.put("registerType", 2);
|
||||||
Long workerId = workerInfoAuditRecordService.adoptWorkerInfo(paramMap);
|
String workerId = workerInfoAuditRecordService.adoptWorkerInfo(paramMap);
|
||||||
if (workerId != null) {
|
if (workerId != null) {
|
||||||
|
String[] split = workerId.split("#");
|
||||||
LambdaUpdateWrapper<WorkerInfoAuditRecord> wrapper = Wrappers.<WorkerInfoAuditRecord>lambdaUpdate();
|
LambdaUpdateWrapper<WorkerInfoAuditRecord> wrapper = Wrappers.<WorkerInfoAuditRecord>lambdaUpdate();
|
||||||
wrapper.set(WorkerInfoAuditRecord::getAsyncState, 1);
|
wrapper.set(WorkerInfoAuditRecord::getAsyncState, 1);
|
||||||
wrapper.eq(WorkerInfoAuditRecord::getId, workerId);
|
wrapper.eq(WorkerInfoAuditRecord::getId, split[0]);
|
||||||
workerInfoAuditRecordService.update(wrapper);
|
workerInfoAuditRecordService.update(wrapper);
|
||||||
|
List<SystemUser> systemUserList = systemUserService.list(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccountType, 5));
|
||||||
|
systemUserList.addAll(systemUserService.list(Wrappers.<SystemUser>lambdaQuery()
|
||||||
|
.eq(SystemUser::getAccountType, 10)
|
||||||
|
.eq(SystemUser::getSn, paramMap.getString("projectSn"))));
|
||||||
|
List<Long> collect = systemUserList.stream().map(s -> s.getUserId()).collect(Collectors.toList());
|
||||||
|
collect.add(Long.valueOf(paramMap.getString("startUser")));
|
||||||
|
for (Long userId : collect) {
|
||||||
|
noticeService.addUserNotice(userId, "人员同步异常,原因:" + split[1], "人员审批数据同步失败", "1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user