|
@@ -11,6 +11,14 @@ import com.abi.qms.platform.dao.entity.QrRepertoryColumn;
|
|
|
import com.abi.qms.platform.dao.entity.UserInfo;
|
|
|
import com.abi.qms.platform.dao.enums.*;
|
|
|
import com.abi.qms.platform.dao.mapper.*;
|
|
|
+import com.abi.qms.platform.dao.entity.*;
|
|
|
+import com.abi.qms.platform.dao.enums.FactoryLevelEnum;
|
|
|
+import com.abi.qms.platform.dao.enums.FactoryTypeEnum;
|
|
|
+import com.abi.qms.platform.dao.enums.InvalidEnum;
|
|
|
+import com.abi.qms.platform.dao.enums.QrPackageApplyStatusEnum;
|
|
|
+import com.abi.qms.platform.dao.enums.QrPackageGenerateStatusEnum;
|
|
|
+import com.abi.qms.platform.dao.enums.QrRepertoryTypeEnum;
|
|
|
+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.*;
|
|
@@ -36,6 +44,7 @@ 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 org.apache.commons.collections.CollectionUtils;
|
|
|
import freemarker.template.Template;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
@@ -111,6 +120,9 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
|
|
|
@Autowired
|
|
|
private BaseMaterialMapper baseMaterialMapper;
|
|
|
+ @Autowired
|
|
|
+ private BaseBrandMapper baseBrandMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 保存码包
|
|
|
*/
|
|
@@ -413,7 +425,53 @@ public class QrPackageServiceImpl implements QrPackageService {
|
|
|
QrPackageVO qrPackage = qrPackageMapper.selectQrPackageDetailById(req.getId());
|
|
|
AssertUtil.isNull(qrPackage, "码包不存在");
|
|
|
|
|
|
- return PojoConverterUtils.copy(qrPackage, GetQrPackageDetailRes.class);
|
|
|
+ //转化出参
|
|
|
+ GetQrPackageDetailRes res = PojoConverterUtils.copy(qrPackage, GetQrPackageDetailRes.class);
|
|
|
+
|
|
|
+ //查询码包对应活动单条数据
|
|
|
+ PackageActiveVO packageActive = baseActiveMapper.getPackageActive(qrPackage.getId());
|
|
|
+
|
|
|
+ //存在活动数据
|
|
|
+ if (ObjectUtils.isNotEmpty(packageActive)) {
|
|
|
+ getBrandCodeName(res,packageActive);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 活动详情封装出参,显示品牌名称
|
|
|
+ * @param res
|
|
|
+ * @param packageActive
|
|
|
+ */
|
|
|
+ private void getBrandCodeName(GetQrPackageDetailRes res,PackageActiveVO packageActive){
|
|
|
+
|
|
|
+ res.setActiveCode(packageActive.getActiveCode());
|
|
|
+ res.setActiveName(packageActive.getActiveName());
|
|
|
+ res.setActiveUrl(packageActive.getActiveUrl());
|
|
|
+ res.setActiveType(packageActive.getActiveType());
|
|
|
+ res.setBeginTime(packageActive.getBeginTime());
|
|
|
+ res.setEndTime(packageActive.getEndTime());
|
|
|
+ //多品牌名称
|
|
|
+ StringBuffer brandNames = new StringBuffer();
|
|
|
+ //查询品牌一级列表
|
|
|
+ QueryWrapper<BaseBrand> baseBrandQW = new QueryWrapper<>();
|
|
|
+ baseBrandQW.eq("brand_level",1);
|
|
|
+ List<BaseBrand> baseBrands = baseBrandMapper.selectList(baseBrandQW);
|
|
|
+ Map<String, String> brandCodeMap = baseBrands.stream().collect(Collectors.toMap(BaseBrand::getBrandCode, BaseBrand::getBrandName));
|
|
|
+
|
|
|
+ //品牌名称获取
|
|
|
+ String[] brandCodeArray = packageActive.getBrandCode().split(",");
|
|
|
+ for (String brandCode : brandCodeArray) {
|
|
|
+ String codeName = brandCodeMap.get(brandCode);
|
|
|
+ if (StringUtils.isNotBlank(codeName)) {
|
|
|
+ brandNames.append(codeName).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (brandNames.length()>0){
|
|
|
+ brandNames.deleteCharAt(brandNames.length()-1);
|
|
|
+ res.setBrandNames(brandNames.toString());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|