Merge remote-tracking branch 'origin/master'
commit
9ec556f0e3
|
@ -129,43 +129,29 @@ public class RuleEngineVersionController {
|
|||
// 定义模板字符串
|
||||
String template = "package com.muyu.rule.common.engine;\n" +
|
||||
"\n" +
|
||||
"import cn.hutool.core.util.DesensitizedUtil;\n" +
|
||||
"import com.alibaba.fastjson2.JSON;\n" +
|
||||
"import com.alibaba.fastjson2.JSONObject;\n" +
|
||||
"import com.muyu.etl.domain.DataValue;\n" +
|
||||
"import com.muyu.rule.common.basic.abstracts." + parentClass + ";\n" +
|
||||
"import com.muyu.rule.common.basic.abstracts.${parentClass};\n" +
|
||||
"import com.muyu.rule.common.exception.DeliteException;\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"/**\n" +
|
||||
" * @Author:张承志\n" +
|
||||
" * @Package:com.muyu.rule.server.basic.engine.row\n" +
|
||||
" * @Package:com.muyu.rule.server.basic.engine\n" +
|
||||
" * @Project:cloud-etl-rule\n" +
|
||||
" * @name:数据集指定字段进行脱敏\n" +
|
||||
" * @name:${className}\n" +
|
||||
" * @Date:2024/8/30 11:13\n" +
|
||||
" */\n" +
|
||||
"\n" +
|
||||
"public class ${className} extends " + parentClass + " {\n" +
|
||||
"public class ${className} extends ${parentClass} {\n" +
|
||||
"\n" +
|
||||
" @Override\n" +
|
||||
" public void run() {\n" +
|
||||
"\n" +
|
||||
" DataValue[][] dataValues = get();\n" +
|
||||
"\n" +
|
||||
" String dataValue = getDataValue();\n" +
|
||||
"\n" +
|
||||
" JSONObject jsonObject = JSON.parseObject(dataValue);\n" +
|
||||
"\n" +
|
||||
" String key = (String)jsonObject.get(\"key\");\n" +
|
||||
"\n" +
|
||||
" for (DataValue[] value : dataValues) {\n" +
|
||||
" for (DataValue dataValue1 : value) {\n" +
|
||||
" if (dataValue1.getKey().equals(key)) {\n" +
|
||||
" dataValue1.setValue(DesensitizedUtil.mobilePhone((String) dataValue1.getValue()));\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
" if (dataValues == null || \"\".equals(dataValues) || \"null\".equals(dataValues)) {\n" +
|
||||
" throw new DeliteException();\n" +
|
||||
" }else {\n" +
|
||||
" System.out.println(\"数据检测无异常\");\n" +
|
||||
" }\n" +
|
||||
" set(dataValues);\n" +
|
||||
"\n" +
|
||||
" }\n" +
|
||||
"}\n";
|
||||
|
||||
|
|
Loading…
Reference in New Issue