|
@@ -7,13 +7,11 @@ import com.abi.qms.platform.dao.enums.ActiveModifyTypeEnum;
|
|
|
import com.abi.qms.platform.dao.enums.QrPackageApplyStatusEnum;
|
|
|
import com.abi.qms.platform.dao.enums.ValidEnum;
|
|
|
import com.abi.qms.platform.dao.mapper.*;
|
|
|
+import com.abi.qms.platform.dao.vo.result.ActiveModifyApplyPackageVO;
|
|
|
import com.abi.qms.platform.dao.vo.result.ActivePackageVO;
|
|
|
import com.abi.qms.platform.dao.vo.result.PackageActiveSearchVO;
|
|
|
import com.abi.qms.platform.dto.req.*;
|
|
|
-import com.abi.qms.platform.dto.res.GetActiveRes;
|
|
|
-import com.abi.qms.platform.dto.res.ListActivePackageAddRes;
|
|
|
-import com.abi.qms.platform.dto.res.ListActivePackageRes;
|
|
|
-import com.abi.qms.platform.dto.res.ListActiveRes;
|
|
|
+import com.abi.qms.platform.dto.res.*;
|
|
|
import com.abi.qms.platform.infrastructure.util.AssertUtil;
|
|
|
import com.abi.qms.platform.infrastructure.util.PageUtil;
|
|
|
import com.abi.qms.platform.infrastructure.util.UserUtil;
|
|
@@ -246,6 +244,64 @@ public class ActiveServiceImpl implements ActiveService {
|
|
|
return listActivePackageRes;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public GetActiveModifyApplyRes getActiveModifyApplyRes(GetActiveModifyApplyReq req) {
|
|
|
+ //1-查询活动对象
|
|
|
+ BaseActive active = baseActiveMapper.selectById(req.getId());
|
|
|
+ AssertUtil.isNull(active, "活动不存在");
|
|
|
+
|
|
|
+ //查询码活动申请单
|
|
|
+ QueryWrapper<BaseActiveModifyApply> activeModifyApplyQW = new QueryWrapper<>();
|
|
|
+ activeModifyApplyQW.eq("active_id", req.getId());
|
|
|
+ activeModifyApplyQW.eq("is_delete", 0);
|
|
|
+ BaseActiveModifyApply activeModifyApply = baseActiveModifyApplyMapper.selectOne(activeModifyApplyQW);
|
|
|
+ AssertUtil.isNull(activeModifyApply,"码活动申请单不存在");
|
|
|
+
|
|
|
+ GetActiveModifyApplyRes res = new GetActiveModifyApplyRes();
|
|
|
+
|
|
|
+ //转化出参
|
|
|
+ GetActiveModifyApplyRes.Active resActive = PojoConverterUtils.copy(active, GetActiveModifyApplyRes.Active.class);
|
|
|
+ GetActiveModifyApplyRes.ActiveModifyApply resActiveModifyApply = PojoConverterUtils.copy(activeModifyApply, GetActiveModifyApplyRes.ActiveModifyApply.class);
|
|
|
+ //处理品牌code,品牌名称
|
|
|
+ if(Objects.nonNull(active.getBrandCode())){
|
|
|
+ String[] brandSplit = active.getBrandCode().trim().split(",");
|
|
|
+ resActive.setBrandCodeList(Arrays.asList(brandSplit));
|
|
|
+ QueryWrapper<BaseBrand> baseBrandQW = new QueryWrapper<>();
|
|
|
+ baseBrandQW.in("brand_code", brandSplit);
|
|
|
+ List<BaseBrand> baseBrands = baseBrandMapper.selectList(baseBrandQW);
|
|
|
+ List<String> baseBrandNameList = baseBrands.stream().map(BaseBrand::getBrandName).collect(Collectors.toList());
|
|
|
+ resActive.setBrandNameList(baseBrandNameList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(Objects.nonNull(activeModifyApply.getBrandCode())){
|
|
|
+ String[] brandSplit = activeModifyApply.getBrandCode().trim().split(",");
|
|
|
+ resActiveModifyApply.setBrandCodeList(Arrays.asList(brandSplit));
|
|
|
+ QueryWrapper<BaseBrand> baseBrandQW = new QueryWrapper<>();
|
|
|
+ baseBrandQW.in("brand_code", brandSplit);
|
|
|
+ List<BaseBrand> baseBrands = baseBrandMapper.selectList(baseBrandQW);
|
|
|
+ List<String> baseBrandNameList = baseBrands.stream().map(BaseBrand::getBrandName).collect(Collectors.toList());
|
|
|
+ resActiveModifyApply.setBrandNameList(baseBrandNameList);
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setActive(resActive);
|
|
|
+ res.setActiveModifyApply(resActiveModifyApply);
|
|
|
+ //查询码活动关联的码包列表
|
|
|
+ res.setListActiveModifyApplyPackageRes(listActiveModifyApplyPackage(req));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ListActiveModifyApplyPackageRes listActiveModifyApplyPackage(GetActiveModifyApplyReq req) {
|
|
|
+ //查询码活动关联的码包列表
|
|
|
+ IPage<ActiveModifyApplyPackageVO> activeModifyApplyPackageVOIPage = qrPackageMapper.listPackageByActiveApplyId(PageUtil.createPage(req), req.getId());
|
|
|
+ List<ActiveModifyApplyPackageVO> records = activeModifyApplyPackageVOIPage.getRecords();
|
|
|
+ ListActiveModifyApplyPackageRes listActiveModifyApplyPackageRes = new ListActiveModifyApplyPackageRes();
|
|
|
+ PageUtil.copyPageInfo(listActiveModifyApplyPackageRes, activeModifyApplyPackageVOIPage);
|
|
|
+ List<ListActiveModifyApplyPackageRes.PackageBean> packageBeans = PojoConverterUtils.copyList(records, ListActiveModifyApplyPackageRes.PackageBean.class);
|
|
|
+ listActiveModifyApplyPackageRes.setPackageBeanList(packageBeans);
|
|
|
+ return listActiveModifyApplyPackageRes;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public ListActivePackageAddRes listActivePackageAdd(ListActivePackageAddReq req) {
|
|
|
//查询码活动关联的码包列表
|