Commit d039fe9c by 宋祥

1.查询视图动态列功能

parent ae8d157a
...@@ -2,6 +2,7 @@ package com.baosight.hggp.common; ...@@ -2,6 +2,7 @@ package com.baosight.hggp.common;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.enums.ValidFlagEnum;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -22,6 +23,15 @@ import java.util.Map; ...@@ -22,6 +23,15 @@ import java.util.Map;
public enum DdynamicEnum { public enum DdynamicEnum {
//------------------------------------配置管理----------------------------------- //------------------------------------配置管理-----------------------------------
/** /**
* 模块:租户管理
* 用途:租户下拉框
*/
ACCOUNT_BLOCK_ID("account_block_id", "accountCode", "accountName", "HGPZ009.query",
new HashMap<String, Object>() {{
put("exValidFlag", ValidFlagEnum.VIRTUALLY.getCode());
}}),
/**
* 模块:项目性质 * 模块:项目性质
* 用途:项目性质下拉框 * 用途:项目性质下拉框
* 编写:wwl * 编写:wwl
......
...@@ -57,13 +57,16 @@ public class DocController extends WebDispatchController { ...@@ -57,13 +57,16 @@ public class DocController extends WebDispatchController {
} }
Map<String, Object> params = this.convertParam(paramMaps); Map<String, Object> params = this.convertParam(paramMaps);
String id = request.getParameter("id"); String id = request.getParameter("id");
DocRouteEnum docRouteEnum = DocRouteEnum.getById(id); DocRouteEnum docRouteEnum = null;
if (MapUtils.getString(params, "fileName").contains("HGSC004A")) { String fileName = MapUtils.getString(params, "fileName");
if (fileName != null && fileName.contains("HGSC004A")) {
docRouteEnum = DocRouteEnum.getById("route_001"); docRouteEnum = DocRouteEnum.getById("route_001");
} else if (params.get("fileName").toString().contains("HGSC009A")) { } else if (fileName != null && fileName.contains("HGSC009A")) {
docRouteEnum = DocRouteEnum.getById("route_002"); docRouteEnum = DocRouteEnum.getById("route_002");
} else if (params.get("fileName").toString().contains("HGPZ005")) { } else if (fileName != null && fileName.contains("HGPZ005")) {
docRouteEnum = DocRouteEnum.getById("route_003"); docRouteEnum = DocRouteEnum.getById("route_003");
} else {
docRouteEnum = DocRouteEnum.getById(id);
} }
if (docRouteEnum == null) { if (docRouteEnum == null) {
outInfo.setMsg("导入标识ID不存在"); outInfo.setMsg("导入标识ID不存在");
......
...@@ -7,6 +7,18 @@ package com.baosight.hggp.core.constant; ...@@ -7,6 +7,18 @@ package com.baosight.hggp.core.constant;
public class CodesetConstant { public class CodesetConstant {
/** /**
* 动态表
*
* @author:songx
* @date:2024/3/1,17:36
*/
public static class HgPz {
// 动态表
public static final String DYNAMIC_TABLE = "app.pz.dynamicTable";
}
/**
* 组织机构 * 组织机构
* *
* @author:songx * @author:songx
......
...@@ -71,6 +71,21 @@ public class CommonConstant { ...@@ -71,6 +71,21 @@ public class CommonConstant {
} }
/** /**
* 权限过滤
*
* @author:songx
* @date:2024/1/20,15:04
*/
public static class AuthFilter {
// 企业权限
public static final String[] ACCOUNT = {"HGXSUser", "HGPZ009", "HGPZ020", "HGPZ020A"};
// 数据权限
public static final String[] DATA = {"HGXSUser", "HGXSOrg", "HGXSUserGroup", "HGPZ009", "HGPZ020",
"HGPZ010.query"};
}
/**
* 设备计划状态 * 设备计划状态
* *
* @author:songx * @author:songx
...@@ -115,6 +130,8 @@ public class CommonConstant { ...@@ -115,6 +130,8 @@ public class CommonConstant {
// Main // Main
public static final String MAIN = "main"; public static final String MAIN = "main";
public static final String ENAME = "ename"; public static final String ENAME = "ename";
// 动态列
public static final String DYNAMIC_COLUMN = "dynamicColumn";
} }
/** /**
......
...@@ -3,7 +3,6 @@ package com.baosight.hggp.core.dao; ...@@ -3,7 +3,6 @@ package com.baosight.hggp.core.dao;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -44,15 +43,26 @@ public class DaoUtils { ...@@ -44,15 +43,26 @@ public class DaoUtils {
* *
* @param sql * @param sql
* @param obj * @param obj
* @throws PlatException
*/ */
public static void insert(String sql, Object obj) throws PlatException { public static void insert(String sql, Object obj) throws PlatException {
insert(sql, obj, true);
}
/**
* insert method.
*
* @param sql
* @param obj
*/
public static void insert(String sql, Object obj, boolean setAuth) throws PlatException {
if (obj instanceof DaoEPBase) { if (obj instanceof DaoEPBase) {
setCreator((DaoEPBase) obj); setCreator((DaoEPBase) obj, setAuth);
} else if (obj instanceof Map) { } else if (obj instanceof Map) {
setCreator((Map) obj); setCreator((Map) obj, setAuth);
} else if (obj instanceof List) { } else if (obj instanceof List) {
for (Object o : ((List) obj)) { for (Object o : ((List) obj)) {
insert(sql, o); insert(sql, o, setAuth);
} }
return; return;
} }
...@@ -66,6 +76,17 @@ public class DaoUtils { ...@@ -66,6 +76,17 @@ public class DaoUtils {
* @param rows * @param rows
*/ */
public static void batchInsert(String sql, List rows) { public static void batchInsert(String sql, List rows) {
batchInsert(sql, rows, true);
}
/**
* insertBatch method.
*
* @param sql
* @param rows
* @param setAuth
*/
public static void batchInsert(String sql, List rows, boolean setAuth) {
// 创建人部门 // 创建人部门
String depCode = ""; String depCode = "";
if (StringUtils.isBlank(depCode) && !"admin".equals(UserSessionUtils.getLoginName())) { if (StringUtils.isBlank(depCode) && !"admin".equals(UserSessionUtils.getLoginName())) {
...@@ -81,11 +102,11 @@ public class DaoUtils { ...@@ -81,11 +102,11 @@ public class DaoUtils {
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人部门编码失败", e); log.warn("写入创建人部门编码失败", e);
} }
setCreator(daoEPBase); setCreator(daoEPBase, setAuth);
} else if (row instanceof Map) { } else if (row instanceof Map) {
Map map = (Map) row; Map map = (Map) row;
map.put("depCode", depCode); map.put("depCode", depCode);
setCreator(map); setCreator(map, setAuth);
} }
} }
Map paramMap = new HashMap(); Map paramMap = new HashMap();
...@@ -132,11 +153,22 @@ public class DaoUtils { ...@@ -132,11 +153,22 @@ public class DaoUtils {
* @param parameters * @param parameters
*/ */
public static int insertBatch(String sql, Collection parameters) { public static int insertBatch(String sql, Collection parameters) {
parameters.forEach(obj->{ return insertBatch(sql, parameters, true);
}
/**
* insertBatch method.
*
* @param sql
* @param parameters
* @param setAuth
*/
public static int insertBatch(String sql, Collection parameters, boolean setAuth) {
parameters.forEach(obj -> {
if (obj instanceof DaoEPBase) { if (obj instanceof DaoEPBase) {
setCreator((DaoEPBase) obj); setCreator((DaoEPBase) obj, setAuth);
} else if (obj instanceof Map) { } else if (obj instanceof Map) {
setCreator((Map) obj); setCreator((Map) obj, setAuth);
} }
}); });
return DaoBase.getInstance().insertBatch(sql, parameters); return DaoBase.getInstance().insertBatch(sql, parameters);
...@@ -146,8 +178,9 @@ public class DaoUtils { ...@@ -146,8 +178,9 @@ public class DaoUtils {
* 创建人工号 创建人姓名 创建人岗号 创建时刻 * 创建人工号 创建人姓名 创建人岗号 创建时刻
* *
* @param bean * @param bean
* @param setAuth 设置权限
*/ */
private static void setCreator(DaoEPBase bean) { private static void setCreator(DaoEPBase bean, boolean setAuth) {
// 创建人ID // 创建人ID
String userId; String userId;
try { try {
...@@ -178,7 +211,22 @@ public class DaoUtils { ...@@ -178,7 +211,22 @@ public class DaoUtils {
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人姓名失败", e); log.warn("写入创建人姓名失败", e);
} }
// 创建时刻
try {
String dateTime = DateUtils.shortDateTime();
BeanUtils.setProperty(bean, "createdTime", dateTime);
BeanUtils.setProperty(bean, "updatedTime", dateTime);
} catch (Exception e) {
log.error("写入创建时刻失败:{}", e.getMessage(), e);
}
// 内码(UUID)
try {
BeanUtils.setProperty(bean, "internalCode", StringUtils.uuid());
} catch (Exception e) {
log.warn("error", e);
}
// 创建人企业编码 // 创建人企业编码
if (setAuth) {
String accountCode = UserSessionUtils.getAccountCode(); String accountCode = UserSessionUtils.getAccountCode();
if (!"admin".equals(userId)) { if (!"admin".equals(userId)) {
AssertUtils.isEmpty(accountCode, "当前用户未绑定公司,无法操作数据,请联系管理员!"); AssertUtils.isEmpty(accountCode, "当前用户未绑定公司,无法操作数据,请联系管理员!");
...@@ -200,19 +248,6 @@ public class DaoUtils { ...@@ -200,19 +248,6 @@ public class DaoUtils {
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人部门编码失败", e); log.warn("写入创建人部门编码失败", e);
} }
// 创建时刻
try {
String dateTime = DateUtils.shortDateTime();
BeanUtils.setProperty(bean, "createdTime", dateTime);
BeanUtils.setProperty(bean, "updatedTime", dateTime);
} catch (Exception e) {
log.error("写入创建时刻失败:{}", e.getMessage(), e);
}
// 内码(UUID)
try {
BeanUtils.setProperty(bean, "internalCode", StringUtils.uuid());
} catch (Exception e) {
log.warn("error", e);
} }
} }
...@@ -220,8 +255,9 @@ public class DaoUtils { ...@@ -220,8 +255,9 @@ public class DaoUtils {
* 创建人工号 创建人姓名 创建时刻. * 创建人工号 创建人姓名 创建时刻.
* *
* @param map * @param map
* @param setAuth
*/ */
public static void setCreator(Map map) { public static void setCreator(Map map, boolean setAuth) {
// 创建人工号 // 创建人工号
String userId = MapUtils.getString(map, "createdBy"); String userId = MapUtils.getString(map, "createdBy");
try { try {
...@@ -245,6 +281,20 @@ public class DaoUtils { ...@@ -245,6 +281,20 @@ public class DaoUtils {
} }
map.put("createdName", userName); map.put("createdName", userName);
map.put("updatedName", ""); map.put("updatedName", "");
// 创建时刻
try {
map.put("createdTime", DateUtils.shortDateTime());
map.put("updatedTime", "");
} catch (PlatException e) {
log.warn("写入创建时刻失败", e);
}
// 内码(UUID)
try {
map.put("internalCode", StringUtils.uuid());
} catch (PlatException e) {
log.warn("error", e);
}
if (setAuth) {
// 创建人企业编码 // 创建人企业编码
String accountCode = UserSessionUtils.getAccountCode(); String accountCode = UserSessionUtils.getAccountCode();
if (!"admin".equals(userId)) { if (!"admin".equals(userId)) {
...@@ -266,18 +316,6 @@ public class DaoUtils { ...@@ -266,18 +316,6 @@ public class DaoUtils {
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人企业编码失败", e); log.warn("写入创建人企业编码失败", e);
} }
// 创建时刻
try {
map.put("createdTime", DateUtils.shortDateTime());
map.put("updatedTime", "");
} catch (PlatException e) {
log.warn("写入创建时刻失败", e);
}
// 内码(UUID)
try {
map.put("internalCode", StringUtils.uuid());
} catch (PlatException e) {
log.warn("error", e);
} }
} }
......
...@@ -2,6 +2,7 @@ package com.baosight.hggp.core.enums; ...@@ -2,6 +2,7 @@ package com.baosight.hggp.core.enums;
import com.baosight.hggp.hg.cw.domain.HGCW003; import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ021;
import com.baosight.hggp.hg.sc.domain.HGSC004A; import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.domain.HGSC009A; import com.baosight.hggp.hg.sc.domain.HGSC009A;
import com.baosight.hggp.hg.sj.domain.HGSJ003; import com.baosight.hggp.hg.sj.domain.HGSJ003;
...@@ -17,6 +18,7 @@ public enum DocRouteEnum { ...@@ -17,6 +18,7 @@ public enum DocRouteEnum {
HGPZ005("route_003", "", 1, "HGPZ005", "importData", HGPZ005.class), HGPZ005("route_003", "", 1, "HGPZ005", "importData", HGPZ005.class),
HGCW003("route_004", "", 1, "HGCW003", "importData", HGCW003.class), HGCW003("route_004", "", 1, "HGCW003", "importData", HGCW003.class),
HGSJ003("route_005", "", 1, "HGSJ003", "importData", HGSJ003.class), HGSJ003("route_005", "", 1, "HGSJ003", "importData", HGSJ003.class),
HGPZ021("HGPZ021", "/file/template/hgpz021.xls", 1, "HGPZ021", "importData", HGPZ021.class),
; ;
......
...@@ -527,6 +527,7 @@ public class HGConstant { ...@@ -527,6 +527,7 @@ public class HGConstant {
// 已提交 // 已提交
public static final Integer S1 = 1; public static final Integer S1 = 1;
} }
// 报工状态 // 报工状态
public static class BGStatus { public static class BGStatus {
......
...@@ -18,4 +18,19 @@ public class HgPzSqlConstant { ...@@ -18,4 +18,19 @@ public class HgPzSqlConstant {
public static final String UPDATE_COMPOSING_COEFF = MODULE + "updateComposingCoeff"; public static final String UPDATE_COMPOSING_COEFF = MODULE + "updateComposingCoeff";
} }
/**
*
* @author songx
* @date 2024/11/6,14:21
*/
public class HgPz020 {
// 模块名称
public static final String MODULE = "HGPZ020.";
// 修改排产系数
public static final String UPDATE_SORT = MODULE + "updateSort";
// 删除字段
public static final String DELETE_BY_FIELD = MODULE + "deleteByField";
}
} }
package com.baosight.hggp.hg.pz.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:HGPZ020.java <br>
* Description: <br>
*
* @author songx
* @date 2024-11-04 16:32:40
*/
public class HGPZ020 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* */
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者 */
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称 */
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间 */
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 记录修改者 */
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称 */
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间 */
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 租户编码 */
public static final String FIELD_ACCOUNT_NAME = "accountName"; /* 租户名称 */
public static final String FIELD_TABLE_CODE = "tableCode"; /* 表英文名 */
public static final String FIELD_TABLE_NAME = "tableName"; /* 表中文名 */
public static final String FIELD_FIELD_CODE = "fieldCode"; /* 字段英文名 */
public static final String FIELD_FIELD_NAME = "fieldName"; /* 字段中文名 */
public static final String FIELD_VIEW_SQL = "viewSql"; /* 视图SQL */
public static final String FIELD_SORT_NUM = "sortNum"; /* 排序 */
public static final String COL_ID = "ID"; /* */
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者 */
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称 */
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间 */
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 记录修改者 */
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称 */
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间 */
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 租户编码 */
public static final String COL_ACCOUNT_NAME = "ACCOUNT_NAME"; /* 租户名称 */
public static final String COL_TABLE_CODE = "TABLE_CODE"; /* 表英文名 */
public static final String COL_TABLE_NAME = "TABLE_NAME"; /* 表中文名 */
public static final String COL_FIELD_CODE = "FIELD_CODE"; /* 字段英文名 */
public static final String COL_FIELD_NAME = "FIELD_NAME"; /* 字段中文名 */
public static final String COL_VIEW_SQL = "VIEW_SQL"; /* 视图SQL */
public static final String COL_SORT_NUM = "SORT_NUM"; /* 排序 */
public static final String QUERY = "HGPZ020.query";
public static final String COUNT = "HGPZ020.count";
public static final String INSERT = "HGPZ020.insert";
public static final String UPDATE = "HGPZ020.update";
public static final String DELETE = "HGPZ020.delete";
public Long id = new Long(0); /* */
public String createdBy = " "; /* 记录创建者 */
public String createdName = " "; /* 记录创建名称 */
public String createdTime = " "; /* 记录创建时间 */
public String updatedBy = " "; /* 记录修改者 */
public String updatedName = " "; /* 记录修改名称 */
public String updatedTime = " "; /* 记录修改时间 */
public String accountCode = " "; /* 租户编码 */
public String accountName = " "; /* 租户名称 */
public String tableCode = " "; /* 表英文名 */
public String tableName = " "; /* 表中文名 */
public String fieldCode = " "; /* 字段英文名 */
public String fieldName = " "; /* 字段中文名 */
public String viewSql = " "; /* 视图SQL */
public Integer sortNum = new Integer(0); /* 排序 */
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setDescName("");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("租户编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_NAME);
eiColumn.setDescName("租户名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TABLE_CODE);
eiColumn.setDescName("表英文名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TABLE_NAME);
eiColumn.setDescName("表中文名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FIELD_CODE);
eiColumn.setDescName("字段英文名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FIELD_NAME);
eiColumn.setDescName("字段中文名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_VIEW_SQL);
eiColumn.setDescName("视图SQL");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SORT_NUM);
eiColumn.setDescName("排序");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGPZ020() {
initMetaData();
}
/**
* get the id - .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - .
*
* @param id -
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 企业编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 企业编码.
*
* @param accountCode - 企业编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
/**
* get the createdBy - 记录创建者.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
* @param createdBy - 记录创建者
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 记录创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
* @param createdName - 记录创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 记录创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
* @param createdTime - 记录创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 记录修改者.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
* @param updatedBy - 记录修改者
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 记录修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
* @param updatedName - 记录修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 记录修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
* @param updatedTime - 记录修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the tableCode - 表英文名.
* @return the tableCode
*/
public String getTableCode() {
return this.tableCode;
}
/**
* set the tableCode - 表英文名.
*
* @param tableCode - 表英文名
*/
public void setTableCode(String tableCode) {
this.tableCode = tableCode;
}
/**
* get the tableName - 表中文名.
* @return the tableName
*/
public String getTableName() {
return this.tableName;
}
/**
* set the tableName - 表中文名.
*
* @param tableName - 表中文名
*/
public void setTableName(String tableName) {
this.tableName = tableName;
}
/**
* get the fieldCode - 字段英文名.
* @return the fieldCode
*/
public String getFieldCode() {
return this.fieldCode;
}
/**
* set the fieldCode - 字段英文名.
*
* @param fieldCode - 字段英文名
*/
public void setFieldCode(String fieldCode) {
this.fieldCode = fieldCode;
}
/**
* get the fieldName - 字段中文名.
* @return the fieldName
*/
public String getFieldName() {
return this.fieldName;
}
/**
* set the fieldName - 字段中文名.
*
* @param fieldName - 字段中文名
*/
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
/**
* get the sortNum - 排序.
* @return the sortNum
*/
public Integer getSortNum() {
return this.sortNum;
}
/**
* set the sortNum - 排序.
*
* @param sortNum - 排序
*/
public void setSortNum(Integer sortNum) {
this.sortNum = sortNum;
}
public String getViewSql() {
return viewSql;
}
public void setViewSql(String viewSql) {
this.viewSql = viewSql;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setAccountName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_NAME)), accountName));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setTableCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TABLE_CODE)), tableCode));
setTableName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TABLE_NAME)), tableName));
setFieldCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FIELD_CODE)), fieldCode));
setFieldName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FIELD_NAME)), fieldName));
setViewSql(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_VIEW_SQL)), viewSql));
setSortNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SORT_NUM)), sortNum));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_ACCOUNT_NAME, StringUtils.toString(accountName, eiMetadata.getMeta(FIELD_ACCOUNT_NAME)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_TABLE_CODE, StringUtils.toString(tableCode, eiMetadata.getMeta(FIELD_TABLE_CODE)));
map.put(FIELD_TABLE_NAME, StringUtils.toString(tableName, eiMetadata.getMeta(FIELD_TABLE_NAME)));
map.put(FIELD_FIELD_CODE, StringUtils.toString(fieldCode, eiMetadata.getMeta(FIELD_FIELD_CODE)));
map.put(FIELD_FIELD_NAME, StringUtils.toString(fieldName, eiMetadata.getMeta(FIELD_FIELD_NAME)));
map.put(FIELD_VIEW_SQL, StringUtils.toString(viewSql, eiMetadata.getMeta(FIELD_VIEW_SQL)));
map.put(FIELD_SORT_NUM, StringUtils.toString(sortNum, eiMetadata.getMeta(FIELD_SORT_NUM)));
return map;
}
}
\ No newline at end of file
package com.baosight.hggp.hg.pz.domain;
import com.baosight.hggp.common.ExcelAnno;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:HGPZ021.java <br>
* Description: <br>
*
* @author songx
* @date 2024-11-04 16:50:20
*/
public class HGPZ021 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* */
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者 */
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称 */
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间 */
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 记录修改者 */
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称 */
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间 */
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0-未删除,1-已删除 */
public static final String FIELD_STATUS = "status"; /* 0-未启用,1-已启用 */
public static final String FIELD_TABLE_CODE = "tableCode"; /* 表英文名 */
public static final String FIELD_TABLE_NAME = "tableName"; /* 表中文名 */
public static final String FIELD_FIELD_CODE = "fieldCode"; /* 字段英文名 */
public static final String FIELD_FIELD_NAME = "fieldName"; /* 字段中文名 */
public static final String FIELD_VIEW_SQL = "viewSql"; /* */
public static final String FIELD_SORT_NUM = "sortNum"; /* 排序 */
public static final String FIELD_IS_DEFAULT = "isDefault"; /* 是否默认 */
public static final String COL_ID = "ID"; /* */
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者 */
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称 */
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间 */
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 记录修改者 */
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称 */
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间 */
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0-未删除,1-已删除 */
public static final String COL_STATUS = "STATUS"; /* 0-未启用,1-已启用 */
public static final String COL_TABLE_CODE = "TABLE_CODE"; /* 表英文名 */
public static final String COL_TABLE_NAME = "TABLE_NAME"; /* 表中文名 */
public static final String COL_FIELD_CODE = "FIELD_CODE"; /* 字段英文名 */
public static final String COL_FIELD_NAME = "FIELD_NAME"; /* 字段中文名 */
public static final String COL_VIEW_SQL = "VIEW_SQL"; /* */
public static final String COL_SORT_NUM = "SORT_NUM"; /* 排序 */
public static final String COL_IS_DEFAULT = "IS_DEFAULT"; /* 是否默认 */
public static final String QUERY = "HGPZ021.query";
public static final String COUNT = "HGPZ021.count";
public static final String INSERT = "HGPZ021.insert";
public static final String UPDATE = "HGPZ021.update";
public static final String DELETE = "HGPZ021.delete";
@ExcelAnno(index = 0)
public Long id = new Long(0); /* */
public String createdBy = " "; /* 记录创建者 */
public String createdName = " "; /* 记录创建名称 */
public String createdTime = " "; /* 记录创建时间 */
public String updatedBy = " "; /* 记录修改者 */
public String updatedName = " "; /* 记录修改名称 */
public String updatedTime = " "; /* 记录修改时间 */
public Integer deleteFlag = new Integer(0); /* 0-未删除,1-已删除 */
public Integer status = new Integer(0); /* 0-未启用,1-已启用 */
@ExcelAnno(index = 1)
public String tableCode = " "; /* 表英文名 */
public String tableName = " "; /* 表中文名 */
@ExcelAnno(index = 2)
public String fieldCode = " "; /* 字段英文名 */
@ExcelAnno(index = 3)
public String fieldName = " "; /* 字段中文名 */
@ExcelAnno(index = 4)
public String viewSql = " "; /* */
@ExcelAnno(index = 5)
public Integer sortNum = new Integer(0); /* 排序 */
@ExcelAnno(index = 6)
public Integer isDefault = new Integer(0); /* 是否默认 */
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setDescName("");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("0-未启用,1-已启用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TABLE_CODE);
eiColumn.setDescName("表英文名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TABLE_NAME);
eiColumn.setDescName("表中文名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FIELD_CODE);
eiColumn.setDescName("字段英文名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FIELD_NAME);
eiColumn.setDescName("字段中文名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_VIEW_SQL);
eiColumn.setDescName("");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SORT_NUM);
eiColumn.setDescName("排序");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_IS_DEFAULT);
eiColumn.setDescName("是否默认");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGPZ021() {
initMetaData();
}
/**
* get the id - .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - .
*
* @param id -
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the createdBy - 记录创建者.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
* @param createdBy - 记录创建者
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 记录创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
* @param createdName - 记录创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 记录创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
* @param createdTime - 记录创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 记录修改者.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
* @param updatedBy - 记录修改者
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 记录修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
* @param updatedName - 记录修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 记录修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
* @param updatedTime - 记录修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0-未删除,1-已删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0-未删除,1-已删除.
*
* @param deleteFlag - 0-未删除,1-已删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the status - 0-未启用,1-已启用.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 0-未启用,1-已启用.
*
* @param status - 0-未启用,1-已启用
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the tableCode - 表英文名.
* @return the tableCode
*/
public String getTableCode() {
return this.tableCode;
}
/**
* set the tableCode - 表英文名.
*
* @param tableCode - 表英文名
*/
public void setTableCode(String tableCode) {
this.tableCode = tableCode;
}
/**
* get the tableName - 表中文名.
* @return the tableName
*/
public String getTableName() {
return this.tableName;
}
/**
* set the tableName - 表中文名.
*
* @param tableName - 表中文名
*/
public void setTableName(String tableName) {
this.tableName = tableName;
}
/**
* get the fieldCode - 字段英文名.
* @return the fieldCode
*/
public String getFieldCode() {
return this.fieldCode;
}
/**
* set the fieldCode - 字段英文名.
*
* @param fieldCode - 字段英文名
*/
public void setFieldCode(String fieldCode) {
this.fieldCode = fieldCode;
}
/**
* get the fieldName - 字段中文名.
* @return the fieldName
*/
public String getFieldName() {
return this.fieldName;
}
/**
* set the fieldName - 字段中文名.
*
* @param fieldName - 字段中文名
*/
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
/**
* get the viewSql - .
* @return the viewSql
*/
public String getViewSql() {
return this.viewSql;
}
/**
* set the viewSql - .
*
* @param viewSql -
*/
public void setViewSql(String viewSql) {
this.viewSql = viewSql;
}
/**
* get the sortNum - 排序.
* @return the sortNum
*/
public Integer getSortNum() {
return this.sortNum;
}
/**
* set the sortNum - 排序.
*
* @param sortNum - 排序
*/
public void setSortNum(Integer sortNum) {
this.sortNum = sortNum;
}
public Integer getIsDefault() {
return isDefault;
}
public void setIsDefault(Integer isDefault) {
this.isDefault = isDefault;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setTableCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TABLE_CODE)), tableCode));
setTableName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TABLE_NAME)), tableName));
setFieldCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FIELD_CODE)), fieldCode));
setFieldName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FIELD_NAME)), fieldName));
setViewSql(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_VIEW_SQL)), viewSql));
setSortNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SORT_NUM)), sortNum));
setIsDefault(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_DEFAULT)), isDefault));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_TABLE_CODE, StringUtils.toString(tableCode, eiMetadata.getMeta(FIELD_TABLE_CODE)));
map.put(FIELD_TABLE_NAME, StringUtils.toString(tableName, eiMetadata.getMeta(FIELD_TABLE_NAME)));
map.put(FIELD_FIELD_CODE, StringUtils.toString(fieldCode, eiMetadata.getMeta(FIELD_FIELD_CODE)));
map.put(FIELD_FIELD_NAME, StringUtils.toString(fieldName, eiMetadata.getMeta(FIELD_FIELD_NAME)));
map.put(FIELD_VIEW_SQL, StringUtils.toString(viewSql, eiMetadata.getMeta(FIELD_VIEW_SQL)));
map.put(FIELD_SORT_NUM, StringUtils.toString(sortNum, eiMetadata.getMeta(FIELD_SORT_NUM)));
map.put(FIELD_IS_DEFAULT, StringUtils.toString(isDefault, eiMetadata.getMeta(FIELD_IS_DEFAULT)));
return map;
}
}
\ No newline at end of file
package com.baosight.hggp.hg.pz.enums;
/**
* 动态表
*
* @author songx
* @date 2024/3/1,17:29
*/
public enum DynamicTableEnum {
HGCW002("HGCW002", "合同管理"),
HGSC001("HGSC001", "项目立项"),
;
/**
* 编码
*/
private String code;
/**
* 名称
*/
private String name;
DynamicTableEnum(String code, String name) {
this.code = code;
this.name = name;
}
/**
* code 是否存在
*
* @param code
* @return
*/
public static boolean contains(String code) {
for (DynamicTableEnum value : values()) {
if (value.getCode().equals(code)) {
return true;
}
}
return false;
}
/**
* 根据名称查询
*
* @param name
* @return
*/
public static DynamicTableEnum getByName(String name) {
for (DynamicTableEnum value : values()) {
if (value.getName().equals(name)) {
return value;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
...@@ -13,8 +13,6 @@ import com.baosight.hggp.util.AssertUtils; ...@@ -13,8 +13,6 @@ import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.DateUtils; import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
......
...@@ -7,13 +7,11 @@ import com.baosight.hggp.core.security.UserSessionUtils; ...@@ -7,13 +7,11 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ015; import com.baosight.hggp.hg.pz.domain.HGPZ015;
import com.baosight.hggp.hg.pz.domain.HGPZ015A; import com.baosight.hggp.hg.pz.domain.HGPZ015A;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC004; import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A; import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
......
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.pz.constant.HgPzSqlConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ020;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 表字段配置
*
* @author:songx
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ020 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.ACCOUNT_BLOCK_ID), null, true);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ020().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HGPZ020.QUERY, new HGPZ020());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HGPZ020> fPz020s = MapUtils.toDaoEPBases(inInfo, HGPZ020.class);
for (HGPZ020 fPz020 : fPz020s) {
DaoUtils.update(HGPZ020.DELETE, fPz020);
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fPz020s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 修改排序
*
* @param inInfo
* @return
*/
public EiInfo updateSort(EiInfo inInfo) {
try {
List<Map> resultMaps = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultMap : resultMaps) {
DaoUtils.update(HgPzSqlConstant.HgPz020.UPDATE_SORT, resultMap);
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + resultMaps.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.domain.HGPZ020;
import com.baosight.hggp.hg.pz.domain.HGPZ021;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 选择字段
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGPZ020A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.ACCOUNT_BLOCK_ID), null, true);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ021().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, "HGPZ020A.query", new HGPZ021());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认操作.
*
* @param inInfo
* @return
*/
public EiInfo confirm(EiInfo inInfo) {
try {
// 租户信息
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String accountCode = MapUtils.getString(queryMap, HGPZ020.FIELD_ACCOUNT_CODE);
AssertUtils.isEmpty(accountCode, "请选择租户");
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode);
AssertUtils.isNull(dbPz009, "租户信息不存在");
List<HGPZ020> fPz020s = MapUtils.toDaoEPBases(inInfo, HGPZ020.class);
for (HGPZ020 fPz020 : fPz020s) {
fPz020.setAccountCode(accountCode);
fPz020.setAccountName(dbPz009.getAccountName());
DaoUtils.insert(HGPZ020.INSERT, fPz020, false);
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fPz020s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.core.constant.CodesetConstant;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.tools.CodeValueTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.constant.HgPzSqlConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ021;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
import java.util.Map;
/**
* 表字段配置
*
* @author:songx
* @date:2024/1/15,11:20
*/
public class ServiceHGPZ021 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ021().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HGPZ021.QUERY, new HGPZ021());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<Map> resultMaps = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultMap : resultMaps) {
DaoUtils.update(HGPZ021.DELETE, resultMap);
// 同步删除已配置的信息
DaoUtils.update(HgPzSqlConstant.HgPz020.DELETE_BY_FIELD, resultMap);
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + resultMaps.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据导入
*
* @param inInfo
* @return
*/
public EiInfo importData(EiInfo inInfo) {
EiInfo outInfo = new EiInfo();
try {
List<HGPZ021> fPz021s = (List<HGPZ021>) inInfo.get("dataList");
// 数据校验
this.checkImportData(fPz021s);
// 插入新的数据
this.saveImportData(fPz021s);
outInfo.setMsg("导入成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(outInfo, e, "数据导入失败");
}
return outInfo;
}
/**
* 检查导入的数据
*
* @param fPz021s
*/
private void checkImportData(List<HGPZ021> fPz021s) {
// 表名称小代码
List<Map> dynamicTables = CodeValueTools.getCodeValues(CodesetConstant.HgPz.DYNAMIC_TABLE);
for (HGPZ021 fPz021 : fPz021s) {
AssertUtils.isEmpty(fPz021.getTableCode(), String.format("序号[%s]表英文名不能为空", fPz021.getId()));
for (Map dynamicTableMap : dynamicTables) {
String value = MapUtils.getString(dynamicTableMap, "value");
if (value.equals(fPz021.getTableCode())) {
fPz021.setTableName(MapUtils.getString(dynamicTableMap, "label"));
}
}
AssertUtils.isEmpty(fPz021.getTableName(), String.format("序号[%s]表名称非法", fPz021.getId()));
AssertUtils.isEmpty(fPz021.getFieldCode(), String.format("序号[%s]字段英文名不能为空", fPz021.getId()));
AssertUtils.isEmpty(fPz021.getFieldName(), String.format("序号[%s]字段中文名不能为空", fPz021.getId()));
}
}
/**
* 数据写入
*
* @param fPz021s
*/
private void saveImportData(List<HGPZ021> fPz021s) {
for (HGPZ021 fPz021 : fPz021s) {
fPz021.setStatus(HGConstant.EnablingStatus.QY);
fPz021.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGPZ021.INSERT, fPz021);
}
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ021;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Map;
/**
* 新增修改
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGPZ021A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
this.setBaseInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
HGPZ021 fPz021 = MapUtils.toDaoEPBase(inInfo, HGPZ021.class);
if (fPz021.getId() == null || fPz021.getId() == 0) {
this.add(fPz021);
} else {
this.modify(fPz021);
}
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fPz021
*/
private void add(HGPZ021 fPz021) {
fPz021.setStatus(HGConstant.EnablingStatus.QY);
fPz021.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGPZ021.INSERT, fPz021);
}
/**
* 修改数据
*
* @param fPz021
*/
private void modify(HGPZ021 fPz021) {
DaoUtils.update(HGPZ021.UPDATE, fPz021);
}
/**
* 设置信息
*
* @param inInfo
*/
public void setBaseInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
Long id = MapUtils.getLong(queryRow, HGPZ021.FIELD_ID);
if (id == null) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HGPZTools.HgPz021.get(id));
resultBlock.addBlockMeta(new HGPZ021().eiMetadata);
inInfo.setBlock(resultBlock);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGPZ020">
<sql id="column">
ID as "id", <!-- -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
ACCOUNT_CODE as "accountCode", <!-- 租户编码 -->
ACCOUNT_NAME as "accountName", <!-- 租户名称 -->
TABLE_CODE as "tableCode", <!-- 表英文名 -->
TABLE_NAME as "tableName", <!-- 表中文名 -->
FIELD_CODE as "fieldCode", <!-- 字段英文名 -->
FIELD_NAME as "fieldName", <!-- 字段中文名 -->
VIEW_SQL as "viewSql", <!-- 视图SQL -->
SORT_NUM as "sortNum" <!-- 排序 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="tableCode">
TABLE_CODE = #tableCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="tableName">
TABLE_NAME LIKE CONCAT('%', #tableName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fieldCode">
FIELD_CODE LIKE CONCAT('%', #fieldCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fieldName">
FIELD_NAME LIKE CONCAT('%', #fieldName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="sortNum">
SORT_NUM = #sortNum#
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ020">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGPZ020 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ020 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ020 (
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
ACCOUNT_CODE, <!-- 租户编码 -->
ACCOUNT_NAME, <!-- 租户名称 -->
TABLE_CODE, <!-- 表英文名 -->
TABLE_NAME, <!-- 表中文名 -->
FIELD_CODE, <!-- 字段英文名 -->
FIELD_NAME, <!-- 字段中文名 -->
VIEW_SQL, <!-- 视图SQL -->
SORT_NUM <!-- 排序 -->
) VALUES (
#createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#,
#accountCode#, #accountName#, #tableCode#, #tableName#, #fieldCode#, #fieldName#, #viewSql#,
#sortNum#
)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGPZ020 WHERE ID = #id#
</delete>
<!-- 根据字段删除 -->
<delete id="deleteByField">
DELETE FROM ${hggpSchema}.HGPZ020 WHERE TABLE_CODE = #tableCode# AND FIELD_CODE = #fieldCode#
</delete>
<!-- 修改排序 -->
<update id="updateSort">
UPDATE ${hggpSchema}.HGPZ020
SET
SORT_NUM = #sortNum#, <!-- 排序 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGPZ020A">
<sql id="column">
ID as "id", <!-- -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
STATUS as "status", <!-- 0-未启用,1-已启用 -->
TABLE_CODE as "tableCode", <!-- 表英文名 -->
TABLE_NAME as "tableName", <!-- 表中文名 -->
FIELD_CODE as "fieldCode", <!-- 字段英文名 -->
FIELD_NAME as "fieldName", <!-- 字段中文名 -->
VIEW_SQL as "viewSql", <!-- -->
SORT_NUM as "sortNum" <!-- 排序 -->
</sql>
<sql id="condition">
<!-- 过滤已经添加的字段 -->
AND NOT EXISTS (SELECT * FROM ${hggpSchema}.HGPZ020 A WHERE A.TABLE_CODE = T.TABLE_CODE
AND A.FIELD_CODE = T.FIELD_CODE AND A.ACCOUNT_CODE = #accountCode#
)
<isNotEmpty prepend=" AND " property="tableCode">
TABLE_CODE LIKE CONCAT('%', #tableCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="tableName">
TABLE_NAME LIKE CONCAT('%', #tableName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fieldCode">
FIELD_CODE LIKE CONCAT('%', #fieldCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fieldName">
FIELD_NAME LIKE CONCAT('%', #fieldName#, '%')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ021">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGPZ021 T WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ021 T WHERE 1=1
<include refid="condition"/>
</select>
</sqlMap>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGPZ021">
<sql id="column">
ID as "id", <!-- -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
STATUS as "status", <!-- 0-未启用,1-已启用 -->
TABLE_CODE as "tableCode", <!-- 表英文名 -->
TABLE_NAME as "tableName", <!-- 表中文名 -->
FIELD_CODE as "fieldCode", <!-- 字段英文名 -->
FIELD_NAME as "fieldName", <!-- 字段中文名 -->
VIEW_SQL as "viewSql", <!-- -->
SORT_NUM as "sortNum", <!-- 排序 -->
IS_DEFAULT as "isDefault" <!-- 是否默认 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="tableCode">
TABLE_CODE = #tableCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="tableName">
TABLE_NAME LIKE CONCAT('%', #tableName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fieldCode">
FIELD_CODE LIKE CONCAT('%', #fieldCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fieldName">
FIELD_NAME LIKE CONCAT('%', #fieldName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isDefault">
IS_DEFAULT = #isDefault#
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ021">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGPZ021 WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ021 WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ021 (
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
STATUS, <!-- 0-未启用,1-已启用 -->
TABLE_CODE, <!-- 表英文名 -->
TABLE_NAME, <!-- 表中文名 -->
FIELD_CODE, <!-- 字段英文名 -->
FIELD_NAME, <!-- 字段中文名 -->
VIEW_SQL, <!-- 视图 -->
SORT_NUM, <!-- 排序 -->
IS_DEFAULT <!-- 是否默认 -->
) VALUES (
#createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#,
#deleteFlag#, #status#, #tableCode#, #tableName#, #fieldCode#, #fieldName#, #viewSql#,
#sortNum#, #isDefault#
)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGPZ021 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGPZ021
SET
TABLE_CODE = #tableCode#, <!-- 表英文名 -->
TABLE_NAME = #tableName#, <!-- 表中文名 -->
FIELD_CODE = #fieldCode#, <!-- 字段英文名 -->
FIELD_NAME = #fieldName#, <!-- 字段中文名 -->
VIEW_SQL = #viewSql#, <!-- 视图 -->
SORT_NUM = #sortNum#, <!-- 排序 -->
IS_DEFAULT = #isDefault#, <!-- 是否默认 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<!-- 修改排序 -->
<update id="updateSort">
UPDATE ${hggpSchema}.HGPZ021
SET
SORT_NUM = #sortNum#, <!-- 排序 -->
IS_DEFAULT = #isDefault#, <!-- 是否默认 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
\ No newline at end of file
package com.baosight.hggp.hg.pz.tools; package com.baosight.hggp.hg.pz.tools;
import com.baosight.hggp.common.InventTypeEnum; import com.baosight.hggp.common.InventTypeEnum;
import com.baosight.hggp.common.ProductTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.ValidFlagEnum; import com.baosight.hggp.core.enums.ValidFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.*;
import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.pz.domain.HGPZ002; import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.pz.domain.HGPZ003; import com.baosight.hggp.hg.pz.domain.HGPZ003;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.domain.HGPZ006;
import com.baosight.hggp.hg.pz.domain.HGPZ007; import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.domain.HGPZ009; import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.domain.HGPZ015A;
import com.baosight.hggp.hg.pz.domain.HGPZ016;
import com.baosight.hggp.hg.pz.domain.HGPZ017;
import com.baosight.hggp.hg.pz.domain.HGPZ018;
import com.baosight.hggp.hg.pz.domain.HGPZ020;
import com.baosight.hggp.hg.pz.domain.HGPZ021;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.domain.HGSC009A;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.SimpleDateFormat; import java.util.HashMap;
import java.util.*; import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -997,5 +1011,64 @@ public class HGPZTools { ...@@ -997,5 +1011,64 @@ public class HGPZTools {
} }
} }
/**
* HGPZ020 定义
*
* @author songx
* @date 2024/11/5,14:28
*/
public static class HgPz020 {
/**
* 查询
*
* @param tableCode
* @return
*/
public static List<HGPZ020> listByTable(String tableCode) {
Map<String, Object> queryMap = new HashMap<>();
queryMap.put(HGPZ020.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
queryMap.put(HGPZ020.FIELD_TABLE_CODE, tableCode);
queryMap.put(EiConstant.orderByStr, " SORT_NUM ASC");
return DaoBase.getInstance().query(HGPZ020.QUERY, queryMap);
}
}
/**
* HGPZ021 定义
*
* @author songx
* @date 2024/11/5,14:28
*/
public static class HgPz021 {
/**
* 查询
*
* @param id
* @return
*/
public static HGPZ021 get(Long id) {
AssertUtils.isNull(id, "节点ID不能为空");
Map<String, Object> queryMap = new HashMap<>();
queryMap.put(HGPZ021.FIELD_ID, id);
List<HGPZ021> results = DaoBase.getInstance().query(HGPZ021.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param tableCode
* @return
*/
public static List<HGPZ021> listDefaultByTable(String tableCode) {
Map<String, Object> queryMap = new HashMap<>();
queryMap.put(HGPZ021.FIELD_IS_DEFAULT, CommonConstant.YesNo.YES_1);
queryMap.put(HGPZ021.FIELD_TABLE_CODE, tableCode);
queryMap.put(EiConstant.orderByStr, " SORT_NUM ASC");
return DaoBase.getInstance().query(HGPZ021.QUERY, queryMap);
}
}
} }
package com.baosight.hggp.hg.pz.utils;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ020;
import com.baosight.hggp.hg.pz.domain.HGPZ021;
import com.baosight.hggp.hg.pz.enums.DynamicTableEnum;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import org.apache.commons.collections.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author songx
* @date 2024/11/6,15:48
*/
public class HGPZUtils {
/**
* HGPZ020 定义
*
* @author songx
* @date 2024/11/6,15:48
*/
public static class HgPz020 {
/**
* 设置动态列
*
* @param inInfo
* @param dynamicTableEnum
* @return
*/
public static void buildDynamicColumn(EiInfo inInfo, DynamicTableEnum dynamicTableEnum) {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
buildDynamicColumn(queryMap, dynamicTableEnum);
}
/**
* 设置动态列
*
* @param queryMap
* @param dynamicTableEnum
* @return
*/
public static void buildDynamicColumn(Map queryMap, DynamicTableEnum dynamicTableEnum) {
queryMap.put(CommonConstant.Field.DYNAMIC_COLUMN, buildDynamicColumn(dynamicTableEnum));
}
/**
* 设置动态列
*
* @param dynamicTableEnum 动态表
*/
public static String buildDynamicColumn(DynamicTableEnum dynamicTableEnum) {
// 查询企业配置的字段,如果未配置使用默认字段
List<HGPZ020> dbPz020s = HGPZTools.HgPz020.listByTable(dynamicTableEnum.getCode());
if (CollectionUtils.isNotEmpty(dbPz020s)) {
return dbPz020s.stream().map(item -> {
if (StringUtils.isEmpty(item.getViewSql())) {
return item.getFieldCode();
} else {
return item.getViewSql() + " as " + item.getFieldCode();
}
}).collect(Collectors.joining(","));
}
List<HGPZ021> dbPz021s = HGPZTools.HgPz021.listDefaultByTable(dynamicTableEnum.getCode());
if (CollectionUtils.isNotEmpty(dbPz021s)) {
return dbPz021s.stream().map(item -> {
if (StringUtils.isEmpty(item.getViewSql())) {
return item.getFieldCode();
} else {
return item.getViewSql() + " as " + item.getFieldCode();
}
}).collect(Collectors.joining(","));
}
return null;
}
/**
* 填充EiMetadata
*
* @param inInfo
* @param clazz
*/
public static void buildEiMetadata(EiInfo inInfo, Class clazz) {
EiBlock resultBlock = inInfo.getBlock(EiConstant.resultBlock);
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 动态列
String dynamicColumn = MapUtils.getString(queryMap, CommonConstant.Field.DYNAMIC_COLUMN);
if (StringUtils.isBlank(dynamicColumn)) {
return;
}
// 取实体类的Meta列信息
Map<String, EiColumn> originMetas = ((DaoEPBase) clazz.newInstance()).eiMetadata.getMetas();
for (String itemColumn : dynamicColumn.split(",")) {
// 需要去除字段前面的表别名
EiColumn eiColumn = originMetas.get(itemColumn);
if (eiColumn != null) {
resultBlock.addMeta(eiColumn);
}
}
} catch (Exception e) {
throw new PlatException("加载EiMetadata失败");
}
}
}
}
...@@ -14,6 +14,8 @@ public class HgScSqlConstant { ...@@ -14,6 +14,8 @@ public class HgScSqlConstant {
*/ */
public static class HgSc001 { public static class HgSc001 {
// 动态查询
public static final String DYNAMIC_QUERY = "HGSC001.dynamicQuery";
// 获取 // 获取
public static final String GET_BY_CODE = "HGSC001.get"; public static final String GET_BY_CODE = "HGSC001.get";
// 德诚修改 // 德诚修改
......
...@@ -7,7 +7,8 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -7,7 +7,8 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ001; import com.baosight.hggp.hg.pz.domain.HGPZ001;
import com.baosight.hggp.hg.pz.domain.HGPZ002; import com.baosight.hggp.hg.pz.enums.DynamicTableEnum;
import com.baosight.hggp.hg.pz.utils.HGPZUtils;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant; import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A; import com.baosight.hggp.hg.sc.domain.HGSC001A;
...@@ -16,17 +17,25 @@ import com.baosight.hggp.hg.xs.domain.Company; ...@@ -16,17 +17,25 @@ import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Dept; import com.baosight.hggp.hg.xs.domain.Dept;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.*; import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @Author wwl * @Author wwl
* @Date 2024/5/6 19:48 * @Date 2024/5/6 19:48
...@@ -46,14 +55,20 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -46,14 +55,20 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo; return inInfo;
} }
/**
* 查询
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "项目立项", operType = "查询", operDesc = "查询") @OperationLogAnnotation(operModul = "项目立项", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001()); // 设置动态列
Map map = new HashMap(); HGPZUtils.HgPz020.buildDynamicColumn(inInfo, DynamicTableEnum.HGSC001);
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode()); inInfo = super.query(inInfo, HgScSqlConstant.HgSc001.DYNAMIC_QUERY, new HGSC001());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_TYPE_BLOCK_ID), map,false); // 根据结果集填充eiMetadata
inInfo.setStatus(EiConstant.STATUS_DEFAULT); HGPZUtils.HgPz020.buildEiMetadata(inInfo, HGSC001.class);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
......
...@@ -136,6 +136,17 @@ ...@@ -136,6 +136,17 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
</isEmpty>
</dynamic>
</sql>
<select id="get" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001"> <select id="get" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
...@@ -148,14 +159,7 @@ ...@@ -148,14 +159,7 @@
<include refid="column"/> <include refid="column"/>
FROM ${hggpSchema}.HGSC001 WHERE 1=1 FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="customCondition"/> <include refid="customCondition"/>
<dynamic prepend="ORDER BY"> <include refid="orderBy"/>
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
</isEmpty>
</dynamic>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
...@@ -163,6 +167,20 @@ ...@@ -163,6 +167,20 @@
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
<select id="dynamicQuery" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT
<isEmpty property="dynamicColumn">ID as "id"</isEmpty>
<isNotEmpty property="dynamicColumn">$dynamicColumn$</isNotEmpty>
FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="customCondition"/>
<include refid="orderBy"/>
</select>
<select id="dynamicCount" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="customCondition"/>
</select>
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGSC001 (id, INSERT INTO ${hggpSchema}.HGSC001 (id,
company_code, <!-- 公司编码 --> company_code, <!-- 公司编码 -->
......
...@@ -2,7 +2,6 @@ package com.baosight.hggp.util; ...@@ -2,7 +2,6 @@ package com.baosight.hggp.util;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.HGConstants; import com.baosight.hggp.common.HGConstants;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.data.ibatis.dao.Dao; import com.baosight.iplat4j.core.data.ibatis.dao.Dao;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -16,7 +15,13 @@ import com.baosight.iplat4j.core.web.threadlocal.UserSession; ...@@ -16,7 +15,13 @@ import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import java.util.*; import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -70,7 +75,7 @@ public class CommonMethod { ...@@ -70,7 +75,7 @@ public class CommonMethod {
if (selectParams == null) { if (selectParams == null) {
selectParams = new HashMap<>(); selectParams = new HashMap<>();
} }
selectParams.put("accountCode", UserSessionUtils.getAccountCode()); // selectParams.put("accountCode", UserSessionUtils.getAccountCode());
/* 遍历每个数据源 */ /* 遍历每个数据源 */
for (DdynamicEnum tableParam : tableParams) { for (DdynamicEnum tableParam : tableParams) {
/* 编辑块名称 */ /* 编辑块名称 */
......
...@@ -124,6 +124,8 @@ public class DocExcelUtils { ...@@ -124,6 +124,8 @@ public class DocExcelUtils {
f.set(obj, Integer.parseInt(cellValue)); f.set(obj, Integer.parseInt(cellValue));
} else if (f.getType() == Double.class || f.getType() == double.class) { } else if (f.getType() == Double.class || f.getType() == double.class) {
f.set(obj, Double.parseDouble(cellValue)); f.set(obj, Double.parseDouble(cellValue));
} else if (f.getType() == Long.class || f.getType() == long.class) {
f.set(obj, Long.parseLong(cellValue));
} else if (f.getType() == BigDecimal.class) { } else if (f.getType() == BigDecimal.class) {
f.set(obj, new BigDecimal(cellValue)); f.set(obj, new BigDecimal(cellValue));
} else { } else {
......
...@@ -192,8 +192,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao { ...@@ -192,8 +192,7 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
*/ */
private void setAccountCode(String name, Map parameters) { private void setAccountCode(String name, Map parameters) {
// 需要过滤部分sql name,否则会形成死循环 // 需要过滤部分sql name,否则会形成死循环
String[] serviceFilter = {"HGXSUser", "HGPZ009"}; if (StringUtils.startsWithAny(name, CommonConstant.AuthFilter.ACCOUNT)) {
if (StringUtils.startsWithAny(name, serviceFilter)) {
return; return;
} }
// 本来是BUG,避免业务代码改动依然保持原逻辑ADMIN时依然置空 // 本来是BUG,避免业务代码改动依然保持原逻辑ADMIN时依然置空
...@@ -221,8 +220,8 @@ public class SqlMapDaoLogProxy extends SqlMapDao { ...@@ -221,8 +220,8 @@ public class SqlMapDaoLogProxy extends SqlMapDao {
} }
// 需要过滤部分sql name,否则会形成死循环;admin账户不需要校验 // 需要过滤部分sql name,否则会形成死循环;admin账户不需要校验
String loginName = UserSessionUtils.getLoginName(); String loginName = UserSessionUtils.getLoginName();
String[] serviceFilter = {"HGXSUser", "HGXSOrg", "HGXSUserGroup", "HGPZ009", "HGPZ010.query"}; if (StringUtils.startsWithAny(name, CommonConstant.AuthFilter.DATA)
if (StringUtils.startsWithAny(name, serviceFilter) || "admin".equalsIgnoreCase(loginName)) { || "admin".equalsIgnoreCase(loginName)) {
return; return;
} }
// 是否启用数据权限 // 是否启用数据权限
......
...@@ -120,6 +120,8 @@ ...@@ -120,6 +120,8 @@
<!--配置--> <!--配置-->
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005.xml"/> <sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005.xml"/>
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"/> <sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ020.xml"/>
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ021.xml"/>
<!--销售--> <!--销售-->
<sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX001.xml"/> <sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX001.xml"/>
......
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100]
},
columns: []
}
// 查询
$("#QUERY").on("click", query);
// 选择
$("#SELECT").on("click", select);
// 删除
$("#REMOVE").on("click", remove);
// 修改排序
$("#UPDATE_SORT").on("click", updateSort);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
};
/**
* 选择
*/
let select = function () {
JSColorbox.open({
href: "HGPZ020A",
title: "<div style='text-align: center;'>字段查询</div>",
width: "95%",
height: "95%",
callbackName: selectCallback
});
}
/**
* 选择回调
*/
let selectCallback = function () {
// 刷新页面
query();
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ020", "remove", true);
}
})
}
/**
* 修改排序
*/
function updateSort() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.submitGridsData("result", "HGPZ020", "updateSort", true);
}
\ No newline at end of file
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="表字段配置">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect ename="accountCode" cname="租户" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="account_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="tableCode" cname="表名称" blockId="result" row="0" colWidth="3" filter="contains"
required="true" optionLabel="全部" template="#=valueField#-#=textField#"
valueTemplate="#=valueField#-#=textField#">
<EF:EFCodeOption codeName="app.pz.dynamicTable"/>
</EF:EFSelect>
<EF:EFInput ename="fieldCode" cname="字段英文名" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput ename="fieldName" cname="字段中文名" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true" sort="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="租户编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="accountName" cname="租户名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="tableCode" cname="表英文名" enable="false" width="120" align="left"/>
<EF:EFColumn ename="tableName" cname="表中文名" enable="false" width="160" align="left"/>
<EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="160" align="left"/>
<EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left"/>
<EF:EFColumn ename="viewSql" cname="视图语句" enable="false" width="200" align="left" sort="false"/>
<EF:EFColumn ename="sortNum" cname="排序" width="100" align="center" required="true"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"inqu_status-0-accountCode": {
change: function (e) { //获取勾选值
query();
}
}
}
IPLATUI.EFGrid = {
"result": {
exportGrid: false,
columns: []
}
}
// 查询
$("#QUERY").on("click", query);
// 确认
$("#CONFIRM").on("click", confirm);
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 选择
*/
let confirm = function () {
let accountCode = $("#inqu_status-0-accountCode").val();
if (CommonUtils.isBlank(accountCode)) {
message("请选择租户");
return;
}
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
JSUtils.submitGridsData("result", "HGPZ020A", "confirm",
true, function (res) {
message(res.msg);
if (res.status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="字段查询">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row">
<EF:EFSelect ename="accountCode" cname="租户" blockId="inqu_status" row="0" colWidth="3" filter="contains"
required="true">
<EF:EFOptions blockId="account_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect ename="tableCode" cname="表名称" blockId="result" row="0" colWidth="3" filter="contains"
required="true" optionLabel="全部" template="#=valueField#-#=textField#"
valueTemplate="#=valueField#-#=textField#">
<EF:EFCodeOption codeName="app.pz.dynamicTable"/>
</EF:EFSelect>
<EF:EFInput ename="fieldCode" cname="字段英文名" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput ename="fieldName" cname="字段中文名" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="60vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="tableCode" cname="表英文名" enable="false" width="120" align="center"/>
<EF:EFColumn ename="tableName" cname="表中文名" enable="false" width="160" align="left"/>
<EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="160" align="center"/>
<EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left"/>
<EF:EFColumn ename="viewSql" cname="视图语句" enable="false" width="200" align="left" sort="false"/>
<EF:EFColumn ename="sortNum" cname="排序" enable="false" width="80" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20, pageSizes: [20, 50, 70, 100]
}, columns: [{
field: "operator", template: function (item) {
let template = '';
if (!CommonUtils.isBlank(item.id)) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="modify(' + item.id + ')">修改</a>';
}
return template
}
}]
}
// 查询
$("#QUERY").on("click", query);
// 新增
$("#ADD").on("click", add);
// 删除
$("#REMOVE").on("click", remove);
// 导入
$("#IMPORT").on("click", importData);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
};
/**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (id) {
let params = "inqu_status-0-id=" + id;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HGPZ021A?" + params,
title: "<div style='text-align: center;'>" + (isBlank(params) ? "新增表字段" : "修改表字段")
+ "</div>",
width: "60%",
height: "70%",
callbackName: addOrUpdateCallback
});
}
/**
* 新增成功后回调
*/
let addOrUpdateCallback = function (res) {
// 刷新列表
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ021", "remove", true);
}
})
}
/**
* 导入
*/
let importData = function () {
CommonUtils.importData("HGPZ021", "表字段导入", importDataCallback);
}
/**
* 导入回调
*/
let importDataCallback = function () {
query();
}
\ No newline at end of file
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="表字段管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect ename="tableCode" cname="表名称" blockId="result" row="0" colWidth="3" filter="contains"
required="true" optionLabel="全部" template="#=valueField#-#=textField#"
valueTemplate="#=valueField#-#=textField#">
<EF:EFCodeOption codeName="app.pz.dynamicTable"/>
</EF:EFSelect>
<EF:EFInput ename="fieldCode" cname="字段英文名" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput ename="fieldName" cname="字段中文名" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true" sort="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"
sort="false"/>
<EF:EFColumn ename="tableCode" cname="表英文名" enable="false" width="120" align="center"/>
<EF:EFColumn ename="tableName" cname="表中文名" enable="false" width="160" align="left"/>
<EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="160" align="left"/>
<EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left"/>
<EF:EFColumn ename="viewSql" cname="视图SQL" enable="false" width="200" align="left" sort="false"/>
<EF:EFColumn ename="sortNum" cname="排序" enable="false" width="80" align="center"/>
<EF:EFComboColumn ename="isDefault" cname="是否默认" enable="false" width="90" align="center">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"result-0-tableCode": {
select: function (e) { //获取勾选值
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = dataItem['textField'];
if (!CommonUtils.isBlank(valueField)) {
textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
$("#result-0-tableName").val(textField);
} else {
$("#result-0-tableName").val("");
}
}
}
}
IPLATUI.EFGrid = {
"result": {
pageable: false,
exportGrid: false,
toolbarConfig: {
hidden: false,
},
columns: []
}
};
// 确认
$('#SAVE').on('click', save);
// 键盘按键
downKeyUp();
})
/**
* 保存
*/
let save = function () {
let tableCode = $("#result-0-tableCode").val();
if (isBlank(tableCode)) {
message("表名称不能为空");
return;
}
let fieldCode = $("#result-0-fieldCode").val();
if (isBlank(fieldCode)) {
message("字段英文名不能为空");
return;
}
let fieldName = $("#result-0-fieldName").val();
if (isBlank(fieldName)) {
message("字段中文名不能为空");
return;
}
JSUtils.submitGridsData("", "HGPZ021A", "save", false,
function (res) {
if (res.status > -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
}
);
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="动态表详情">
<EF:EFRegion id="result" title="数据区域">
<EF:EFInput cname="ID" blockId="result" ename="id" row="0" type="hidden"/>
<div class="row">
<EF:EFSelect ename="tableCode" cname="表名称" blockId="result" row="0" colWidth="6" ratio="2:10"
filter="contains" required="true" optionLabel="请选择" template="#=valueField#-#=textField#"
valueTemplate="#=valueField#-#=textField#">
<EF:EFCodeOption codeName="app.pz.dynamicTable"/>
</EF:EFSelect>
<EF:EFInput ename="tableName" cname="表中文名" blockId="result" row="0" type="hidden"/>
</div>
<div class="row">
<EF:EFInput ename="fieldCode" cname="字段英文名" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true"/>
</div>
<div class="row">
<EF:EFInput ename="fieldName" cname="字段中文名" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true"/>
</div>
<div class="row">
<EF:EFInput ename="viewSql" cname="视图语句" blockId="result" row="0" colWidth="6" ratio="2:10"/>
</div>
<div class="row">
<EF:EFInput ename="sortNum" cname="排序" blockId="result" row="0" colWidth="6" ratio="2:10"/>
</div>
<div class="row">
<EF:EFSelect ename="isDefault" cname="是否默认" blockId="result" row="0" colWidth="6" ratio="2:10"
required="true">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFSelect>
</div>
<br/>
</EF:EFRegion>
</EF:EFPage>
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
<script> <script>
var ctx = "${ctx}"; var ctx = "${ctx}";
</script> </script>
<head>
</head>
<EF:EFPage title="项目立项"> <EF:EFPage title="项目立项">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
...@@ -32,7 +30,7 @@ ...@@ -32,7 +30,7 @@
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false"> <EF:EFGrid blockId="result" autoDraw="dynamic" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center"/>
......
...@@ -770,6 +770,23 @@ function loadChange(grid,e,field) { ...@@ -770,6 +770,23 @@ function loadChange(grid,e,field) {
} }
} }
/**
* 导入
*
* @param id 路由ID
* @param title 标题
* @param callback 回调函数
*/
let importData = function (id, title, callback) {
JSColorbox.open({
href: "HGDM91?inqu_status-0-id=" + id,
title: "<div style='text-align: center;'>" + title + "</div>",
width: "600px",
height: "250px",
callbackName: callback
});
}
// export 到全局作用域 window对象 // export 到全局作用域 window对象
$.extend(window, { $.extend(window, {
CommonUtils: { CommonUtils: {
...@@ -778,7 +795,8 @@ function loadChange(grid,e,field) { ...@@ -778,7 +795,8 @@ function loadChange(grid,e,field) {
previewFile: previewFile, previewFile: previewFile,
isBlank: isBlank, isBlank: isBlank,
hideButton: hideButton, hideButton: hideButton,
showButton: showButton showButton: showButton,
importData: importData
} }
}); });
})(window.jQuery); })(window.jQuery);
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