Commit 920e5b94 by liuyang

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

 Conflicts:
	src/main/webapp/HG/WD/HGWD001.js
parents 109448f2 89b7313f
...@@ -109,9 +109,8 @@ public class ServiceHGKC008 extends ServiceBase { ...@@ -109,9 +109,8 @@ public class ServiceHGKC008 extends ServiceBase {
hgkc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.RECEIVE_CODE)); hgkc008.setApplyCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.RECEIVE_CODE));
hgkc008.setStatus(HGConstant.ProductStatus.WTJ); hgkc008.setStatus(HGConstant.ProductStatus.WTJ);
DaoUtils.insert(HGKC008.INSERT, hgkc008); DaoUtils.insert(HGKC008.INSERT, hgkc008);
//移动端新增需要获取对象id信息
HGKC008 queryKC008 = HGKCTools.HgKc008.getByApplyCode(hgkc008.getApplyCode()); EiInfoUtils.addBlock(inInfo,"entity", hgkc008, HGKC008.class);
EiInfoUtils.addBlock(inInfo,"entity", queryKC008, HGKC008.class);
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!"); inInfo.setMsg("保存成功!");
......
...@@ -131,6 +131,9 @@ ...@@ -131,6 +131,9 @@
RECEIVE_TYPE <!-- 领料单类型 0:正常,1:退库 --> RECEIVE_TYPE <!-- 领料单类型 0:正常,1:退库 -->
) )
VALUES (#id#,#projCode#, #projName#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #applyCode#, #whCode#, #whName#, #status#, #receiveType#) VALUES (#id#,#projCode#, #projName#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiptDate#, #applyCode#, #whCode#, #whName#, #status#, #receiveType#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC008
</selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
......
...@@ -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);
// 新增组织机构顶级 // 新增组织机构顶级
......
...@@ -122,7 +122,7 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -122,7 +122,7 @@ public class ServiceHGSC005A extends ServiceBase {
String planCode = MapUtils.getString(queryMap, "planCode"); String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode); HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005); this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(planCode); int count = HGSCTools.THGSC005A.schedule(queryMap);
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1); dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005); DaoUtils.update(HGSC005.UPDATE, dbSc005);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-05-17 17:15:03
Version : 1.0
schema : hggp
tableName : HGSC005A
id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
mat_detail_id BIGINT NOT NULL,
tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_name VARCHAR,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
plan_code VARCHAR,
product_type TINYINT,
product_code VARCHAR,
product_name VARCHAR,
finish_date VARCHAR,
plan_start_date VARCHAR,
plan_end_date VARCHAR,
quantity TINYINT,
finish_quantity TINYINT,
unfinish_quantity TINYINT,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC005A"> <sqlMap namespace="HGSC005A">
<sql id="condition"> <sql id="condition">
<!--<include refid="HGXSDataAuth.authCondition"/>--> <!--<include refid="HGXSDataAuth.authCondition"/>-->
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -156,8 +120,7 @@ ...@@ -156,8 +120,7 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC005A">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC005A">
SELECT SELECT
id as "id", id as "id",
mat_id as "matId", <!-- 物料清单ID --> mat_id as "matId", <!-- 物料清单ID -->
......
...@@ -615,6 +615,11 @@ public class HGSCTools { ...@@ -615,6 +615,11 @@ public class HGSCTools {
} }
} }
/**
*
* @author:songx
* @date:2024/9/4,22:02
*/
public static class THGSC005A{ public static class THGSC005A{
public static HGSC005A getById(Long id){ public static HGSC005A getById(Long id){
...@@ -640,6 +645,22 @@ public class HGSCTools { ...@@ -640,6 +645,22 @@ public class HGSCTools {
return CollectionUtils.isEmpty(results) ? null : results; return CollectionUtils.isEmpty(results) ? null : results;
} }
/**
* 根据工序查询
*
* @param planCode
* @param processName
* @return
*/
public static List<HGSC005A> queryByPlanCode(String planCode, String processName) {
AssertUtils.isEmpty(planCode, "计划编码不能为空!");
Map paramMap = new HashMap();
paramMap.put(HGSC005A.FIELD_plan_code, planCode);
paramMap.put(HGSC005A.FIELD_process_name, processName);
List<HGSC005A> results = DaoBase.getInstance().query(HGSC005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
public static List<HGSC005A> queryByMatId(Long matId){ public static List<HGSC005A> queryByMatId(Long matId){
AssertUtils.isTrue(Objects.isNull(matId)||matId<=0, "物料清单ID不能为空!"); AssertUtils.isTrue(Objects.isNull(matId)||matId<=0, "物料清单ID不能为空!");
Map paramMap = new HashMap(); Map paramMap = new HashMap();
...@@ -1038,11 +1059,11 @@ public class HGSCTools { ...@@ -1038,11 +1059,11 @@ public class HGSCTools {
/** /**
* 排产 * 排产
* *
* @param planCode * @param queryMap
* @return * @return
*/ */
public static int schedule(String planCode) { public static int schedule(Map queryMap) {
List<HGSC005A> hgsc005AList = queryByPlanCode(planCode); List<HGSC005A> hgsc005AList = DaoBase.getInstance().query(HGSC005A.QUERY, queryMap);
// hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder())); // hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder()));
//通过工序编码查询工序设置 //通过工序编码查询工序设置
List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode) List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode)
...@@ -1080,9 +1101,15 @@ public class HGSCTools { ...@@ -1080,9 +1101,15 @@ public class HGSCTools {
} }
} }
for (HGSC005A planInfo : partList) { for (HGSC005A planInfo : partList) {
remainder = calculateWordHour(planInfo,hgsj001List,hgpz005List,hgpz005AList,minDate,remainder); remainder = calculateWordHour(planInfo, hgsj001List, hgpz005List, hgpz005AList, minDate, remainder);
minDate = DateUtil.toDate(planInfo.getPlanStartDate(),DateUtil.DATE10_PATTERN).compareTo(DateUtil.toDate(minDate,DateUtil.DATE10_PATTERN)) <=0?planInfo.getPlanStartDate():minDate; if (StringUtils.isBlank(minDate)) {
DaoUtils.update(HGSC005A.UPDATE,planInfo); minDate = planInfo.getPlanStartDate();
} else {
minDate = DateUtil.toDate(planInfo.getPlanStartDate(), DateUtil.DATE10_PATTERN)
.compareTo(DateUtil.toDate(minDate, DateUtil.DATE10_PATTERN)) <= 0
? planInfo.getPlanStartDate() : minDate;
}
DaoUtils.update(HGSC005A.UPDATE, planInfo);
} }
return hgsc005AList.size(); return hgsc005AList.size();
} }
......
...@@ -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
......
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* word预览
*
* @author:songx
* @date:2024/9/4,15:22
*/
public class ServiceHGWD098 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "word预览", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
...@@ -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);
......
...@@ -18,7 +18,8 @@ $(function () { ...@@ -18,7 +18,8 @@ $(function () {
$("#BNT_SCHEDULE").on("click", schedule); $("#BNT_SCHEDULE").on("click", schedule);
}, },
onSuccess: function (e) { onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){ if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete'
|| e.eiInfo.extAttr.methodName == 'update') {
query(); query();
} }
} }
...@@ -41,28 +42,9 @@ $(window).load(function () { ...@@ -41,28 +42,9 @@ $(window).load(function () {
* 排产 * 排产
*/ */
function schedule() { function schedule() {
var planCode = $("#inqu_status-0-planCode").val(); JSUtils.confirm("自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产? ", {
IPLAT.confirm({ ok: function () {
title: '提交', JSUtils.submitGridsData("result", "HGSC005A", "schedule", true);
message: '自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产?',
okFn: function () {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
EiCommunicator.send("HGSC005A", "schedule", inInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
$("#inqu_status-0-isSchedule").val('1');
NotificationUtil(ei);
resultGrid.dataSource.query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
} }
}); });
} }
...@@ -919,7 +919,7 @@ function uploadFileCallback(data) { ...@@ -919,7 +919,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);
inEiInfo.set("inqu_status-0-fileId", data.bizId); inEiInfo.set("inqu_status-0-fileId", data.bizId);
......
...@@ -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>
......
...@@ -263,21 +263,18 @@ let preview = function () { ...@@ -263,21 +263,18 @@ let preview = function () {
message("请选择数据"); message("请选择数据");
return; return;
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"预览\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001B", "add", false, JSUtils.submitGridsData("result", "HGWD001B", "add", false,
function (res) { function (res) {
if (res.status > -1) { if (res.status > -1) {
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
window.open(downloadHref(rows[i]['docId'], true), '_blank'); let row = rows[i];
previewDoc(row['docType'], row['docId']);
} }
} else { } else {
message(res.msg); message(res.msg);
} }
} }
); );
}
});
} }
/** /**
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" queryMethod="query" sort="setted"> <EF:EFGrid blockId="result" autoDraw="override" queryMethod="query" sort="setted" checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/> <EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="200" align="center" sort="false" <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="200" align="center" sort="false"
......
...@@ -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>
......
$(document).ready(function () {
let docId = $("#inqu_status-0-docId").val();
if (isBlank(docId)) {
message("文件ID不能为空");
return;
}
fetch(downloadHref(docId, true)).then(res => {
return res.arrayBuffer();
}).then(arrayBuffer => {
renderDocx(arrayBuffer);
});
});
/**
* 渲染word
*
* @param file
*/
function renderDocx(file) {
docx.renderAsync(file, document.getElementById("docx-container")).then((x) => {
console.log("docx: finished")
});
}
<!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}"/>
<script src="${ctx}/common/docxjs/jszip.min.js"></script>
<script src="${ctx}/common/docxjs/docx-preview.js"></script>
<EF:EFPage title="WORD预览">
<EF:EFRegion id="result" title="展示区域" fitHeight="true">
<EF:EFInput cname="文件ID" ename="docId" blockId="inqu_status" row="0" type="hidden"/>
<div id="docx-container"></div>
</EF:EFRegion>
</EF:EFPage>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -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