style: 应用 Spotless 代码格式化

- 对所有 Java 源文件应用统一的代码格式化
- 统一缩进为 4 个空格
- 清理尾随空白字符和文件末尾换行
- 优化导入语句组织
- 总计格式化 654 个 Java 文件

有问题可以回滚或者找我聊
This commit is contained in:
irving
2025-08-30 21:21:08 -04:00
parent 7cafe17cd3
commit d719a047d8
619 changed files with 6491 additions and 6625 deletions

View File

@@ -18,13 +18,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -32,6 +25,12 @@ import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 店员业绩查询对
@@ -59,38 +58,43 @@ public class PlayClerkPerformanceController {
@Resource
private IPlayClerkPerformanceService playClerkPerformanceService;
@ApiOperation(value = "分页查询店员业绩", notes = "分页查询店员业绩统计信息")
@ApiResponses({
@ApiResponse(code = 200, message = "操作成功", response = PlayClerkPerformanceInfoReturnVo.class, responseContainer = "Page")
})
@ApiResponse(code = 200, message = "操作成功", response = PlayClerkPerformanceInfoReturnVo.class, responseContainer = "Page")})
@PostMapping("/listByPage")
public R listByPage(@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
public R listByPage(
@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
IPage<PlayClerkUserInfoEntity> page = clerkUserInfoService.selectByPage(vo);
IPage<PlayClerkPerformanceInfoReturnVo> voPage = page.convert(u -> {
List<PlayClerkLevelInfoEntity> clerkLevelInfoEntity = playClerkLevelInfoService.selectAll();
String startTime = vo.getEndOrderTime() != null ? vo.getEndOrderTime().get(0) : "";
String endTime = vo.getEndOrderTime() != null ? vo.getEndOrderTime().get(1) : "";
List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.clerkSelectOrderInfoList(u.getId(), startTime, endTime);
List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.clerkSelectOrderInfoList(u.getId(),
startTime, endTime);
List<PlayPersonnelGroupInfoEntity> groupInfoEntities = playPersonnelGroupInfoService.selectAll();
return playClerkPerformanceService.getClerkPerformanceInfo(u, orderInfoEntities, clerkLevelInfoEntity, groupInfoEntities);
return playClerkPerformanceService.getClerkPerformanceInfo(u, orderInfoEntities, clerkLevelInfoEntity,
groupInfoEntities);
});
voPage.setRecords(voPage.getRecords().stream().sorted(Comparator.comparing(PlayClerkPerformanceInfoReturnVo::getOrderNumber).reversed()).collect(Collectors.toList()));
voPage.setRecords(voPage.getRecords().stream()
.sorted(Comparator.comparing(PlayClerkPerformanceInfoReturnVo::getOrderNumber).reversed())
.collect(Collectors.toList()));
return R.ok(voPage);
}
@ApiOperation(value = "按日查询业绩", notes = "按日期查询店员业绩统计信息")
@ApiResponses({
@ApiResponse(code = 200, message = "操作成功")
})
@ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
@PostMapping("/listByTime")
public R listByTime(@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
//时间范围
public R listByTime(
@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
// 时间范围
List<String> dates = getDateRangeByDay(vo.getEndOrderTime().get(0), vo.getEndOrderTime().get(1));
//指定时间内所有订单
// List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.listByTime("", vo.getEndOrderTime().get(0), vo.getEndOrderTime().get(1), Stream.of("2", "3").collect(Collectors.toList()));
List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.listByTime("", vo.getEndOrderTime().get(0), vo.getEndOrderTime().get(1), new ArrayList<>());
// 指定时间内所有订单
// List<PlayOrderInfoEntity> orderInfoEntities =
// playOrderInfoService.listByTime("", vo.getEndOrderTime().get(0),
// vo.getEndOrderTime().get(1), Stream.of("2",
// "3").collect(Collectors.toList()));
List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.listByTime("", vo.getEndOrderTime().get(0),
vo.getEndOrderTime().get(1), new ArrayList<>());
List<PlayClerkPerformanceInfoReturnVo> orders = new ArrayList<>(dates.size());
for (String date : dates) {
orders.add(getPerformanceInfo(date, orderInfoEntities));
@@ -102,22 +106,24 @@ public class PlayClerkPerformanceController {
return R.ok(resultMap);
}
@ApiOperation(value = "按月查询业绩", notes = "按月份查询店员业绩统计信息")
@ApiResponses({
@ApiResponse(code = 200, message = "操作成功")
})
@ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
@PostMapping("/listByMonth")
public R listByMonth(@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
String startTime = LocalDate.of(Integer.parseInt(vo.getEndOrderTime().get(0).split("-")[0]), Integer.parseInt(vo.getEndOrderTime().get(0).split("-")[1]), 1).toString() + " 00:00:00";
LocalDate endDate = LocalDate.of(Integer.parseInt(vo.getEndOrderTime().get(1).split("-")[0]), Integer.parseInt(vo.getEndOrderTime().get(1).split("-")[1]), 1);
public R listByMonth(
@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
String startTime = LocalDate.of(Integer.parseInt(vo.getEndOrderTime().get(0).split("-")[0]),
Integer.parseInt(vo.getEndOrderTime().get(0).split("-")[1]), 1).toString() + " 00:00:00";
LocalDate endDate = LocalDate.of(Integer.parseInt(vo.getEndOrderTime().get(1).split("-")[0]),
Integer.parseInt(vo.getEndOrderTime().get(1).split("-")[1]), 1);
String endTime = endDate.with(TemporalAdjusters.lastDayOfMonth()) + " 23:59:59";
List<String> dates = getDateRangeByMonth(startTime, endTime);
//指定时间内所有订单
// List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.listByTime("", startTime, endTime, Stream.of("4").collect(Collectors.toList()));
List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.listByTime("", startTime, endTime, new ArrayList<>());
// 指定时间内所有订单
// List<PlayOrderInfoEntity> orderInfoEntities =
// playOrderInfoService.listByTime("", startTime, endTime,
// Stream.of("4").collect(Collectors.toList()));
List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.listByTime("", startTime, endTime,
new ArrayList<>());
List<PlayClerkPerformanceInfoReturnVo> orders = new ArrayList<>(dates.size());
for (String date : dates) {
orders.add(getPerformanceInfo(date, orderInfoEntities));
@@ -129,12 +135,13 @@ public class PlayClerkPerformanceController {
return R.ok(resultMap);
}
/**
* 根据订单开始时间和结束时间,组装订单统计信息的查询时间范围
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param startTime
* 开始时间
* @param endTime
* 结束时间
* @return 时间范围
*/
public List<String> getDateRangeByDay(String startTime, String endTime) {
@@ -152,8 +159,10 @@ public class PlayClerkPerformanceController {
/**
* 根据订单开始时间和结束时间,组装订单统计信息的查询时间范围
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param startTime
* 开始时间
* @param endTime
* 结束时间
* @return 时间范围
*/
public List<String> getDateRangeByMonth(String startTime, String endTime) {
@@ -168,7 +177,6 @@ public class PlayClerkPerformanceController {
return dates;
}
public PlayClerkPerformanceInfoReturnVo getTotalInfo(List<PlayOrderInfoEntity> orderInfoEntities) {
Set<String> customIds = new HashSet<>();
int orderContinueNumber = 0;
@@ -220,24 +228,28 @@ public class PlayClerkPerformanceController {
/**
* 组装统计数据
*
* @param performanceDate 统计时间
* @param orderInfoEntities 订单列表
* @param performanceDate
* 统计时间
* @param orderInfoEntities
* 订单列表
* @return 统计数据
*/
public PlayClerkPerformanceInfoReturnVo getPerformanceInfo(String performanceDate, List<PlayOrderInfoEntity> orderInfoEntities) {
public PlayClerkPerformanceInfoReturnVo getPerformanceInfo(String performanceDate,
List<PlayOrderInfoEntity> orderInfoEntities) {
List<PlayOrderInfoEntity> itemOrderInfo = new ArrayList<>();
for (PlayOrderInfoEntity orderInfoEntity : orderInfoEntities) {
//接单时间,在指定日期的 00:00:00点到23:5959之间
if (orderInfoEntity.getPurchaserTime().isAfter(LocalDateTime.parse(performanceDate + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))) && orderInfoEntity.getPurchaserTime().isBefore(LocalDateTime.parse(performanceDate + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))) {
// 接单时间,在指定日期的 00:00:00点到23:5959之间
if (orderInfoEntity.getPurchaserTime()
.isAfter(LocalDateTime.parse(performanceDate + " 00:00:00",
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
&& orderInfoEntity.getPurchaserTime().isBefore(LocalDateTime.parse(performanceDate + " 23:59:59",
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))) {
itemOrderInfo.add(orderInfoEntity);
}
}
Set<String> customIds = new HashSet<>();
int orderContinueNumber = 0;
int orderRefundNumber = 0;

View File

@@ -3,11 +3,10 @@ package com.starry.admin.modules.statistics.module.vo;
import com.starry.common.domain.BasePageEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* @author admin
* @since 2024/6/10 下午8:58
@@ -15,7 +14,7 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel(value = "店员业绩查询参数", description = "查询店员业绩统计信息的条件参数")
public class PlayClerkPerformanceInfoQueryVo extends BasePageEntity {
public class PlayClerkPerformanceInfoQueryVo extends BasePageEntity {
/**
* 分组ID
@@ -23,21 +22,18 @@ public class PlayClerkPerformanceInfoQueryVo extends BasePageEntity {
@ApiModelProperty(value = "分组ID", example = "1", notes = "店员所属分组ID")
private String groupId;
/**
* 店员ID
*/
@ApiModelProperty(value = "店员ID", example = "1", notes = "店员ID")
private String clerkId;
/**
* 店员性别
*/
@ApiModelProperty(value = "店员性别", example = "1", notes = "店员性别1男2女")
private String sex;
/**
* 店员上架状态
*/

View File

@@ -2,9 +2,8 @@ package com.starry.admin.modules.statistics.module.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import lombok.Data;
/**
* @author admin
@@ -14,7 +13,6 @@ import java.math.BigDecimal;
@ApiModel(value = "店员业绩返回数据", description = "店员业绩统计信息的返回数据")
public class PlayClerkPerformanceInfoReturnVo {
/**
* 店员ID
*/
@@ -159,5 +157,4 @@ public class PlayClerkPerformanceInfoReturnVo {
@ApiModelProperty(value = "统计时间", example = "2024-06-01")
private String performanceDate;
}

View File

@@ -5,7 +5,6 @@ import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
import com.starry.admin.modules.personnel.module.entity.PlayPersonnelGroupInfoEntity;
import com.starry.admin.modules.statistics.module.vo.PlayClerkPerformanceInfoReturnVo;
import java.util.List;
/**
@@ -14,15 +13,20 @@ import java.util.List;
**/
public interface IPlayClerkPerformanceService {
/**
* 根据店员订单ID生成店员业绩信息
*
* @param userInfo 店员信息
* @param orderInfoEntities 店员订单列表
* @param clerkLevelInfoEntity 店员等级信息
* @param groupInfoEntities 店员分组信息
* @param userInfo
* 店员信息
* @param orderInfoEntities
* 店员订单列表
* @param clerkLevelInfoEntity
* 店员等级信息
* @param groupInfoEntities
* 店员分组信息
* @return 业绩信息
*/
PlayClerkPerformanceInfoReturnVo getClerkPerformanceInfo(PlayClerkUserInfoEntity userInfo, List<PlayOrderInfoEntity> orderInfoEntities, List<PlayClerkLevelInfoEntity> clerkLevelInfoEntity, List<PlayPersonnelGroupInfoEntity> groupInfoEntities);
PlayClerkPerformanceInfoReturnVo getClerkPerformanceInfo(PlayClerkUserInfoEntity userInfo,
List<PlayOrderInfoEntity> orderInfoEntities, List<PlayClerkLevelInfoEntity> clerkLevelInfoEntity,
List<PlayPersonnelGroupInfoEntity> groupInfoEntities);
}

View File

@@ -6,12 +6,11 @@ import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
import com.starry.admin.modules.personnel.module.entity.PlayPersonnelGroupInfoEntity;
import com.starry.admin.modules.statistics.module.vo.PlayClerkPerformanceInfoReturnVo;
import com.starry.admin.modules.statistics.service.IPlayClerkPerformanceService;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.springframework.stereotype.Service;
/**
* @author admin
@@ -21,7 +20,9 @@ import java.util.Set;
public class PlayClerkPerformanceServiceImpl implements IPlayClerkPerformanceService {
@Override
public PlayClerkPerformanceInfoReturnVo getClerkPerformanceInfo(PlayClerkUserInfoEntity userInfo, List<PlayOrderInfoEntity> orderInfoEntities, List<PlayClerkLevelInfoEntity> clerkLevelInfoEntities, List<PlayPersonnelGroupInfoEntity> groupInfoEntities) {
public PlayClerkPerformanceInfoReturnVo getClerkPerformanceInfo(PlayClerkUserInfoEntity userInfo,
List<PlayOrderInfoEntity> orderInfoEntities, List<PlayClerkLevelInfoEntity> clerkLevelInfoEntities,
List<PlayPersonnelGroupInfoEntity> groupInfoEntities) {
Set<String> customIds = new HashSet<>();
int orderContinueNumber = 0;