Merge branch 'feature/report1110' into release/2.1.3.2211.03
# Conflicts: # src/com/engine/salary/sys/entity/param/AppSettingSaveParam.java # src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java
This commit is contained in:
commit
f5622df8fe
|
|
@ -1,12 +1,14 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryformula.po.FormulaVar;
|
||||
import com.engine.salary.enums.salaryformula.ReferenceTypeEnum;
|
||||
import com.engine.salary.formlua.entity.parameter.DataType;
|
||||
import com.engine.salary.service.FormulaRunService;
|
||||
import com.engine.salary.sys.enums.OpenEnum;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
@ -56,6 +58,8 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
|||
String extendParam = expressFormula.getExtendParam();
|
||||
String sqlReturnKey = "";
|
||||
String datasourceId = "";
|
||||
String openDecrypt = "";
|
||||
String result = "";
|
||||
try {
|
||||
JsonNode jsonNode = objectMapper.readTree(extendParam);
|
||||
//返回值配置
|
||||
|
|
@ -71,6 +75,11 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
|||
datasourceId = datasourceIdNode.asText();
|
||||
}
|
||||
}
|
||||
//是否需要解密
|
||||
JsonNode decrypt = jsonNode.get("openDecrypt");
|
||||
if (decrypt != null) {
|
||||
openDecrypt = decrypt.asText().trim();
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error("express execute fail, sql extendParam parse fail", e);
|
||||
}
|
||||
|
|
@ -89,18 +98,22 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
|
|||
RecordSetDataSource rs = new RecordSetDataSource(datasourceId);
|
||||
if (rs.executeSql(sql)) {
|
||||
if (rs.next()) {
|
||||
return rs.getString(sqlReturnKey);
|
||||
result = rs.getString(sqlReturnKey);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
RecordSet rs = new RecordSet();
|
||||
if (rs.execute(sql)) {
|
||||
if (rs.next()) {
|
||||
return rs.getString(sqlReturnKey);
|
||||
result = rs.getString(sqlReturnKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
|
||||
if (OpenEnum.OPEN.getValue().equals(openDecrypt)) {
|
||||
result = AESEncryptUtil.decrypt(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Object runFormula(ExpressFormula expressFormula, List<FormulaVar> formulaVars) throws Exception {
|
||||
|
|
|
|||
|
|
@ -198,7 +198,19 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
if (salaryItemIdKeySalarySobItemPOMap.containsKey(salaryItemId)) {
|
||||
// 转换成薪资核算结果po
|
||||
SalaryAcctResultTempPO salaryAcctResultTempPO = new SalaryAcctResultTempPO()
|
||||
.setSalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId()).setSalaryAcctEmpId(salaryAcctEmployeePO.getId()).setEmployeeId(salaryAcctEmployeePO.getEmployeeId()).setTaxAgentId(salaryAcctEmployeePO.getTaxAgentId()).setSalarySobId(salaryAcctEmployeePO.getSalarySobId()).setSalaryItemId(salaryItemPO.getId()).setResultValue(resultValue).setCalculateKey(salaryAcctCalculateBO.getCalculateKey()).setCreator((long) user.getUID()).setCreateTime(now).setUpdateTime(now).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setDeleteType(0);
|
||||
.setSalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId())
|
||||
.setSalaryAcctEmpId(salaryAcctEmployeePO.getId())
|
||||
.setEmployeeId(salaryAcctEmployeePO.getEmployeeId())
|
||||
.setTaxAgentId(salaryAcctEmployeePO.getTaxAgentId())
|
||||
.setSalarySobId(salaryAcctEmployeePO.getSalarySobId())
|
||||
.setSalaryItemId(salaryItemPO.getId())
|
||||
.setResultValue(resultValue)
|
||||
.setCalculateKey(salaryAcctCalculateBO.getCalculateKey())
|
||||
.setCreator((long) user.getUID())
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now)
|
||||
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.setDeleteType(0);
|
||||
salaryAcctResultTempPOS.add(salaryAcctResultTempPO);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,27 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.report.SalaryAcctResultReportPOEncrypt;
|
||||
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
|
||||
import com.engine.salary.mapper.report.SalaryAcctResultReportMapper;
|
||||
import com.engine.salary.service.SalaryAcctReportService;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.enums.OpenEnum;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.DISPLAY_EMP_INFO_REPORT;
|
||||
|
||||
/**
|
||||
* 薪资报表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -28,6 +36,11 @@ public class SalaryAcctReportServiceImpl extends Service implements SalaryAcctRe
|
|||
return MapperProxyFactory.getProxy(SalaryAcctResultReportMapper.class);
|
||||
}
|
||||
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪酬解密方法
|
||||
*
|
||||
|
|
@ -61,7 +74,11 @@ public class SalaryAcctReportServiceImpl extends Service implements SalaryAcctRe
|
|||
@Override
|
||||
public void batchSave(Collection<SalaryAcctResultReportPO> pos) {
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
SalaryAcctResultReportPOEncrypt.encryptList(pos);
|
||||
SalarySysConfPO disPlay = getSalarySysConfService(user).getOneByCode(DISPLAY_EMP_INFO_REPORT);
|
||||
//默认不显示,关闭状态
|
||||
if (disPlay == null || OpenEnum.OFF.getValue().equals(disPlay.getConfValue())) {
|
||||
SalaryAcctResultReportPOEncrypt.encryptList(pos);
|
||||
}
|
||||
// List<List<SalaryAcctResultReportPO>> partition = Lists.partition((List) pos, 100);
|
||||
// partition.forEach(getSalaryAcctResultReportMapper()::batchInsert);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ public class SalarySysConstant {
|
|||
*/
|
||||
public static final String OPEN_ACCT_RESULT_SUM = "OPEN_ACCT_RESULT_SUM";
|
||||
|
||||
/**
|
||||
* 是否显示脱敏表人员信息
|
||||
*/
|
||||
public static final String DISPLAY_EMP_INFO_REPORT = "DISPLAY_EMP_INFO_REPORT";
|
||||
|
||||
/**
|
||||
* 应用设置是否开启加密
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.sys.entity.param;
|
||||
|
||||
import com.engine.salary.sys.enums.OpenEnum;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -32,6 +33,7 @@ public class AppSettingSaveParam {
|
|||
*
|
||||
* @see OpenEnum
|
||||
*/
|
||||
@DataCheck(require = true,message = "是否开启核算结果合计列?")
|
||||
private String openAcctResultSum;
|
||||
|
||||
/**
|
||||
|
|
@ -44,4 +46,11 @@ public class AppSettingSaveParam {
|
|||
*/
|
||||
private String operateTaxDeclaration;
|
||||
|
||||
/**
|
||||
* 是否显示脱敏表人员信息
|
||||
* @see OpenEnum
|
||||
*/
|
||||
@DataCheck(require = true,message = "是否显示脱敏表人员信息?")
|
||||
private String displayEmpInfoReport;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,4 +45,11 @@ public class AppSettingVO {
|
|||
private String isOpenTaxDeclaration;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 是否显示脱敏表人员信息
|
||||
* @see OpenEnum
|
||||
*/
|
||||
private String displayEmpInfoReport;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,5 +73,10 @@ public interface SalarySysConfService {
|
|||
*/
|
||||
Map<String, Object> saveEncryptSetting(AppSettingSaveParam appSettingSaveParam);
|
||||
|
||||
/**
|
||||
* 加密进度
|
||||
* @param progressId
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getEncryptProgress(String progressId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
public void saveAppSetting(AppSettingSaveParam param) {
|
||||
String openAcctResultSum = param.getOpenAcctResultSum();
|
||||
saveSettingByType(openAcctResultSum, OPEN_ACCT_RESULT_SUM, "开启核算结果合并", "app");
|
||||
saveSettingByType(param.getDisplayEmpInfoReport(), DISPLAY_EMP_INFO_REPORT, "是否显示脱敏表人员信息", "app");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -436,6 +437,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
case TAX_DECLARATION_FUNCTION:
|
||||
appSettingVO.setIsOpenTaxDeclaration(salarySysConfPO.getConfValue());
|
||||
break;
|
||||
case DISPLAY_EMP_INFO_REPORT:
|
||||
appSettingVO.setDisplayEmpInfoReport(salarySysConfPO.getConfValue());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -443,7 +447,14 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
}
|
||||
//默认加密开启
|
||||
if (StringUtils.isEmpty(appSettingVO.getIsOpenEncrypt())) {
|
||||
appSettingVO.setIsOpenEncrypt("1");
|
||||
appSettingVO.setIsOpenEncrypt(OpenEnum.OPEN.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认不显示
|
||||
*/
|
||||
if (StringUtils.isEmpty(appSettingVO.getDisplayEmpInfoReport())) {
|
||||
appSettingVO.setDisplayEmpInfoReport(OpenEnum.OFF.getValue());
|
||||
}
|
||||
// 默认开启报税功能
|
||||
if(StringUtils.isEmpty(appSettingVO.getIsOpenTaxDeclaration())){
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import com.engine.salary.util.page.SalaryPageUtil;
|
|||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import tebie.applib.api.O;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -134,7 +133,6 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
}
|
||||
|
||||
public Map<String, Object> saveEncryptSetting(AppSettingSaveParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
return getSalarySysConfService(user).saveEncryptSetting(param);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue