24 changed files with 657 additions and 3 deletions
@ -0,0 +1,10 @@ |
|||||
|
# Default ignored files |
||||
|
/shelf/ |
||||
|
/workspace.xml |
||||
|
# Editor-based HTTP Client requests |
||||
|
/httpRequests/ |
||||
|
# Environment-dependent path to Maven home directory |
||||
|
/mavenHomeManager.xml |
||||
|
# Datasource local storage ignored files |
||||
|
/dataSources/ |
||||
|
/dataSources.local.xml |
||||
@ -0,0 +1 @@ |
|||||
|
yun-parent |
||||
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="CompilerConfiguration"> |
||||
|
<annotationProcessing> |
||||
|
<profile default="true" name="Default" enabled="true" /> |
||||
|
<profile name="Maven default annotation processors profile" enabled="true"> |
||||
|
<sourceOutputDir name="target/generated-sources/annotations" /> |
||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> |
||||
|
<outputRelativeToContentRoot value="true" /> |
||||
|
<module name="yun-base" /> |
||||
|
<module name="yun-admin" /> |
||||
|
</profile> |
||||
|
</annotationProcessing> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,14 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="Encoding"> |
||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/src/main/resources/dev" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/yun-admin/src/main/java" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/yun-admin/src/main/resources" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/yun-admin/src/main/resources/dev" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/yun-base/src/main/java" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/yun-base/src/main/resources" charset="UTF-8" /> |
||||
|
<file url="file://$PROJECT_DIR$/yun-base/src/main/resources/dev" charset="UTF-8" /> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,20 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="RemoteRepositoriesConfiguration"> |
||||
|
<remote-repository> |
||||
|
<option name="id" value="central" /> |
||||
|
<option name="name" value="Maven Central repository" /> |
||||
|
<option name="url" value="https://repo1.maven.org/maven2" /> |
||||
|
</remote-repository> |
||||
|
<remote-repository> |
||||
|
<option name="id" value="jboss.community" /> |
||||
|
<option name="name" value="JBoss Community repository" /> |
||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> |
||||
|
</remote-repository> |
||||
|
<remote-repository> |
||||
|
<option name="id" value="central" /> |
||||
|
<option name="name" value="Central Repository" /> |
||||
|
<option name="url" value="https://maven.aliyun.com/repository/central" /> |
||||
|
</remote-repository> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,12 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
||||
|
<component name="MavenProjectsManager"> |
||||
|
<option name="originalFiles"> |
||||
|
<list> |
||||
|
<option value="$PROJECT_DIR$/pom.xml" /> |
||||
|
</list> |
||||
|
</option> |
||||
|
</component> |
||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> |
||||
|
</project> |
||||
@ -0,0 +1,6 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="SqlDialectMappings"> |
||||
|
<file url="file://$PROJECT_DIR$/yun-admin/src/main/java/net/lab1024/sa/admin/module/letter/sql/LetterMenu.sql" dialect="GenericSQL" /> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,6 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="VcsDirectoryMappings"> |
||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" /> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,92 @@ |
|||||
|
package net.lab1024.sa.admin.common.enums; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import net.lab1024.sa.base.common.enumeration.BaseEnum; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.LocalTime; |
||||
|
import java.time.format.DateTimeFormatter; |
||||
|
|
||||
|
/** |
||||
|
* 时间枚举 |
||||
|
*/ |
||||
|
public enum DateTimeEnum implements BaseEnum { |
||||
|
|
||||
|
Q1_START(1, "第一季度开始时间", "01-01 00:00:00"), |
||||
|
Q1_END(2, "第一季度结束时间", "03-31 23:59:59"), |
||||
|
Q2_START(3, "第二季度开始时间", "04-01 00:00:00"), |
||||
|
Q2_END(4, "第二季度结束时间", "06-30 23:59:59"), |
||||
|
Q3_START(5, "第三季度开始时间", "07-01 00:00:00"), |
||||
|
Q3_END(6, "第三季度结束时间", "09-30 23:59:59"), |
||||
|
Q4_START(7, "第四季度开始时间", "10-01 00:00:00"), |
||||
|
Q4_END(8, "第四季度结束时间", "12-31 23:59:59"); |
||||
|
|
||||
|
DateTimeEnum(Integer value, String desc, String timePattern) { |
||||
|
this.value = value; |
||||
|
this.desc = desc; |
||||
|
this.timePattern = timePattern; |
||||
|
} |
||||
|
|
||||
|
private Integer value; |
||||
|
private String desc; |
||||
|
private String timePattern; |
||||
|
|
||||
|
@Override |
||||
|
public Integer getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getDesc() { |
||||
|
return desc; |
||||
|
} |
||||
|
|
||||
|
public String getTimePattern() { |
||||
|
return timePattern; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取指定年份的季度开始时间 |
||||
|
*/ |
||||
|
public LocalDateTime getQuarterStartDateTime(int year) { |
||||
|
String dateStr = year + "-" + this.timePattern.substring(0, 5) + " 00:00:00"; |
||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
||||
|
return LocalDateTime.parse(dateStr, formatter); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取指定年份的季度结束时间 |
||||
|
*/ |
||||
|
public LocalDateTime getQuarterEndDateTime(int year) { |
||||
|
String dateStr = year + "-" + this.timePattern.substring(0, 5) + " 23:59:59"; |
||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
||||
|
return LocalDateTime.parse(dateStr, formatter); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据季度编号获取开始时间 |
||||
|
*/ |
||||
|
public static LocalDateTime getQuarterStart(int year, int quarter) { |
||||
|
switch (quarter) { |
||||
|
case 1: return Q1_START.getQuarterStartDateTime(year); |
||||
|
case 2: return Q2_START.getQuarterStartDateTime(year); |
||||
|
case 3: return Q3_START.getQuarterStartDateTime(year); |
||||
|
case 4: return Q4_START.getQuarterStartDateTime(year); |
||||
|
default: throw new IllegalArgumentException("无效的季度: " + quarter); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据季度编号获取结束时间 |
||||
|
*/ |
||||
|
public static LocalDateTime getQuarterEnd(int year, int quarter) { |
||||
|
switch (quarter) { |
||||
|
case 1: return Q1_END.getQuarterEndDateTime(year); |
||||
|
case 2: return Q2_END.getQuarterEndDateTime(year); |
||||
|
case 3: return Q3_END.getQuarterEndDateTime(year); |
||||
|
case 4: return Q4_END.getQuarterEndDateTime(year); |
||||
|
default: throw new IllegalArgumentException("无效的季度: " + quarter); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
package net.lab1024.sa.admin.module.service.domain.form; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
import net.lab1024.sa.base.common.domain.PageParam; |
||||
|
|
||||
|
import javax.validation.constraints.Pattern; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* 律师统计查询表单 |
||||
|
* |
||||
|
* @author wzh |
||||
|
*/ |
||||
|
@Data |
||||
|
@Schema(description = "律师统计查询表单") |
||||
|
public class LawyerStatisticsQueryForm extends PageParam { |
||||
|
|
||||
|
@Schema(description = "季度,1,2,3,4") |
||||
|
private Integer quarter; |
||||
|
|
||||
|
@Schema(description = "年度,格式:yyyy") |
||||
|
private Integer year; |
||||
|
|
||||
|
@Schema(description = "律师姓名") |
||||
|
private String lawyerName; |
||||
|
|
||||
|
@Schema(description = "律所名称") |
||||
|
private String firmName; |
||||
|
|
||||
|
@Schema(description = "开始时间") |
||||
|
private String startTime; |
||||
|
|
||||
|
@Schema(description = "结束时间") |
||||
|
private String endTime; |
||||
|
|
||||
|
private Long userId; |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
package net.lab1024.sa.admin.module.service.domain.vo; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 律师统计信息 VO |
||||
|
* |
||||
|
* @Author wzh |
||||
|
*/ |
||||
|
|
||||
|
@Data |
||||
|
@Schema(description = "律师统计信息") |
||||
|
public class LawyerStatisticsVO { |
||||
|
|
||||
|
private Long userId; |
||||
|
|
||||
|
@Schema(description = "执业律师姓名") |
||||
|
private String lawyerName; |
||||
|
|
||||
|
@Schema(description = "执业证号") |
||||
|
private String certificateNumber; |
||||
|
|
||||
|
@Schema(description = "季度累计服务时长") |
||||
|
private Double quarterlyServiceDuration; |
||||
|
|
||||
|
@Schema(description = "季度累计服务成本") |
||||
|
private BigDecimal quarterlyServiceCost; |
||||
|
|
||||
|
@Schema(description = "年度累计服务时长") |
||||
|
private Double annualServiceDuration; |
||||
|
|
||||
|
@Schema(description = "年度累计服务成本") |
||||
|
private BigDecimal annualServiceCost; |
||||
|
} |
||||
@ -0,0 +1,90 @@ |
|||||
|
package net.lab1024.sa.admin.util; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.ZoneId; |
||||
|
import java.time.format.DateTimeFormatter; |
||||
|
import java.util.Calendar; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @program: yun-parent |
||||
|
* @description: 时间工具 |
||||
|
* @author: Mr.Wang |
||||
|
* @create: 2025-12-24 16:24 |
||||
|
**/ |
||||
|
public class DateTimeUtil { |
||||
|
/** |
||||
|
* 获取当前日期上一季度 开始时间 |
||||
|
* |
||||
|
* @return |
||||
|
*/ |
||||
|
public static TimeVo getStartQuarter() { |
||||
|
// 获取当前日期
|
||||
|
LocalDate today = LocalDate.now(); |
||||
|
TimeVo timeVo = new TimeVo(); |
||||
|
// 计算上个季度的起始和结束日期
|
||||
|
LocalDate startOfLastQuarter; |
||||
|
LocalDate endOfLastQuarter; |
||||
|
int month = today.getMonthValue(); |
||||
|
int year = today.getYear(); |
||||
|
|
||||
|
if (month >= 1 && month <= 3) { |
||||
|
// 当前是第一季度,上个季度是上一年第四季度
|
||||
|
startOfLastQuarter = LocalDate.of(year - 1, 10, 1); |
||||
|
endOfLastQuarter = LocalDate.of(year - 1, 12, 31); |
||||
|
} else if (month >= 4 && month <= 6) { |
||||
|
// 当前是第二季度,上个季度是上一年第一季度
|
||||
|
startOfLastQuarter = LocalDate.of(year - 1, 1, 1); |
||||
|
endOfLastQuarter = LocalDate.of(year - 1, 3, 31); |
||||
|
} else if (month >= 7 && month <= 9) { |
||||
|
// 当前是第三季度,上个季度是本年第一季度
|
||||
|
startOfLastQuarter = LocalDate.of(year, 1, 1); |
||||
|
endOfLastQuarter = LocalDate.of(year, 3, 31); |
||||
|
} else { |
||||
|
// 当前是第四季度,上个季度是本年第三季度
|
||||
|
startOfLastQuarter = LocalDate.of(year, 7, 1); |
||||
|
endOfLastQuarter = LocalDate.of(year, 9, 30); |
||||
|
} |
||||
|
|
||||
|
// 格式化日期以便输出
|
||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
||||
|
|
||||
|
// 输出上个季度的起始和结束日期
|
||||
|
String startTime = startOfLastQuarter.format(formatter); |
||||
|
String endTime = endOfLastQuarter.format(formatter); |
||||
|
timeVo.setStartTime(startTime); |
||||
|
timeVo.setEndTime(endTime); |
||||
|
return timeVo; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取当前年度 |
||||
|
*/ |
||||
|
public static Integer getCurrentYear() { |
||||
|
// 获取当前日期
|
||||
|
LocalDate today = LocalDate.now(); |
||||
|
return today.getYear(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 当前年度的开始时间和结束时间 |
||||
|
*/ |
||||
|
public static TimeVo getYearStartAndEnd() { |
||||
|
TimeVo timeVo = new TimeVo(); |
||||
|
LocalDate currentDate = LocalDate.now(); |
||||
|
LocalDate beginOfYear = currentDate.withDayOfYear(1); |
||||
|
LocalDate endOfYear = currentDate.withDayOfYear(currentDate.lengthOfYear()); |
||||
|
|
||||
|
//格式化
|
||||
|
//DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
|
||||
|
|
||||
|
// 输出上个季度的起始和结束日期
|
||||
|
//String startTime = beginOfYear.format(formatter);
|
||||
|
//String endTime = endOfYear.format(formatter);
|
||||
|
|
||||
|
timeVo.setYearStart(beginOfYear.toString()); |
||||
|
timeVo.setYearEnd(endOfYear.toString()); |
||||
|
return timeVo; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package net.lab1024.sa.admin.util; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @program: yun-parent |
||||
|
* @description: 时间格式 |
||||
|
* @author: Mr.Wang |
||||
|
* @create: 2025-12-25 09:03 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class TimeVo { |
||||
|
private String startTime; |
||||
|
private String endTime; |
||||
|
|
||||
|
private String yearStart; |
||||
|
|
||||
|
private String yearEnd; |
||||
|
} |
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue