Commit df61a431 by 张富康

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

2 parents 3f388c72 20091750
...@@ -146,85 +146,6 @@ public class BusinessAnalysisController { ...@@ -146,85 +146,6 @@ public class BusinessAnalysisController {
return RopResponse.success(null); return RopResponse.success(null);
} }
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-总产值、目标产值、达成率")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.output.scene", needInSession = NeedInSessionType.YES)
public RopResponse<SceneOutputResponse> sceneOutput(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-产值趋势及达成率")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.output.trend.scene", needInSession = NeedInSessionType.YES)
public RopResponse<TrendOutputResponse> trendOutput(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-存量门店分析")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.output.store.scene", needInSession = NeedInSessionType.YES)
public RopResponse<StoreSceneSummaryResponse> storeSummary(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-流量概况")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.traffic.summary.scene", needInSession = NeedInSessionType.YES)
public RopResponse<TrafficSummaryResponse> trafficSummary(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-区域分布")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.regional distribution", needInSession = NeedInSessionType.YES)
public RopResponse<List<RegionalDistributionResponse>> regionalDistribution(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-新拓门店分析")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.store.new.summary.scene", needInSession = NeedInSessionType.YES)
public RopResponse<NewStoreAnalysisResponse> newStoreSummary(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-触客率分析")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.touch.rate.scene", needInSession = NeedInSessionType.YES)
public RopResponse<List<ContactRateAnalysisResponse>> touchRateSummary(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-门店列表均值")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.store.avg.list", needInSession = NeedInSessionType.YES)
public RopResponse<StoreAvgResponse> storeAvgList(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-门店列表")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.store.list", needInSession = NeedInSessionType.YES)
public RopResponse<List<StoreListResponse>> storeList(SceneOutputRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-门店分析")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.store.detail.summary", needInSession = NeedInSessionType.YES)
public RopResponse<StoreDetailSummaryResponse> storeDetailSummary(SceneStoreRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-员工排行")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.store.employee.rank", needInSession = NeedInSessionType.YES)
public RopResponse<StoreEmployeeRankResponse> storeEmployeeRank(SceneStoreRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-流量贡献排行")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.store.traffic.rank", needInSession = NeedInSessionType.YES)
public RopResponse<TrafficContributionRankResponse> storeTrafficRank(SceneStoreRequest request) {
return RopResponse.success(null);
}
@ApiOperation("总部视角/区域运营、销售视角----延保/权益/轻改-员工分析")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.store.employee.summary", needInSession = NeedInSessionType.YES)
public RopResponse<EmployeeDetailSummaryResponse> storeEmployeeSummary(SceneStoreRequest request) {
return RopResponse.success(null);
}
@ApiOperation("区域运营/销售视角----全业务-个人总览-总产值、毛利率") @ApiOperation("区域运营/销售视角----全业务-个人总览-总产值、毛利率")
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.output.personal", needInSession = NeedInSessionType.YES) @ServiceMethod(method = "dj.api.smartcarlife.business.analysis.output.personal", needInSession = NeedInSessionType.YES)
public RopResponse<List<RegionOutputResponse>> personalOutput(RegionalOutputRequest request) { public RopResponse<List<RegionOutputResponse>> personalOutput(RegionalOutputRequest request) {
......
...@@ -36,11 +36,17 @@ public class MerchantIdPermissionRequest implements Serializable{ ...@@ -36,11 +36,17 @@ public class MerchantIdPermissionRequest implements Serializable{
//周期类型-- 4.自定义 //周期类型-- 4.自定义
@ApiModelProperty(hidden = true) @ApiModelProperty(hidden = true)
public static final int CYCLE_TYPE_CUSTOMIZE = 4; public static final int CYCLE_TYPE_CUSTOMIZE = 4;
//周期类型-- 5.按年
@ApiModelProperty(hidden = true)
public static final int CYCLE_TYPE_YEAR = 5;
@Builder.Default @Builder.Default
@ApiModelProperty(notes = "业务场景(0.会员权益,1.精品升级),必须,默认会员权益") @ApiModelProperty(notes = "业务场景(0.会员权益,1.精品升级),必须,默认会员权益")
private Byte sceneType = SceneTypeEnum.SCENE1_0.getValue(); private Byte sceneType = SceneTypeEnum.SCENE1_0.getValue();
@ApiModelProperty(notes = "业务类型(1:全业务;2:延保;3:权益;4:轻改;5:二手车)")
private Integer bizs;
@ApiModelProperty(notes = "周期类型(1.按天,2.按周,3.按月,4.自定义),必须", required = true) @ApiModelProperty(notes = "周期类型(1.按天,2.按周,3.按月,4.自定义,5.按年),必须", required = true)
private Integer cycleType; private Integer cycleType;
@ApiModelProperty(notes = "当前周期内的任一时间(格式 yyyy-MM-dd/yyyy-MM-dd HH:mm:ss均可),如果为自定义类型则为开始时间(格式yyyy-MM-dd HH:mm:ss)必须", required = true) @ApiModelProperty(notes = "当前周期内的任一时间(格式 yyyy-MM-dd/yyyy-MM-dd HH:mm:ss均可),如果为自定义类型则为开始时间(格式yyyy-MM-dd HH:mm:ss)必须", required = true)
......
package cn.com.glsx.dj.request.output;
import cn.com.glsx.dj.request.MerchantIdPermissionRequest;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class SceneBaseRequest extends AbstractRopRequest implements Serializable {
private static final long serialVersionUID = -1;
@ApiModelProperty(notes = "门店过滤条件")
private MerchantIdPermissionRequest merchantFilter;
@ApiModelProperty(notes = "排序:1-产值(默认),2-客单价,3-转化率")
private Integer sortType;
@ApiModelProperty(notes = "排序:1-降序(默认),2-升序")
private Integer orderBy;
@ApiModelProperty(notes = "门店号列表")
private List<Integer> merchantIds;
@ApiModelProperty(notes = "员工编号列表")
private List<String> staffUuids;
@ApiModelProperty(notes = "模糊搜索")
private String search;
/**
* 转换周期传参,适配指标传参
*
* permissionRequest.cycleType:request筛选参数:1.按天,2.按周,3.按月,4.自定义
* queryParams.dataType:指标参数:0,按指定时段;1,按周;2,按月;3,按年;4,全部
*/
@JsonIgnoreProperties
public Integer convertQueryParamCycleType(Integer cycleType) {
switch (cycleType) {
case 1:
case 4:
return 0;
case 2:
return 1;
case 3:
return 2;
case 5:
return 3;
default:
throw new RpcServiceException("不支持的周期类型");
}
}
}
package cn.com.glsx.dj.request.output;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
public class SceneOutputRequest extends AbstractRopRequest implements Serializable {
private static final long serialVersionUID = -1;
/**
* 业务类型 「全业务」「延保」「权益」「轻改」「二手车」
*/
@ApiModelProperty(notes = "业务类型(1:全业务;2:延保;3:权益;4:轻改;5:二手车)")
@NotNull
private Integer businessType;
/**
* 1-天 2-周 3-月 4-自定义
*/
@ApiModelProperty(notes = "1-天 2-周 3-月 4-自定义")
@NotNull
private Integer cycleType;
/**
* 开始时间
*/
@ApiModelProperty(notes = "开始时间")
@NotNull
private String startTime;
/**
* 结束时间
*/
@ApiModelProperty(notes = "结束时间")
@NotNull
private String endTime;
/**
* 品牌筛选 选择一级主营品牌
*/
@ApiModelProperty(notes = "品牌筛选 选择一级主营品牌")
private Integer brandId;
/**
* 省份筛选
*/
@ApiModelProperty(notes = "省份筛选")
private String provinceId;
}
...@@ -621,4 +621,44 @@ public class DateUtils extends cn.com.glsx.framework.core.util.DateUtils { ...@@ -621,4 +621,44 @@ public class DateUtils extends cn.com.glsx.framework.core.util.DateUtils {
LocalDateTime localDateTime = date.atTime(23, 59, 59); LocalDateTime localDateTime = date.atTime(23, 59, 59);
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
} }
/**
* 根据cycleType偏移周期和endDate,计算出开始时间
* 如cycleType为按周统计时,开始时间应该是endDate的8周前
*
* @param cycleType 周期类型:1-天 2-周 3-月 4-自定义
* @param endDate 结束日期
* @param offset 偏移周期数
* @return 计算后的开始日期
*/
public static Date getStartDateByCycleType(Integer cycleType, Date endDate, int offset) {
if (cycleType == null || endDate == null || offset <= 0) {
throw new IllegalArgumentException("参数不能为空且偏移量必须大于0");
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(endDate);
switch (cycleType) {
case 1: // 按天
calendar.add(Calendar.DAY_OF_YEAR, offset);
break;
case 2: // 按周(一周7天)
calendar.add(Calendar.WEEK_OF_YEAR, offset);
break;
case 3: // 按月
calendar.add(Calendar.MONTH, offset);
break;
case 4: // 自定义,默认按天处理
calendar.add(Calendar.DAY_OF_YEAR, offset);
break;
case 5: // 按年
calendar.add(Calendar.YEAR, offset);
break;
default:
throw new IllegalArgumentException("不支持的周期类型: " + cycleType);
}
return calendar.getTime();
}
} }
  • @wangxw1
    commented
    Master

    Auto Review Result:

    代码审查报告

    问题描述和优化建议

    1. 字段命名不一致

    • 问题描述: StoreListRequest 类中的 storeName 字段被更改为 merchantName,这可能导致代码中其他地方对该字段的引用出现问题。
    • 影响: 如果没有同步更新所有引用该字段的地方,可能会导致运行时错误或逻辑错误。
    • 优化建议:
      • 确保所有引用 storeName 的地方都已更新为 merchantName。
      • 使用IDE的重构功能来重命名字段,以避免遗漏。

    2. 提交信息的准确性

    • 问题描述: 提交信息提到“修正部分API接口及DTO字段命名”,但具体的变更细节不够明确。
    • 影响: 其他开发者可能不清楚具体哪些字段被修改了,这会影响代码的可维护性。
    • 优化建议:
      • 在提交信息中详细列出所有修改的字段及其变更原因。
      • 例如:“修正部分API接口及DTO字段命名,将storeName改为merchantName以保持一致性。”

    评分明细

    1. 功能实现的正确性与健壮性 (40分):

      • 代码逻辑上没有明显的错误,但字段命名更改需要确保所有引用都已更新。
      • 分数: 35分
    2. 安全性与潜在风险 (30分):

      • 没有明显的安全漏洞,但需要确保所有数据库查询和外部接口调用都是安全的。
      • 分数: 28分
    3. 是否符合最佳实践 (20分):

      • 字段命名更改是一个好的实践,但需要确保一致性。
      • 提交信息可以更详细一些。
      • 分数: 16分
    4. 性能与资源利用效率 (5分):

      • 没有明显的性能问题。
      • 分数: 5分
    5. Commits信息的清晰性与准确性 (5分):

      • 提交信息不够详细,难以追踪具体的变更。
      • 分数: 3分

    总分: 87分

    通过以上审查,建议在后续开发中更加注重代码的一致性和提交信息的详细性,以提高代码质量和可维护性。

Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!