|
@@ -6,17 +6,21 @@ package com.tofly.workflow.baseconf.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.tofly.common.oauth.exception.ToflyDeniedException;
|
|
|
import com.tofly.workflow.baseconf.entity.ContractConfig;
|
|
|
import com.tofly.workflow.baseconf.entity.ContractConfigField;
|
|
|
import com.tofly.workflow.baseconf.entity.TfContractFieldP;
|
|
|
+import com.tofly.workflow.baseconf.entity.TfContractTemplateP;
|
|
|
+import com.tofly.workflow.baseconf.entity.dto.QueryConfigDto;
|
|
|
+import com.tofly.workflow.baseconf.entity.vo.SingleDataVo;
|
|
|
import com.tofly.workflow.baseconf.menum.ContractConfigTypeEnum;
|
|
|
import com.tofly.workflow.baseconf.service.ContractConfigFieldService;
|
|
|
import com.tofly.workflow.baseconf.service.ContractConfigService;
|
|
|
import com.tofly.workflow.baseconf.service.TfContractFieldPService;
|
|
|
+import com.tofly.workflow.baseconf.service.TfContractTemplatePService;
|
|
|
import com.tofly.workflow.buss.entity.TfProjectBaseW;
|
|
|
import com.tofly.workflow.buss.entity.vo.ContractConfigFieldVo;
|
|
|
import com.tofly.workflow.buss.entity.vo.ContractConfigTableVo;
|
|
@@ -27,15 +31,13 @@ import com.tofly.workflow.utils.compute.StrParaReplace;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.tofly.workflow.baseconf.mapper.ContractConfigMapper;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
* 合同计算配置信息
|
|
@@ -51,27 +53,155 @@ public class ContractConfigServiceImpl extends ServiceImpl<ContractConfigMapper,
|
|
|
private final ContractConfigFieldService contractConfigFieldService;
|
|
|
|
|
|
private final TfContractFieldPService tfContractFieldPService;
|
|
|
+ private final TfContractTemplatePService tfContractTemplatePService;
|
|
|
|
|
|
@Override
|
|
|
public List<ContractConfigFieldVo> paraReplace(Long processId,ContractConfig contractConfig, TfProjectBaseW tfProjectBaseW ) {
|
|
|
List<ContractConfigFieldVo> list = new ArrayList<>();
|
|
|
final Map<String, ContractConfigFieldVo> stringObjectMap = obtainParaAndValue(contractConfig, processId, tfProjectBaseW);
|
|
|
- for (ContractConfigFieldVo value : stringObjectMap.values()) {
|
|
|
- list.add(value);
|
|
|
+
|
|
|
+ if(stringObjectMap!=null){
|
|
|
+ for (ContractConfigFieldVo value : stringObjectMap.values()) {
|
|
|
+ list.add(value);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }else {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void copyConfig(Long sourceConfigId, String targetTempletIds) {
|
|
|
+ final String[] templeteIds = targetTempletIds.split(",");
|
|
|
+ final ContractConfig contractConfig = this.getById(sourceConfigId);
|
|
|
+ final List<ContractConfigField> list = contractConfigFieldService.list(Wrappers.
|
|
|
+ <ContractConfigField>lambdaQuery()
|
|
|
+ .eq(ContractConfigField::getContractConfigId, contractConfig.getId()));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ for (String templeteId : templeteIds) {
|
|
|
+
|
|
|
+ ContractConfig contractConfigCopy = new ContractConfig();
|
|
|
+
|
|
|
+ BeanUtils.copyProperties(contractConfig,contractConfigCopy);
|
|
|
+ final TfContractTemplateP byId = tfContractTemplatePService.getById(templeteId);
|
|
|
+ contractConfigCopy.setId(null);
|
|
|
+ contractConfigCopy.setContractType(byId.getContractType());
|
|
|
+ contractConfigCopy.setTemplateFieldId(Long.valueOf(templeteId));
|
|
|
+ this.saveOrUpdate(contractConfigCopy);
|
|
|
+
|
|
|
+ for (ContractConfigField contractConfigField : list) {
|
|
|
+ contractConfigField.setContractConfigId(contractConfigCopy.getId());
|
|
|
+ contractConfigField.setId(null);
|
|
|
+ contractConfigFieldService.saveOrUpdate(contractConfigField);
|
|
|
+ }
|
|
|
}
|
|
|
- return list;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<SingleDataVo> singleData(QueryConfigDto queryConfigDto) {
|
|
|
+ List<SingleDataVo> list = new ArrayList<>();
|
|
|
+
|
|
|
+ if(StringUtils.isBlank(queryConfigDto.getSourceValue())){
|
|
|
+
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+ ContractConfig contractConfig = new ContractConfig();
|
|
|
+ contractConfig.setTenantId(queryConfigDto.getTenantId());
|
|
|
+ contractConfig.setTemplateFieldId(queryConfigDto.getTemplateFieldId());
|
|
|
+ ContractConfig contractConfig1 = this.getOne(Wrappers.query(contractConfig));
|
|
|
+ if(contractConfig1==null){
|
|
|
+ log.info("该合同未配置对应的模板");
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ final List<ContractConfigField> datas = contractConfigFieldService.list(Wrappers.
|
|
|
+ <ContractConfigField>lambdaQuery()
|
|
|
+ .eq(ContractConfigField::getContractConfigId, contractConfig1.getId())
|
|
|
+ .eq(ContractConfigField::getSourceFieldName, queryConfigDto.getSourceField()));
|
|
|
+
|
|
|
+ if(datas!=null && datas.size()>0){
|
|
|
+ for (ContractConfigField data : datas) {
|
|
|
+ SingleDataVo singleDataVo = new SingleDataVo();
|
|
|
+
|
|
|
+ singleDataVo.setHasValue(Boolean.TRUE);
|
|
|
+ final TfContractFieldP targetField = tfContractFieldPService.getById(data.getTargetFieldId());
|
|
|
+ if(targetField==null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ final Short type = data.getType();
|
|
|
+ String targetValue=null;
|
|
|
+ if(type== ContractConfigTypeEnum.one.getCode()){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }else if(type== ContractConfigTypeEnum.two.getCode()){
|
|
|
+
|
|
|
+ targetValue = queryConfigDto.getSourceValue();
|
|
|
+ }else if(type== ContractConfigTypeEnum.three.getCode()){
|
|
|
+ singleDataVo.setHasValue(Boolean.TRUE);
|
|
|
+ targetValue= MoneyToChineseUtils.convert(Double.valueOf(queryConfigDto.getSourceValue()));
|
|
|
+
|
|
|
+ }else if(type== ContractConfigTypeEnum.four.getCode()){
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ singleDataVo.setTargetFieldId(data.getTargetFieldId());
|
|
|
+ singleDataVo.setTargetField(targetField.getFieldName());
|
|
|
+ singleDataVo.setTargetValue(targetValue);
|
|
|
+ list.add(singleDataVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 通过前端传入的填写数据 以及配置 生成 参数列表
|
|
|
+ * @param contractConfig
|
|
|
+ * @param processId
|
|
|
+ * @param tfProjectBaseW 由前端页传入的 一些基础数据
|
|
|
+ * @return
|
|
|
+ */
|
|
|
private Map<String,ContractConfigFieldVo> obtainParaAndValue(ContractConfig contractConfig,Long processId,TfProjectBaseW tfProjectBaseW ){
|
|
|
|
|
|
ContractConfig contractConfig1 = this.getOne(Wrappers.query(contractConfig));
|
|
|
+ if(contractConfig1==null){
|
|
|
|
|
|
+ log.info("该合同未配置对应的模板");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
final List<ContractConfigField> list = contractConfigFieldService.list(Wrappers.
|
|
|
<ContractConfigField>lambdaQuery()
|
|
|
.eq(ContractConfigField::getContractConfigId, contractConfig1.getId()));
|
|
|
-
|
|
|
|
|
|
- return resolverConfig(list,processId,tfProjectBaseW);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, ContractConfigFieldVo> dataMap= new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ Map<String,Object> configFieldMap=new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ Boolean hasChanged = null;
|
|
|
+ while (hasChanged==null||hasChanged){
|
|
|
+ if(hasChanged==null){
|
|
|
+ hasChanged=Boolean.FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ hasChanged = resolverConfig(dataMap,list, processId, tfProjectBaseW, hasChanged,configFieldMap);
|
|
|
+ log.info("获取到的hasChanged值为{}",hasChanged);
|
|
|
+ }
|
|
|
+ log.info("configFieldMap:"+JSON.toJSONString(configFieldMap));
|
|
|
+
|
|
|
+ return dataMap;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -79,26 +209,47 @@ public class ContractConfigServiceImpl extends ServiceImpl<ContractConfigMapper,
|
|
|
* @param list
|
|
|
*/
|
|
|
|
|
|
- private Map<String,ContractConfigFieldVo> resolverConfig(List<ContractConfigField> list,Long processId,TfProjectBaseW tfProjectBaseW ) {
|
|
|
-
|
|
|
- Map<String,Object> configFieldMap = new HashMap<>();
|
|
|
+ private Boolean resolverConfig(Map<String, ContractConfigFieldVo> targetMap,
|
|
|
+ List<ContractConfigField> list,Long processId,TfProjectBaseW tfProjectBaseW,Boolean hasChanged , Map<String,Object> configFieldMap) {
|
|
|
|
|
|
try {
|
|
|
- putParaIn(configFieldMap,tfProjectBaseW);
|
|
|
+
|
|
|
+ if(!hasChanged){
|
|
|
+ putParaIn(configFieldMap,tfProjectBaseW);
|
|
|
+
|
|
|
+ }
|
|
|
+ hasChanged = Boolean.FALSE;
|
|
|
} catch (IllegalAccessException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- Map<String,ContractConfigFieldVo> targetMap = new HashMap<>();
|
|
|
+ if(targetMap==null){
|
|
|
+ targetMap = new HashMap<>();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
List<ContractConfigField> needCal = new ArrayList<>();
|
|
|
for (ContractConfigField contractConfigField : list) {
|
|
|
+
|
|
|
final Short type = contractConfigField.getType();
|
|
|
|
|
|
final Long targetFieldId = contractConfigField.getTargetFieldId();
|
|
|
final TfContractFieldP targetField = tfContractFieldPService.getById(targetFieldId);
|
|
|
+
|
|
|
+ if(targetMap.containsKey(targetField.getFieldName())){
|
|
|
+ final ContractConfigFieldVo contractConfigFieldVo
|
|
|
+ = targetMap.get(targetField.getFieldName());
|
|
|
+ if(contractConfigFieldVo!=null&&contractConfigFieldVo.getFieldValue() !=null){
|
|
|
+
|
|
|
|
|
|
+ log.info("跳过处理"+contractConfigFieldVo.getFieldName());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
+ }else{
|
|
|
+ log.info("当前处理参数"+targetField.getFieldName());
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
final String sourceFieldName = contractConfigField.getSourceFieldName();
|
|
|
final String sourceTable = contractConfigField.getSourceTable();
|
|
|
ContractConfigFieldVo contractConfigFieldVo = new ContractConfigFieldVo();
|
|
@@ -112,6 +263,8 @@ public class ContractConfigServiceImpl extends ServiceImpl<ContractConfigMapper,
|
|
|
|
|
|
}else if(type==ContractConfigTypeEnum.two.getCode()){
|
|
|
if(( targetValue=configFieldMap.get(sourceFieldName))!=null){
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
|
|
|
if(StringUtils.isEmpty(sourceTable)||StringUtils.isEmpty(sourceFieldName)){
|
|
@@ -120,45 +273,77 @@ public class ContractConfigServiceImpl extends ServiceImpl<ContractConfigMapper,
|
|
|
}
|
|
|
|
|
|
final ConditionSqlVo conditionSqlVo = generateConditionSql(sourceTable);
|
|
|
+ if(!"合同配置模板".equals(sourceTable)){
|
|
|
+ targetValue
|
|
|
+ = baseMapper.getValueByTableNameAndProcessId(sourceTable, StrUtil.toUnderlineCase(sourceFieldName), processId,conditionSqlVo.getJoinSql(),conditionSqlVo.getWhereSql());
|
|
|
+ }else{
|
|
|
+ log.info("合同配置获取字段");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(type==ContractConfigTypeEnum.three.getCode()){
|
|
|
|
|
|
- targetValue
|
|
|
- = baseMapper.getValueByTableNameAndProcessId(sourceTable, StrUtil.toUnderlineCase(sourceFieldName), processId,conditionSqlVo.getJoinSql(),conditionSqlVo.getWhereSql());
|
|
|
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- }else if(type==ContractConfigTypeEnum.three.getCode()){
|
|
|
if(StringUtils.isEmpty(sourceTable)||StringUtils.isEmpty(sourceFieldName)){
|
|
|
log.info("该大小写转换数据未配置源字段sourceTable或者sourceFieldName:"+ JSON.toJSONString(contractConfigField));
|
|
|
throw new RuntimeException("该大小写转换数据未配置源字段sourceTable或者sourceFieldName:"+ JSON.toJSONString(contractConfigField));
|
|
|
}
|
|
|
- final ConditionSqlVo conditionSqlVo = generateConditionSql(sourceTable);
|
|
|
- targetValue = baseMapper.getValueByTableNameAndProcessId(sourceTable, StrUtil.toUnderlineCase(sourceFieldName), processId,conditionSqlVo.getJoinSql(),conditionSqlVo.getWhereSql());
|
|
|
- if(StringUtils.isNotBlank((String)targetValue)){
|
|
|
- targetValue = MoneyToChineseUtils.convert(Double.valueOf((String)targetValue ));
|
|
|
- }else {
|
|
|
- targetValue= MoneyToChineseUtils.convert(0d);
|
|
|
- }
|
|
|
+
|
|
|
+ if(( targetValue=configFieldMap.get(sourceFieldName))!=null){
|
|
|
+
|
|
|
+ log.info("通过{}获取到的大写转换的源数据为{}",sourceFieldName,targetValue);
|
|
|
+ Double aDouble=null;
|
|
|
+ if(targetValue instanceof String){
|
|
|
+ aDouble = Double.valueOf((String)targetValue);
|
|
|
+ }else if(targetValue instanceof Double){
|
|
|
+ aDouble = (Double) targetValue;
|
|
|
+ }
|
|
|
+ if(aDouble!=null){
|
|
|
+ targetValue= MoneyToChineseUtils.convert(aDouble);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(!"合同配置模板".equals(sourceTable)){
|
|
|
+ final ConditionSqlVo conditionSqlVo = generateConditionSql(sourceTable);
|
|
|
+ targetValue = baseMapper.getValueByTableNameAndProcessId(sourceTable, StrUtil.toUnderlineCase(sourceFieldName), processId,conditionSqlVo.getJoinSql(),conditionSqlVo.getWhereSql());
|
|
|
+ if(StringUtils.isNotBlank((String)targetValue)){
|
|
|
+ targetValue = MoneyToChineseUtils.convert(Double.valueOf((String)targetValue ));
|
|
|
+ }else {
|
|
|
+ targetValue= MoneyToChineseUtils.convert(0d);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ log.info("未获取到大写需要的源数据{}",contractConfigFieldVo.getFieldName());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
if(type == ContractConfigTypeEnum.four.getCode()){
|
|
|
needCal.add(contractConfigField);
|
|
|
}else{
|
|
|
- configFieldMap.put(targetField.getFieldName(),targetValue);
|
|
|
- contractConfigFieldVo.setFieldValue(targetValue);
|
|
|
- targetMap.put(targetField.getFieldName(),contractConfigFieldVo);
|
|
|
+ if(targetValue==null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ configFieldMap.put(targetField.getFieldName(),targetValue);
|
|
|
+ contractConfigFieldVo.setFieldValue(targetValue);
|
|
|
+ targetMap.put(targetField.getFieldName(),contractConfigFieldVo);
|
|
|
+
|
|
|
+ hasChanged = Boolean.TRUE;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- fillValueByMath(configFieldMap,targetMap,needCal,processId);
|
|
|
-
|
|
|
-
|
|
|
- return targetMap;
|
|
|
-
|
|
|
+ hasChanged = fillValueByMath(configFieldMap,targetMap,needCal,processId,hasChanged);
|
|
|
+ log.info("计算后的hasChanged值为{}",hasChanged);
|
|
|
+ return hasChanged;
|
|
|
}
|
|
|
|
|
|
private ConditionSqlVo generateConditionSql(String sourceTable) {
|
|
@@ -182,6 +367,12 @@ public class ContractConfigServiceImpl extends ServiceImpl<ContractConfigMapper,
|
|
|
return conditionSqlVo;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 将前端传入的参数 放入
|
|
|
+ * @param configFieldMap
|
|
|
+ * @param tfProjectBaseW
|
|
|
+ * @throws IllegalAccessException
|
|
|
+ */
|
|
|
private void putParaIn(Map<String, Object> configFieldMap, TfProjectBaseW tfProjectBaseW) throws IllegalAccessException {
|
|
|
|
|
|
final Field[] declaredFields = tfProjectBaseW.getClass().getDeclaredFields();
|
|
@@ -200,11 +391,17 @@ public class ContractConfigServiceImpl extends ServiceImpl<ContractConfigMapper,
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void fillValueByMath(Map<String, Object> configFieldMap,Map<String,ContractConfigFieldVo> targetMap ,
|
|
|
- List<ContractConfigField> needCal,Long processId) {
|
|
|
+ public Boolean fillValueByMath(Map<String, Object> configFieldMap,Map<String,ContractConfigFieldVo> targetMap ,
|
|
|
+ List<ContractConfigField> needCal,Long processId,Boolean hasChanged ) {
|
|
|
+
|
|
|
for (ContractConfigField contractConfigField : needCal) {
|
|
|
+
|
|
|
final Long targetFieldId = contractConfigField.getTargetFieldId();
|
|
|
final TfContractFieldP targetField = tfContractFieldPService.getById(targetFieldId);
|
|
|
+ if(targetMap.get(targetField.getFieldName())!=null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
ContractConfigFieldVo contractConfigFieldVo = new ContractConfigFieldVo();
|
|
|
contractConfigFieldVo.setFieldName(targetField.getFieldName());
|
|
|
contractConfigFieldVo.setFieldType(targetField.getFieldType());
|
|
@@ -215,15 +412,25 @@ public class ContractConfigServiceImpl extends ServiceImpl<ContractConfigMapper,
|
|
|
|
|
|
|
|
|
String formulaFilledPara = fillValue(formula,configFieldMap,paraByCalStr,processId);
|
|
|
+
|
|
|
+ if(formulaFilledPara==null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
String outSum = new EvaluateExpression(formulaFilledPara)
|
|
|
.doEvaluateExpression()
|
|
|
.getOutSum();
|
|
|
- contractConfigFieldVo.setFieldValue(outSum);
|
|
|
- configFieldMap.put(targetField.getFieldName(),outSum);
|
|
|
- targetMap.put(targetField.getFieldName(),contractConfigFieldVo);
|
|
|
- }
|
|
|
+ if(outSum!=null){
|
|
|
+ contractConfigFieldVo.setFieldValue(outSum);
|
|
|
+ configFieldMap.put(targetField.getFieldName(),outSum);
|
|
|
+ targetMap.put(targetField.getFieldName(),contractConfigFieldVo);
|
|
|
+ hasChanged = true;
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ }
|
|
|
+ return hasChanged;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -236,21 +443,38 @@ public class ContractConfigServiceImpl extends ServiceImpl<ContractConfigMapper,
|
|
|
public String fillValue(String formula, Map<String, Object> configFieldMap, List<String> paraByCalStr,Long processId) {
|
|
|
|
|
|
for (String para : paraByCalStr) {
|
|
|
+ try {
|
|
|
+ Double.parseDouble(para);
|
|
|
+ continue;
|
|
|
+ }catch (Exception e){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if(configFieldMap.containsKey(para)){
|
|
|
- formula = formula.replaceAll(para, String.valueOf(configFieldMap.get(para)));
|
|
|
|
|
|
+ formula = formula.replace(para, String.valueOf(configFieldMap.get(para)));
|
|
|
log.debug("填充参数{},设置值为{}",configFieldMap.get(para));
|
|
|
}else{
|
|
|
|
|
|
|
|
|
final String tableByField = ScanFieldUtil.getTableByField(para);
|
|
|
-
|
|
|
+ if(StringUtils.isBlank(tableByField)){
|
|
|
+ log.info("未找到字段"+para+"对应的表");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ String joinSql = "";
|
|
|
+ String conditionSql = "";
|
|
|
+ if(ScanFieldUtil.existFieldByTableName(tableByField,"nodeId")){
|
|
|
+ joinSql = " left join tf_process_node_l n on a.node_id = n.id ";
|
|
|
+ conditionSql = "and n.IS_VALID=1 ";
|
|
|
+ }
|
|
|
Object value
|
|
|
- = baseMapper.getValueByTableNameAndProcessId(tableByField, StrUtil.toUnderlineCase(para), processId,null,null);
|
|
|
+ = baseMapper.getValueByTableNameAndProcessId(tableByField, StrUtil.toUnderlineCase(para), processId,joinSql,conditionSql);
|
|
|
if(value!=null){
|
|
|
formula = formula.replaceAll(para, String.valueOf(value));
|
|
|
}else{
|
|
|
+ formula = formula.replaceAll(para, String.valueOf("0"));
|
|
|
log.error("未能找到参数:{}的值",para);
|
|
|
}
|
|
|
}
|