Commit 644322ff authored by chenyuxi's avatar chenyuxi

feat: 瓜子交互任务加个推送中

parent 071dbd33
......@@ -69,13 +69,13 @@ public class TGzPushEntry extends BaseEntity {
@Schema(description = "交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)")
private String taskType;
/**
* 推送状态(0:推送成功1:推送失败2:待推送)
* 推送状态(0:推送成功1:推送失败2:待推送3 推送中
*/
@ExcelAttribute(name = "推送状态(0:推送成功1:推送失败2:待推送)", isNotEmpty = true, errorInfo = "推送状态(0:推送成功1:推送失败2:待推送)不能为空", maxLength = 1)
@NotBlank(message = "推送状态(0:推送成功1:推送失败2:待推送)不能为空")
@Length(max = 1, message = "推送状态(0:推送成功1:推送失败2:待推送)不能超过1个字符")
@ExcelProperty("推送状态(0:推送成功1:推送失败2:待推送)")
@Schema(description = "推送状态(0:推送成功1:推送失败2:待推送)")
@Schema(description = "推送状态(0:推送成功1:推送失败2:待推送3 推送中)")
private String pushStatus;
/**
* 推送时间
......
......@@ -89,7 +89,12 @@ public class TGzPushEntryServiceImpl extends ServiceImpl<TGzPushEntryMapper, TGz
return R.failed(CommonConstants.ERROR_NO_DOMAIN);
}
// 先改为推送中
findInfo.setPushStatus(CommonConstants.THREE_STRING);
findInfo.setUpdateBy(user.getId());
findInfo.setUpdateTime(LocalDateTime.now());
this.updateById(tGzPushEntry);
// 改为异步处理
doJointTask.handleGzPushEntry(findInfo);
......@@ -114,11 +119,11 @@ public class TGzPushEntryServiceImpl extends ServiceImpl<TGzPushEntryMapper, TGz
tGzPushEntry.setDelFlag(CommonConstants.NOT_DELETE_FLAG);
this.save(tGzPushEntry);
// 除了本次任务,获取是否有【推送失败、待推送】的任务,有的话本次不推送,存为“待推送”就结束
// 除了本次任务,获取是否有【推送失败、待推送、推送中】的任务,有的话本次不推送,存为“待推送”就结束
TGzPushEntry findBizFailInfo = this.getOne(Wrappers.<TGzPushEntry>query().lambda()
.eq(TGzPushEntry::getBizId, tGzPushEntry.getBizId())
.ne(TGzPushEntry::getId, tGzPushEntry.getId())
.in(TGzPushEntry::getPushStatus, CommonConstants.ONE_STRING, CommonConstants.TWO_STRING)
.in(TGzPushEntry::getPushStatus, CommonConstants.ONE_STRING, CommonConstants.TWO_STRING, CommonConstants.THREE_STRING)
.eq(TGzPushEntry::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(findBizFailInfo)) {
......
......@@ -80,6 +80,11 @@ public class TGzPushHandleServiceImpl implements TGzPushHandleService {
@Override
public void handlePushEntry(TGzPushEntry tGzPushEntry) {
// 先改为推送中
tGzPushEntry.setPushStatus(CommonConstants.THREE_STRING);
tGzPushEntry.setUpdateTime(LocalDateTime.now());
tGzPushEntryService.updateById(tGzPushEntry);
// 判断推送任务: 如果任务类型是改状态的,直接获取任务记录里的数据推送
if (ArrayUtils.contains(taskTypeArr, tGzPushEntry.getTaskType())) {
// 状态推送任务
......@@ -98,7 +103,6 @@ public class TGzPushHandleServiceImpl implements TGzPushHandleService {
}
tGzPushEntry.setUpdateTime(LocalDateTime.now());
tGzPushEntryService.updateById(tGzPushEntry);
// 如果推送结果是成功,再获取【同一个流程ID最早一个未推送状态的数据】进行推送,
......@@ -125,6 +129,12 @@ public class TGzPushHandleServiceImpl implements TGzPushHandleService {
if (Common.isEmpty(findWaitInfo)) {
return;
}
// 先改为推送中
findWaitInfo.setPushStatus(CommonConstants.THREE_STRING);
findWaitInfo.setUpdateTime(LocalDateTime.now());
tGzPushEntryService.updateById(findWaitInfo);
// 如果任务类型是改状态的,直接获取任务记录里的数据推送
if (ArrayUtils.contains(taskTypeArr, findWaitInfo.getTaskType())) {
// 更新推送信息
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment