|
@@ -0,0 +1,39 @@
|
|
|
+package com.winhc.bigdata.udf;
|
|
|
+
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.aliyun.odps.udf.UDF;
|
|
|
+import com.aliyun.odps.utils.StringUtils;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author: π
|
|
|
+ * @Description: 股权冻结全量逻辑
|
|
|
+ * 1、如果为空,则为空
|
|
|
+ * 2、如果含有变更,则为股权变更
|
|
|
+ * 3、如果含有 无效/失效,则为股权冻结|失效
|
|
|
+ * 4、如果含有 解 则为股权冻结|解除冻结
|
|
|
+ * 5、其他都为股权冻结|冻结
|
|
|
+ */
|
|
|
+public class type_state_trans extends UDF {
|
|
|
+
|
|
|
+ public String evaluate(String info) {
|
|
|
+ if (StringUtils.isBlank(info)) {
|
|
|
+ return "";
|
|
|
+ } else if (StrUtil.containsAny(info, "变更")) {
|
|
|
+ return "股权变更";
|
|
|
+ } else if (StrUtil.containsAny(info, "无效", "失效")) {
|
|
|
+ return "股权冻结|失效";
|
|
|
+ } else if (StrUtil.containsAny(info, "解")) {
|
|
|
+ return "股权冻结|解除冻结";
|
|
|
+ }
|
|
|
+ return "股权冻结|冻结";
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String result_info = "已解冻";
|
|
|
+ type_state_trans n = new type_state_trans();
|
|
|
+ System.out.println(n.evaluate(result_info));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|