commit
This commit is contained in:
@@ -26,7 +26,7 @@ public class Sys_unit extends BaseModel implements Serializable {
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
// @PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@@ -110,4 +110,24 @@ public class Sys_unit extends BaseModel implements Serializable {
|
||||
@Comment("小组id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionGroupId;
|
||||
|
||||
@Column
|
||||
@Comment("处级_院系单位号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String divisionCollegeCode;
|
||||
|
||||
@Column
|
||||
@Comment("机构类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String institutionType;
|
||||
|
||||
@Column
|
||||
@Comment("部门类别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unitType;
|
||||
|
||||
@Column
|
||||
@Comment("部门类别区分(部门类设置 1, 其他设置 0)")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer unitTypeCode;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.budwk.app.sys.services;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:SysDataDictPullService
|
||||
* @Date 2025/9/22 11:35
|
||||
* @注释
|
||||
*/
|
||||
public interface SysDataDictPullService extends BaseService<Sys_dict> {
|
||||
|
||||
void pullDataDict();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.budwk.app.sys.services;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.models.Sys_unit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:SysDataUnitPullService
|
||||
* @Date 2025/9/15 17:54
|
||||
* @注释
|
||||
*/
|
||||
public interface SysDataUnitPullService extends BaseService<Sys_unit> {
|
||||
|
||||
void updateUnits();
|
||||
|
||||
void updateUnits(List<String> unitIds);
|
||||
}
|
||||
@@ -31,4 +31,11 @@ public interface SysDataUserPullService extends BaseService<Sys_user_source> {
|
||||
* @return
|
||||
*/
|
||||
List<NutMap> pullTimeOptions();
|
||||
|
||||
|
||||
/**
|
||||
* 获取财务数据
|
||||
* @return
|
||||
*/
|
||||
Map<String, NutMap> pullFinance();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.budwk.app.sys.utils;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ClassUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DataCenterUtil
|
||||
* @Date 2025/9/16 9:34
|
||||
* @注释
|
||||
*/
|
||||
public class DataCenterUtil {
|
||||
|
||||
/**
|
||||
* 映射字段
|
||||
* @param obj
|
||||
* @param clazz
|
||||
* @param api2db
|
||||
* @return
|
||||
* @param <T>
|
||||
*/
|
||||
public static <T> T mapJsonToBean(JSONObject obj, Class<T> clazz, Map<String, String> api2db) {
|
||||
T bean = ReflectUtil.newInstance(clazz);
|
||||
api2db.forEach((apiField, dbColumn) -> {
|
||||
Object val = obj.getByPath(apiField);
|
||||
if (val == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Field field = ClassUtil.getDeclaredField(clazz, dbColumn);
|
||||
if (field != null) {
|
||||
Object castVal = Convert.convert(field.getType(), val);
|
||||
ReflectUtil.setFieldValue(bean, field, castVal);
|
||||
}
|
||||
});
|
||||
return bean;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user