|
@@ -34,14 +34,7 @@ import com.abi.qms.platform.dao.mapper.QrPackageMapper;
|
|
|
import com.abi.qms.platform.dao.mapper.QrPackageSapOrderItemMapper;
|
|
|
import com.abi.qms.platform.dao.mapper.QrRepertoryColumnMapper;
|
|
|
import com.abi.qms.platform.dao.tablestore.entity.QrCode;
|
|
|
-import com.abi.qms.platform.dao.vo.result.PackageActiveVO;
|
|
|
-import com.abi.qms.platform.dao.vo.result.QrBoxMappingVO;
|
|
|
-import com.abi.qms.platform.dao.vo.result.QrPackageBatchVO;
|
|
|
-import com.abi.qms.platform.dao.vo.result.QrPackageDownloadRecordVO;
|
|
|
-import com.abi.qms.platform.dao.vo.result.QrPackageVO;
|
|
|
-import com.abi.qms.platform.dao.vo.result.QrPackageWxVO;
|
|
|
-import com.abi.qms.platform.dao.vo.result.QrSingleCheckVO;
|
|
|
-import com.abi.qms.platform.dao.vo.result.WxQrPackageDetailVO;
|
|
|
+import com.abi.qms.platform.dao.vo.result.*;
|
|
|
import com.abi.qms.platform.dto.req.DeleteQrPackageReq;
|
|
|
import com.abi.qms.platform.dto.req.DownloadQrPackageReq;
|
|
|
import com.abi.qms.platform.dto.req.GetPackageCodeReq;
|
|
@@ -69,10 +62,7 @@ import com.abi.qms.platform.dto.res.WxQrPackageDetailRes;
|
|
|
import com.abi.qms.platform.infrastructure.constant.RedisKey;
|
|
|
import com.abi.qms.platform.infrastructure.event.CodePackageCreateEvent;
|
|
|
import com.abi.qms.platform.infrastructure.util.*;
|
|
|
-import com.abi.qms.platform.service.FactoryService;
|
|
|
-import com.abi.qms.platform.service.MaterialService;
|
|
|
-import com.abi.qms.platform.service.QrPackageBookingOrderService;
|
|
|
-import com.abi.qms.platform.service.QrPackageService;
|
|
|
+import com.abi.qms.platform.service.*;
|
|
|
import com.abi.task.common.api.exception.BusinessException;
|
|
|
import com.abi.task.common.api.exception.ErrorCodeEnum;
|
|
|
import com.abi.task.common.tablestore.TableStorePlusUtils;
|
|
@@ -182,6 +172,9 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
@Autowired
|
|
|
private ApplicationContext applicationContext;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private QrBoxMappingService qrBoxMappingService;
|
|
|
+
|
|
|
// @Autowired
|
|
|
// private SendMqUtil sendMqUtil;
|
|
|
|
|
@@ -931,6 +924,7 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
//存在活动数据
|
|
|
PackageActiveVO packageActive = baseActiveMapper.getPackageActive(qrSingleCheckVO.getActiveId());
|
|
|
if (!ObjectUtils.isEmpty(packageActive)) {
|
|
|
+ qrSingleCheckVO.setActiveCode(packageActive.getActiveCode());
|
|
|
qrSingleCheckVO.setActiveName(packageActive.getActiveName());
|
|
|
qrSingleCheckVO.setActiveUrl(packageActive.getActiveUrl());
|
|
|
qrSingleCheckVO.setActiveType(packageActive.getActiveType());
|
|
@@ -951,17 +945,20 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
}
|
|
|
|
|
|
//1-查询码关联激活信息单条数据
|
|
|
- QrOneBoxCodeMappingReq qrOneBoxCodeMappingReq = new QrOneBoxCodeMappingReq();
|
|
|
- qrOneBoxCodeMappingReq.setPackageId(qrCode.getPackageId());
|
|
|
- qrOneBoxCodeMappingReq.setQrIndex(qrCode.getCodeIndex());
|
|
|
- QrBoxMappingVO qrBoxMappingVO = qrBoxMappingMapper.getIndexQrBoxCodeMappingOne(qrOneBoxCodeMappingReq);
|
|
|
+ QrBoxMapping indexQrBoxCodeMappingOne = getPackeageActivation(qrCode);
|
|
|
|
|
|
//存在激活关联信息
|
|
|
- if (ObjectUtils.isNotEmpty(qrBoxMappingVO)) {
|
|
|
- qrSingleCheckVO.setBoxCode(qrBoxMappingVO.getBoxCode());//条码序号
|
|
|
- qrSingleCheckVO.setActiveTime(qrBoxMappingVO.getActiveTime());//激活时间
|
|
|
- qrSingleCheckVO.setActiveUserName(qrBoxMappingVO.getActiveUserName());//激活时间
|
|
|
- qrSingleCheckVO.setActiveStatus(qrBoxMappingVO.getActiveStatus());//激活状态
|
|
|
+ if (ObjectUtils.isNotEmpty(indexQrBoxCodeMappingOne)) {
|
|
|
+ qrSingleCheckVO.setBoxCode(indexQrBoxCodeMappingOne.getBoxCode());//条码序号
|
|
|
+ qrSingleCheckVO.setActiveTime(indexQrBoxCodeMappingOne.getActiveTime());//激活时间
|
|
|
+ qrSingleCheckVO.setActiveUserName(indexQrBoxCodeMappingOne.getActiveUserName());//激活时间
|
|
|
+ qrSingleCheckVO.setActiveStatus(indexQrBoxCodeMappingOne.getActiveStatus());//激活状态
|
|
|
+ qrSingleCheckVO.setPackageActiveStatus(indexQrBoxCodeMappingOne.getActiveStatus());//赋值原始状态
|
|
|
+ }
|
|
|
+
|
|
|
+ //满足废除条件
|
|
|
+ if (getPackeageInvalid(req.getQrCode())){
|
|
|
+ qrSingleCheckVO.setPackageActiveStatus(2);//状态重置为废除
|
|
|
}
|
|
|
|
|
|
//转化出参
|
|
@@ -1087,4 +1084,56 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查看码是否作废
|
|
|
+ * @param qrCode 码code
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean getPackeageInvalid(String qrCode) {
|
|
|
+ //调用tablestore查询码信息
|
|
|
+ QrCode qrCodeVo = tableStorePlusUtils.selectOne(QrCode.class, qrCode);
|
|
|
+ AssertUtil.isNull(qrCodeVo, "码数据不存在");
|
|
|
+
|
|
|
+ //码数据是否作废
|
|
|
+ if (qrCodeVo.getInvalid() == 1){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询码包信息
|
|
|
+ QrPackage qrPackage = qrPackageMapper.selectById(qrCodeVo.getPackageId());
|
|
|
+ AssertUtil.isNull(qrPackage, "码包数据不存在");
|
|
|
+
|
|
|
+ //码包数据是否作废
|
|
|
+ if (qrPackage.getInvalid() == 1){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ //关联表是否作废
|
|
|
+ QrBoxMapping qrBoxMapping = getPackeageActivation(qrCodeVo);
|
|
|
+ if (ObjectUtils.isNotEmpty(qrBoxMapping) && qrBoxMapping.getInvalid() == 1){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询码关联激活信息单条数据
|
|
|
+ * @param qrCode code对象
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public QrBoxMapping getPackeageActivation(QrCode qrCode) {
|
|
|
+
|
|
|
+ //查询码关联激活信息单条数据
|
|
|
+ QrOneBoxCodeMappingReq qrOneBoxCodeMappingReq = new QrOneBoxCodeMappingReq();
|
|
|
+ qrOneBoxCodeMappingReq.setPackageId(qrCode.getPackageId());
|
|
|
+ qrOneBoxCodeMappingReq.setQrIndex(qrCode.getCodeIndex());
|
|
|
+ QrBoxMapping qrBoxMapping = qrBoxMappingMapper.getIndexQrBoxCodeMappingOne(qrOneBoxCodeMappingReq);
|
|
|
+
|
|
|
+ return qrBoxMapping;
|
|
|
+ }
|
|
|
}
|