|
|
@ -2,6 +2,7 @@ package com.glxp.api.controller.trace;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
|
@ -9,7 +10,9 @@ import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
import com.glxp.api.entity.basic.UdiEntity;
|
|
|
|
import com.glxp.api.entity.basic.UdiEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.sup.UserCompanyEntity;
|
|
|
|
import com.glxp.api.entity.trace.TraceOrderEntity;
|
|
|
|
import com.glxp.api.entity.trace.TraceOrderEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.trace.TraceProductDetailEntity;
|
|
|
|
import com.glxp.api.entity.trace.TraceTaskNoticeEntity;
|
|
|
|
import com.glxp.api.entity.trace.TraceTaskNoticeEntity;
|
|
|
|
import com.glxp.api.req.trace.TraceOrderDetailRequest;
|
|
|
|
import com.glxp.api.req.trace.TraceOrderDetailRequest;
|
|
|
|
import com.glxp.api.req.trace.TraceOrderRequest;
|
|
|
|
import com.glxp.api.req.trace.TraceOrderRequest;
|
|
|
@ -18,8 +21,11 @@ import com.glxp.api.req.trace.TraceRecordRequest;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
import com.glxp.api.res.trace.TraceOrderResponse;
|
|
|
|
import com.glxp.api.res.trace.TraceOrderResponse;
|
|
|
|
import com.glxp.api.res.trace.TraceRecordResponse;
|
|
|
|
import com.glxp.api.res.trace.TraceRecordResponse;
|
|
|
|
|
|
|
|
import com.glxp.api.service.sup.UserCompanyService;
|
|
|
|
import com.glxp.api.service.trace.TraceOrderService;
|
|
|
|
import com.glxp.api.service.trace.TraceOrderService;
|
|
|
|
|
|
|
|
import com.glxp.api.service.trace.TraceProductDetailService;
|
|
|
|
import com.glxp.api.service.trace.TraceTaskNoticeService;
|
|
|
|
import com.glxp.api.service.trace.TraceTaskNoticeService;
|
|
|
|
|
|
|
|
import com.glxp.api.service.trace.UdiTraceService;
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@ -80,6 +86,12 @@ public class TraceOrderController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
TraceTaskNoticeService traceTaskNoticeService;
|
|
|
|
TraceTaskNoticeService traceTaskNoticeService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
UserCompanyService userCompanyService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
UdiTraceService udiTraceService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
TraceProductDetailService traceProductDetailService;
|
|
|
|
|
|
|
|
|
|
|
|
//客户端单据信息上传接口
|
|
|
|
//客户端单据信息上传接口
|
|
|
|
@ApiOperation(value = "客户端单据信息上传接口", response = BaseResponse.class)
|
|
|
|
@ApiOperation(value = "客户端单据信息上传接口", response = BaseResponse.class)
|
|
|
@ -100,7 +112,26 @@ public class TraceOrderController extends BaseController {
|
|
|
|
taskNoticeEntity.setStatus(3);
|
|
|
|
taskNoticeEntity.setStatus(3);
|
|
|
|
taskNoticeEntity.setUpdateTime(new Date());
|
|
|
|
taskNoticeEntity.setUpdateTime(new Date());
|
|
|
|
traceTaskNoticeService.updateById(taskNoticeEntity);
|
|
|
|
traceTaskNoticeService.updateById(taskNoticeEntity);
|
|
|
|
System.out.println("成功");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 推送下一家企业
|
|
|
|
|
|
|
|
UserCompanyEntity userCompanyEntity = userCompanyService.getById(traceOrderEntity.getCompanyIdFk());
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success("成功");
|
|
|
|
return ResultVOUtils.success("成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|