Compare commits

..

8 Commits

Author SHA1 Message Date
lzm
c496f00fd2 0512新功能优化 2026-05-12 10:31:20 +08:00
lzm
1d26048bc1 0509新功能优化 2026-05-08 17:39:39 +08:00
lzm
e278ca59bd 0508优化修改 2026-05-08 09:32:53 +08:00
lzm
e3e16f73cc 优化代码 2026-04-29 17:13:18 +08:00
lzm
29005c5ee8 添加指导价法明细表 2026-04-29 15:46:24 +08:00
lzm
a319567f65 表格导出 2026-04-28 18:52:34 +08:00
lzm
7a2260fbf4 表格修改 2026-04-27 10:20:12 +08:00
lzm
2d6bbc1086 添加基础表维护 2026-04-25 18:09:36 +08:00
119 changed files with 10673 additions and 408 deletions

View File

@@ -172,6 +172,6 @@ http://127.0.0.1:48080/swagger-ui
- `doc/后端开发文档.md`
特建投框架调研补充文档:
特建投业务分析与计划文档:
- [`../doc/tejiantou_ai_requirements_20260410_v2_framework.md`](../doc/tejiantou_ai_requirements_20260410_v2_framework.md)
- [`../doc/特建投业务分析与计划.md`](../doc/特建投业务分析与计划.md)

View File

@@ -112,6 +112,7 @@ public class LyzsysWebAutoConfiguration {
config.addAllowedOriginPattern("*"); // 设置访问源地址
config.addAllowedHeader("*"); // 设置访问源请求头
config.addAllowedMethod("*"); // 设置访问源请求方法
config.addExposedHeader("Content-Disposition"); // 允许前端读取下载文件名
// 创建 UrlBasedCorsConfigurationSource 对象
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config); // 对接口配置跨域设置

View File

@@ -0,0 +1,82 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employee;
import cn.iocoder.lyzsys.framework.common.pojo.CommonResult;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeePageReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeRespVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeSimpleRespVO;
import cn.iocoder.lyzsys.module.tjt.service.employee.EmployeeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.lyzsys.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 员工")
@RestController
@RequestMapping("/tjt/employee")
@Validated
public class EmployeeController {
@Resource
private EmployeeService employeeService;
@PostMapping("/create")
@Operation(summary = "创建员工")
@PreAuthorize("@ss.hasPermission('tjt:employee:create')")
public CommonResult<Long> createEmployee(@Valid @RequestBody EmployeeSaveReqVO createReqVO) {
return success(employeeService.createEmployee(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "修改员工")
@PreAuthorize("@ss.hasPermission('tjt:employee:update')")
public CommonResult<Boolean> updateEmployee(@Valid @RequestBody EmployeeSaveReqVO updateReqVO) {
employeeService.updateEmployee(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除员工")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:employee:delete')")
public CommonResult<Boolean> deleteEmployee(@RequestParam("id") Long id) {
employeeService.deleteEmployee(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得员工详情")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:employee:query')")
public CommonResult<EmployeeRespVO> getEmployee(@RequestParam("id") Long id) {
return success(employeeService.getEmployee(id));
}
@GetMapping("/page")
@Operation(summary = "获得员工分页")
@PreAuthorize("@ss.hasPermission('tjt:employee:query')")
public CommonResult<PageResult<EmployeeRespVO>> getEmployeePage(@Valid EmployeePageReqVO pageReqVO) {
return success(employeeService.getEmployeePage(pageReqVO));
}
@GetMapping("/simple-list")
@Operation(summary = "获得员工精简列表")
public CommonResult<List<EmployeeSimpleRespVO>> getEmployeeSimpleList(
@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "officeId", required = false) Long officeId,
@RequestParam(value = "status", required = false) String status,
@RequestParam(value = "enabledFlag", required = false) Boolean enabledFlag,
@RequestParam(value = "officeLeaderFlag", required = false) Boolean officeLeaderFlag) {
return success(employeeService.getEmployeeSimpleList(keyword, officeId, status, enabledFlag, officeLeaderFlag));
}
}

View File

@@ -0,0 +1,28 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo;
import cn.iocoder.lyzsys.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Schema(description = "管理后台 - 员工分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class EmployeePageReqVO extends PageParam {
@Schema(description = "员工姓名", example = "")
private String employeeName;
@Schema(description = "所属专业所 ID", example = "1")
private Long officeId;
@Schema(description = "状态", example = "在职")
private String employeeStatus;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
@Schema(description = "是否所长", example = "false")
private Boolean officeLeaderFlag;
}

View File

@@ -0,0 +1,61 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 员工 Response VO")
@Data
public class EmployeeRespVO {
@Schema(description = "员工 ID", example = "1")
private Long id;
@Schema(description = "员工姓名")
private String employeeName;
@Schema(description = "性别")
private String gender;
@Schema(description = "所属专业所 ID")
private Long officeId;
@Schema(description = "所属专业所名称")
private String officeName;
@Schema(description = "注册类型及等级")
private String registrationType;
@Schema(description = "职称")
private String jobTitle;
@Schema(description = "注册章号")
private String registrationSealNo;
@Schema(description = "入职时间")
private LocalDate entryDate;
@Schema(description = "离职时间")
private LocalDate leaveDate;
@Schema(description = "状态")
private String employeeStatus;
@Schema(description = "备注")
private String remark;
@Schema(description = "是否所长")
private Boolean officeLeaderFlag;
@Schema(description = "排序号")
private Integer sortNo;
@Schema(description = "是否启用")
private Boolean enabledFlag;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,76 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;
import static cn.iocoder.lyzsys.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
@Schema(description = "管理后台 - 员工新增/修改 Request VO")
@Data
public class EmployeeSaveReqVO {
@Schema(description = "员工 ID", example = "1")
private Long id;
@Schema(description = "员工姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
@NotBlank(message = "员工姓名不能为空")
@Size(max = 64, message = "员工姓名长度不能超过 64 个字符")
private String employeeName;
@Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
@NotBlank(message = "性别不能为空")
@Size(max = 2, message = "性别长度不能超过 2 个字符")
private String gender;
@Schema(description = "所属专业所 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "所属专业所不能为空")
private Long officeId;
@Schema(description = "注册类型及等级", example = "一级注册建筑师")
@Size(max = 100, message = "注册类型及等级长度不能超过 100 个字符")
private String registrationType;
@Schema(description = "职称", example = "正高级")
@Size(max = 50, message = "职称长度不能超过 50 个字符")
private String jobTitle;
@Schema(description = "注册章号", example = "A123456")
@Size(max = 100, message = "注册章号长度不能超过 100 个字符")
private String registrationSealNo;
@Schema(description = "入职时间", example = "2026-01-01")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate entryDate;
@Schema(description = "离职时间", example = "2026-12-31")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate leaveDate;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "在职")
@NotBlank(message = "状态不能为空")
@Size(max = 20, message = "状态长度不能超过 20 个字符")
private String employeeStatus;
@Schema(description = "备注")
@Size(max = 255, message = "备注长度不能超过 255 个字符")
private String remark;
@Schema(description = "是否所长", example = "false")
private Boolean officeLeaderFlag;
@Schema(description = "排序号", example = "1")
private Integer sortNo;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,34 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 员工精简 Response VO")
@Data
public class EmployeeSimpleRespVO {
@Schema(description = "员工 ID", example = "1")
private Long id;
@Schema(description = "员工姓名")
private String employeeName;
@Schema(description = "所属专业所 ID")
private Long officeId;
@Schema(description = "所属专业所名称")
private String officeName;
@Schema(description = "员工状态")
private String employeeStatus;
@Schema(description = "注册类型及等级")
private String registrationType;
@Schema(description = "职称")
private String jobTitle;
@Schema(description = "是否所长")
private Boolean officeLeaderFlag;
}

View File

@@ -0,0 +1,76 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget;
import cn.iocoder.lyzsys.framework.common.pojo.CommonResult;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo.*;
import cn.iocoder.lyzsys.module.tjt.service.employeeyearcostbudget.EmployeeYearCostBudgetService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.lyzsys.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 员工年度成本预算")
@RestController
@RequestMapping("/tjt/employee-year-cost-budget")
@Validated
public class EmployeeYearCostBudgetController {
@Resource
private EmployeeYearCostBudgetService employeeYearCostBudgetService;
@PostMapping("/create")
@Operation(summary = "创建员工年度成本预算")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-cost-budget:create')")
public CommonResult<Long> createEmployeeYearCostBudget(@Valid @RequestBody EmployeeYearCostBudgetSaveReqVO createReqVO) {
return success(employeeYearCostBudgetService.createEmployeeYearCostBudget(createReqVO));
}
@PostMapping("/generate")
@Operation(summary = "按年度生成员工年度成本预算")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-cost-budget:create')")
public CommonResult<EmployeeYearCostBudgetGenerateRespVO> generateEmployeeYearCostBudget(
@Valid @RequestBody EmployeeYearCostBudgetGenerateReqVO generateReqVO) {
return success(employeeYearCostBudgetService.generateEmployeeYearCostBudget(generateReqVO));
}
@PutMapping("/update")
@Operation(summary = "修改员工年度成本预算")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-cost-budget:update')")
public CommonResult<Boolean> updateEmployeeYearCostBudget(@Valid @RequestBody EmployeeYearCostBudgetSaveReqVO updateReqVO) {
employeeYearCostBudgetService.updateEmployeeYearCostBudget(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除员工年度成本预算")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-cost-budget:delete')")
public CommonResult<Boolean> deleteEmployeeYearCostBudget(@RequestParam("id") Long id) {
employeeYearCostBudgetService.deleteEmployeeYearCostBudget(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得员工年度成本预算详情")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-cost-budget:query')")
public CommonResult<EmployeeYearCostBudgetRespVO> getEmployeeYearCostBudget(@RequestParam("id") Long id) {
return success(employeeYearCostBudgetService.getEmployeeYearCostBudget(id));
}
@GetMapping("/page")
@Operation(summary = "获得员工年度成本预算分页")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-cost-budget:query')")
public CommonResult<PageResult<EmployeeYearCostBudgetRespVO>> getEmployeeYearCostBudgetPage(
@Valid EmployeeYearCostBudgetPageReqVO pageReqVO) {
return success(employeeYearCostBudgetService.getEmployeeYearCostBudgetPage(pageReqVO));
}
}

View File

@@ -0,0 +1,22 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 员工年度成本预算按年度生成 Request VO")
@Data
public class EmployeeYearCostBudgetGenerateReqVO {
@Schema(description = "预算年度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "预算年度不能为空")
private Integer budgetYear;
@Schema(description = "默认预计发生成本", example = "0")
@DecimalMin(value = "0", message = "默认预计发生成本不能小于 0")
private BigDecimal expectedCostAmount;
}

View File

@@ -0,0 +1,22 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 员工年度成本预算按年度生成 Response VO")
@Data
public class EmployeeYearCostBudgetGenerateRespVO {
@Schema(description = "预算年度")
private Integer budgetYear;
@Schema(description = "已启用员工数量")
private Integer totalEnabledEmployeeCount;
@Schema(description = "本次新增预算记录数量")
private Integer createdCount;
@Schema(description = "已存在并跳过的预算记录数量")
private Integer skippedCount;
}

View File

@@ -0,0 +1,25 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo;
import cn.iocoder.lyzsys.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Schema(description = "管理后台 - 员工年度成本预算分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class EmployeeYearCostBudgetPageReqVO extends PageParam {
@Schema(description = "员工 ID", example = "1")
private Long employeeId;
@Schema(description = "员工姓名", example = "")
private String employeeName;
@Schema(description = "预算年度", example = "2026")
private Integer budgetYear;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,40 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 员工年度成本预算 Response VO")
@Data
public class EmployeeYearCostBudgetRespVO {
@Schema(description = "记录 ID", example = "1")
private Long id;
@Schema(description = "员工 ID")
private Long employeeId;
@Schema(description = "员工姓名")
private String employeeName;
@Schema(description = "预算年度")
private Integer budgetYear;
@Schema(description = "预计发生成本")
private BigDecimal expectedCostAmount;
@Schema(description = "备注")
private String remark;
@Schema(description = "排序号")
private Integer sortNo;
@Schema(description = "是否启用")
private Boolean enabledFlag;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,43 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 员工年度成本预算新增/修改 Request VO")
@Data
public class EmployeeYearCostBudgetSaveReqVO {
@Schema(description = "记录 ID", example = "1")
private Long id;
@Schema(description = "员工 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "员工 ID 不能为空")
private Long employeeId;
@Schema(description = "员工姓名,后端根据 employeeId 回填", example = "张三")
@Size(max = 64, message = "员工姓名长度不能超过 64 个字符")
private String employeeName;
@Schema(description = "预算年度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "预算年度不能为空")
private Integer budgetYear;
@Schema(description = "预计发生成本", requiredMode = Schema.RequiredMode.REQUIRED, example = "100000")
@NotNull(message = "预计发生成本不能为空")
private BigDecimal expectedCostAmount;
@Schema(description = "备注")
@Size(max = 255, message = "备注长度不能超过 255 个字符")
private String remark;
@Schema(description = "排序号", example = "1")
private Integer sortNo;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,78 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput;
import cn.iocoder.lyzsys.framework.common.pojo.CommonResult;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo.*;
import cn.iocoder.lyzsys.module.tjt.service.employeeyearleaderoutput.EmployeeYearLeaderOutputService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.lyzsys.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 年度所长考核产值")
@RestController
@RequestMapping("/tjt/employee-year-leader-output")
@Validated
public class EmployeeYearLeaderOutputController {
@Resource
private EmployeeYearLeaderOutputService employeeYearLeaderOutputService;
@PostMapping("/create")
@Operation(summary = "创建年度所长考核产值")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-leader-output:create')")
public CommonResult<Long> createEmployeeYearLeaderOutput(
@Valid @RequestBody EmployeeYearLeaderOutputSaveReqVO createReqVO) {
return success(employeeYearLeaderOutputService.createEmployeeYearLeaderOutput(createReqVO));
}
@PostMapping("/generate")
@Operation(summary = "按年度生成年度所长考核产值")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-leader-output:create')")
public CommonResult<EmployeeYearLeaderOutputGenerateRespVO> generateEmployeeYearLeaderOutput(
@Valid @RequestBody EmployeeYearLeaderOutputGenerateReqVO generateReqVO) {
return success(employeeYearLeaderOutputService.generateEmployeeYearLeaderOutput(generateReqVO));
}
@PutMapping("/update")
@Operation(summary = "修改年度所长考核产值")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-leader-output:update')")
public CommonResult<Boolean> updateEmployeeYearLeaderOutput(
@Valid @RequestBody EmployeeYearLeaderOutputSaveReqVO updateReqVO) {
employeeYearLeaderOutputService.updateEmployeeYearLeaderOutput(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除年度所长考核产值")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-leader-output:delete')")
public CommonResult<Boolean> deleteEmployeeYearLeaderOutput(@RequestParam("id") Long id) {
employeeYearLeaderOutputService.deleteEmployeeYearLeaderOutput(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得年度所长考核产值详情")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-leader-output:query')")
public CommonResult<EmployeeYearLeaderOutputRespVO> getEmployeeYearLeaderOutput(@RequestParam("id") Long id) {
return success(employeeYearLeaderOutputService.getEmployeeYearLeaderOutput(id));
}
@GetMapping("/page")
@Operation(summary = "获得年度所长考核产值分页")
@PreAuthorize("@ss.hasPermission('tjt:employee-year-leader-output:query')")
public CommonResult<PageResult<EmployeeYearLeaderOutputRespVO>> getEmployeeYearLeaderOutputPage(
@Valid EmployeeYearLeaderOutputPageReqVO pageReqVO) {
return success(employeeYearLeaderOutputService.getEmployeeYearLeaderOutputPage(pageReqVO));
}
}

View File

@@ -0,0 +1,22 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 年度所长考核产值按年度生成 Request VO")
@Data
public class EmployeeYearLeaderOutputGenerateReqVO {
@Schema(description = "产值年度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "产值年度不能为空")
private Integer outputYear;
@Schema(description = "默认所长考核产值", example = "0")
@DecimalMin(value = "0", message = "默认所长考核产值不能小于 0")
private BigDecimal leaderOutputAmount;
}

View File

@@ -0,0 +1,22 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 年度所长考核产值按年度生成 Response VO")
@Data
public class EmployeeYearLeaderOutputGenerateRespVO {
@Schema(description = "产值年度")
private Integer outputYear;
@Schema(description = "已启用所长数量")
private Integer totalEnabledLeaderCount;
@Schema(description = "本次新增记录数量")
private Integer createdCount;
@Schema(description = "已存在并跳过的记录数量")
private Integer skippedCount;
}

View File

@@ -0,0 +1,25 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo;
import cn.iocoder.lyzsys.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Schema(description = "管理后台 - 年度所长考核产值分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class EmployeeYearLeaderOutputPageReqVO extends PageParam {
@Schema(description = "员工 ID", example = "1")
private Long employeeId;
@Schema(description = "员工姓名", example = "")
private String employeeName;
@Schema(description = "产值年度", example = "2026")
private Integer outputYear;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,40 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 年度所长考核产值 Response VO")
@Data
public class EmployeeYearLeaderOutputRespVO {
@Schema(description = "记录 ID", example = "1")
private Long id;
@Schema(description = "员工 ID")
private Long employeeId;
@Schema(description = "员工姓名")
private String employeeName;
@Schema(description = "产值年度")
private Integer outputYear;
@Schema(description = "所长考核产值")
private BigDecimal leaderOutputAmount;
@Schema(description = "备注")
private String remark;
@Schema(description = "排序号")
private Integer sortNo;
@Schema(description = "是否启用")
private Boolean enabledFlag;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,43 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 年度所长考核产值新增/修改 Request VO")
@Data
public class EmployeeYearLeaderOutputSaveReqVO {
@Schema(description = "记录 ID", example = "1")
private Long id;
@Schema(description = "员工 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "员工 ID 不能为空")
private Long employeeId;
@Schema(description = "员工姓名,后端根据 employeeId 回填", example = "张三")
@Size(max = 64, message = "员工姓名长度不能超过 64 个字符")
private String employeeName;
@Schema(description = "产值年度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "产值年度不能为空")
private Integer outputYear;
@Schema(description = "所长考核产值", requiredMode = Schema.RequiredMode.REQUIRED, example = "100000")
@NotNull(message = "所长考核产值不能为空")
private BigDecimal leaderOutputAmount;
@Schema(description = "备注")
@Size(max = 255, message = "备注长度不能超过 255 个字符")
private String remark;
@Schema(description = "排序号", example = "1")
private Integer sortNo;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,77 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.office;
import cn.iocoder.lyzsys.framework.common.pojo.CommonResult;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficePageReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeRespVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeSimpleRespVO;
import cn.iocoder.lyzsys.module.tjt.service.office.OfficeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.lyzsys.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 专业所")
@RestController
@RequestMapping("/tjt/office")
@Validated
public class OfficeController {
@Resource
private OfficeService officeService;
@PostMapping("/create")
@Operation(summary = "创建专业所")
@PreAuthorize("@ss.hasPermission('tjt:office:create')")
public CommonResult<Long> createOffice(@Valid @RequestBody OfficeSaveReqVO createReqVO) {
return success(officeService.createOffice(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "修改专业所")
@PreAuthorize("@ss.hasPermission('tjt:office:update')")
public CommonResult<Boolean> updateOffice(@Valid @RequestBody OfficeSaveReqVO updateReqVO) {
officeService.updateOffice(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除专业所")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:office:delete')")
public CommonResult<Boolean> deleteOffice(@RequestParam("id") Long id) {
officeService.deleteOffice(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得专业所详情")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:office:query')")
public CommonResult<OfficeRespVO> getOffice(@RequestParam("id") Long id) {
return success(officeService.getOffice(id));
}
@GetMapping("/page")
@Operation(summary = "获得专业所分页")
@PreAuthorize("@ss.hasPermission('tjt:office:query')")
public CommonResult<PageResult<OfficeRespVO>> getOfficePage(@Valid OfficePageReqVO pageReqVO) {
return success(officeService.getOfficePage(pageReqVO));
}
@GetMapping("/simple-list")
@Operation(summary = "获得专业所精简列表")
public CommonResult<List<OfficeSimpleRespVO>> getOfficeSimpleList() {
return success(officeService.getOfficeSimpleList());
}
}

View File

@@ -0,0 +1,19 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo;
import cn.iocoder.lyzsys.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Schema(description = "管理后台 - 专业所分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class OfficePageReqVO extends PageParam {
@Schema(description = "专业所名称", example = "建筑")
private String officeName;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,33 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 专业所 Response VO")
@Data
public class OfficeRespVO {
@Schema(description = "专业所 ID", example = "1")
private Long id;
@Schema(description = "专业所名称", example = "建筑一所")
private String officeName;
@Schema(description = "专业所编码", example = "JZY")
private String officeCode;
@Schema(description = "排序号", example = "1")
private Integer sortNo;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,35 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
@Schema(description = "管理后台 - 专业所新增/修改 Request VO")
@Data
public class OfficeSaveReqVO {
@Schema(description = "专业所 ID", example = "1")
private Long id;
@Schema(description = "专业所名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "建筑一所")
@NotBlank(message = "专业所名称不能为空")
@Size(max = 100, message = "专业所名称长度不能超过 100 个字符")
private String officeName;
@Schema(description = "专业所编码", example = "JZY")
@Size(max = 50, message = "专业所编码长度不能超过 50 个字符")
private String officeCode;
@Schema(description = "排序号", example = "1")
private Integer sortNo;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
@Schema(description = "备注", example = "默认专业所")
@Size(max = 255, message = "备注长度不能超过 255 个字符")
private String remark;
}

View File

@@ -0,0 +1,16 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 专业所精简 Response VO")
@Data
public class OfficeSimpleRespVO {
@Schema(description = "专业所 ID", example = "1")
private Long id;
@Schema(description = "专业所名称", example = "建筑一所")
private String officeName;
}

View File

@@ -21,7 +21,7 @@ public class ProjectOutputSplitRespVO {
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "规划内容")
@Schema(description = "项目任务包")
private String planningContent;
@Schema(description = "年度")
@@ -33,20 +33,17 @@ public class ProjectOutputSplitRespVO {
@Schema(description = "项目经理")
private String projectManagerName;
@Schema(description = "项目负责人")
@Schema(description = "工程负责人")
private String engineeringLeaderName;
@Schema(description = "项目经理比例")
private BigDecimal projectManagerRatio;
@Schema(description = "项目经理/工程负责人")
private String projectLeadName;
@Schema(description = "项目经理金额")
private BigDecimal projectManagerAmount;
@Schema(description = "项目经理/工程负责人合并比例")
private BigDecimal projectLeadRatio;
@Schema(description = "项目负责人比例")
private BigDecimal engineeringLeaderRatio;
@Schema(description = "项目负责人金额")
private BigDecimal engineeringLeaderAmount;
@Schema(description = "项目经理/工程负责人合并金额")
private BigDecimal projectLeadAmount;
@Schema(description = "专业所比例")
private BigDecimal officeRatio;

View File

@@ -3,6 +3,8 @@ package cn.iocoder.lyzsys.module.tjt.controller.admin.outputsplit.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@@ -10,48 +12,62 @@ import java.math.BigDecimal;
@Data
public class ProjectOutputSplitSaveReqVO {
@Schema(description = "规划 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "规划 ID 不能为空")
@Schema(description = "规划 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "规划 ID 不能为空")
private Long planningId;
@Schema(description = "项目经理比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0200")
@NotNull(message = "项目经理比例不能为空")
private BigDecimal projectManagerRatio;
@Schema(description = "项目负责人比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0300")
@NotNull(message = "项目负责人比例不能为空")
private BigDecimal engineeringLeaderRatio;
@Schema(description = "项目经理/工程负责人合并比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0550")
@NotNull(message = "项目经理/工程负责人合并比例不能为空")
@DecimalMin(value = "0.0000", message = "projectLeadRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "projectLeadRatio must be <= 1")
private BigDecimal projectLeadRatio;
@Schema(description = "专业所比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.9500")
@NotNull(message = "专业所比例不能为空")
@DecimalMin(value = "0.0000", message = "officeRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "officeRatio must be <= 1")
private BigDecimal officeRatio;
@Schema(description = "建筑专业比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.5000")
@NotNull(message = "建筑专业比例不能为空")
@DecimalMin(value = "0.0000", message = "archRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "archRatio must be <= 1")
private BigDecimal archRatio;
@Schema(description = "装修专业比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0000")
@NotNull(message = "装修专业比例不能为空")
@DecimalMin(value = "0.0000", message = "decorRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "decorRatio must be <= 1")
private BigDecimal decorRatio;
@Schema(description = "结构专业比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.2000")
@NotNull(message = "结构专业比例不能为空")
@DecimalMin(value = "0.0000", message = "structRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "structRatio must be <= 1")
private BigDecimal structRatio;
@Schema(description = "水专业比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.1000")
@NotNull(message = "水专业比例不能为空")
@DecimalMin(value = "0.0000", message = "waterRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "waterRatio must be <= 1")
private BigDecimal waterRatio;
@Schema(description = "电气专业比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.1000")
@NotNull(message = "电气专业比例不能为空")
@DecimalMin(value = "0.0000", message = "elecRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "elecRatio must be <= 1")
private BigDecimal elecRatio;
@Schema(description = "暖通专业比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0500")
@NotNull(message = "暖通专业比例不能为空")
@DecimalMin(value = "0.0000", message = "hvacRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "hvacRatio must be <= 1")
private BigDecimal hvacRatio;
@Schema(description = "数字化设计专业比例", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0500")
@NotNull(message = "数字化设计专业比例不能为空")
@DecimalMin(value = "0.0000", message = "digitalRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "digitalRatio must be <= 1")
private BigDecimal digitalRatio;
}

View File

@@ -24,7 +24,7 @@ public class ProjectPlanningPageReqVO extends PageParam {
@Schema(description = "产值计算方式", example = "指导价法")
private String calculationMethod;
@Schema(description = "规划内容,模糊匹配", example = "建筑")
@Schema(description = "项目任务包,模糊匹配", example = "建筑")
private String planningContent;
@Schema(description = "开始年度", example = "2026")

View File

@@ -16,25 +16,43 @@ public class ProjectPlanningRespVO {
@Schema(description = "项目 ID", example = "1")
private Long projectId;
@Schema(description = "排序")
private Integer sortNo;
@Schema(description = "归属类型")
private String ownershipType;
@Schema(description = "产值计算方式")
private String calculationMethod;
@Schema(description = "规划内容")
@Schema(description = "项目任务包")
private String planningContent;
@Schema(description = "规划金额")
@Schema(description = "分项合同产值")
private BigDecimal planningAmount;
@Schema(description = "管理费费率")
@Schema(description = "合同产值数量")
private BigDecimal contractValueQuantity;
@Schema(description = "合同产值单价")
private BigDecimal contractValueUnitPrice;
@Schema(description = "管理费率")
private BigDecimal managementFeeRate;
@Schema(description = "管理费")
private BigDecimal managementFee;
@Schema(description = "实施团队")
@Schema(description = "增值税率")
private BigDecimal vatRate;
@Schema(description = "增值税")
private BigDecimal vatAmount;
@Schema(description = "项目预算产值")
private BigDecimal projectBudgetOutputValue;
@Schema(description = "意向实施团队")
private String implementationTeam;
@Schema(description = "开始年度")
@@ -64,25 +82,25 @@ public class ProjectPlanningRespVO {
@Schema(description = "待分配比例")
private BigDecimal pendingAmount;
@Schema(description = "Planning progress remark")
@Schema(description = "提取进度备注")
private String progressRemark;
@Schema(description = "楼栋数或户型数")
private Integer buildingOrUnitCount;
@Schema(description = "套图系数,保留两位小数")
@Schema(description = "套图系数")
private BigDecimal drawingSetFactor;
@Schema(description = "规模系数,保留两位小数")
@Schema(description = "规模系数")
private BigDecimal scaleFactor;
@Schema(description = "修改系数,保留两位小数")
@Schema(description = "修改系数")
private BigDecimal modificationFactor;
@Schema(description = "复杂系数/复杂等级按比例值返回100%=1.0000")
@Schema(description = "复杂系数")
private BigDecimal complexityFactor;
@Schema(description = "内部指导单价(元/")
@Schema(description = "内部指导单价(元/")
private BigDecimal internalGuidanceUnitPrice;
@Schema(description = "虚拟产值计算方式")
@@ -100,13 +118,10 @@ public class ProjectPlanningRespVO {
@Schema(description = "指导总价")
private BigDecimal guidanceTotalPrice;
@Schema(description = "虚拟总价")
private BigDecimal virtualTotalPrice;
@Schema(description = "产值计算比例")
private BigDecimal calculationRatio;
@Schema(description = "合同单价(元/")
@Schema(description = "合同单价(元/")
private BigDecimal contractUnitPrice;
@Schema(description = "合计调整系数")

View File

@@ -3,6 +3,8 @@ package cn.iocoder.lyzsys.module.tjt.controller.admin.planning.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@@ -19,31 +21,50 @@ public class ProjectPlanningSaveReqVO {
@NotNull(message = "项目 ID 不能为空")
private Long projectId;
@Schema(description = "排序", example = "0")
private Integer sortNo;
@Schema(description = "归属类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "专业所")
@NotBlank(message = "归属类型不能为空")
@Size(max = 20, message = "归属类型长度不能超过 20 个字符")
private String ownershipType;
@Schema(description = "产值计算方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "指导价法")
@NotBlank(message = "产值计算方式不能为空")
@Schema(description = "产值计算方式,页面 2 维护", example = "指导价法")
@Size(max = 30, message = "产值计算方式长度不能超过 30 个字符")
private String calculationMethod;
@Schema(description = "规划内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "建筑设计")
@NotBlank(message = "规划内容不能为空")
@Size(max = 255, message = "规划内容长度不能超过 255 个字符")
@Schema(description = "项目任务包", requiredMode = Schema.RequiredMode.REQUIRED, example = "建筑设计")
@NotBlank(message = "项目任务包不能为空")
@Size(max = 255, message = "项目任务包长度不能超过 255 个字符")
private String planningContent;
@Schema(description = "规划金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "500000")
@NotNull(message = "规划金额不能为空")
@Schema(description = "分项合同产值,系统根据合同产值数量和合同产值单价自动计算", example = "500000")
private BigDecimal planningAmount;
@Schema(description = "管理费费率", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0500")
@NotNull(message = "管理费费率不能为空")
@Schema(description = "合同产值数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "合同产值数量不能为空")
@DecimalMin(value = "0.0000", message = "contractValueQuantity must be >= 0")
private BigDecimal contractValueQuantity;
@Schema(description = "合同产值单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "500000")
@NotNull(message = "合同产值单价不能为空")
@DecimalMin(value = "0.0000", message = "contractValueUnitPrice must be >= 0")
private BigDecimal contractValueUnitPrice;
@Schema(description = "管理费率", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0500")
@NotNull(message = "管理费率不能为空")
@DecimalMin(value = "0.0000", message = "managementFeeRate must be >= 0")
@DecimalMax(value = "1.0000", message = "managementFeeRate must be <= 1")
private BigDecimal managementFeeRate;
@Schema(description = "实施团队", example = "建筑一所")
@Size(max = 100, message = "实施团队长度不能超过 100 个字符")
@Schema(description = "增值税率", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.0600")
@NotNull(message = "增值税率不能为空")
@DecimalMin(value = "0.0000", message = "vatRate must be >= 0")
@DecimalMax(value = "1.0000", message = "vatRate must be <= 1")
private BigDecimal vatRate;
@Schema(description = "意向实施团队", example = "建筑一所")
@Size(max = 100, message = "意向实施团队长度不能超过 100 个字符")
private String implementationTeam;
@Schema(description = "开始年度", example = "2026")
@@ -57,19 +78,25 @@ public class ProjectPlanningSaveReqVO {
private String designStage;
@Schema(description = "本次设计阶段比例", example = "0.3000")
@DecimalMin(value = "0.0000", message = "currentDesignStageRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "currentDesignStageRatio must be <= 1")
private BigDecimal currentDesignStageRatio;
@Schema(description = "审核审定是否外包", example = "false")
private Boolean reviewOutsourceFlag;
@Schema(description = "审核审定占比", example = "0.0600")
@DecimalMin(value = "0.0000", message = "reviewOutsourceRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "reviewOutsourceRatio must be <= 1")
private BigDecimal reviewOutsourceRatio;
@Schema(description = "总分配比例", example = "1.0000")
@DecimalMin(value = "0.0000", message = "totalDistributionAmount must be >= 0")
@DecimalMax(value = "1.0000", message = "totalDistributionAmount must be <= 1")
private BigDecimal totalDistributionAmount;
@Schema(description = "Planning progress remark", example = "Q1 extraction arrangement")
@Size(max = 500, message = "Progress remark length must be within 500 characters")
@Schema(description = "提取进度备注", example = "Q1 提取安排")
@Size(max = 500, message = "提取进度备注长度不能超过 500 个字符")
private String progressRemark;
@Schema(description = "楼栋数或户型数", example = "10")
@@ -85,12 +112,14 @@ public class ProjectPlanningSaveReqVO {
private BigDecimal modificationFactor;
@Schema(description = "复杂系数/复杂等级按比例值存储100%=1.0000", example = "1.0000")
@DecimalMin(value = "0.0000", message = "complexityFactor must be >= 0")
@DecimalMax(value = "1.0000", message = "complexityFactor must be <= 1")
private BigDecimal complexityFactor;
@Schema(description = "内部指导单价(元/", example = "80.00")
@Schema(description = "内部指导单价(元/", example = "80.00")
private BigDecimal internalGuidanceUnitPrice;
@Schema(description = "虚拟产值计算方式", example = "工日法")
@Schema(description = "虚拟产值计算方式:指导单价法/指导总价法/工日法", example = "工日法")
@Size(max = 30, message = "虚拟产值计算方式长度不能超过 30 个字符")
private String virtualCalculationMethod;
@@ -106,10 +135,9 @@ public class ProjectPlanningSaveReqVO {
@Schema(description = "指导总价", example = "880000.00")
private BigDecimal guidanceTotalPrice;
@Schema(description = "虚拟总价", example = "600000.00")
private BigDecimal virtualTotalPrice;
@Schema(description = "产值计算比例", example = "0.0800")
@DecimalMin(value = "0.0000", message = "calculationRatio must be >= 0")
@DecimalMax(value = "1.0000", message = "calculationRatio must be <= 1")
private BigDecimal calculationRatio;
}

View File

@@ -0,0 +1,66 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.planningguidedetail;
import cn.iocoder.lyzsys.framework.common.pojo.CommonResult;
import cn.iocoder.lyzsys.framework.common.util.object.BeanUtils;
import cn.iocoder.lyzsys.module.tjt.controller.admin.planningguidedetail.vo.ProjectPlanningGuideDetailBatchSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.planningguidedetail.vo.ProjectPlanningGuideDetailRespVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.planningguidedetail.ProjectPlanningGuideDetailDO;
import cn.iocoder.lyzsys.module.tjt.service.planningguidedetail.ProjectPlanningGuideDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.lyzsys.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 合约规划指导价法明细")
@RestController
@RequestMapping("/tjt/planning-guide-detail")
@Validated
public class ProjectPlanningGuideDetailController {
@Resource
private ProjectPlanningGuideDetailService projectPlanningGuideDetailService;
@GetMapping("/list-by-planning")
@Operation(summary = "根据合约规划获得指导价法明细列表")
@Parameter(name = "planningId", description = "合约规划 ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:planning:query')")
public CommonResult<List<ProjectPlanningGuideDetailRespVO>> getProjectPlanningGuideDetailListByPlanningId(
@RequestParam("planningId") Long planningId) {
List<ProjectPlanningGuideDetailDO> list =
projectPlanningGuideDetailService.getProjectPlanningGuideDetailListByPlanningId(planningId);
return success(BeanUtils.toBean(list, ProjectPlanningGuideDetailRespVO.class));
}
@PostMapping("/batch-save")
@Operation(summary = "批量保存指导价法明细")
@PreAuthorize("@ss.hasPermission('tjt:planning:update')")
public CommonResult<Boolean> batchSaveProjectPlanningGuideDetail(
@Valid @RequestBody ProjectPlanningGuideDetailBatchSaveReqVO reqVO) {
projectPlanningGuideDetailService.batchSaveProjectPlanningGuideDetail(reqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除指导价法明细")
@Parameter(name = "id", description = "明细 ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:planning:update')")
public CommonResult<Boolean> deleteProjectPlanningGuideDetail(@RequestParam("id") Long id) {
projectPlanningGuideDetailService.deleteProjectPlanningGuideDetail(id);
return success(true);
}
}

View File

@@ -0,0 +1,22 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.planningguidedetail.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
@Schema(description = "管理后台 - 合约规划指导价法明细批量保存 Request VO")
@Data
public class ProjectPlanningGuideDetailBatchSaveReqVO {
@Schema(description = "合约规划 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "合约规划 ID 不能为空")
private Long planningId;
@Schema(description = "指导价法明细列表")
@Valid
private List<ProjectPlanningGuideDetailSaveReqVO> details;
}

View File

@@ -0,0 +1,70 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.planningguidedetail.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 合约规划指导价法明细 Response VO")
@Data
public class ProjectPlanningGuideDetailRespVO {
@Schema(description = "明细 ID", example = "1")
private Long id;
@Schema(description = "合约规划 ID", example = "1")
private Long planningId;
@Schema(description = "项目 ID", example = "1")
private Long projectId;
@Schema(description = "设计部位")
private String designPart;
@Schema(description = "建筑类型")
private String buildingType;
@Schema(description = "设计面积")
private BigDecimal designArea;
@Schema(description = "内部指导单价(元/m²)")
private BigDecimal internalGuidanceUnitPrice;
@Schema(description = "楼栋数/户型数")
private Integer buildingOrUnitCount;
@Schema(description = "套图系数")
private BigDecimal drawingSetFactor;
@Schema(description = "规模系数")
private BigDecimal scaleFactor;
@Schema(description = "修改系数")
private BigDecimal modificationFactor;
@Schema(description = "复杂系数")
private BigDecimal complexityFactor;
@Schema(description = "合计调整系数")
private BigDecimal totalAdjustmentFactor;
@Schema(description = "设计占比")
private BigDecimal designRatio;
@Schema(description = "考核面积")
private BigDecimal assessmentArea;
@Schema(description = "考核产值")
private BigDecimal assessmentOutputValue;
@Schema(description = "排序号")
private Integer sortNo;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,76 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.planningguidedetail.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 合约规划指导价法明细新增/修改 Request VO")
@Data
public class ProjectPlanningGuideDetailSaveReqVO {
@Schema(description = "明细 ID", example = "1")
private Long id;
@Schema(description = "设计部位", requiredMode = Schema.RequiredMode.REQUIRED, example = "地上部分")
@NotBlank(message = "设计部位不能为空")
@Size(max = 20, message = "设计部位长度不能超过 20 个字符")
private String designPart;
@Schema(description = "建筑类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "住宅")
@NotBlank(message = "建筑类型不能为空")
@Size(max = 100, message = "建筑类型长度不能超过 100 个字符")
private String buildingType;
@Schema(description = "设计面积", requiredMode = Schema.RequiredMode.REQUIRED, example = "12000")
@NotNull(message = "设计面积不能为空")
@DecimalMin(value = "0", message = "designArea must be >= 0")
private BigDecimal designArea;
@Schema(description = "内部指导单价(元/m²)", requiredMode = Schema.RequiredMode.REQUIRED, example = "80")
@NotNull(message = "内部指导单价不能为空")
@DecimalMin(value = "0", message = "internalGuidanceUnitPrice must be >= 0")
private BigDecimal internalGuidanceUnitPrice;
@Schema(description = "楼栋数/户型数", example = "10")
private Integer buildingOrUnitCount;
@Schema(description = "套图系数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1.0000")
@NotNull(message = "套图系数不能为空")
@DecimalMin(value = "0", message = "drawingSetFactor must be >= 0")
private BigDecimal drawingSetFactor;
@Schema(description = "规模系数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1.0000")
@NotNull(message = "规模系数不能为空")
@DecimalMin(value = "0", message = "scaleFactor must be >= 0")
private BigDecimal scaleFactor;
@Schema(description = "修改系数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1.0000")
@NotNull(message = "修改系数不能为空")
@DecimalMin(value = "0", message = "modificationFactor must be >= 0")
private BigDecimal modificationFactor;
@Schema(description = "复杂系数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1.0000")
@NotNull(message = "复杂系数不能为空")
@DecimalMin(value = "0", message = "complexityFactor must be >= 0")
private BigDecimal complexityFactor;
@Schema(description = "设计占比", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.5000")
@NotNull(message = "设计占比不能为空")
@DecimalMin(value = "0", message = "designRatio must be >= 0")
@DecimalMax(value = "1", message = "designRatio must be <= 1")
private BigDecimal designRatio;
@Schema(description = "排序号", example = "1")
private Integer sortNo;
@Schema(description = "备注", example = "样板房")
@Size(max = 500, message = "备注长度不能超过 500 个字符")
private String remark;
}

View File

@@ -6,32 +6,29 @@ import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 季度分配 Response VO")
@Schema(description = "Admin - project planning quarter Response VO")
@Data
public class ProjectPlanningQuarterRespVO {
@Schema(description = "季度分配 ID", example = "1")
@Schema(description = "Quarter distribution ID", example = "1")
private Long id;
@Schema(description = "合约规划 ID", example = "1")
@Schema(description = "Planning ID", example = "1")
private Long planningId;
@Schema(description = "分配年度")
@Schema(description = "Distribution year")
private Integer distributionYear;
@Schema(description = "季度")
@Schema(description = "Quarter number")
private Integer quarterNo;
@Schema(description = "分配比例")
@Schema(description = "Distribution ratio")
private BigDecimal distributionRatio;
@Schema(description = "分配金额")
@Schema(description = "Distribution amount")
private BigDecimal distributionAmount;
@Schema(description = "提取进度备注")
private String progressRemark;
@Schema(description = "创建时间")
@Schema(description = "Create time")
private LocalDateTime createTime;
}

View File

@@ -6,35 +6,30 @@ import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 季度分配新增/修改 Request VO")
@Schema(description = "Admin - project planning quarter save Request VO")
@Data
public class ProjectPlanningQuarterSaveReqVO {
@Schema(description = "季度分配 ID", example = "1")
@Schema(description = "Quarter distribution ID", example = "1")
private Long id;
@Schema(description = "合约规划 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "合约规划 ID 不能为空")
@Schema(description = "Planning ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "planningId cannot be null")
private Long planningId;
@Schema(description = "分配年度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "分配年度不能为空")
@Schema(description = "Distribution year", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "distributionYear cannot be null")
private Integer distributionYear;
@Schema(description = "季度", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "季度不能为空")
@Min(value = 1, message = "季度必须在 1 到 4 之间")
@Max(value = 4, message = "季度必须在 1 到 4 之间")
@Schema(description = "Quarter number", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "quarterNo cannot be null")
@Min(value = 1, message = "quarterNo must be between 1 and 4")
@Max(value = 4, message = "quarterNo must be between 1 and 4")
private Integer quarterNo;
@Schema(description = "分配比例", example = "0.2500")
@Schema(description = "Distribution ratio", example = "0.2500")
private BigDecimal distributionRatio;
@Schema(description = "提取进度备注", example = "Q1 提取")
@Size(max = 500, message = "提取进度备注长度不能超过 500 个字符")
private String progressRemark;
}

View File

@@ -15,7 +15,7 @@ import static cn.iocoder.lyzsys.framework.common.util.date.DateUtils.FORMAT_YEAR
@EqualsAndHashCode(callSuper = true)
public class ProjectProfitPageReqVO extends PageParam {
@Schema(description = "工程名称,模糊匹配", example = "设计")
@Schema(description = "项目名称,模糊匹配", example = "设计")
private String projectName;
@Schema(description = "是否签订合同", example = "true")

View File

@@ -13,18 +13,24 @@ public class ProjectProfitRespVO {
@Schema(description = "项目 ID", example = "1")
private Long projectId;
@Schema(description = "工程名称")
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "排序")
private Integer sortNo;
@Schema(description = "是否签订合同")
private Boolean contractSignedFlag;
@Schema(description = "合同金额")
@Schema(description = "合同产值")
private BigDecimal contractAmount;
@Schema(description = "最终结算金额")
private BigDecimal finalSettlementAmount;
@Schema(description = "有效结算金额,最终结算金额大于 0 时取最终结算金额,否则取合同产值")
private BigDecimal effectiveSettlementAmount;
@Schema(description = "综合所协作金额")
private BigDecimal comprehensivePlanningAmount;
@@ -34,12 +40,18 @@ public class ProjectProfitRespVO {
@Schema(description = "专业所产值")
private BigDecimal majorOutputValue;
@Schema(description = "预计 K 值")
private BigDecimal expectedKValue;
@Schema(description = "专业所预计绩效")
private BigDecimal majorExpectedPerformance;
@Schema(description = "科创产值比例")
private BigDecimal innovationOutputRate;
@Schema(description = "科创产值")
private BigDecimal innovationOutputValue;
@Schema(description = "其他成本")
private BigDecimal otherCost;
@Schema(description = "盈亏值")
private BigDecimal profitLossValue;

View File

@@ -2,11 +2,9 @@ package cn.iocoder.lyzsys.module.tjt.controller.admin.project;
import cn.iocoder.lyzsys.framework.common.pojo.CommonResult;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.common.util.object.BeanUtils;
import cn.iocoder.lyzsys.module.tjt.controller.admin.project.vo.ProjectPageReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.project.vo.ProjectRespVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.project.vo.ProjectSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.project.ProjectDO;
import cn.iocoder.lyzsys.module.tjt.service.project.ProjectService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -67,8 +65,7 @@ public class ProjectController {
@Operation(summary = "获得项目分页")
@PreAuthorize("@ss.hasPermission('tjt:project:query')")
public CommonResult<PageResult<ProjectRespVO>> getProjectPage(@Valid ProjectPageReqVO pageReqVO) {
PageResult<ProjectDO> pageResult = projectService.getProjectPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProjectRespVO.class));
return success(projectService.getProjectPage(pageReqVO));
}
@GetMapping("/get")
@@ -76,7 +73,7 @@ public class ProjectController {
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:project:query')")
public CommonResult<ProjectRespVO> getProject(@RequestParam("id") Long id) {
return success(BeanUtils.toBean(projectService.getProject(id), ProjectRespVO.class));
return success(projectService.getProject(id));
}
}

View File

@@ -15,7 +15,7 @@ import static cn.iocoder.lyzsys.framework.common.util.date.DateUtils.FORMAT_YEAR
@EqualsAndHashCode(callSuper = true)
public class ProjectPageReqVO extends PageParam {
@Schema(description = "工程名称,模糊匹配", example = "设计")
@Schema(description = "项目名称,模糊匹配", example = "设计")
private String projectName;
@Schema(description = "是否签订合同", example = "true")
@@ -24,6 +24,9 @@ public class ProjectPageReqVO extends PageParam {
@Schema(description = "项目开始年度", example = "2026")
private Integer projectStartYear;
@Schema(description = "项目状态", example = "进行中")
private String projectStatus;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@Schema(description = "创建时间")
private LocalDateTime[] createTime;

View File

@@ -9,6 +9,7 @@ import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 项目 Response VO")
@Data
@@ -21,16 +22,20 @@ public class ProjectRespVO {
@ExcelProperty("项目ID")
private Long id;
@Schema(description = "工程名称", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("工程名称")
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("项目名称")
private String projectName;
@Schema(description = "排序")
@ExcelProperty("排序")
private Integer sortNo;
@Schema(description = "是否签订合同", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("是否签订合同")
private Boolean contractSignedFlag;
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("合同金额")
@Schema(description = "合同产值", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("合同产值")
private BigDecimal contractAmount;
@Schema(description = "工程总面积", requiredMode = Schema.RequiredMode.REQUIRED)
@@ -41,12 +46,12 @@ public class ProjectRespVO {
@ExcelProperty("建设单位")
private String constructionUnitName;
@Schema(description = "联系人")
@ExcelProperty("联系人")
@Schema(description = "建设单位联系人")
@ExcelProperty("建设单位联系人")
private String contactName;
@Schema(description = "联系方式")
@ExcelProperty("联系方式")
@Schema(description = "建设单位联系电话")
@ExcelProperty("建设单位联系电话")
private String contactPhone;
@Schema(description = "合同签订日期")
@@ -66,20 +71,47 @@ public class ProjectRespVO {
@ExcelProperty("工程类型")
private String projectType;
@Schema(description = "工程类别")
@ExcelProperty("工程类别")
private String projectCategory;
@Schema(description = "项目开始年度")
@ExcelProperty("项目开始年度")
private Integer projectStartYear;
@Schema(description = "项目状态")
@ExcelProperty("项目状态")
private String projectStatus;
@Schema(description = "是否封档")
private Boolean archiveFlag;
@Schema(description = "封档时间")
private LocalDateTime archiveTime;
@Schema(description = "暂停原因")
private String pauseReason;
@Schema(description = "中止原因")
private String terminateReason;
@Schema(description = "最终结算金额")
@ExcelProperty("最终结算金额")
private BigDecimal finalSettlementAmount;
@Schema(description = "预计 K 值")
@ExcelProperty("预计 K 值")
private BigDecimal expectedKValue;
@Schema(description = "科创产值比例")
@ExcelProperty("科创产值比例")
private BigDecimal innovationOutputRate;
@Schema(description = "其他成本")
@ExcelProperty("其他成本")
private BigDecimal otherCost;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "项目角色人员列表")
private List<ProjectRolePersonRespVO> rolePersons;
}

View File

@@ -0,0 +1,31 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.project.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "管理后台 - 项目角色人员 Response VO")
@Data
public class ProjectRolePersonRespVO {
@Schema(description = "主键 ID", example = "1")
private Long id;
@Schema(description = "项目 ID", example = "1")
private Long projectId;
@Schema(description = "角色编码", example = "project_manager")
private String roleCode;
@Schema(description = "角色名称", example = "项目经理")
private String roleName;
@Schema(description = "员工 ID", example = "1")
private Long employeeId;
@Schema(description = "员工姓名", example = "张三")
private String employeeName;
@Schema(description = "排序号", example = "1")
private Integer sortNo;
}

View File

@@ -0,0 +1,29 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.project.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@Schema(description = "管理后台 - 项目角色人员新增/修改 Request VO")
@Data
public class ProjectRolePersonSaveReqVO {
@Schema(description = "角色编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "project_manager")
@NotBlank(message = "角色编码不能为空")
private String roleCode;
@Schema(description = "员工 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "员工 ID 不能为空")
private Long employeeId;
@Schema(description = "员工姓名,后端根据 employeeId 回填", example = "张三")
@Size(max = 64, message = "员工姓名长度不能超过 64 个字符")
private String employeeName;
@Schema(description = "排序号", example = "1")
private Integer sortNo;
}

View File

@@ -5,6 +5,9 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.Valid;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@@ -20,17 +23,20 @@ public class ProjectSaveReqVO {
@Schema(description = "项目 ID", example = "1")
private Long id;
@Schema(description = "工程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "XX 设计项目")
@NotBlank(message = "工程名称不能为空")
@Size(max = 200, message = "工程名称长度不能超过 200 个字符")
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "XX 设计项目")
@NotBlank(message = "项目名称不能为空")
@Size(max = 200, message = "项目名称长度不能超过 200 个字符")
private String projectName;
@Schema(description = "排序", example = "0")
private Integer sortNo;
@Schema(description = "是否签订合同", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "是否签订合同不能为空")
private Boolean contractSignedFlag;
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000000")
@NotNull(message = "合同金额不能为空")
@Schema(description = "合同产值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000000")
@NotNull(message = "合同产值不能为空")
private BigDecimal contractAmount;
@Schema(description = "工程总面积", requiredMode = Schema.RequiredMode.REQUIRED, example = "30000")
@@ -41,12 +47,12 @@ public class ProjectSaveReqVO {
@Size(max = 200, message = "建设单位长度不能超过 200 个字符")
private String constructionUnitName;
@Schema(description = "联系人", example = "张三")
@Size(max = 64, message = "联系人长度不能超过 64 个字符")
@Schema(description = "建设单位联系人", example = "张三")
@Size(max = 64, message = "建设单位联系人长度不能超过 64 个字符")
private String contactName;
@Schema(description = "联系方式", example = "13800000000")
@Size(max = 32, message = "联系方式长度不能超过 32 个字符")
@Schema(description = "建设单位联系电话", example = "13800000000")
@Size(max = 32, message = "建设单位联系电话长度不能超过 32 个字符")
private String contactPhone;
@Schema(description = "合同签订日期", example = "2026-04-14")
@@ -54,26 +60,43 @@ public class ProjectSaveReqVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate contractSigningDate;
@Schema(description = "项目经理", example = "李四")
@Size(max = 64, message = "项目经理长度不能超过 64 个字符")
private String projectManagerName;
@Schema(description = "工程负责人", example = "王五")
@Size(max = 64, message = "工程负责人长度不能超过 64 个字符")
private String engineeringPrincipalName;
@Schema(description = "工程类型", example = "住宅")
@Schema(description = "工程类型", example = "建筑工程")
@Size(max = 50, message = "工程类型长度不能超过 50 个字符")
private String projectType;
@Schema(description = "工程类别", example = "住宅")
@Size(max = 50, message = "工程类别长度不能超过 50 个字符")
private String projectCategory;
@Schema(description = "项目开始年度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "项目开始年度不能为空")
private Integer projectStartYear;
@Schema(description = "项目状态", example = "进行中")
@Size(max = 20, message = "项目状态长度不能超过 20 个字符")
private String projectStatus;
@Schema(description = "暂停原因")
@Size(max = 255, message = "暂停原因长度不能超过 255 个字符")
private String pauseReason;
@Schema(description = "中止原因")
@Size(max = 255, message = "中止原因长度不能超过 255 个字符")
private String terminateReason;
@Schema(description = "最终结算金额", example = "1200000")
private BigDecimal finalSettlementAmount;
@Schema(description = "预计 K 值", example = "0.8500")
private BigDecimal expectedKValue;
@Schema(description = "科创产值比例", example = "0.0100")
@DecimalMin(value = "0.0000", message = "科创产值比例不能小于 0%")
@DecimalMax(value = "1.0000", message = "科创产值比例不能大于 100%")
private BigDecimal innovationOutputRate;
@Schema(description = "其他成本", example = "20000.00")
private BigDecimal otherCost;
@Schema(description = "项目角色人员列表")
@Valid
private java.util.List<ProjectRolePersonSaveReqVO> rolePersons;
}

View File

@@ -0,0 +1,112 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report;
import cn.iocoder.lyzsys.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.lyzsys.framework.common.pojo.CommonResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo.*;
import cn.iocoder.lyzsys.module.tjt.service.report.ProjectOutputReportService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import static cn.iocoder.lyzsys.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.lyzsys.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 产值报表导出")
@RestController
@RequestMapping("/tjt/report")
@Validated
public class ProjectOutputReportController {
@Resource
private ProjectOutputReportService projectOutputReportService;
@GetMapping("/project-budget/export-excel")
@Operation(summary = "导出项目考核产值预算表")
@PreAuthorize("@ss.hasPermission('tjt:report-budget:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProjectBudgetExcel(HttpServletResponse response,
@Valid ProjectBudgetExportReqVO reqVO) throws IOException {
projectOutputReportService.exportProjectBudgetExcel(response, reqVO);
}
@GetMapping("/project-quarter-output/export-excel")
@Operation(summary = "导出项目级年度季度计取表")
@PreAuthorize("@ss.hasPermission('tjt:report-project-quarter:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProjectQuarterOutputExcel(HttpServletResponse response,
@Valid ProjectQuarterOutputExportReqVO reqVO) throws IOException {
projectOutputReportService.exportProjectQuarterOutputExcel(response, reqVO);
}
@GetMapping("/project-lead-quarter-output/export-excel")
@Operation(summary = "导出工程负责人年度季度计取表")
@PreAuthorize("@ss.hasPermission('tjt:report-project-quarter:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProjectLeadQuarterOutputExcel(HttpServletResponse response,
@Valid ProjectLeadQuarterOutputExportReqVO reqVO)
throws IOException {
projectOutputReportService.exportProjectLeadQuarterOutputExcel(response, reqVO);
}
@GetMapping("/specialty-person-output/export-excel")
@Operation(summary = "导出专业内人员年度季度计取表")
@PreAuthorize("@ss.hasPermission('tjt:report-specialty-person:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportSpecialtyPersonOutputExcel(HttpServletResponse response,
@Valid SpecialtyPersonOutputExportReqVO reqVO) throws IOException {
projectOutputReportService.exportSpecialtyPersonOutputExcel(response, reqVO);
}
@GetMapping("/specialty-person-output/preview")
@Operation(summary = "预览专业内人员年度季度计取表")
@PreAuthorize("@ss.hasAnyPermissions('tjt:report-specialty-person:query', 'tjt:report-specialty-person:export')")
public CommonResult<SpecialtyPersonOutputPreviewRespVO> getSpecialtyPersonOutputPreview(
@Valid SpecialtyPersonOutputPreviewReqVO reqVO) {
return success(projectOutputReportService.getSpecialtyPersonOutputPreview(reqVO));
}
@GetMapping("/project-overview/preview")
@Operation(summary = "预览项目总览表")
@PreAuthorize("@ss.hasAnyPermissions('tjt:report-summary:query', 'tjt:report-summary:export')")
public CommonResult<ProjectOverviewPreviewRespVO> getProjectOverviewPreview(
@Valid ProjectOverviewExportReqVO reqVO) {
return success(projectOutputReportService.getProjectOverviewPreview(reqVO));
}
@GetMapping("/project-overview/export-excel")
@Operation(summary = "导出项目总览表")
@PreAuthorize("@ss.hasPermission('tjt:report-summary:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProjectOverviewExcel(HttpServletResponse response,
@Valid ProjectOverviewExportReqVO reqVO) throws IOException {
projectOutputReportService.exportProjectOverviewExcel(response, reqVO);
}
@GetMapping("/employee-output-summary/preview")
@Operation(summary = "预览员工个人考核产值汇总表")
@PreAuthorize("@ss.hasAnyPermissions('tjt:report-summary:query', 'tjt:report-summary:export')")
public CommonResult<EmployeeOutputSummaryPreviewRespVO> getEmployeeOutputSummaryPreview(
@Valid EmployeeOutputSummaryExportReqVO reqVO) {
return success(projectOutputReportService.getEmployeeOutputSummaryPreview(reqVO));
}
@GetMapping("/employee-output-summary/export-excel")
@Operation(summary = "导出员工个人考核产值汇总表")
@PreAuthorize("@ss.hasPermission('tjt:report-summary:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportEmployeeOutputSummaryExcel(HttpServletResponse response,
@Valid EmployeeOutputSummaryExportReqVO reqVO)
throws IOException {
projectOutputReportService.exportEmployeeOutputSummaryExcel(response, reqVO);
}
}

View File

@@ -0,0 +1,57 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 员工个人考核产值汇总 Excel 导出 Response VO")
@Data
@ExcelIgnoreUnannotated
public class EmployeeOutputSummaryExcelRespVO {
@ExcelProperty("序号")
private Integer serialNo;
@ExcelProperty("姓名")
private String employeeName;
@ExcelProperty("所属专业所")
private String officeName;
@ExcelProperty("第一季度")
private BigDecimal quarterOneAmount;
@ExcelProperty("第二季度")
private BigDecimal quarterTwoAmount;
@ExcelProperty("第三季度")
private BigDecimal quarterThreeAmount;
@ExcelProperty("第四季度")
private BigDecimal quarterFourAmount;
@ExcelProperty("年度合计")
private BigDecimal annualTotalAmount;
@ExcelProperty("所长/BIM考核产值")
private BigDecimal officeLeaderOrBimAmount;
@ExcelProperty("年度考核产值合计")
private BigDecimal totalAssessmentOutputAmount;
@ExcelProperty("1~12月份预计发生成本")
private BigDecimal expectedCostAmount;
@ExcelProperty("基本考核产值")
private BigDecimal basicAssessmentOutputAmount;
@ExcelProperty("剩余产值")
private BigDecimal remainingOutputAmount;
@ExcelProperty("预估年底绩效")
private BigDecimal estimatedYearEndPerformanceAmount;
}

View File

@@ -0,0 +1,28 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 员工个人考核产值汇总导出 Request VO")
@Data
public class EmployeeOutputSummaryExportReqVO {
@Schema(description = "年度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "年度不能为空")
private Integer year;
@Schema(description = "专业所 ID", example = "1")
private Long officeId;
@Schema(description = "员工 ID", example = "1")
private Long employeeId;
@Schema(description = "员工状态", example = "在职")
private String employeeStatus;
@Schema(description = "排序方式", example = "annual_total_desc")
private String sortType;
}

View File

@@ -0,0 +1,26 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
@Schema(description = "管理后台 - 员工个人考核产值汇总表预览 Response VO")
@Data
public class EmployeeOutputSummaryPreviewRespVO {
@Schema(description = "年度", example = "2026")
private Integer year;
@Schema(description = "预计 K 值,小数值,例如 0.4 表示 40%")
private BigDecimal kValue;
@Schema(description = "员工明细行,金额单位:万元")
private List<EmployeeOutputSummaryExcelRespVO> rows = Collections.emptyList();
@Schema(description = "合计行,金额单位:万元")
private EmployeeOutputSummaryExcelRespVO totalRow;
}

View File

@@ -0,0 +1,19 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 项目考核产值预算表导出 Request VO")
@Data
public class ProjectBudgetExportReqVO {
@Schema(description = "项目 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "项目 ID 不能为空")
private Long projectId;
@Schema(description = "导出年度", example = "2026")
private Integer year;
}

View File

@@ -0,0 +1,19 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 工程负责人年度季度计取表导出 Request VO")
@Data
public class ProjectLeadQuarterOutputExportReqVO {
@Schema(description = "合约规划 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "合约规划 ID 不能为空")
private Long planningId;
@Schema(description = "导出年度", example = "2026")
private Integer year;
}

View File

@@ -0,0 +1,57 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 项目总览表 Excel 导出 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ProjectOverviewExcelRespVO {
@ExcelProperty("序号")
private Integer serialNo;
@ExcelProperty("项目名称")
private String projectName;
@ExcelProperty("项目任务包")
private String planningContent;
@ExcelProperty("工程进度情况及其它说明")
private String progressText;
@ExcelProperty("工作阶段")
private String designStage;
@ExcelProperty("本专业+项总核算总产值")
private BigDecimal totalOutputAmount;
@ExcelProperty("往年已发放比例")
private String historicalIssuedRatioText;
@ExcelProperty("本期结算")
private BigDecimal currentSettlementAmount;
@ExcelProperty("未结算比例")
private String pendingRatioText;
@ExcelProperty("一季度")
private BigDecimal quarterOneAmount;
@ExcelProperty("二季度")
private BigDecimal quarterTwoAmount;
@ExcelProperty("三季度")
private BigDecimal quarterThreeAmount;
@ExcelProperty("四季度")
private BigDecimal quarterFourAmount;
@ExcelProperty("本年度小计")
private BigDecimal yearTotalAmount;
}

View File

@@ -0,0 +1,22 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Schema(description = "Management Backend - Project overview export Request VO")
@Data
public class ProjectOverviewExportReqVO {
@Schema(description = "Year", example = "2026")
private Integer year;
@Schema(description = "Office ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "专业所不能为空")
private Long officeId;
@Schema(description = "Sort type", example = "output_desc")
private String sortType;
}

View File

@@ -0,0 +1,103 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Schema(description = "管理后台 - 项目总览表预览 Response VO")
@Data
public class ProjectOverviewPreviewRespVO {
@Schema(description = "年度", example = "2026")
private Integer year;
@Schema(description = "专业所名称", example = "给排水所")
private String officeName;
@Schema(description = "员工动态列")
private List<EmployeeColumn> employeeColumns = Collections.emptyList();
@Schema(description = "项目行")
private List<ProjectRow> rows = Collections.emptyList();
@Schema(description = "合计行")
private ProjectRow totalRow;
@Schema(description = "员工动态列")
@Data
public static class EmployeeColumn {
@Schema(description = "员工 ID", example = "1")
private Long employeeId;
@Schema(description = "员工姓名", example = "张三")
private String employeeName;
}
@Schema(description = "项目总览行")
@Data
public static class ProjectRow {
@Schema(description = "序号", example = "1")
private Integer serialNo;
@Schema(description = "是否合计行", example = "false")
private Boolean totalRow = false;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "工程进度情况及其它说明")
private String progressText;
@Schema(description = "工作阶段")
private String workStage;
@Schema(description = "本专业 + 项目总核算总产值,单位:万元")
private BigDecimal totalOutputAmountWan;
@Schema(description = "往期已发放比例,小数值,例如 0.2 表示 20%")
private BigDecimal historicalIssuedRatio;
@Schema(description = "本期结算占比,小数值,例如 0.2 表示 20%")
private BigDecimal currentSettlementRatio;
@Schema(description = "本期结算考核产值,单位:万元")
private BigDecimal currentSettlementAmountWan;
@Schema(description = "未结算比例,小数值,例如 0.2 表示 20%")
private BigDecimal pendingRatio;
@Schema(description = "员工季度金额key 为员工 ID金额单位万元")
private Map<Long, EmployeeAmountValue> employeeAmountMap = new LinkedHashMap<>();
}
@Schema(description = "员工季度金额")
@Data
public static class EmployeeAmountValue {
@Schema(description = "一季度,单位:万元")
private BigDecimal quarterOneAmountWan;
@Schema(description = "二季度,单位:万元")
private BigDecimal quarterTwoAmountWan;
@Schema(description = "三季度,单位:万元")
private BigDecimal quarterThreeAmountWan;
@Schema(description = "四季度,单位:万元")
private BigDecimal quarterFourAmountWan;
@Schema(description = "本年度小计,单位:万元")
private BigDecimal annualTotalAmountWan;
}
}

View File

@@ -0,0 +1,19 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 项目级年度季度计取表导出 Request VO")
@Data
public class ProjectQuarterOutputExportReqVO {
@Schema(description = "合约规划 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "合约规划 ID 不能为空")
private Long planningId;
@Schema(description = "导出年度", example = "2026")
private Integer year;
}

View File

@@ -0,0 +1,24 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 专业内人员年度季度计取表导出 Request VO")
@Data
public class SpecialtyPersonOutputExportReqVO {
@Schema(description = "合约规划 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "合约规划 ID 不能为空")
private Long planningId;
@Schema(description = "专业编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "water")
@NotBlank(message = "专业编码不能为空")
private String specialtyCode;
@Schema(description = "导出年度", example = "2026")
private Integer year;
}

View File

@@ -0,0 +1,19 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 专业内人员年度季度计取预览 Request VO")
@Data
public class SpecialtyPersonOutputPreviewReqVO {
@Schema(description = "合约规划 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "合约规划 ID 不能为空")
private Long planningId;
@Schema(description = "预览年度", example = "2026")
private Integer year;
}

View File

@@ -0,0 +1,157 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.report.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Schema(description = "管理后台 - 专业内人员年度季度计取预览 Response VO")
@Data
public class SpecialtyPersonOutputPreviewRespVO {
@Schema(description = "锚点合约规划 ID")
private Long planningId;
@Schema(description = "预览年度")
private Integer year;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "专业分组")
private List<GroupRow> groups;
@Schema(description = "专业分组")
@Data
public static class GroupRow {
@Schema(description = "专业编码")
private String specialtyCode;
@Schema(description = "专业名称")
private String specialtyName;
@Schema(description = "是否允许导出专业内人员计取表")
private Boolean exportable;
@Schema(description = "专业金额(元)")
private BigDecimal specialtyAmount;
@Schema(description = "角色比例合计")
private BigDecimal roleTotal;
@Schema(description = "已配置人数")
private Integer personCount;
@Schema(description = "是否超额")
private Boolean overRatio;
@Schema(description = "专业一季度金额(万元)")
private BigDecimal specialtyQuarterOneAmountWan;
@Schema(description = "专业二季度金额(万元)")
private BigDecimal specialtyQuarterTwoAmountWan;
@Schema(description = "专业三季度金额(万元)")
private BigDecimal specialtyQuarterThreeAmountWan;
@Schema(description = "专业四季度金额(万元)")
private BigDecimal specialtyQuarterFourAmountWan;
@Schema(description = "专业本年度小计金额(万元)")
private BigDecimal specialtyYearTotalAmountWan;
@Schema(description = "角色人员年度季度计取明细")
private List<RoleRow> rows;
}
@Schema(description = "角色人员年度季度计取明细")
@Data
public static class RoleRow {
@Schema(description = "专业编码")
private String specialtyCode;
@Schema(description = "专业名称")
private String specialtyName;
@Schema(description = "角色编码")
private String roleCode;
@Schema(description = "角色名称")
private String roleName;
@Schema(description = "角色比例")
private BigDecimal roleRatio;
@Schema(description = "角色金额(元)")
private BigDecimal roleAmount;
@Schema(description = "人员比例合计")
private BigDecimal personTotalRatio;
@Schema(description = "人员明细")
private List<PersonRow> persons;
}
@Schema(description = "人员年度季度计取明细")
@Data
public static class PersonRow {
@Schema(description = "人员唯一键")
private String personKey;
@Schema(description = "员工 ID")
private Long employeeId;
@Schema(description = "员工姓名")
private String employeeName;
@Schema(description = "人员工作量比例")
private BigDecimal personRatio;
@Schema(description = "人员金额(元)")
private BigDecimal personAmount;
@Schema(description = "参与角色")
private String roleNames;
@Schema(description = "占专业比例合计")
private BigDecimal adjustedPersonRatio;
@Schema(description = "一季度比例")
private BigDecimal quarterOneRatio;
@Schema(description = "一季度金额(万元)")
private BigDecimal quarterOneAmountWan;
@Schema(description = "二季度比例")
private BigDecimal quarterTwoRatio;
@Schema(description = "二季度金额(万元)")
private BigDecimal quarterTwoAmountWan;
@Schema(description = "三季度比例")
private BigDecimal quarterThreeRatio;
@Schema(description = "三季度金额(万元)")
private BigDecimal quarterThreeAmountWan;
@Schema(description = "四季度比例")
private BigDecimal quarterFourRatio;
@Schema(description = "四季度金额(万元)")
private BigDecimal quarterFourAmountWan;
@Schema(description = "本年度小计比例")
private BigDecimal yearTotalRatio;
@Schema(description = "本年度小计金额(万元)")
private BigDecimal yearTotalAmountWan;
}
}

View File

@@ -9,8 +9,11 @@ import java.math.BigDecimal;
@Data
public class SpecialtyRolePersonRespVO {
@Schema(description = "人员名称")
private String personName;
@Schema(description = "员工 ID")
private Long employeeId;
@Schema(description = "员工姓名")
private String employeeName;
@Schema(description = "人员比例")
private BigDecimal personRatio;

View File

@@ -9,8 +9,11 @@ import java.math.BigDecimal;
@Data
public class SpecialtyRolePersonSaveReqVO {
@Schema(description = "人员名称", example = "张三")
private String personName;
@Schema(description = "员工 ID", example = "1")
private Long employeeId;
@Schema(description = "员工姓名", example = "张三")
private String employeeName;
@Schema(description = "人员比例", example = "0.1000")
private BigDecimal personRatio;

View File

@@ -16,13 +16,13 @@ public class SpecialtyRoleSplitRespVO {
@Schema(description = "页面4拆分 ID", example = "1")
private Long outputSplitId;
@Schema(description = "规划 ID", example = "1")
@Schema(description = "规划 ID", example = "1")
private Long planningId;
@Schema(description = "项目名称")
private String projectName;
@Schema(description = "规划内容")
@Schema(description = "项目任务包")
private String planningContent;
@Schema(description = "专业编码")

View File

@@ -0,0 +1,104 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.yearkvalue;
import cn.iocoder.lyzsys.framework.common.pojo.CommonResult;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.common.util.object.BeanUtils;
import cn.iocoder.lyzsys.module.tjt.controller.admin.yearkvalue.vo.YearKValuePageReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.yearkvalue.vo.YearKValueRespVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.yearkvalue.vo.YearKValueSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.service.yearkvalue.YearKValueService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.Map;
import static cn.iocoder.lyzsys.framework.common.exception.util.ServiceExceptionUtil.invalidParamException;
import static cn.iocoder.lyzsys.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 年度 K 值")
@RestController
@RequestMapping("/tjt/year-k-value")
@Validated
public class YearKValueController {
@Resource
private YearKValueService yearKValueService;
@PostMapping("/create")
@Operation(summary = "创建年度 K 值")
@PreAuthorize("@ss.hasPermission('tjt:year-k-value:create')")
public CommonResult<Long> createYearKValue(@RequestBody Map<String, Object> requestBody) {
YearKValueSaveReqVO createReqVO = buildSaveReqVO(requestBody, false);
return success(yearKValueService.createYearKValue(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "修改年度 K 值")
@PreAuthorize("@ss.hasPermission('tjt:year-k-value:update')")
public CommonResult<Boolean> updateYearKValue(@RequestBody Map<String, Object> requestBody) {
YearKValueSaveReqVO updateReqVO = buildSaveReqVO(requestBody, true);
yearKValueService.updateYearKValue(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除年度 K 值")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:year-k-value:delete')")
public CommonResult<Boolean> deleteYearKValue(@RequestParam("id") Long id) {
yearKValueService.deleteYearKValue(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得年度 K 值详情")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('tjt:year-k-value:query')")
public CommonResult<YearKValueRespVO> getYearKValue(@RequestParam("id") Long id) {
return success(yearKValueService.getYearKValue(id));
}
@GetMapping("/page")
@Operation(summary = "获得年度 K 值分页")
@PreAuthorize("@ss.hasPermission('tjt:year-k-value:query')")
public CommonResult<PageResult<YearKValueRespVO>> getYearKValuePage(@Valid YearKValuePageReqVO pageReqVO) {
return success(yearKValueService.getYearKValuePage(pageReqVO));
}
private YearKValueSaveReqVO buildSaveReqVO(Map<String, Object> requestBody, boolean requireId) {
YearKValueSaveReqVO reqVO = BeanUtils.toBean(requestBody, YearKValueSaveReqVO.class);
if (requireId && reqVO.getId() == null) {
throw invalidParamException("编号不能为空");
}
if (reqVO.getKYear() == null) {
throw invalidParamException("年度不能为空");
}
if (reqVO.getKValue() == null) {
throw invalidParamException("K值不能为空");
}
if (reqVO.getKValue().compareTo(BigDecimal.ZERO) < 0
|| reqVO.getKValue().compareTo(BigDecimal.ONE) > 0) {
throw invalidParamException("K值必须在 0% 到 100% 之间");
}
if (reqVO.getRemark() != null && reqVO.getRemark().length() > 255) {
throw invalidParamException("备注长度不能超过 255 个字符");
}
return reqVO;
}
}

View File

@@ -0,0 +1,19 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.yearkvalue.vo;
import cn.iocoder.lyzsys.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Schema(description = "管理后台 - 年度 K 值分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class YearKValuePageReqVO extends PageParam {
@Schema(description = "年度", example = "2026")
private Integer kYear;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,31 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.yearkvalue.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 年度 K 值 Response VO")
@Data
public class YearKValueRespVO {
@Schema(description = "主键 ID", example = "1")
private Long id;
@Schema(description = "年度", example = "2026")
private Integer kYear;
@Schema(description = "K 值", example = "0.4000")
private BigDecimal kValue;
@Schema(description = "备注")
private String remark;
@Schema(description = "是否启用")
private Boolean enabledFlag;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,36 @@
package cn.iocoder.lyzsys.module.tjt.controller.admin.yearkvalue.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 年度 K 值新增/修改 Request VO")
@Data
public class YearKValueSaveReqVO {
@Schema(description = "主键 ID", example = "1")
private Long id;
@Schema(description = "年度", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026")
@NotNull(message = "年度不能为空")
private Integer kYear;
@Schema(description = "K 值", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.4000")
@NotNull(message = "K 值不能为空")
@DecimalMin(value = "0.0000", message = "K 值不能小于 0%")
@DecimalMax(value = "1.0000", message = "K 值不能大于 100%")
private BigDecimal kValue;
@Schema(description = "备注")
@Size(max = 255, message = "备注长度不能超过 255 个字符")
private String remark;
@Schema(description = "是否启用", example = "true")
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,47 @@
package cn.iocoder.lyzsys.module.tjt.dal.dataobject.employee;
import cn.iocoder.lyzsys.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDate;
@TableName("tjt_employee")
@KeySequence("tjt_employee_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class EmployeeDO extends TenantBaseDO {
@TableId
private Long id;
private String employeeName;
private String gender;
private Long officeId;
private String registrationType;
private String jobTitle;
private String registrationSealNo;
private LocalDate entryDate;
private LocalDate leaveDate;
private String employeeStatus;
private String remark;
private Boolean officeLeaderFlag;
private Integer sortNo;
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,35 @@
package cn.iocoder.lyzsys.module.tjt.dal.dataobject.employeeyearcostbudget;
import cn.iocoder.lyzsys.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
@TableName("tjt_employee_year_cost_budget")
@KeySequence("tjt_employee_year_cost_budget_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class EmployeeYearCostBudgetDO extends TenantBaseDO {
@TableId
private Long id;
private Long employeeId;
private String employeeName;
private Integer budgetYear;
private BigDecimal expectedCostAmount;
private String remark;
private Integer sortNo;
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,35 @@
package cn.iocoder.lyzsys.module.tjt.dal.dataobject.employeeyearleaderoutput;
import cn.iocoder.lyzsys.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
@TableName("tjt_employee_year_leader_output")
@KeySequence("tjt_employee_year_leader_output_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class EmployeeYearLeaderOutputDO extends TenantBaseDO {
@TableId
private Long id;
private Long employeeId;
private String employeeName;
private Integer outputYear;
private BigDecimal leaderOutputAmount;
private String remark;
private Integer sortNo;
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,29 @@
package cn.iocoder.lyzsys.module.tjt.dal.dataobject.office;
import cn.iocoder.lyzsys.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@TableName("tjt_office")
@KeySequence("tjt_office_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class OfficeDO extends TenantBaseDO {
@TableId
private Long id;
private String officeName;
private String officeCode;
private Integer sortNo;
private Boolean enabledFlag;
private String remark;
}

View File

@@ -29,9 +29,7 @@ public class ProjectOutputSplitDO extends TenantBaseDO {
private Integer year;
private BigDecimal projectManagerRatio;
private BigDecimal engineeringLeaderRatio;
private BigDecimal projectLeadRatio;
private BigDecimal officeRatio;

View File

@@ -25,6 +25,8 @@ public class ProjectPlanningDO extends TenantBaseDO {
private Long projectId;
private Integer sortNo;
private String ownershipType;
private String calculationMethod;
@@ -33,10 +35,20 @@ public class ProjectPlanningDO extends TenantBaseDO {
private BigDecimal planningAmount;
private BigDecimal contractValueQuantity;
private BigDecimal contractValueUnitPrice;
private BigDecimal managementFeeRate;
private BigDecimal managementFee;
private BigDecimal vatRate;
private BigDecimal vatAmount;
private BigDecimal projectBudgetOutputValue;
private String implementationTeam;
private Integer planningStartYear;
@@ -77,8 +89,6 @@ public class ProjectPlanningDO extends TenantBaseDO {
private BigDecimal guidanceTotalPrice;
private BigDecimal virtualTotalPrice;
private BigDecimal calculationRatio;
private BigDecimal contractUnitPrice;

View File

@@ -0,0 +1,55 @@
package cn.iocoder.lyzsys.module.tjt.dal.dataobject.planningguidedetail;
import cn.iocoder.lyzsys.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
@TableName("tjt_project_planning_guide_detail")
@KeySequence("tjt_project_planning_guide_detail_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class ProjectPlanningGuideDetailDO extends TenantBaseDO {
@TableId
private Long id;
private Long planningId;
private Long projectId;
private String designPart;
private String buildingType;
private BigDecimal designArea;
private BigDecimal internalGuidanceUnitPrice;
private Integer buildingOrUnitCount;
private BigDecimal drawingSetFactor;
private BigDecimal scaleFactor;
private BigDecimal modificationFactor;
private BigDecimal complexityFactor;
private BigDecimal totalAdjustmentFactor;
private BigDecimal designRatio;
private BigDecimal assessmentArea;
private BigDecimal assessmentOutputValue;
private Integer sortNo;
private String remark;
}

View File

@@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 项目 DO
@@ -27,15 +28,19 @@ public class ProjectDO extends TenantBaseDO {
@TableId
private Long id;
/**
* 工程名称
* 项目名称
*/
private String projectName;
/**
* 排序
*/
private Integer sortNo;
/**
* 是否签订合同
*/
private Boolean contractSignedFlag;
/**
* 合同金额
* 合同产值
*/
private BigDecimal contractAmount;
/**
@@ -47,40 +52,60 @@ public class ProjectDO extends TenantBaseDO {
*/
private String constructionUnitName;
/**
* 联系人
* 建设单位联系人
*/
private String contactName;
/**
* 联系方式
* 建设单位联系电话
*/
private String contactPhone;
/**
* 合同签订日期
*/
private LocalDate contractSigningDate;
/**
* 项目经理
*/
private String projectManagerName;
/**
* 工程负责人
*/
private String engineeringPrincipalName;
/**
* 工程类型
*/
private String projectType;
/**
* 工程类别
*/
private String projectCategory;
/**
* 项目开始年度
*/
private Integer projectStartYear;
/**
* 项目状态
*/
private String projectStatus;
/**
* 是否封档
*/
private Boolean archiveFlag;
/**
* 封档时间
*/
private LocalDateTime archiveTime;
/**
* 暂停原因
*/
private String pauseReason;
/**
* 中止原因
*/
private String terminateReason;
/**
* 最终结算金额
*/
private BigDecimal finalSettlementAmount;
/**
* 预计 K 值
* 科创产值比例
*/
private BigDecimal expectedKValue;
private BigDecimal innovationOutputRate;
/**
* 其他成本
*/
private BigDecimal otherCost;
}

View File

@@ -0,0 +1,33 @@
package cn.iocoder.lyzsys.module.tjt.dal.dataobject.projectroleperson;
import cn.iocoder.lyzsys.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
@TableName("tjt_project_role_person")
@KeySequence("tjt_project_role_person_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class ProjectRolePersonDO extends TenantBaseDO {
@TableId
private Long id;
private Long projectId;
private String roleCode;
private String roleName;
private Long employeeId;
private String employeeName;
private Integer sortNo;
private Boolean enabledFlag;
}

View File

@@ -35,8 +35,6 @@ public class SpecialtyRoleSplitDO extends TenantBaseDO {
private BigDecimal roleRatio;
private String personNames;
private Integer sortNo;
}

View File

@@ -0,0 +1,50 @@
package cn.iocoder.lyzsys.module.tjt.dal.dataobject.specialtyrolesplitperson;
import cn.iocoder.lyzsys.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 页面 5 角色人员分配明细 DO
*
* @author Codex
*/
@TableName("tjt_specialty_role_split_person")
@KeySequence("tjt_specialty_role_split_person_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class SpecialtyRoleSplitPersonDO extends TenantBaseDO {
@TableId
private Long id;
private Long roleSplitId;
private Long outputSplitId;
private Long projectId;
private Long planningId;
private String specialtyCode;
private String specialtyName;
private String roleCode;
private String roleName;
private Long employeeId;
private String employeeName;
private BigDecimal personRatio;
private Integer sortNo;
}

View File

@@ -0,0 +1,29 @@
package cn.iocoder.lyzsys.module.tjt.dal.dataobject.yearkvalue;
import cn.iocoder.lyzsys.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
@TableName("tjt_year_k_value")
@KeySequence("tjt_year_k_value_seq")
@Data
@EqualsAndHashCode(callSuper = true)
public class YearKValueDO extends TenantBaseDO {
@TableId
private Long id;
private Integer kYear;
private BigDecimal kValue;
private String remark;
private Boolean enabledFlag;
}

View File

@@ -0,0 +1,58 @@
package cn.iocoder.lyzsys.module.tjt.dal.mysql.employee;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeePageReqVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employee.EmployeeDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface EmployeeMapper extends BaseMapperX<EmployeeDO> {
default PageResult<EmployeeDO> selectPage(EmployeePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeDO>()
.likeIfPresent(EmployeeDO::getEmployeeName, reqVO.getEmployeeName())
.eqIfPresent(EmployeeDO::getOfficeId, reqVO.getOfficeId())
.eqIfPresent(EmployeeDO::getEmployeeStatus, reqVO.getEmployeeStatus())
.eqIfPresent(EmployeeDO::getEnabledFlag, reqVO.getEnabledFlag())
.eqIfPresent(EmployeeDO::getOfficeLeaderFlag, reqVO.getOfficeLeaderFlag())
.orderByAsc(EmployeeDO::getSortNo)
.orderByAsc(EmployeeDO::getId));
}
default List<EmployeeDO> selectSimpleList(String keyword, Long officeId, String status, Boolean enabledFlag,
Boolean officeLeaderFlag) {
return selectList(new LambdaQueryWrapperX<EmployeeDO>()
.likeIfPresent(EmployeeDO::getEmployeeName, keyword)
.eqIfPresent(EmployeeDO::getOfficeId, officeId)
.eqIfPresent(EmployeeDO::getEmployeeStatus, status)
.eqIfPresent(EmployeeDO::getEnabledFlag, enabledFlag)
.eqIfPresent(EmployeeDO::getOfficeLeaderFlag, officeLeaderFlag)
.orderByAsc(EmployeeDO::getSortNo)
.orderByAsc(EmployeeDO::getId));
}
default List<EmployeeDO> selectEnabledList() {
return selectList(new LambdaQueryWrapperX<EmployeeDO>()
.eq(EmployeeDO::getEnabledFlag, Boolean.TRUE)
.orderByAsc(EmployeeDO::getSortNo)
.orderByAsc(EmployeeDO::getId));
}
default List<EmployeeDO> selectEnabledLeaderList() {
return selectList(new LambdaQueryWrapperX<EmployeeDO>()
.eq(EmployeeDO::getEnabledFlag, Boolean.TRUE)
.eq(EmployeeDO::getOfficeLeaderFlag, Boolean.TRUE)
.orderByAsc(EmployeeDO::getSortNo)
.orderByAsc(EmployeeDO::getId));
}
default Long selectCountByOfficeId(Long officeId) {
return selectCount(new LambdaQueryWrapperX<EmployeeDO>()
.eq(EmployeeDO::getOfficeId, officeId));
}
}

View File

@@ -0,0 +1,42 @@
package cn.iocoder.lyzsys.module.tjt.dal.mysql.employeeyearcostbudget;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo.EmployeeYearCostBudgetPageReqVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employeeyearcostbudget.EmployeeYearCostBudgetDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface EmployeeYearCostBudgetMapper extends BaseMapperX<EmployeeYearCostBudgetDO> {
default PageResult<EmployeeYearCostBudgetDO> selectPage(EmployeeYearCostBudgetPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeYearCostBudgetDO>()
.eqIfPresent(EmployeeYearCostBudgetDO::getEmployeeId, reqVO.getEmployeeId())
.likeIfPresent(EmployeeYearCostBudgetDO::getEmployeeName, reqVO.getEmployeeName())
.eqIfPresent(EmployeeYearCostBudgetDO::getBudgetYear, reqVO.getBudgetYear())
.eqIfPresent(EmployeeYearCostBudgetDO::getEnabledFlag, reqVO.getEnabledFlag())
.orderByDesc(EmployeeYearCostBudgetDO::getBudgetYear)
.orderByAsc(EmployeeYearCostBudgetDO::getSortNo)
.orderByAsc(EmployeeYearCostBudgetDO::getId));
}
default EmployeeYearCostBudgetDO selectByEmployeeIdAndBudgetYear(Long employeeId, Integer budgetYear) {
return selectOne(new LambdaQueryWrapperX<EmployeeYearCostBudgetDO>()
.eq(EmployeeYearCostBudgetDO::getEmployeeId, employeeId)
.eq(EmployeeYearCostBudgetDO::getBudgetYear, budgetYear));
}
default List<EmployeeYearCostBudgetDO> selectListByBudgetYear(Integer budgetYear) {
return selectList(new LambdaQueryWrapperX<EmployeeYearCostBudgetDO>()
.eq(EmployeeYearCostBudgetDO::getBudgetYear, budgetYear));
}
default Long selectCountByEmployeeId(Long employeeId) {
return selectCount(new LambdaQueryWrapperX<EmployeeYearCostBudgetDO>()
.eq(EmployeeYearCostBudgetDO::getEmployeeId, employeeId));
}
}

View File

@@ -0,0 +1,53 @@
package cn.iocoder.lyzsys.module.tjt.dal.mysql.employeeyearleaderoutput;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo.EmployeeYearLeaderOutputPageReqVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employeeyearleaderoutput.EmployeeYearLeaderOutputDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.List;
@Mapper
public interface EmployeeYearLeaderOutputMapper extends BaseMapperX<EmployeeYearLeaderOutputDO> {
default PageResult<EmployeeYearLeaderOutputDO> selectPage(EmployeeYearLeaderOutputPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeYearLeaderOutputDO>()
.eqIfPresent(EmployeeYearLeaderOutputDO::getEmployeeId, reqVO.getEmployeeId())
.likeIfPresent(EmployeeYearLeaderOutputDO::getEmployeeName, reqVO.getEmployeeName())
.eqIfPresent(EmployeeYearLeaderOutputDO::getOutputYear, reqVO.getOutputYear())
.eqIfPresent(EmployeeYearLeaderOutputDO::getEnabledFlag, reqVO.getEnabledFlag())
.orderByDesc(EmployeeYearLeaderOutputDO::getOutputYear)
.orderByAsc(EmployeeYearLeaderOutputDO::getSortNo)
.orderByAsc(EmployeeYearLeaderOutputDO::getId));
}
default EmployeeYearLeaderOutputDO selectByEmployeeIdAndOutputYear(Long employeeId, Integer outputYear) {
return selectOne(new LambdaQueryWrapperX<EmployeeYearLeaderOutputDO>()
.eq(EmployeeYearLeaderOutputDO::getEmployeeId, employeeId)
.eq(EmployeeYearLeaderOutputDO::getOutputYear, outputYear));
}
default List<EmployeeYearLeaderOutputDO> selectListByOutputYear(Integer outputYear) {
return selectList(new LambdaQueryWrapperX<EmployeeYearLeaderOutputDO>()
.eq(EmployeeYearLeaderOutputDO::getOutputYear, outputYear));
}
default List<EmployeeYearLeaderOutputDO> selectEnabledListByOutputYear(Integer outputYear,
Collection<Long> employeeIds) {
return selectList(new LambdaQueryWrapperX<EmployeeYearLeaderOutputDO>()
.eq(EmployeeYearLeaderOutputDO::getOutputYear, outputYear)
.eq(EmployeeYearLeaderOutputDO::getEnabledFlag, Boolean.TRUE)
.inIfPresent(EmployeeYearLeaderOutputDO::getEmployeeId, employeeIds)
.orderByAsc(EmployeeYearLeaderOutputDO::getSortNo)
.orderByAsc(EmployeeYearLeaderOutputDO::getId));
}
default Long selectCountByEmployeeId(Long employeeId) {
return selectCount(new LambdaQueryWrapperX<EmployeeYearLeaderOutputDO>()
.eq(EmployeeYearLeaderOutputDO::getEmployeeId, employeeId));
}
}

View File

@@ -0,0 +1,30 @@
package cn.iocoder.lyzsys.module.tjt.dal.mysql.office;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficePageReqVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.office.OfficeDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface OfficeMapper extends BaseMapperX<OfficeDO> {
default PageResult<OfficeDO> selectPage(OfficePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<OfficeDO>()
.likeIfPresent(OfficeDO::getOfficeName, reqVO.getOfficeName())
.eqIfPresent(OfficeDO::getEnabledFlag, reqVO.getEnabledFlag())
.orderByAsc(OfficeDO::getSortNo)
.orderByAsc(OfficeDO::getId));
}
default List<OfficeDO> selectSimpleList() {
return selectList(new LambdaQueryWrapperX<OfficeDO>()
.eq(OfficeDO::getEnabledFlag, Boolean.TRUE)
.orderByAsc(OfficeDO::getSortNo)
.orderByAsc(OfficeDO::getId));
}
}

View File

@@ -25,7 +25,8 @@ public interface ProjectPlanningMapper extends BaseMapperX<ProjectPlanningDO> {
.likeIfPresent(ProjectPlanningDO::getPlanningContent, reqVO.getPlanningContent())
.eqIfPresent(ProjectPlanningDO::getPlanningStartYear, reqVO.getPlanningStartYear())
.betweenIfPresent(ProjectPlanningDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProjectPlanningDO::getId));
.orderByAsc(ProjectPlanningDO::getSortNo)
.orderByAsc(ProjectPlanningDO::getId));
}
default List<ProjectPlanningDO> selectListByProjectId(Long projectId) {
@@ -34,4 +35,11 @@ public interface ProjectPlanningMapper extends BaseMapperX<ProjectPlanningDO> {
.orderByDesc(ProjectPlanningDO::getId));
}
default List<ProjectPlanningDO> selectDisplayListByProjectId(Long projectId) {
return selectList(new LambdaQueryWrapperX<ProjectPlanningDO>()
.eq(ProjectPlanningDO::getProjectId, projectId)
.orderByAsc(ProjectPlanningDO::getSortNo)
.orderByAsc(ProjectPlanningDO::getId));
}
}

View File

@@ -0,0 +1,33 @@
package cn.iocoder.lyzsys.module.tjt.dal.mysql.planningguidedetail;
import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.planningguidedetail.ProjectPlanningGuideDetailDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@Mapper
public interface ProjectPlanningGuideDetailMapper extends BaseMapperX<ProjectPlanningGuideDetailDO> {
default List<ProjectPlanningGuideDetailDO> selectListByPlanningId(Long planningId) {
return selectList(new LambdaQueryWrapperX<ProjectPlanningGuideDetailDO>()
.eq(ProjectPlanningGuideDetailDO::getPlanningId, planningId)
.orderByAsc(ProjectPlanningGuideDetailDO::getSortNo)
.orderByAsc(ProjectPlanningGuideDetailDO::getId));
}
default List<ProjectPlanningGuideDetailDO> selectListByPlanningIds(Collection<Long> planningIds) {
if (planningIds == null || planningIds.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<ProjectPlanningGuideDetailDO>()
.in(ProjectPlanningGuideDetailDO::getPlanningId, planningIds)
.orderByAsc(ProjectPlanningGuideDetailDO::getPlanningId)
.orderByAsc(ProjectPlanningGuideDetailDO::getSortNo)
.orderByAsc(ProjectPlanningGuideDetailDO::getId));
}
}

View File

@@ -20,8 +20,10 @@ public interface ProjectMapper extends BaseMapperX<ProjectDO> {
.likeIfPresent(ProjectDO::getProjectName, reqVO.getProjectName())
.eqIfPresent(ProjectDO::getContractSignedFlag, reqVO.getContractSignedFlag())
.eqIfPresent(ProjectDO::getProjectStartYear, reqVO.getProjectStartYear())
.eqIfPresent(ProjectDO::getProjectStatus, reqVO.getProjectStatus())
.betweenIfPresent(ProjectDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProjectDO::getId));
.orderByAsc(ProjectDO::getSortNo)
.orderByAsc(ProjectDO::getId));
}
}

View File

@@ -0,0 +1,55 @@
package cn.iocoder.lyzsys.module.tjt.dal.mysql.projectroleperson;
import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.projectroleperson.ProjectRolePersonDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@Mapper
public interface ProjectRolePersonMapper extends BaseMapperX<ProjectRolePersonDO> {
default List<ProjectRolePersonDO> selectListByProjectId(Long projectId) {
return selectList(new LambdaQueryWrapperX<ProjectRolePersonDO>()
.eq(ProjectRolePersonDO::getProjectId, projectId)
.eq(ProjectRolePersonDO::getEnabledFlag, Boolean.TRUE)
.orderByAsc(ProjectRolePersonDO::getRoleCode)
.orderByAsc(ProjectRolePersonDO::getSortNo)
.orderByAsc(ProjectRolePersonDO::getId));
}
default List<ProjectRolePersonDO> selectListByProjectIds(Collection<Long> projectIds) {
if (projectIds == null || projectIds.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<ProjectRolePersonDO>()
.in(ProjectRolePersonDO::getProjectId, projectIds)
.eq(ProjectRolePersonDO::getEnabledFlag, Boolean.TRUE)
.orderByAsc(ProjectRolePersonDO::getProjectId)
.orderByAsc(ProjectRolePersonDO::getRoleCode)
.orderByAsc(ProjectRolePersonDO::getSortNo)
.orderByAsc(ProjectRolePersonDO::getId));
}
default List<ProjectRolePersonDO> selectListByEmployeeIds(Collection<Long> employeeIds) {
if (employeeIds == null || employeeIds.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<ProjectRolePersonDO>()
.in(ProjectRolePersonDO::getEmployeeId, employeeIds)
.eq(ProjectRolePersonDO::getEnabledFlag, Boolean.TRUE)
.orderByAsc(ProjectRolePersonDO::getProjectId)
.orderByAsc(ProjectRolePersonDO::getRoleCode)
.orderByAsc(ProjectRolePersonDO::getSortNo)
.orderByAsc(ProjectRolePersonDO::getId));
}
default Long selectCountByEmployeeId(Long employeeId) {
return selectCount(new LambdaQueryWrapperX<ProjectRolePersonDO>()
.eq(ProjectRolePersonDO::getEmployeeId, employeeId));
}
}

View File

@@ -5,6 +5,8 @@ import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.specialtyrolesplit.SpecialtyRoleSplitDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
@@ -22,4 +24,15 @@ public interface SpecialtyRoleSplitMapper extends BaseMapperX<SpecialtyRoleSplit
.orderByAsc(SpecialtyRoleSplitDO::getId));
}
default List<SpecialtyRoleSplitDO> selectListByOutputSplitIds(Collection<Long> outputSplitIds) {
if (outputSplitIds == null || outputSplitIds.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<SpecialtyRoleSplitDO>()
.in(SpecialtyRoleSplitDO::getOutputSplitId, outputSplitIds)
.orderByAsc(SpecialtyRoleSplitDO::getOutputSplitId)
.orderByAsc(SpecialtyRoleSplitDO::getSortNo)
.orderByAsc(SpecialtyRoleSplitDO::getId));
}
}

View File

@@ -0,0 +1,105 @@
package cn.iocoder.lyzsys.module.tjt.dal.mysql.specialtyrolesplitperson;
import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.specialtyrolesplitperson.SpecialtyRoleSplitPersonDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* 页面 5 角色人员分配明细 Mapper
*
* @author Codex
*/
@Mapper
public interface SpecialtyRoleSplitPersonMapper extends BaseMapperX<SpecialtyRoleSplitPersonDO> {
default List<SpecialtyRoleSplitPersonDO> selectListByRoleSplitId(Long roleSplitId) {
return selectList(new LambdaQueryWrapperX<SpecialtyRoleSplitPersonDO>()
.eq(SpecialtyRoleSplitPersonDO::getRoleSplitId, roleSplitId)
.orderByAsc(SpecialtyRoleSplitPersonDO::getSortNo)
.orderByAsc(SpecialtyRoleSplitPersonDO::getId));
}
default List<SpecialtyRoleSplitPersonDO> selectListByRoleSplitIds(Collection<Long> roleSplitIds) {
if (roleSplitIds == null || roleSplitIds.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<SpecialtyRoleSplitPersonDO>()
.in(SpecialtyRoleSplitPersonDO::getRoleSplitId, roleSplitIds)
.orderByAsc(SpecialtyRoleSplitPersonDO::getRoleSplitId)
.orderByAsc(SpecialtyRoleSplitPersonDO::getSortNo)
.orderByAsc(SpecialtyRoleSplitPersonDO::getId));
}
default List<SpecialtyRoleSplitPersonDO> selectListByOutputSplitIds(Collection<Long> outputSplitIds) {
if (outputSplitIds == null || outputSplitIds.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<SpecialtyRoleSplitPersonDO>()
.in(SpecialtyRoleSplitPersonDO::getOutputSplitId, outputSplitIds)
.orderByAsc(SpecialtyRoleSplitPersonDO::getOutputSplitId)
.orderByAsc(SpecialtyRoleSplitPersonDO::getRoleSplitId)
.orderByAsc(SpecialtyRoleSplitPersonDO::getSortNo)
.orderByAsc(SpecialtyRoleSplitPersonDO::getId));
}
default List<SpecialtyRoleSplitPersonDO> selectListByEmployeeIds(Collection<Long> employeeIds) {
if (employeeIds == null || employeeIds.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<SpecialtyRoleSplitPersonDO>()
.in(SpecialtyRoleSplitPersonDO::getEmployeeId, employeeIds)
.orderByAsc(SpecialtyRoleSplitPersonDO::getPlanningId)
.orderByAsc(SpecialtyRoleSplitPersonDO::getRoleSplitId)
.orderByAsc(SpecialtyRoleSplitPersonDO::getSortNo)
.orderByAsc(SpecialtyRoleSplitPersonDO::getId));
}
default List<SpecialtyRoleSplitPersonDO> selectListByPlanningIdsAndEmployeeIds(Collection<Long> planningIds,
Collection<Long> employeeIds) {
if (planningIds == null || planningIds.isEmpty() || employeeIds == null || employeeIds.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<SpecialtyRoleSplitPersonDO>()
.in(SpecialtyRoleSplitPersonDO::getPlanningId, planningIds)
.in(SpecialtyRoleSplitPersonDO::getEmployeeId, employeeIds)
.orderByAsc(SpecialtyRoleSplitPersonDO::getPlanningId)
.orderByAsc(SpecialtyRoleSplitPersonDO::getRoleSplitId)
.orderByAsc(SpecialtyRoleSplitPersonDO::getSortNo)
.orderByAsc(SpecialtyRoleSplitPersonDO::getId));
}
default void deleteByRoleSplitId(Long roleSplitId) {
delete(SpecialtyRoleSplitPersonDO::getRoleSplitId, roleSplitId);
}
default void deleteByRoleSplitIds(Collection<Long> roleSplitIds) {
if (roleSplitIds == null || roleSplitIds.isEmpty()) {
return;
}
delete(new LambdaQueryWrapperX<SpecialtyRoleSplitPersonDO>()
.in(SpecialtyRoleSplitPersonDO::getRoleSplitId, roleSplitIds));
}
default void deleteByOutputSplitId(Long outputSplitId) {
delete(SpecialtyRoleSplitPersonDO::getOutputSplitId, outputSplitId);
}
default void deleteByOutputSplitIds(Collection<Long> outputSplitIds) {
if (outputSplitIds == null || outputSplitIds.isEmpty()) {
return;
}
delete(new LambdaQueryWrapperX<SpecialtyRoleSplitPersonDO>()
.in(SpecialtyRoleSplitPersonDO::getOutputSplitId, outputSplitIds));
}
default Long selectCountByEmployeeId(Long employeeId) {
return selectCount(new LambdaQueryWrapperX<SpecialtyRoleSplitPersonDO>()
.eq(SpecialtyRoleSplitPersonDO::getEmployeeId, employeeId));
}
}

View File

@@ -0,0 +1,44 @@
package cn.iocoder.lyzsys.module.tjt.dal.mysql.yearkvalue;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.lyzsys.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.lyzsys.module.tjt.controller.admin.yearkvalue.vo.YearKValuePageReqVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.yearkvalue.YearKValueDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@Mapper
public interface YearKValueMapper extends BaseMapperX<YearKValueDO> {
default PageResult<YearKValueDO> selectPage(YearKValuePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<YearKValueDO>()
.eqIfPresent(YearKValueDO::getKYear, reqVO.getKYear())
.eqIfPresent(YearKValueDO::getEnabledFlag, reqVO.getEnabledFlag())
.orderByAsc(YearKValueDO::getKYear));
}
default YearKValueDO selectByKYear(Integer kYear) {
return selectOne(new LambdaQueryWrapperX<YearKValueDO>()
.eq(YearKValueDO::getKYear, kYear));
}
default YearKValueDO selectEnabledByKYear(Integer kYear) {
return selectOne(new LambdaQueryWrapperX<YearKValueDO>()
.eq(YearKValueDO::getKYear, kYear)
.eq(YearKValueDO::getEnabledFlag, Boolean.TRUE));
}
default List<YearKValueDO> selectEnabledListByYears(Collection<Integer> years) {
if (years == null || years.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<YearKValueDO>()
.in(YearKValueDO::getKYear, years)
.eq(YearKValueDO::getEnabledFlag, Boolean.TRUE));
}
}

View File

@@ -20,6 +20,11 @@ public interface ErrorCodeConstants {
ErrorCode PROJECT_PLANNING_OWNERSHIP_TYPE_IMMUTABLE = new ErrorCode(1_020_002_004, "归属类型保存后不允许修改");
ErrorCode PROJECT_PLANNING_CALCULATION_METHOD_IMMUTABLE = new ErrorCode(1_020_002_005, "产值计算方式保存后不允许修改");
ErrorCode PROJECT_PLANNING_VIRTUAL_CALCULATION_METHOD_INVALID = new ErrorCode(1_020_002_006, "虚拟产值计算方式不正确");
ErrorCode PROJECT_PLANNING_WORKING_DAY_COUNT_REQUIRED = new ErrorCode(1_020_002_007, "工日法下工日不能为空");
ErrorCode PROJECT_PLANNING_WORKING_DAY_UNIT_PRICE_REQUIRED = new ErrorCode(1_020_002_008, "工日法下工日单价不能为空");
ErrorCode PROJECT_PLANNING_DESIGN_PART_INVALID = new ErrorCode(1_020_002_009, "设计部位不正确");
ErrorCode PROJECT_PLANNING_GUIDE_DETAIL_NOT_EXISTS = new ErrorCode(1_020_002_010, "指导价法明细不存在");
ErrorCode PROJECT_PLANNING_GUIDE_DETAIL_SCENE_INVALID = new ErrorCode(1_020_002_011, "当前合约规划不是专业所指导价法,不能维护指导价法明细");
// ========== 季度分配管理 1-020-003-000 ==========
ErrorCode PROJECT_PLANNING_QUARTER_NOT_EXISTS = new ErrorCode(1_020_003_000, "季度分配明细不存在");
@@ -28,7 +33,6 @@ public interface ErrorCodeConstants {
// ========== 页面 4 拆分管理 1-020-004-000 ==========
ErrorCode PROJECT_OUTPUT_SPLIT_PLANNING_NOT_EXISTS = new ErrorCode(1_020_004_000, "关联合约规划不存在");
ErrorCode PROJECT_OUTPUT_SPLIT_NOT_MAJOR = new ErrorCode(1_020_004_001, "仅专业所记录允许进行页面4拆分");
ErrorCode PROJECT_OUTPUT_SPLIT_RATIO_INVALID = new ErrorCode(1_020_004_002, "页面4比例合计必须等于 100%");
// ========== 页面 5 角色拆分管理 1-020-005-000 ==========
@@ -36,8 +40,29 @@ public interface ErrorCodeConstants {
ErrorCode SPECIALTY_ROLE_SPLIT_ROLE_RATIO_INVALID = new ErrorCode(1_020_005_001, "页面5五类角色比例合计必须等于 100%");
ErrorCode SPECIALTY_ROLE_SPLIT_SPECIALTY_INVALID = new ErrorCode(1_020_005_002, "专业编码不正确");
ErrorCode SPECIALTY_ROLE_SPLIT_ROLE_INVALID = new ErrorCode(1_020_005_003, "角色编码不正确");
ErrorCode SPECIALTY_ROLE_SPLIT_PERSON_INVALID = new ErrorCode(1_020_005_004, "页面5人员名称和比例必须同时填写");
ErrorCode SPECIALTY_ROLE_SPLIT_PERSON_INVALID = new ErrorCode(1_020_005_004, "页面5人员和比例必须同时填写");
ErrorCode SPECIALTY_ROLE_SPLIT_DESIGN_PERSON_REQUIRED = new ErrorCode(1_020_005_005, "页面5设计角色金额大于 0 时必须配置人员");
ErrorCode SPECIALTY_ROLE_SPLIT_PERSON_RATIO_INVALID = new ErrorCode(1_020_005_007, "页面5同一角色下人员比例之和不能大于 100%");
// ========== 年度 K 值管理 1-020-006-000 ==========
ErrorCode YEAR_K_VALUE_NOT_EXISTS = new ErrorCode(1_020_006_000, "年度 K 值记录不存在");
ErrorCode YEAR_K_VALUE_DUPLICATE = new ErrorCode(1_020_006_001, "同一年度的 K 值记录已存在");
// ========== 专业所管理 1-020-007-000 ==========
ErrorCode OFFICE_NOT_EXISTS = new ErrorCode(1_020_007_000, "专业所记录不存在");
ErrorCode OFFICE_IN_USE = new ErrorCode(1_020_007_001, "当前专业所已被员工引用,不能删除");
// ========== 员工管理 1-020-008-000 ==========
ErrorCode EMPLOYEE_NOT_EXISTS = new ErrorCode(1_020_008_000, "员工记录不存在");
ErrorCode EMPLOYEE_IN_USE = new ErrorCode(1_020_008_001, "当前员工已被业务数据引用,不能删除");
ErrorCode EMPLOYEE_NOT_OFFICE_LEADER = new ErrorCode(1_020_008_002, "当前员工未启用或未标记为所长,不能维护年度所长考核产值");
// ========== 员工年度成本预算 1-020-009-000 ==========
ErrorCode EMPLOYEE_YEAR_COST_BUDGET_NOT_EXISTS = new ErrorCode(1_020_009_000, "员工年度成本预算记录不存在");
ErrorCode EMPLOYEE_YEAR_COST_BUDGET_DUPLICATE = new ErrorCode(1_020_009_001, "当前员工该年度预计发生成本已存在");
// ========== 年度所长考核产值 1-020-010-000 ==========
ErrorCode EMPLOYEE_YEAR_LEADER_OUTPUT_NOT_EXISTS = new ErrorCode(1_020_010_000, "年度所长考核产值记录不存在");
ErrorCode EMPLOYEE_YEAR_LEADER_OUTPUT_DUPLICATE = new ErrorCode(1_020_010_001, "当前所长该年度考核产值已存在");
}

View File

@@ -15,8 +15,7 @@ import java.util.Map;
*/
public final class OutputSplitBizConstants {
public static final String OWNERSHIP_TYPE_MAJOR = "专业所";
public static final String SPECIALTY_PROJECT_LEAD = "project_lead";
public static final String SPECIALTY_ARCH = "arch";
public static final String SPECIALTY_DECOR = "decor";
public static final String SPECIALTY_STRUCT = "struct";
@@ -30,18 +29,31 @@ public final class OutputSplitBizConstants {
public static final String ROLE_REVIEW = "review";
public static final String ROLE_APPROVE = "approve";
public static final String ROLE_DESIGN = "design";
public static final String ROLE_PROJECT_MANAGER = "project_manager";
public static final String ROLE_ENGINEERING_PRINCIPAL = "engineering_principal";
public static final List<SpecialtyItem> SPECIALTY_ITEMS = Arrays.asList(
public static final List<SpecialtyItem> ASSIGNMENT_SPECIALTY_ITEMS = Arrays.asList(
new SpecialtyItem(SPECIALTY_PROJECT_LEAD, "项目经理/工程负责人", 0),
new SpecialtyItem(SPECIALTY_ARCH, "建筑", 1),
new SpecialtyItem(SPECIALTY_DECOR, "", 2),
new SpecialtyItem(SPECIALTY_DECOR, "", 2),
new SpecialtyItem(SPECIALTY_STRUCT, "结构", 3),
new SpecialtyItem(SPECIALTY_WATER, "", 4),
new SpecialtyItem(SPECIALTY_WATER, "给排", 4),
new SpecialtyItem(SPECIALTY_ELEC, "电气", 5),
new SpecialtyItem(SPECIALTY_HVAC, "暖通", 6),
new SpecialtyItem(SPECIALTY_DIGITAL, "数字化设计", 7)
);
public static final List<RoleItem> ROLE_ITEMS = Arrays.asList(
public static final List<SpecialtyItem> SPECIALTY_ITEMS = Arrays.asList(
new SpecialtyItem(SPECIALTY_ARCH, "建筑", 1),
new SpecialtyItem(SPECIALTY_DECOR, "装饰", 2),
new SpecialtyItem(SPECIALTY_STRUCT, "结构", 3),
new SpecialtyItem(SPECIALTY_WATER, "给排水", 4),
new SpecialtyItem(SPECIALTY_ELEC, "电气", 5),
new SpecialtyItem(SPECIALTY_HVAC, "暖通", 6),
new SpecialtyItem(SPECIALTY_DIGITAL, "数字化设计", 7)
);
public static final List<RoleItem> SPECIALTY_ROLE_ITEMS = Arrays.asList(
new RoleItem(ROLE_DIRECTOR, "专业负责人", 1),
new RoleItem(ROLE_CHECK, "校对", 2),
new RoleItem(ROLE_REVIEW, "审核", 3),
@@ -49,23 +61,29 @@ public final class OutputSplitBizConstants {
new RoleItem(ROLE_DESIGN, "设计", 5)
);
public static final List<RoleItem> PROJECT_LEAD_ROLE_ITEMS = Arrays.asList(
new RoleItem(ROLE_PROJECT_MANAGER, "项目经理", 1),
new RoleItem(ROLE_ENGINEERING_PRINCIPAL, "工程负责人", 2)
);
private OutputSplitBizConstants() {
}
public static boolean isMajorOwnershipType(String value) {
return OWNERSHIP_TYPE_MAJOR.equals(value);
}
public static boolean isValidSpecialtyCode(String code) {
return SPECIALTY_ITEMS.stream().anyMatch(item -> item.getCode().equals(code));
return ASSIGNMENT_SPECIALTY_ITEMS.stream().anyMatch(item -> item.getCode().equals(code));
}
public static boolean isValidRoleCode(String code) {
return ROLE_ITEMS.stream().anyMatch(item -> item.getCode().equals(code));
return SPECIALTY_ROLE_ITEMS.stream().anyMatch(item -> item.getCode().equals(code))
|| PROJECT_LEAD_ROLE_ITEMS.stream().anyMatch(item -> item.getCode().equals(code));
}
public static boolean isValidRoleCode(String specialtyCode, String roleCode) {
return getRoleItems(specialtyCode).stream().anyMatch(item -> item.getCode().equals(roleCode));
}
public static String getSpecialtyName(String code) {
return SPECIALTY_ITEMS.stream()
return ASSIGNMENT_SPECIALTY_ITEMS.stream()
.filter(item -> item.getCode().equals(code))
.findFirst()
.map(SpecialtyItem::getName)
@@ -73,7 +91,7 @@ public final class OutputSplitBizConstants {
}
public static String getRoleName(String code) {
return ROLE_ITEMS.stream()
return getAllRoleItems().stream()
.filter(item -> item.getCode().equals(code))
.findFirst()
.map(RoleItem::getName)
@@ -81,7 +99,7 @@ public final class OutputSplitBizConstants {
}
public static int getRoleSortNo(String code) {
return ROLE_ITEMS.stream()
return getAllRoleItems().stream()
.filter(item -> item.getCode().equals(code))
.findFirst()
.map(RoleItem::getSortNo)
@@ -89,7 +107,7 @@ public final class OutputSplitBizConstants {
}
public static int getSpecialtySortNo(String code) {
return SPECIALTY_ITEMS.stream()
return ASSIGNMENT_SPECIALTY_ITEMS.stream()
.filter(item -> item.getCode().equals(code))
.findFirst()
.map(SpecialtyItem::getSortNo)
@@ -104,6 +122,25 @@ public final class OutputSplitBizConstants {
return map;
}
public static List<RoleItem> getRoleItems(String specialtyCode) {
if (SPECIALTY_PROJECT_LEAD.equals(specialtyCode)) {
return PROJECT_LEAD_ROLE_ITEMS;
}
return SPECIALTY_ROLE_ITEMS;
}
private static List<RoleItem> getAllRoleItems() {
return Arrays.asList(
PROJECT_LEAD_ROLE_ITEMS.get(0),
PROJECT_LEAD_ROLE_ITEMS.get(1),
SPECIALTY_ROLE_ITEMS.get(0),
SPECIALTY_ROLE_ITEMS.get(1),
SPECIALTY_ROLE_ITEMS.get(2),
SPECIALTY_ROLE_ITEMS.get(3),
SPECIALTY_ROLE_ITEMS.get(4)
);
}
@Getter
@AllArgsConstructor
public static class SpecialtyItem {

View File

@@ -14,13 +14,15 @@ public final class ProjectPlanningBizTypeConstants {
public static final String OWNERSHIP_TYPE_MAJOR = "专业所";
public static final String OWNERSHIP_TYPE_COMPREHENSIVE = "综合所";
public static final String OWNERSHIP_TYPE_SUBCONTRACT = "专业分包";
public static final String DESIGN_PART_REAL_ESTATE = "地上部分";
public static final String DESIGN_PART_UNDERGROUND = "地下部分";
public static final String CALCULATION_METHOD_GUIDANCE_PRICE = "指导价法";
public static final String CALCULATION_METHOD_CONTRACT_PRICE = "合同价法";
public static final String CALCULATION_METHOD_VIRTUAL_OUTPUT = "虚拟产值法";
public static final String VIRTUAL_CALCULATION_METHOD_GUIDANCE_PRICE = "指导单价法";
public static final String VIRTUAL_CALCULATION_METHOD_VIRTUAL_TOTAL_PRICE = "虚拟总价法";
public static final String VIRTUAL_CALCULATION_METHOD_GUIDANCE_TOTAL_PRICE = "指导总价法";
public static final String VIRTUAL_CALCULATION_METHOD_WORKING_DAY = "工日法";
private static final Set<String> OWNERSHIP_TYPES = new HashSet<>(Arrays.asList(
@@ -35,9 +37,14 @@ public final class ProjectPlanningBizTypeConstants {
CALCULATION_METHOD_VIRTUAL_OUTPUT
));
private static final Set<String> DESIGN_PARTS = new HashSet<>(Arrays.asList(
DESIGN_PART_REAL_ESTATE,
DESIGN_PART_UNDERGROUND
));
private static final Set<String> VIRTUAL_CALCULATION_METHODS = new HashSet<>(Arrays.asList(
VIRTUAL_CALCULATION_METHOD_GUIDANCE_PRICE,
VIRTUAL_CALCULATION_METHOD_VIRTUAL_TOTAL_PRICE,
VIRTUAL_CALCULATION_METHOD_GUIDANCE_TOTAL_PRICE,
VIRTUAL_CALCULATION_METHOD_WORKING_DAY
));
@@ -52,6 +59,10 @@ public final class ProjectPlanningBizTypeConstants {
return CALCULATION_METHODS.contains(value);
}
public static boolean isValidDesignPart(String value) {
return DESIGN_PARTS.contains(value);
}
public static boolean isValidVirtualCalculationMethod(String value) {
return VIRTUAL_CALCULATION_METHODS.contains(value);
}
@@ -72,6 +83,10 @@ public final class ProjectPlanningBizTypeConstants {
return CALCULATION_METHOD_GUIDANCE_PRICE.equals(value);
}
public static boolean isMajorGuidanceScene(String ownershipType, String calculationMethod) {
return isMajor(ownershipType) && isGuidancePrice(calculationMethod);
}
public static boolean isContractPrice(String value) {
return CALCULATION_METHOD_CONTRACT_PRICE.equals(value);
}
@@ -80,4 +95,16 @@ public final class ProjectPlanningBizTypeConstants {
return CALCULATION_METHOD_VIRTUAL_OUTPUT.equals(value);
}
public static boolean isWorkingDay(String value) {
return VIRTUAL_CALCULATION_METHOD_WORKING_DAY.equals(value);
}
public static boolean isVirtualGuidancePrice(String value) {
return VIRTUAL_CALCULATION_METHOD_GUIDANCE_PRICE.equals(value);
}
public static boolean isVirtualGuidanceTotalPrice(String value) {
return VIRTUAL_CALCULATION_METHOD_GUIDANCE_TOTAL_PRICE.equals(value);
}
}

View File

@@ -0,0 +1,30 @@
package cn.iocoder.lyzsys.module.tjt.service.employee;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeePageReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeRespVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeSimpleRespVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employee.EmployeeDO;
import javax.validation.Valid;
import java.util.List;
public interface EmployeeService {
Long createEmployee(@Valid EmployeeSaveReqVO createReqVO);
void updateEmployee(@Valid EmployeeSaveReqVO updateReqVO);
void deleteEmployee(Long id);
EmployeeRespVO getEmployee(Long id);
EmployeeDO validateEmployeeExists(Long id);
PageResult<EmployeeRespVO> getEmployeePage(EmployeePageReqVO pageReqVO);
List<EmployeeSimpleRespVO> getEmployeeSimpleList(String keyword, Long officeId, String status,
Boolean enabledFlag, Boolean officeLeaderFlag);
}

View File

@@ -0,0 +1,148 @@
package cn.iocoder.lyzsys.module.tjt.service.employee;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.common.util.collection.CollectionUtils;
import cn.iocoder.lyzsys.framework.common.util.object.BeanUtils;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeePageReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeRespVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employee.vo.EmployeeSimpleRespVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employee.EmployeeDO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.office.OfficeDO;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.employeeyearcostbudget.EmployeeYearCostBudgetMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.employeeyearleaderoutput.EmployeeYearLeaderOutputMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.employee.EmployeeMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.office.OfficeMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.projectroleperson.ProjectRolePersonMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.specialtyrolesplitperson.SpecialtyRoleSplitPersonMapper;
import cn.iocoder.lyzsys.module.tjt.service.office.OfficeService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import static cn.iocoder.lyzsys.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.EMPLOYEE_IN_USE;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.EMPLOYEE_NOT_EXISTS;
@Service
@Validated
public class EmployeeServiceImpl implements EmployeeService {
@Resource
private EmployeeMapper employeeMapper;
@Resource
private OfficeMapper officeMapper;
@Resource
private EmployeeYearCostBudgetMapper employeeYearCostBudgetMapper;
@Resource
private EmployeeYearLeaderOutputMapper employeeYearLeaderOutputMapper;
@Resource
private ProjectRolePersonMapper projectRolePersonMapper;
@Resource
private SpecialtyRoleSplitPersonMapper specialtyRoleSplitPersonMapper;
@Resource
private OfficeService officeService;
@Override
public Long createEmployee(EmployeeSaveReqVO createReqVO) {
officeService.validateOfficeExists(createReqVO.getOfficeId());
EmployeeDO employee = BeanUtils.toBean(createReqVO, EmployeeDO.class);
if (employee.getEnabledFlag() == null) {
employee.setEnabledFlag(Boolean.TRUE);
}
if (employee.getOfficeLeaderFlag() == null) {
employee.setOfficeLeaderFlag(Boolean.FALSE);
}
employeeMapper.insert(employee);
return employee.getId();
}
@Override
public void updateEmployee(EmployeeSaveReqVO updateReqVO) {
validateEmployeeExists(updateReqVO.getId());
officeService.validateOfficeExists(updateReqVO.getOfficeId());
EmployeeDO employee = BeanUtils.toBean(updateReqVO, EmployeeDO.class);
if (employee.getOfficeLeaderFlag() == null) {
employee.setOfficeLeaderFlag(Boolean.FALSE);
}
employeeMapper.updateById(employee);
}
@Override
public void deleteEmployee(Long id) {
validateEmployeeExists(id);
if (employeeYearCostBudgetMapper.selectCountByEmployeeId(id) > 0
|| employeeYearLeaderOutputMapper.selectCountByEmployeeId(id) > 0
|| projectRolePersonMapper.selectCountByEmployeeId(id) > 0
|| existsInSpecialtyRoleSplit(id)) {
throw exception(EMPLOYEE_IN_USE);
}
employeeMapper.deleteById(id);
}
@Override
public EmployeeRespVO getEmployee(Long id) {
EmployeeDO employee = validateEmployeeExists(id);
Map<Long, OfficeDO> officeMap = getOfficeMap(Collections.singleton(employee.getOfficeId()));
return toRespVO(employee, officeMap);
}
@Override
public EmployeeDO validateEmployeeExists(Long id) {
EmployeeDO employee = employeeMapper.selectById(id);
if (employee == null) {
throw exception(EMPLOYEE_NOT_EXISTS);
}
return employee;
}
@Override
public PageResult<EmployeeRespVO> getEmployeePage(EmployeePageReqVO pageReqVO) {
PageResult<EmployeeDO> pageResult = employeeMapper.selectPage(pageReqVO);
Map<Long, OfficeDO> officeMap = getOfficeMap(CollectionUtils.convertSet(pageResult.getList(), EmployeeDO::getOfficeId));
return BeanUtils.toBean(pageResult, EmployeeRespVO.class, respVO ->
respVO.setOfficeName(officeMap.containsKey(respVO.getOfficeId())
? officeMap.get(respVO.getOfficeId()).getOfficeName() : null));
}
@Override
public List<EmployeeSimpleRespVO> getEmployeeSimpleList(String keyword, Long officeId, String status,
Boolean enabledFlag, Boolean officeLeaderFlag) {
List<EmployeeDO> list = employeeMapper.selectSimpleList(keyword, officeId, status,
enabledFlag == null ? Boolean.TRUE : enabledFlag, officeLeaderFlag);
Map<Long, OfficeDO> officeMap = getOfficeMap(CollectionUtils.convertSet(list, EmployeeDO::getOfficeId));
return BeanUtils.toBean(list, EmployeeSimpleRespVO.class, respVO ->
respVO.setOfficeName(officeMap.containsKey(respVO.getOfficeId())
? officeMap.get(respVO.getOfficeId()).getOfficeName() : null));
}
private boolean existsInSpecialtyRoleSplit(Long employeeId) {
return specialtyRoleSplitPersonMapper.selectCountByEmployeeId(employeeId) > 0;
}
private Map<Long, OfficeDO> getOfficeMap(Set<Long> officeIds) {
if (officeIds == null || officeIds.isEmpty()) {
return Collections.emptyMap();
}
Set<Long> validOfficeIds = officeIds.stream()
.filter(Objects::nonNull)
.collect(java.util.stream.Collectors.toSet());
if (validOfficeIds.isEmpty()) {
return Collections.emptyMap();
}
return CollectionUtils.convertMap(officeMapper.selectBatchIds(validOfficeIds), OfficeDO::getId);
}
private EmployeeRespVO toRespVO(EmployeeDO employee, Map<Long, OfficeDO> officeMap) {
return BeanUtils.toBean(employee, EmployeeRespVO.class, respVO ->
respVO.setOfficeName(officeMap.containsKey(respVO.getOfficeId())
? officeMap.get(respVO.getOfficeId()).getOfficeName() : null));
}
}

View File

@@ -0,0 +1,22 @@
package cn.iocoder.lyzsys.module.tjt.service.employeeyearcostbudget;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo.*;
import javax.validation.Valid;
public interface EmployeeYearCostBudgetService {
Long createEmployeeYearCostBudget(@Valid EmployeeYearCostBudgetSaveReqVO createReqVO);
EmployeeYearCostBudgetGenerateRespVO generateEmployeeYearCostBudget(@Valid EmployeeYearCostBudgetGenerateReqVO reqVO);
void updateEmployeeYearCostBudget(@Valid EmployeeYearCostBudgetSaveReqVO updateReqVO);
void deleteEmployeeYearCostBudget(Long id);
EmployeeYearCostBudgetRespVO getEmployeeYearCostBudget(Long id);
PageResult<EmployeeYearCostBudgetRespVO> getEmployeeYearCostBudgetPage(EmployeeYearCostBudgetPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,134 @@
package cn.iocoder.lyzsys.module.tjt.service.employeeyearcostbudget;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.common.util.object.BeanUtils;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearcostbudget.vo.*;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employee.EmployeeDO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employeeyearcostbudget.EmployeeYearCostBudgetDO;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.employee.EmployeeMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.employeeyearcostbudget.EmployeeYearCostBudgetMapper;
import cn.iocoder.lyzsys.module.tjt.service.employee.EmployeeService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import static cn.iocoder.lyzsys.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.EMPLOYEE_YEAR_COST_BUDGET_DUPLICATE;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.EMPLOYEE_YEAR_COST_BUDGET_NOT_EXISTS;
@Service
@Validated
public class EmployeeYearCostBudgetServiceImpl implements EmployeeYearCostBudgetService {
@Resource
private EmployeeYearCostBudgetMapper employeeYearCostBudgetMapper;
@Resource
private EmployeeMapper employeeMapper;
@Resource
private EmployeeService employeeService;
@Override
public Long createEmployeeYearCostBudget(EmployeeYearCostBudgetSaveReqVO createReqVO) {
EmployeeDO employee = employeeService.validateEmployeeExists(createReqVO.getEmployeeId());
validateDuplicate(null, createReqVO.getEmployeeId(), createReqVO.getBudgetYear());
EmployeeYearCostBudgetDO budget = BeanUtils.toBean(createReqVO, EmployeeYearCostBudgetDO.class);
budget.setEmployeeName(employee.getEmployeeName());
if (budget.getEnabledFlag() == null) {
budget.setEnabledFlag(Boolean.TRUE);
}
employeeYearCostBudgetMapper.insert(budget);
return budget.getId();
}
@Override
public EmployeeYearCostBudgetGenerateRespVO generateEmployeeYearCostBudget(EmployeeYearCostBudgetGenerateReqVO reqVO) {
BigDecimal expectedCostAmount = amount(reqVO.getExpectedCostAmount());
List<EmployeeDO> enabledEmployees = employeeMapper.selectEnabledList();
Set<Long> existingEmployeeIds = employeeYearCostBudgetMapper.selectListByBudgetYear(reqVO.getBudgetYear())
.stream()
.map(EmployeeYearCostBudgetDO::getEmployeeId)
.filter(Objects::nonNull)
.collect(Collectors.toSet());
List<EmployeeYearCostBudgetDO> createList = enabledEmployees.stream()
.filter(employee -> !existingEmployeeIds.contains(employee.getId()))
.map(employee -> buildInitialBudget(employee, reqVO.getBudgetYear(), expectedCostAmount))
.collect(Collectors.toList());
if (!createList.isEmpty()) {
employeeYearCostBudgetMapper.insertBatch(createList);
}
EmployeeYearCostBudgetGenerateRespVO respVO = new EmployeeYearCostBudgetGenerateRespVO();
respVO.setBudgetYear(reqVO.getBudgetYear());
respVO.setTotalEnabledEmployeeCount(enabledEmployees.size());
respVO.setCreatedCount(createList.size());
respVO.setSkippedCount(enabledEmployees.size() - createList.size());
return respVO;
}
@Override
public void updateEmployeeYearCostBudget(EmployeeYearCostBudgetSaveReqVO updateReqVO) {
validateExists(updateReqVO.getId());
EmployeeDO employee = employeeService.validateEmployeeExists(updateReqVO.getEmployeeId());
validateDuplicate(updateReqVO.getId(), updateReqVO.getEmployeeId(), updateReqVO.getBudgetYear());
EmployeeYearCostBudgetDO updateObj = BeanUtils.toBean(updateReqVO, EmployeeYearCostBudgetDO.class);
updateObj.setEmployeeName(employee.getEmployeeName());
employeeYearCostBudgetMapper.updateById(updateObj);
}
@Override
public void deleteEmployeeYearCostBudget(Long id) {
validateExists(id);
employeeYearCostBudgetMapper.deleteById(id);
}
@Override
public EmployeeYearCostBudgetRespVO getEmployeeYearCostBudget(Long id) {
return BeanUtils.toBean(validateExists(id), EmployeeYearCostBudgetRespVO.class);
}
@Override
public PageResult<EmployeeYearCostBudgetRespVO> getEmployeeYearCostBudgetPage(EmployeeYearCostBudgetPageReqVO pageReqVO) {
return BeanUtils.toBean(employeeYearCostBudgetMapper.selectPage(pageReqVO), EmployeeYearCostBudgetRespVO.class);
}
private EmployeeYearCostBudgetDO validateExists(Long id) {
EmployeeYearCostBudgetDO budget = employeeYearCostBudgetMapper.selectById(id);
if (budget == null) {
throw exception(EMPLOYEE_YEAR_COST_BUDGET_NOT_EXISTS);
}
return budget;
}
private void validateDuplicate(Long id, Long employeeId, Integer budgetYear) {
EmployeeYearCostBudgetDO duplicate = employeeYearCostBudgetMapper.selectByEmployeeIdAndBudgetYear(employeeId, budgetYear);
if (duplicate != null && !Objects.equals(duplicate.getId(), id)) {
throw exception(EMPLOYEE_YEAR_COST_BUDGET_DUPLICATE);
}
}
private EmployeeYearCostBudgetDO buildInitialBudget(EmployeeDO employee, Integer budgetYear, BigDecimal expectedCostAmount) {
EmployeeYearCostBudgetDO budget = new EmployeeYearCostBudgetDO();
budget.setEmployeeId(employee.getId());
budget.setEmployeeName(employee.getEmployeeName());
budget.setBudgetYear(budgetYear);
budget.setExpectedCostAmount(expectedCostAmount);
budget.setSortNo(employee.getSortNo() == null ? 0 : employee.getSortNo());
budget.setEnabledFlag(Boolean.TRUE);
budget.setRemark("");
return budget;
}
private BigDecimal amount(BigDecimal value) {
return value == null ? BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP)
: value.setScale(2, RoundingMode.HALF_UP);
}
}

View File

@@ -0,0 +1,24 @@
package cn.iocoder.lyzsys.module.tjt.service.employeeyearleaderoutput;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo.*;
import javax.validation.Valid;
public interface EmployeeYearLeaderOutputService {
Long createEmployeeYearLeaderOutput(@Valid EmployeeYearLeaderOutputSaveReqVO createReqVO);
EmployeeYearLeaderOutputGenerateRespVO generateEmployeeYearLeaderOutput(
@Valid EmployeeYearLeaderOutputGenerateReqVO reqVO);
void updateEmployeeYearLeaderOutput(@Valid EmployeeYearLeaderOutputSaveReqVO updateReqVO);
void deleteEmployeeYearLeaderOutput(Long id);
EmployeeYearLeaderOutputRespVO getEmployeeYearLeaderOutput(Long id);
PageResult<EmployeeYearLeaderOutputRespVO> getEmployeeYearLeaderOutputPage(
EmployeeYearLeaderOutputPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,148 @@
package cn.iocoder.lyzsys.module.tjt.service.employeeyearleaderoutput;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.common.util.object.BeanUtils;
import cn.iocoder.lyzsys.module.tjt.controller.admin.employeeyearleaderoutput.vo.*;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employee.EmployeeDO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.employeeyearleaderoutput.EmployeeYearLeaderOutputDO;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.employee.EmployeeMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.employeeyearleaderoutput.EmployeeYearLeaderOutputMapper;
import cn.iocoder.lyzsys.module.tjt.service.employee.EmployeeService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import static cn.iocoder.lyzsys.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.*;
@Service
@Validated
public class EmployeeYearLeaderOutputServiceImpl implements EmployeeYearLeaderOutputService {
@Resource
private EmployeeYearLeaderOutputMapper employeeYearLeaderOutputMapper;
@Resource
private EmployeeMapper employeeMapper;
@Resource
private EmployeeService employeeService;
@Override
public Long createEmployeeYearLeaderOutput(EmployeeYearLeaderOutputSaveReqVO createReqVO) {
EmployeeDO employee = validateEmployeeIsOfficeLeader(createReqVO.getEmployeeId());
validateDuplicate(null, createReqVO.getEmployeeId(), createReqVO.getOutputYear());
EmployeeYearLeaderOutputDO output = BeanUtils.toBean(createReqVO, EmployeeYearLeaderOutputDO.class);
output.setEmployeeName(employee.getEmployeeName());
output.setLeaderOutputAmount(amount(output.getLeaderOutputAmount()));
if (output.getEnabledFlag() == null) {
output.setEnabledFlag(Boolean.TRUE);
}
employeeYearLeaderOutputMapper.insert(output);
return output.getId();
}
@Override
public EmployeeYearLeaderOutputGenerateRespVO generateEmployeeYearLeaderOutput(
EmployeeYearLeaderOutputGenerateReqVO reqVO) {
BigDecimal leaderOutputAmount = amount(reqVO.getLeaderOutputAmount());
List<EmployeeDO> enabledLeaders = employeeMapper.selectEnabledLeaderList();
Set<Long> existingEmployeeIds = employeeYearLeaderOutputMapper.selectListByOutputYear(reqVO.getOutputYear())
.stream()
.map(EmployeeYearLeaderOutputDO::getEmployeeId)
.filter(Objects::nonNull)
.collect(Collectors.toSet());
List<EmployeeYearLeaderOutputDO> createList = enabledLeaders.stream()
.filter(employee -> !existingEmployeeIds.contains(employee.getId()))
.map(employee -> buildInitialOutput(employee, reqVO.getOutputYear(), leaderOutputAmount))
.collect(Collectors.toList());
if (!createList.isEmpty()) {
employeeYearLeaderOutputMapper.insertBatch(createList);
}
EmployeeYearLeaderOutputGenerateRespVO respVO = new EmployeeYearLeaderOutputGenerateRespVO();
respVO.setOutputYear(reqVO.getOutputYear());
respVO.setTotalEnabledLeaderCount(enabledLeaders.size());
respVO.setCreatedCount(createList.size());
respVO.setSkippedCount(enabledLeaders.size() - createList.size());
return respVO;
}
@Override
public void updateEmployeeYearLeaderOutput(EmployeeYearLeaderOutputSaveReqVO updateReqVO) {
validateExists(updateReqVO.getId());
EmployeeDO employee = validateEmployeeIsOfficeLeader(updateReqVO.getEmployeeId());
validateDuplicate(updateReqVO.getId(), updateReqVO.getEmployeeId(), updateReqVO.getOutputYear());
EmployeeYearLeaderOutputDO updateObj = BeanUtils.toBean(updateReqVO, EmployeeYearLeaderOutputDO.class);
updateObj.setEmployeeName(employee.getEmployeeName());
updateObj.setLeaderOutputAmount(amount(updateObj.getLeaderOutputAmount()));
employeeYearLeaderOutputMapper.updateById(updateObj);
}
@Override
public void deleteEmployeeYearLeaderOutput(Long id) {
validateExists(id);
employeeYearLeaderOutputMapper.deleteById(id);
}
@Override
public EmployeeYearLeaderOutputRespVO getEmployeeYearLeaderOutput(Long id) {
return BeanUtils.toBean(validateExists(id), EmployeeYearLeaderOutputRespVO.class);
}
@Override
public PageResult<EmployeeYearLeaderOutputRespVO> getEmployeeYearLeaderOutputPage(
EmployeeYearLeaderOutputPageReqVO pageReqVO) {
return BeanUtils.toBean(employeeYearLeaderOutputMapper.selectPage(pageReqVO),
EmployeeYearLeaderOutputRespVO.class);
}
private EmployeeYearLeaderOutputDO validateExists(Long id) {
EmployeeYearLeaderOutputDO output = employeeYearLeaderOutputMapper.selectById(id);
if (output == null) {
throw exception(EMPLOYEE_YEAR_LEADER_OUTPUT_NOT_EXISTS);
}
return output;
}
private EmployeeDO validateEmployeeIsOfficeLeader(Long employeeId) {
EmployeeDO employee = employeeService.validateEmployeeExists(employeeId);
if (!Boolean.TRUE.equals(employee.getEnabledFlag()) || !Boolean.TRUE.equals(employee.getOfficeLeaderFlag())) {
throw exception(EMPLOYEE_NOT_OFFICE_LEADER);
}
return employee;
}
private void validateDuplicate(Long id, Long employeeId, Integer outputYear) {
EmployeeYearLeaderOutputDO duplicate =
employeeYearLeaderOutputMapper.selectByEmployeeIdAndOutputYear(employeeId, outputYear);
if (duplicate != null && !Objects.equals(duplicate.getId(), id)) {
throw exception(EMPLOYEE_YEAR_LEADER_OUTPUT_DUPLICATE);
}
}
private EmployeeYearLeaderOutputDO buildInitialOutput(EmployeeDO employee, Integer outputYear,
BigDecimal leaderOutputAmount) {
EmployeeYearLeaderOutputDO output = new EmployeeYearLeaderOutputDO();
output.setEmployeeId(employee.getId());
output.setEmployeeName(employee.getEmployeeName());
output.setOutputYear(outputYear);
output.setLeaderOutputAmount(leaderOutputAmount);
output.setSortNo(employee.getSortNo() == null ? 0 : employee.getSortNo());
output.setEnabledFlag(Boolean.TRUE);
output.setRemark("");
return output;
}
private BigDecimal amount(BigDecimal value) {
return value == null ? BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP)
: value.setScale(2, RoundingMode.HALF_UP);
}
}

View File

@@ -0,0 +1,29 @@
package cn.iocoder.lyzsys.module.tjt.service.office;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficePageReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeRespVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeSimpleRespVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.office.OfficeDO;
import javax.validation.Valid;
import java.util.List;
public interface OfficeService {
Long createOffice(@Valid OfficeSaveReqVO createReqVO);
void updateOffice(@Valid OfficeSaveReqVO updateReqVO);
void deleteOffice(Long id);
OfficeRespVO getOffice(Long id);
OfficeDO validateOfficeExists(Long id);
PageResult<OfficeRespVO> getOfficePage(OfficePageReqVO pageReqVO);
List<OfficeSimpleRespVO> getOfficeSimpleList();
}

View File

@@ -0,0 +1,80 @@
package cn.iocoder.lyzsys.module.tjt.service.office;
import cn.iocoder.lyzsys.framework.common.pojo.PageResult;
import cn.iocoder.lyzsys.framework.common.util.object.BeanUtils;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficePageReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeRespVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.controller.admin.office.vo.OfficeSimpleRespVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.office.OfficeDO;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.employee.EmployeeMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.office.OfficeMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.lyzsys.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.OFFICE_IN_USE;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.OFFICE_NOT_EXISTS;
@Service
@Validated
public class OfficeServiceImpl implements OfficeService {
@Resource
private OfficeMapper officeMapper;
@Resource
private EmployeeMapper employeeMapper;
@Override
public Long createOffice(OfficeSaveReqVO createReqVO) {
OfficeDO office = BeanUtils.toBean(createReqVO, OfficeDO.class);
if (office.getEnabledFlag() == null) {
office.setEnabledFlag(Boolean.TRUE);
}
officeMapper.insert(office);
return office.getId();
}
@Override
public void updateOffice(OfficeSaveReqVO updateReqVO) {
validateOfficeExists(updateReqVO.getId());
officeMapper.updateById(BeanUtils.toBean(updateReqVO, OfficeDO.class));
}
@Override
public void deleteOffice(Long id) {
validateOfficeExists(id);
if (employeeMapper.selectCountByOfficeId(id) > 0) {
throw exception(OFFICE_IN_USE);
}
officeMapper.deleteById(id);
}
@Override
public OfficeRespVO getOffice(Long id) {
return BeanUtils.toBean(validateOfficeExists(id), OfficeRespVO.class);
}
@Override
public OfficeDO validateOfficeExists(Long id) {
OfficeDO office = officeMapper.selectById(id);
if (office == null) {
throw exception(OFFICE_NOT_EXISTS);
}
return office;
}
@Override
public PageResult<OfficeRespVO> getOfficePage(OfficePageReqVO pageReqVO) {
return BeanUtils.toBean(officeMapper.selectPage(pageReqVO), OfficeRespVO.class);
}
@Override
public List<OfficeSimpleRespVO> getOfficeSimpleList() {
return BeanUtils.toBean(officeMapper.selectSimpleList(), OfficeSimpleRespVO.class);
}
}

View File

@@ -6,9 +6,11 @@ import cn.iocoder.lyzsys.module.tjt.controller.admin.outputsplit.vo.ProjectOutpu
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.outputsplit.ProjectOutputSplitDO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.planning.ProjectPlanningDO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.project.ProjectDO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.projectroleperson.ProjectRolePersonDO;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.outputsplit.ProjectOutputSplitMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.planning.ProjectPlanningMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.project.ProjectMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.projectroleperson.ProjectRolePersonMapper;
import cn.iocoder.lyzsys.module.tjt.enums.OutputSplitBizConstants;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -18,13 +20,14 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import static cn.iocoder.lyzsys.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_OUTPUT_SPLIT_NOT_MAJOR;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_OUTPUT_SPLIT_PLANNING_NOT_EXISTS;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_OUTPUT_SPLIT_RATIO_INVALID;
@@ -49,10 +52,12 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
private ProjectPlanningMapper projectPlanningMapper;
@Resource
private ProjectMapper projectMapper;
@Resource
private ProjectRolePersonMapper projectRolePersonMapper;
@Override
public ProjectOutputSplitRespVO getProjectOutputSplit(Long planningId) {
ProjectPlanningDO planning = validateMajorPlanning(planningId);
ProjectPlanningDO planning = validatePlanningExists(planningId);
ProjectDO project = validateProjectExists(planning.getProjectId());
ProjectOutputSplitDO outputSplit = projectOutputSplitMapper.selectByPlanningId(planningId);
if (outputSplit == null) {
@@ -63,7 +68,7 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
@Override
public Long saveProjectOutputSplit(ProjectOutputSplitSaveReqVO reqVO) {
ProjectPlanningDO planning = validateMajorPlanning(reqVO.getPlanningId());
ProjectPlanningDO planning = validatePlanningExists(reqVO.getPlanningId());
validateOutputSplitRatios(reqVO);
ProjectOutputSplitDO outputSplit = projectOutputSplitMapper.selectByPlanningId(reqVO.getPlanningId());
if (outputSplit == null) {
@@ -86,7 +91,7 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
@Override
public ProjectOutputSplitDO getOrCreateProjectOutputSplit(Long planningId) {
ProjectPlanningDO planning = validateMajorPlanning(planningId);
ProjectPlanningDO planning = validatePlanningExists(planningId);
ProjectOutputSplitDO outputSplit = projectOutputSplitMapper.selectByPlanningId(planningId);
if (outputSplit != null) {
return outputSplit;
@@ -134,18 +139,20 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
private ProjectOutputSplitRespVO buildRespVO(ProjectOutputSplitDO outputSplit, ProjectPlanningDO planning, ProjectDO project) {
ProjectOutputSplitRespVO respVO = BeanUtils.toBean(outputSplit, ProjectOutputSplitRespVO.class);
BigDecimal assessmentOutputValue = amount(planning.getAssessmentOutputValue());
BigDecimal projectManagerAmount = multiplyAmount(assessmentOutputValue, outputSplit.getProjectManagerRatio());
BigDecimal engineeringLeaderAmount = multiplyAmount(assessmentOutputValue, outputSplit.getEngineeringLeaderRatio());
BigDecimal projectLeadAmount = multiplyAmount(assessmentOutputValue, outputSplit.getProjectLeadRatio());
BigDecimal officeAmount = multiplyAmount(assessmentOutputValue, outputSplit.getOfficeRatio());
List<ProjectRolePersonDO> rolePersons = projectRolePersonMapper.selectListByProjectId(project.getId());
String projectManagerName = joinRoleNames(rolePersons, OutputSplitBizConstants.ROLE_PROJECT_MANAGER);
String engineeringPrincipalName = joinRoleNames(rolePersons, OutputSplitBizConstants.ROLE_ENGINEERING_PRINCIPAL);
respVO.setProjectName(project.getProjectName());
respVO.setPlanningContent(planning.getPlanningContent());
respVO.setYear(getPlanningYear(planning));
respVO.setAssessmentOutputValue(assessmentOutputValue);
respVO.setProjectManagerName(project.getProjectManagerName());
respVO.setEngineeringLeaderName(project.getEngineeringPrincipalName());
respVO.setProjectManagerAmount(projectManagerAmount);
respVO.setEngineeringLeaderAmount(engineeringLeaderAmount);
respVO.setProjectManagerName(projectManagerName);
respVO.setEngineeringLeaderName(engineeringPrincipalName);
respVO.setProjectLeadName(joinProjectLeadName(projectManagerName, engineeringPrincipalName));
respVO.setProjectLeadAmount(projectLeadAmount);
respVO.setOfficeAmount(officeAmount);
respVO.setArchAmount(multiplyAmount(officeAmount, outputSplit.getArchRatio()));
respVO.setDecorAmount(multiplyAmount(officeAmount, outputSplit.getDecorRatio()));
@@ -157,14 +164,11 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
return respVO;
}
private ProjectPlanningDO validateMajorPlanning(Long planningId) {
private ProjectPlanningDO validatePlanningExists(Long planningId) {
ProjectPlanningDO planning = projectPlanningMapper.selectById(planningId);
if (planning == null) {
throw exception(PROJECT_OUTPUT_SPLIT_PLANNING_NOT_EXISTS);
}
if (!OutputSplitBizConstants.isMajorOwnershipType(planning.getOwnershipType())) {
throw exception(PROJECT_OUTPUT_SPLIT_NOT_MAJOR);
}
return planning;
}
@@ -181,8 +185,7 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
outputSplit.setProjectId(planning.getProjectId());
outputSplit.setPlanningId(planning.getId());
outputSplit.setYear(getPlanningYear(planning));
outputSplit.setProjectManagerRatio(ZERO_RATIO);
outputSplit.setEngineeringLeaderRatio(ZERO_RATIO);
outputSplit.setProjectLeadRatio(ZERO_RATIO);
outputSplit.setOfficeRatio(ONE_RATIO);
outputSplit.setArchRatio(ONE_RATIO);
outputSplit.setDecorRatio(ZERO_RATIO);
@@ -199,8 +202,16 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
}
private void validateOutputSplitRatios(ProjectOutputSplitSaveReqVO reqVO) {
BigDecimal projectTotal = ratio(reqVO.getProjectManagerRatio())
.add(ratio(reqVO.getEngineeringLeaderRatio()))
validateRatioRange(reqVO.getProjectLeadRatio());
validateRatioRange(reqVO.getOfficeRatio());
validateRatioRange(reqVO.getArchRatio());
validateRatioRange(reqVO.getDecorRatio());
validateRatioRange(reqVO.getStructRatio());
validateRatioRange(reqVO.getWaterRatio());
validateRatioRange(reqVO.getElecRatio());
validateRatioRange(reqVO.getHvacRatio());
validateRatioRange(reqVO.getDigitalRatio());
BigDecimal projectTotal = ratio(reqVO.getProjectLeadRatio())
.add(ratio(reqVO.getOfficeRatio()))
.setScale(RATIO_SCALE, RoundingMode.HALF_UP);
BigDecimal specialtyTotal = ratio(reqVO.getArchRatio())
@@ -211,14 +222,20 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
.add(ratio(reqVO.getHvacRatio()))
.add(ratio(reqVO.getDigitalRatio()))
.setScale(RATIO_SCALE, RoundingMode.HALF_UP);
if (projectTotal.compareTo(ONE_RATIO) > 0 || specialtyTotal.compareTo(ONE_RATIO) != 0) {
if (projectTotal.compareTo(ONE_RATIO) != 0 || specialtyTotal.compareTo(ONE_RATIO) != 0) {
throw exception(PROJECT_OUTPUT_SPLIT_RATIO_INVALID);
}
}
private void validateRatioRange(BigDecimal value) {
BigDecimal normalized = ratio(value);
if (normalized.compareTo(ZERO_RATIO) < 0 || normalized.compareTo(ONE_RATIO) > 0) {
throw exception(PROJECT_OUTPUT_SPLIT_RATIO_INVALID);
}
}
private void normalizeRatios(ProjectOutputSplitDO outputSplit) {
normalize(outputSplit::setProjectManagerRatio, outputSplit.getProjectManagerRatio());
normalize(outputSplit::setEngineeringLeaderRatio, outputSplit.getEngineeringLeaderRatio());
normalize(outputSplit::setProjectLeadRatio, outputSplit.getProjectLeadRatio());
normalize(outputSplit::setOfficeRatio, outputSplit.getOfficeRatio());
normalize(outputSplit::setArchRatio, outputSplit.getArchRatio());
normalize(outputSplit::setDecorRatio, outputSplit.getDecorRatio());
@@ -266,4 +283,26 @@ public class ProjectOutputSplitServiceImpl implements ProjectOutputSplitService
return value == null ? ZERO_RATIO : value.setScale(RATIO_SCALE, RoundingMode.HALF_UP);
}
private String joinRoleNames(List<ProjectRolePersonDO> rolePersons, String roleCode) {
return rolePersons.stream()
.filter(item -> Objects.equals(item.getRoleCode(), roleCode))
.map(ProjectRolePersonDO::getEmployeeName)
.filter(Objects::nonNull)
.collect(Collectors.joining(""));
}
private String joinProjectLeadName(String projectManagerName, String engineeringPrincipalName) {
if ((projectManagerName == null || projectManagerName.isEmpty())
&& (engineeringPrincipalName == null || engineeringPrincipalName.isEmpty())) {
return "";
}
if (projectManagerName == null || projectManagerName.isEmpty()) {
return engineeringPrincipalName;
}
if (engineeringPrincipalName == null || engineeringPrincipalName.isEmpty()) {
return projectManagerName;
}
return projectManagerName + " / " + engineeringPrincipalName;
}
}

View File

@@ -13,6 +13,7 @@ import cn.iocoder.lyzsys.module.tjt.dal.mysql.planning.ProjectPlanningMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.planningquarter.ProjectPlanningQuarterMapper;
import cn.iocoder.lyzsys.module.tjt.dal.mysql.project.ProjectMapper;
import cn.iocoder.lyzsys.module.tjt.service.outputsplit.ProjectOutputSplitService;
import cn.iocoder.lyzsys.module.tjt.service.planningguidedetail.ProjectPlanningGuideDetailService;
import cn.iocoder.lyzsys.module.tjt.service.specialtyrolesplit.SpecialtyRoleSplitService;
import cn.iocoder.lyzsys.module.tjt.enums.ProjectPlanningBizTypeConstants;
import org.springframework.stereotype.Service;
@@ -29,13 +30,14 @@ import java.util.Map;
import java.util.Objects;
import static cn.iocoder.lyzsys.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_CALCULATION_METHOD_IMMUTABLE;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_CALCULATION_METHOD_INVALID;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_NOT_EXISTS;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_OWNERSHIP_TYPE_IMMUTABLE;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_OWNERSHIP_TYPE_INVALID;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_PROJECT_NOT_EXISTS;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_VIRTUAL_CALCULATION_METHOD_INVALID;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_WORKING_DAY_COUNT_REQUIRED;
import static cn.iocoder.lyzsys.module.tjt.enums.ErrorCodeConstants.PROJECT_PLANNING_WORKING_DAY_UNIT_PRICE_REQUIRED;
/**
* 合约规划 Service 实现类
@@ -49,6 +51,7 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
private static final int AMOUNT_SCALE = 2;
private static final int RATIO_SCALE = 4;
private static final int FACTOR_SCALE = 2;
private static final int QUANTITY_SCALE = 4;
private static final BigDecimal ZERO_AMOUNT = BigDecimal.ZERO.setScale(AMOUNT_SCALE, RoundingMode.HALF_UP);
private static final BigDecimal ZERO_RATIO = BigDecimal.ZERO.setScale(RATIO_SCALE, RoundingMode.HALF_UP);
@@ -57,7 +60,6 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
private static final BigDecimal DEFAULT_SUBCONTRACT_RATIO = new BigDecimal("0.0400");
private static final BigDecimal DEFAULT_MAJOR_OUTSOURCE_RATIO = new BigDecimal("0.0600");
private static final BigDecimal DEFAULT_COMMON_OUTSOURCE_RATIO = new BigDecimal("0.2500");
private static final BigDecimal DEFAULT_WORKING_DAY_UNIT_PRICE = new BigDecimal("1000.00");
private static final BigDecimal MIN_GUIDANCE_PRICE_RATIO = new BigDecimal("0.6000");
@Resource
@@ -70,6 +72,8 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
private ProjectOutputSplitService projectOutputSplitService;
@Resource
private SpecialtyRoleSplitService specialtyRoleSplitService;
@Resource
private ProjectPlanningGuideDetailService projectPlanningGuideDetailService;
@Override
public Long createProjectPlanning(ProjectPlanningSaveReqVO createReqVO) {
@@ -79,6 +83,7 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
prepareProjectPlanning(planning, project);
calculateProjectPlanning(planning);
projectPlanningMapper.insert(planning);
projectPlanningGuideDetailService.handlePlanningSaved(planning, null);
return planning.getId();
}
@@ -91,6 +96,11 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
prepareProjectPlanning(updateObj, project);
calculateProjectPlanning(updateObj);
projectPlanningMapper.updateById(updateObj);
projectPlanningGuideDetailService.handlePlanningSaved(updateObj, dbPlanning);
if (ProjectPlanningBizTypeConstants.isMajorGuidanceScene(
updateObj.getOwnershipType(), updateObj.getCalculationMethod())) {
return;
}
refreshQuarterDistributionAmounts(updateObj);
}
@@ -103,6 +113,7 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
projectOutputSplitService.deleteByPlanningId(id);
}
projectPlanningQuarterMapper.delete(ProjectPlanningQuarterDO::getPlanningId, id);
projectPlanningGuideDetailService.deleteByPlanningId(id);
projectPlanningMapper.deleteById(id);
}
@@ -117,6 +128,7 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
projectOutputSplitService.deleteByPlanningIds(ids);
}
projectPlanningQuarterMapper.deleteBatch(ProjectPlanningQuarterDO::getPlanningId, ids);
projectPlanningGuideDetailService.deleteByPlanningIds(ids);
projectPlanningMapper.deleteBatchIds(ids);
}
@@ -131,7 +143,7 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
@Override
public List<ProjectPlanningDO> getProjectPlanningListByProjectId(Long projectId) {
validateProjectExists(projectId);
return projectPlanningMapper.selectListByProjectId(projectId);
return projectPlanningMapper.selectDisplayListByProjectId(projectId);
}
@Override
@@ -160,7 +172,8 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
if (!ProjectPlanningBizTypeConstants.isValidOwnershipType(reqVO.getOwnershipType())) {
throw exception(PROJECT_PLANNING_OWNERSHIP_TYPE_INVALID);
}
if (!ProjectPlanningBizTypeConstants.isValidCalculationMethod(reqVO.getCalculationMethod())) {
if (StrUtil.isNotBlank(reqVO.getCalculationMethod())
&& !ProjectPlanningBizTypeConstants.isValidCalculationMethod(reqVO.getCalculationMethod())) {
throw exception(PROJECT_PLANNING_CALCULATION_METHOD_INVALID);
}
if (ProjectPlanningBizTypeConstants.isVirtualOutput(reqVO.getCalculationMethod())
@@ -168,26 +181,39 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
&& !ProjectPlanningBizTypeConstants.isValidVirtualCalculationMethod(reqVO.getVirtualCalculationMethod())) {
throw exception(PROJECT_PLANNING_VIRTUAL_CALCULATION_METHOD_INVALID);
}
if (ProjectPlanningBizTypeConstants.isWorkingDay(reqVO.getVirtualCalculationMethod())) {
if (reqVO.getWorkingDayCount() == null) {
throw exception(PROJECT_PLANNING_WORKING_DAY_COUNT_REQUIRED);
}
if (reqVO.getWorkingDayUnitPrice() == null) {
throw exception(PROJECT_PLANNING_WORKING_DAY_UNIT_PRICE_REQUIRED);
}
}
if (dbPlanning == null) {
return;
}
if (!Objects.equals(dbPlanning.getOwnershipType(), reqVO.getOwnershipType())) {
throw exception(PROJECT_PLANNING_OWNERSHIP_TYPE_IMMUTABLE);
}
if (!Objects.equals(dbPlanning.getCalculationMethod(), reqVO.getCalculationMethod())) {
throw exception(PROJECT_PLANNING_CALCULATION_METHOD_IMMUTABLE);
}
}
private void prepareProjectPlanning(ProjectPlanningDO planning, ProjectDO project) {
if (planning.getSortNo() == null) {
planning.setSortNo(0);
}
if (planning.getPlanningStartYear() == null) {
planning.setPlanningStartYear(project.getProjectStartYear());
}
if (planning.getReviewOutsourceFlag() == null) {
planning.setReviewOutsourceFlag(Boolean.FALSE);
}
planning.setPlanningAmount(amount(planning.getPlanningAmount()));
planning.setContractValueQuantity(quantity(planning.getContractValueQuantity()));
planning.setContractValueUnitPrice(quantity(planning.getContractValueUnitPrice()));
planning.setPlanningAmount(multiplyAmount(
planning.getContractValueQuantity(),
planning.getContractValueUnitPrice()));
planning.setManagementFeeRate(ratio(planning.getManagementFeeRate()));
planning.setVatRate(ratio(planning.getVatRate()));
if (planning.getPlanningArea() == null) {
planning.setPlanningArea(project.getTotalConstructionArea());
}
@@ -219,16 +245,14 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
planning.setWorkingDayUnitPrice(amountNullable(planning.getWorkingDayUnitPrice()));
planning.setGuidanceUnitPrice(amountNullable(planning.getGuidanceUnitPrice()));
planning.setGuidanceTotalPrice(amountNullable(planning.getGuidanceTotalPrice()));
planning.setVirtualTotalPrice(amountNullable(planning.getVirtualTotalPrice()));
if (ProjectPlanningBizTypeConstants.VIRTUAL_CALCULATION_METHOD_WORKING_DAY.equals(planning.getVirtualCalculationMethod())
&& planning.getWorkingDayUnitPrice() == null) {
planning.setWorkingDayUnitPrice(DEFAULT_WORKING_DAY_UNIT_PRICE);
}
}
private void calculateProjectPlanning(ProjectPlanningDO planning) {
planning.setManagementFee(multiplyAmount(planning.getPlanningAmount(), planning.getManagementFeeRate()));
planning.setVatAmount(multiplyAmount(planning.getPlanningAmount(), planning.getVatRate()));
planning.setProjectBudgetOutputValue(amount(planning.getPlanningAmount()
.subtract(planning.getManagementFee())
.subtract(planning.getVatAmount())));
planning.setContractUnitPrice(divideAmount(planning.getPlanningAmount(), planning.getPlanningArea()));
planning.setTotalAdjustmentFactor(ZERO_RATIO);
planning.setAssessmentArea(ZERO_AMOUNT);
@@ -251,16 +275,9 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
private void calculateMajorPlanning(ProjectPlanningDO planning) {
if (ProjectPlanningBizTypeConstants.isGuidancePrice(planning.getCalculationMethod())) {
BigDecimal totalAdjustmentFactor = calculateTotalAdjustmentFactor(planning);
planning.setTotalAdjustmentFactor(totalAdjustmentFactor);
planning.setAssessmentArea(multiplyAmount(planning.getPlanningArea(), totalAdjustmentFactor));
BigDecimal applicableUnitPrice = calculateApplicableUnitPrice(
planning.getContractUnitPrice(), planning.getInternalGuidanceUnitPrice());
planning.setAssessmentOutputValue(multiplyAmount(
applicableUnitPrice,
planning.getAssessmentArea(),
planning.getCurrentDesignStageRatio(),
oneMinus(planning.getReviewOutsourceRatio())));
planning.setTotalAdjustmentFactor(ZERO_RATIO);
planning.setAssessmentArea(ZERO_AMOUNT);
planning.setAssessmentOutputValue(ZERO_AMOUNT);
return;
}
if (ProjectPlanningBizTypeConstants.isContractPrice(planning.getCalculationMethod())) {
@@ -309,17 +326,14 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
}
private BigDecimal calculateVirtualOutputValue(ProjectPlanningDO planning) {
if (ProjectPlanningBizTypeConstants.VIRTUAL_CALCULATION_METHOD_WORKING_DAY.equals(planning.getVirtualCalculationMethod())) {
if (ProjectPlanningBizTypeConstants.isWorkingDay(planning.getVirtualCalculationMethod())) {
return multiplyAmount(planning.getWorkingDayCount(), planning.getWorkingDayUnitPrice());
}
if (ProjectPlanningBizTypeConstants.VIRTUAL_CALCULATION_METHOD_GUIDANCE_PRICE.equals(planning.getVirtualCalculationMethod())) {
if (isPositive(planning.getGuidanceTotalPrice())) {
return amount(planning.getGuidanceTotalPrice());
}
if (ProjectPlanningBizTypeConstants.isVirtualGuidancePrice(planning.getVirtualCalculationMethod())) {
return multiplyAmount(planning.getGuidanceUnitPrice(), planning.getPlanningArea());
}
if (ProjectPlanningBizTypeConstants.VIRTUAL_CALCULATION_METHOD_VIRTUAL_TOTAL_PRICE.equals(planning.getVirtualCalculationMethod())) {
return amount(planning.getVirtualTotalPrice());
if (ProjectPlanningBizTypeConstants.isVirtualGuidanceTotalPrice(planning.getVirtualCalculationMethod())) {
return amount(planning.getGuidanceTotalPrice());
}
return ZERO_AMOUNT;
}
@@ -408,6 +422,11 @@ public class ProjectPlanningServiceImpl implements ProjectPlanningService {
return value == null ? null : factor(value);
}
private BigDecimal quantity(BigDecimal value) {
return value == null ? BigDecimal.ZERO.setScale(QUANTITY_SCALE, RoundingMode.HALF_UP)
: value.setScale(QUANTITY_SCALE, RoundingMode.HALF_UP);
}
private BigDecimal ratio(BigDecimal value) {
return value == null ? ZERO_RATIO : value.setScale(RATIO_SCALE, RoundingMode.HALF_UP);
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.lyzsys.module.tjt.service.planningguidedetail;
import cn.iocoder.lyzsys.module.tjt.controller.admin.planningguidedetail.vo.ProjectPlanningGuideDetailBatchSaveReqVO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.planning.ProjectPlanningDO;
import cn.iocoder.lyzsys.module.tjt.dal.dataobject.planningguidedetail.ProjectPlanningGuideDetailDO;
import java.util.Collection;
import java.util.List;
import java.util.Map;
public interface ProjectPlanningGuideDetailService {
void batchSaveProjectPlanningGuideDetail(ProjectPlanningGuideDetailBatchSaveReqVO reqVO);
void deleteProjectPlanningGuideDetail(Long id);
List<ProjectPlanningGuideDetailDO> getProjectPlanningGuideDetailListByPlanningId(Long planningId);
Map<Long, List<ProjectPlanningGuideDetailDO>> getProjectPlanningGuideDetailMapByPlanningIds(Collection<Long> planningIds);
void deleteByPlanningId(Long planningId);
void deleteByPlanningIds(Collection<Long> planningIds);
void handlePlanningSaved(ProjectPlanningDO planning, ProjectPlanningDO dbPlanning);
}

Some files were not shown because too many files have changed in this diff Show More