Commit 89b7313f by 宋祥

Merge branch 'dev-sx' of http://git.pseer.com:8800/platform/hg-smart into dev

parents aaac300d cac8cdc4
...@@ -316,7 +316,7 @@ public class HGKCUtils { ...@@ -316,7 +316,7 @@ public class HGKCUtils {
newKc010.setWhCode(whCode); newKc010.setWhCode(whCode);
newKc010.setInventCode(inventCode); newKc010.setInventCode(inventCode);
newKc010.setInvQty(qty); newKc010.setInvQty(qty);
newKc010.setInvUnitWeight(unitWeight); newKc010.setInvUnitWeight(unitWeight == null ? weight.divide(qty, 3, RoundingMode.HALF_UP) : unitWeight);
newKc010.setInvWeight(weight); newKc010.setInvWeight(weight);
return newKc010; return newKc010;
} }
......
...@@ -138,8 +138,7 @@ public class ServiceHGPZ009 extends ServiceBase { ...@@ -138,8 +138,7 @@ public class ServiceHGPZ009 extends ServiceBase {
dao.insert(HGPZ009.INSERT, fPz009); dao.insert(HGPZ009.INSERT, fPz009);
// 默认新增企业管理员账号 // 默认新增企业管理员账号
String userId = fPz009.getLoginPrefix() + "0000"; String userId = fPz009.getLoginPrefix() + "0000";
HGXSTools.XsUser.addUser(fPz009.getAccountCode(), userId, fPz009.getAccountName(), HGXSTools.XsUser.addUser(fPz009.getAccountCode(), userId, fPz009.getAccountName());
null, null, null, "1");
// 关联企业管理员角色 // 关联企业管理员角色
this.insertGroupMember(fPz009, userId); this.insertGroupMember(fPz009, userId);
// 新增组织机构顶级 // 新增组织机构顶级
......
...@@ -37,6 +37,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -37,6 +37,7 @@ public class HGWD003 extends DaoEPBase {
public static final String FIELD_USER_NAME = "userName"; /* 用户姓名*/ public static final String FIELD_USER_NAME = "userName"; /* 用户姓名*/
public static final String FIELD_REMARK = "remark"; /* 备注*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_IS_PROJECT_MANAGER = "isProjectManager"; /* 是否项目经理,0=否,1=是*/ public static final String FIELD_IS_PROJECT_MANAGER = "isProjectManager"; /* 是否项目经理,0=否,1=是*/
public static final String FIELD_EXT_ID = "extId"; /* 外部系统主键ID*/
public static final String FIELD_ORG_ID = "orgId"; /* 部门编码*/ public static final String FIELD_ORG_ID = "orgId"; /* 部门编码*/
public static final String FIELD_ORG_CNAME = "orgCname"; /* 部门名称*/ public static final String FIELD_ORG_CNAME = "orgCname"; /* 部门名称*/
...@@ -55,6 +56,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -55,6 +56,7 @@ public class HGWD003 extends DaoEPBase {
public static final String COL_USER_NAME = "USER_NAME"; /* 用户姓名*/ public static final String COL_USER_NAME = "USER_NAME"; /* 用户姓名*/
public static final String COL_REMARK = "REMARK"; /* 备注*/ public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_IS_PROJECT_MANAGER = "IS_PROJECT_MANAGER"; /* 是否项目经理,0=否,1=是*/ public static final String COL_IS_PROJECT_MANAGER = "IS_PROJECT_MANAGER"; /* 是否项目经理,0=否,1=是*/
public static final String COL_EXT_ID = "EXT_ID"; /* 外部系统主键ID*/
public static final String COL_ORG_ID = "ORG_ID"; /* 部门编码*/ public static final String COL_ORG_ID = "ORG_ID"; /* 部门编码*/
public static final String COL_ORG_CNAME = "ORG_CNAME"; /* 部门名称*/ public static final String COL_ORG_CNAME = "ORG_CNAME"; /* 部门名称*/
...@@ -79,6 +81,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -79,6 +81,7 @@ public class HGWD003 extends DaoEPBase {
private String userName = " "; /* 用户姓名*/ private String userName = " "; /* 用户姓名*/
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
private Integer isProjectManager = 0; /* 是否项目经理,0=否,1=是*/ private Integer isProjectManager = 0; /* 是否项目经理,0=否,1=是*/
private String extId = " "; /* 外部系统主键ID*/
private String orgId = " "; /* 部门编码*/ private String orgId = " "; /* 部门编码*/
private String orgCname = " "; /* 部门名称*/ private String orgCname = " "; /* 部门名称*/
...@@ -149,6 +152,10 @@ public class HGWD003 extends DaoEPBase { ...@@ -149,6 +152,10 @@ public class HGWD003 extends DaoEPBase {
eiColumn.setDescName("是否项目经理"); eiColumn.setDescName("是否项目经理");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_EXT_ID);
eiColumn.setDescName("外部系统主键ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ORG_ID); eiColumn = new EiColumn(FIELD_ORG_ID);
eiColumn.setDescName("部门编码"); eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -392,6 +399,14 @@ public class HGWD003 extends DaoEPBase { ...@@ -392,6 +399,14 @@ public class HGWD003 extends DaoEPBase {
this.isProjectManager = isProjectManager; this.isProjectManager = isProjectManager;
} }
public String getExtId() {
return extId;
}
public void setExtId(String extId) {
this.extId = extId;
}
public String getOrgId() { public String getOrgId() {
return orgId; return orgId;
} }
...@@ -431,6 +446,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -431,6 +446,7 @@ public class HGWD003 extends DaoEPBase {
setUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_NAME)), userName)); setUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_NAME)), userName));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark)); setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setIsProjectManager(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_PROJECT_MANAGER)), isProjectManager)); setIsProjectManager(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_PROJECT_MANAGER)), isProjectManager));
setExtId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_EXT_ID)), extId));
setOrgId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_ID)), orgId)); setOrgId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_ID)), orgId));
setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname)); setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname));
} }
...@@ -457,6 +473,7 @@ public class HGWD003 extends DaoEPBase { ...@@ -457,6 +473,7 @@ public class HGWD003 extends DaoEPBase {
map.put(FIELD_USER_NAME, StringUtils.toString(userName, eiMetadata.getMeta(FIELD_USER_NAME))); map.put(FIELD_USER_NAME, StringUtils.toString(userName, eiMetadata.getMeta(FIELD_USER_NAME)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK))); map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_IS_PROJECT_MANAGER, StringUtils.toString(isProjectManager, eiMetadata.getMeta(FIELD_IS_PROJECT_MANAGER))); map.put(FIELD_IS_PROJECT_MANAGER, StringUtils.toString(isProjectManager, eiMetadata.getMeta(FIELD_IS_PROJECT_MANAGER)));
map.put(FIELD_EXT_ID, StringUtils.toString(extId, eiMetadata.getMeta(FIELD_EXT_ID)));
map.put(FIELD_ORG_ID, StringUtils.toString(orgId, eiMetadata.getMeta(FIELD_ORG_ID))); map.put(FIELD_ORG_ID, StringUtils.toString(orgId, eiMetadata.getMeta(FIELD_ORG_ID)));
map.put(FIELD_ORG_CNAME, StringUtils.toString(orgCname, eiMetadata.getMeta(FIELD_ORG_CNAME))); map.put(FIELD_ORG_CNAME, StringUtils.toString(orgCname, eiMetadata.getMeta(FIELD_ORG_CNAME)));
......
...@@ -19,6 +19,8 @@ import java.util.List; ...@@ -19,6 +19,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 文档预览
*
* @author:songx * @author:songx
* @date:2024/5/9,11:04 * @date:2024/5/9,11:04
*/ */
......
...@@ -19,6 +19,8 @@ import java.util.List; ...@@ -19,6 +19,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 文档下载
*
* @author:songx * @author:songx
* @date:2024/5/9,11:04 * @date:2024/5/9,11:04
*/ */
......
...@@ -5,8 +5,15 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -5,8 +5,15 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
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.*; import com.baosight.iplat4j.core.ei.*;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.ef.ui.tree.TreeService; import com.baosight.iplat4j.ef.ui.tree.TreeService;
...@@ -169,17 +176,17 @@ public class ServiceHGWD001D extends TreeService { ...@@ -169,17 +176,17 @@ public class ServiceHGWD001D extends TreeService {
} }
public EiInfo searchNodePath(EiInfo inInfo) { public EiInfo searchNodePath(EiInfo inInfo) {
String leafName = (String)inInfo.get("leafName"); String leafName = (String) inInfo.get("leafName");
Map map = new HashMap(); Map map = new HashMap();
List queryNodeList = this.dao.query("XSOG01.queryOrganiation", map); List queryNodeList = this.dao.query("XSOG01.queryOrganiation", map);
List nodeList = new ArrayList(); List nodeList = new ArrayList();
Iterator var6 = queryNodeList.iterator(); Iterator var6 = queryNodeList.iterator();
while(var6.hasNext()) { while (var6.hasNext()) {
Object node = var6.next(); Object node = var6.next();
String parentId = (String)((HashMap)node).get("parentOrgId"); String parentId = (String) ((HashMap) node).get("parentOrgId");
if (!"".equals(parentId.trim())) { if (!"".equals(parentId.trim())) {
((HashMap)node).put("parentId", parentId); ((HashMap) node).put("parentId", parentId);
nodeList.add(node); nodeList.add(node);
} }
} }
...@@ -189,4 +196,112 @@ public class ServiceHGWD001D extends TreeService { ...@@ -189,4 +196,112 @@ public class ServiceHGWD001D extends TreeService {
inInfo.set("allPath", allPath); inInfo.set("allPath", allPath);
return inInfo; return inInfo;
} }
/**
* 树节点查询
*
* @param inInfo
* @return
*/
public EiInfo queryTree(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryMap, CommonConstant.Field.NODE);
if (CommonConstant.Field.ROOT.equals(node) || CommonConstant.Field.ROOT2.equals(node)) {
inInfo.addBlock(node).setRows(queryTopNode(node));
} else {
inInfo.addBlock(node).setRows(queryChildNode(node));
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败");
}
return inInfo;
}
/**
* 查询树根
*
* @return
*/
public List queryTopNode(String parentId) {
List<Map> results = new ArrayList();
List<HGSC001> dbSc001s = dao.query(HGSC001.QUERY, new HashMap<>());
if (CollectionUtils.isEmpty(dbSc001s)) {
return results;
}
for (HGSC001 dbSc001 : dbSc001s) {
String text = "[" + dbSc001.getProjCode() + "]" + dbSc001.getProjName();
Map leafMap = buildLeaf(parentId, dbSc001.getProjCode(), text, HgWdConstant.LeafType.P);
leafMap.put("projCode", dbSc001.getProjCode());
leafMap.put("projName", dbSc001.getProjName());
leafMap.put("ename", dbSc001.getProjCode());
leafMap.put("type", "1");
leafMap.put("leafLevel", "0");
results.add(leafMap);
}
// 设置叶子节点
setTreeNodeLeaf(results);
return results;
}
/**
* 查询叶子节点
*
* @param parentId
* @return
*/
public List queryChildNode(String parentId) {
List<Map> results = new ArrayList();
Map queryMap = new HashMap();
queryMap.put("parentId", parentId);
List<HGWD001> dbWd001s = dao.query(HGWD001.QUERY, queryMap);
if (CollectionUtils.isEmpty(dbWd001s)) {
return results;
}
for (HGWD001 dbWd001 : dbWd001s) {
Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C);
leafMap.put("projCode", dbWd001.getProjCode());
leafMap.put("projName", dbWd001.getProjName());
leafMap.put("ename", dbWd001.getProjCode());
leafMap.put("type", dbWd001.getFileType());
leafMap.put("leafLevel", dbWd001.getLeafLevel());
results.add(leafMap);
}
// 设置叶子节点
setTreeNodeLeaf(results);
return results;
}
/**
* 设置叶子节点是否可以展开
*
* @param nodes
*/
private void setTreeNodeLeaf(List<Map> nodes) {
if (CollectionUtils.isEmpty(nodes)) {
return;
}
List<String> labels = ObjectUtils.listKey(nodes, "label");
Map<String, Integer> resultMap = HGWDTools.HgWd001.countByParent(labels);
for (Map node : nodes) {
Integer cnt = resultMap == null ? null : resultMap.get(node.get("label"));
node.put("leaf", cnt == null || cnt == 0 ? 1 : 0);
}
}
/**
* 构建叶子节点
*
* @param parentId
* @param label
* @param text
*/
private HashMap buildLeaf(String parentId, String label, String text, String leafType) {
HashMap<String, String> leafMap = new HashMap();
leafMap.put("parentId", parentId);
leafMap.put("label", label);
leafMap.put("text", text);
leafMap.put("leafType", leafType);
return leafMap;
}
} }
...@@ -73,69 +73,6 @@ public class ServiceHGWD003 extends ServiceEPBase { ...@@ -73,69 +73,6 @@ public class ServiceHGWD003 extends ServiceEPBase {
} }
/** /**
* 树节点查询
*
* @param inInfo
* @return
*/
public EiInfo queryTree(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryMap, CommonConstant.Field.NODE);
if (CommonConstant.Field.ROOT.equals(node) || CommonConstant.Field.ROOT2.equals(node)) {
inInfo.addBlock(node).setRows(queryTopNode(node));
} else {
inInfo.addBlock(node).setRows(queryChildNode(node));
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败");
}
return inInfo;
}
/**
* 查询树根
*
* @return
*/
public List queryTopNode(String parentLabel) {
List<Map> results = new ArrayList();
List<HGSC001> dbSc001s = dao.query(HGSC001.QUERY, new HashMap<>());
if (CollectionUtils.isEmpty(dbSc001s)) {
return results;
}
for (HGSC001 dbSc001 : dbSc001s) {
String text = "[" + dbSc001.getProjCode() + "]" + dbSc001.getProjName();
results.add(buildLeaf(parentLabel, dbSc001.getProjCode(), text, HgWdConstant.LeafType.P));
}
// 设置叶子节点
setTreeNodeLeaf(results);
return results;
}
/**
* 查询叶子节点
*
* @param parentLabel
* @return
*/
public List queryChildNode(String parentLabel) {
List<Map> results = new ArrayList();
Map queryMap = new HashMap();
queryMap.put("parentId", parentLabel);
List<HGWD001> dbWd001s = dao.query(HGWD001.QUERY, queryMap);
if (CollectionUtils.isEmpty(dbWd001s)) {
return results;
}
for (HGWD001 dbWd001 : dbWd001s) {
results.add(buildLeaf(parentLabel, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C));
}
// 设置叶子节点
setTreeNodeLeaf(results);
return results;
}
/**
* 搜索树节点 * 搜索树节点
* *
* @param inInfo * @param inInfo
...@@ -247,21 +184,4 @@ public class ServiceHGWD003 extends ServiceEPBase { ...@@ -247,21 +184,4 @@ public class ServiceHGWD003 extends ServiceEPBase {
return inInfo; return inInfo;
} }
/**
* 设置叶子节点是否可以展开
*
* @param nodes
*/
private void setTreeNodeLeaf(List<Map> nodes) {
if (CollectionUtils.isEmpty(nodes)) {
return;
}
List<String> labels = ObjectUtils.listKey(nodes, "label");
Map<String, Integer> resultMap = HGWDTools.HgWd001.countByParent(labels);
for (Map node : nodes) {
Integer cnt = resultMap == null ? null : resultMap.get(node.get("label"));
node.put("leaf", cnt == null || cnt == 0 ? 1 : 0);
}
}
} }
...@@ -51,7 +51,7 @@ public class ServiceHGWD003A extends ServiceEPBase { ...@@ -51,7 +51,7 @@ public class ServiceHGWD003A extends ServiceEPBase {
} }
/** /**
* 树节点查询 * 查询
* *
* @param inInfo * @param inInfo
* @return * @return
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
A.FILE_ID as "fileId", <!-- 文件ID --> A.FILE_ID as "fileId", <!-- 文件ID -->
A.USER_ID as "userId", <!-- 用户ID --> A.USER_ID as "userId", <!-- 用户ID -->
A.REMARK as "remark", <!-- 备注 --> A.REMARK as "remark", <!-- 备注 -->
A.IS_PROJECT_MANAGER as "isProjectManager" <!-- 是否项目经理,0=否,1=是 --> A.IS_PROJECT_MANAGER as "isProjectManager", <!-- 是否项目经理,0=否,1=是 -->
A.EXT_ID as "extId" <!-- 外部系统ID -->
</sql> </sql>
<sql id="columnB"> <sql id="columnB">
...@@ -106,11 +107,12 @@ ...@@ -106,11 +107,12 @@
CREATED_NAME, <!-- 记录创建名称 --> CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 --> CREATED_TIME, <!-- 记录创建时间 -->
FILE_ID, <!-- 文件ID --> FILE_ID, <!-- 文件ID -->
USER_ID, <!-- 文件ID --> USER_ID, <!-- 用户ID -->
REMARK <!-- 备注 --> REMARK, <!-- 备注 -->
EXT_ID <!-- 外部系统ID -->
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#fileId#, #userId#, #remark# #fileId#, #userId#, #remark#, #extId#
) )
</insert> </insert>
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
A.GENDER as "gender", <!-- 性别 --> A.GENDER as "gender", <!-- 性别 -->
A.MOBILE as "mobile", <!-- 手机号 --> A.MOBILE as "mobile", <!-- 手机号 -->
A.EMAIL as "email", <!-- 邮箱 --> A.EMAIL as "email", <!-- 邮箱 -->
A.ACCOUNT_CODE as "accountCode" <!-- 企业编码 --> A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.EXT_ID as "extId" <!-- 外部系统主键ID -->
</sql> </sql>
<sql id="columnB"> <sql id="columnB">
......
...@@ -47,6 +47,7 @@ public class User extends DaoEPBase { ...@@ -47,6 +47,7 @@ public class User extends DaoEPBase {
public static final String FIELD_DEP_NAME = "depName"; /* 部门名称*/ public static final String FIELD_DEP_NAME = "depName"; /* 部门名称*/
public static final String FIELD_ID_CODE = "idCode"; public static final String FIELD_ID_CODE = "idCode";
public static final String FIELD_ID_CARD = "idCard"; public static final String FIELD_ID_CARD = "idCard";
public static final String FIELD_EXT_ID = "extId";
public static final String COL_USER_ID = "USER_ID"; /* 用户ID*/ public static final String COL_USER_ID = "USER_ID"; /* 用户ID*/
public static final String COL_LOGIN_NAME = "LOGIN_NAME"; public static final String COL_LOGIN_NAME = "LOGIN_NAME";
...@@ -101,6 +102,7 @@ public class User extends DaoEPBase { ...@@ -101,6 +102,7 @@ public class User extends DaoEPBase {
private String depName = ""; /* 部门名称*/ private String depName = ""; /* 部门名称*/
private String idCode = ""; private String idCode = "";
private String idCard = ""; private String idCard = "";
private String extId = "";
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -207,6 +209,11 @@ public class User extends DaoEPBase { ...@@ -207,6 +209,11 @@ public class User extends DaoEPBase {
eiColumn = new EiColumn(FIELD_ID_CARD); eiColumn = new EiColumn(FIELD_ID_CARD);
eiColumn.setDescName("身份证号码"); eiColumn.setDescName("身份证号码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_EXT_ID);
eiColumn.setDescName("外部系统ID");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -589,6 +596,14 @@ public class User extends DaoEPBase { ...@@ -589,6 +596,14 @@ public class User extends DaoEPBase {
this.idCard = idCard; this.idCard = idCard;
} }
public String getExtId() {
return extId;
}
public void setExtId(String extId) {
this.extId = extId;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -622,6 +637,7 @@ public class User extends DaoEPBase { ...@@ -622,6 +637,7 @@ public class User extends DaoEPBase {
setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_NAME)), depName)); setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_NAME)), depName));
setIdCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ID_CODE)), idCode)); setIdCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ID_CODE)), idCode));
setIdCard(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ID_CARD)), idCard)); setIdCard(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ID_CARD)), idCard));
setExtId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_EXT_ID)), extId));
} }
/** /**
...@@ -656,6 +672,7 @@ public class User extends DaoEPBase { ...@@ -656,6 +672,7 @@ public class User extends DaoEPBase {
map.put(FIELD_DEP_NAME, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_DEP_NAME))); map.put(FIELD_DEP_NAME, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_DEP_NAME)));
map.put(FIELD_ID_CODE, StringUtils.toString(idCode, eiMetadata.getMeta(FIELD_ID_CODE))); map.put(FIELD_ID_CODE, StringUtils.toString(idCode, eiMetadata.getMeta(FIELD_ID_CODE)));
map.put(FIELD_ID_CARD, StringUtils.toString(idCard, eiMetadata.getMeta(FIELD_ID_CARD))); map.put(FIELD_ID_CARD, StringUtils.toString(idCard, eiMetadata.getMeta(FIELD_ID_CARD)));
map.put(FIELD_EXT_ID, StringUtils.toString(extId, eiMetadata.getMeta(FIELD_EXT_ID)));
return map; return map;
} }
......
...@@ -304,7 +304,7 @@ public class ServiceHGXSUser extends ServiceBase { ...@@ -304,7 +304,7 @@ public class ServiceHGXSUser extends ServiceBase {
String isLock = HGXSUtils.XsUser.convertIsLock(dcUserList.getStatus()); String isLock = HGXSUtils.XsUser.convertIsLock(dcUserList.getStatus());
// 新增用户 // 新增用户
HGXSTools.XsUser.addUser(dbPz009.getAccountCode(), userId, dcUser.getName(), dcUser.getSex(), dcUser.getEmail(), HGXSTools.XsUser.addUser(dbPz009.getAccountCode(), userId, dcUser.getName(), dcUser.getSex(), dcUser.getEmail(),
dcUser.getCardid(), isLock); dcUser.getCardid(), isLock, dcUserList.getOrd().toString());
// 新增用户和组织机构关系 // 新增用户和组织机构关系
Map addMap = new HashMap(); Map addMap = new HashMap();
addMap.put("orgId", dbPz009.getLoginPrefix() + dcUser.getOrgsid()); addMap.put("orgId", dbPz009.getLoginPrefix() + dcUser.getOrgsid());
...@@ -329,6 +329,7 @@ public class ServiceHGXSUser extends ServiceBase { ...@@ -329,6 +329,7 @@ public class ServiceHGXSUser extends ServiceBase {
// -1:冻结用户,1:正常 // -1:冻结用户,1:正常
String isLock = HGXSUtils.XsUser.convertIsLock(dcUserList.getStatus()); String isLock = HGXSUtils.XsUser.convertIsLock(dcUserList.getStatus());
updateMap.put(User.FIELD_IS_LOCKED, isLock); updateMap.put(User.FIELD_IS_LOCKED, isLock);
updateMap.put(User.FIELD_EXT_ID, dcUserList.getOrd());
updateMap.put(User.FIELD_REC_REVISOR, "System"); updateMap.put(User.FIELD_REC_REVISOR, "System");
updateMap.put(User.FIELD_REC_REVISE_TIME, DateUtils.shortDateTime()); updateMap.put(User.FIELD_REC_REVISE_TIME, DateUtils.shortDateTime());
dao.update(HgXsSqlConstant.HgXsUser.UPDATE_DC_USER, updateMap); dao.update(HgXsSqlConstant.HgXsUser.UPDATE_DC_USER, updateMap);
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
GENDER as "gender", <!-- 性别 --> GENDER as "gender", <!-- 性别 -->
MOBILE as "mobile", <!-- 手机号 --> MOBILE as "mobile", <!-- 手机号 -->
EMAIL as "email", <!-- 邮箱 --> EMAIL as "email", <!-- 邮箱 -->
ACCOUNT_CODE as "accountCode" <!-- 企业编码 --> ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
EXT_ID as extId <!-- 外部系统主键ID -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -124,6 +125,7 @@ ...@@ -124,6 +125,7 @@
EMAIL = #email#, EMAIL = #email#,
ID_CARD = #idCard#, ID_CARD = #idCard#,
IS_LOCKED = #isLocked#, IS_LOCKED = #isLocked#,
EXT_ID = #extId#,
REC_REVISOR = #recRevisor#, REC_REVISOR = #recRevisor#,
REC_REVISE_TIME = #recReviseTime# REC_REVISE_TIME = #recReviseTime#
WHERE LOGIN_NAME = #loginName# WHERE LOGIN_NAME = #loginName#
......
...@@ -204,13 +204,25 @@ public class HGXSTools { ...@@ -204,13 +204,25 @@ public class HGXSTools {
* @param accountCode * @param accountCode
* @param userId * @param userId
* @param userName * @param userName
* @throws Exception
*/
public static void addUser(String accountCode, String userId, String userName) throws Exception {
addUser(accountCode, userId, userName, null, null, null, null, null);
}
/**
* 初始化新增用户
*
* @param accountCode
* @param userId
* @param userName
* @param gender * @param gender
* @param mobile * @param mobile
* @param idCard * @param idCard
* @param isLock * @param isLock
*/ */
public static void addUser(String accountCode, String userId, String userName, String gender, String mobile, public static void addUser(String accountCode, String userId, String userName, String gender, String mobile,
String idCard, String isLock) throws Exception { String idCard, String isLock, String extId) throws Exception {
Map inInfoRowMap = new HashMap(); Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", userId); inInfoRowMap.put("userId", userId);
inInfoRowMap.put("loginName", userId); inInfoRowMap.put("loginName", userId);
...@@ -223,6 +235,8 @@ public class HGXSTools { ...@@ -223,6 +235,8 @@ public class HGXSTools {
inInfoRowMap.put("idCard", StringUtils.isBlank(idCard) ? " " : idCard); inInfoRowMap.put("idCard", StringUtils.isBlank(idCard) ? " " : idCard);
inInfoRowMap.put("gender", HGXSUtils.XsUser.convertGender(gender)); inInfoRowMap.put("gender", HGXSUtils.XsUser.convertGender(gender));
inInfoRowMap.put("mobile", StringUtils.isBlank(mobile) ? " " : mobile); inInfoRowMap.put("mobile", StringUtils.isBlank(mobile) ? " " : mobile);
inInfoRowMap.put("isLock", isLock);
inInfoRowMap.put("extId", extId);
inInfoRowMap.put("accountCode", accountCode); inInfoRowMap.put("accountCode", accountCode);
EiInfo inInfo = new EiInfo(); EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap); inInfo.addBlock("details").addRow(inInfoRowMap);
......
...@@ -918,7 +918,7 @@ function uploadFileCallback(data) { ...@@ -918,7 +918,7 @@ function uploadFileCallback(data) {
inEiInfo.set("result-0-bizId", data.bizId); inEiInfo.set("result-0-bizId", data.bizId);
inEiInfo.set("result-0-docId", data.docId); inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-docName", data.docName); inEiInfo.set("result-0-docName", data.docName);
inEiInfo.set("result-0-docType", data.docType); inEiInfo.set("result-0-docType", isBlank(data.docType) ? "" : data.docType.substring(1));
inEiInfo.set("result-0-bizType", data.bizType); inEiInfo.set("result-0-bizType", data.bizType);
inEiInfo.set("result-0-ndocId", data.ndocId); inEiInfo.set("result-0-ndocId", data.ndocId);
let serviceName = data.operType == "add" ? "HGWD099" : "HGWD001"; let serviceName = data.operType == "add" ? "HGWD099" : "HGWD001";
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div id="menu" style="margin-top: 12px; margin-bottom: 8px"> <div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="categoryTree" ename="tree_name" textField="text" valueField="label" <EF:EFTree bindId="categoryTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parentId" hasChildren="leaf" pid="parentId"
serviceName="HGWD001D" methodName="query"> serviceName="HGWD001D" methodName="queryTree">
</EF:EFTree> </EF:EFTree>
</div> </div>
...@@ -65,16 +65,20 @@ ...@@ -65,16 +65,20 @@
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="附件详情" fitHeight="true"> <EF:EFRegion id="result" title="附件详情" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="no" personal="true" serviceName="HGWD099" queryMethod="query" deleteMethod="delete"> <EF:EFGrid blockId="result" autoDraw="no" personal="true" serviceName="HGWD099" queryMethod="query"
deleteMethod="delete">
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="180"/> <EF:EFColumn ename="docName" cname="文件名称" enable="false" width="180"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center" defaultValue="0" hidden="false"> <EF:EFColumn ename="docType" cname="文件类型" enable="false" width="110"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center"
defaultValue="0" hidden="false">
<EF:EFCodeOption codeName="hggp.hgwd.status"/> <EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/> parseFormats="['yyyyMMddHHmmss']" editType="datetime"
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center"/> dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
......
...@@ -268,13 +268,7 @@ let preview = function () { ...@@ -268,13 +268,7 @@ let preview = function () {
if (res.status > -1) { if (res.status > -1) {
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
let row = rows[i]; let row = rows[i];
let docType = row['docType']; previewDoc(row['docType'], row['docId']);
if (!isBlank(docType) && docType.toLowerCase() == ".docx") {
let url = "HGWD098?inqu_status-0-docId=" + row['docId'];
window.open(url, '_blank');
} else {
window.open(downloadHref(rows[i]['docId'], true), '_blank');
}
} }
} else { } else {
message(res.msg); message(res.msg);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div id="menu" style="margin-top: 12px; margin-bottom: 8px"> <div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="docTree" ename="node" textField="text" valueField="label" hasChildren="leaf" <EF:EFTree bindId="docTree" ename="node" textField="text" valueField="label" hasChildren="leaf"
serviceName="HGWD003" methodName="queryTree"> serviceName="HGWD001D" methodName="queryTree">
</EF:EFTree> </EF:EFTree>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -36,7 +36,7 @@ function isInteger(obj) { ...@@ -36,7 +36,7 @@ function isInteger(obj) {
* @returns {boolean} * @returns {boolean}
*/ */
function isPositiveInteger(input) { function isPositiveInteger(input) {
var pattern = /^[1-9]\d*$/; // 只能包含非零开头的数字 let pattern = /^[1-9]\d*$/; // 只能包含非零开头的数字
if (pattern.test(input)) { if (pattern.test(input)) {
return true; return true;
} else { } else {
...@@ -85,7 +85,7 @@ function message(msg) { ...@@ -85,7 +85,7 @@ function message(msg) {
* @param title * @param title
* @param msg * @param msg
*/ */
function message2(title,msg) { function message2(title, msg) {
WindowUtil({ WindowUtil({
title: title, title: title,
content: "<div class='kendo-del-message'>" + msg + "</div>" content: "<div class='kendo-del-message'>" + msg + "</div>"
...@@ -109,6 +109,21 @@ function downloadHref(docId, isPreview) { ...@@ -109,6 +109,21 @@ function downloadHref(docId, isPreview) {
} }
/** /**
* 预览
*
* @param 文件类型,例如:jpg/docx/pdf
* @param 文件ID
*/
function previewDoc(fileType, docId) {
if (!isBlank(fileType) && fileType.toLowerCase() == "docx") {
let url = "HGWD098?inqu_status-0-docId=" + docId;
window.open(url, '_blank');
} else {
window.open(downloadHref(docId, true), '_blank');
}
}
/**
* 获取窗口宽度 * 获取窗口宽度
* *
* @returns {number} * @returns {number}
......
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