|
|
|
@ -1,18 +1,31 @@
|
|
|
|
|
package com.glxp.api.controller.trace;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.config.rabbit.TopicRabbitConfig;
|
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.entity.trace.TraceManuOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.trace.TraceOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.trace.TraceRecordLogEntity;
|
|
|
|
|
import com.glxp.api.req.trace.TraceRecordRequest;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.trace.TraceRecordResponse;
|
|
|
|
|
import com.glxp.api.res.trace.TraceSearchReponse;
|
|
|
|
|
import com.glxp.api.service.trace.TraceManuOrderService;
|
|
|
|
|
import com.glxp.api.service.trace.TraceOrderService;
|
|
|
|
|
import com.glxp.api.service.trace.TraceRecordService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
|
|
import org.bouncycastle.util.encoders.UTF8;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
|
|
|
@ -27,6 +40,11 @@ public class TraceRecordController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
TraceRecordService traceRecordService;
|
|
|
|
|
@Resource
|
|
|
|
|
TraceOrderService traceOrderService;
|
|
|
|
|
@Resource
|
|
|
|
|
TraceManuOrderService traceManuOrderService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询记录搜索
|
|
|
|
|
@ApiOperation(value = "追溯查询记录搜索", response = TraceRecordResponse.class)
|
|
|
|
@ -43,4 +61,23 @@ public class TraceRecordController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "追溯查询记录结果", response = TraceRecordResponse.class)
|
|
|
|
|
@AuthRuleAnnotation("udi/trace/record/result")
|
|
|
|
|
@GetMapping("udi/trace/record/result")
|
|
|
|
|
public BaseResponse getTraceResult(TraceRecordRequest traceRecordRequest) {
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(traceRecordRequest.getRecordCode())) {
|
|
|
|
|
TraceRecordLogEntity traceRecordLogEntity = traceRecordService.getOne(new QueryWrapper<TraceRecordLogEntity>().eq("recordCode", traceRecordRequest.getRecordCode()));
|
|
|
|
|
List<TraceOrderEntity> traceOrderEntities = traceOrderService.findByProductIdFk(traceRecordLogEntity.getTraceProductIdFk());
|
|
|
|
|
List<TraceManuOrderEntity> traceManuOrderEntities = traceManuOrderService.list(new QueryWrapper<TraceManuOrderEntity>().eq("traceProductIdFk", traceRecordLogEntity.getTraceProductIdFk()));
|
|
|
|
|
TraceSearchReponse traceSearchReponse = new TraceSearchReponse();
|
|
|
|
|
traceSearchReponse.setTraceOrderEntities(traceOrderEntities);
|
|
|
|
|
traceSearchReponse.setTraceManuOrderEntities(traceManuOrderEntities);
|
|
|
|
|
traceSearchReponse.setTraceRecordLogEntity(traceRecordLogEntity);
|
|
|
|
|
return ResultVOUtils.success(traceSearchReponse);
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "查询记录号不能为空!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|