Commit 4a4b343e by chenxi

Merge remote-tracking branch 'origin/v5.8.3' into v5.8.3

2 parents affa1727 752b58f2
Showing 28 changed files with 431 additions and 90 deletions
......@@ -20,13 +20,21 @@ public class GoodsRespDTO implements Serializable {
private static final long serialVersionUID = 1L;
/** 产品ID(对应 upgrade_goods.commodity_code) */
@ApiModelProperty(notes = "产品ID")
private String productId;
/** 上架商品编码 */
@ApiModelProperty(notes = "上架商品编码")
private String goodsCode;
/** 产品名称 */
/** 产品名称(来自 upgrade_goods.upgrade_goods_name) */
@ApiModelProperty(notes = "产品名称")
private String goodsName;
private String productName;
/** 商品别名(来自 merchant_goods_info.goods_alias) */
@ApiModelProperty(notes = "商品别名")
private String goodsAlias;
/** 上架ID */
@ApiModelProperty(notes = "上架ID")
......
package cn.com.glsx.dj.strategy.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 活动车系查询请求DTO
*
* @author
* @version 1.0
* @since 2026/06/24
*/
@Data
@ApiModel(value = "活动车系查询请求")
public class MarketingActivityCarSeriesQueryDTO implements Serializable {
private static final long serialVersionUID = 1L;
/** 活动ID */
@ApiModelProperty(notes = "活动ID", required = true)
private Integer activityId;
/** 是否查询完整信息(含商品/套餐列表) */
@ApiModelProperty(notes = "是否查询完整信息(含商品/套餐列表),默认false")
private Boolean includeDetail = false;
}
package cn.com.glsx.dj.strategy.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 活动车系响应DTO(含可选的商品/套餐详情列表)
*
* @author
* @version 1.0
* @since 2026/06/24
*/
@Data
@ApiModel(value = "活动车系响应")
public class MarketingActivityCarSeriesRespDTO implements Serializable {
private static final long serialVersionUID = 1L;
/** 车系关联ID */
@ApiModelProperty(notes = "车系关联ID")
private Integer id;
/** 活动ID */
@ApiModelProperty(notes = "活动ID")
private Integer activityId;
/** 品牌ID(一级) */
@ApiModelProperty(notes = "品牌ID(一级)")
private Integer brandId;
/** 品牌名称 */
@ApiModelProperty(notes = "品牌名称")
private String brandName;
/** 子品牌ID(二级) */
@ApiModelProperty(notes = "子品牌ID(二级)")
private Integer childId;
/** 子品牌名称 */
@ApiModelProperty(notes = "子品牌名称")
private String childName;
/** 车系ID(三级) */
@ApiModelProperty(notes = "车系ID(三级)")
private Integer carSeriesId;
/** 车系名称 */
@ApiModelProperty(notes = "车系名称")
private String carSeriesName;
/** 商品列表(includeDetail=true 时有值) */
@ApiModelProperty(notes = "商品列表(仅 includeDetail=true 时返回)")
private List<MarketingActivityProductRespDTO> goodsList;
/** 套餐列表(includeDetail=true 时有值) */
@ApiModelProperty(notes = "套餐列表(仅 includeDetail=true 时返回)")
private List<MarketingActivityProductRespDTO> packageList;
}
......@@ -41,6 +41,10 @@ public class MarketingActivityProductRespDTO implements Serializable {
@ApiModelProperty(notes = "商品类型名称(仅GOODS类型有值)")
private String goodsTypeName;
/** 商品名称或套餐名称 */
@ApiModelProperty(notes = "商品名称或套餐名称")
private String productName;
/** 上架商品编码 */
@ApiModelProperty(notes = "上架商品编码")
private String goodsCode;
......
......@@ -20,13 +20,25 @@ public class PackageItemRespDTO implements Serializable {
private static final long serialVersionUID = 1L;
/** 产品ID(对应 upgrade_goods.commodity_code) */
@ApiModelProperty(notes = "产品ID")
private String productId;
/** 子商品编码 */
@ApiModelProperty(notes = "子商品编码")
private String goodsCode;
/** 子商品名称 */
@ApiModelProperty(notes = "子商品名称")
private String goodsName;
/** 产品名称(来自 upgrade_goods.upgrade_goods_name) */
@ApiModelProperty(notes = "产品名称")
private String productName;
/** 商品别名(来自 merchant_goods_info.goods_alias) */
@ApiModelProperty(notes = "商品别名")
private String goodsAlias;
/** 上架ID */
@ApiModelProperty(notes = "上架ID")
private String listingId;
/** 子商品现售价 */
@ApiModelProperty(notes = "子商品现售价")
......
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.strategy.dto.sop;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.persistence.Column;
import lombok.Data;
import java.util.List;
......@@ -39,6 +40,9 @@ public class SopActionDTO implements Serializable {
@ApiModelProperty(notes= "素材间隔(像素)(消息类型为4时使用)")
private Integer intervalPx;
@ApiModelProperty(notes= "网页描述(消息类型为4时使用)")
private String pageDesc;
@ApiModelProperty(notes= "素材列表")
private List<SopActionMediaDTO> medias;
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ public class SopConditionReqDTO implements Serializable {
private BigDecimal numberValue;
@ApiModelProperty(value = "日期值")
private Date dateValue;
private String dateValue;
@ApiModelProperty(value = "枚举值(值类型为4时使用,多个值用逗号分隔)")
private String enumValue;
......
......@@ -43,7 +43,7 @@ public class SopConditionVariableDTO implements Serializable {
private List<SopEnumValueDTO> enumValues;
@ApiModelProperty(notes = "可用操作符列表")
private List<SopStrategyMetaDTO.SopMetaItemDTO> operators;
private List<SopStrategyMetaDTO.SopMetaItemDTOInt> operators;
@ApiModelProperty(notes = "可选的变量列表")
private List<SopConditionVariableDTO> sopConditionVariableDTOList;
......
......@@ -45,4 +45,23 @@ public class SopStrategyMetaDTO implements Serializable {
@ApiModelProperty(notes = "描述")
private String description;
}
/**
* 元数据项DTO
*/
@Data
public static class SopMetaItemDTOInt implements Serializable{
@ApiModelProperty(notes = "编码")
private Integer code;
@ApiModelProperty(notes = "名称")
private String name;
@ApiModelProperty(notes = "类型")
private Integer type;
@ApiModelProperty(notes = "描述")
private String description;
}
}
\ No newline at end of file
......@@ -13,37 +13,37 @@ public class SopStrategyUpdateReqDTO implements Serializable {
@ApiModelProperty(value = "策略ID")
private Integer strategyId;
@ApiModelProperty(value = "策略名称")
private String strategyName;
@ApiModelProperty(value = "业务类型:1-轻改")
@ApiModelProperty(notes = "场景大类", required = true)
private Integer bizType;
@ApiModelProperty(value = "门店范围类型:1-指定门店 2-全部门店")
@ApiModelProperty(notes = "适用门店类型(0不限/1指定门店)", required = true)
private Integer storeScopeType;
@ApiModelProperty(value = "营销阶段:关联sop_strategy_meta_marketing_stage.stage_code")
@ApiModelProperty(notes = "营销阶段(stage_code)", required = true)
private String marketingStage;
@ApiModelProperty(value = "触发类型:关联sop_strategy_meta_trigger.trigger_code")
@ApiModelProperty(notes = "触发类型(trigger_code)", required = true)
private String triggerType;
@ApiModelProperty(value = "日期变量类型:关联sop_strategy_meta_date_variable.date_code")
@ApiModelProperty(notes = "客户行为类型")
private Integer customerBehaviorType;
@ApiModelProperty(notes = "日期变量类型(date_code)")
private String dateVariableType;
@ApiModelProperty(notes = "相对日期类型(0提前/1当前/2推后)")
private Integer relativeDateType;
@ApiModelProperty(value = "相对天数(相对日期类型时使用)")
@ApiModelProperty(notes = "相对天数")
private Integer relativeDays;
@ApiModelProperty(value = "触发小时")
@ApiModelProperty(notes = "触发小时")
private Integer triggerHour;
@ApiModelProperty(value = "触发分钟")
@ApiModelProperty(notes = "触发分钟")
private Integer triggerMinute;
@ApiModelProperty(value = "确认类型(0自动执行/1人工确认)")
@ApiModelProperty(notes = "确认类型(0自动执行/1人工确认)", required = true)
private Integer actionConfirmType;
@ApiModelProperty(value = "门店ID列表")
......
......@@ -76,6 +76,12 @@ public class MarketingActivityProduct implements Serializable {
private String goodsTypeName;
/**
* 商品名称或套餐名称
*/
@Column(name = "product_name")
private String productName;
/**
* 选项卡名称
*/
@Column(name = "tab_name")
......
package cn.com.glsx.dj.strategy.remote;
import cn.com.glsx.dj.strategy.dto.*;
import cn.com.glsx.dj.strategy.model.MarketingActivityCarSeries;
import cn.com.glsx.dj.strategy.model.MarketingActivityProduct;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
......@@ -54,9 +53,9 @@ public interface MarketingActivityRemote {
RpcResponse<RpcPagination<OperationLogVO>> logs(RpcPagination<MarketingActivityLogPageReqDTO> pagination);
@ApiMethod("查询活动关联车系")
@ApiParam(name = "activityId", notes = "活动ID", dataType = ApiParam.DataTypeEnum.INT, required = true)
@ApiResponse("车系列表")
RpcResponse<List<MarketingActivityCarSeries>> carSeries(Integer activityId);
@ApiParam(name = "query", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("车系列表(含可选商品/套餐详情)")
RpcResponse<List<MarketingActivityCarSeriesRespDTO>> carSeries(MarketingActivityCarSeriesQueryDTO query);
@ApiMethod("编辑营销活动")
@ApiParam(name = "request", notes = "编辑请求", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
......
......@@ -7,9 +7,9 @@ import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
/**
/**
* @ClassName CancelCustomerProductTagJob
* @Description 取消客户产品标签任务 - 15日退单数据
* @Description 取消客户产品标签任务 - 16日退单数据
* @Author lqWang
* @Date 2026/6/23 10:16
*/
......
package cn.com.glsx.dj.strategy.mapper;
import cn.com.glsx.dj.strategy.dto.MarketingActivityCarSeriesRespDTO;
import cn.com.glsx.dj.strategy.model.MarketingActivityCarSeries;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -18,9 +19,9 @@ import java.util.List;
public interface MarketingActivityCarSeriesMapper extends OreMapper<MarketingActivityCarSeries> {
/**
* 按活动ID查询车系列表
* 按活动ID查询车系列表(返回 DTO,可配合 includeDetail 使用)
*/
List<MarketingActivityCarSeries> selectByActivityId(@Param("activityId") Integer activityId);
List<MarketingActivityCarSeriesRespDTO> selectByActivityId(@Param("activityId") Integer activityId);
/**
* 按活动ID删除所有车系关联(逻辑删除)
......
......@@ -37,6 +37,11 @@ public interface MarketingActivityProductMapper extends OreMapper<MarketingActiv
List<MarketingActivityProduct> selectByActivityIds(@Param("activityIds") List<Integer> activityIds);
/**
* 级联查询商品/套餐 + 套餐子商品(LEFT JOIN product_item,含 items 集合)
*/
List<MarketingActivityProductRespDTO> selectProductWithItemsByActivityId(@Param("activityId") Integer activityId);
/**
* 按门店+商品编码查询有效活动商品
*/
List<MarketingActivityProduct> selectActiveByMerchantIdAndGoodsCodes(
......
package cn.com.glsx.dj.strategy.remote;
import cn.com.glsx.dj.strategy.dto.*;
import cn.com.glsx.dj.strategy.model.MarketingActivityCarSeries;
import cn.com.glsx.dj.strategy.model.MarketingActivityProduct;
import cn.com.glsx.dj.strategy.service.MarketingActivityService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
......@@ -110,9 +109,9 @@ public class MarketingActivityRemoteImpl implements MarketingActivityRemote {
}
@Override
public RpcResponse<List<MarketingActivityCarSeries>> carSeries(Integer activityId) {
public RpcResponse<List<MarketingActivityCarSeriesRespDTO>> carSeries(MarketingActivityCarSeriesQueryDTO query) {
try {
List<MarketingActivityCarSeries> result = marketingActivityService.carSeries(activityId);
List<MarketingActivityCarSeriesRespDTO> result = marketingActivityService.carSeries(query);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("查询活动车系发生业务异常", e);
......
......@@ -28,6 +28,7 @@ import java.util.List;
public class CustomerTagProfileService {
private static final String CATEGORY_CODE_INIT = "INIT_C1";
private static final String DIMENSION_CODE_INIT = "INIT_D1";
private static final String SOURCE_TYPE_ARCHIVE = "ARCHIVE";
private static final int DEFAULT_SCORE = 1;
......@@ -73,7 +74,7 @@ public class CustomerTagProfileService {
CustomerTagProfile profile = new CustomerTagProfile();
profile.setPhone(phone);
profile.setCategoryCode(CATEGORY_CODE_INIT);
profile.setDimensionCode(null);
profile.setDimensionCode(DIMENSION_CODE_INIT);
profile.setEnumCode(tagEnum.getEnumCode());
profile.setScoreBasis(buildScoreBasis(tagEnum, carSeriesDetail, avgPrice));
profile.setScore(DEFAULT_SCORE);
......
......@@ -10,8 +10,8 @@ import cn.com.glsx.dj.strategy.util.GopApiUtil;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -28,7 +28,6 @@ import java.util.List;
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class CustomerTagProfileSyncService {
/**
......@@ -36,6 +35,8 @@ public class CustomerTagProfileSyncService {
*/
private static final String CATEGORY_CODE_INIT = "INIT_C1";
private static final String DIMENSION_CODE_INIT = "INIT_D1";
/**
* 来源类型 - 建档同步
*/
......@@ -51,8 +52,10 @@ public class CustomerTagProfileSyncService {
*/
private static final int DEFAULT_SCORE = 1;
private final CustomerInfoRemote customerInfoRemote;
private final CustomerTagProfileMapper customerTagProfileMapper;
@Autowired
private CustomerInfoRemote customerInfoRemote;
@Autowired
private CustomerTagProfileMapper customerTagProfileMapper;
/**
* 执行客户标签画像全量同步
......@@ -110,7 +113,8 @@ public class CustomerTagProfileSyncService {
RpcPagination<CustomerProfileInfoDTO> pagination = new RpcPagination<>();
pagination.setList(new ArrayList<>());
pagination.setPageSize(PAGE_SIZE);
pagination.setPageNum(pageNum);
RpcResponse<RpcPagination<CustomerProfileInfoDTO>> response = customerInfoRemote.pageCustomerProfileInfo(pagination);
if (response.isFailed()) {
log.error("查询客户画像信息失败: {}", response.getMessage());
......@@ -211,7 +215,7 @@ public class CustomerTagProfileSyncService {
CustomerTagProfile profile = new CustomerTagProfile();
profile.setPhone(phone);
profile.setCategoryCode(CATEGORY_CODE_INIT);
profile.setDimensionCode(null);
profile.setDimensionCode(DIMENSION_CODE_INIT);
profile.setEnumCode(tagEnum.getEnumCode());
profile.setScoreBasis(buildScoreBasis(tagEnum, carSeriesDetail, avgPrice));
profile.setScore(DEFAULT_SCORE);
......
......@@ -34,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import tk.mybatis.mapper.entity.Example;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
......@@ -41,8 +42,6 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import tk.mybatis.mapper.entity.Example;
/**
* 客户标签同步服务
* 从 AI 分析服务同步客户标签数据到客户标签画像表
......@@ -178,10 +177,13 @@ public class InspectionCustomerTagSyncService {
query.setCategoryCode(CATEGORY_CODE_BEHAVIOR_TAG);
TagCategoryDimensionRespDTO categoryData = tagCategoryService.queryCategoryWithDimensions(query);
List<TagCategoryDimensionRespDTO> all = tagCategoryService.listALL();
// 初始化分类代码缓存
categoryCodeCache = new ConcurrentHashMap<>();
categoryCodeCache.put(categoryData.getId(), categoryData.getCategoryCode());
for (TagCategoryDimensionRespDTO tagCategoryDimensionRespDTO : all) {
categoryCodeCache.put(tagCategoryDimensionRespDTO.getId(), tagCategoryDimensionRespDTO.getCategoryCode());
}
// 初始化维度缓存和枚举缓存
dimensionCache = new ConcurrentHashMap<>();
......@@ -224,6 +226,8 @@ public class InspectionCustomerTagSyncService {
private TagDimension convertToDimensionEntity(TagDimensionRespDTO dto) {
TagDimension entity = new TagDimension();
entity.setId(dto.getId());
entity.setCategoryId(dto.getCategoryId());
entity.setCategoryName(dto.getCategoryName());
entity.setDimensionCode(dto.getDimensionCode());
entity.setDimensionName(dto.getDimensionName());
entity.setCategoryId(dto.getCategoryId());
......@@ -556,11 +560,11 @@ public class InspectionCustomerTagSyncService {
//车衣大类
String carCoverTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.carCover","4,12,161,14,6,162,127");
//电动踏板
Integer electricPedalTypeId = OrePropertyConfigurer.getProperty("smartcarlife.customer.tag.goodsType.electricPedal",Integer.class,163);
String electricPedalTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.electricPedal","163");
//底盘护板
String groundGuardBoardTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.groundGuardBoard","129,166");
//小桌板
Integer smallTableBoardId = OrePropertyConfigurer.getProperty("smartcarlife.customer.tag.goodsType.smallTableBoard",Integer.class,167);
String smallTableBoardTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.smallTableBoard","167");
//脚垫
String footMatTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.footMat","2,125,130");
......@@ -603,9 +607,9 @@ public class InspectionCustomerTagSyncService {
// 3. 品类ID集合 → 产品标签枚举映射
Set<Integer> solarFilmTypes = parseTypeIds(solarFilmTypesStr);
Set<Integer> carCoverTypes = parseTypeIds(carCoverTypesStr);
Set<Integer> electricPedalTypes = parseTypeIds(String.valueOf(electricPedalTypeId));
Set<Integer> electricPedalTypes = parseTypeIds(electricPedalTypesStr);
Set<Integer> groundGuardBoardTypes = parseTypeIds(groundGuardBoardTypesStr);
Set<Integer> smallTableBoardTypes = parseTypeIds(String.valueOf(smallTableBoardId));
Set<Integer> smallTableBoardTypes = parseTypeIds(smallTableBoardTypesStr);
Set<Integer> footMatTypes = parseTypeIds(footMatTypesStr);
Map<Set<Integer>, String> goodsTypeEnumMap = new LinkedHashMap<>();
......@@ -692,7 +696,7 @@ public class InspectionCustomerTagSyncService {
}
/**
* @description: 取消客户产品标签 - 默认15天内退款订单
* @description: 取消客户产品标签 - 默认16天内退款订单
* @param: [jobParameter]
* @return: void
* @author: lqWang
......@@ -709,7 +713,7 @@ public class InspectionCustomerTagSyncService {
if (StrUtil.isBlank(jobParameter)) {
endLocalDate = LocalDate.now();
startLocalDate = endLocalDate.minusDays(15);
startLocalDate = endLocalDate.minusDays(16);
} else {
JSONObject params = JSONUtil.parseObj(jobParameter);
String startDateStr = params.getStr("startDate");
......@@ -745,19 +749,19 @@ public class InspectionCustomerTagSyncService {
//车衣大类
String carCoverTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.carCover","4,12,161,14,6,162,127");
//电动踏板
Integer electricPedalTypeId = OrePropertyConfigurer.getProperty("smartcarlife.customer.tag.goodsType.electricPedal",Integer.class,163);
String electricPedalTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.electricPedal","163");
//底盘护板
String groundGuardBoardTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.groundGuardBoard","129,166");
//小桌板
Integer smallTableBoardId = OrePropertyConfigurer.getProperty("smartcarlife.customer.tag.goodsType.smallTableBoard",Integer.class,167);
String smallTableBoardTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.smallTableBoard","167");
//脚垫
String footMatTypesStr = OrePropertyConfigurer.getString("smartcarlife.customer.tag.goodsType.footMat","2,125,130");
Set<Integer> solarFilmTypes = parseTypeIds(solarFilmTypesStr);
Set<Integer> carCoverTypes = parseTypeIds(carCoverTypesStr);
Set<Integer> electricPedalTypes = parseTypeIds(String.valueOf(electricPedalTypeId));
Set<Integer> electricPedalTypes = parseTypeIds(electricPedalTypesStr);
Set<Integer> groundGuardBoardTypes = parseTypeIds(groundGuardBoardTypesStr);
Set<Integer> smallTableBoardTypes = parseTypeIds(String.valueOf(smallTableBoardId));
Set<Integer> smallTableBoardTypes = parseTypeIds(smallTableBoardTypesStr);
Set<Integer> footMatTypes = parseTypeIds(footMatTypesStr);
Map<Set<Integer>, String> goodsTypeEnumMap = new LinkedHashMap<>();
......
......@@ -148,9 +148,39 @@ public class MarketingActivityService {
/**
* 查询活动关联车系列表
*
* @param query 查询条件(activityId + includeDetail)
*/
public List<MarketingActivityCarSeries> carSeries(Integer activityId) {
return marketingActivityCarSeriesMapper.selectByActivityId(activityId);
public List<MarketingActivityCarSeriesRespDTO> carSeries(MarketingActivityCarSeriesQueryDTO query) {
Integer activityId = query.getActivityId();
Boolean includeDetail = query.getIncludeDetail();
List<MarketingActivityCarSeriesRespDTO> result = marketingActivityCarSeriesMapper.selectByActivityId(activityId);
if (CollectionUtils.isEmpty(result)) {
return Collections.emptyList();
}
if (Boolean.TRUE.equals(includeDetail)) {
// 级联查询商品/套餐 + 套餐子商品
List<MarketingActivityProductRespDTO> allProducts = marketingActivityProductMapper.selectProductWithItemsByActivityId(activityId);
if (!CollectionUtils.isEmpty(allProducts)) {
Map<Integer, List<MarketingActivityProductRespDTO>> productMap = allProducts.stream()
.collect(Collectors.groupingBy(MarketingActivityProductRespDTO::getCarSeriesId));
for (MarketingActivityCarSeriesRespDTO dto : result) {
List<MarketingActivityProductRespDTO> csProducts = productMap.getOrDefault(dto.getId(), Collections.emptyList());
if (!CollectionUtils.isEmpty(csProducts)) {
dto.setGoodsList(csProducts.stream()
.filter(p -> ProductTypeEnum.GOODS.getValue().equals(p.getProductType()))
.collect(Collectors.toList()));
dto.setPackageList(csProducts.stream()
.filter(p -> ProductTypeEnum.PACKAGE.getValue().equals(p.getProductType()))
.collect(Collectors.toList()));
}
}
}
}
return result;
}
/**
......@@ -640,6 +670,7 @@ public class MarketingActivityService {
}
}
p.setProductName(req.getProductName());
p.setSortOrder(req.getSortOrder() != null ? req.getSortOrder() : 0);
p.setTabName(req.getTabName());
p.setTabDescription(req.getTabDescription());
......@@ -810,6 +841,7 @@ public class MarketingActivityService {
pd.setGoodsTypeName(p.getGoodsTypeName());
pd.setGoodsCode(p.getGoodsCode());
pd.setPackageCode(p.getPackageCode());
pd.setProductName(p.getProductName());
pd.setSortOrder(p.getSortOrder());
pd.setTabName(p.getTabName());
pd.setTabDescription(p.getTabDescription());
......
......@@ -187,6 +187,7 @@ public class StrategySopQueryService {
*/
private SopActionDTO convertToActionDTO(SopStrategyAction action) {
SopActionDTO dto = BeanUtil.copyProperties(action, SopActionDTO.class);
dto.setPageTitle(action.getContent());
List<SopStrategyActionMedia> medias = sopStrategyActionMediaMapper.selectByActionId(action.getId());
dto.setMedias(medias.stream()
......@@ -209,7 +210,7 @@ public class StrategySopQueryService {
// 设置日期变量
List<SopConditionVariableDTO> collect = allConditionVariables.stream()
.filter(index -> index.getVariableType() == 1).map(index -> {
.filter(index -> index.getVariableType() == 3).map(index -> {
SopConditionVariableDTO variable = new SopConditionVariableDTO();
variable.setVariableCode(index.getVariableCode());
variable.setVariableName(index.getVariableName());
......@@ -358,8 +359,8 @@ public class StrategySopQueryService {
* @param variableType 变量类型
* @return 可用操作符列表
*/
private List<SopStrategyMetaDTO.SopMetaItemDTO> buildOperatorsByVariableType(Integer variableType) {
List<SopStrategyMetaDTO.SopMetaItemDTO> items = new ArrayList<>();
private List<SopStrategyMetaDTO.SopMetaItemDTOInt> buildOperatorsByVariableType(Integer variableType) {
List<SopStrategyMetaDTO.SopMetaItemDTOInt> items = new ArrayList<>();
if (variableType == null) {
return items;
......@@ -372,45 +373,45 @@ public class StrategySopQueryService {
switch (typeEnum) {
case DATE:
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.LESS_THAN.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.LESS_THAN.getValue(),
SopOperatorTypeEnum.LESS_THAN.getDisplayName(), 4, SopOperatorTypeEnum.LESS_THAN.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.EQUAL_TO.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.EQUAL_TO.getValue(),
SopOperatorTypeEnum.EQUAL_TO.getDisplayName(), 4, SopOperatorTypeEnum.EQUAL_TO.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.GREATER_THAN.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.GREATER_THAN.getValue(),
SopOperatorTypeEnum.GREATER_THAN.getDisplayName(), 4, SopOperatorTypeEnum.GREATER_THAN.getDisplayName()));
break;
case NUMBER:
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.EQUAL_TO.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.EQUAL_TO.getValue(),
SopOperatorTypeEnum.EQUAL_TO.getDisplayName(), 4, SopOperatorTypeEnum.EQUAL_TO.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.NOT_EQUAL_TO.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.NOT_EQUAL_TO.getValue(),
SopOperatorTypeEnum.NOT_EQUAL_TO.getDisplayName(), 4, SopOperatorTypeEnum.NOT_EQUAL_TO.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.GREATER.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.GREATER.getValue(),
SopOperatorTypeEnum.GREATER.getDisplayName(), 4, SopOperatorTypeEnum.GREATER.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.GREATER_EQUAL.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.GREATER_EQUAL.getValue(),
SopOperatorTypeEnum.GREATER_EQUAL.getDisplayName(), 4, SopOperatorTypeEnum.GREATER_EQUAL.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.LESS.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.LESS.getValue(),
SopOperatorTypeEnum.LESS.getDisplayName(), 4, SopOperatorTypeEnum.LESS.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.LESS_EQUAL.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.LESS_EQUAL.getValue(),
SopOperatorTypeEnum.LESS_EQUAL.getDisplayName(), 4, SopOperatorTypeEnum.LESS_EQUAL.getDisplayName()));
break;
case TEXT:
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.CONTAINS.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.CONTAINS.getValue(),
SopOperatorTypeEnum.CONTAINS.getDisplayName(), 4, SopOperatorTypeEnum.CONTAINS.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.NOT_CONTAINS.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.NOT_CONTAINS.getValue(),
SopOperatorTypeEnum.NOT_CONTAINS.getDisplayName(), 4, SopOperatorTypeEnum.NOT_CONTAINS.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.EQUAL_TO.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.EQUAL_TO.getValue(),
SopOperatorTypeEnum.EQUAL_TO.getDisplayName(), 4, SopOperatorTypeEnum.EQUAL_TO.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.NOT_EQUAL_TO.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.NOT_EQUAL_TO.getValue(),
SopOperatorTypeEnum.NOT_EQUAL_TO.getDisplayName(), 4, SopOperatorTypeEnum.NOT_EQUAL_TO.getDisplayName()));
break;
case ENUM:
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.CONTAINS.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.CONTAINS.getValue(),
SopOperatorTypeEnum.CONTAINS.getDisplayName(), 4, SopOperatorTypeEnum.CONTAINS.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.NOT_CONTAINS.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.NOT_CONTAINS.getValue(),
SopOperatorTypeEnum.NOT_CONTAINS.getDisplayName(), 4, SopOperatorTypeEnum.NOT_CONTAINS.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.EQUAL_TO.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.EQUAL_TO.getValue(),
SopOperatorTypeEnum.EQUAL_TO.getDisplayName(), 4, SopOperatorTypeEnum.EQUAL_TO.getDisplayName()));
items.add(createMetaItem(String.valueOf(SopOperatorTypeEnum.NOT_EQUAL_TO.getValue()),
items.add(createMetaItemInt(SopOperatorTypeEnum.NOT_EQUAL_TO.getValue(),
SopOperatorTypeEnum.NOT_EQUAL_TO.getDisplayName(), 4, SopOperatorTypeEnum.NOT_EQUAL_TO.getDisplayName()));
break;
default:
......@@ -485,6 +486,24 @@ public class StrategySopQueryService {
}
/**
* 创建元数据项DTO
*
* @param code 编码
* @param name 名称
* @param type 类型
* @param description 描述
* @return 元数据项DTO
*/
private SopStrategyMetaDTO.SopMetaItemDTOInt createMetaItemInt(Integer code, String name, Integer type, String description) {
SopStrategyMetaDTO.SopMetaItemDTOInt item = new SopStrategyMetaDTO.SopMetaItemDTOInt();
item.setCode(code);
item.setName(name);
item.setType(type);
item.setDescription(description);
return item;
}
/**
* 根据记录ID查询策略执行记录详情
*
* @param recordId 执行记录ID
......
......@@ -203,8 +203,10 @@ public class StrategySopService {
if (CollUtil.isEmpty(branches)) {
return;
}
int branchNo = 1;
for (SopBranchReqDTO branchReq : branches) {
SopStrategyBranch branch = BeanUtil.copyProperties(branchReq, SopStrategyBranch.class);
branch.setBranchNo(branchNo);
branch.setStrategyId(strategyId);
branch.setDeletedFlag(DeleteFlagEnum.N.getValue());
branch.setCreatedBy(createdBy);
......@@ -212,9 +214,9 @@ public class StrategySopService {
branch.setStep(3);
sopStrategyBranchMapper.insertSelective(branch);
Integer branchId = branch.getId();
saveConditionGroups(strategyId, branchId, branchReq.getConditionGroups(), createdBy);
saveActions(strategyId, branchId, branchReq.getActions(), createdBy);
branchNo++ ;
}
}
......@@ -222,10 +224,12 @@ public class StrategySopService {
if (CollUtil.isEmpty(conditionGroups)) {
return;
}
int groupNo = 1;
for (SopConditionGroupReqDTO groupReq : conditionGroups) {
SopStrategyConditionGroup group = BeanUtil.copyProperties(groupReq, SopStrategyConditionGroup.class);
group.setStrategyId(strategyId);
group.setBranchId(null);
group.setGroupSeq(groupNo);
group.setStep(2);
group.setDeletedFlag(DeleteFlagEnum.N.getValue());
group.setCreatedBy(createdBy);
......@@ -234,6 +238,7 @@ public class StrategySopService {
Integer groupId = group.getId();
saveConditions(strategyId, null, groupId, groupReq.getConditions(), createdBy);
groupNo++ ;
}
}
......@@ -241,11 +246,13 @@ public class StrategySopService {
if (CollUtil.isEmpty(conditionGroups)) {
return;
}
int groupNo = 1;
for (SopConditionGroupReqDTO groupReq : conditionGroups) {
SopStrategyConditionGroup group = BeanUtil.copyProperties(groupReq, SopStrategyConditionGroup.class);
group.setStrategyId(strategyId);
group.setBranchId(branchId);
group.setStep(3);
group.setGroupSeq(groupNo);
group.setDeletedFlag(DeleteFlagEnum.N.getValue());
group.setCreatedBy(createdBy);
group.setCreatedDate(new Date());
......@@ -253,6 +260,7 @@ public class StrategySopService {
Integer groupId = group.getId();
saveConditions(strategyId, branchId, groupId, groupReq.getConditions(), createdBy);
groupNo++ ;
}
}
......@@ -276,6 +284,7 @@ public class StrategySopService {
if (CollUtil.isEmpty(actions)) {
return;
}
int actionNo = 1;
for (SopActionReqDTO actionReq : actions) {
SopStrategyAction action = BeanUtil.copyProperties(actionReq, SopStrategyAction.class);
List<SopActionMediaReqDTO> medias = actionReq.getMedias();
......@@ -283,6 +292,7 @@ public class StrategySopService {
action.setMediaIds(medias.stream().map(SopActionMediaReqDTO::getMediaUrl).collect(
Collectors.joining(",")));
}
action.setActionSeq(actionNo);
action.setStrategyId(strategyId);
action.setBranchId(branchId);
action.setDeletedFlag(DeleteFlagEnum.N.getValue());
......@@ -313,6 +323,7 @@ public class StrategySopService {
Integer actionId = action.getId();
saveActionMedias(actionId, actionReq.getMedias(), createdBy);
actionNo++ ;
}
}
......
......@@ -335,6 +335,78 @@ public class TagCategoryService {
}
/**
* 查询所有分类及其维度和枚举
*
* @return 所有分类及其维度枚举列表
* @since 2026/06/24 15:30
*/
public List<TagCategoryDimensionRespDTO> listALL() {
// 一次性加载全部分类
List<TagCategory> allCategories = tagCategoryMapper.selectAllCategories();
if (allCategories.isEmpty()) {
return Collections.emptyList();
}
Map<Integer, TagCategory> allCategoryMap = allCategories.stream()
.collect(Collectors.toMap(TagCategory::getId, c -> c));
// 查询所有维度
TagDimensionQueryReqDTO dimQuery = new TagDimensionQueryReqDTO();
List<TagDimension> allDimensions = tagDimensionMapper.queryDimensionList(dimQuery);
// 批量查询所有枚举值
Map<Integer, List<TagEnum>> enumMap = Collections.emptyMap();
if (!allDimensions.isEmpty()) {
List<Integer> dimensionIds = allDimensions.stream()
.map(TagDimension::getId)
.collect(Collectors.toList());
enumMap = tagEnumMapper.selectByDimensionIds(dimensionIds).stream()
.collect(Collectors.groupingBy(TagEnum::getDimensionId));
}
// 按分类ID分组维度
Map<Integer, List<TagDimension>> dimensionByCategoryMap = allDimensions.stream()
.collect(Collectors.groupingBy(TagDimension::getCategoryId));
// 构建每个分类的响应DTO
final Map<Integer, List<TagEnum>> finalEnumMap = enumMap;
return allCategories.stream().map(category -> {
TagCategoryDimensionRespDTO dto = new TagCategoryDimensionRespDTO();
dto.setId(category.getId());
dto.setCategoryCode(category.getCategoryCode());
dto.setCategoryName(category.getCategoryName());
dto.setParentId(category.getParentId());
dto.setLevel(category.getLevel());
dto.setFullPath(buildFullPath(category, allCategoryMap));
// 设置该分类下的维度
List<TagDimension> dimensions = dimensionByCategoryMap.getOrDefault(category.getId(), Collections.emptyList());
List<TagDimensionRespDTO> dimensionDTOs = dimensions.stream().map(dim -> {
TagDimensionRespDTO dimDto = new TagDimensionRespDTO();
dimDto.setId(dim.getId());
dimDto.setDimensionCode(dim.getDimensionCode());
dimDto.setDimensionName(dim.getDimensionName());
dimDto.setCategoryId(dim.getCategoryId());
TagCategory cat = allCategoryMap.get(dim.getCategoryId());
dimDto.setCategoryName(cat != null ? cat.getCategoryName() : null);
dimDto.setCategoryFullPath(cat != null ? buildFullPath(cat, allCategoryMap) : null);
dimDto.setEnumCount(dim.getEnumCount());
dimDto.setSortOrder(dim.getSortOrder());
dimDto.setCanEdit(dim.getCanEdit());
dimDto.setCanAddEnum(dim.getCanAddEnum());
List<TagEnum> dimEnums = finalEnumMap.getOrDefault(dim.getId(), Collections.emptyList());
dimDto.setEnums(dimEnums.stream().map(this::convertTagEnumToRespDTO).collect(Collectors.toList()));
dimDto.setCreatedDate(dim.getCreatedDate());
dimDto.setUpdatedDate(dim.getUpdatedDate());
return dimDto;
}).collect(Collectors.toList());
dto.setDimensions(dimensionDTOs);
return dto;
}).collect(Collectors.toList());
}
/**
* 根据类别代码查询类别
*/
public TagCategoryRespDTO getByCode(String categoryCode) {
......
......@@ -2,13 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.strategy.mapper.MarketingActivityCarSeriesMapper">
<select id="selectByActivityId" resultType="cn.com.glsx.dj.strategy.model.MarketingActivityCarSeries">
SELECT id, activity_id activityId,
brand_id brandId, brand_name brandName,
child_id childId, child_name childName,
car_series_id carSeriesId, car_series_name carSeriesName,
created_by createdBy, created_date createdDate
FROM dj_marketing_activity_car_series
<resultMap id="CarSeriesRespDTOResultMap" type="cn.com.glsx.dj.strategy.dto.MarketingActivityCarSeriesRespDTO">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="activity_id" property="activityId" jdbcType="INTEGER"/>
<result column="brand_id" property="brandId" jdbcType="INTEGER"/>
<result column="brand_name" property="brandName" jdbcType="VARCHAR"/>
<result column="child_id" property="childId" jdbcType="INTEGER"/>
<result column="child_name" property="childName" jdbcType="VARCHAR"/>
<result column="car_series_id" property="carSeriesId" jdbcType="INTEGER"/>
<result column="car_series_name" property="carSeriesName" jdbcType="VARCHAR"/>
</resultMap>
<select id="selectByActivityId" resultMap="CarSeriesRespDTOResultMap">
SELECT * FROM dj_marketing_activity_car_series
WHERE activity_id = #{activityId} AND deleted_flag = 'N'
</select>
......
......@@ -28,6 +28,7 @@
<result column="sort_order" property="sortOrder" jdbcType="INTEGER"/>
<result column="goods_type" property="goodsType" jdbcType="INTEGER"/>
<result column="goods_type_name" property="goodsTypeName" jdbcType="VARCHAR"/>
<result column="product_name" property="productName" jdbcType="VARCHAR"/>
<result column="tab_name" property="tabName" jdbcType="VARCHAR"/>
<result column="tab_description" property="tabDescription" jdbcType="VARCHAR"/>
<result column="discount_price" property="discountPrice" jdbcType="DECIMAL"/>
......@@ -67,6 +68,40 @@
<result column="detail_image_url" property="detailImageUrl" jdbcType="VARCHAR"/>
</resultMap>
<!-- 级联查询商品/套餐 + 套餐子商品(LEFT JOIN product_item,一次查询带回所有数据) -->
<resultMap id="ProductWithItemsResultMap" type="cn.com.glsx.dj.strategy.dto.MarketingActivityProductRespDTO" extends="ProductRespDTOResultMap">
<collection property="packageItems" ofType="cn.com.glsx.dj.strategy.dto.MarketingActivityProductItemRespDTO">
<id column="item_id" property="itemId"/>
<result column="item_activity_product_id" property="activityProductId"/>
<result column="item_goods_code" property="goodsCode"/>
<result column="item_goods_name" property="goodsName"/>
<result column="item_goods_type" property="goodsType"/>
<result column="item_goods_type_name" property="goodsTypeName"/>
<result column="item_current_price" property="currentPrice"/>
<result column="item_minimum_price" property="minimumPrice"/>
<result column="item_discount_price" property="discountPrice"/>
<result column="item_sales_incentive" property="salesIncentive"/>
</collection>
</resultMap>
<select id="selectProductWithItemsByActivityId" resultMap="ProductWithItemsResultMap">
SELECT p.*,
i.id AS item_id,
i.activity_product_id AS item_activity_product_id,
i.goods_code AS item_goods_code,
i.goods_name AS item_goods_name,
i.goods_type AS item_goods_type,
i.goods_type_name AS item_goods_type_name,
i.current_price AS item_current_price,
i.minimum_price AS item_minimum_price,
i.discount_price AS item_discount_price,
i.sales_incentive AS item_sales_incentive
FROM dj_marketing_activity_product p
LEFT JOIN dj_marketing_activity_product_item i ON i.activity_product_id = p.id AND i.deleted_flag = 'N'
WHERE p.activity_id = #{activityId} AND p.deleted_flag = 'N'
ORDER BY p.sort_order
</select>
<select id="selectProductDTOList" resultMap="ProductRespDTOResultMap">
SELECT *
FROM dj_marketing_activity_product
......
......@@ -4,14 +4,16 @@
<!-- 分页查询适用门店范围内的上架商品(仅取必要字段) -->
<select id="pageGoods" resultType="cn.com.glsx.dj.strategy.dto.GoodsRespDTO">
SELECT mgi.merchant_goods_code AS goodsCode,
mgi.goods_alias AS goodsName,
ug.commodity_code AS listingId,
mgi.scene_type AS scene,
mgi.base_scene_code AS baseSceneCode,
SELECT ug.commodity_code AS productId,
mgi.merchant_goods_code AS goodsCode,
ug.upgrade_goods_name AS productName,
mgi.goods_alias AS goodsAlias,
ug.commodity_code AS listingId,
mgi.scene_type AS scene,
mgi.base_scene_code AS baseSceneCode,
COUNT(DISTINCT mgr.merchant_id) AS storeCount,
mgi.sell_price AS currentPrice,
mgi.min_sell_price AS minimumPrice
mgi.sell_price AS currentPrice,
mgi.min_sell_price AS minimumPrice
FROM dj_car_life_merchant_goods_info mgi
LEFT JOIN dj_car_life_upgrade_goods ug ON ug.id = mgi.upgrade_goods_id AND ug.deleted_flag = 'N'
JOIN dj_car_life_merchant_goods_ref mgr ON mgr.merchant_goods_id = mgi.id AND mgr.deleted_flag = 'N'
......@@ -42,7 +44,8 @@
<!-- 查询商品/套餐在适用门店范围内的门店列表(不分页,取交集) -->
<select id="findStores" resultType="cn.com.glsx.dj.strategy.dto.GoodsStoreRespDTO">
SELECT mgr.merchant_id AS merchantId,
SELECT DISTINCT
mgr.merchant_id AS merchantId,
sm.merchant_name AS merchantName,
sm.address AS merchantAddress
FROM dj_car_life_merchant_goods_info mgi
......
......@@ -52,11 +52,15 @@
<!-- 查询套餐下所有子商品 -->
<select id="findPackageItems" resultType="cn.com.glsx.dj.strategy.dto.PackageItemRespDTO">
SELECT mgi.merchant_goods_code AS goodsCode,
mgi.goods_alias AS goodsName,
SELECT ug.commodity_code AS productId,
mgi.merchant_goods_code AS goodsCode,
ug.upgrade_goods_name AS productName,
mgi.goods_alias AS goodsAlias,
ug.commodity_code AS listingId,
mgi.sell_price AS currentPrice,
mgi.min_sell_price AS minimumPrice
FROM dj_car_life_merchant_goods_info mgi
LEFT JOIN dj_car_life_upgrade_goods ug ON ug.id = mgi.upgrade_goods_id AND ug.deleted_flag = 'N'
WHERE mgi.package_code = #{packageCode}
AND mgi.deleted_flag = 'N'
AND mgi.status = 1
......
......@@ -12,6 +12,8 @@
<result column="variable_name" property="variableName"/>
<result column="value_type" property="valueType"/>
<result column="operator" property="operator"/>
<result column="value_source" property="valueSource"/>
<result column="variable_ref_code" property="variableRefCode"/>
<result column="text_value" property="textValue"/>
<result column="number_value" property="numberValue"/>
<result column="date_value" property="dateValue"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!