|
@@ -6,27 +6,24 @@ import com.abi.base.foundation.util.RedisClient;
|
|
|
import com.abi.qms.platform.constant.RedisKeysConstant;
|
|
|
import com.abi.qms.platform.dao.entity.*;
|
|
|
import com.abi.qms.platform.dao.enums.*;
|
|
|
-import com.abi.qms.platform.dao.mapper.BaseFactoryMapper;
|
|
|
-import com.abi.qms.platform.dao.mapper.QrPackageBatchMapper;
|
|
|
-import com.abi.qms.platform.dao.mapper.QrPackageDownloadRecordMapper;
|
|
|
-import com.abi.qms.platform.dao.mapper.QrPackageMapper;
|
|
|
-import com.abi.qms.platform.dao.vo.result.QrPackageVO;
|
|
|
+import com.abi.qms.platform.dao.mapper.*;
|
|
|
+import com.abi.qms.platform.dao.tablestore.entity.QrCode;
|
|
|
+import com.abi.qms.platform.dao.vo.result.*;
|
|
|
import com.abi.qms.platform.dto.req.*;
|
|
|
-import com.abi.qms.platform.dto.res.CheckQrPackageRepetitiveRes;
|
|
|
-import com.abi.qms.platform.dto.res.GetQrPackageDetailRes;
|
|
|
-import com.abi.qms.platform.dto.res.ListQrPackageRes;
|
|
|
-import com.abi.qms.platform.dto.res.ValidSAPOrderNoAndMaterialRes;
|
|
|
+import com.abi.qms.platform.dto.res.*;
|
|
|
import com.abi.qms.platform.infrastructure.mq.GenerateCodeConsumer;
|
|
|
import com.abi.qms.platform.infrastructure.util.*;
|
|
|
import com.abi.qms.platform.service.QrPackageService;
|
|
|
import com.abi.task.common.api.exception.BusinessException;
|
|
|
import com.abi.task.common.api.exception.ErrorCodeEnum;
|
|
|
+import com.abi.task.common.tablestore.TableStorePlusUtils;
|
|
|
import com.abi.task.common.utils.PojoConverterUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import freemarker.template.Template;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.amqp.core.AmqpTemplate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -77,6 +74,18 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
@Autowired
|
|
|
private UserUtil userUtil;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TableStorePlusUtils tableStorePlusUtils;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private QrRepertoryColumnMapper repertoryColumnMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private BaseActiveMapper baseActiveMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private QrBoxMappingMapper qrBoxMappingMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 保存码包
|
|
|
*/
|
|
@@ -593,5 +602,63 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public GetQrSingleCheckDetailRes getQrSingleCheckDetail(GetQrSingleCheckDetailCodeReq req) {
|
|
|
+
|
|
|
+ //调用tablestore查询码信息
|
|
|
+ QrCode qrCode = tableStorePlusUtils.selectOne(QrCode.class, req.getQrCode());
|
|
|
+ AssertUtil.isNull(qrCode.getPackageId(), "码数据不存在");
|
|
|
+
|
|
|
+ //1-查询码关联信息
|
|
|
+ QrSingleCheckVO qrSingleCheckVO = qrPackageMapper.getQrSingleCheckDetailById(Long.valueOf(qrCode.getPackageId()));
|
|
|
+ AssertUtil.isNull(qrSingleCheckVO, "码数据不存在");
|
|
|
+
|
|
|
+ //查询是否存在隐形码
|
|
|
+ QrRepertoryColumn qrRepertoryColumn = repertoryColumnMapper.selectById(qrCode.getQrRepertoryColumnId());
|
|
|
+
|
|
|
+ //存在别名(隐形码)
|
|
|
+ if (ObjectUtils.isNotEmpty(qrRepertoryColumn)){
|
|
|
+ qrSingleCheckVO.setAlias(qrRepertoryColumn.getAlias());//隐形码
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询码包对应活动单条数据
|
|
|
+ PackageActiveVO packageActive = baseActiveMapper.getPackageActive(qrCode.getPackageId());
|
|
|
+
|
|
|
+ //存在活动数据
|
|
|
+ if (ObjectUtils.isNotEmpty(packageActive)){
|
|
|
+ qrSingleCheckVO.setActiveName(packageActive.getActiveName());
|
|
|
+ qrSingleCheckVO.setActiveUrl(packageActive.getActiveUrl());
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询批次号id
|
|
|
+ QrOnePackageBatchReq qrOnePackageBatchReq = new QrOnePackageBatchReq();
|
|
|
+ qrOnePackageBatchReq.setPackageId(qrCode.getPackageId());
|
|
|
+ qrOnePackageBatchReq.setBatchNumber(qrCode.getBatchNumberId());
|
|
|
+ QrPackageBatchVO qrPackageBatchOne = qrPackageBatchMapper.getQrPackageBatchOne(qrOnePackageBatchReq);
|
|
|
+
|
|
|
+ //存批次号
|
|
|
+ if (ObjectUtils.isNotEmpty(qrPackageBatchOne)){
|
|
|
+ qrSingleCheckVO.setBatchNumber(qrPackageBatchOne.getBatchNumber());
|
|
|
+ }
|
|
|
+
|
|
|
+ //1-查询码关联激活信息单条数据
|
|
|
+ QrOneBoxCodeMappingReq qrOneBoxCodeMappingReq = new QrOneBoxCodeMappingReq();
|
|
|
+ qrOneBoxCodeMappingReq.setPackageId(qrCode.getPackageId());
|
|
|
+ qrOneBoxCodeMappingReq.setQrIndex(qrCode.getCodeIndex());
|
|
|
+ QrBoxMappingVO qrBoxMappingVO = qrBoxMappingMapper.getIndexQrBoxCodeMappingOne(qrOneBoxCodeMappingReq);
|
|
|
+
|
|
|
+ //存在激活关联信息
|
|
|
+ if (ObjectUtils.isNotEmpty(qrBoxMappingVO)){
|
|
|
+ qrSingleCheckVO.setBoxCode(qrBoxMappingVO.getBoxCode());//条码序号
|
|
|
+ qrSingleCheckVO.setActiveTime(qrBoxMappingVO.getActiveTime());//激活时间
|
|
|
+ qrSingleCheckVO.setActiveUserName(qrBoxMappingVO.getActiveUserName());//激活时间
|
|
|
+ qrSingleCheckVO.setActiveStatus(qrBoxMappingVO.getActiveStatus());//激活状态
|
|
|
+ }
|
|
|
+
|
|
|
+ //转化出参
|
|
|
+ GetQrSingleCheckDetailRes res = PojoConverterUtils.copy(qrSingleCheckVO, GetQrSingleCheckDetailRes.class);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|