Merge branch 'release/2.14.2.2405.02' into custom/宁波精华
This commit is contained in:
commit
c098dc1d1f
|
|
@ -32,3 +32,14 @@ update hrsa_other_archives set delete_type=3 WHERE employee_id = ? and payment_
|
|||
|
||||
-- 删除薪资档案
|
||||
update hrsa_salary_archive set delete_type=3 where employee_id = ? and tax_agent_id=?
|
||||
|
||||
|
||||
update hrsa_salary_archive set delete_type=3;
|
||||
update hrsa_insurance_base_info set delete_type=3;
|
||||
update hrsa_social_archives set delete_type=3;
|
||||
update hrsa_fund_archives set delete_type=3;
|
||||
update hrsa_other_archives set delete_type=3;
|
||||
update hrsa_tax_agent_emp set delete_type=3;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,3 +8,14 @@ left join hrsa_salary_acct_result result on record.id = result.salary_acct_recor
|
|||
left join hrsa_salary_item item on result.salary_item_id = item.id and item.delete_type = 0
|
||||
left join hrsa_tax_agent agent on agent.id=sob.tax_agent_id and agent.delete_type=0
|
||||
left join hrmresource e on e.id= result.employee_id
|
||||
|
||||
|
||||
# 获取档案信息
|
||||
|
||||
select i.item_value from hrsa_salary_archive_item i
|
||||
left join hrsa_salary_archive a on a.id = i.salary_archive_id
|
||||
left join hrsa_salary_item c on c.id=i.salary_item_id
|
||||
left join hrsa_tax_agent t on a.tax_agent_id=t.id
|
||||
where a.delete_type=0 and i.delete_type=0 and t.delete_type=0 and c.delete_type=0
|
||||
and a.employee_id=$main.ygid$ and t.name='$main.dzqgskjywr$'
|
||||
and effective_time <= now() and c.name='基本工资' order by effective_time desc
|
||||
|
|
@ -112,23 +112,23 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
|
||||
@Override
|
||||
public void calculate(SalaryAcctCalculateBO salaryAcctCalculateBO, DataCollectionEmployee simpleEmployee, List<SalarySobBackItemPO> salarySobBackItems) {
|
||||
StopWatch sw = new StopWatch(salaryAcctCalculateBO.getSalaryAcctRecordPO().getId()+"");
|
||||
StopWatch sw = new StopWatch("核算耗时明细,id:"+salaryAcctCalculateBO.getSalaryAcctRecordPO().getId()+"");
|
||||
Date now = new Date();
|
||||
try {
|
||||
// 数据库字段加密用
|
||||
// 1、查询人员信息
|
||||
sw.start("核算耗时查询人员信息");
|
||||
sw.start("查询人员信息");
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
|
||||
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
|
||||
SalarySobCycleDTO salarySobCycleDTO = salaryAcctCalculateBO.getSalarySobCycleDTO();
|
||||
Long taxAgentId = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentId();
|
||||
sw.stop();
|
||||
// 2、查询薪资档案的数据
|
||||
sw.start("核算耗时查询薪资档案的数据");
|
||||
sw.start("查询薪资档案的数据");
|
||||
List<SalaryArchiveDataDTO> salaryArchiveData = getSalaryArchiveService(user).getSalaryArchiveData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentId);
|
||||
sw.stop();
|
||||
// 3、查询往期累计情况(查询的是上个税款所属期的的累计情况)
|
||||
sw.start("核算耗时查询往期累计情况");
|
||||
sw.start("查询往期累计情况");
|
||||
List<AddUpSituation> addUpSituationPOS;
|
||||
if (salarySobCycleDTO.getTaxCycle().getMonth() == Month.JANUARY) {
|
||||
// 3.1、如果当前税款所属期是本年度第一个税款所属期,就不需要查询往期累计情况
|
||||
|
|
@ -138,28 +138,28 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
}
|
||||
sw.stop();
|
||||
// 4、查询累计专项附加扣除
|
||||
sw.start("核算耗时查询累计专项附加扣除");
|
||||
sw.start("查询累计专项附加扣除");
|
||||
List<AddUpDeduction> addUpDeductionPOS = getAddUpDeductionService(user).getAddUpDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentId);
|
||||
sw.stop();
|
||||
// 5、查询其他免税扣除
|
||||
sw.start("核算耗时查询其他免税扣除");
|
||||
sw.start("查询其他免税扣除");
|
||||
List<OtherDeductionPO> otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentId);
|
||||
sw.stop();
|
||||
//6、查询社保福利
|
||||
sw.start("核算耗时查询社保福利");
|
||||
sw.start("查询社保福利");
|
||||
List<Map<String, Object>> welfareData = getSIAccountService(user).welfareData(salarySobCycleDTO.getSocialSecurityCycle().toString(), employeeIds, taxAgentId);
|
||||
sw.stop();
|
||||
// 7、查询考勤数据
|
||||
sw.start("核算耗时查询考勤数据");
|
||||
sw.start("查询考勤数据");
|
||||
List<AttendQuoteDataDTO> attendQuoteDataDTOS = getAttendQuoteDataService(user).getAttendQuoteData(salarySobCycleDTO.getSalaryMonth(), salarySobCycleDTO.getSalarySobId(), employeeIds);
|
||||
sw.stop();
|
||||
// 8、查询薪资核算人员的薪资核算结果
|
||||
sw.start("核算耗时查询薪资核算人员的薪资核算结果");
|
||||
sw.start("查询薪资核算人员的薪资核算结果");
|
||||
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList());
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||
sw.stop();
|
||||
// 薪资回算时回算前的核算结果 (没有回算项)
|
||||
sw.start("核算耗时查询薪资回算时回算前的核算结果");
|
||||
sw.start("查询薪资回算时回算前的核算结果");
|
||||
Map<String, List<SalaryAcctResultPO>> collect = salaryAcctResultPOS.stream().collect(Collectors.groupingBy(k -> k.getEmployeeId() + "-" + k.getTaxAgentId() + "-" + k.getSalaryItemId()));
|
||||
Map<String, String> salaryAcctResultPOMap = new HashMap<>();
|
||||
for (Map.Entry<String, List<SalaryAcctResultPO>> et : collect.entrySet()) {
|
||||
|
|
@ -170,22 +170,22 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
List<Long> lockSalaryItemIds = ListUtils.emptyIfNull(salaryAcctCalculateBO.getLockSalaryItemIds());
|
||||
sw.stop();
|
||||
// 9、查询相同税款所属期内涉及合并计税的其他薪资核算结果
|
||||
sw.start("核算耗时查询相同税款所属期内涉及合并计税的其他薪资核算结果");
|
||||
sw.start("查询相同税款所属期内涉及合并计税的其他薪资核算结果");
|
||||
Set<Long> otherSalaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getOtherSalaryAcctRecordPOS(), SalaryAcctRecordPO::getId);
|
||||
List<SalaryAcctResultPO> otherSalaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds);
|
||||
Map<String, List<SalaryAcctResultPO>> otherSalaryAcctResultPOMap = SalaryEntityUtil.group2Map(otherSalaryAcctResultPOS, e -> e.getEmployeeId() + "_" + e.getTaxAgentId());
|
||||
sw.stop();
|
||||
// 9.1、查询相同税款所属期内设计合并计税的其他薪资核算人员
|
||||
sw.start("核算耗时查询相同税款所属期内设计合并计税的其他薪资核算人员");
|
||||
sw.start("查询相同税款所属期内设计合并计税的其他薪资核算人员");
|
||||
List<SalaryAcctEmployeePO> otherSalaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds);
|
||||
Map<String, List<SalaryAcctEmployeePO>> otherSalaryAcctEmployeePOMap = SalaryEntityUtil.group2Map(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
sw.stop();
|
||||
// 10、转换成公式编辑器中的变量
|
||||
sw.start("核算耗时转换成公式编辑器中的变量");
|
||||
sw.start("转换成公式编辑器中的变量");
|
||||
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS);
|
||||
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
||||
sw.stop();
|
||||
sw.start("核算耗时数据结构准备");
|
||||
sw.start("数据结构准备");
|
||||
// 本次薪资核算所用的薪资账套下的薪资项目
|
||||
Map<Long, SalarySobItemPO> salaryItemIdKeySalarySobItemPOMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalarySobItemPOS(), SalarySobItemPO::getSalaryItemId);
|
||||
// 本次薪资核算所用的公式
|
||||
|
|
@ -198,7 +198,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
List<SalaryAcctResultTempPO> salaryAcctResultTempPOS = Lists.newArrayList();
|
||||
sw.stop();
|
||||
// 开始核算
|
||||
sw.start("核算耗时核算耗时");
|
||||
sw.start("核算耗时");
|
||||
StringBuffer noticeMsg = new StringBuffer();
|
||||
for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) {
|
||||
Long salaryAcctEmployeePOId = salaryAcctEmployeePO.getId();
|
||||
|
|
@ -290,7 +290,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
}
|
||||
sw.stop();
|
||||
// 保存新的薪资核算结果(临时存储)
|
||||
sw.start("核算耗时保存新的薪资核算结果(临时存储)");
|
||||
sw.start("保存新的薪资核算结果(临时存储)");
|
||||
getSalaryAcctResultTempService(user).batchSave(salaryAcctResultTempPOS);
|
||||
sw.stop();
|
||||
// 更新薪资核算进度
|
||||
|
|
@ -300,7 +300,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
noticeMsg.toString()
|
||||
);
|
||||
sw.stop();
|
||||
log.info("核算耗时明细" + sw.prettyPrint());
|
||||
log.info(sw.prettyPrint());
|
||||
// 记录子线程执行结果
|
||||
salaryAcctCalculateBO.getResults().add(new SalaryAcctCalculateBO.Result(true, StringUtils.EMPTY));
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -721,9 +721,9 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
|
||||
@Override
|
||||
public void calculate(SalaryAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee) {
|
||||
StopWatch stopWatch = new StopWatch(calculateParam.getSalaryAcctRecordId() + "");
|
||||
StopWatch stopWatch = new StopWatch("总核算耗时,id:"+calculateParam.getSalaryAcctRecordId());
|
||||
try {
|
||||
stopWatch.start("核算总耗时数据准备");
|
||||
stopWatch.start("数据准备");
|
||||
// 1、查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(calculateParam.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
|
|
@ -791,7 +791,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
}
|
||||
|
||||
stopWatch.stop();
|
||||
stopWatch.start("核算完毕计时");
|
||||
stopWatch.start("核算耗时");
|
||||
|
||||
// 11.1、初始化进度
|
||||
ProgressDTO initProgress = new ProgressDTO().setTitle(SalaryI18nUtil.getI18nLabel(97515, "核算中")).setTitleLabelId(97515L).setTotalQuantity(salaryAcctEmployeePOS.size() * 2 + 1).setCalculatedQuantity(0).setProgress(BigDecimal.ZERO).setStatus(true).setMessage(StringUtils.EMPTY);
|
||||
|
|
@ -841,7 +841,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
childMonitor.await();
|
||||
|
||||
stopWatch.stop();
|
||||
stopWatch.start("核算入库计时");
|
||||
stopWatch.start("数据写入耗时");
|
||||
|
||||
// 14、判断子线程执行结果
|
||||
boolean allSuccess = calculateResults.stream().allMatch(SalaryAcctCalculateBO.Result::isStatus);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import weaver.common.MessageUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
|
@ -957,7 +958,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
try {
|
||||
Method method = salaryFormulaEmployeeDTO.getClass().getMethod(getter);
|
||||
Object invoke = method.invoke(salaryFormulaEmployeeDTO);
|
||||
e.setSalaryItemValue(invoke.toString());
|
||||
e.setSalaryItemValue(Util.null2String(invoke));
|
||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
log.error("no such method", e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@ package com.engine.salary.util.pdf;
|
|||
import com.engine.workflow.biz.requestForm.HtmlToPdfInterceptor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
@Slf4j
|
||||
public class HtmlToPdf {
|
||||
|
|
@ -11,9 +14,9 @@ public class HtmlToPdf {
|
|||
/**
|
||||
* html转pdf
|
||||
*
|
||||
* @param toPdfTool 工具路径
|
||||
* @param srcPath html路径,可以是硬盘上的路径,也可以是网络路径
|
||||
* @param destPath pdf保存路径
|
||||
* @param toPdfTool 工具路径
|
||||
* @param srcPath html路径,可以是硬盘上的路径,也可以是网络路径
|
||||
* @param destPath pdf保存路径
|
||||
* @return 转换成功返回true
|
||||
*/
|
||||
public static boolean convert(String toPdfTool, String srcPath, String destPath) {
|
||||
|
|
@ -45,8 +48,26 @@ public class HtmlToPdf {
|
|||
HtmlToPdfInterceptor output = new HtmlToPdfInterceptor(proc.getInputStream());
|
||||
error.start();
|
||||
output.start();
|
||||
proc.waitFor();
|
||||
|
||||
BufferedInputStream err = new BufferedInputStream(proc.getErrorStream());
|
||||
BufferedReader errBr = new BufferedReader(new InputStreamReader(err));
|
||||
String lineStr = "";
|
||||
while ((lineStr = errBr.readLine()) != null) {
|
||||
//检查命令是否执行失败。
|
||||
log.info("pdf转换执行中! {}", lineStr);
|
||||
}
|
||||
if (proc.waitFor() != 0) {
|
||||
//p.exitValue()==0表示正常结束,1:非正常结束
|
||||
if (proc.exitValue() == 1) {
|
||||
log.error("pdf转换命令执行失败!");
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
log.error("pdf转换出错!", e);
|
||||
e.printStackTrace();
|
||||
result = false;
|
||||
} catch (Exception e) {
|
||||
log.error("pdf转换出错!", e);
|
||||
result = false;
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue