|
|
|
@ -102,6 +102,9 @@ public class TraceOrderController extends BaseController {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceOrderUploadRequest.getTaskId());
|
|
|
|
|
if (taskNoticeEntity == null) {
|
|
|
|
|
return ResultVOUtils.error(500, "任务已过期!");
|
|
|
|
|
}
|
|
|
|
|
TraceOrderEntity traceOrderEntity = new TraceOrderEntity();
|
|
|
|
|
BeanUtils.copyProperties(traceOrderUploadRequest, traceOrderEntity);
|
|
|
|
|
traceOrderEntity.setCompanyIdFk(taskNoticeEntity.getCompanyIdFk());
|
|
|
|
@ -119,16 +122,21 @@ public class TraceOrderController extends BaseController {
|
|
|
|
|
if (StrUtil.isNotEmpty(traceOrderEntity.getToCorpCreditNum()) &&
|
|
|
|
|
!traceOrderEntity.getToCorpCreditNum().equals(userCompanyEntity.getCreditNum())) {
|
|
|
|
|
UserCompanyEntity toUserCompanyEntity = userCompanyService.getOne(new QueryWrapper<UserCompanyEntity>().eq("creditNum", traceOrderEntity.getToCorpCreditNum()), false);
|
|
|
|
|
TraceTaskNoticeEntity nextNotity = traceTaskNoticeService.findTask(2, traceOrderEntity.getTraceProductIdFk(), toUserCompanyEntity.getId());
|
|
|
|
|
if (nextNotity == null) {
|
|
|
|
|
TraceProductDetailEntity traceProductDetailEntity = traceProductDetailService.getById(traceOrderEntity.getTraceProductIdFk());
|
|
|
|
|
nextNotity = udiTraceService.createTraceNotice(2, traceProductDetailEntity, toUserCompanyEntity.getId());
|
|
|
|
|
udiTraceService.pushDelayExpireTask(nextNotity);
|
|
|
|
|
udiTraceService.pushMq(nextNotity, toUserCompanyEntity.getId());
|
|
|
|
|
} else if (nextNotity.getStatus() == 4) {
|
|
|
|
|
//任务超时未处理,重新推送消息
|
|
|
|
|
udiTraceService.pushMq(nextNotity, toUserCompanyEntity.getId());
|
|
|
|
|
if (toUserCompanyEntity != null) {
|
|
|
|
|
TraceTaskNoticeEntity nextNotity = traceTaskNoticeService.findTask(2, traceOrderEntity.getTraceProductIdFk(), toUserCompanyEntity.getId());
|
|
|
|
|
if (nextNotity == null) {
|
|
|
|
|
TraceProductDetailEntity traceProductDetailEntity = traceProductDetailService.getById(traceOrderEntity.getTraceProductIdFk());
|
|
|
|
|
nextNotity = udiTraceService.createTraceNotice(2, traceProductDetailEntity, toUserCompanyEntity.getId());
|
|
|
|
|
udiTraceService.pushDelayExpireTask(nextNotity);
|
|
|
|
|
udiTraceService.pushMq(nextNotity, toUserCompanyEntity.getId());
|
|
|
|
|
} else if (nextNotity.getStatus() == 4) {
|
|
|
|
|
//任务超时未处理,重新推送消息
|
|
|
|
|
udiTraceService.pushMq(nextNotity, toUserCompanyEntity.getId());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.error("未找到下一家企业");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|