Commit 2007a13c authored by yanzg's avatar yanzg

身份证识别

parent 66110f1d
......@@ -3,6 +3,7 @@ package com.yanzuoguang.dao.impl;
import com.yanzuoguang.dao.TableAnnotation;
import com.yanzuoguang.dao.cond.SqlCondDefault;
import com.yanzuoguang.dao.cond.SqlCondEquals;
import com.yanzuoguang.db.impl.DbRow;
import com.yanzuoguang.util.base.MethodField;
import com.yanzuoguang.util.base.ObjectHelper;
import com.yanzuoguang.util.exception.RuntimeCodeException;
......@@ -12,6 +13,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import static com.yanzuoguang.dao.DaoConst.*;
......@@ -880,17 +882,34 @@ public class TableStruct {
*
* @param froms 来源数据
* @param cls 类型
* @param <T>
* @return
* @param <T> 类型
* @return 返回值
*/
public static <T extends GroupAdd> List<T> megerGroupAdd(List<T> froms, Class<T> cls) {
return megerGroupAdd(cls, dbRow -> {
for (T from : froms) {
dbRow.handle(from);
}
});
}
/**
* 表结构累加
*
* @param cls 类型
* @param consumer 消费类型
* @param <T> 类型
* @return 返回值
*/
public static <T extends GroupAdd> List<T> megerGroupAdd(Class<T> cls, Consumer<DbRow<T>> consumer) {
List<T> tos = new ArrayList<>();
Map<String, T> mapFrom = new HashMap<>();
TableStruct tableStruct = new TableStruct(StringHelper.EMPTY, cls);
List<TableFieldVo> fields = tableStruct.getGroupLatitudeFields();
for (T from : froms) {
consumer.accept((from) -> {
StringBuilder sb = new StringBuilder();
for (TableFieldVo field : fields) {
String value = StringHelper.getFirst(ObjectHelper.getString(from, field.inputName));
......@@ -906,10 +925,9 @@ public class TableStruct {
T history = mapFrom.get(key);
history.add(from);
}
}
});
return tos;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment