Compare commits
No commits in common. "b1340f0b8e57534b6e467cad5a588e7cef64d2b9" and "6f1e24a274681da3bfeb73a3e67392b027be29e8" have entirely different histories.
b1340f0b8e
...
6f1e24a274
|
@ -537,12 +537,7 @@ public class DealWithMapping extends ToolUtil {
|
|||
* @param mainMap 主表数据结果集
|
||||
* @param detailMap 明细数据结果集
|
||||
* @param mappingDetail 配置节点信息
|
||||
*
|
||||
* <h1>代码版本改动说明:</h1>
|
||||
* <p>
|
||||
* v2.0 xuanran.wang 转换类型是默认值时增加替换规则
|
||||
* 将自定义文本中的{?requestid}替换成requestid 以及将 ? 替换成选择的流程字段对应的值
|
||||
* <p>
|
||||
* @return
|
||||
*/
|
||||
private Object normalValueDeal(Map<String, Object> mainMap, Map<String, Object> detailMap, MappingDetail mappingDetail) {
|
||||
|
||||
|
@ -568,19 +563,7 @@ public class DealWithMapping extends ToolUtil {
|
|||
break;
|
||||
// 默认值
|
||||
case DEFAULT_VALUE: {
|
||||
FieldMessage fieldMassage = mappingDetail.getFieldMassage();
|
||||
String workFlowVal = "";
|
||||
if(fieldMassage != null){
|
||||
String fieldName = fieldMassage.getFieldName().toLowerCase();
|
||||
if ("1".equals(childSource)) {
|
||||
workFlowVal = Util.null2String(detailMap.get(fieldName));
|
||||
} else if ("0".equals(childSource)) {
|
||||
workFlowVal = Util.null2String(mainMap.get(fieldName));
|
||||
}
|
||||
}
|
||||
value = Util.null2String(valueContext)
|
||||
.replace("{?requestid}", String.valueOf(mainMap.get("requestid")))
|
||||
.replace("?", workFlowVal);
|
||||
value = valueContext;
|
||||
}
|
||||
break;
|
||||
// 当前时间
|
||||
|
@ -795,12 +778,7 @@ public class DealWithMapping extends ToolUtil {
|
|||
* @param detailMap 明细数据结果集
|
||||
* @param mappingDetail 配置节点信息
|
||||
* @param relationRs 关联流程数据集合
|
||||
*
|
||||
* <h1>代码版本改动说明:</h1>
|
||||
* <p>
|
||||
* v2.0 xuanran.wang 转换类型是默认值时增加替换规则
|
||||
* 将自定义文本中的{?requestid}替换成requestid 以及将 ? 替换成选择的流程字段对应的值
|
||||
* <p>
|
||||
* @return
|
||||
*/
|
||||
private Object normalValueDeal(Map<String, Object> mainMap, Map<String, Object> detailMap, RecordSet relationRs, MappingDetail mappingDetail) {
|
||||
String paramType = mappingDetail.getParamType();
|
||||
|
@ -832,24 +810,7 @@ public class DealWithMapping extends ToolUtil {
|
|||
break;
|
||||
// 默认值
|
||||
case DEFAULT_VALUE: {
|
||||
FieldMessage fieldMassage = mappingDetail.getFieldMassage();
|
||||
String workFlowVal = "";
|
||||
if(fieldMassage != null){
|
||||
String fieldName = fieldMassage.getFieldName().toLowerCase();
|
||||
if ("1".equals(childSource)) {
|
||||
workFlowVal = Util.null2String(detailMap.get(fieldName));
|
||||
} else if ("0".equals(childSource)) {
|
||||
workFlowVal = Util.null2String(mainMap.get(fieldName));
|
||||
} else {
|
||||
workFlowVal = Util.null2String(relationRs.getString(fieldName));
|
||||
}
|
||||
if ("rootNode".equals(mappingDetail.getBelongTo()) && "2".equals(childSource)) {
|
||||
workFlowVal = Util.null2String(tempRs.getString(fieldName));
|
||||
}
|
||||
}
|
||||
value = Util.null2String(valueContext)
|
||||
.replace("{?requestid}", String.valueOf(mainMap.get("requestid")))
|
||||
.replace("?", workFlowVal);
|
||||
value = valueContext;
|
||||
}
|
||||
break;
|
||||
// 当前时间
|
||||
|
|
|
@ -45,7 +45,7 @@ public class PushSealTaskAction extends CusBaseAction {
|
|||
}
|
||||
}catch (Exception e){
|
||||
trans.rollback();
|
||||
throw new CustomerException(Util.logStr("执行提交方法异常:{}", e.getMessage()));
|
||||
throw new CustomerException(e.getMessage());
|
||||
}
|
||||
trans.commit();
|
||||
}
|
||||
|
|
|
@ -1,17 +1,8 @@
|
|||
package weaver.xuanran.wang.schroeder.cus_field_value;
|
||||
|
||||
import aiyh.utils.Util;
|
||||
import aiyh.utils.excention.CustomerException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.xiao.commons.config.interfacies.CusInterfaceGetValue;
|
||||
import weaver.zwl.common.ToolUtil;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <h1></h1>
|
||||
|
@ -20,52 +11,12 @@ import java.util.stream.Collectors;
|
|||
* @Date 2022/12/2 16:10
|
||||
*/
|
||||
public class PushSealTaskSealValue implements CusInterfaceGetValue {
|
||||
private final ToolUtil toolUtil = new ToolUtil();
|
||||
|
||||
private final Logger logger = Util.getLogger();
|
||||
|
||||
@Override
|
||||
public Object execute(Map<String, Object> mainMap, Map<String, Object> detailMap, String currentValue, Map<String, String> pathParam) {
|
||||
logger.info(Util.logStr("路径参数:[{}]", JSONObject.toJSONString(pathParam)));
|
||||
// 接口字段
|
||||
String sealSnField = pathParam.get("sealSnField");
|
||||
String sealNumField = pathParam.get("sealNumField");
|
||||
// 表单字段
|
||||
String workFlowSealNumField = pathParam.get("workFlowSealNumField");
|
||||
String workFlowSealSnField = pathParam.get("workFlowSealSnField");
|
||||
// 自定义sql业务印章类型
|
||||
String sealSnCusSql = pathParam.get("sealSnCusSql");
|
||||
// 使用次数
|
||||
String sealNumCusSql = pathParam.get("sealNumCusSql");
|
||||
// 非空校验
|
||||
if(checkBlank(sealSnField, sealNumField, sealSnCusSql, sealNumCusSql, workFlowSealNumField, workFlowSealSnField)){
|
||||
throw new CustomerException(Util.logStr("自定义类路径中必要参数为空,请检查!当前pathParam : {}", JSONObject.toJSONString(pathParam)));
|
||||
}
|
||||
// 表单印章使用类型值
|
||||
String sealSnVal = Util.null2String(String.valueOf(detailMap.get(sealSnField)),"");
|
||||
// 如果为空返回空集合
|
||||
if(StringUtils.isBlank(sealSnVal)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
ArrayList<Map<String, Object>> list = new ArrayList<>();
|
||||
logger.info(Util.logStr("当前值 : {}", currentValue));
|
||||
int detailId = -1;
|
||||
if(MapUtils.isNotEmpty(detailMap)){
|
||||
detailId = Util.getIntValue(String.valueOf(detailMap.get("id")), -1);
|
||||
}
|
||||
for (String val : sealSnVal.split(",")) {
|
||||
// 印章类型转换执行自定义sql
|
||||
String inSealVal = Util.null2DefaultStr(toolUtil.getValueByChangeRule(sealSnCusSql, val, String.valueOf(mainMap.get("requestid")), detailId),"");
|
||||
String inSealNumVal = Util.null2DefaultStr(toolUtil.getValueByChangeRule(sealNumCusSql, val, String.valueOf(mainMap.get("requestid")), detailId),"");
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put(sealSnField, inSealVal);
|
||||
map.put(sealNumField, inSealNumVal);
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean checkBlank(String ... args){
|
||||
return Arrays.stream(args).noneMatch(StringUtils::isBlank);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,6 @@ public class SchroederQRCodeService {
|
|||
log.info(Util.logStr("this response is [{}]", responeVo.getEntityString()));
|
||||
try {
|
||||
response = responeVo.getEntityMap();
|
||||
log.info(Util.logStr("接口响应:{}", JSONObject.toJSONString(response)));
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error(Util.logStr("push data error, can not parse response to map," +
|
||||
"this response is [{}], url is [{}],request params is [{}], request heard is [{}];",
|
||||
|
|
Loading…
Reference in New Issue