Commit a3daa8c8 by liuyang

1.修复企业log显示

parent c21d7724
......@@ -9,6 +9,7 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ009;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
......@@ -60,8 +61,8 @@ public class ServiceHPPZ009 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, "HPPZ009.query", new HPPZ009());
String projectEnv = ProjectInfo.getProjectEnv();
inInfo.setCell(EiConstant.resultBlock,ACConstants.ROW_CODE_0,"projectEnv",projectEnv);
//String projectEnv = ProjectInfo.getProjectEnv();
//inInfo.setCell(EiConstant.resultBlock,ACConstants.ROW_CODE_0,"projectEnv",projectEnv);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -172,6 +172,7 @@ public class ServiceHPSB002 extends ServiceBase {
List<HPSB002> hpsb002s = DaoBase.getInstance().query("HPSB002.queryMaxDate", map);
if (CollectionUtils.isNotEmpty(hpsb002s)) {
for (HPSB002 hpsb002: hpsb002s) {
hpsb002.setCompanyCode("Q24072514");
DaoUtils.insert("HPSB002.insertHgSb010", hpsb002);
}
}
......
......@@ -221,7 +221,7 @@
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
)
VALUES (#accountCode#, #fileName#, #equipmentType#, #equipmentCode#, #logInivalue#, #logValue#
VALUES (#companyCode#, #fileName#, #equipmentType#, #equipmentCode#, #logInivalue#, #logValue#
, #createdBy#, #createdName#, #createdTime#)
</insert>
......
......@@ -41,6 +41,7 @@ public class HPWD003 extends DaoEPBase {
public static final String FIELD_ORG_ID = "orgId"; /* 部门编码*/
public static final String FIELD_ORG_CNAME = "orgCname"; /* 部门名称*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 工厂代码*/
public static final String FIELD_DOWNLOAD_FLAG = "downloadFlag"; /* 是否可以下载,0=否,1=是*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -87,6 +88,7 @@ public class HPWD003 extends DaoEPBase {
private String orgId = " "; /* 部门编码*/
private String orgCname = " "; /* 部门名称*/
private String factoryCode = " "; /* 工厂代码*/
private Integer downloadFlag = 0; /* 是否可以下载,0=否,1=是*/
/**
* initialize the metadata.
......@@ -171,6 +173,9 @@ public class HPWD003 extends DaoEPBase {
eiColumn.setDescName("工厂代码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOWNLOAD_FLAG);
eiColumn.setDescName("是否可以下载");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -438,6 +443,14 @@ public class HPWD003 extends DaoEPBase {
this.factoryCode = factoryCode;
}
public Integer getDownloadFlag() {
return downloadFlag;
}
public void setDownloadFlag(Integer downloadFlag) {
this.downloadFlag = downloadFlag;
}
/**
* get the value from Map.
*
......@@ -465,6 +478,7 @@ public class HPWD003 extends DaoEPBase {
setOrgId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_ID)), orgId));
setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setDownloadFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_FLAG)), downloadFlag));
}
/**
......@@ -493,6 +507,7 @@ public class HPWD003 extends DaoEPBase {
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_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_DOWNLOAD_FLAG, StringUtils.toString(downloadFlag, eiMetadata.getMeta(FIELD_DOWNLOAD_FLAG)));
return map;
}
......
......@@ -17,7 +17,8 @@
A.USER_ID as "userId", <!-- 用户ID -->
A.REMARK as "remark", <!-- 备注 -->
A.IS_PROJECT_MANAGER as "isProjectManager", <!-- 是否项目经理,0=否,1=是 -->
A.FACTORY_CODE as "factoryCode"
A.FACTORY_CODE as "factoryCode",
A.DOWNLOAD_FLAG as "downloadFlag" <!-- 是否可以下载,0=否,1=是 -->
<!--A.EXT_ID as "extId" 外部系统ID -->
</sql>
......
......@@ -2101,14 +2101,14 @@ $(function () {
try {
if (loginName !== "admin"){
var info = new EiInfo()
info.set("inqu_status-0-accountCode", loginName)
EiCommunicator.send("HGPZ009", "query", info, {
info.set("inqu_status-0-companyCode", companyCode)
EiCommunicator.send("HPPZ009", "query", info, {
onSuccess: function (ei) {//返回结果集
if (ei.blocks.result !== undefined){
let results = ei.getBlock("result").getMappedRows();
if (results.length>0 && results[0].docIdPc.trim().length>0){
let src = downloadHref(results[0].docIdPc.trim(),results[0].projectEnv)
let img=`<img src="${src}" style='width:200px;height:55px;background-image: none;'/>`;
//let src = downloadHref(results[0].docIdPc.trim(),true)
let img=`<img src="${downloadHref(results[0].docIdPc.trim(),true)}" style='width:200px;height:55px;background-image: none;'/>`;
$("#sidebar .sidebar-content .side-header").html(img);
//$("#sidebar .sidebar-content .side-header").attr("src",downloadHref(results[0].docIdPc,results[0].projectEnv));
}else {
......@@ -2201,13 +2201,20 @@ function changepassword(formEname,formCname){
});
}
function downloadHref(docId,projectEnv) {
// S3地址有外网
// return IPLATUI.CONTEXT_PATH + ("run" == projectEnv ? ('/docFileDownload/' + docId)
// : ('/EU/DM/EUDM06.jsp?docId=' + docId));
// S3地址无外网
return IPLATUI.CONTEXT_PATH + ("run" == projectEnv ? ('/file/download/' + docId)
: ('/EU/DM/EUDM06.jsp?docId=' + docId));
/**
* 文件下载路径
*
* @param docId
* @param isPreview 是否预览,true:预览
* @returns {string}
*/
function downloadHref(docId, isPreview) {
if (isPreview) {
return IPLATUI.CONTEXT_PATH + '/file/download/preview/' + docId;
} else {
// S3地址必须支持公网
return IPLATUI.CONTEXT_PATH + '/file/download/' + docId;
}
}
/**
......
......@@ -12,6 +12,7 @@
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%@ page import="com.baosight.iplat4j.core.service.soa.XLocalManager" %>
<%@ page import="com.baosight.iplat4j.ed.service.PlatApplicationDynamicContext" %>
<%@ page import="com.baosight.hpjx.core.security.UserSessionUtils" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
......@@ -21,6 +22,7 @@
UserSession.web2Service(request);
String userName = UserSession.getLoginCName();
String loginName = UserSession.getLoginName();
String companyCode = UserSessionUtils.getCompanyCode();
request.setAttribute("userName", userName);
request.setAttribute("loginName", loginName);
String efSecurityToken = null;
......@@ -118,6 +120,7 @@
<c:set var="loadingIcon" value="<%=loadingIcon%>" scope="session"/>
<c:set var="SideBarIsMini" value="<%=SideBarIsMini%>" />
<c:set var="loginName" value="<%=loginName%>" />
<c:set var="companyCode" value="<%=companyCode%>" />
<!--[if IE 9]>
<html class="ie9 no-focus" xmlns="http://www.w3.org/1999/xhtml">
<![endif]-->
......@@ -555,6 +558,7 @@
var ctx = "${ctx}";
var loginName = "${loginName}";
var SideBarIsMini =${SideBarIsMini};
var companyCode = "${companyCode}";
var theme = "${theme}";
</script>
......
......@@ -48,7 +48,7 @@ $(function () {
let src = downloadHref(docId);
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;background-color: #e7e7e7" '
+ 'href="' + src + '" target="_blank">' +
'<img src="'+src+'" style="width:200px;height:50px;background-image: none;" alt="APP端log"/></a>';
'<img src="'+downloadHref(docId,true)+'" style="width:200px;height:50px;background-image: none;" alt="APP端log"/></a>';
}
return template;
}
......
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