refactor(oa): 重构薪资计算逻辑并添加项目签约公司字段
- 将 SalaryCalculationResult 类从 OaEmployeeTemplateBindingServiceImpl 中提取到域模型包下- 在 SysOaProject 模型中添加 signingCompany 字段用于记录签约公司 - 更新相关 BO、VO 和 Mapper 文件以支持新增的签约公司字段 - 优化 SysOaProjectServiceImpl 中的查询条件,支持按签约公司筛选- 修复 SysOssServiceImpl 中的文件下载逻辑,使用 baseMapper 替代 AOP 代理
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.oa.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 薪资计算结果内部类
|
||||||
|
*/
|
||||||
|
public class SalaryCalculationResult {
|
||||||
|
private BigDecimal totalSalary = BigDecimal.ZERO; // 薪资总额
|
||||||
|
private BigDecimal totalPersonalInsurance = BigDecimal.ZERO; // 个人社保总额
|
||||||
|
private BigDecimal totalCompanyInsurance = BigDecimal.ZERO; // 企业社保总额
|
||||||
|
private BigDecimal netSalary = BigDecimal.ZERO; // 实发工资
|
||||||
|
private BigDecimal totalCompanyCost = BigDecimal.ZERO; // 公司总成本
|
||||||
|
|
||||||
|
// getters and setters
|
||||||
|
public BigDecimal getTotalSalary() { return totalSalary; }
|
||||||
|
public void setTotalSalary(BigDecimal totalSalary) { this.totalSalary = totalSalary; }
|
||||||
|
|
||||||
|
public BigDecimal getTotalPersonalInsurance() { return totalPersonalInsurance; }
|
||||||
|
public void setTotalPersonalInsurance(BigDecimal totalPersonalInsurance) { this.totalPersonalInsurance = totalPersonalInsurance; }
|
||||||
|
|
||||||
|
public BigDecimal getTotalCompanyInsurance() { return totalCompanyInsurance; }
|
||||||
|
public void setTotalCompanyInsurance(BigDecimal totalCompanyInsurance) { this.totalCompanyInsurance = totalCompanyInsurance; }
|
||||||
|
|
||||||
|
public BigDecimal getNetSalary() { return netSalary; }
|
||||||
|
public void setNetSalary(BigDecimal netSalary) { this.netSalary = netSalary; }
|
||||||
|
|
||||||
|
public BigDecimal getTotalCompanyCost() { return totalCompanyCost; }
|
||||||
|
public void setTotalCompanyCost(BigDecimal totalCompanyCost) { this.totalCompanyCost = totalCompanyCost; }
|
||||||
|
}
|
||||||
@@ -153,4 +153,6 @@ public class SysOaProject extends BaseEntity {
|
|||||||
* 代号类型
|
* 代号类型
|
||||||
*/
|
*/
|
||||||
private String projectCode;
|
private String projectCode;
|
||||||
|
//签约公司
|
||||||
|
private String signingCompany;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,5 +188,7 @@ public class SysOaProjectBo extends BaseEntity {
|
|||||||
private String projectCode;
|
private String projectCode;
|
||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
|
//签约公司
|
||||||
|
private String signingCompany;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -255,5 +255,7 @@ public class SysOaProjectVo {
|
|||||||
* 项目状态
|
* 项目状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
//签约公司
|
||||||
|
private String signingCompany;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,32 +122,7 @@ public class OaEmployeeTemplateBindingServiceImpl implements IOaEmployeeTemplate
|
|||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 薪资计算结果内部类
|
|
||||||
*/
|
|
||||||
private static class SalaryCalculationResult {
|
|
||||||
private BigDecimal totalSalary = BigDecimal.ZERO; // 薪资总额
|
|
||||||
private BigDecimal totalPersonalInsurance = BigDecimal.ZERO; // 个人社保总额
|
|
||||||
private BigDecimal totalCompanyInsurance = BigDecimal.ZERO; // 企业社保总额
|
|
||||||
private BigDecimal netSalary = BigDecimal.ZERO; // 实发工资
|
|
||||||
private BigDecimal totalCompanyCost = BigDecimal.ZERO; // 公司总成本
|
|
||||||
|
|
||||||
// getters and setters
|
|
||||||
public BigDecimal getTotalSalary() { return totalSalary; }
|
|
||||||
public void setTotalSalary(BigDecimal totalSalary) { this.totalSalary = totalSalary; }
|
|
||||||
|
|
||||||
public BigDecimal getTotalPersonalInsurance() { return totalPersonalInsurance; }
|
|
||||||
public void setTotalPersonalInsurance(BigDecimal totalPersonalInsurance) { this.totalPersonalInsurance = totalPersonalInsurance; }
|
|
||||||
|
|
||||||
public BigDecimal getTotalCompanyInsurance() { return totalCompanyInsurance; }
|
|
||||||
public void setTotalCompanyInsurance(BigDecimal totalCompanyInsurance) { this.totalCompanyInsurance = totalCompanyInsurance; }
|
|
||||||
|
|
||||||
public BigDecimal getNetSalary() { return netSalary; }
|
|
||||||
public void setNetSalary(BigDecimal netSalary) { this.netSalary = netSalary; }
|
|
||||||
|
|
||||||
public BigDecimal getTotalCompanyCost() { return totalCompanyCost; }
|
|
||||||
public void setTotalCompanyCost(BigDecimal totalCompanyCost) { this.totalCompanyCost = totalCompanyCost; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据绑定记录ID集合批量计算薪资明细
|
* 根据绑定记录ID集合批量计算薪资明细
|
||||||
|
|||||||
@@ -180,6 +180,8 @@ public class SysOaProjectServiceImpl implements ISysOaProjectService {
|
|||||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectType()), SysOaProject::getProjectType, bo.getProjectType());
|
lqw.eq(StringUtils.isNotBlank(bo.getProjectType()), SysOaProject::getProjectType, bo.getProjectType());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectStatus()), SysOaProject::getProjectStatus, bo.getProjectStatus());
|
lqw.eq(StringUtils.isNotBlank(bo.getProjectStatus()), SysOaProject::getProjectStatus, bo.getProjectStatus());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), SysOaProject::getCreateBy, bo.getCreateBy());
|
lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), SysOaProject::getCreateBy, bo.getCreateBy());
|
||||||
|
//新增签约公司作为筛选条件
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSigningCompany()), SysOaProject::getSigningCompany, bo.getSigningCompany());
|
||||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||||
SysOaProject::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
SysOaProject::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||||
lqw.orderByDesc(SysOaProject::getCreateTime);
|
lqw.orderByDesc(SysOaProject::getCreateTime);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
<result property="accessory" column="accessory"/>
|
<result property="accessory" column="accessory"/>
|
||||||
<result property="bail" column="bail"/>
|
<result property="bail" column="bail"/>
|
||||||
<result property="closureFiles" column="closure_files"/>
|
<result property="closureFiles" column="closure_files"/>
|
||||||
|
<result property="signingCompany" column="signing_company"/>
|
||||||
<result property="remark" column="remark"/>
|
<result property="remark" column="remark"/>
|
||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="createTime" column="create_time"/>
|
<result property="createTime" column="create_time"/>
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
<result property="count" column="count"/>
|
<result property="count" column="count"/>
|
||||||
<result property="laborCost" column="labor_cost"/>
|
<result property="laborCost" column="labor_cost"/>
|
||||||
<result property="projectCode" column="project_code"/>
|
<result property="projectCode" column="project_code"/>
|
||||||
|
<result property="signingCompany" column="signing_company"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
@@ -301,6 +302,7 @@
|
|||||||
p.postpone_reason,
|
p.postpone_reason,
|
||||||
p.postpone_time,
|
p.postpone_time,
|
||||||
p.color,
|
p.color,
|
||||||
|
p.signing_company,
|
||||||
TIMESTAMPDIFF(DAY, NOW(), p.postpone_time) AS remainTime
|
TIMESTAMPDIFF(DAY, NOW(), p.postpone_time) AS remainTime
|
||||||
FROM sys_oa_project p
|
FROM sys_oa_project p
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void download(Long ossId, HttpServletResponse response) throws IOException {
|
public void download(Long ossId, HttpServletResponse response) throws IOException {
|
||||||
SysOssVo sysOss = SpringUtils.getAopProxy(this).getById(ossId);
|
SysOssVo sysOss = baseMapper.selectVoById(ossId);
|
||||||
if (ObjectUtil.isNull(sysOss)) {
|
if (ObjectUtil.isNull(sysOss)) {
|
||||||
throw new ServiceException("文件数据不存在!");
|
throw new ServiceException("文件数据不存在!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user