Commit da8fe797 by 宋祥

1.文档库优化:产品仅同步设备数据、文档按类型排序,文档浏览页面去掉下载功能

parent 95939f1c
......@@ -12,7 +12,6 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
......@@ -320,7 +319,7 @@ public class DaoUtils {
userId = MapUtils.getString(map, "updatedBy");
if (StringUtils.isBlank(userId)) {
userId = UserSession.getLoginName();
userId = userId == null || userId.length() > 32 ? "System" : userId;
userId = userId == null ? "System" : userId;
}
} catch (Exception e) {
userId = "System";
......@@ -335,7 +334,7 @@ public class DaoUtils {
} catch (Exception e) {
userName = "System";
}
map.put("updatedName", userName);
map.put("updatedName", StringUtils.isBlank(userName) ? "System" : userName);
// 修改时间
map.put("updatedTime", DateUtils.shortDateTime());
}
......
......@@ -149,6 +149,8 @@ public class DcOpenApi {
JSONArray dataJsons = new JSONArray();
dataJsons.add(DcApiUtils.buildValueJson("pageindex", pageIndex));
dataJsons.add(DcApiUtils.buildValueJson("pagesize", 100));
// 仅同步设备数据,566:成品-设备的分类ID
dataJsons.add(DcApiUtils.buildValueJson("idProductClass", 566));
String param = JSON.toJSONString(DcApiUtils.buildParamJson(dataJsons));
String result = HttpUtils.post(DeChengConst.PRODUCT_BILLLIST, param, HttpUtils.JSON_MEDIA_TYPE);
if (StringUtils.isBlank(result)) {
......
......@@ -6,11 +6,11 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
......@@ -55,7 +55,10 @@ public class ServiceHGWD002 extends ServiceBase {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
// 管理员不做权限验证
if (!HgWdUtils.HgWd009.isManager()) {
queryRow.put(User.FIELD_USER_ID, UserSessionUtils.getUserId());
}
builder(inInfo);
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (Exception e) {
......
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
......@@ -93,9 +94,13 @@ public class ServiceHGWD002A extends ServiceEPBase {
public List queryChildNode(String parentId) {
List<Map> results = new ArrayList();
Map queryMap = new HashMap();
queryMap.put("fileId", parentId);
queryMap.put("parentId", parentId);
queryMap.put("userId", UserSessionUtils.getLoginName());
if (!HgWdUtils.HgWd009.isManager()) {
queryMap.put("userId", UserSessionUtils.getLoginName());
}
queryMap.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
queryMap.put("orderBy", "B.DOC_TYPE ASC, B.DOC_NAME ASC");
List<HGWD002> dbWd002s = dao.query(HGWD002.QUERY, queryMap);
if (CollectionUtils.isEmpty(dbWd002s)) {
return results;
......
......@@ -61,7 +61,10 @@
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
B.BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #parentId# )
<isNotEmpty prepend=" AND " property="userId">
B.BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId#
AND FILE_ID = #parentId#)
</isNotEmpty>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
LEFT(B.CREATED_TIME,8) = replace(#createdTime#,'-','')
......
......@@ -115,7 +115,7 @@
PRODUCT_NAME = #productName#, <!-- 产品名称 -->
PRODUCT_MODEL = #productModel#, <!-- 产品型号 -->
UNIT = #unit#, <!-- 产品单位 -->
CLASSIFY = #classify#, <!-- 产品分类 -->
CLASSIFY = #classify# <!-- 产品分类 -->
WHERE ID = #id#
</update>
......
......@@ -370,7 +370,8 @@ function otherDownload(isRoot, docId) {
if (isRoot) {
$("#descSpan").html("文件预览区域...");
} else {
$("#descSpan").html("该文件暂不支持预览,点击<a href='" + downloadHref(docId, false)
+ "' target='_blank'>下载</a>");
$("#descSpan").html("该文件暂不支持预览");
// $("#descSpan").html("该文件暂不支持预览,点击<a href='" + downloadHref(docId, false)
// + "' target='_blank'>下载</a>");
}
}
......@@ -14,7 +14,7 @@
/*align-items: flex-start;*/
height: 100%;
width: 100%;
overflow: scroll;
overflow: auto;
}
.center-flex {
......@@ -75,7 +75,7 @@
<span id="descSpan" style="font-weight: bold;font-size: 18px">文件预览区域...</span>
</div>
<%-- 文本预览 --%>
<div id="textContainer" class="center-flex">
<div id="textContainer" class="left-flex">
<pre id="textSpan" class="textSpan"></pre>
</div>
<%-- docx文件预览--%>
......
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