Commit 9b3bfac7 by 宋祥

1.项目清单和生产下料需要区分环境

parent bedf29d1
...@@ -7,6 +7,20 @@ package com.baosight.hpjx.core.constant; ...@@ -7,6 +7,20 @@ package com.baosight.hpjx.core.constant;
public class CommonConstant { public class CommonConstant {
/** /**
* 环境变量
*
* @author:songx
* @date:2024/1/20,15:04
*/
public static class projectEnv {
// 开发环境
public static final String DEV = "dev";
// 正式环境
public static final String RUN = "run";
}
/**
* 是否 * 是否
* *
* @author:songx * @author:songx
......
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.ds.domain.HPDS002; import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.sc.domain.HPSC002; import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC002A; import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC006; import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.zl.domain.HPZL001A;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.FileUtils; import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant; 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.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -68,7 +71,13 @@ public class ServiceHPSC002A extends ServiceEPBase { ...@@ -68,7 +71,13 @@ public class ServiceHPSC002A extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HPSC002A.QUERY, new HPSC002A()); // 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HPSC002A.queryRun", new HPSC002A());
} else {
inInfo = super.query(inInfo, "HPSC002A.queryDev", new HPSC002A());
}
} catch (Throwable e) { } catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
......
package com.baosight.hpjx.hp.sc.service; package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC002; import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC002A; import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.sc.domain.HPSC002B; import com.baosight.hpjx.hp.sc.domain.HPSC002B;
import com.baosight.hpjx.hp.zl.domain.HPZL001A;
import com.baosight.hpjx.util.EiInfoUtils; import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils; import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant; 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.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -57,7 +60,13 @@ public class ServiceHPSC002B extends ServiceEPBase { ...@@ -57,7 +60,13 @@ public class ServiceHPSC002B extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
inInfo = super.query(inInfo, HPSC002B.QUERY, new HPSC002B()); // 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HPSC002B.queryRun", new HPSC002B());
} else {
inInfo = super.query(inInfo, "HPSC002B.queryDev", new HPSC002B());
}
} catch (Throwable e) { } catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
A.BIZ_TYPE as "bizType", <!-- 物料ID --> A.BIZ_TYPE as "bizType", <!-- 物料ID -->
A.MAT_ID as "matId", <!-- 物料ID --> A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID --> A.DOC_ID as "docId", <!-- 文件ID -->
B.DOC_NAME as "docName", <!-- 文件名称 -->
A.CREATED_BY as "createdBy", <!-- 创建人 --> A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 --> A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 --> A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
...@@ -18,6 +17,16 @@ ...@@ -18,6 +17,16 @@
A.UPDATED_TIME as "updatedTime" <!-- 修改时间 --> A.UPDATED_TIME as "updatedTime" <!-- 修改时间 -->
</sql> </sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# A.ID = #id#
...@@ -37,11 +46,26 @@ ...@@ -37,11 +46,26 @@
<isNotEmpty prepend=" AND " property="docId"> <isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId# A.DOC_ID = #docId#
</isNotEmpty> </isNotEmpty>
</sql>
<!-- 开发环境 -->
<sql id="conditionDev">
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName"> <isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%') B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<!-- 正式环境 -->
<sql id="conditionRun">
AND A.DOC_ID = B.RES_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000') A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
...@@ -62,21 +86,37 @@ ...@@ -62,21 +86,37 @@
</dynamic> </dynamic>
</sql> </sql>
<select id="query" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002A"> <select id="queryDev" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002A">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B
WHERE 1=1 WHERE 1=1
AND A.DOC_ID = B.DOC_ID <include refid="conditionDev"/>
<include refid="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
<include refid="order"/> <include refid="order"/>
</select> </select>
<select id="count" resultClass="int"> <select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="conditionDev"/>
<include refid="customCondition"/>
</select>
<select id="queryRun" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002A">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countRun" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
A.BIZ_TYPE as "bizType", <!-- 物料ID --> A.BIZ_TYPE as "bizType", <!-- 物料ID -->
A.MAT_ID as "matId", <!-- 物料ID --> A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID --> A.DOC_ID as "docId", <!-- 文件ID -->
B.DOC_NAME as "docName", <!-- 文件名称 -->
A.CREATED_BY as "createdBy", <!-- 创建人 --> A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 --> A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 --> A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
...@@ -18,6 +17,16 @@ ...@@ -18,6 +17,16 @@
A.UPDATED_TIME as "updatedTime" <!-- 修改时间 --> A.UPDATED_TIME as "updatedTime" <!-- 修改时间 -->
</sql> </sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="condition"> <sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# A.ID = #id#
...@@ -55,8 +64,23 @@ ...@@ -55,8 +64,23 @@
<isNotEmpty prepend=" AND " property="updatedTime"> <isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime# A.UPDATED_TIME = #updatedTime#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime"> </sql>
B.DOC_NAME LIKE ('%$updatedTime$%')
<!-- 开发环境 -->
<sql id="conditionDev">
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- 正式环境 -->
<sql id="conditionRun">
AND A.DOC_ID = B.RES_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -80,21 +104,37 @@ ...@@ -80,21 +104,37 @@
</dynamic> </dynamic>
</sql> </sql>
<select id="query" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002B"> <select id="queryDev" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002B">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B
WHERE 1=1 WHERE 1=1
AND A.DOC_ID = B.DOC_ID <include refid="conditionDev"/>
<include refid="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
<include refid="order"/> <include refid="order"/>
</select> </select>
<select id="count" resultClass="int"> <select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="conditionDev"/>
<include refid="customCondition"/>
</select>
<select id="queryRun" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002B">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countRun" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
......
...@@ -64,7 +64,7 @@ public class ServiceHPZL001A extends ServiceEPBase { ...@@ -64,7 +64,7 @@ public class ServiceHPZL001A extends ServiceEPBase {
try { try {
// 项目环境 // 项目环境
String projectEnv = ProjectInfo.getProjectEnv(); String projectEnv = ProjectInfo.getProjectEnv();
if ("run".equalsIgnoreCase(projectEnv)) { if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HPZL001A.queryRun", new HPZL001A()); inInfo = super.query(inInfo, "HPZL001A.queryRun", new HPZL001A());
} else { } else {
inInfo = super.query(inInfo, "HPZL001A.queryDev", new HPZL001A()); inInfo = super.query(inInfo, "HPZL001A.queryDev", new HPZL001A());
......
...@@ -5,8 +5,7 @@ $(function () { ...@@ -5,8 +5,7 @@ $(function () {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + item.docId + 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
+ '" >附件下载</a>';
return template; return template;
} }
}], }],
......
...@@ -5,8 +5,7 @@ $(function () { ...@@ -5,8 +5,7 @@ $(function () {
field: "operator", field: "operator",
template: function (item) { template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + IPLATUI.CONTEXT_PATH + '/EU/DM/EUDM06.jsp?docId=' + item.docId + 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
+ '" >附件下载</a>';
return template; 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