Commit 97de8883 by 宋祥

Merge remote-tracking branch 'origin/dev' into dev

parents 4339bff4 ed5f3254
...@@ -22,6 +22,8 @@ public class HgWdSqlConstant { ...@@ -22,6 +22,8 @@ public class HgWdSqlConstant {
public static final String SEARCH_TREE_NODE = "HGWD001.searchTreeNode"; public static final String SEARCH_TREE_NODE = "HGWD001.searchTreeNode";
// 修改项目 // 修改项目
public static final String UPDATE_PROJECT = "HGWD001.updateProject"; public static final String UPDATE_PROJECT = "HGWD001.updateProject";
// 查询所以
public static final String QUERY_ALL = "HGWD001.queryAll";
} }
/** /**
......
...@@ -59,6 +59,12 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -59,6 +59,12 @@ public class ServiceHGWD001 extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 未选择文件目录时,返回空
String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID);
if (StringUtils.isBlank(fileId)) {
return inInfo;
}
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGWD001.QUERY,new HGWD001()); return super.query(inInfo, HGWD001.QUERY,new HGWD001());
} }
...@@ -396,7 +402,7 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -396,7 +402,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
if (!HgWdUtils.HgWd009.isManager(userId)) { if (!HgWdUtils.HgWd009.isManager(userId)) {
queryRow.put(User.FIELD_USER_ID, userId); queryRow.put(User.FIELD_USER_ID, userId);
} }
return super.query(inInfo, HGWD001.QUERY, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status1", inInfo = super.query(inInfo, HGWD001.QUERY, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status1",
"result1", "result1", null); "result1", "result1", null);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败"); LogUtils.setMsg(inInfo, e, "查询失败");
...@@ -445,7 +451,7 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -445,7 +451,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
} }
/** /**
* 复制项目列表 * 复制目录列表
* *
* @param inInfo * @param inInfo
* @return * @return
...@@ -459,7 +465,7 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -459,7 +465,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
if (!HgWdUtils.HgWd009.isManager(userId)) { if (!HgWdUtils.HgWd009.isManager(userId)) {
queryRow.put(User.FIELD_USER_ID, userId); queryRow.put(User.FIELD_USER_ID, userId);
} }
return super.query(inInfo, HGWD001.QUERY, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status2", inInfo = super.query(inInfo, HGWD001.QUERY, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status2",
"result2", "result2", null); "result2", "result2", null);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败"); LogUtils.setMsg(inInfo, e, "查询失败");
...@@ -467,26 +473,47 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -467,26 +473,47 @@ public class ServiceHGWD001 extends ServiceEPBase {
return inInfo; return inInfo;
} }
public EiInfo queryDetail2(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo, "inqu_status2");
queryRow.put(HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
// 非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName();
if (!HgWdUtils.HgWd009.isManager(userId)) {
queryRow.put(User.FIELD_USER_ID, userId);
}
inInfo = super.query(inInfo, HgWdSqlConstant.HgWd001.QUERY_ALL, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status2",
"detail2", "detail2", null);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "文档库", operType = "复制项目", operDesc = "文档库-复制项目-复制项目操作") @OperationLogAnnotation(operModul = "文档库", operType = "复制项目", operDesc = "文档库-复制项目-复制项目操作")
public EiInfo save2(EiInfo inInfo) { public EiInfo save2(EiInfo inInfo) {
try { try {
Map<String, String> queryMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.queryBlock); Map<String, String> queryMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.queryBlock);
List<HGWD001> result1Rows = MapUtils.toDaoEPBases(inInfo.getBlock("result2").getRows(), HGWD001.class); //来源目录
List<HGWD001> hgwd001List = HGWDTools.HgWd001.queryByParentId(queryMap.get(HGWD001.FIELD_PROJ_CODE), List<HGWD001> result2Rows = MapUtils.toDaoEPBases(inInfo.getBlock("result2").getRows(), HGWD001.class);
//目标目录
List<HGWD001> detail2Rows = MapUtils.toDaoEPBases(inInfo.getBlock("detail2").getRows(), HGWD001.class);
/*List<HGWD001> hgwd001List = HGWDTools.HgWd001.queryByParentId(queryMap.get(HGWD001.FIELD_PROJ_CODE),
queryMap.get(HGWD001.FIELD_PARENT_ID)); queryMap.get(HGWD001.FIELD_PARENT_ID));
if (queryMap.get("leafType").equals(HgWdConstant.LeafType.P)) { if (queryMap.get("leafType").equals(HgWdConstant.LeafType.P)) {
hgwd001List = HGWDTools.HgWd001.queryByProjCode(queryMap.get(HGWD001.FIELD_PROJ_CODE), hgwd001List = HGWDTools.HgWd001.queryByProjCode(queryMap.get(HGWD001.FIELD_PROJ_CODE),
queryMap.get(HGWD001.FIELD_PARENT_ID)); queryMap.get(HGWD001.FIELD_PARENT_ID));
} }*/
// 要复制项目 // 要复制目录集合
if (Objects.nonNull(detail2Rows)){
String parentId = result1Rows.get(0).getParentId(); String parentId = detail2Rows.get(0).getFileId().length()>0?detail2Rows.get(0).getFileId():detail2Rows.get(0).getProjCode();
if (!StringUtils.isNull(hgwd001List)) { if (!StringUtils.isNull(result2Rows)) {
hgwd001List.forEach(hgwd001 -> { result2Rows.forEach(hgwd001 -> {
hgwd001.setParentId(parentId); hgwd001.setParentId(parentId);
}); });
// 查询添加子节点 // 查询添加子节点
addNode(hgwd001List); addNode(result2Rows);
}
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -499,6 +526,7 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -499,6 +526,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
public void addNode(List<HGWD001> hgwd001List) { public void addNode(List<HGWD001> hgwd001List) {
List<String> fileIds = hgwd001List.stream().map(HGWD001::getFileId).collect(Collectors.toList()); List<String> fileIds = hgwd001List.stream().map(HGWD001::getFileId).collect(Collectors.toList());
//查询子级目录
List<HGWD001> hgwd001s = HGWDTools.HgWd001.listByParentIds(fileIds); List<HGWD001> hgwd001s = HGWDTools.HgWd001.listByParentIds(fileIds);
for (HGWD001 hgwd001 : hgwd001List) { for (HGWD001 hgwd001 : hgwd001List) {
String fileId = SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID); String fileId = SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID);
......
...@@ -9,6 +9,7 @@ import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum; ...@@ -9,6 +9,7 @@ import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.wd.utils.HgWdUtils; import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
...@@ -32,6 +33,7 @@ import java.util.HashMap; ...@@ -32,6 +33,7 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author LiuYang * @author LiuYang
...@@ -276,14 +278,19 @@ public class ServiceHGWD001D extends TreeService { ...@@ -276,14 +278,19 @@ public class ServiceHGWD001D extends TreeService {
if (CollectionUtils.isEmpty(dbSc001s)) { if (CollectionUtils.isEmpty(dbSc001s)) {
return results; return results;
} }
List<String> projCodes = dbSc001s.stream().map(HGSC001::getProjCode).distinct().collect(Collectors.toList());
List<HGWD003> hgwd003s = HGWDTools.HgWd003.list(projCodes);
for (HGSC001 dbSc001 : dbSc001s) { for (HGSC001 dbSc001 : dbSc001s) {
String text = dbSc001.getProjName() + "(" + dbSc001.getProjCode() + ")"; String text = dbSc001.getProjName() + "(" + dbSc001.getProjCode() + ")";
Map leafMap = buildLeaf(parentId, dbSc001.getProjCode(), text, HgWdConstant.LeafType.P); Map leafMap = buildLeaf(parentId, dbSc001.getProjCode(), text, HgWdConstant.LeafType.P);
Long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(dbSc001.getProjCode())).count();
leafMap.put("projCode", dbSc001.getProjCode()); leafMap.put("projCode", dbSc001.getProjCode());
leafMap.put("projName", dbSc001.getProjName()); leafMap.put("projName", dbSc001.getProjName());
leafMap.put("ename", dbSc001.getProjCode()); leafMap.put("ename", dbSc001.getProjCode());
leafMap.put("type", "1"); leafMap.put("type", "1");
leafMap.put("leafLevel", "0"); leafMap.put("leafLevel", "0");
leafMap.put("count", count);
leafMap.put("isAuth", isAuth ? "1" : "0"); leafMap.put("isAuth", isAuth ? "1" : "0");
results.add(leafMap); results.add(leafMap);
} }
...@@ -312,13 +319,17 @@ public class ServiceHGWD001D extends TreeService { ...@@ -312,13 +319,17 @@ public class ServiceHGWD001D extends TreeService {
if (CollectionUtils.isEmpty(dbWd001s)) { if (CollectionUtils.isEmpty(dbWd001s)) {
return results; return results;
} }
List<String> fileIds = dbWd001s.stream().map(HGWD001::getFileId).distinct().collect(Collectors.toList());
List<HGWD003> hgwd003s = HGWDTools.HgWd003.list(fileIds);
for (HGWD001 dbWd001 : dbWd001s) { for (HGWD001 dbWd001 : dbWd001s) {
Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C); Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C);
Long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(dbWd001.getFileId())).count();
leafMap.put("projCode", dbWd001.getProjCode()); leafMap.put("projCode", dbWd001.getProjCode());
leafMap.put("projName", dbWd001.getProjName()); leafMap.put("projName", dbWd001.getProjName());
leafMap.put("ename", dbWd001.getProjCode()); leafMap.put("ename", dbWd001.getProjCode());
leafMap.put("type", dbWd001.getFileType()); leafMap.put("type", dbWd001.getFileType());
leafMap.put("leafLevel", dbWd001.getLeafLevel()); leafMap.put("leafLevel", dbWd001.getLeafLevel());
leafMap.put("count", count);
leafMap.put("isAuth", isAuth ? "1" : "0"); leafMap.put("isAuth", isAuth ? "1" : "0");
results.add(leafMap); results.add(leafMap);
} }
......
package com.baosight.hggp.hg.wd.service; package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003; import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.wd.utils.HgWdUtils; import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
...@@ -13,8 +16,10 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -13,8 +16,10 @@ 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.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author:songx * @author:songx
...@@ -68,13 +73,23 @@ public class ServiceHGWD003A extends ServiceEPBase { ...@@ -68,13 +73,23 @@ public class ServiceHGWD003A extends ServiceEPBase {
// 获取FILE_ID // 获取FILE_ID
String fileId = MapUtils.getString(queryMap, HGWD003.FIELD_FILE_ID); String fileId = MapUtils.getString(queryMap, HGWD003.FIELD_FILE_ID);
AssertUtils.isEmpty(fileId, "请选择目录"); AssertUtils.isEmpty(fileId, "请选择目录");
List<Map> mapList =DaoBase.getInstance().query("HGWD001.queryFileChild",new HashMap<String,String>(){{
put("parentId",fileId);
}});
List<String> fileIds = mapList.stream().map(map -> MapUtils.getString(map, HGWD001.FIELD_FILE_ID)).collect(Collectors.toList());
List<HGWD003> hgwd003s = HGWDTools.HgWd003.list(fileIds);
// 判断是否是管理员或项目经理 // 判断是否是管理员或项目经理
AssertUtils.isTrue(!HgWdUtils.HgWd003.isManager(fileId), "操作失败,非项目经理不能授权人员"); AssertUtils.isTrue(!HgWdUtils.HgWd003.isManager(fileId), "操作失败,非项目经理不能授权人员");
List<HGWD003> fWd003s = MapUtils.toDaoEPBases(inInfo, HGWD003.class); List<HGWD003> fWd003s = MapUtils.toDaoEPBases(inInfo, HGWD003.class);
for (HGWD003 fWd003 : fWd003s) { for (Map resultMap: mapList) {
fWd003.setFileId(fileId); for (HGWD003 fWd003:fWd003s) {
long count = hgwd003s.stream().filter(hgwd003 -> hgwd003.getFileId().equals(resultMap.get(HGWD003.FIELD_FILE_ID)) && hgwd003.getUserId().equals(fWd003.getUserId())).count();
if (count == 0){
fWd003.setFileId(resultMap.get(HGWD003.FIELD_FILE_ID).toString());
DaoUtils.insert(HGWD003.INSERT, fWd003); DaoUtils.insert(HGWD003.INSERT, fWd003);
} }
}
}
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fWd003s.size() + "]条数据授权成功!"); inInfo.setMsg("操作成功!本次对[" + fWd003s.size() + "]条数据授权成功!");
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
COMPANY_NAME LIKE CONCAT('%', #companyName#, '%') COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode"> <isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode# PROJ_CODE like concat('%', #projCode#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%') PROJ_NAME LIKE CONCAT('%', #projName#, '%')
...@@ -215,10 +215,10 @@ ...@@ -215,10 +215,10 @@
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #projectSource#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #projectSource#,
#leafLevel#, #parentId#, #fileId#, #fileType#, #fileName#, #leafLevel#, #parentId#, #fileId#, #fileType#, #fileName#,
#docVersion#, #status#, #remark#, #releaseDate# #docVersion#, #status#, #remark#, #releaseDate#
)
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001
</selectKey> </selectKey>
)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -273,6 +273,9 @@ ...@@ -273,6 +273,9 @@
FILE_NAME as "fileName" <!-- 文件名称 --> FILE_NAME as "fileName" <!-- 文件名称 -->
FROM ${hggpSchema}.HGWD001 FROM ${hggpSchema}.HGWD001
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pEname"> <isNotEmpty prepend=" AND " property="pEname">
PARENT_ID = #pEname# PARENT_ID = #pEname#
</isNotEmpty> </isNotEmpty>
...@@ -364,4 +367,56 @@ ...@@ -364,4 +367,56 @@
WHERE PROJ_CODE = #projCode# WHERE PROJ_CODE = #projCode#
</update> </update>
<select id="queryAll" resultClass="com.baosight.hggp.hg.wd.domain.HGWD001">
select
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PROJECT_SOURCE as "projectSource", <!-- 项目来源 -->
PARENT_ID as "parentId", <!--父级ID-->
FILE_ID as "fileId", <!-- 文件ID -->
FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName" <!-- 文件名称 -->
from (
SELECT
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PROJECT_SOURCE, <!-- 项目来源 -->
PROJ_CODE as "PARENT_ID", <!--父级ID-->
'' as "FILE_ID", <!-- 文件ID -->
'' as "FILE_TYPE", <!-- 文件类型 -->
'' as "FILE_NAME" <!-- 文件名称 -->
FROM ${hggpSchema}.HGSC001 T WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code like concat('%', #projCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name like concat('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE T.PROJ_CODE = M.FILE_ID
AND M.USER_ID = #userId#
)
</isNotEmpty>
union all
SELECT
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
PROJECT_SOURCE, <!-- 项目来源 -->
PARENT_ID, <!--父级ID-->
FILE_ID, <!-- 文件ID -->
FILE_TYPE, <!-- 文件类型 -->
FILE_NAME <!-- 文件名称 -->
FROM ${hggpSchema}.HGWD001 T WHERE 1=1
<include refid="condition"/>
) a
order by a.PROJ_CODE DESC, a.PARENT_ID asc
</select>
</sqlMap> </sqlMap>
...@@ -15,7 +15,8 @@ $(function () { ...@@ -15,7 +15,8 @@ $(function () {
$("#QUERY1").on("click", query1); $("#QUERY1").on("click", query1);
$("#QUERY2").on("click", function (e) { $("#QUERY2").on("click", function (e) {
result2Grid.dataSource.page(1); //result2Grid.dataSource.page(1);
detail2Grid.dataSource.page(1);
}); });
// 分割线组件 // 分割线组件
(function () { (function () {
...@@ -120,13 +121,20 @@ $(function () { ...@@ -120,13 +121,20 @@ $(function () {
template: function (node) { template: function (node) {
var item = node.item; var item = node.item;
var title = item.text; var title = item.text;
let count = item.count;
let icon = 'fa fa-globe' let icon = 'fa fa-globe'
switch (item.leafType) { switch (item.leafType) {
case 'P': case 'P':
icon = 'fa fa-clipboard' icon = 'fa fa-clipboard'
if (count>0){
icon = 'fa fa-clipboard text-success'
}
break; break;
case 'C': case 'C':
icon = 'fa fa-folder' icon = 'fa fa-folder'
if (count>0){
icon = 'fa fa-folder text-success'
}
break; break;
} }
return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>' return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>'
...@@ -439,7 +447,7 @@ $(function () { ...@@ -439,7 +447,7 @@ $(function () {
onSuccess(ei) { onSuccess(ei) {
if (!isBlank(ei.getBlock("result"))){ if (!isBlank(ei.getBlock("result"))){
let rows = ei.getBlock("result").getMappedRows(); let rows = ei.getBlock("result").getMappedRows();
if (rows.length <= 1){ if (rows.length <= 0){
message("文件未分配人员,请先分配人员!"); message("文件未分配人员,请先分配人员!");
return; return;
}else { }else {
...@@ -463,7 +471,7 @@ $(function () { ...@@ -463,7 +471,7 @@ $(function () {
$("#CHANGE_RECORD").on("click", changeResord); $("#CHANGE_RECORD").on("click", changeResord);
// 复制附件 // 复制附件
$("#COPY_FILE").on("click", copyFile); $("#COPY_FILE").on("click", copyFile);
// 复制文件 // 复制目录
$("#COPY_PROT_FILE").on("click", copyProtFile); $("#COPY_PROT_FILE").on("click", copyProtFile);
// 预览 // 预览
$("#PREVIEW").on("click", preview); $("#PREVIEW").on("click", preview);
...@@ -505,6 +513,34 @@ $(function () { ...@@ -505,6 +513,34 @@ $(function () {
pageable: { pageable: {
pageSize: 10, pageSize: 10,
pageSizes: [10, 20, 50, 100], pageSizes: [10, 20, 50, 100],
},
query: function (e) {
let inEiInfo = new EiInfo();
let fileId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
inEiInfo.set("inqu_status2-0-parentId", fileId);
return inEiInfo;
}
},
"detail2":{
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 5,
pageSizes: [5, 10, 20, 50, 100],
},
}
};
IPLATUI.EFWindow = {
"selectProjWindow": {
close: function (e) {
// 刷新表格
resultGrid.dataSource.page(1);
}
},
"releaseWindow": {
close: function (e) {
// 刷新表格
resultGrid.dataSource.page(1);
} }
} }
}; };
...@@ -561,7 +597,9 @@ let addCallback = function (rows) { ...@@ -561,7 +597,9 @@ let addCallback = function (rows) {
*/ */
let editCallback = function (parentOrgId) { let editCallback = function (parentOrgId) {
// 回填父级ID // 回填父级ID
//$("#inqu_status-0-orgParentId").val(parentOrgId); if (parentOrgId != null){
$("#inqu_status-0-orgParentId").val(parentOrgId);
}
refreshTree(); refreshTree();
} }
...@@ -864,7 +902,7 @@ function changeResord() { ...@@ -864,7 +902,7 @@ function changeResord() {
} }
/** /**
* 复制 * 复制
*/ */
let copyFile = function () { let copyFile = function () {
let rowsDate = resultGrid.getCheckedRows(); let rowsDate = resultGrid.getCheckedRows();
...@@ -879,7 +917,7 @@ let copyFile = function () { ...@@ -879,7 +917,7 @@ let copyFile = function () {
} }
/** /**
* 复制 * 复制
*/ */
function saveFunc() { function saveFunc() {
var rows = result1Grid.getCheckedRows(); var rows = result1Grid.getCheckedRows();
...@@ -915,7 +953,7 @@ function saveFunc() { ...@@ -915,7 +953,7 @@ function saveFunc() {
} }
/** /**
* 复制项目 * 复制目录
*/ */
let copyProtFile = function () { let copyProtFile = function () {
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.parentId; let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.parentId;
...@@ -927,20 +965,27 @@ let copyProtFile = function () { ...@@ -927,20 +965,27 @@ let copyProtFile = function () {
selectOrgWindow.data("kendoWindow").center(); selectOrgWindow.data("kendoWindow").center();
selectOrgWindow.data("kendoWindow").open(); selectOrgWindow.data("kendoWindow").open();
result2Grid.dataSource.page(1); result2Grid.dataSource.page(1);
detail2Grid.dataSource.page(1);
} }
/** /**
* 复制项目 * 复制目录
*/ */
function saveProtFunc() { function saveProtFunc() {
var rows = result2Grid.getCheckedRows(); let resultRows = result2Grid.getCheckedRows();
if (rows.length == 0) { let detailRows = detail2Grid.getCheckedRows();
message("请勾选数据文件!"); if (resultRows.length == 0) {
message("请勾选来源项目目录文件!");
return; return;
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据\"确认\"操作?", { if (detailRows.length == 0){
message("请勾选目标项目目录文件!");
return;
}
let parentId = detailRows[0].parentId
JSUtils.confirm("确定对勾选中的[" + resultRows.length + "]条数据\"确认\"操作?", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result2", "HGWD001", "save2", true, JSUtils.submitGridsData("result2,detail2", "HGWD001", "save2", true,
function (ei) { function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
try { try {
...@@ -948,8 +993,9 @@ function saveProtFunc() { ...@@ -948,8 +993,9 @@ function saveProtFunc() {
$("#inqu_status2-0-projName").val(''); $("#inqu_status2-0-projName").val('');
const tree = $('#categoryTree').data('kendoTreeView'); const tree = $('#categoryTree').data('kendoTreeView');
// 刷新树节点 // 刷新树节点
tree.reload(parentId)
tree.select(); tree.select();
refreshTree();
} catch (e) { } catch (e) {
// TODO: handle exception // TODO: handle exception
} }
...@@ -980,33 +1026,26 @@ let isProjectManager = function (parentId) { ...@@ -980,33 +1026,26 @@ let isProjectManager = function (parentId) {
inEiInfo.set("inqu_status-0-fileId", parentId); inEiInfo.set("inqu_status-0-fileId", parentId);
$("#COPY_PROT_FILE").show(); $("#COPY_PROT_FILE").show();
$("#BATCH_DOWNLOAD").show(); $("#BATCH_DOWNLOAD").show();
$("#RELEASE").show();
$("#UPLOAD_FILE").show();
$("#COPY_FILE").show();
$("#PREVIEW").show();
EiCommunicator.send("HGWD001", "queryProjectManager", inEiInfo, { EiCommunicator.send("HGWD001", "queryProjectManager", inEiInfo, {
onSuccess(ei) { onSuccess(ei) {
if (ei.status != -1){ if (ei.status != -1){
switch (ei.extAttr.isManager) { switch (ei.extAttr.isManager) {
case 1: case 1:
$("#RELEASE").show();
$("#UPLOAD_FILE").show();
$("#COPY_FILE").show();
$("#PREVIEW").show();
break;
case 2: case 2:
$("#RELEASE").show(); break
$("#UPLOAD_FILE").show();
$("#COPY_FILE").show();
$("#PREVIEW").show();
break;
case 3: case 3:
$("#RELEASE").hide(); $("#RELEASE").hide();
$("#UPLOAD_FILE").show();
$("#COPY_FILE").show();
$("#PREVIEW").show();
break break
default: default:
$("#RELEASE").hide(); $("#RELEASE").hide();
$("#UPLOAD_FILE").hide(); $("#UPLOAD_FILE").hide();
$("#COPY_FILE").hide(); $("#COPY_FILE").hide();
$("#PREVIEW").hide(); $("#PREVIEW").hide();
$("#COPY_PROT_FILE").hide();
} }
} }
} }
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<EF:EFInput cname="父级Id" ename="orgParentId" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="父级Id" ename="orgParentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="登录用户" ename="userId" blockId="inqu_status" row="0" colWidth="3" value="${loginName}" type="hidden"/> <EF:EFInput cname="登录用户" ename="userId" blockId="inqu_status" row="0" colWidth="3" value="${loginName}" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/> <EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<EF:EFInput cname="件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3"> <EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.status"/> <EF:EFCodeOption codeName="hggp.hgwd.status"/>
...@@ -82,8 +82,8 @@ ...@@ -82,8 +82,8 @@
<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" hidden="true"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="100" align="center" sort="false"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="100" align="center" sort="false"/>
<EF:EFColumn ename="docName" cname="件名称" enable="false" width="180"/> <EF:EFColumn ename="docName" cname="件名称" enable="false" width="180"/>
<EF:EFColumn ename="docType" cname="件类型" enable="false" width="110" align="center"/> <EF:EFColumn ename="docType" cname="件类型" enable="false" width="110" align="center"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/> <EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center" <EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center"
defaultValue="0" hidden="false"> defaultValue="0" hidden="false">
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</div> </div>
</EF:EFWindow> </EF:EFWindow>
<%--复制选中文--%> <%--复制--%>
<EF:EFWindow id="selectOrgWindow" width="70%" height="70%" title="选择文档"> <EF:EFWindow id="selectOrgWindow" width="70%" height="70%" title="选择文档">
<EF:EFRegion id="inqu1" title="查询条件"> <EF:EFRegion id="inqu1" title="查询条件">
<div class="row"> <div class="row">
...@@ -149,32 +149,62 @@ ...@@ -149,32 +149,62 @@
</EF:EFRegion> </EF:EFRegion>
</EF:EFWindow> </EF:EFWindow>
<%--复制项目下的所以文件--%> <%--复制目录--%>
<EF:EFWindow id="selectProjWindow" width="70%" height="70%" title="选择文档"> <EF:EFWindow id="selectProjWindow" width="70%" height="90%" title="选择文档">
<EF:EFRegion id="inqu2" title="查询条件"> <EF:EFRegion id="inqu2" title="查询条件">
<div class="row"> <div class="row">
<EF:EFInput blockId="inqu_status2" row="0" ename="projCode" cname="项目编码" colWidth="3" placeholder="模糊查询项目编码"/>
<EF:EFInput blockId="inqu_status2" row="0" ename="projName" cname="项目名称" colWidth="3" placeholder="模糊查询项目名称"/> <EF:EFInput blockId="inqu_status2" row="0" ename="projName" cname="项目名称" colWidth="3" placeholder="模糊查询项目名称"/>
<EF:EFInput blockId="inqu_status2" row="0" ename="fileName" cname="目录名称" colWidth="3" placeholder="模糊查询目录名称"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result2" title="明细信息" > <EF:EFRegion id="detail2" title="目标目录信息" >
<EF:EFGrid blockId="result2" autoDraw="override" autoBind="false" isFloat="true" checkMode="single" <EF:EFGrid blockId="detail2" autoDraw="override" autoBind="false" isFloat="true" checkMode="single" queryMethod="queryDetail2">
queryMethod="query2">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/> <EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id" <%--<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true" maxLength="16" readonly="true" width="200" required="true"
align="left" filter="contains" sort="true"/> align="center" filter="contains" sort="true"/>--%>
<EF:EFColumn ename="projName" cname="项目名称" width="160" enable="true" readonly="true" align="left" <EF:EFColumn ename="projCode" cname="项目编码" width="160" enable="true" readonly="true" align="center"
required="true" hidden="true"/> required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="160" enable="true" readonly="true" align="center"
required="true"/>
<EF:EFComboColumn ename="fileType" cname="目录类型" width="100" align="center" readonly="false" required="true" defaultValue="20">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="fileName" cname="目录名称" width="160" enable="true" readonly="false" align="center" required="true"/>
<EF:EFColumn ename="fileId" cname="目录号" width="100" enable="false" readonly="true" align="center" required="false"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="result2" title="来源目录信息" >
<EF:EFGrid blockId="result2" autoDraw="override" autoBind="false" isFloat="true" checkMode="row " queryMethod="query2">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<%--<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true"/>--%>
<EF:EFColumn ename="projCode" cname="项目编码" width="160" enable="true" readonly="true" align="center"
required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="160" enable="true" readonly="true" align="center"
required="true"/>
<EF:EFComboColumn ename="fileType" cname="目录类型" width="100" align="center" readonly="false" required="true"
defaultValue="20">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="fileName" cname="目录名称" width="160" enable="true" readonly="false" align="center"
required="true"/>
<EF:EFColumn ename="fileId" cname="目录号" width="100" enable="false" readonly="true" align="center"
required="false"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFWindow> </EF:EFWindow>
<EF:EFWindow id="releaseWindow" title="发布变更" width="50%" height="30%"> <EF:EFWindow id="releaseWindow" title="发布变更" width="50%" height="30%">
<EF:EFRegion id="inqu2" title=""> <EF:EFRegion id="inqu3" title="">
<EF:EFInput blockId="inqu_status" row="0" ename="changeContent" cname="变更内容" type="textarea" colWidth="12" ratio="2:10" required="true"/> <EF:EFInput blockId="inqu_status" row="0" ename="changeContent" cname="变更内容" type="textarea" colWidth="12" ratio="2:10" required="true"/>
</EF:EFRegion> </EF:EFRegion>
<div style="display: flex;justify-content: flex-end;"> <div style="display: flex;justify-content: flex-end;">
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<EF:EFInput cname="组织编码" blockId="inqu_status" ename="fileId" row="0" type="hidden"/> <EF:EFInput cname="组织编码" blockId="inqu_status" ename="fileId" row="0" type="hidden"/>
<EF:EFInput cname="项目代码" blockId="inqu_status" ename="projCode" row="0" type="hidden"/> <EF:EFInput cname="项目代码" blockId="inqu_status" ename="projCode" row="0" type="hidden"/>
<EF:EFInput cname="层级" blockId="inqu_status" ename="leafLevel" row="0" type="hidden"/> <EF:EFInput cname="层级" blockId="inqu_status" ename="leafLevel" row="0" type="hidden"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="文件类型" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="目录类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/> <EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="fileName" cname="文件名称" placeholder="模糊查询" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="fileName" cname="目录名称" placeholder="模糊查询" colWidth="3"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true"> <EF:EFRegion id="result" title="明细信息" fitHeight="true">
...@@ -45,13 +45,13 @@ ...@@ -45,13 +45,13 @@
align="left" filter="contains" sort="true"/> align="left" filter="contains" sort="true"/>
<EF:EFColumn ename="projName" cname="所属项目" width="160" enable="true" readonly="true" align="center" <EF:EFColumn ename="projName" cname="所属项目" width="160" enable="true" readonly="true" align="center"
required="true" hidden="true"/> required="true" hidden="true"/>
<EF:EFComboColumn ename="fileType" cname="文件类型" width="100" align="center" readonly="false" required="true" <EF:EFComboColumn ename="fileType" cname="目录类型" width="100" align="center" readonly="false" required="true"
defaultValue="20"> defaultValue="20">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/> <EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="fileName" cname="文件名称" width="160" enable="true" readonly="false" align="left" <EF:EFColumn ename="fileName" cname="目录名称" width="160" enable="true" readonly="false" align="left"
required="true"/> required="true"/>
<EF:EFColumn ename="fileId" cname="文件号" width="100" enable="false" readonly="true" align="center" <EF:EFColumn ename="fileId" cname="目录号" width="100" enable="false" readonly="true" align="center"
required="false"/> required="false"/>
<EF:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false" <EF:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false"
enable="false"/> enable="false"/>
......
...@@ -34,8 +34,6 @@ $(function () { ...@@ -34,8 +34,6 @@ $(function () {
$(window).load(function () { $(window).load(function () {
// 查询 // 查询
query(); query();
// 授权按钮是否可用
showAuthButton();
}); });
/** /**
...@@ -60,7 +58,14 @@ let save = function () { ...@@ -60,7 +58,14 @@ let save = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "save", true); JSUtils.submitGridsData("result", "HGWD003", "save", true,
function (e) {
var status = e.status;
if (status !== -1) {
let fileId = $("#inqu_status-0-fileId").val();
parent.JSColorbox.setValueCallback(fileId);
}
});
} }
}); });
} }
...@@ -91,8 +96,11 @@ let auth = function () { ...@@ -91,8 +96,11 @@ let auth = function () {
* 授权回调 * 授权回调
*/ */
let authCallback = function (res) { let authCallback = function (res) {
let fileId = $("#inqu_status-0-fileId").val();
parent.JSColorbox.setValueCallback(fileId);
// 刷新页面 // 刷新页面
query(); query();
} }
/** /**
......
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