|
@@ -8,14 +8,22 @@ import com.abi.qms.platform.dao.enums.InvalidEnum;
|
|
|
import com.abi.qms.platform.dao.mapper.BaseFactoryMapper;
|
|
|
import com.abi.qms.platform.dao.mapper.QrBoxMappingMapper;
|
|
|
import com.abi.qms.platform.dao.tablestore.entity.QrCode;
|
|
|
+import com.abi.qms.platform.dao.vo.result.ActivateDetailVo;
|
|
|
+import com.abi.qms.platform.dao.vo.result.ActivationRecordVO;
|
|
|
import com.abi.qms.platform.dao.vo.result.PrintingDetailVO;
|
|
|
import com.abi.qms.platform.dao.vo.result.QrBoxMappingVO;
|
|
|
import com.abi.qms.platform.dao.vo.result.QueryWxQrBoxMappingDetailsVO;
|
|
|
+import com.abi.qms.platform.dto.req.ActivateDetailReq;
|
|
|
+import com.abi.qms.platform.dto.req.ActivateNowReq;
|
|
|
+import com.abi.qms.platform.dto.req.ActivationRecordReq;
|
|
|
import com.abi.qms.platform.dto.req.ActiveBoxCodeReq;
|
|
|
import com.abi.qms.platform.dto.req.GenerateBarCodeReq;
|
|
|
import com.abi.qms.platform.dto.req.ListQrBoxCodeMappingReq;
|
|
|
import com.abi.qms.platform.dto.req.PrintingDetailReq;
|
|
|
import com.abi.qms.platform.dto.req.QueryWxQrBoxMappingDetailsWxReq;
|
|
|
+import com.abi.qms.platform.dto.req.ReplenishActivationReq;
|
|
|
+import com.abi.qms.platform.dto.res.ActivateDetailRes;
|
|
|
+import com.abi.qms.platform.dto.res.ActivationRecordRes;
|
|
|
import com.abi.qms.platform.dto.res.ListQrBoxCodeMappingRes;
|
|
|
import com.abi.qms.platform.dto.res.PrintingDetailRes;
|
|
|
import com.abi.qms.platform.dto.res.QrBoxCodeUploadRes;
|
|
@@ -213,6 +221,71 @@ public class QrBoxMappingServiceImpl implements QrBoxMappingService {
|
|
|
return PojoConverterUtils.copy(query, QueryWxQrBoxMappingDetailsWxRes.class);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void replenishActivation(ReplenishActivationReq req) {
|
|
|
+
|
|
|
+ QrBoxMapping qrBoxMapping = getActiveQrBoxMapping(req.getBoxCode());
|
|
|
+ qrBoxMapping.setRemark(req.getReason());
|
|
|
+
|
|
|
+ qrBoxMappingMapper.updateById(qrBoxMapping);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ActivationRecordRes getActivationRecord(ActivationRecordReq req) {
|
|
|
+ ActivationRecordRes res = new ActivationRecordRes();
|
|
|
+
|
|
|
+ List<ActivationRecordVO> recordVOList = qrBoxMappingMapper.getActivationRecord(req);
|
|
|
+ List<ActivationRecordRes.ActivationRecordBean> beanList = PojoConverterUtils.copyList(recordVOList, ActivationRecordRes.ActivationRecordBean.class);
|
|
|
+ res.setActivationRecordBeanList(beanList);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void activateNow(ActivateNowReq req) {
|
|
|
+
|
|
|
+ List<String> boxCodeList = req.getBoxCodeList();
|
|
|
+ for (String boxCode : boxCodeList) {
|
|
|
+
|
|
|
+ QrBoxMapping qrBoxMapping = getActiveQrBoxMapping(boxCode);
|
|
|
+ qrBoxMapping.setProductionLineName(req.getProductionLineName());
|
|
|
+ qrBoxMapping.setProductionTime(LocalDateTime.parse(req.getProductionTime()));
|
|
|
+
|
|
|
+ qrBoxMappingMapper.updateById(qrBoxMapping);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ActivateDetailRes getActivateDetail(ActivateDetailReq req) {
|
|
|
+
|
|
|
+ ActivateDetailVo activateDetailVo = qrBoxMappingMapper.getActivateDetail(req.getBoxCode());
|
|
|
+
|
|
|
+ ActivateDetailRes res = PojoConverterUtils.copy(activateDetailVo, ActivateDetailRes.class);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 组装激活公共所需参数
|
|
|
+ *
|
|
|
+ * @param boxCode
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private QrBoxMapping getActiveQrBoxMapping(String boxCode) {
|
|
|
+ QueryWrapper<QrBoxMapping> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("box_code", boxCode);
|
|
|
+ qw.eq("is_delete", 0);
|
|
|
+ QrBoxMapping qrBoxMapping = qrBoxMappingMapper.selectOne(qw);
|
|
|
+ AssertUtil.isNull(qrBoxMapping, "条码序号错误,未找到该条码序号!");
|
|
|
+ qrBoxMapping.setActiveTime(LocalDateTime.now());
|
|
|
+ qrBoxMapping.setActiveStatus(BoxMappingActiveStatusEnum.ACTIVATED.getCode());
|
|
|
+ qrBoxMapping.setActiveUserId(userUtil.getUser().getId());
|
|
|
+ qrBoxMapping.setActiveUserName(userUtil.getUser().getUserName());
|
|
|
+
|
|
|
+ return qrBoxMapping;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 根据主键查询已生成码包位置
|