diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 47e0741f7..69b12aa04 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -504,7 +504,12 @@ public class SIAccountBiz extends Service { //TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); String billMonth = param.getBillMonth(); try { - List list = getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization()); +// List list = getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization()); + List list = new ArrayList<>(); + List> partitionDetailTempInfo = Lists.partition((List) ids, 100); + partitionDetailTempInfo.forEach(part -> list.addAll( + getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(part, billMonth, param.getPaymentOrganization()))); + encryptUtil.decryptList(list, InsuranceAccountDetailTempPO.class); Integer paymentStatus = 0; log.info("核算明细临时表 hrsa_bill_detail_temp待处理数量:{}", list.size()); diff --git a/src/com/engine/salary/service/impl/FormulaRunServiceImpl.java b/src/com/engine/salary/service/impl/FormulaRunServiceImpl.java index 615c148eb..40edf009b 100644 --- a/src/com/engine/salary/service/impl/FormulaRunServiceImpl.java +++ b/src/com/engine/salary/service/impl/FormulaRunServiceImpl.java @@ -11,9 +11,7 @@ import com.engine.salary.formlua.entity.parameter.DataType; import com.engine.salary.formlua.entity.standard.ExcelResult; 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; +import com.engine.salary.util.JsonUtil; import com.ql.util.express.DefaultContext; import com.ql.util.express.ExpressRunner; import lombok.extern.slf4j.Slf4j; @@ -35,8 +33,6 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService private static ExpressRunner runner = new ExpressRunner(true, false); - private static final ObjectMapper objectMapper = new ObjectMapper(); - private final BaseBean baseBean = new BaseBean(); private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log")); @@ -85,24 +81,25 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService String openDecrypt = ""; String result = ""; try { - JsonNode jsonNode = objectMapper.readTree(extendParam); + Map map = JsonUtil.parseMap(extendParam, String.class); //返回值配置 - JsonNode sqlReturnKeyNode = jsonNode.get("sqlReturnKey"); - if (sqlReturnKeyNode != null) { - sqlReturnKey = sqlReturnKeyNode.asText().trim(); + sqlReturnKey = map.getOrDefault("sqlReturnKey", ""); + if (StringUtils.isNotBlank(sqlReturnKey)) { + sqlReturnKey = sqlReturnKey.trim(); } //数据源配置 - JsonNode datasourceNode = jsonNode.get("datasource"); - if (datasourceNode != null) { - JsonNode datasourceIdNode = datasourceNode.get("datasourceId"); - if (datasourceIdNode != null) { - datasourceId = datasourceIdNode.asText(); + String datasourceJson = map.getOrDefault("datasource", ""); + if (StringUtils.isNotBlank(datasourceJson)) { + Map datasourceIdMap = JsonUtil.parseMap(datasourceJson, String.class); + String datasourceIdNode = datasourceIdMap.getOrDefault("datasourceId",""); + if (StringUtils.isNotBlank(datasourceIdNode)) { + datasourceId = datasourceIdNode; } } //是否需要解密 - JsonNode decrypt = jsonNode.get("openDecrypt"); - if (decrypt != null) { - openDecrypt = decrypt.asText().trim(); + String decrypt = map.get("openDecrypt"); + if (StringUtils.isNotBlank(decrypt)) { + openDecrypt = decrypt.trim(); } //解析sql @@ -155,23 +152,23 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService private ExcelResult runFormula(ExpressFormula expressFormula, List formulaVars) { + if (isLog) { + log.info("FORMULA ExpressFormula {} {}", expressFormula.getFormula(), expressFormula.getFormulaRunScript()); + } + //是否是自定义函数 boolean isCustomFunction = true; String extendParam = expressFormula.getExtendParam(); try { - JsonNode jsonNode = objectMapper.readTree(extendParam); + Map map = JsonUtil.parseMap(extendParam, String.class); //返回值配置 - JsonNode isCustomFunctionNode = jsonNode.get("isCustomFunction"); - if (isCustomFunctionNode != null) { - isCustomFunction = StringUtils.equals(isCustomFunctionNode.asText().trim(), "1"); + String isCustomFunctionNode = map.getOrDefault("isCustomFunction", ""); + if (StringUtils.isNotBlank(isCustomFunctionNode)) { + isCustomFunction = StringUtils.equals(isCustomFunctionNode.trim(), "1"); } - } catch (JsonProcessingException e) { - log.error("express execute fail, sql extendParam parse fail", e); - } - - if (isLog) { - log.info("FORMULA ExpressFormula {} {}", expressFormula.getFormula(), expressFormula.getFormulaRunScript()); + } catch (Exception e) { + log.error("express execute fail, extendParam parse fail {}", extendParam, e); } String formula = expressFormula.getFormulaRunScript(); diff --git a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java index 401a761d7..3e34a2715 100644 --- a/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryFormulaServiceImpl.java @@ -18,11 +18,9 @@ import com.engine.salary.mapper.formula.FormulaVarMapper; import com.engine.salary.service.FormulaRunService; import com.engine.salary.service.RemoteExcelService; import com.engine.salary.service.SalaryFormulaService; +import com.engine.salary.util.JsonUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.valid.ValidUtil; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; @@ -47,7 +45,6 @@ import java.util.stream.Collectors; **/ @Slf4j public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaService { - private static final ObjectMapper objectMapper = new ObjectMapper(); private FormulaMapper getFormulaMapper() { return MapperProxyFactory.getProxy(FormulaMapper.class); @@ -171,12 +168,9 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe String sqlReturnKey = ""; try { - JsonNode jsonNode = objectMapper.readTree(extendParam); - JsonNode sqlReturnKeyNode = jsonNode.get("sqlReturnKey"); - if (sqlReturnKeyNode != null) { - sqlReturnKey = sqlReturnKeyNode.asText(); - } - } catch (JsonProcessingException e) { + Map map = JsonUtil.parseMap(extendParam, String.class); + sqlReturnKey = map.getOrDefault("sqlReturnKey", ""); + } catch (Exception e) { log.error("express execute fail, sql extendParam parse fail", e); } diff --git a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java index 98d9815a5..0f03e2906 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java @@ -74,7 +74,7 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt // 控件数据 Map data = new HashMap<>(); - data.put("effectiveTime", effectiveTime + ""); + data.put("effectiveTime", effectiveTime == null ? null : effectiveTime + ""); data.put("adjustReason", adjustReason); data.put("description", description); data.put("adjustReasonList", SalaryArchiveItemAdjustReasonEnum.getList());