This commit is contained in:
parent
4d674bdd37
commit
692c2f5a79
|
|
@ -1,15 +0,0 @@
|
|||
package com.engine.salary.entity.base;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseQueryParam {
|
||||
|
||||
private Integer pageNum = 1;
|
||||
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
|
|
@ -64,4 +64,7 @@ public class DataCollectionEmployee {
|
|||
//生日
|
||||
private String birthday;
|
||||
|
||||
//是否是系统管理员
|
||||
private Boolean isAdmin;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +1,42 @@
|
|||
//package com.engine.salary.entity.salaryacct.dto;
|
||||
//
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
//import java.util.Collection;
|
||||
//
|
||||
///**
|
||||
// * @description: 薪资核算导入时生成导入模板的薪资项目
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 12/13/21 4:26 PM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//@Builder
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//public class SalaryAcctImportFieldDTO {
|
||||
//
|
||||
// //公式项")
|
||||
// private Collection<ImportFieldDTO> formulaItems;
|
||||
//
|
||||
// //输入项")
|
||||
// private Collection<ImportFieldDTO> inputItems;
|
||||
//
|
||||
// @Data
|
||||
// @Builder
|
||||
// @NoArgsConstructor
|
||||
// @AllArgsConstructor
|
||||
// public static class ImportFieldDTO {
|
||||
//
|
||||
// //薪资项目id")
|
||||
// private Long salaryItemId;
|
||||
//
|
||||
// //薪资项目名称")
|
||||
// private String salaryItemName;
|
||||
// }
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 薪资核算导入时生成导入模板的薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryAcctImportFieldDTO {
|
||||
|
||||
//公式项")
|
||||
private Collection<ImportFieldDTO> formulaItems;
|
||||
|
||||
//输入项")
|
||||
private Collection<ImportFieldDTO> inputItems;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ImportFieldDTO {
|
||||
|
||||
//薪资项目id")
|
||||
private Long salaryItemId;
|
||||
|
||||
//薪资项目名称")
|
||||
private String salaryItemName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,32 @@
|
|||
//package com.engine.salary.entity.salaryacct.dto;
|
||||
//
|
||||
//import com.weaver.common.component.table.column.WeaTableColumn;
|
||||
//import com.weaver.common.component.table.page.Page;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//import lombok.experimental.Accessors;
|
||||
//
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * @description: 薪资核算线下对比结果列表
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 2/15/22 1:55 PM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//@Accessors(chain = true)
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//public class SalaryComparisonResultListDTO {
|
||||
//
|
||||
// //列表的表头")
|
||||
// private List<WeaTableColumn> weaTableColumns;
|
||||
//
|
||||
// //列表数据")
|
||||
// private Page<Map<String, Object>> data;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资核算线下对比结果列表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryComparisonResultListDTO {
|
||||
|
||||
//列表的表头")
|
||||
private List<WeaTableColumn> weaTableColumns;
|
||||
|
||||
//列表数据")
|
||||
private PageInfo<Map<String, Object>> data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,34 @@
|
|||
//package com.engine.salary.entity.salaryacct.param;
|
||||
//
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//import lombok.experimental.Accessors;
|
||||
//
|
||||
//import javax.validation.constraints.NotNull;
|
||||
//import java.util.Collection;
|
||||
//
|
||||
///**
|
||||
// * @description: 薪资核算结果的校验参数
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 12/16/21 6:45 PM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//@Accessors(chain = true)
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//@ApiModel("薪资核算结果的校验参数")
|
||||
//public class SalaryAcctCheckParam {
|
||||
//
|
||||
// /**
|
||||
// * 不是employeeId而是salaryAcctEmpId
|
||||
// */
|
||||
// //核算人员的id")
|
||||
// private Collection<Long> ids;
|
||||
//
|
||||
// /**
|
||||
// * 参数错误,薪资核算记录ID不能为空
|
||||
// */
|
||||
// @NotNull(message = "LABEL:99845")
|
||||
// //薪资核算记录id")
|
||||
// private Long salaryAcctRecordId;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 薪资核算结果的校验参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryAcctCheckParam {
|
||||
|
||||
/**
|
||||
* 不是employeeId而是salaryAcctEmpId
|
||||
*/
|
||||
//核算人员的id
|
||||
private Collection<Long> ids;
|
||||
|
||||
//薪资核算记录id
|
||||
@DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空")
|
||||
private Long salaryAcctRecordId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,7 @@ import com.engine.salary.common.BaseQueryParam;
|
|||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
|
@ -20,9 +17,10 @@ import java.util.Collection;
|
|||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class SalaryAcctEmployeeQueryParam extends BaseQueryParam {
|
||||
|
||||
//薪资核算记录id")
|
||||
|
|
@ -41,7 +39,10 @@ public class SalaryAcctEmployeeQueryParam extends BaseQueryParam {
|
|||
//岗位")
|
||||
private Collection<Long> positionIds;
|
||||
|
||||
//状态")
|
||||
/**
|
||||
* 状态
|
||||
* @see SalaryEmployeeStatusEnum
|
||||
*/
|
||||
private SalaryEmployeeStatusEnum status;
|
||||
|
||||
//离职日期")
|
||||
|
|
|
|||
|
|
@ -1,36 +1,31 @@
|
|||
//package com.engine.salary.entity.salaryacct.param;
|
||||
//
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Getter;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//import lombok.Setter;
|
||||
//
|
||||
//import javax.validation.constraints.NotEmpty;
|
||||
//import java.util.Collection;
|
||||
//
|
||||
///**
|
||||
// * @description: 薪资核算导入数据时下载导入模板的参数
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 12/13/21 4:41 PM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Getter
|
||||
//@Setter
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//@ApiModel("薪资核算导入数据时下载导入模板的参数")
|
||||
//public class SalaryAcctImportTemplateParam extends SalaryAcctResultQueryParam {
|
||||
//
|
||||
// /**
|
||||
// * 薪资项目id不能为空
|
||||
// */
|
||||
// @NotEmpty(message = "LABEL:93297")
|
||||
// //薪资项目id")
|
||||
// private Collection<Long> salaryItemIds;
|
||||
//
|
||||
// //是否导出数据")
|
||||
// private String importType;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 薪资核算导入数据时下载导入模板的参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryAcctImportTemplateParam extends SalaryAcctResultQueryParam {
|
||||
|
||||
//薪资项目id")
|
||||
@DataCheck(require = true,message = "薪资项目id不能为空")
|
||||
private Collection<Long> salaryItemIds;
|
||||
|
||||
//是否导出数据")
|
||||
private String importType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@ import com.engine.salary.common.BaseQueryParam;
|
|||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
|
@ -17,6 +20,9 @@ import java.util.Collection;
|
|||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryAcctResultQueryParam extends BaseQueryParam {
|
||||
|
||||
//薪资核算记录id
|
||||
|
|
|
|||
|
|
@ -1,34 +1,31 @@
|
|||
//package com.engine.salary.entity.salaryacct.param;
|
||||
//
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
//import javax.validation.constraints.NotNull;
|
||||
//import java.util.Collection;
|
||||
//
|
||||
///**
|
||||
// * @description: 薪资核算校验异常导出参数
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 1/4/22 3:29 PM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//@Builder
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//public class SalaryCheckResultExportParam {
|
||||
//
|
||||
// //指定导出的id")
|
||||
// private Collection<Long> ids;
|
||||
//
|
||||
// /**
|
||||
// * 参数错误,薪资核算记录ID不能为空
|
||||
// */
|
||||
// @NotNull(message = "LABEL:99845")
|
||||
// //薪资核算记录的id")
|
||||
// private Long salaryAcctRecordId;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 薪资核算校验异常导出参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryCheckResultExportParam {
|
||||
|
||||
//指定导出的id
|
||||
private Collection<Long> ids;
|
||||
|
||||
//薪资核算记录的id
|
||||
@DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空")
|
||||
private Long salaryAcctRecordId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,27 @@
|
|||
//package com.engine.salary.entity.salaryacct.param;
|
||||
//
|
||||
//import com.weaver.hrm.salary.common.BaseQueryParam;
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
//import javax.validation.constraints.NotNull;
|
||||
//
|
||||
///**
|
||||
// * @description: 校验结果列表查询参数
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 12/8/21 1:43 PM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//@Builder
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//@ApiModel("校验结果列表查询参数")
|
||||
//public class SalaryCheckResultQueryParam extends BaseQueryParam {
|
||||
//
|
||||
// /**
|
||||
// * 参数错误,薪资核算记录ID不能为空
|
||||
// */
|
||||
// @NotNull(message = "LABEL:99845")
|
||||
// //薪资核算的id")
|
||||
// private Long salaryAcctRecordId;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 校验结果列表查询参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryCheckResultQueryParam extends BaseQueryParam {
|
||||
|
||||
//薪资核算的id
|
||||
@DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空")
|
||||
private Long salaryAcctRecordId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,27 @@
|
|||
//package com.engine.salary.entity.salaryacct.param;
|
||||
//
|
||||
//import com.weaver.hrm.salary.common.BaseQueryParam;
|
||||
//import io.swagger.annotations.ApiModel;
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
//import javax.validation.constraints.NotNull;
|
||||
//
|
||||
///**
|
||||
// * @description: 校验结果明细列表查询参数
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 12/8/21 1:44 PM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//@Builder
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//@ApiModel("校验结果明细列表查询参数")
|
||||
//public class SalaryCheckResultRecordQueryParam extends BaseQueryParam {
|
||||
//
|
||||
// /**
|
||||
// * 核算异常的id不能为空
|
||||
// */
|
||||
// @NotNull(message = "LABEL:99849")
|
||||
// //校验结果id")
|
||||
// private Long checkResultId;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 校验结果明细列表查询参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryCheckResultRecordQueryParam extends BaseQueryParam {
|
||||
|
||||
//校验结果id
|
||||
@DataCheck(require = true,message = "核算异常的id不能为空")
|
||||
private Long checkResultId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,20 @@
|
|||
//package com.engine.salary.entity.salaryacct.param;
|
||||
//
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.Data;
|
||||
//
|
||||
//import javax.validation.constraints.NotNull;
|
||||
//
|
||||
///**
|
||||
// * @description: 薪资核算线下对比结果导入模板导出参数
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 2/15/22 4:04 PM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//public class SalaryComparisonResultExportParam {
|
||||
//
|
||||
// /**
|
||||
// * 参数错误,薪资核算记录ID不能为空
|
||||
// */
|
||||
// @NotNull(message = "LABEL:99845")
|
||||
// //薪资核算记录id")
|
||||
// private Long salaryAcctRecordId;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 薪资核算线下对比结果导入模板导出参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class SalaryComparisonResultExportParam {
|
||||
|
||||
//薪资核算记录id
|
||||
@DataCheck(require = true, message = "参数错误,薪资核算记录ID不能为空")
|
||||
private Long salaryAcctRecordId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
//package com.engine.salary.entity.salaryacct.param;
|
||||
//
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
||||
//import lombok.Data;
|
||||
//import lombok.EqualsAndHashCode;
|
||||
//
|
||||
///**
|
||||
// * @description: 薪资核算线下对比结果查询参数
|
||||
// * @author: xiajun
|
||||
// * @modified By: xiajun
|
||||
// * @date: Created in 2/15/22 11:34 AM
|
||||
// * @version:v1.0
|
||||
// */
|
||||
//@Data
|
||||
//@EqualsAndHashCode(callSuper = true)
|
||||
//public class SalaryComparisonResultQueryParam extends SalaryAcctResultQueryParam {
|
||||
//
|
||||
// //仅显示有差异的人员")
|
||||
// private boolean onlyDiffEmployee;
|
||||
//
|
||||
// //仅显示有差异的薪资项目")
|
||||
// private boolean onlyDiffSalaryItem;
|
||||
//}
|
||||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 薪资核算线下对比结果查询参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SalaryComparisonResultQueryParam extends SalaryAcctResultQueryParam {
|
||||
|
||||
//仅显示有差异的人员")
|
||||
private boolean onlyDiffEmployee;
|
||||
|
||||
//仅显示有差异的薪资项目")
|
||||
private boolean onlyDiffSalaryItem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ alter table hrsa_salary_archive_tax_agent modify id bigint auto_increment;
|
|||
alter table hrsa_salary_archive_item modify id bigint auto_increment;
|
||||
alter table hrsa_salary_acct_record modify id bigint auto_increment;
|
||||
alter table hrsa_salary_acct_emp modify id bigint auto_increment;
|
||||
alter table hrsa_acct_result_temp modify id bigint auto_increment;
|
||||
|
||||
|
||||
--福利方案主键自增增加
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@
|
|||
and declare_month = #{param.declareMonth}
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size()>0">
|
||||
AND t1.employee_id IN
|
||||
AND t.employee_id IN
|
||||
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
#{employeeId}
|
||||
</foreach>
|
||||
|
|
|
|||
|
|
@ -165,18 +165,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'||#{param.employeeName}||'%'
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -236,18 +236,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'+#{param.employeeName}+'%'
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -333,18 +333,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE
|
||||
SELECT id FROM hrmresource em WHERE
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'||#{param.employeeName}||'%'
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -404,18 +404,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'+#{param.employeeName}+'%'
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -478,18 +478,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'||#{param.employeeName}||'%'
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -527,18 +527,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'+#{param.employeeName}+'%'
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -586,18 +586,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'||#{param.employeeName}||'%'
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -635,18 +635,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'+#{param.employeeName}+'%'
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -676,18 +676,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE CONCAT('%',#{param.employeeName},'%')
|
||||
AND em.lastname LIKE CONCAT('%',#{param.employeeName},'%')
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -714,18 +714,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'||#{param.employeeName}||'%'
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -752,18 +752,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'+#{param.employeeName}+'%'
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -829,18 +829,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'||#{param.employeeName}||'%'
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -888,18 +888,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'+#{param.employeeName}+'%'
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -967,18 +967,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'||#{param.employeeName}||'%'
|
||||
AND em.lastname LIKE '%'||#{param.employeeName}||'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
@ -1026,18 +1026,18 @@
|
|||
or (param.status != null and param.status != 'ALL')">
|
||||
AND employee_id IN
|
||||
(
|
||||
SELECT id FROM {$publicdb}.employee em WHERE 1=1
|
||||
SELECT id FROM hrmresource em WHERE 1=1
|
||||
<if test="param.employeeName != null and param.employeeName != ''">
|
||||
AND em.username LIKE '%'+#{param.employeeName}+'%'
|
||||
AND em.lastname LIKE '%'+#{param.employeeName}+'%'
|
||||
</if>
|
||||
<if test="param.departmentIds != null and param.departmentIds.size()>0">
|
||||
AND em.department IN
|
||||
AND em.departmentid IN
|
||||
<foreach collection="param.departmentIds" open="(" item="departmentId" separator="," close=")">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.positionIds != null and param.positionIds.size()>0">
|
||||
AND em.position IN
|
||||
AND em.jobtitle IN
|
||||
<foreach collection="param.positionIds" open="(" item="positionId" separator="," close=")">
|
||||
#{positionId}
|
||||
</foreach>
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@
|
|||
SELECT
|
||||
<include refid="SalaryAcctResultColumn"/>
|
||||
FROM hrsa_salary_acct_result
|
||||
WHERE tenant_key = #{tenantKey} AND delete_type = 0
|
||||
WHERE delete_type = 0
|
||||
AND salary_acct_record_id IN
|
||||
<foreach collection="salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
|
||||
#{salaryAcctRecordId}
|
||||
|
|
@ -326,7 +326,7 @@
|
|||
AND salary_acct_emp_id IN
|
||||
(
|
||||
SELECT id FROM hrsa_salary_acct_emp emp
|
||||
WHERE emp.tenant_key = #{tenantKey} AND emp.delete_type = 0
|
||||
WHERE emp.delete_type = 0
|
||||
AND emp.salary_acct_record_id IN
|
||||
<foreach collection="salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
|
||||
#{salaryAcctRecordId}
|
||||
|
|
@ -403,7 +403,7 @@
|
|||
|
||||
<delete id="deleteBySalaryAcctRecordIds">
|
||||
DELETE FROM hrsa_salary_acct_result
|
||||
WHERE tenant_key = #{tenantKey} AND delete_type = 0
|
||||
WHERE delete_type = 0
|
||||
AND salary_acct_record_id IN
|
||||
<foreach collection="salaryAcctRecordIds" open="(" item="salaryAcctRecordId" separator="," close=")">
|
||||
#{salaryAcctRecordId}
|
||||
|
|
@ -412,7 +412,7 @@
|
|||
|
||||
<delete id="deleteBySalaryAcctEmpIds">
|
||||
DELETE FROM hrsa_salary_acct_result
|
||||
WHERE tenant_key = #{tenantKey} AND delete_type = 0
|
||||
WHERE delete_type = 0
|
||||
AND salary_acct_emp_id IN
|
||||
<foreach collection="salaryAcctEmpIds" open="(" item="salaryAcctEmpId" separator="," close=")">
|
||||
#{salaryAcctEmpId}
|
||||
|
|
@ -421,7 +421,7 @@
|
|||
|
||||
<delete id="deleteByAcctEmpIdsAndSalaryItemIds">
|
||||
DELETE FROM hrsa_salary_acct_result
|
||||
WHERE tenant_key = #{tenantKey} AND delete_type = 0
|
||||
WHERE delete_type = 0
|
||||
AND salary_acct_emp_id IN
|
||||
<foreach collection="salaryAcctEmpIds" open="(" item="salaryAcctEmpId" separator="," close=")">
|
||||
#{salaryAcctEmpId}
|
||||
|
|
@ -434,7 +434,7 @@
|
|||
|
||||
<delete id="deleteByIds">
|
||||
DELETE FROM hrsa_salary_acct_result
|
||||
WHERE tenant_key = #{tenantKey} AND delete_type = 0
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
|
|
|
|||
|
|
@ -1,452 +0,0 @@
|
|||
package com.engine.salary.process.datacollection;
|
||||
|
||||
import com.engine.common.constant.BizLogSmallType4Hrm;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.personalIncomeTax.enums.VerificationTypeEnum;
|
||||
import com.engine.personalIncomeTax.service.ImportLogService;
|
||||
import com.engine.personalIncomeTax.service.impl.ImportLogServiceImpl;
|
||||
import com.engine.personalIncomeTax.util.PITUtil;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.file.FileManage;
|
||||
import weaver.file.FileUploadToPath;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class CostImportProcess extends BaseBean {
|
||||
public CostImportProcess(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
private User user;
|
||||
private String keyField;
|
||||
private int keyFieldIndex = 0;
|
||||
private String excelfile;
|
||||
private Sheet sheet;
|
||||
private Map<String,Object> error = null;
|
||||
private List<Map<String, Object>> errorInfo = new ArrayList<>();
|
||||
|
||||
//标准模板字段名称
|
||||
private List<String> tempFieldLabel = new ArrayList<>(Arrays.asList(""+ SystemEnv.getHtmlLabelName(714,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(413,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(16126,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(10005512,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(10005513,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(25043,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(10005514,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(10005515,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(10005516,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(10005517,weaver.general.ThreadVarLanguage.getLang())+"", ""+ SystemEnv.getHtmlLabelName(10005518,weaver.general.ThreadVarLanguage.getLang())+""));
|
||||
private List<String> tempField = new ArrayList<>(Arrays.asList("workcode", "lastname", "loginid", "verificationType", "verificationId", "month", "childEdu", "loan", "rent", "supportParent", "edu"));
|
||||
//必填列
|
||||
private List<String> requireField = new ArrayList<>(Arrays.asList("month"));
|
||||
//列序号
|
||||
private List<Integer> fieldIndex = new ArrayList<>();
|
||||
|
||||
//需要导入的数据
|
||||
private List<Map<String, Object>> datas = new ArrayList<>();
|
||||
|
||||
int processId = 0;
|
||||
|
||||
/**
|
||||
* map集合创建类
|
||||
*
|
||||
* @param fu 上传参数
|
||||
* @return List
|
||||
*/
|
||||
public List creatImportMap(FileUploadToPath fu) {
|
||||
try {
|
||||
// 初始化数据
|
||||
initDataSource(fu);
|
||||
|
||||
// 模板验证
|
||||
valExcelTemp();
|
||||
|
||||
// 读取数据并验证
|
||||
readExcel();
|
||||
|
||||
} catch (NegativeArraySizeException ex) {
|
||||
deleteFile();
|
||||
errorInfo.add(generateErrMsg("Excel"+ SystemEnv.getHtmlLabelName(10003739,weaver.general.ThreadVarLanguage.getLang())+""));//目前尚不清楚,这种异常的产生原因
|
||||
writeLog(ex);
|
||||
} catch (Exception e) {
|
||||
deleteFile();
|
||||
e.printStackTrace();
|
||||
errorInfo.add(generateErrMsg("Excel"+ SystemEnv.getHtmlLabelName(10003740,weaver.general.ThreadVarLanguage.getLang())+""));//Excel"+weaver.systeminfo.SystemEnv.getHtmlLabelName(10003740,weaver.general.ThreadVarLanguage.getLang())+"
|
||||
writeLog(e);
|
||||
}
|
||||
|
||||
return errorInfo;
|
||||
}
|
||||
|
||||
private Map<String, Object> generateErrMsg(String msg){
|
||||
error = new HashMap<String,Object>();
|
||||
error.put("message",msg);
|
||||
return error;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
private void deleteFile() {
|
||||
try {
|
||||
FileManage.DeleteFile(excelfile);
|
||||
} catch (Exception ex) {
|
||||
writeLog(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上传文件,初始化参数
|
||||
*
|
||||
* @param fu
|
||||
* @return
|
||||
*/
|
||||
private void initDataSource(FileUploadToPath fu) throws Exception {
|
||||
keyField = fu.getParameter("keyField");
|
||||
keyFieldIndex = tempField.indexOf(keyField);
|
||||
excelfile = fu.getParameter("excelfile");
|
||||
|
||||
requireField.add(keyField);
|
||||
|
||||
try {
|
||||
ImageFileManager manager = new ImageFileManager();
|
||||
manager.getImageFileInfoById(Util.getIntValue(excelfile));
|
||||
Workbook workbook = WorkbookFactory.create(manager.getInputStream());
|
||||
sheet = workbook.getSheetAt(0);
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (IOException e) {
|
||||
errorInfo.add(generateErrMsg(SystemEnv.getHtmlLabelName(83618, user.getLanguage()))); //上传文件不是excel文件
|
||||
writeLog(e);
|
||||
throw e;
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
errorInfo.add(generateErrMsg(""+ SystemEnv.getHtmlLabelName(10003741,weaver.general.ThreadVarLanguage.getLang())+"1"+ SystemEnv.getHtmlLabelName(27591,weaver.general.ThreadVarLanguage.getLang())+"sheet"+ SystemEnv.getHtmlLabelName(10005519,weaver.general.ThreadVarLanguage.getLang())+""));
|
||||
writeLog(e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证模板格式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private void valExcelTemp() throws Exception {
|
||||
Row row;
|
||||
Cell cell;
|
||||
String cellValue;
|
||||
Boolean flag;
|
||||
|
||||
try {
|
||||
row = sheet.getRow(0);
|
||||
for (int i = 0; i < row.getLastCellNum(); i++) {
|
||||
cell = row.getCell(i);
|
||||
|
||||
if (cell == null)
|
||||
continue;
|
||||
|
||||
cellValue = getCellValue(cell);
|
||||
flag = tempFieldLabel.contains(cellValue);
|
||||
if (!flag)
|
||||
errorInfo.add(generateErrMsg(getCellPosition(i, 1) + "[" + cellValue + "]" + " "+ SystemEnv.getHtmlLabelName(10003743,weaver.general.ThreadVarLanguage.getLang())+"")); //不是模板中字段,请检查是否有误
|
||||
else
|
||||
fieldIndex.add(tempFieldLabel.indexOf(cellValue));
|
||||
}
|
||||
} catch (IllegalArgumentException ex) {
|
||||
errorInfo.add(generateErrMsg("Excel"+ SystemEnv.getHtmlLabelName(10005520,weaver.general.ThreadVarLanguage.getLang())+""));
|
||||
writeLog(ex);
|
||||
throw ex;
|
||||
} catch (Exception ex) {
|
||||
errorInfo.add(generateErrMsg("Excel"+ SystemEnv.getHtmlLabelName(10005520,weaver.general.ThreadVarLanguage.getLang())+""));
|
||||
writeLog(ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取excel数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private void readExcel() throws Exception {
|
||||
Row row;
|
||||
Cell cell;
|
||||
String cellValue;
|
||||
|
||||
try {
|
||||
for (int i = 1; i <= sheet.getLastRowNum(); i++) {
|
||||
row = sheet.getRow(i);
|
||||
|
||||
if (row == null)
|
||||
continue;
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
|
||||
for (int j = 0; j < row.getLastCellNum(); j++) {
|
||||
cell = row.getCell(j);
|
||||
String fieldlable = tempFieldLabel.get(fieldIndex.get(j));
|
||||
String fieldname = tempField.get(fieldIndex.get(j));
|
||||
if (cell == null && requireField.contains(fieldname)){
|
||||
errorInfo.add(generateErrMsg(getCellPosition(j, i + 1) + "[" + fieldlable + "]" + " "+ SystemEnv.getHtmlLabelName(18019,weaver.general.ThreadVarLanguage.getLang())+""));
|
||||
break;
|
||||
}
|
||||
if(cell == null)
|
||||
continue;
|
||||
|
||||
cellValue = getCellValue(cell);
|
||||
if ("".equals(cellValue) && requireField.contains(fieldname)){
|
||||
errorInfo.add(generateErrMsg(getCellPosition(j, i + 1) + "[" + fieldlable + "]" + " "+ SystemEnv.getHtmlLabelName(18019,weaver.general.ThreadVarLanguage.getLang())+""));
|
||||
break;
|
||||
}
|
||||
|
||||
data.put(tempField.get(fieldIndex.get(j)), cellValue);
|
||||
}
|
||||
|
||||
if (!data.isEmpty()){
|
||||
Integer resourceId = checkKeyField(data);
|
||||
if(resourceId != null)
|
||||
datas.add(data);
|
||||
else
|
||||
errorInfo.add(generateErrMsg(getCellPosition(keyFieldIndex, i + 1) + ""+ SystemEnv.getHtmlLabelName(512694,weaver.general.ThreadVarLanguage.getLang())+""));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
writeLog(ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
private Integer checkKeyField(Map<String, Object> data){
|
||||
Integer resourceId = null;
|
||||
try{
|
||||
RecordSet rs = new RecordSet();
|
||||
String keyFieldValue = Util.null2String(data.get(keyField));
|
||||
String sql = "";
|
||||
if(keyField.equals("verificationId")){
|
||||
String verificationType = Util.null2String(data.get("verificationType"));
|
||||
String type = getVerificationType(verificationType);
|
||||
if("".equals(type) || "1".equals(type)){
|
||||
sql = "select id, lastname from hrmresource where certificatenum = ?";
|
||||
rs.executeQuery(sql, keyFieldValue);
|
||||
}else {
|
||||
sql = "select r.id, r.lastname from hrmresource r, HRM_PIT_BASICINFO i where r.id = i.id and i.verificationtype = ? and i.verificationid = ?";
|
||||
rs.executeQuery(sql, type, keyFieldValue);
|
||||
}
|
||||
writeLog("type:"+type+", sql:"+sql);
|
||||
}else{
|
||||
sql = "select id, lastname from hrmresource where " + keyField + " = ?";
|
||||
rs.executeQuery(sql, keyFieldValue);
|
||||
}
|
||||
while(rs.next()){
|
||||
resourceId = rs.getInt("id");
|
||||
data.put("pid", resourceId);
|
||||
data.put("lastname", Util.null2String(rs.getString("lastname")));
|
||||
}
|
||||
}catch (Exception ex){
|
||||
writeLog(ex);
|
||||
}
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
private String getVerificationType(String verificationType){
|
||||
String type = "";
|
||||
for (VerificationTypeEnum vt : VerificationTypeEnum.values()) {
|
||||
if("".equals(vt.getName()))
|
||||
continue;
|
||||
if(SystemEnv.getHtmlLabelName(Integer.valueOf(vt.getName()), 7).equals(verificationType))
|
||||
type = vt.getValue();
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据到数据库
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void processMap() {
|
||||
ImportLogService importLogService = (ImportLogService) ServiceUtil.getService(ImportLogServiceImpl.class, this.user);
|
||||
try {
|
||||
RecordSet rs = new RecordSet();
|
||||
boolean flag = false;
|
||||
String sql = "";
|
||||
int i = 0;
|
||||
for (Map<String, Object> data : datas) {
|
||||
int pid = Util.getIntValue(String.valueOf(data.get("pid")));
|
||||
String lastname = Util.null2String(data.get("lastname"));
|
||||
String id = "";
|
||||
sql = "select id from hrm_pit_tax where pid = ? and month = ?";
|
||||
rs.executeQuery(sql, pid, data.get("month"));
|
||||
if(rs.next()){
|
||||
//update
|
||||
id = rs.getString("id");
|
||||
sql = "update hrm_pit_tax set childEdu = ?, edu = ?, loan = ?, rent = ?, supportParent = ? where id = ?";
|
||||
flag = executeSql(sql, new Object[]{data.get("childEdu"), data.get("edu"), data.get("loan"), data.get("rent"), data.get("supportParent"), id});
|
||||
}else{
|
||||
//create
|
||||
id = PITUtil.getInstance().getUnquieID();
|
||||
sql = "insert into hrm_pit_tax(id, pid, month, childEdu, edu, loan, rent, supportParent) values(?,?,?,?,?,?,?,?)";
|
||||
flag = executeSql(sql, new Object[]{id, pid, data.get("month"), data.get("childEdu"), data.get("edu"), data.get("loan"), data.get("rent"), data.get("supportParent")});
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pId", processId);
|
||||
params.put("lineNum", (i + 1));
|
||||
params.put("relatedName", lastname);
|
||||
params.put("msg", ""+ SystemEnv.getHtmlLabelName(15323,weaver.general.ThreadVarLanguage.getLang())+"" + (i + 1) + ""+ SystemEnv.getHtmlLabelName(10003745,weaver.general.ThreadVarLanguage.getLang())+"" + ","+ SystemEnv.getHtmlLabelName(25750,weaver.general.ThreadVarLanguage.getLang())+"!");
|
||||
params.put("status", "1");
|
||||
params.put("logSmallType", BizLogSmallType4Hrm.HRM_ENGINE_TAX_COST_IMPORT.getCode());
|
||||
importLogService.saveImportDeitalLog(params, user);
|
||||
} else {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pId", processId);
|
||||
params.put("lineNum", (i + 1));
|
||||
params.put("relatedName", lastname);
|
||||
params.put("msg", ""+ SystemEnv.getHtmlLabelName(15323,weaver.general.ThreadVarLanguage.getLang())+"" + (i + 1) + ""+ SystemEnv.getHtmlLabelName(10003745,weaver.general.ThreadVarLanguage.getLang())+"" + ","+ SystemEnv.getHtmlLabelName(24945,weaver.general.ThreadVarLanguage.getLang())+"!");
|
||||
params.put("status", "0");
|
||||
params.put("logSmallType", BizLogSmallType4Hrm.HRM_ENGINE_TAX_COST_IMPORT.getCode());
|
||||
importLogService.saveImportDeitalLog(params, user);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
writeLog(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取excel单元格值
|
||||
*
|
||||
* @param cell 要读取的单元格对象
|
||||
* @return
|
||||
*/
|
||||
private String getCellValue(Cell cell) {
|
||||
String cellValue = "";
|
||||
if (cell == null)
|
||||
return "";
|
||||
switch (cell.getCellType()) {
|
||||
case BOOLEAN://得到Boolean对象的方法
|
||||
cellValue = Util.null2String(cell.getBooleanCellValue());
|
||||
break;
|
||||
case NUMERIC:
|
||||
if (DateUtil.isCellDateFormatted(cell)) {//先看是否是日期格式
|
||||
SimpleDateFormat sft = new SimpleDateFormat("yyyy-MM");
|
||||
cellValue = sft.format(cell.getDateCellValue()); //读取日期格式
|
||||
} else {
|
||||
cellValue = Util.null2String(new Double(cell.getNumericCellValue())); //读取数字
|
||||
if (cellValue.endsWith(".0"))
|
||||
cellValue = cellValue.substring(0, cellValue.indexOf("."));
|
||||
}
|
||||
break;
|
||||
case STRING://读取String
|
||||
cellValue = Util.null2String(cell.getStringCellValue());
|
||||
Date d = validDate(cellValue);
|
||||
if (d != null)
|
||||
cellValue = new SimpleDateFormat("yyyy-MM-dd").format(d);
|
||||
break;
|
||||
}
|
||||
|
||||
return cellValue.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* excel单元格位置转换
|
||||
*
|
||||
* @param cellIndex 列号
|
||||
* @param rowNum 行号
|
||||
* @return
|
||||
*/
|
||||
private String getCellPosition(int cellIndex, int rowNum) {
|
||||
|
||||
int count = cellIndex / 26;
|
||||
String cellChar = String.valueOf((char) (cellIndex % 26 + 65));
|
||||
String cellPosition = "";
|
||||
|
||||
if (count != 0)
|
||||
cellPosition = String.valueOf((char) ((count - 1) + 65)) + cellChar;
|
||||
else
|
||||
cellPosition = cellChar;
|
||||
cellPosition += rowNum;
|
||||
return cellPosition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证单元格内容是否为日期
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
private Date validDate(String str) {
|
||||
Date d = null;
|
||||
SimpleDateFormat fmt1 = new SimpleDateFormat("yyyy-MM-dd");
|
||||
fmt1.setLenient(false);
|
||||
SimpleDateFormat fmt2 = new SimpleDateFormat("yyyy/MM/dd");
|
||||
fmt2.setLenient(false);
|
||||
try {
|
||||
d = fmt1.parse(str);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
try {
|
||||
d = fmt2.parse(str);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置session属性,匹配监控进程
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> init(HttpServletRequest request){
|
||||
Map<String, Object> retmap = new HashMap<String, Object>();
|
||||
try {
|
||||
ImportLogService importLogService = (ImportLogService) ServiceUtil.getService(ImportLogServiceImpl.class, user);
|
||||
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||
retmap = importLogService.saveImportLog(params, request, user);
|
||||
if(Util.null2String(retmap.get("status")).equals("1")){
|
||||
String importType = "tax";
|
||||
processId = Util.getIntValue(Util.null2String(retmap.get("pId")));
|
||||
String processName = "hrm"+importType+"PId";;
|
||||
request.getSession(true).setAttribute(processName, processId);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
writeLog(e) ;
|
||||
}
|
||||
return retmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入结束后更新日志状态,写入over状态,前端就不再轮询日志
|
||||
* @param request
|
||||
*/
|
||||
public void over(HttpServletRequest request){
|
||||
try {
|
||||
ImportLogService importLogService = (ImportLogServiceImpl) ServiceUtil.getService(ImportLogServiceImpl.class, user);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pId", processId);
|
||||
params.put("status", "over");
|
||||
importLogService.saveImportLogStatus(params, user);
|
||||
|
||||
deleteFile();
|
||||
} catch(Exception e) {
|
||||
writeLog(e) ;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean executeSql(String sql, Object[] params){
|
||||
boolean flag = false;
|
||||
try{
|
||||
flag = new RecordSet().executeUpdate(sql, params);
|
||||
}catch (Exception ex){
|
||||
writeLog(ex);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ public interface SalaryAcctEmployeeService {
|
|||
* @param queryParam 薪资核算结果列表的列表查询条件
|
||||
* @return
|
||||
*/
|
||||
PageInfo<SalaryAcctEmployeePO> listPageByResultQueryParam(SalaryAcctResultQueryParam queryParam);
|
||||
PageInfo<SalaryAcctEmployeePO> listPageByResultQueryParam(SalaryAcctResultQueryParam queryParam) ;
|
||||
|
||||
/**
|
||||
* 根据薪资核算结果列表的列表查询条件查询薪资核算人员
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctImportFieldDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资核算导入导出
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface SalaryAcctExcelService {
|
||||
|
||||
/**
|
||||
* 薪资核算人员导出
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 薪资核算环比减少人员导出
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
XSSFWorkbook exportReducedEmployee(SalaryAcctEmployeeQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 薪资核算结果导出
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
XSSFWorkbook exportSalaryAcctResult(SalaryAcctResultQueryParam queryParam);
|
||||
|
||||
List<WeaTableColumn> listWeaTableColumn(SalaryAcctRecordPO salaryAcctRecordPO);
|
||||
|
||||
/**
|
||||
* 薪资核算导入时候薪资项目按取值方式分组
|
||||
*
|
||||
* @param salaryAcctId
|
||||
* @return
|
||||
*/
|
||||
SalaryAcctImportFieldDTO getImportField(Long salaryAcctId);
|
||||
|
||||
/**
|
||||
* 下载薪资核算导入模板
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
XSSFWorkbook exportImportTemplate(SalaryAcctImportTemplateParam param);
|
||||
|
||||
// /**
|
||||
// * 薪资核算线下对比结果导出
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// XSSFWorkbook exportComparisonResult(SalaryComparisonResultQueryParam queryParam);
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算线下对比结果导入模板导出
|
||||
// *
|
||||
// * @param exportParam
|
||||
// * @return
|
||||
// */
|
||||
// XSSFWorkbook exportComparisonResultTemplate(SalaryComparisonResultExportParam exportParam);
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算结果校验异常导出
|
||||
// *
|
||||
// * @param exportParam
|
||||
// * @return
|
||||
// */
|
||||
// XSSFWorkbook exportCheckResult(SalaryCheckResultExportParam exportParam);
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算结果校验异常明细导出
|
||||
// *
|
||||
// * @param checkResultId
|
||||
// * @return
|
||||
// */
|
||||
// XSSFWorkbook exportCheckResultDetail(Long checkResultId);
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryCheckResultRecordCountDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryCheckResultRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryCheckResultRecordPO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资核算结果校验异常明细
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface SalaryCheckResultDetailService {
|
||||
|
||||
/**
|
||||
* 统计薪资核算结果校验异常的明细数量
|
||||
*
|
||||
* @param checkResultId 薪资核算结果的校验异常id
|
||||
* @return
|
||||
*/
|
||||
List<SalaryCheckResultRecordCountDTO> countByCheckResultId(Collection<Long> checkResultId);
|
||||
|
||||
/**
|
||||
* 根据校验异常id查询校验异常明细
|
||||
*
|
||||
* @param checkResultId 校验异常id
|
||||
* @return
|
||||
*/
|
||||
List<SalaryCheckResultRecordPO> listByCheckResultId(Long checkResultId);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id查询校验异常明细
|
||||
*
|
||||
* @param salaryAcctRecordId
|
||||
* @return
|
||||
*/
|
||||
List<SalaryCheckResultRecordPO> listBySalaryAcctRecordId(Long salaryAcctRecordId);
|
||||
|
||||
/**
|
||||
* 根据列表查询条件查询校验异常明细(分页)
|
||||
*
|
||||
* @param queryParam 列表查询条件
|
||||
* @return
|
||||
*/
|
||||
PageInfo<SalaryCheckResultRecordPO> listPageByParam(SalaryCheckResultRecordQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
*
|
||||
* @param salaryCheckResultRecordPOS
|
||||
*/
|
||||
void batchSave(Collection<SalaryCheckResultRecordPO> salaryCheckResultRecordPOS);
|
||||
|
||||
/**
|
||||
* 根据主键id删除校验异常明细
|
||||
*
|
||||
* @param ids 主键id
|
||||
*/
|
||||
void deleteByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据薪资核算人员id删除薪资核算结果的校验异常明细
|
||||
*
|
||||
* @param salaryAcctEmployeeIds 薪资核算人员id
|
||||
*/
|
||||
void deleteBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id删除薪资核算结果的校验异常明细
|
||||
*
|
||||
* @param salaryAcctRecordIds 薪资核算记录id
|
||||
*/
|
||||
void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctCheckParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryCheckResultQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryCheckResultPO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 校验异常
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface SalaryCheckResultService {
|
||||
|
||||
/**
|
||||
* 按照薪资核算记录id统计薪资核算结果的校验异常数量
|
||||
*
|
||||
* @param salaryAcctRecordId 薪资核算记录id
|
||||
* @return
|
||||
*/
|
||||
Integer countBySalaryAcctRecordId(Long salaryAcctRecordId);
|
||||
|
||||
/**
|
||||
* 根据主键id获取单个校验异常
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return
|
||||
*/
|
||||
SalaryCheckResultPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id查询校验异常
|
||||
*
|
||||
* @param salaryAcctRecordId 薪资核算记录id
|
||||
* @return
|
||||
*/
|
||||
List<SalaryCheckResultPO> listBySalaryAcctRecordId(Long salaryAcctRecordId);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id、是否忽略查询校验异常
|
||||
*
|
||||
* @param salaryAcctRecordId 薪资核算记录id
|
||||
* @param ignoreType 是否忽略
|
||||
* @return
|
||||
*/
|
||||
List<SalaryCheckResultPO> listBySalaryAcctRecordIdAndIgnoreType(Long salaryAcctRecordId, Integer ignoreType);
|
||||
|
||||
/**
|
||||
* 根据列表查询条件查询校验异常
|
||||
*
|
||||
* @param queryParam 列表查询条件
|
||||
* @return
|
||||
*/
|
||||
PageInfo<SalaryCheckResultPO> listPageByParam(SalaryCheckResultQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
*
|
||||
* @param salaryCheckResultPOS
|
||||
*/
|
||||
void batchSave(Collection<SalaryCheckResultPO> salaryCheckResultPOS);
|
||||
|
||||
/**
|
||||
* 更新是否忽略
|
||||
*
|
||||
* @param id 校验异常的主键id
|
||||
*/
|
||||
void updateIgnoreTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 更新是否忽略
|
||||
*
|
||||
* @param salaryAcctRecordId 薪资核算记录id
|
||||
*/
|
||||
void updateIgnoreTypeBySalaryAcctRecordId(Long salaryAcctRecordId);
|
||||
|
||||
/**
|
||||
* 根据主键id删除校验异常
|
||||
*
|
||||
* @param ids 主键id
|
||||
*/
|
||||
void deleteByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id删除校验异常
|
||||
*
|
||||
* @param salaryAcctRecordIds 薪资核算记录id
|
||||
*/
|
||||
void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
|
||||
|
||||
/**
|
||||
* 薪资核算-校验
|
||||
*
|
||||
* @param checkParam
|
||||
* @param fromCalculate
|
||||
* @param simpleEmployee
|
||||
*/
|
||||
void check(SalaryAcctCheckParam checkParam, boolean fromCalculate, DataCollectionEmployee simpleEmployee);
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryComparisonResultListDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryComparisonResultQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.po.ExcelAcctResultPO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 薪资核算的线下对比结果
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 1/20/22 7:00 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public interface SalaryComparisonResultService {
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id查询线下对比结果
|
||||
*
|
||||
* @param salaryAcctRecordId 薪资核算记录id
|
||||
* @return
|
||||
*/
|
||||
List<ExcelAcctResultPO> listBySalaryAcctRecordId(Long salaryAcctRecordId);
|
||||
|
||||
/**
|
||||
* 根据薪资核算人员id查询线下对比结果
|
||||
*
|
||||
* @param salaryAcctEmployeeIds 薪资核算人员
|
||||
* @return
|
||||
*/
|
||||
List<ExcelAcctResultPO> listBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds);
|
||||
|
||||
/**
|
||||
* 根据列表查询条件查询线下对比结果(分页)
|
||||
*
|
||||
* @param queryParam 列表查询条件
|
||||
* @return
|
||||
*/
|
||||
SalaryComparisonResultListDTO listPageByParam(SalaryComparisonResultQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 根据列表查询条件查询线下对比结果
|
||||
*
|
||||
* @param queryParam 列表查询条件
|
||||
* @return
|
||||
*/
|
||||
SalaryComparisonResultListDTO listByParam(SalaryComparisonResultQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
*
|
||||
* @param excelAcctResultPOS
|
||||
*/
|
||||
void batchSave(Collection<ExcelAcctResultPO> excelAcctResultPOS);
|
||||
|
||||
/**
|
||||
* 根据薪资核算人员id删除薪资核算线下对比结果
|
||||
*
|
||||
* @param salaryAcctEmployeeIds 薪资核算人员id
|
||||
*/
|
||||
void deleteBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id删除薪资核算线下对比结果
|
||||
*
|
||||
* @param salaryAcctRecordIds 薪资核算记录id
|
||||
*/
|
||||
void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
|
||||
}
|
||||
|
|
@ -32,4 +32,11 @@ public interface SalaryEmployeeService {
|
|||
List<DataCollectionEmployee> listByIds(List<Long> ids);
|
||||
|
||||
DataCollectionEmployee getEmployeeById(Long employeeId);
|
||||
|
||||
/**
|
||||
* 获取当前登录人的信息
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
// DataCollectionEmployee getLoginEmployeeById(Long employeeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,9 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
|
||||
private SalaryAcctProgressService salaryAcctProgressService;
|
||||
|
||||
private SalaryAcctEmployeeService salaryAcctEmployeeService;
|
||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||
return (SalaryAcctEmployeeService) ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calculate(SalaryAcctCalculateBO salaryAcctCalculateBO, DataCollectionEmployee simpleEmployee) {
|
||||
|
|
@ -116,7 +118,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
// 5、查询其他免税扣除
|
||||
List<OtherDeductionPO> otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds);
|
||||
//todo 6、查询社保福利
|
||||
List<Map<String, Object>> welfareData = null;//siAccountService.welfareData(salarySobCycleDTO.getSocialSecurityCycle().toString(), employeeIds);
|
||||
List<Map<String, Object>> welfareData = Lists.newArrayList();//siAccountService.welfareData(salarySobCycleDTO.getSocialSecurityCycle().toString(), employeeIds);
|
||||
// 7、查询考勤数据
|
||||
List<AttendQuoteDataDTO> attendQuoteDataDTOS = getAttendQuoteDataService(user).getAttendQuoteData(salarySobCycleDTO.getSalaryMonth(), salarySobCycleDTO.getSalarySobId(), employeeIds);
|
||||
// 8、查询薪资核算人员的薪资核算结果
|
||||
|
|
@ -127,7 +129,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
List<SalaryAcctResultPO> otherSalaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds);
|
||||
Map<String, List<SalaryAcctResultPO>> otherSalaryAcctResultPOMap = SalaryEntityUtil.group2Map(otherSalaryAcctResultPOS, e -> e.getEmployeeId() + "_" + e.getTaxAgentId());
|
||||
// 9.1、查询相同税款所属期内设计合并计税的其他薪资核算人员
|
||||
List<SalaryAcctEmployeePO> otherSalaryAcctEmployeePOS = salaryAcctEmployeeService.listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds);
|
||||
List<SalaryAcctEmployeePO> otherSalaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds);
|
||||
Map<String, List<SalaryAcctEmployeePO>> otherSalaryAcctEmployeePOMap = SalaryEntityUtil.group2Map(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
|
||||
// 10、转换成公式编辑器中的变量
|
||||
|
|
@ -217,8 +219,8 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
// 保存新的薪资核算结果(临时存储)
|
||||
getSalaryAcctResultTempService(user).batchSave(salaryAcctResultTempPOS);
|
||||
// 更新薪资核算进度
|
||||
salaryAcctProgressService.getAndAddCalculatedQty("" + salaryAcctCalculateBO.getSalaryAcctRecordPO().getId(),
|
||||
salaryAcctCalculateBO.getSalaryAcctEmployeePOS().size());
|
||||
// salaryAcctProgressService.getAndAddCalculatedQty("" + salaryAcctCalculateBO.getSalaryAcctRecordPO().getId(),
|
||||
// salaryAcctCalculateBO.getSalaryAcctEmployeePOS().size());
|
||||
// 记录子线程执行结果
|
||||
salaryAcctCalculateBO.getResults().add(new SalaryAcctCalculateBO.Result(true, StringUtils.EMPTY));
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -52,8 +52,9 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
return (SalaryAcctRecordService) ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctResultService salaryAcctResultService;
|
||||
|
||||
private SalaryAcctResultService getSalaryAcctResultService(User user) {
|
||||
return (SalaryAcctResultService) ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
|
||||
}
|
||||
|
||||
// private SalaryAcctResultService getSalaryAcctResultService(User user) {
|
||||
// return (SalaryAcctResultService) ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
|
||||
|
|
@ -296,7 +297,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
// 查询薪资档案,获取人员的个税扣缴义务人
|
||||
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), saveParam.getEmployeeIds());
|
||||
// 转换成薪资核算人员po
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2EmployeePO(saveParam.getEmployeeIds(), salaryAcctRecordPO, salaryArchiveDataDTOS, (long)user.getUID());
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2EmployeePO(saveParam.getEmployeeIds(), salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
|
||||
// 保存薪资核算人员
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOS)) {
|
||||
getSalaryAcctEmployeeMapper().batchInsert(salaryAcctEmployeePOS);
|
||||
|
|
@ -328,11 +329,11 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
public void deleteByIds(Collection<Long> ids) {
|
||||
// 删除薪资核算人员
|
||||
getSalaryAcctEmployeeMapper().deleteByIds(ids);
|
||||
// // 删除薪资核算人员对应的薪资核算结果
|
||||
// salaryAcctResultService.deleteBySalaryAcctEmployeeIds(ids);
|
||||
// // 删除薪资核算人员对应的校验异常明细
|
||||
// 删除薪资核算人员对应的薪资核算结果
|
||||
getSalaryAcctResultService(user).deleteBySalaryAcctEmployeeIds(ids);
|
||||
// 删除薪资核算人员对应的校验异常明细
|
||||
// salaryCheckResultDetailService.deleteBySalaryAcctEmployeeIds(ids);
|
||||
// // 删除薪资核算人员对应的线下对比结果
|
||||
// 删除薪资核算人员对应的线下对比结果
|
||||
// salaryComparisonResultService.deleteBySalaryAcctRecordIds(ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,774 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.TaxAgentBiz;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultBO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAccEmployeeListDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctImportFieldDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctImportTemplateParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 薪资核算导入导出
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExcelService {
|
||||
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return (SalaryAcctRecordService) ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||
return (SalaryAcctEmployeeService) ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctResultService getSalaryAcctResultService(User user) {
|
||||
return (SalaryAcctResultService) ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) {
|
||||
return (SalarySobEmpFieldService) ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return (SalarySobItemService) ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return (SalaryItemService) ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
// private SalaryFormulaService getSalaryFormulaService(User user) {
|
||||
// return (SalaryFormulaService) ServiceUtil.getService(SalaryFormulaServiceImpl.class, user);
|
||||
// }
|
||||
|
||||
// private SalaryComparisonResultService getSalaryComparisonResultService(User user) {
|
||||
// return (SalaryComparisonResultService) ServiceUtil.getService(SalaryComparisonResultServiceImpl.class, user);
|
||||
// }
|
||||
|
||||
private TaxAgentBiz taxAgentService = new TaxAgentBiz();
|
||||
|
||||
|
||||
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||
return (SalaryEmployeeService) ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryCheckResultService salaryCheckResultService;
|
||||
|
||||
private SalaryCheckResultDetailService salaryCheckResultDetailService;
|
||||
|
||||
private SalarySobCheckRuleService salarySobCheckRuleService;
|
||||
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) {
|
||||
|
||||
// 1.工作簿名称
|
||||
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "核算人员范围");
|
||||
// 2.表头
|
||||
String[] header = {
|
||||
SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
||||
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"),
|
||||
SalaryI18nUtil.getI18nLabel(86185, "部门"),
|
||||
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
|
||||
SalaryI18nUtil.getI18nLabel(86186, "工号"),
|
||||
SalaryI18nUtil.getI18nLabel(91075, "员工状态"),
|
||||
SalaryI18nUtil.getI18nLabel(91075, "入职日期"),
|
||||
SalaryI18nUtil.getI18nLabel(91075, "离职日期")
|
||||
};
|
||||
List<Object> headerList = new ArrayList<>(Arrays.asList(header));
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByParam(queryParam);
|
||||
|
||||
// 组装数据
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(headerList);
|
||||
|
||||
// 3.表数据
|
||||
List<List<Object>> lists = convert2ExcelRow(salaryAcctEmployees);
|
||||
rows.addAll(lists);
|
||||
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook exportReducedEmployee(SalaryAcctEmployeeQueryParam queryParam) {
|
||||
// 1.工作簿名称
|
||||
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "环比上月减少人员");
|
||||
// 2.表头
|
||||
String[] header = {
|
||||
SalaryI18nUtil.getI18nLabel(85429, "姓名"),
|
||||
SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"),
|
||||
SalaryI18nUtil.getI18nLabel(86185, "部门"),
|
||||
SalaryI18nUtil.getI18nLabel(86186, "手机号"),
|
||||
SalaryI18nUtil.getI18nLabel(86186, "工号"),
|
||||
SalaryI18nUtil.getI18nLabel(91075, "员工状态"),
|
||||
SalaryI18nUtil.getI18nLabel(91075, "入职日期"),
|
||||
SalaryI18nUtil.getI18nLabel(91075, "离职日期")
|
||||
};
|
||||
List<Object> headerList = new ArrayList<>(Arrays.asList(header));
|
||||
// 查询薪资核算人员(环比上月减少)
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByParam4Reduce(queryParam);
|
||||
|
||||
// 组装数据
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(headerList);
|
||||
|
||||
// 3.表数据
|
||||
List<List<Object>> lists = convert2ExcelRow(salaryAcctEmployees);
|
||||
rows.addAll(lists);
|
||||
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private List<List<Object>> convert2ExcelRow(List<SalaryAcctEmployeePO> salaryAcctEmployees) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<SalaryAccEmployeeListDTO> salaryAccEmployeeListDTOS = new ArrayList<>();
|
||||
List<List<SalaryAcctEmployeePO>> partition = Lists.partition(salaryAcctEmployees, 1000);
|
||||
for (List<SalaryAcctEmployeePO> tempList : partition) {
|
||||
// 人员
|
||||
List<Long> employeeIds = tempList.stream().map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toList());
|
||||
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).listByIds(employeeIds);
|
||||
// 个税扣缴义务人
|
||||
List<Long> taxAgentIds = tempList.stream().map(SalaryAcctEmployeePO::getTaxAgentId).distinct().collect(Collectors.toList());
|
||||
List<TaxAgent> taxAgents = taxAgentService.listByIds(taxAgentIds);
|
||||
// 转换成列表数据
|
||||
salaryAccEmployeeListDTOS.addAll(SalaryAcctEmployeeBO.convert2EmployeeListDTO(tempList, taxAgents, simpleEmployees));
|
||||
}
|
||||
List<List<Object>> rows = Lists.newArrayListWithExpectedSize(salaryAccEmployeeListDTOS.size());
|
||||
for (SalaryAccEmployeeListDTO dto : salaryAccEmployeeListDTOS) {
|
||||
List<Object> row = Lists.newArrayListWithExpectedSize(8);
|
||||
row.add(dto.getEmployeeName());
|
||||
row.add(dto.getTaxAgentName());
|
||||
row.add(dto.getDepartmentName());
|
||||
row.add(dto.getMobile());
|
||||
row.add(dto.getJobNum());
|
||||
row.add(dto.getStatus());
|
||||
row.add(dto.getHireDate());
|
||||
row.add(dto.getDismissDate());
|
||||
rows.add(row);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook exportSalaryAcctResult(SalaryAcctResultQueryParam queryParam) {
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
// 查询列表的表头
|
||||
List<WeaTableColumn> weaTableColumns = listWeaTableColumn(salaryAcctRecordPO);
|
||||
// excel导出的表头
|
||||
String[] headers = weaTableColumns.stream()
|
||||
.map(WeaTableColumn::getText)
|
||||
.toArray(String[]::new);
|
||||
List<Object> headerList = new ArrayList<>(Arrays.asList(headers));
|
||||
// 查询薪资核算结果
|
||||
List<Map<String, Object>> resultMapList = getSalaryAcctResultService(user).listByParam(queryParam);
|
||||
// excel导出的数据
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
rows.add(headerList);
|
||||
for (Map<String, Object> map : resultMapList) {
|
||||
List<Object> row = Lists.newArrayListWithExpectedSize(weaTableColumns.size());
|
||||
for (WeaTableColumn weaTableColumn : weaTableColumns) {
|
||||
row.add(map.getOrDefault(weaTableColumn.getColumn(), StringUtils.EMPTY));
|
||||
}
|
||||
rows.add(row);
|
||||
}
|
||||
|
||||
String sheetName = "薪资核算结果";
|
||||
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建薪资核算结果列表的表头
|
||||
*
|
||||
* @param salaryAcctRecordPO 薪资核算记录
|
||||
* @return
|
||||
*/
|
||||
public List<WeaTableColumn> listWeaTableColumn(SalaryAcctRecordPO salaryAcctRecordPO) {
|
||||
// 查询薪资账套下的薪资项目+员工信息字段
|
||||
SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
// 构建薪资核算结果列表表头
|
||||
return SalaryAcctResultBO.buildTableColumns(salarySobItemAggregateDTO);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 解析表头
|
||||
// *
|
||||
// * @param headerList
|
||||
// * @param weaTableColumns
|
||||
// */
|
||||
// private void parseHeader(List<WeaTableColumnWapper> headerList, List<WeaTableColumnWapper> weaTableColumns) {
|
||||
// for (WeaTableColumnWapper weaTableColumnWapper : weaTableColumns) {
|
||||
// if (CollectionUtils.isEmpty(weaTableColumnWapper.getChildren())) {
|
||||
// headerList.add(weaTableColumnWapper);
|
||||
// continue;
|
||||
// }
|
||||
// parseHeader(headerList, weaTableColumnWapper.getChildren());
|
||||
// }
|
||||
// }
|
||||
@Override
|
||||
public SalaryAcctImportFieldDTO getImportField(Long salaryAcctRecordId) {
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
// 查询薪资核算记录所用的薪资账套的薪资项目副本
|
||||
List<SalarySobItemPO> salarySobItems = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId);
|
||||
// 查询薪资项目
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
// 薪资项目中的公式项
|
||||
List<SalaryAcctImportFieldDTO.ImportFieldDTO> formulaItems = salaryItems.stream()
|
||||
.filter(salaryItemPO -> Objects.equals(salaryItemPO.getValueType(), SalaryValueTypeEnum.FORMULA.getValue()))
|
||||
.map(salaryItemPO -> SalaryAcctImportFieldDTO.ImportFieldDTO.builder()
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.salaryItemName(salaryItemPO.getName())
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
// 薪资项目中的输入项
|
||||
List<SalaryAcctImportFieldDTO.ImportFieldDTO> inputItems = salaryItems.stream()
|
||||
.filter(salaryItemPO -> Objects.equals(salaryItemPO.getValueType(), SalaryValueTypeEnum.INPUT.getValue()))
|
||||
.map(salaryItemPO -> SalaryAcctImportFieldDTO.ImportFieldDTO.builder()
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.salaryItemName(salaryItemPO.getName())
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
// 转换成dto
|
||||
return SalaryAcctImportFieldDTO.builder().formulaItems(formulaItems).inputItems(inputItems).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook exportImportTemplate(SalaryAcctImportTemplateParam param) {
|
||||
// 必须选择导入模板所需的薪资项目
|
||||
if (CollectionUtils.isEmpty(param.getSalaryItemIds())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的薪资项目"));
|
||||
}
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
// 模板表头(默认必带"个税扣缴义务人"、"姓名")
|
||||
List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"));
|
||||
List<String> dataIndexList = Lists.newArrayList("username", "taxAgentName");
|
||||
// 查询薪资项目
|
||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(param.getSalaryItemIds());
|
||||
for (SalaryItemPO salaryItemPO : salaryItemPOS) {
|
||||
headerList.add(salaryItemPO.getName());
|
||||
dataIndexList.add("" + salaryItemPO.getId());
|
||||
}
|
||||
String[] headers = headerList.toArray(new String[0]);
|
||||
|
||||
// 查询薪资核算结果
|
||||
List<Map<String, Object>> resultMapList = getSalaryAcctResultService(user).listByParam(param);
|
||||
// excel导出的数据
|
||||
List<List<Object>> rows = Lists.newArrayListWithExpectedSize(resultMapList.size());
|
||||
rows.add(headerList);
|
||||
for (Map<String, Object> map : resultMapList) {
|
||||
List<Object> row = Lists.newArrayListWithExpectedSize(headerList.size());
|
||||
for (String dataIndex : dataIndexList) {
|
||||
row.add(map.getOrDefault(dataIndex, StringUtils.EMPTY));
|
||||
}
|
||||
rows.add(row);
|
||||
}
|
||||
|
||||
String sheetName = "薪资核算导入模板";
|
||||
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
||||
}
|
||||
|
||||
//
|
||||
// @Override
|
||||
// public XSSFWorkbook exportComparisonResult(SalaryComparisonResultQueryParam queryParam) {
|
||||
// // 查询薪资核算记录
|
||||
// SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId());
|
||||
// if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
// }
|
||||
// // 查询线下对比结果
|
||||
// SalaryComparisonResultListDTO salaryComparisonResultListDTO = getSalaryComparisonResultService(user).listByParam(queryParam);
|
||||
// // 薪资核算线下对比结果列表表头
|
||||
// List<String> headerList = Lists.newArrayList();
|
||||
// // 查询薪资核算所用的薪资账套的员工信息字段
|
||||
// List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
// Set<String> employeeFieldCodeSet = SalaryEntityUtil.properties(salarySobEmpFieldPOS, SalarySobEmpFieldPO::getFieldCode);
|
||||
// // 查询薪资项目
|
||||
// List<SalaryItemPO> salaryItemPOS = getSalarySobItemService(user).listBySalarySobId4SalaryItem(salaryAcctRecordPO.getSalarySobId());
|
||||
// Set<String> salaryItemIds = SalaryEntityUtil.properties(salaryItemPOS, salaryItemPO -> "" + salaryItemPO.getId());
|
||||
// for (WeaTableColumn weaTableColumn : salaryComparisonResultListDTO.getWeaTableColumns()) {
|
||||
// // 员工信息字段
|
||||
// if (employeeFieldCodeSet.contains(weaTableColumn.getDataIndex())) {
|
||||
// headerList.add(weaTableColumn.getTitle());
|
||||
// }
|
||||
// // 薪资项目的表头
|
||||
// if (salaryItemIds.contains(weaTableColumn.getDataIndex())) {
|
||||
// headerList.add(weaTableColumn.getTitle() + " (线上值)");
|
||||
// headerList.add(weaTableColumn.getTitle() + " (线下值)");
|
||||
// }
|
||||
// }
|
||||
// String[] headers = headerList.toArray(new String[0]);
|
||||
//
|
||||
// List<Map<String, Object>> resultMapList = salaryComparisonResultListDTO.getData().getRecords();
|
||||
// // excel导出的数据
|
||||
// List<List<Object>> rows = Lists.newArrayListWithExpectedSize(resultMapList.size());
|
||||
// for (Map<String, Object> map : resultMapList) {
|
||||
// List<Object> row = Lists.newArrayList();
|
||||
// for (WeaTableColumn weaTableColumn : salaryComparisonResultListDTO.getWeaTableColumns()) {
|
||||
// // 员工信息字段的值
|
||||
// if (employeeFieldCodeSet.contains(weaTableColumn.getDataIndex())) {
|
||||
// row.add(map.get(weaTableColumn.getDataIndex()));
|
||||
// }
|
||||
// // 薪资项目的值
|
||||
// if (salaryItemIds.contains(weaTableColumn.getDataIndex())) {
|
||||
// Map tempMap = (Map) map.getOrDefault(weaTableColumn.getDataIndex(), Collections.emptyMap());
|
||||
// row.add(tempMap.get("acctResultValue"));
|
||||
// row.add(tempMap.get("excelResultValue"));
|
||||
// }
|
||||
// }
|
||||
// rows.add(row);
|
||||
// }
|
||||
//
|
||||
// ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
// excelSheetData.setSheetName("线下对比结果");
|
||||
// excelSheetData.setHeaders(Collections.singletonList(headers));
|
||||
// excelSheetData.setRows(rows);
|
||||
// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder()
|
||||
// .fileName("线下对比结果")
|
||||
// .dataType("线下对比结果")
|
||||
// .function(excelExportParam.getFunction())
|
||||
// .handlerName("comparisonResultHandler")
|
||||
// .flag(true)
|
||||
// .bizId(String.valueOf(excelExportParam.getBiz()))
|
||||
// .module(excelExportParam.getModule())
|
||||
// .userId(simpleEmployee.getEmployeeId())
|
||||
// .tenantKey(tenantKey)
|
||||
// .operator(simpleEmployee.getUsername())
|
||||
// .eteamsId(eteamsId)
|
||||
// .build();
|
||||
// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public XSSFWorkbook exportComparisonResultTemplate(SalaryComparisonResultExportParam exportParam) {
|
||||
// // 查询薪资核算记录
|
||||
// SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(exportParam.getSalaryAcctRecordId());
|
||||
// if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
// }
|
||||
// // 模板表头(默认必带"个税扣缴义务人"、"姓名")
|
||||
// List<Object> headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"));
|
||||
// // 查询薪资账套下的薪资项目
|
||||
// SalarySobItemAggregateDTO salarySobItemAggregateDTO = getSalarySobItemService(user).getAggregateBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
// // 薪资项目分类下的新资项目
|
||||
// for (SalarySobItemGroupDTO itemGroup : salarySobItemAggregateDTO.getItemGroups()) {
|
||||
// for (SalarySobItemDTO item : itemGroup.getItems()) {
|
||||
// headerList.add(item.getName());
|
||||
// }
|
||||
// }
|
||||
// // 没有分类的薪资项目
|
||||
// for (SalarySobItemDTO item : salarySobItemAggregateDTO.getItems()) {
|
||||
// headerList.add(item.getName());
|
||||
// }
|
||||
// List<List<Object>> rows = new ArrayList<>();
|
||||
// rows.add(headerList);
|
||||
// String sheetName = "线下对比结果导入模板";
|
||||
//
|
||||
// return ExcelUtil.genWorkbookV2(rows, sheetName);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// @BatchImportHandler("importSalaryAcctResult")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void importSalaryAcctResult() {
|
||||
// BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage();
|
||||
// String tenantKey = message.getTenantKey();
|
||||
// try {
|
||||
// // 加密用
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// // 接收到解析的数据
|
||||
// batchImport(message, "importSalaryAcctResult");
|
||||
// } catch (Exception e) {
|
||||
// log.error("薪资核算结果导入失败:{}", e.getMessage(), e);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @BatchImportHandler("importExcelAcctResult")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void importExcelAcctResult() {
|
||||
// BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage();
|
||||
// String tenantKey = message.getTenantKey();
|
||||
// try {
|
||||
// // 加密用
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// // 接收到解析的数据
|
||||
// batchImport(message, "importExcelAcctResult");
|
||||
// } catch (Exception e) {
|
||||
// log.error("线下核算结果导入失败:{}", e.getMessage(), e);
|
||||
// } finally {
|
||||
// // 加密用
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void batchImport(BatchDocumentMessage message, String importType) {
|
||||
// String tenantKey = message.getTenantKey();
|
||||
// Long currentEmployeeId = message.getUserId();
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
// // 前端传入的参数(薪资核算记录的id)
|
||||
// Map<String, Object> paramMap = JsonUtil.parseMap(message.getUploadSet().getCustomData(), Object.class);
|
||||
// // 薪资核算记录的id
|
||||
// Long salaryAcctRecordId = Long.valueOf(String.valueOf(paramMap.get("salaryAcctRecordId")));
|
||||
// // 薪资核算记录
|
||||
// SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||
// if (salaryAcctRecordPO == null) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
// }
|
||||
// // 薪资账套下的薪资项目副本
|
||||
// List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
// // 薪资项目
|
||||
// Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
|
||||
// List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
// Map<String, Long> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getName, SalaryItemPO::getId);
|
||||
// // 薪资核算确认的人员
|
||||
// List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordId);
|
||||
// Map<String, SalaryAcctEmployeePO> salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(salaryAcctEmployees, e -> e.getEmployeeId() + "-" + e.getTaxAgentId());
|
||||
// // 租户下所有的人员
|
||||
// List<SalaryEmployee> salaryEmployees = getSalaryEmployeeService(user).listAll(tenantKey);
|
||||
// Map<String, Long> salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, SalaryEmployee::getUsername, SalaryEmployee::getId);
|
||||
// // 租户下所有的个税扣缴义务人
|
||||
// List<TaxAgentPO> taxAgents = taxAgentService.listAll(tenantKey);
|
||||
// Map<String, Long> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId);
|
||||
//
|
||||
// // 索引(用于计算进度)
|
||||
// int index = 0;
|
||||
// // 失败的数量
|
||||
// int failCount = 0;
|
||||
// // 成功的数量
|
||||
// int successCount = 0;
|
||||
// // 总数
|
||||
// int total = message.getBatchFile().getExcelSheets().stream()
|
||||
// .filter(e -> CollectionUtils.isNotEmpty(e.getHeader()) && CollectionUtils.isNotEmpty(e.getData()))
|
||||
// .map(e -> BigDecimal.valueOf(e.getData().size()))
|
||||
// .reduce(BigDecimal.ZERO, BigDecimal::add)
|
||||
// .intValue();
|
||||
// // 包含错误提示信息的sheet页
|
||||
// List<ExcelSheet> errorExcelSheets = Lists.newArrayList();
|
||||
// // 解析excel
|
||||
// Set<Long> salaryAcctEmpIds = Sets.newHashSet();
|
||||
// // excel导入了哪些薪资项目
|
||||
// Set<Long> excelSalaryItemIds = Sets.newHashSet();
|
||||
// List<SalaryAcctResultPO> salaryAcctResults = Lists.newArrayList();
|
||||
// List<SalaryAcctEmployeePO> newSalaryAcctEmployees = Lists.newArrayList();
|
||||
//
|
||||
// List<ExcelAcctResultPO> excelAcctResults = Lists.newArrayList();
|
||||
// for (ExcelSheet excelSheet : message.getBatchFile().getExcelSheets()) {
|
||||
// if (CollectionUtils.isEmpty(excelSheet.getHeader())) {
|
||||
// continue;
|
||||
// }
|
||||
// // 错误提示信息
|
||||
// List<ExcelComment> excelComments = Lists.newArrayList();
|
||||
// // 存在错误的那行数据
|
||||
// List<Map<String, Object>> errorDatas = Lists.newArrayList();
|
||||
// // 表头
|
||||
// List<Map> headers = excelSheet.getHeader();
|
||||
// // 处理数值
|
||||
// List<Map<String, Object>> data = excelSheet.getData();
|
||||
// if (CollectionUtils.isEmpty(data)) {
|
||||
// continue;
|
||||
// }
|
||||
// for (int i = 0; i < data.size(); i++) {
|
||||
// int usernameIndex = 0;
|
||||
// boolean isError = false;
|
||||
// Map<String, Object> map = data.get(i);
|
||||
// Long employeeId = 0L;
|
||||
// Long taxAgentId = 0L;
|
||||
// List<SalaryAcctResultPO> salaryAcctResultsOfOneEmp = Lists.newArrayListWithExpectedSize(headers.size() - 1);
|
||||
// List<ExcelAcctResultPO> excelAcctResultsOfOneEmp = Lists.newArrayListWithExpectedSize(headers.size() - 1);
|
||||
// for (int j = 0; j < headers.size(); j++) {
|
||||
// Map header = headers.get(j);
|
||||
// Object dataKey = header.get("key");
|
||||
// if (dataKey == null) {
|
||||
// continue;
|
||||
// }
|
||||
// String dataValue = (String) map.getOrDefault(dataKey.toString(), "");
|
||||
// if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
|
||||
// usernameIndex = j;
|
||||
// if (StringUtils.isEmpty(dataValue)) {
|
||||
// isError = true;
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"), i, i, j, j);
|
||||
// } else {
|
||||
// employeeId = salaryEmployeeMap.getOrDefault(dataValue, 0L);
|
||||
// if (employeeId == null || employeeId <= 0) {
|
||||
// isError = true;
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名"), i, i, j, j);
|
||||
// }
|
||||
// }
|
||||
// } else if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), dataKey.toString())) {
|
||||
// if (StringUtils.isEmpty(dataValue)) {
|
||||
// isError = true;
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102839, "个税扣缴义务人不能为空"), i, i, j, j);
|
||||
// } else {
|
||||
// taxAgentId = taxAgentNameMap.getOrDefault(dataValue, 0L);
|
||||
// if (taxAgentId == null || taxAgentId <= 0) {
|
||||
// isError = true;
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102840, "个税扣缴义务人错误,系统内不存在该个税扣缴义务人"), i, i, j, j);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// Long salaryItemId = salaryItemMap.get(dataKey.toString());
|
||||
// if (salaryItemId == null || salaryItemId <= 0) {
|
||||
// isError = true;
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102841, "表头错误,本次核算所用账套不包含该薪资项目"), i, i, j, j);
|
||||
// } else {
|
||||
// excelSalaryItemIds.add(salaryItemId);
|
||||
// if (StringUtils.equals("importExcelAcctResult", importType)) {
|
||||
// ExcelAcctResultPO excelAcctResult = ExcelAcctResultPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .salaryAcctRecordId(salaryAcctRecordPO.getId())
|
||||
// .salarySobId(salaryAcctRecordPO.getSalarySobId())
|
||||
// .salaryItemId(salaryItemId)
|
||||
// .resultValue(dataValue)
|
||||
// .creator(currentEmployeeId)
|
||||
// .createTime(now)
|
||||
// .updateTime(now)
|
||||
// .deleteType(0)
|
||||
// .tenantKey(tenantKey)
|
||||
// .build();
|
||||
// excelAcctResultsOfOneEmp.add(excelAcctResult);
|
||||
// }
|
||||
// if (StringUtils.equals("importSalaryAcctResult", importType)) {
|
||||
// SalaryAcctResultPO salaryAcctResult = SalaryAcctResultPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .salaryAcctRecordId(salaryAcctRecordPO.getId())
|
||||
// .salarySobId(salaryAcctRecordPO.getSalarySobId())
|
||||
// .salaryItemId(salaryItemId)
|
||||
// .resultValue(dataValue)
|
||||
// .creator(currentEmployeeId)
|
||||
// .createTime(now)
|
||||
// .updateTime(now)
|
||||
// .deleteType(0)
|
||||
// .tenantKey(tenantKey)
|
||||
// .build();
|
||||
// salaryAcctResultsOfOneEmp.add(salaryAcctResult);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // (如果是线下对比)如果个税扣缴义务人+人员目前不在核算人员里面,不支持导入
|
||||
// if (StringUtils.equals("importExcelAcctResult", importType)
|
||||
// && (employeeId != null && employeeId > 0)
|
||||
// && (taxAgentId != null && taxAgentId > 0)
|
||||
// && i == data.size() - 1
|
||||
// && !salaryAcctEmployeeMap.containsKey(employeeId + "-" + taxAgentId)) {
|
||||
// isError = true;
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102842, "本次薪资核算不包含该人员"), i, i, usernameIndex, usernameIndex);
|
||||
// }
|
||||
// }
|
||||
// // 每处理50个数据更新一次进度
|
||||
// index++;
|
||||
// if (index % 50 == 0 || index >= total) {
|
||||
// salaryBatchService.sendImportRate(message.getBizId(), total, index);
|
||||
// }
|
||||
// if (isError) {
|
||||
// failCount++;
|
||||
// errorDatas.add(map);
|
||||
// continue;
|
||||
// }
|
||||
// SalaryAcctEmployeePO salaryAcctEmployee = salaryAcctEmployeeMap.get(employeeId + "-" + taxAgentId);
|
||||
// Long salaryAcctEmpId = Optional.ofNullable(salaryAcctEmployee).map(SalaryAcctEmployeePO::getId).orElse(0L);
|
||||
// if (StringUtils.equals("importExcelAcctResult", importType)) {
|
||||
// for (ExcelAcctResultPO excelAcctResultPO : excelAcctResultsOfOneEmp) {
|
||||
// excelAcctResultPO.setEmployeeId(employeeId);
|
||||
// excelAcctResultPO.setTaxAgentId(taxAgentId);
|
||||
// excelAcctResultPO.setSalaryAcctEmpId(salaryAcctEmpId);
|
||||
// }
|
||||
// excelAcctResults.addAll(excelAcctResultsOfOneEmp);
|
||||
// }
|
||||
// if (StringUtils.equals("importSalaryAcctResult", importType)) {
|
||||
// if (salaryAcctEmpId <= 0) {
|
||||
// SalaryAcctEmployeePO acctEmployee = SalaryAcctEmployeePO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .employeeId(employeeId)
|
||||
// .salaryAcctRecordId(salaryAcctRecordId)
|
||||
// .salarySobId(salaryAcctRecordPO.getSalarySobId())
|
||||
// .salaryMonth(salaryAcctRecordPO.getSalaryMonth())
|
||||
// .taxAgentId(taxAgentId)
|
||||
// .creator(currentEmployeeId)
|
||||
// .createTime(now)
|
||||
// .updateTime(now)
|
||||
// .deleteType(0)
|
||||
// .tenantKey(tenantKey)
|
||||
// .build();
|
||||
// newSalaryAcctEmployees.add(acctEmployee);
|
||||
// salaryAcctEmpId = acctEmployee.getId();
|
||||
// }
|
||||
// for (SalaryAcctResultPO salaryAcctResultPO : salaryAcctResultsOfOneEmp) {
|
||||
// salaryAcctResultPO.setEmployeeId(employeeId);
|
||||
// salaryAcctResultPO.setTaxAgentId(taxAgentId);
|
||||
// salaryAcctResultPO.setSalaryAcctEmpId(salaryAcctEmpId);
|
||||
// }
|
||||
// salaryAcctEmpIds.add(salaryAcctEmpId);
|
||||
// salaryAcctResults.addAll(salaryAcctResultsOfOneEmp);
|
||||
// }
|
||||
// successCount++;
|
||||
// }
|
||||
// // 如果sheet包含错误数据
|
||||
// if (CollectionUtils.isNotEmpty(errorDatas)) {
|
||||
// salaryBatchService.createErrorExcelSheet(headers, errorDatas, excelSheet.getName(), excelComments, errorExcelSheets);
|
||||
// }
|
||||
// }
|
||||
// if (StringUtils.equals("importExcelAcctResult", importType)) {
|
||||
// getSalaryComparisonResultService(user).deleteBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));
|
||||
// if (CollectionUtils.isNotEmpty(excelAcctResults)) {
|
||||
// getSalaryComparisonResultService(user).batchSave(excelAcctResults);
|
||||
// }
|
||||
// }
|
||||
// if (StringUtils.equals("importSalaryAcctResult", importType)) {
|
||||
// if (CollectionUtils.isNotEmpty(salaryAcctEmpIds)) {
|
||||
// getSalaryAcctResultService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, excelSalaryItemIds);
|
||||
// }
|
||||
// if (CollectionUtils.isNotEmpty(salaryAcctResults)) {
|
||||
// getSalaryAcctResultService(user).batchSave(salaryAcctResults);
|
||||
// }
|
||||
// if (CollectionUtils.isNotEmpty(newSalaryAcctEmployees)) {
|
||||
// getSalaryAcctEmployeeService(user).batchSave(newSalaryAcctEmployees);
|
||||
// }
|
||||
// }
|
||||
// // 发送导入回调信息
|
||||
// salaryBatchService.sendImportCallBackInfo(message, successCount, failCount, errorExcelSheets);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Map<String, Object> exportCheckResult(
|
||||
// SalaryCheckResultExportParam exportParam,
|
||||
// ) {
|
||||
// // 查询薪资核算结果校验异常
|
||||
// List<SalaryCheckResultPO> salaryCheckResults = salaryCheckResultService.listBySalaryAcctRecordId(exportParam.getSalaryAcctRecordId());
|
||||
// List<ExcelSheetData> excelSheetData = Lists.newArrayListWithExpectedSize(salaryCheckResults.size());
|
||||
// for (SalaryCheckResultPO salaryCheckResult : salaryCheckResults) {
|
||||
// excelSheetData.add(buildDetailExcelSheetData(salaryCheckResult, simpleEmployee.getEmployeeId()));
|
||||
// }
|
||||
// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder()
|
||||
// .fileName("校验异常")
|
||||
// .dataType("校验异常")
|
||||
// .function(excelExportParam.getFunction())
|
||||
// .handlerName("salaryCheckResultHandler")
|
||||
// .flag(true)
|
||||
// .bizId(String.valueOf(excelExportParam.getBiz()))
|
||||
// .module(excelExportParam.getModule())
|
||||
// .userId(simpleEmployee.getEmployeeId())
|
||||
// .tenantKey(tenantKey)
|
||||
// .operator(simpleEmployee.getUsername())
|
||||
// .eteamsId(eteamsId)
|
||||
// .build();
|
||||
// return salaryBatchService.simpleExportExcel(exportExcelInfo, excelSheetData);
|
||||
// }
|
||||
//
|
||||
// @BatchExportHandler("salaryCheckResultHandler")
|
||||
// private void salaryCheckResultHandler() {
|
||||
// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage();
|
||||
// log.info("导出结束:{}", JsonUtil.toJsonString(message));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Map<String, Object> exportCheckResultDetail(
|
||||
// Long checkResultId,
|
||||
// ) {
|
||||
// // 查询校验异常
|
||||
// SalaryCheckResultPO checkResult = salaryCheckResultService.getById(checkResultId);
|
||||
// // 查询校验异常明细
|
||||
// ExcelSheetData excelSheetData = buildDetailExcelSheetData(checkResult, simpleEmployee.getEmployeeId());
|
||||
// ExportExcelInfo exportExcelInfo = ExportExcelInfo.builder()
|
||||
// .fileName("校验异常明细")
|
||||
// .dataType("校验异常明细")
|
||||
// .function(excelExportParam.getFunction())
|
||||
// .handlerName("salaryCheckResultDetailHandler")
|
||||
// .flag(true)
|
||||
// .bizId(String.valueOf(excelExportParam.getBiz()))
|
||||
// .module(excelExportParam.getModule())
|
||||
// .userId(simpleEmployee.getEmployeeId())
|
||||
// .tenantKey(tenantKey)
|
||||
// .operator(simpleEmployee.getUsername())
|
||||
// .eteamsId(eteamsId)
|
||||
// .build();
|
||||
// return salaryBatchService.simpleExportExcel(exportExcelInfo, Collections.singletonList(excelSheetData));
|
||||
// }
|
||||
//
|
||||
// @BatchExportHandler("salaryCheckResultDetailHandler")
|
||||
// private void salaryCheckResultDetailHandler() {
|
||||
// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage();
|
||||
// log.info("导出结束:{}", JsonUtil.toJsonString(message));
|
||||
// }
|
||||
//
|
||||
// private ExcelSheetData buildDetailExcelSheetData(SalaryCheckResultPO checkResult, Long employeeId) {
|
||||
// // 查询校验异常中的校验规则
|
||||
// SalarySobCheckRulePO checkRule = salarySobCheckRuleService.getById(checkResult.getSalaryCheckRuleId());
|
||||
// // 查询校验异常明细
|
||||
// List<SalaryCheckResultRecordPO> salaryCheckResultRecords = salaryCheckResultDetailService.listByCheckResultId(checkResult.getId());
|
||||
// String[] headers = new String[]{"规则名称", "规则内容", "姓名"};
|
||||
// List<List<Object>> rows = Lists.newArrayList();
|
||||
// ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
// excelSheetData.setSheetName("校验异常");
|
||||
// excelSheetData.setHeaders(Collections.singletonList(headers));
|
||||
// excelSheetData.setRows(rows);
|
||||
// if (CollectionUtils.isEmpty(salaryCheckResultRecords)) {
|
||||
// return excelSheetData;
|
||||
// }
|
||||
// List<Long> employeeIds = SalaryEntityUtil.properties(salaryCheckResultRecords, SalaryCheckResultRecordPO::getEmployeeId, Collectors.toList());
|
||||
// List<SimpleEmployee> simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIds);
|
||||
// Map<Long, String> simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId, SimpleEmployee::getUsername);
|
||||
// List<ExpressFormula> expressFormulas = getSalaryFormulaService(user).listExpressFormula(Collections.singleton(checkResult.getFormulaId()));
|
||||
// Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
||||
// for (SalaryCheckResultRecordPO salaryCheckResultRecord : salaryCheckResultRecords) {
|
||||
// List<Object> row = Lists.newArrayListWithExpectedSize(3);
|
||||
// row.add(checkRule.getName());
|
||||
// row.add(formulaMap.getOrDefault(salaryCheckResultRecord.getFormulaId(), ""));
|
||||
// row.add(simpleEmployeeMap.getOrDefault(salaryCheckResultRecord.getEmployeeId(), ""));
|
||||
// rows.add(row);
|
||||
// }
|
||||
// return excelSheetData;
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.TaxAgentBiz;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
|
|
@ -34,8 +35,10 @@ import com.engine.salary.service.*;
|
|||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
import com.weaver.util.threadPool.ThreadPoolUtil;
|
||||
import com.weaver.util.threadPool.constant.ModulePoolEnum;
|
||||
|
|
@ -45,8 +48,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
|
@ -66,53 +68,69 @@ import java.util.stream.Collectors;
|
|||
@Slf4j
|
||||
public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctResultService {
|
||||
|
||||
private SalaryAcctResultMapper salaryAcctResultMapper;
|
||||
private SalaryAcctEmployeeService salaryAcctEmployeeService;
|
||||
private SalarySobItemService salarySobItemService;
|
||||
|
||||
private SalaryItemService salaryItemService;
|
||||
|
||||
private SalarySobEmpFieldService salarySobEmpFieldService;
|
||||
|
||||
private SalarySobService salarySobService;
|
||||
|
||||
private SalaryAcctRecordService salaryAcctRecordService;
|
||||
|
||||
private TaxAgentBiz taxAgentService;
|
||||
|
||||
private SalaryEmployeeService hrmCommonEmployeeService;
|
||||
|
||||
private SalaryFormulaService salaryFormulaService;
|
||||
|
||||
private SalarySobAdjustRuleService salarySobAdjustRuleService;
|
||||
|
||||
private SalaryAcctCalculateService salaryAcctCalculateService;
|
||||
private SalaryAcctResultMapper getSalaryAcctResultMapper(){
|
||||
return MapperProxyFactory.getProxy(SalaryAcctResultMapper.class);
|
||||
}
|
||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||
return (SalaryAcctEmployeeService) ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return (SalarySobItemService) ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return (SalaryItemService) ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
private SalarySobEmpFieldService getSalarySobEmpFieldService(User user) {
|
||||
return (SalarySobEmpFieldService) ServiceUtil.getService(SalarySobEmpFieldServiceImpl.class, user);
|
||||
}
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return (SalarySobService) ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return (SalaryAcctRecordService) ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
private TaxAgentBiz taxAgentService = new TaxAgentBiz();
|
||||
|
||||
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||
return (SalaryEmployeeService) ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
private SalaryFormulaService getSalaryFormulaService(User user) {
|
||||
// return (SalaryFormulaService) ServiceUtil.getService(SalaryFormulaServiceImpl.class, user);
|
||||
return null;
|
||||
}
|
||||
private SalarySobAdjustRuleService getSalarySobAdjustRuleService(User user) {
|
||||
return (SalarySobAdjustRuleService) ServiceUtil.getService(SalarySobAdjustRuleServiceImpl.class, user);
|
||||
}
|
||||
private SalaryAcctCalculateService getSalaryAcctCalculateService(User user) {
|
||||
return (SalaryAcctCalculateService) ServiceUtil.getService(SalaryAcctCalculateServiceImpl.class, user);
|
||||
}
|
||||
// private SalaryAcctProgressService salaryAcctProgressService;
|
||||
|
||||
private DataSourceTransactionManager dataSourceTransactionManager;
|
||||
|
||||
private SalaryAcctResultTempService salaryAcctResultTempService;
|
||||
|
||||
private SalaryAcctResultTempService getSalaryAcctResultTempService(User user) {
|
||||
return (SalaryAcctResultTempService) ServiceUtil.getService(SalaryAcctResultTempServiceImpl.class, user);
|
||||
}
|
||||
// private LoggerTemplate salaryAcctRecordLoggerTemplate;
|
||||
|
||||
// private SIAccountService siAccountService;
|
||||
|
||||
private AttendQuoteFieldService attendQuoteFieldService;
|
||||
|
||||
// private SalaryCheckResultService salaryCheckResultService;
|
||||
private AttendQuoteFieldService getAttendQuoteFieldService(User user) {
|
||||
return (AttendQuoteFieldService) ServiceUtil.getService(AttendQuoteFieldServiceImpl.class, user);
|
||||
}
|
||||
private SalaryCheckResultService salaryCheckResultService;
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctResultPO> listBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecordIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return salaryAcctResultMapper.listSome(SalaryAcctResultPO.builder().salaryAcctRecordIds(salaryAcctRecordIds).build());
|
||||
return getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctRecordIds(salaryAcctRecordIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctResultPO> listBySalaryAcctEmployeeId(Long salaryAcctEmployeeId) {
|
||||
return salaryAcctResultMapper.listSome(SalaryAcctResultPO.builder().salaryAcctEmpId(salaryAcctEmployeeId).build());
|
||||
return getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpId(salaryAcctEmployeeId).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -120,7 +138,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
if (CollectionUtils.isEmpty(salaryAcctEmployeeIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return salaryAcctResultMapper.listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(salaryAcctEmployeeIds).build());
|
||||
return getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(salaryAcctEmployeeIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -128,25 +146,25 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
if (CollectionUtils.isEmpty(salaryAcctRecordIds) || CollectionUtils.isEmpty(employeeIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return salaryAcctResultMapper.listSome(SalaryAcctResultPO.builder().salaryAcctRecordIds(salaryAcctRecordIds).employeeIds(employeeIds).build());
|
||||
return getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctRecordIds(salaryAcctRecordIds).employeeIds(employeeIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryAcctResultDetailDTO getBySalaryAcctEmployeeId(Long salaryAcctEmployeeId) {
|
||||
// 查询薪资核算人员
|
||||
SalaryAcctEmployeePO salaryAcctEmployeePO = salaryAcctEmployeeService.getById(salaryAcctEmployeeId);
|
||||
SalaryAcctEmployeePO salaryAcctEmployeePO = getSalaryAcctEmployeeService(user).getById(salaryAcctEmployeeId);
|
||||
if (Objects.isNull(salaryAcctEmployeePO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除"));
|
||||
}
|
||||
// 查询薪资核算所用薪资账套的薪资项目副本
|
||||
List<SalarySobItemPO> salarySobItemPOS = salarySobItemService.listBySalarySobId(salaryAcctEmployeePO.getSalarySobId());
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctEmployeePO.getSalarySobId());
|
||||
// 查询薪资项目
|
||||
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
|
||||
List<SalaryItemPO> salaryItemPOS = salaryItemService.listByIds(salaryItemIds);
|
||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
// 查询薪资核算所用薪资账套的人员信息字段
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = salarySobEmpFieldService.listBySalarySobId(salaryAcctEmployeePO.getSalarySobId());
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salaryAcctEmployeePO.getSalarySobId());
|
||||
// 查询人员信息
|
||||
DataCollectionEmployee simpleEmployee = hrmCommonEmployeeService.getEmployeeById(salaryAcctEmployeePO.getEmployeeId());
|
||||
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salaryAcctEmployeePO.getEmployeeId());
|
||||
// 查询薪资核算结果
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = listBySalaryAcctEmployeeId(salaryAcctEmployeeId);
|
||||
// 查询个税扣缴义务人
|
||||
|
|
@ -158,7 +176,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
@Override
|
||||
public PageInfo<Map<String, Object>> listPageByParam(SalaryAcctResultQueryParam queryParam) {
|
||||
// 查询薪资核算人员(分页)
|
||||
PageInfo<SalaryAcctEmployeePO> page = salaryAcctEmployeeService.listPageByResultQueryParam(queryParam);
|
||||
PageInfo<SalaryAcctEmployeePO> page = getSalaryAcctEmployeeService(user).listPageByResultQueryParam(queryParam);
|
||||
// 查询薪资核算结果
|
||||
List<Map<String, Object>> data = listBySalaryAcctEmployees(page.getList(), queryParam);
|
||||
// 薪资核算结果的分页结果
|
||||
|
|
@ -170,7 +188,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
@Override
|
||||
public List<Map<String, Object>> listByParam(SalaryAcctResultQueryParam queryParam) {
|
||||
// 查询薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = salaryAcctEmployeeService.listByResultQueryParam(queryParam);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listByResultQueryParam(queryParam);
|
||||
// 查询薪资核算结果
|
||||
return listBySalaryAcctEmployees(salaryAcctEmployeePOS, queryParam);
|
||||
}
|
||||
|
|
@ -188,22 +206,22 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
return Collections.emptyList();
|
||||
}
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = salaryAcctRecordService.getById(queryParam.getSalaryAcctRecordId());
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
// 查询薪资核算所用的薪资账套的员工信息字段
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = salarySobEmpFieldService.listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
// 查询薪资核算所用薪资账套的薪资项目
|
||||
List<SalarySobItemPO> salarySobItemPOS = salarySobItemService.listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
|
||||
List<SalaryItemPO> salaryItemPOS = salaryItemService.listByIds(salaryItemIds);
|
||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
// 查询薪资核算结果
|
||||
Set<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId);
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||
// 查询人员信息
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
|
||||
List<DataCollectionEmployee> simpleEmployees = hrmCommonEmployeeService.listByIds(employeeIds);
|
||||
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).listByIds(employeeIds);
|
||||
// 查询个税扣缴义务人
|
||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getTaxAgentId);
|
||||
List<TaxAgent> taxAgentPOS = taxAgentService.listByIds(taxAgentIds);
|
||||
|
|
@ -214,15 +232,16 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
salaryAcctEmployeeIds4ConsolidatedTax = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId);
|
||||
} else {
|
||||
// 如果查询条件中没有包含"合并计税",那么就需要查询出存在合并计税的人,标记给前端
|
||||
SalaryAcctEmployeeQueryParam accEmployeeQueryParam = new SalaryAcctEmployeeQueryParam()
|
||||
.setSalaryAcctRecordId(queryParam.getSalaryAcctRecordId())
|
||||
.setIds(SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId));
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS4ConsolidatedTax = salaryAcctEmployeeService.listByParam4ConsolidatedTax(accEmployeeQueryParam);
|
||||
SalaryAcctEmployeeQueryParam accEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder()
|
||||
.salaryAcctRecordId(queryParam.getSalaryAcctRecordId())
|
||||
.ids(SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId))
|
||||
.build();
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS4ConsolidatedTax = getSalaryAcctEmployeeService(user).listByParam4ConsolidatedTax(accEmployeeQueryParam);
|
||||
salaryAcctEmployeeIds4ConsolidatedTax = SalaryEntityUtil.properties(salaryAcctEmployeePOS4ConsolidatedTax, SalaryAcctEmployeePO::getId);
|
||||
}
|
||||
// 查询公式详情
|
||||
Set<Long> formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId);
|
||||
List<ExpressFormula> expressFormulas = salaryFormulaService.listExpressFormula(formulaIds);
|
||||
List<ExpressFormula> expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds);
|
||||
Map<Long, String> expressFormulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
||||
Map<Long, String> customParameters = SalaryEntityUtil.convert2Map(salarySobItemPOS, SalarySobItemPO::getSalaryItemId, salarySobItemPO -> {
|
||||
if (salarySobItemPO.getFormulaId() <= 0) {
|
||||
|
|
@ -239,20 +258,20 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
@Override
|
||||
public ConsolidatedTaxDetailDTO getConsolidatedTaxDetail(Long salaryAcctEmployeeId) {
|
||||
// 查询当前的薪资核算人员
|
||||
SalaryAcctEmployeePO salaryAcctEmployeePO = salaryAcctEmployeeService.getById(salaryAcctEmployeeId);
|
||||
SalaryAcctEmployeePO salaryAcctEmployeePO = getSalaryAcctEmployeeService(user).getById(salaryAcctEmployeeId);
|
||||
if (Objects.isNull(salaryAcctEmployeePO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除"));
|
||||
}
|
||||
// 查询当前的薪资核算人员的个税扣缴义务人
|
||||
TaxAgent taxAgentPO = taxAgentService.getById(salaryAcctEmployeePO.getTaxAgentId());
|
||||
// 查询当前的薪资核算人员的人员信息
|
||||
DataCollectionEmployee simpleEmployee = hrmCommonEmployeeService.getEmployeeById(salaryAcctEmployeePO.getEmployeeId());
|
||||
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salaryAcctEmployeePO.getEmployeeId());
|
||||
// 查询当前的薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = salaryAcctRecordService.getById(salaryAcctEmployeePO.getSalaryAcctRecordId());
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctEmployeePO.getSalaryAcctRecordId());
|
||||
// 查询当前薪资核算记录所用的薪资账套
|
||||
SalarySobPO salarySobPO = salarySobService.getById(salaryAcctRecordPO.getSalarySobId());
|
||||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salaryAcctRecordPO.getSalarySobId());
|
||||
// 当前薪资核算记录所用的薪资账套的员工信息字段
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = salarySobEmpFieldService.listBySalarySobId(salarySobPO.getId());
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = getSalarySobEmpFieldService(user).listBySalarySobId(salarySobPO.getId());
|
||||
|
||||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = Collections.singletonList(salaryAcctRecordPO);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = Collections.singletonList(salaryAcctEmployeePO);
|
||||
|
|
@ -260,14 +279,14 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// 如果当前薪资核算记录所用的薪资账套的薪资类型是工资薪金,代表可能存在合并计税
|
||||
if (Objects.equals(salarySobPO.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue())) {
|
||||
// 查询所有薪资类型为工资薪金的账套
|
||||
List<SalarySobPO> salarySobPOS = salarySobService.listByIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES);
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES);
|
||||
// 查询相同税款所属期内的薪资类型为工资薪金的账套的所有核算记录
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
|
||||
LocalDateRange taxCycleDateRange = SalaryDateUtil.localDate2Range(salaryAcctRecordPO.getTaxCycle());
|
||||
salaryAcctRecordPOS = salaryAcctRecordService.listBySalarySobIdsAndSalaryMonth(salarySobIds, taxCycleDateRange);
|
||||
salaryAcctRecordPOS = getSalaryAcctRecordService(user).listBySalarySobIdsAndSalaryMonth(salarySobIds, taxCycleDateRange);
|
||||
// 查询当前薪资核算人员所涉及的合并计税的所有薪资核算人员
|
||||
Set<Long> salaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId);
|
||||
salaryAcctEmployeePOS = salaryAcctEmployeeService.listByRecordIdsAndEmpIdAndTaxAgentId(salaryAcctRecordIds,
|
||||
salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listByRecordIdsAndEmpIdAndTaxAgentId(salaryAcctRecordIds,
|
||||
salaryAcctEmployeePO.getEmployeeId(), salaryAcctEmployeePO.getTaxAgentId());
|
||||
}
|
||||
// 查询薪资核算人员的薪资核算结果
|
||||
|
|
@ -275,12 +294,12 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
List<SalaryAcctResultPO> salaryAcctResultPOS = listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||
// 查询薪资核算人员所有合并计税的薪资核算记录所用的账套
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getSalarySobId);
|
||||
List<SalarySobPO> salarySobPOS = salarySobService.listByIds(salarySobIds);
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByIds(salarySobIds);
|
||||
// 查询薪资项目所引用的薪资项目
|
||||
List<SalarySobItemPO> salarySobItemPOS = salarySobItemService.listBySalarySobIds(salarySobIds);
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobIds(salarySobIds);
|
||||
// 查询薪资项目
|
||||
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
|
||||
List<SalaryItemPO> salaryItemPOS = salaryItemService.listByIds(salaryItemIds);
|
||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
// 转换成合并计税详情dto
|
||||
return SalaryAcctResultBO.convert2ConsolidatedTaxDetailDTO(simpleEmployee, taxAgentPO, salarySobEmpFieldPOS, salaryItemPOS,
|
||||
salaryAcctEmployeePOS, salarySobPOS, salaryAcctRecordPOS, salaryAcctResultPOS);
|
||||
|
|
@ -289,7 +308,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
@Override
|
||||
public void save(SalaryAcctResultSaveParam saveParam) {
|
||||
// 查询薪资核算人员
|
||||
SalaryAcctEmployeePO salaryAcctEmployeePO = salaryAcctEmployeeService.getById(saveParam.getSalaryAcctEmpId());
|
||||
SalaryAcctEmployeePO salaryAcctEmployeePO = getSalaryAcctEmployeeService(user).getById(saveParam.getSalaryAcctEmpId());
|
||||
if (Objects.isNull(salaryAcctEmployeePO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除"));
|
||||
}
|
||||
|
|
@ -299,12 +318,12 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
deleteBySalaryAcctEmployeeIds(Collections.singleton(saveParam.getSalaryAcctEmpId()));
|
||||
// 保存薪资核算结果
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) {
|
||||
salaryAcctResultMapper.batchInsert(salaryAcctResultPOS);
|
||||
getSalaryAcctResultMapper().batchInsert(salaryAcctResultPOS);
|
||||
}
|
||||
// 查询操作日志的targetName
|
||||
String targetName = salaryAcctRecordService.getLogTargetNameById(salaryAcctEmployeePO.getSalaryAcctRecordId());
|
||||
String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(salaryAcctEmployeePO.getSalaryAcctRecordId());
|
||||
// 查询人员信息
|
||||
DataCollectionEmployee simpleEmployee = hrmCommonEmployeeService.getEmployeeById(salaryAcctEmployeePO.getEmployeeId());
|
||||
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salaryAcctEmployeePO.getEmployeeId());
|
||||
// 查询个税扣缴义务人
|
||||
TaxAgent taxAgentPO = taxAgentService.getById(salaryAcctEmployeePO.getTaxAgentId());
|
||||
// 记录日志
|
||||
|
|
@ -322,30 +341,30 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
@Override
|
||||
public void batchSave(Collection<SalaryAcctResultPO> salaryAcctResultPOS) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) {
|
||||
salaryAcctResultMapper.batchInsert(salaryAcctResultPOS);
|
||||
getSalaryAcctResultMapper().batchInsert(salaryAcctResultPOS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds) {
|
||||
salaryAcctResultMapper.deleteBySalaryAcctEmpIds(salaryAcctEmployeeIds);
|
||||
getSalaryAcctResultMapper().deleteBySalaryAcctEmpIds(salaryAcctEmployeeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds) {
|
||||
salaryAcctResultMapper.deleteByAcctEmpIdsAndSalaryItemIds(salaryAcctEmployeeIds, salaryItemIds);
|
||||
getSalaryAcctResultMapper().deleteByAcctEmpIdsAndSalaryItemIds(salaryAcctEmployeeIds, salaryItemIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds) {
|
||||
salaryAcctResultMapper.deleteBySalaryAcctRecordIds(salaryAcctRecordIds);
|
||||
getSalaryAcctResultMapper().deleteBySalaryAcctRecordIds(salaryAcctRecordIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calculate(SalaryAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee) {
|
||||
try {
|
||||
// 1、查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = salaryAcctRecordService.getById(calculateParam.getSalaryAcctRecordId());
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(calculateParam.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
|
|
@ -354,34 +373,34 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99148, "当前薪资核算记录已归档,请重新打开后再进行核算"));
|
||||
}
|
||||
// 2、查询薪资核算记录的薪资周期、考勤周期等
|
||||
SalarySobCycleDTO salarySobCycleDTO = salaryAcctRecordService.getSalarySobCycleById(calculateParam.getSalaryAcctRecordId());
|
||||
SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(calculateParam.getSalaryAcctRecordId());
|
||||
// 3、查询薪资核算记录所用薪资账套的薪资项目副本
|
||||
List<SalarySobItemPO> salarySobItemPOS = salarySobItemService.listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
if (CollectionUtils.isEmpty(salarySobItemPOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99151, "当前所用的薪资账套未选择任何薪资项目,无法核算"));
|
||||
}
|
||||
// 4、查询当前租户的所有薪资项目
|
||||
List<SalaryItemPO> salaryItemPOS = salaryItemService.listAll();
|
||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listAll();
|
||||
// 5、查询薪资核算记录所用薪资账套的调薪计薪规则
|
||||
List<SalarySobAdjustRulePO> salarySobAdjustRulePOS = salarySobAdjustRuleService.listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
List<SalarySobAdjustRulePO> salarySobAdjustRulePOS = getSalarySobAdjustRuleService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
// todo 6、查询社保福利的所有字段
|
||||
Map<String, String> welfareColumns = null;//siAccountService.welfareColumns(tenantKey);
|
||||
Map<String, String> welfareColumns = Maps.newHashMap();//siAccountService.welfareColumns(tenantKey);
|
||||
// 7、查询考勤引用的所有字段
|
||||
List<AttendQuoteFieldListDTO> attendQuoteFieldListDTOS = attendQuoteFieldService.listAll();
|
||||
List<AttendQuoteFieldListDTO> attendQuoteFieldListDTOS = getAttendQuoteFieldService(user).listAll();
|
||||
// 8、查询公式详情
|
||||
Set<Long> formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId);
|
||||
formulaIds.addAll(SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getFormulaId));
|
||||
List<ExpressFormula> expressFormulas = salaryFormulaService.listExpressFormula(formulaIds);
|
||||
List<ExpressFormula> expressFormulas = Lists.newArrayList();//getSalaryFormulaService(user).listExpressFormula(formulaIds);
|
||||
// 9、计算薪资项目的运算优先级
|
||||
List<List<Long>> salarySobItemsWithPriority = SalaryAcctCalculatePriorityBO.calculatePriority(salarySobItemPOS, salaryItemPOS, expressFormulas);
|
||||
// 10、根据id查询其他合并计税的薪资核算记录
|
||||
List<SalaryAcctRecordPO> otherSalaryAcctRecordPOS = salaryAcctRecordService.listById4OtherConsolidatedTax(salaryAcctRecordPO.getId());
|
||||
List<SalaryAcctRecordPO> otherSalaryAcctRecordPOS = getSalaryAcctRecordService(user).listById4OtherConsolidatedTax(salaryAcctRecordPO.getId());
|
||||
// 11、查询本次核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS;
|
||||
if (CollectionUtils.isEmpty(calculateParam.getIds())) {
|
||||
salaryAcctEmployeePOS = salaryAcctEmployeeService.listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
|
||||
salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
|
||||
} else {
|
||||
salaryAcctEmployeePOS = salaryAcctEmployeeService.listByIds(calculateParam.getIds());
|
||||
salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listByIds(calculateParam.getIds());
|
||||
}
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(103378, "薪资核算人员不能为空"));
|
||||
|
|
@ -424,7 +443,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
salaryAcctCalculateService.calculate(salaryAcctCalculateBO, simpleEmployee);
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "salaryAcctCalculate", localRunnable);
|
||||
|
|
@ -441,7 +460,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
.collect(Collectors.joining("|"));
|
||||
// salaryAcctProgressService.fail("" + calculateParam.getSalaryAcctRecordId(), errorMsg);
|
||||
// 删除薪资核算临时存储表中的数据
|
||||
salaryAcctResultTempService.deleteByCalculateKey(calculateKey);
|
||||
getSalaryAcctResultTempService(user).deleteByCalculateKey(calculateKey);
|
||||
return;
|
||||
}
|
||||
// 15、处理核算结果临时表数据
|
||||
|
|
@ -453,7 +472,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// salaryCheckResultService.check(salaryAcctCheckParam, true, simpleEmployee);
|
||||
// 记录日志
|
||||
// 查询操作日志的targetName
|
||||
// String targetName = salaryAcctRecordService.getLogTargetNameById(calculateParam.getSalaryAcctRecordId());
|
||||
// String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(calculateParam.getSalaryAcctRecordId());
|
||||
// LoggerContext<SalaryCheckResultPO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(calculateParam.getSalaryAcctRecordId()));
|
||||
// loggerContext.setTargetName(targetName);
|
||||
|
|
@ -476,26 +495,26 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
* @param calculateKey
|
||||
*/
|
||||
private void handleSalaryAcctResultTemp(SalaryAcctCalculateParam calculateParam, String calculateKey) {
|
||||
TransactionStatus status = dataSourceTransactionManager.getTransaction(new DefaultTransactionDefinition());
|
||||
try {
|
||||
// TransactionStatus status = dataSourceTransactionManager.getTransaction(new DefaultTransactionDefinition());
|
||||
// try {
|
||||
// 查询薪资核算结果的临时存储
|
||||
List<SalaryAcctResultTempPO> salaryAcctResultTempPOS = salaryAcctResultTempService.listByCalculateKey(calculateKey);
|
||||
List<SalaryAcctResultTempPO> salaryAcctResultTempPOS = getSalaryAcctResultTempService(user).listByCalculateKey(calculateKey);
|
||||
// 删除原来的薪资核算结果
|
||||
if (CollectionUtils.isNotEmpty(calculateParam.getIds())) {
|
||||
salaryAcctResultMapper.deleteBySalaryAcctEmpIds(calculateParam.getIds());
|
||||
getSalaryAcctResultMapper().deleteBySalaryAcctEmpIds(calculateParam.getIds());
|
||||
} else {
|
||||
salaryAcctResultMapper.deleteBySalaryAcctRecordIds(Collections.singleton(calculateParam.getSalaryAcctRecordId()));
|
||||
getSalaryAcctResultMapper().deleteBySalaryAcctRecordIds(Collections.singleton(calculateParam.getSalaryAcctRecordId()));
|
||||
}
|
||||
// 保存薪资的薪资核算结果
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = SalaryAcctResultBO.convert2ResultPO(salaryAcctResultTempPOS);
|
||||
batchSave(salaryAcctResultPOS);
|
||||
// 删除薪资核算临时存储表中的数据
|
||||
salaryAcctResultTempService.deleteByCalculateKey(calculateKey);
|
||||
// 提交事务
|
||||
dataSourceTransactionManager.commit(status);
|
||||
} catch (Exception e) {
|
||||
dataSourceTransactionManager.rollback(status);
|
||||
throw e;
|
||||
}
|
||||
getSalaryAcctResultTempService(user).deleteByCalculateKey(calculateKey);
|
||||
// // 提交事务
|
||||
// dataSourceTransactionManager.commit(status);
|
||||
// } catch (Exception e) {
|
||||
// dataSourceTransactionManager.rollback(status);
|
||||
// throw e;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,244 @@
|
|||
//package com.engine.salary.service.impl;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
//import com.engine.core.impl.Service;
|
||||
//import com.engine.salary.service.SalaryComparisonResultService;
|
||||
//import com.google.common.collect.Sets;
|
||||
//import com.weaver.common.component.table.column.WeaTableColumn;
|
||||
//import com.weaver.common.component.table.page.Page;
|
||||
//import com.weaver.common.hrm.service.HrmCommonEmployeeService;
|
||||
//import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
//import com.weaver.hrm.salary.dao.ExcelAcctResultMapper;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.bo.SalaryAcctResultBO;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryComparisonResultListDTO;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.param.SalaryComparisonResultQueryParam;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.po.ExcelAcctResultPO;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
//import com.weaver.hrm.salary.entity.salaryarchive.po.TaxAgentPO;
|
||||
//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.bo.SalarySobItemAggregateBO;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobPO;
|
||||
//import com.weaver.hrm.salary.exception.SalaryRunTimeException;
|
||||
//import com.weaver.hrm.salary.service.*;
|
||||
//import com.weaver.hrm.salary.util.SalaryEntityUtil;
|
||||
//import com.weaver.hrm.salary.util.SalaryI18nUtil;
|
||||
//import com.weaver.hrm.salary.util.SalaryPageUtil;
|
||||
//import com.weaver.teams.domain.user.SimpleEmployee;
|
||||
//import org.apache.commons.collections4.CollectionUtils;
|
||||
//import org.apache.commons.lang3.BooleanUtils;
|
||||
//import org.apache.commons.lang3.StringUtils;
|
||||
//import org.apache.commons.lang3.math.NumberUtils;
|
||||
//
|
||||
//import java.util.*;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * 薪资核算的线下对比结果
|
||||
// * <p>Copyright: Copyright (c) 2022</p>
|
||||
// * <p>Company: 泛微软件</p>
|
||||
// *
|
||||
// * @author qiantao
|
||||
// * @version 1.0
|
||||
// **/
|
||||
//public class SalaryComparisonResultServiceImpl extends Service implements SalaryComparisonResultService {
|
||||
//
|
||||
//
|
||||
// private ExcelAcctResultMapper excelAcctResultMapper;
|
||||
//
|
||||
// private SalaryAcctResultService salaryAcctResultService;
|
||||
//
|
||||
// private SalaryAcctEmployeeService salaryAcctEmployeeService;
|
||||
//
|
||||
// private SalarySobItemService salarySobItemService;
|
||||
//
|
||||
// private SalaryAcctRecordService salaryAcctRecordService;
|
||||
//
|
||||
// private SalarySobEmpFieldService salarySobEmpFieldService;
|
||||
//
|
||||
// private HrmCommonEmployeeService hrmCommonEmployeeService;
|
||||
//
|
||||
// private TaxAgentService taxAgentService;
|
||||
//
|
||||
// private SalaryFormulaService salaryFormulaService;
|
||||
//
|
||||
// private SalaryItemService salaryItemService;
|
||||
//
|
||||
// private SalarySobService salarySobService;
|
||||
//
|
||||
// private SalarySobItemGroupService salarySobItemGroupService;
|
||||
//
|
||||
// @Override
|
||||
// public List<ExcelAcctResultPO> listBySalaryAcctRecordId(Long salaryAcctRecordId, String tenantKey) {
|
||||
// return new LambdaQueryChainWrapper<>(excelAcctResultMapper)
|
||||
// .eq(ExcelAcctResultPO::getTenantKey, tenantKey)
|
||||
// .eq(ExcelAcctResultPO::getDeleteType, 0)
|
||||
// .eq(ExcelAcctResultPO::getSalaryAcctRecordId, salaryAcctRecordId)
|
||||
// .list();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<ExcelAcctResultPO> listBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds, String tenantKey) {
|
||||
// if (CollectionUtils.isEmpty(salaryAcctEmployeeIds)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// return new LambdaQueryChainWrapper<>(excelAcctResultMapper)
|
||||
// .eq(ExcelAcctResultPO::getTenantKey, tenantKey)
|
||||
// .eq(ExcelAcctResultPO::getDeleteType, 0)
|
||||
// .in(ExcelAcctResultPO::getSalaryAcctEmpId, salaryAcctEmployeeIds)
|
||||
// .list();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public SalaryComparisonResultListDTO listPageByParam(SalaryComparisonResultQueryParam queryParam, String tenantKey) {
|
||||
// return listByParam(true, queryParam, tenantKey);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public SalaryComparisonResultListDTO listByParam(SalaryComparisonResultQueryParam queryParam, String tenantKey) {
|
||||
// return listByParam(false, queryParam, tenantKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据薪资核算人员查询薪资核算线下对比结果
|
||||
// *
|
||||
// * @param queryParam 列表查询条件
|
||||
// * @param tenantKey 租户key
|
||||
// * @return
|
||||
// */
|
||||
// private SalaryComparisonResultListDTO listByParam(boolean needPage, SalaryComparisonResultQueryParam queryParam, String tenantKey) {
|
||||
// // 查询薪资核算记录
|
||||
// SalaryAcctRecordPO salaryAcctRecordPO = salaryAcctRecordService.getById(queryParam.getSalaryAcctRecordId(), tenantKey);
|
||||
// if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
// }
|
||||
// // 查询薪资核算所用薪资账套
|
||||
// SalarySobPO salarySobPO = salarySobService.getById(salaryAcctRecordPO.getSalarySobId(), tenantKey);
|
||||
// // 查询薪资核算所用的薪资账套的员工信息字段
|
||||
// List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = salarySobEmpFieldService.listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), tenantKey);
|
||||
// // 查询薪资账套的薪资项目分类
|
||||
// List<SalarySobItemGroupPO> salarySobItemGroupPOS = salarySobItemGroupService.listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), tenantKey);
|
||||
// // 查询薪资核算所用薪资账套的薪资项目副本
|
||||
// List<SalarySobItemPO> salarySobItemPOS = salarySobItemService.listBySalarySobId(salaryAcctRecordPO.getSalarySobId(), tenantKey);
|
||||
// // 查询公式详情
|
||||
// Set<Long> formulaIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getFormulaId);
|
||||
// List<ExpressFormula> expressFormulas = salaryFormulaService.listExpressFormula(formulaIds, tenantKey);
|
||||
// // 转换成
|
||||
// Map<Long, String> expressFormulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
||||
// Map<Long, String> customParameters = SalaryEntityUtil.convert2Map(salarySobItemPOS, SalarySobItemPO::getSalaryItemId, salarySobItemPO -> {
|
||||
// if (salarySobItemPO.getFormulaId() <= 0) {
|
||||
// return SalaryI18nUtil.getI18nLabel(92004, "输入/导入");
|
||||
// }
|
||||
// return expressFormulaMap.getOrDefault(salarySobItemPO.getFormulaId(), StringUtils.EMPTY);
|
||||
// });
|
||||
// // 查询薪资项目
|
||||
// Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItemPOS, SalarySobItemPO::getSalaryItemId);
|
||||
// List<SalaryItemPO> salaryItemPOS = salaryItemService.listByIds(salaryItemIds, tenantKey);
|
||||
// // 转换成聚合dto
|
||||
// SalarySobItemAggregateBO salarySobItemAggregateBO = new SalarySobItemAggregateBO(salarySobPO, salarySobEmpFieldPOS,
|
||||
// salarySobItemGroupPOS, salarySobItemPOS, expressFormulas, salaryItemPOS);
|
||||
// SalarySobItemAggregateDTO salarySobItemAggregateDTO = salarySobItemAggregateBO.convert2AggregateDTO();
|
||||
//
|
||||
// // 薪资核算人员
|
||||
// List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = salaryAcctEmployeeService.listByResultQueryParam(queryParam, tenantKey);
|
||||
// if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
// // 构建薪资核算结果列表表头
|
||||
// List<WeaTableColumn> weaTableColumns = SalaryAcctResultBO.buildTableColumns4ComparisonResult(salarySobItemAggregateDTO, Collections.emptySet());
|
||||
// // 构建列表数据
|
||||
// Page<Map<String, Object>> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
// dtoPage.setTotal(NumberUtils.INTEGER_ZERO);
|
||||
// dtoPage.setRecords(Collections.emptyList());
|
||||
// // 返回结果
|
||||
// return new SalaryComparisonResultListDTO().setWeaTableColumns(weaTableColumns).setData(dtoPage);
|
||||
// }
|
||||
// // 薪资核算结果
|
||||
// List<SalaryAcctResultPO> salaryAcctResultPOS;
|
||||
// // 线下导入结果
|
||||
// List<ExcelAcctResultPO> excelAcctResultPOS;
|
||||
// // 如果薪资核算人员太多,利用薪资核算人员id查询薪资核算结果的效率就不太好,改为直接用薪资核算记录id查询
|
||||
// if (salaryAcctEmployeePOS.size() > 1000) {
|
||||
// // 查询薪资核算结果
|
||||
// salaryAcctResultPOS = salaryAcctResultService.listBySalaryAcctRecordIds(Collections.singleton(queryParam.getSalaryAcctRecordId()), tenantKey);
|
||||
// // 查询线下导入结果
|
||||
// excelAcctResultPOS = listBySalaryAcctRecordId(queryParam.getSalaryAcctRecordId(), tenantKey);
|
||||
// } else {
|
||||
// // 薪资核算人员id
|
||||
// Set<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId);
|
||||
// // 查询薪资核算结果
|
||||
// salaryAcctResultPOS = salaryAcctResultService.listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds, tenantKey);
|
||||
// // 查询线下导入结果
|
||||
// excelAcctResultPOS = listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds, tenantKey);
|
||||
// }
|
||||
//
|
||||
// // 查询个税扣缴义务人
|
||||
// Set<Long> taxAgentIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getTaxAgentId);
|
||||
// List<TaxAgentPO> taxAgentPOS = taxAgentService.listByIds(taxAgentIds, tenantKey);
|
||||
// // 查询人员信息
|
||||
// List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
|
||||
// List<SimpleEmployee> simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIds, tenantKey);
|
||||
// // 判断是否存在合并计税
|
||||
// Set<Long> salaryAcctEmployeeIds4ConsolidatedTax;
|
||||
// if (StringUtils.isEmpty(queryParam.getConsolidatedTaxation())) {
|
||||
// salaryAcctEmployeeIds4ConsolidatedTax = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId);
|
||||
// } else {
|
||||
// SalaryAcctEmployeeQueryParam accEmployeeQueryParam = new SalaryAcctEmployeeQueryParam()
|
||||
// .setSalaryAcctRecordId(queryParam.getSalaryAcctRecordId())
|
||||
// .setIds(SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getId));
|
||||
// List<SalaryAcctEmployeePO> salaryAcctEmployeePOS4ConsolidatedTax = salaryAcctEmployeeService.listByParam4ConsolidatedTax(accEmployeeQueryParam, tenantKey);
|
||||
// salaryAcctEmployeeIds4ConsolidatedTax = SalaryEntityUtil.properties(salaryAcctEmployeePOS4ConsolidatedTax, SalaryAcctEmployeePO::getId);
|
||||
// }
|
||||
// // 系统值和线下值不一致的薪资项目id
|
||||
// Set<Long> includeSalaryItemIds = Sets.newHashSetWithExpectedSize(salaryItemPOS.size());
|
||||
// // 转换成薪资核算线下对比结果
|
||||
// List<Map<String, Object>> resultMapList = SalaryAcctResultBO.buildComparisonTableData(salaryItemPOS, salarySobEmpFieldPOS, simpleEmployees,
|
||||
// salaryAcctEmployeePOS, salaryAcctResultPOS, excelAcctResultPOS, taxAgentPOS, customParameters, salaryAcctEmployeeIds4ConsolidatedTax, includeSalaryItemIds);
|
||||
// // 系统值和线下值一致的人员
|
||||
// if (queryParam.isOnlyDiffEmployee()) {
|
||||
// // 过滤系统值和线下值一致的薪资核算人员
|
||||
// resultMapList = resultMapList.stream()
|
||||
// .filter(map -> BooleanUtils.toBoolean(String.valueOf(map.get("different"))))
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
// // 分页
|
||||
// Page<Map<String, Object>> dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
// dtoPage.setTotal(resultMapList.size());
|
||||
// if (needPage) {
|
||||
// dtoPage.setRecords(SalaryPageUtil.subList((int) dtoPage.getCurrent(), (int) dtoPage.getSize(), resultMapList));
|
||||
// } else {
|
||||
// dtoPage.setRecords(resultMapList);
|
||||
// }
|
||||
// Set<Long> excludeSalaryItemIds = Sets.newHashSet();
|
||||
// if (queryParam.isOnlyDiffSalaryItem()) {
|
||||
// // 过滤系统值和线下值一致的薪资项目
|
||||
// excludeSalaryItemIds = salaryItemPOS.stream()
|
||||
// .filter(salaryItemPO -> !includeSalaryItemIds.contains(salaryItemPO.getId()))
|
||||
// .map(SalaryItemPO::getId)
|
||||
// .collect(Collectors.toSet());
|
||||
// }
|
||||
// // 构建薪资核算结果列表表头
|
||||
// List<WeaTableColumn> weaTableColumns = SalaryAcctResultBO.buildTableColumns4ComparisonResult(salarySobItemAggregateDTO, excludeSalaryItemIds);
|
||||
// // 返回结果
|
||||
// return new SalaryComparisonResultListDTO().setWeaTableColumns(weaTableColumns).setData(dtoPage);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void batchSave(Collection<ExcelAcctResultPO> excelAcctResultPOS) {
|
||||
// excelAcctResultMapper.batchInsert(excelAcctResultPOS);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void deleteBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds, String tenantKey) {
|
||||
// excelAcctResultMapper.deleteBySalaryAcctEmployeeIds(salaryAcctEmployeeIds, tenantKey);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds, String tenantKey) {
|
||||
// excelAcctResultMapper.deleteBySalaryAcctRecordIds(salaryAcctRecordIds, tenantKey);
|
||||
// }
|
||||
//}
|
||||
|
|
@ -7,6 +7,7 @@ import com.engine.core.exception.ECException;
|
|||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
|
@ -15,7 +16,7 @@ import java.util.function.Consumer;
|
|||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class ResponseResult<T, R> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
@ -24,17 +25,17 @@ public class ResponseResult<T, R> {
|
|||
* 统一返回方法
|
||||
*/
|
||||
public static String run(Function<Map<String, Object>, Map<String, Object>> f, Map<String, Object> m) {
|
||||
BaseBean b = new BaseBean();
|
||||
try {
|
||||
b.writeLog(getJsonString(m));
|
||||
return Ok(f.apply(m));
|
||||
} catch (SalaryRunTimeException e) {
|
||||
return Error(e.getMessage());
|
||||
} catch (ECException e) {
|
||||
BaseBean b = new BaseBean();
|
||||
b.writeLog(e);
|
||||
Throwable cause = e.getCause();
|
||||
return Error(cause.getMessage());
|
||||
} catch (Exception e) {
|
||||
BaseBean b = new BaseBean();
|
||||
b.writeLog(e);
|
||||
return Error(e.getMessage());
|
||||
}
|
||||
|
|
@ -65,17 +66,17 @@ public class ResponseResult<T, R> {
|
|||
* 统一返回方法
|
||||
*/
|
||||
public String run(Function<T, R> f, T m) {
|
||||
BaseBean b = new BaseBean();
|
||||
try {
|
||||
b.writeLog(getJsonString(m));
|
||||
return Ok(f.apply(m));
|
||||
} catch (SalaryRunTimeException e) {
|
||||
return Error(e.getMessage());
|
||||
} catch (ECException e) {
|
||||
BaseBean b = new BaseBean();
|
||||
b.writeLog(e);
|
||||
Throwable cause = e.getCause();
|
||||
return Error(cause.getMessage());
|
||||
} catch (Exception e) {
|
||||
BaseBean b = new BaseBean();
|
||||
b.writeLog(e);
|
||||
return Error(e.getMessage());
|
||||
}
|
||||
|
|
@ -85,18 +86,17 @@ public class ResponseResult<T, R> {
|
|||
* 统一返回方法(有参无返回)
|
||||
*/
|
||||
public String run(Consumer<T> f, T t) {
|
||||
BaseBean b = new BaseBean();
|
||||
try {
|
||||
f.accept(t);
|
||||
return Ok();
|
||||
} catch (SalaryRunTimeException e) {
|
||||
return Error(e.getMessage());
|
||||
} catch (ECException e) {
|
||||
BaseBean b = new BaseBean();
|
||||
b.writeLog(e);
|
||||
Throwable cause = e.getCause();
|
||||
return Error(cause.getMessage());
|
||||
} catch (Exception e) {
|
||||
BaseBean b = new BaseBean();
|
||||
b.writeLog(e);
|
||||
return Error(e.getMessage());
|
||||
}
|
||||
|
|
@ -126,15 +126,24 @@ public class ResponseResult<T, R> {
|
|||
/**
|
||||
* 成功返回
|
||||
*/
|
||||
private String Ok(R r) throws JsonProcessingException {
|
||||
private String Ok(R r) {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
apidatas.put("status", true);
|
||||
apidatas.put("data", r);
|
||||
ObjectMapper mapper=new ObjectMapper();
|
||||
return mapper.writeValueAsString(apidatas);
|
||||
return getJsonString(apidatas);
|
||||
// return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
private static String getJsonString(Object apidatas) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
return mapper.writeValueAsString(apidatas);
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 成功返回
|
||||
|
|
|
|||
|
|
@ -37,16 +37,14 @@ public class MapperProxyFactory implements InvocationHandler {
|
|||
}
|
||||
|
||||
public Object getProxy() {
|
||||
if (enableTransactions)
|
||||
this.session = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
Class<?>[] interfaces = new Class<?>[1];
|
||||
interfaces[0] = this.clazz;
|
||||
return Proxy.newProxyInstance(loader, interfaces, this);
|
||||
}
|
||||
|
||||
public Object getProxy(boolean isAutoCommit) {
|
||||
this.enableTransactions = isAutoCommit;
|
||||
public Object getProxy(boolean enableTransactions) {
|
||||
this.enableTransactions = enableTransactions;
|
||||
return this.getProxy();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,24 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAccEmployeeListDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordFormDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SalaryAcctEmployeeWrapper;
|
||||
import com.engine.salary.wrapper.SalaryAcctExcelWrapper;
|
||||
import com.engine.salary.wrapper.SalaryAcctRecordWrapper;
|
||||
import com.engine.salary.wrapper.SalaryAcctResultWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -20,7 +27,15 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.StreamingOutput;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 薪资核算
|
||||
|
|
@ -37,13 +52,20 @@ public class SalaryAcctController {
|
|||
private SalaryAcctRecordWrapper getSalaryAcctRecordWrapper(User user) {
|
||||
return (SalaryAcctRecordWrapper) ServiceUtil.getService(SalaryAcctRecordWrapper.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctEmployeeWrapper getSalaryAcctEmployeeWrapper(User user) {
|
||||
return (SalaryAcctEmployeeWrapper) ServiceUtil.getService(SalaryAcctEmployeeWrapper.class, user);
|
||||
}
|
||||
private SalaryAcctResultWrapper salaryAcctResultWrapper;
|
||||
// private SalaryAcctCheckResultWrapper salaryAcctCheckResultWrapper;
|
||||
|
||||
private SalaryAcctResultWrapper getSalaryAcctResultWrapper(User user) {
|
||||
return (SalaryAcctResultWrapper) ServiceUtil.getService(SalaryAcctResultWrapper.class, user);
|
||||
}
|
||||
|
||||
// private SalaryAcctCheckResultWrapper salaryAcctCheckResultWrapper;
|
||||
// private SalaryComparisonResultWrapper salaryComparisonResultWrapper;
|
||||
// private SalaryAcctExcelWrapper salaryAcctExcelWrapper;
|
||||
private SalaryAcctExcelWrapper getSalaryAcctExcelWrapper(User user) {
|
||||
return (SalaryAcctExcelWrapper) ServiceUtil.getService(SalaryAcctExcelWrapper.class, user);
|
||||
}
|
||||
// private SalaryAcctExcelService salaryAcctExcelService;
|
||||
// private SalaryBatchService salaryBatchService;
|
||||
//
|
||||
|
|
@ -145,7 +167,7 @@ public class SalaryAcctController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listReducedEmployee(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctEmployeeQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctEmployeeQueryParam,PageInfo<SalaryAccEmployeeListDTO>>().run(getSalaryAcctEmployeeWrapper(user)::listPage4Reduce, param);
|
||||
return new ResponseResult<SalaryAcctEmployeeQueryParam, PageInfo<SalaryAccEmployeeListDTO>>().run(getSalaryAcctEmployeeWrapper(user)::listPage4Reduce, param);
|
||||
}
|
||||
|
||||
//添加薪资核算人员
|
||||
|
|
@ -154,7 +176,7 @@ public class SalaryAcctController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSalaryAcctEmployee(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctEmployeeSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctEmployeeSaveParam,String>().run(getSalaryAcctEmployeeWrapper(user)::save, param);
|
||||
return new ResponseResult<SalaryAcctEmployeeSaveParam, String>().run(getSalaryAcctEmployeeWrapper(user)::save, param);
|
||||
}
|
||||
|
||||
//删除薪资核算人员
|
||||
|
|
@ -163,7 +185,7 @@ public class SalaryAcctController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteSalaryAcctEmployee(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctEmployeeDeleteParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctEmployeeDeleteParam,String>().run(getSalaryAcctEmployeeWrapper(user)::delete, param);
|
||||
return new ResponseResult<SalaryAcctEmployeeDeleteParam, String>().run(getSalaryAcctEmployeeWrapper(user)::delete, param);
|
||||
}
|
||||
|
||||
//检查薪资核算人员的个税扣缴义务人
|
||||
|
|
@ -172,7 +194,7 @@ public class SalaryAcctController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String checkTaxAgent(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctEmpCheckTaxAgentParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long,String>().run(getSalaryAcctEmployeeWrapper(user)::checkTaxAgent, param.getSalaryAcctRecordId());
|
||||
return new ResponseResult<Long, String>().run(getSalaryAcctEmployeeWrapper(user)::checkTaxAgent, param.getSalaryAcctRecordId());
|
||||
}
|
||||
|
||||
//刷新薪资核算人员的个税扣缴义务人
|
||||
|
|
@ -181,7 +203,7 @@ public class SalaryAcctController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String refreshTaxAgent(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctEmpRefreshTaxAgentParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long,String>().run(getSalaryAcctEmployeeWrapper(user)::refreshTaxAgent, param.getSalaryAcctRecordId());
|
||||
return new ResponseResult<Long, String>().run(getSalaryAcctEmployeeWrapper(user)::refreshTaxAgent, param.getSalaryAcctRecordId());
|
||||
}
|
||||
|
||||
//从环比上月减少添加薪资核算人员
|
||||
|
|
@ -190,45 +212,113 @@ public class SalaryAcctController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String addFromReduce(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctEmployeeAddParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctEmployeeAddParam,String>().run(getSalaryAcctEmployeeWrapper(user)::addFromReduce, param);
|
||||
return new ResponseResult<SalaryAcctEmployeeAddParam, String>().run(getSalaryAcctEmployeeWrapper(user)::addFromReduce, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出人员范围
|
||||
*/
|
||||
@GET
|
||||
@Path("/acctemployee/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response exportSalaryAcctEmployee(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
SalaryAcctEmployeeQueryParam param = buildSalaryAcctEmployeeQueryParam(request);
|
||||
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getSalaryAcctExcelWrapper(user).exportSalaryAcctEmployee(param);
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = "核算人员范围" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private SalaryAcctEmployeeQueryParam buildSalaryAcctEmployeeQueryParam(HttpServletRequest request) {
|
||||
SalaryAcctEmployeeQueryParam param = new SalaryAcctEmployeeQueryParam();
|
||||
|
||||
String salaryAcctRecordId = request.getParameter("salaryAcctRecordId");
|
||||
if (StringUtils.isNotBlank(salaryAcctRecordId)) {
|
||||
param.setSalaryAcctRecordId(Long.parseLong(salaryAcctRecordId));
|
||||
}
|
||||
String employeeName = request.getParameter("employeeName");
|
||||
if (StringUtils.isNotBlank(employeeName)) {
|
||||
param.setEmployeeName(employeeName);
|
||||
}
|
||||
String taxAgentId = request.getParameter("taxAgentId");
|
||||
if (StringUtils.isNotBlank(taxAgentId)) {
|
||||
param.setTaxAgentId(Long.parseLong(taxAgentId));
|
||||
}
|
||||
String departmentIds = request.getParameter("departmentIds");
|
||||
if (StringUtils.isNotBlank(departmentIds)) {
|
||||
param.setDepartmentIds(Arrays.stream(departmentIds.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
String positionIds = request.getParameter("positionIds");
|
||||
if (StringUtils.isNotBlank(positionIds)) {
|
||||
param.setPositionIds(Arrays.stream(positionIds.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
String status = request.getParameter("status");
|
||||
if (StringUtils.isNotBlank(status)) {
|
||||
param.setStatus(SalaryEmployeeStatusEnum.parseByValue(Integer.parseInt(status)));
|
||||
}
|
||||
//fixme 日期
|
||||
request.getParameter("dismissDate");
|
||||
String ids = request.getParameter("ids");
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
param.setIds(Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出环比减少人员
|
||||
*/
|
||||
@GET
|
||||
@Path("/reducedemployee/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response exportReducedEmployee(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
SalaryAcctEmployeeQueryParam param = buildSalaryAcctEmployeeQueryParam(request);
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getSalaryAcctExcelWrapper(user).exportReducedEmployee(param);
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = "环比上月减少人员" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
|
||||
/**********************************薪资核算人员相关 end*********************************/
|
||||
|
||||
// @PostMapping("/acctemployee/export")
|
||||
// @ApiOperation("导出人员范围")
|
||||
// @WeaPermission
|
||||
// public WeaResult<Map<String, Object>> exportSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) {
|
||||
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
|
||||
// String tenantKey = TenantContext.getCurrentTenantKey();
|
||||
// String eteamsId = TenantRpcContext.getEteamsId();
|
||||
// Map<String, Object> map = salaryAcctExcelWrapper.exportSalaryAcctEmployee(queryParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// return WeaResult.success(map);
|
||||
// }
|
||||
/**********************************薪资核算结果 start*********************************/
|
||||
|
||||
//薪资核算结果列表
|
||||
@POST
|
||||
@Path("/acctresult/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listSalaryAcctResult(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctResultQueryParam, Map<String, Object>>().run(getSalaryAcctResultWrapper(user)::listPage, param);
|
||||
}
|
||||
|
||||
// @PostMapping("/reducedemployee/export")
|
||||
// @ApiOperation("导出环比减少人员")
|
||||
// @WeaPermission
|
||||
// public WeaResult<Map<String, Object>> exportReducedEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) {
|
||||
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
|
||||
// String tenantKey = TenantContext.getCurrentTenantKey();
|
||||
// String eteamsId = TenantRpcContext.getEteamsId();
|
||||
// Map<String, Object> map = salaryAcctExcelWrapper.exportReducedEmployee(queryParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// return WeaResult.success(map);
|
||||
// }
|
||||
|
||||
// /**********************************薪资核算人员相关 end*********************************/
|
||||
//
|
||||
// /**********************************薪资核算结果 start*********************************/
|
||||
//
|
||||
// @PostMapping("/acctresult/list")
|
||||
// @ApiOperation(("薪资核算结果列表"))
|
||||
// @WeaPermission
|
||||
// public WeaResult<WeaTable<Map<String, Object>>> listSalaryAcctResult(@RequestBody @Validated SalaryAcctResultQueryParam queryParam) {
|
||||
// WeaTable<Map<String, Object>> weaTable = salaryAcctResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(weaTable);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/acctresult/getSearchCondition")
|
||||
// @ApiOperation(("获取薪资核算结果高级搜索"))
|
||||
// @WeaPermission
|
||||
|
|
@ -236,50 +326,67 @@ public class SalaryAcctController {
|
|||
// WeaSearchCondition searchCondition = salaryAcctResultWrapper.getSearchCondition(TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(searchCondition);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/acctresult/detail")
|
||||
// @ApiOperation(("薪资核算结果详情"))
|
||||
// @WeaPermission
|
||||
// public WeaResult<SalaryAcctResultDetailDTO> getSalaryAcctResultDetail(@RequestParam(value = "id") Long id) {
|
||||
// SalaryAcctResultDetailDTO dto = salaryAcctResultWrapper.getForm(id, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(dto);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/acctresult/getConsolidatedTaxDetail")
|
||||
// @ApiOperation(("薪资核算合并计税详情"))
|
||||
// @WeaPermission
|
||||
// public WeaResult<ConsolidatedTaxDetailDTO> getConsolidatedTaxDetail(@RequestParam(value = "salaryAcctEmpId") Long salaryAcctEmpId) {
|
||||
// ConsolidatedTaxDetailDTO dto = salaryAcctResultWrapper.getConsolidatedTaxDetail(salaryAcctEmpId, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(dto);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/acctresult/save")
|
||||
// @ApiOperation(("编辑薪资核算结果"))
|
||||
// @WeaPermission
|
||||
// public WeaResult<Object> saveSalaryAcctResult(@RequestBody @Validated SalaryAcctResultSaveParam saveParam) {
|
||||
// salaryAcctResultWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(null);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/acctresult/accounting")
|
||||
// @ApiOperation("薪资核算")
|
||||
// @WeaPermission
|
||||
// public WeaResult<String> accounting(@RequestBody @Validated SalaryAcctCalculateParam acctParam) {
|
||||
// salaryAcctResultWrapper.calculate(acctParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success("");
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/acctresult/export")
|
||||
// @ApiOperation("导出核算结果")
|
||||
// @WeaPermission
|
||||
// public WeaResult<Map<String, Object>> exportSalaryAcctResult(@RequestBody @Validated SalaryAcctResultQueryParam queryParam) {
|
||||
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
|
||||
// String tenantKey = TenantContext.getCurrentTenantKey();
|
||||
// String eteamsId = TenantRpcContext.getEteamsId();
|
||||
// Map<String, Object> map = salaryAcctExcelWrapper.exportSalaryAcctResult(queryParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// return WeaResult.success(map);
|
||||
// }
|
||||
//
|
||||
|
||||
//薪资核算结果详情
|
||||
@GET
|
||||
@Path("/acctresult/detail")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalaryAcctResultDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, SalaryAcctResultDetailDTO>().run(getSalaryAcctResultWrapper(user)::getForm, id);
|
||||
}
|
||||
|
||||
//薪资核算结果详情
|
||||
@GET
|
||||
@Path("/acctresult/getConsolidatedTaxDetail")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getConsolidatedTaxDetail(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryAcctEmpId") Long salaryAcctEmpId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, ConsolidatedTaxDetailDTO>().run(getSalaryAcctResultWrapper(user)::getConsolidatedTaxDetail, salaryAcctEmpId);
|
||||
}
|
||||
|
||||
//编辑薪资核算结果
|
||||
@POST
|
||||
@Path("/acctresult/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSalaryAcctResult(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultSaveParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctResultSaveParam, String>().run(getSalaryAcctResultWrapper(user)::save, param);
|
||||
}
|
||||
|
||||
//薪资核算
|
||||
@POST
|
||||
@Path("/acctresult/accounting")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String accounting(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctCalculateParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctCalculateParam, String>().run(getSalaryAcctResultWrapper(user)::calculate, param);
|
||||
}
|
||||
|
||||
//导出核算结果
|
||||
@GET
|
||||
@Path("/acctresult/export")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response exportSalaryAcctResult(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
SalaryAcctResultQueryParam param = null;
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getSalaryAcctExcelWrapper(user).exportSalaryAcctResult(param);
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = "薪资核算结果" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
|
||||
// @GetMapping("/acctresult/importField")
|
||||
// @ApiOperation("导入核算结果前生成导入模板时可选的薪资项目")
|
||||
// @WeaPermission
|
||||
|
|
|
|||
|
|
@ -1,193 +1,86 @@
|
|||
//package com.engine.salary.wrapper;
|
||||
//
|
||||
//import com.engine.core.impl.Service;
|
||||
//import com.weaver.common.distribution.genid.IdGenerator;
|
||||
//import com.weaver.common.threadPool.ThreadPoolUtil;
|
||||
//import com.weaver.common.threadPool.constant.ModulePoolEnum;
|
||||
//import com.weaver.common.threadPool.entity.LocalRunnable;
|
||||
//import com.weaver.datasecurity.interceptor.DSTenantKeyThreadVar;
|
||||
//import com.weaver.framework.util.JsonUtil;
|
||||
//import com.weaver.hrm.salary.common.excel.ExcelExportParam;
|
||||
//import com.weaver.hrm.salary.entity.salaryacct.param.*;
|
||||
//import com.weaver.hrm.salary.service.SalaryAcctExcelService;
|
||||
//import com.weaver.teams.domain.EntityType;
|
||||
//import com.weaver.teams.domain.user.SimpleEmployee;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.util.Map;
|
||||
//
|
||||
///**
|
||||
// * 薪资核算导出导出
|
||||
// * <p>Copyright: Copyright (c) 2022</p>
|
||||
// * <p>Company: 泛微软件</p>
|
||||
// *
|
||||
// * @author qiantao
|
||||
// * @version 1.0
|
||||
// **/
|
||||
//public class SalaryAcctExcelWrapper extends Service {
|
||||
//
|
||||
// @Autowired
|
||||
// private SalaryAcctExcelService salaryAcctExcelService;
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算人员导出
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @param simpleEmployee
|
||||
// * @param tenantKey
|
||||
// * @param eteamsId
|
||||
// */
|
||||
// public Map<String, Object> exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam,
|
||||
// SimpleEmployee simpleEmployee, String tenantKey, String eteamsId) {
|
||||
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||
// .setBiz(IdGenerator.generate())
|
||||
// .setModule(EntityType.hrsa.name())
|
||||
// .setFunction("acctEmployeeExportHandler");
|
||||
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||
// @Override
|
||||
// public void execute() {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salaryAcctExcelService.exportSalaryAcctEmployee(excelExportParam, queryParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportSalaryAcctEmployee", localRunnable);
|
||||
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctImportTemplateParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
|
||||
import com.engine.salary.service.SalaryAcctExcelService;
|
||||
import com.engine.salary.service.impl.SalaryAcctExcelServiceImpl;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.hrm.User;
|
||||
|
||||
/**
|
||||
* 薪资核算导出导出
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalaryAcctExcelWrapper extends Service {
|
||||
|
||||
private SalaryAcctExcelService getSalaryAcctExcelService(User user) {
|
||||
return (SalaryAcctExcelService) ServiceUtil.getService(SalaryAcctExcelServiceImpl.class, user);
|
||||
}
|
||||
/**
|
||||
* 薪资核算人员导出
|
||||
*
|
||||
* @param queryParam
|
||||
*/
|
||||
public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) {
|
||||
return getSalaryAcctExcelService(user).exportSalaryAcctEmployee(queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算环比减少人员导出
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public XSSFWorkbook exportReducedEmployee(SalaryAcctEmployeeQueryParam queryParam) {
|
||||
return getSalaryAcctExcelService(user).exportReducedEmployee(queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算结果导出
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public XSSFWorkbook exportSalaryAcctResult(SalaryAcctResultQueryParam queryParam) {
|
||||
return getSalaryAcctExcelService(user).exportSalaryAcctResult(queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载薪资核算导入模板
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public XSSFWorkbook exportImportTemplate(SalaryAcctImportTemplateParam param) {
|
||||
return getSalaryAcctExcelService(user).exportImportTemplate( param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算线下对比结果导出
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
// public Map<String, Object> exportComparisonResult(SalaryComparisonResultQueryParam queryParam) {
|
||||
// return getSalaryAcctExcelService(user).exportComparisonResult(excelExportParam, queryParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算环比减少人员导出
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @param simpleEmployee
|
||||
// * @param tenantKey
|
||||
// * @param eteamsId
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> exportReducedEmployee(SalaryAcctEmployeeQueryParam queryParam,
|
||||
// SimpleEmployee simpleEmployee, String tenantKey, String eteamsId) {
|
||||
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||
// .setBiz(IdGenerator.generate())
|
||||
// .setModule(EntityType.hrsa.name())
|
||||
// .setFunction("reducedEmployeeExportHandler");
|
||||
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||
// @Override
|
||||
// public void execute() {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salaryAcctExcelService.exportReducedEmployee(excelExportParam, queryParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportReducedEmployee", localRunnable);
|
||||
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算结果导出
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @param simpleEmployee
|
||||
// * @param tenantKey
|
||||
// * @param eteamsId
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> exportSalaryAcctResult(SalaryAcctResultQueryParam queryParam,
|
||||
// SimpleEmployee simpleEmployee, String tenantKey, String eteamsId) {
|
||||
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||
// .setBiz(IdGenerator.generate())
|
||||
// .setModule(EntityType.hrsa.name())
|
||||
// .setFunction("salaryAcctResultExportHandler");
|
||||
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||
// @Override
|
||||
// public void execute() {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salaryAcctExcelService.exportSalaryAcctResult(excelExportParam, queryParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportSalaryAcctResult", localRunnable);
|
||||
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 下载薪资核算导入模板
|
||||
// *
|
||||
// * @param param
|
||||
// * @param simpleEmployee
|
||||
// * @param tenantKey
|
||||
// * @param eteamsId
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> exportImportTemplate(SalaryAcctImportTemplateParam param,
|
||||
// SimpleEmployee simpleEmployee, String tenantKey, String eteamsId) {
|
||||
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||
// .setBiz(IdGenerator.generate())
|
||||
// .setModule(EntityType.hrsa.name())
|
||||
// .setFunction("salaryAcctImportTemplateHandler");
|
||||
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||
// @Override
|
||||
// public void execute() {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salaryAcctExcelService.exportImportTemplate(excelExportParam, param, simpleEmployee, tenantKey, eteamsId);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportImportTemplate", localRunnable);
|
||||
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算线下对比结果导出
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @param simpleEmployee
|
||||
// * @param tenantKey
|
||||
// * @param eteamsId
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> exportComparisonResult(SalaryComparisonResultQueryParam queryParam,
|
||||
// SimpleEmployee simpleEmployee, String tenantKey, String eteamsId) {
|
||||
// ExcelExportParam excelExportParam = new ExcelExportParam()
|
||||
// .setBiz(IdGenerator.generate())
|
||||
// .setModule(EntityType.hrsa.name())
|
||||
// .setFunction("comparisonResultHandler");
|
||||
// LocalRunnable localRunnable = new LocalRunnable() {
|
||||
// @Override
|
||||
// public void execute() {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salaryAcctExcelService.exportComparisonResult(excelExportParam, queryParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportComparisonResult", localRunnable);
|
||||
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算线下对比结果导入模板导出
|
||||
// *
|
||||
// * @param exportParam
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
|
||||
/**
|
||||
* 薪资核算线下对比结果导入模板导出
|
||||
*
|
||||
* @param exportParam
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
// public Map<String, Object> exportComparisonResultTemplate(SalaryComparisonResultExportParam exportParam, String tenantKey) {
|
||||
// return salaryAcctExcelService.exportComparisonResultTemplate(exportParam, tenantKey);
|
||||
// return getSalaryAcctExcelService(user).exportComparisonResultTemplate(exportParam, tenantKey);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
|
|
@ -210,7 +103,7 @@
|
|||
// public void execute() {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salaryAcctExcelService.exportCheckResult(excelExportParam, exportParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// getSalaryAcctExcelService(user).exportCheckResult(excelExportParam, exportParam, simpleEmployee, tenantKey, eteamsId);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
|
|
@ -240,7 +133,7 @@
|
|||
// public void execute() {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salaryAcctExcelService.exportCheckResultDetail(excelExportParam, checkResultId, simpleEmployee, tenantKey, eteamsId);
|
||||
// getSalaryAcctExcelService(user).exportCheckResultDetail(excelExportParam, checkResultId, simpleEmployee, tenantKey, eteamsId);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
|
|
@ -249,4 +142,4 @@
|
|||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "exportCheckResultDetail", localRunnable);
|
||||
// return JsonUtil.parseMap(excelExportParam, Object.class);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctResultBO;
|
||||
import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam;
|
||||
|
|
@ -13,17 +13,16 @@ import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam;
|
|||
import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.SalaryAcctRecordService;
|
||||
import com.engine.salary.service.SalaryAcctResultService;
|
||||
import com.engine.salary.service.SalarySobItemService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.weaver.util.threadPool.ThreadPoolUtil;
|
||||
import com.weaver.util.threadPool.constant.ModulePoolEnum;
|
||||
import com.weaver.util.threadPool.entity.LocalRunnable;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -40,40 +39,53 @@ import java.util.Objects;
|
|||
**/
|
||||
public class SalaryAcctResultWrapper extends Service {
|
||||
|
||||
private SalaryAcctResultService getSalaryAcctResultService(User user) {
|
||||
return (SalaryAcctResultService) ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctResultService salaryAcctResultService;
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return (SalaryAcctRecordService) ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return (SalarySobItemService) ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctRecordService salaryAcctRecordService;
|
||||
|
||||
private SalarySobItemService salarySobItemService;
|
||||
|
||||
private SalaryAcctEmployeeWrapper salaryAcctEmployeeWrapper;
|
||||
private SalaryAcctEmployeeWrapper getSalaryAcctEmployeeWrapper(User user) {
|
||||
return (SalaryAcctEmployeeWrapper) ServiceUtil.getService(SalaryAcctEmployeeWrapper.class, user);
|
||||
}
|
||||
|
||||
// private SalaryAcctProgressService salaryAcctProgressService;
|
||||
|
||||
// private SalaryCheckResultService salaryCheckResultService;
|
||||
|
||||
private TaxAgentService taxAgentService;
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return (TaxAgentService) ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctExcelService getSalaryAcctExcelService(User user) {
|
||||
return (SalaryAcctExcelService) ServiceUtil.getService(SalaryAcctExcelServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算列表
|
||||
*
|
||||
* @param queryParam 列表查询条件
|
||||
* @param tenantKey 租户key
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> listPage(SalaryAcctResultQueryParam queryParam, String tenantKey) {
|
||||
public Map<String,Object> listPage(SalaryAcctResultQueryParam queryParam) {
|
||||
ValidUtil.doValidator(queryParam);
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = salaryAcctRecordService.getById(queryParam.getSalaryAcctRecordId());
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
|
||||
// 查询薪资核算结果(分页)
|
||||
PageInfo<Map<String, Object>> page = salaryAcctResultService.listPageByParam(queryParam);
|
||||
PageInfo<Map<String, Object>> page = getSalaryAcctResultService(user).listPageByParam(queryParam);
|
||||
|
||||
// 构建薪资核算结果列表的表头
|
||||
List<WeaTableColumn> columns = listWeaTableColumn(salaryAcctRecordPO);
|
||||
List<WeaTableColumn> columns = getSalaryAcctExcelService(user).listWeaTableColumn(salaryAcctRecordPO);
|
||||
|
||||
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, SalaryArchiveListDTO.class);
|
||||
table.setColumns(columns);
|
||||
|
|
@ -90,18 +102,7 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建薪资核算结果列表的表头
|
||||
*
|
||||
* @param salaryAcctRecordPO 薪资核算记录
|
||||
* @return
|
||||
*/
|
||||
public List<WeaTableColumn> listWeaTableColumn(SalaryAcctRecordPO salaryAcctRecordPO) {
|
||||
// 查询薪资账套下的薪资项目+员工信息字段
|
||||
SalarySobItemAggregateDTO salarySobItemAggregateDTO = salarySobItemService.getAggregateBySalarySobId(salaryAcctRecordPO.getSalarySobId());
|
||||
// 构建薪资核算结果列表表头
|
||||
return SalaryAcctResultBO.buildTableColumns(salarySobItemAggregateDTO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取薪资核算列表的高级搜索
|
||||
|
|
@ -113,7 +114,7 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
// WeaSearchCondition searchCondition = SalaryFormatUtil.<SalaryAcctResultSearchConditionDTO>getInstance()
|
||||
// .buildCondition(SalaryAcctResultSearchConditionDTO.class, searchConditionDTO, "SalaryAcctResultCondition");
|
||||
// // 查询个税扣缴义务人
|
||||
// List<TaxAgentPO> taxAgentPOS = taxAgentService.listAll(tenantKey);
|
||||
// List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAll(tenantKey);
|
||||
// List<WeaSearchConditionOption> weaSearchConditionOptions = taxAgentPOS.stream()
|
||||
// .map(taxAgentPO -> new WeaSearchConditionOption(String.valueOf(taxAgentPO.getId()), taxAgentPO.getName()))
|
||||
// .collect(Collectors.toList());
|
||||
|
|
@ -136,7 +137,7 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
*/
|
||||
public SalaryAcctResultDetailDTO getForm(Long salaryAcctEmployeeId) {
|
||||
// 获取薪资核算结果详情
|
||||
return salaryAcctResultService.getBySalaryAcctEmployeeId(salaryAcctEmployeeId);
|
||||
return getSalaryAcctResultService(user).getBySalaryAcctEmployeeId(salaryAcctEmployeeId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -147,7 +148,7 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
*/
|
||||
public ConsolidatedTaxDetailDTO getConsolidatedTaxDetail(Long salaryAcctEmployeeId) {
|
||||
// 获取合并计税详情
|
||||
return salaryAcctResultService.getConsolidatedTaxDetail(salaryAcctEmployeeId);
|
||||
return getSalaryAcctResultService(user).getConsolidatedTaxDetail(salaryAcctEmployeeId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -156,18 +157,20 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
* @param saveParam 保存参数
|
||||
*/
|
||||
public void save(SalaryAcctResultSaveParam saveParam) {
|
||||
salaryAcctResultService.save(saveParam);
|
||||
getSalaryAcctResultService(user).save(saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算-核算
|
||||
*
|
||||
* @param calculateParam 薪资核算的参数
|
||||
* @param simpleEmployee 当前登陆人员
|
||||
*/
|
||||
public void calculate(SalaryAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee) {
|
||||
public void calculate(SalaryAcctCalculateParam calculateParam) {
|
||||
//当前登陆人员
|
||||
DataCollectionEmployee simpleEmployee = new DataCollectionEmployee();
|
||||
simpleEmployee.setEmployeeId((long)user.getUID());
|
||||
// 检查薪资核算人员的个税扣缴义务人
|
||||
salaryAcctEmployeeWrapper.checkTaxAgent(calculateParam.getSalaryAcctRecordId());
|
||||
getSalaryAcctEmployeeWrapper(user).checkTaxAgent(calculateParam.getSalaryAcctRecordId());
|
||||
// 检查是否正在核算中
|
||||
// SalaryAcctProgressDTO salaryAcctProgressDTO = salaryAcctProgressService.getProgress("" + calculateParam.getSalaryAcctRecordId(), simpleEmployee.getEmployeeId(), tenantKey);
|
||||
// if (Objects.nonNull(salaryAcctProgressDTO) && salaryAcctProgressDTO.isStatus() && Optional.ofNullable(salaryAcctProgressDTO.getProgress()).orElse(BigDecimal.ZERO).compareTo(BigDecimal.ONE) < 0) {
|
||||
|
|
@ -187,7 +190,7 @@ public class SalaryAcctResultWrapper extends Service {
|
|||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
salaryAcctResultService.calculate(calculateParam, simpleEmployee);
|
||||
getSalaryAcctResultService(user).calculate(calculateParam, simpleEmployee);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "salaryAcctCalculate", localRunnable);
|
||||
|
|
|
|||
Loading…
Reference in New Issue