Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hp-smart
Commits
2b136631
Commit
2b136631
authored
Mar 13, 2024
by
wasx8023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.文件上传下载区分测试和正式
parent
85b0240d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
14 deletions
+89
-14
ConfigurationBean.java
...m/baosight/hpjx/core/configuration/ConfigurationBean.java
+38
-0
HPSC003.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC003.xml
+1
-1
HPSC004.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC004.xml
+1
-1
ServiceHPZL001A.java
...java/com/baosight/hpjx/hp/zl/service/ServiceHPZL001A.java
+10
-1
HPZL001A.xml
src/main/java/com/baosight/hpjx/hp/zl/sql/HPZL001A.xml
+31
-4
applicationContext-s3.xml
...main/resources/spring/framework/applicationContext-s3.xml
+6
-6
EUDM04.jsp
src/main/webapp/EU/DM/EUDM04.jsp
+2
-1
No files found.
src/main/java/com/baosight/hpjx/core/configuration/ConfigurationBean.java
0 → 100644
View file @
2b136631
package
com
.
baosight
.
hpjx
.
core
.
configuration
;
import
com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext
;
import
com.baosight.iplat4j.eu.dm.PlatFileUploadManagerByAmazonS3
;
import
com.baosight.iplat4j.eu.dm.util.PlatFileUploader
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
lombok.extern.slf4j.Slf4j
;
/**
* 初始化注入bean
*
* @author:songx
* @date:2024/3/13,15:03
*/
@Slf4j
@Configuration
@ConditionalOnProperty
(
name
=
{
"iplat4j.admin.objectStorage.s3.switch"
},
havingValue
=
"on"
)
public
class
ConfigurationBean
{
@Bean
(
name
=
"platFileUploader"
)
public
PlatFileUploader
newPlatFileUploader
()
{
return
new
PlatFileUploader
();
}
@Bean
(
name
=
"fileUpLoadManager"
)
public
PlatFileUploadManagerByAmazonS3
newPlatFileUploadManagerByAmazonS3
()
{
String
str
=
PlatApplicationContext
.
getProperty
(
"iplat4j.admin.objectStorage.s3.switch"
);
log
.
warn
(
"str -> {}"
,
str
);
return
new
PlatFileUploadManagerByAmazonS3
();
}
}
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC003.xml
View file @
2b136631
...
@@ -197,7 +197,7 @@
...
@@ -197,7 +197,7 @@
<isNotEmpty
prepend=
" AND "
property=
"projCode"
>
<isNotEmpty
prepend=
" AND "
property=
"projCode"
>
PROJ_CODE = #projCode#
PROJ_CODE = #projCode#
</isNotEmpty>
</isNotEmpty>
ORDER BY PR
OJ
_CODE
ORDER BY PR
DT
_CODE
</select>
</select>
<!--计划完成时间回写-->
<!--计划完成时间回写-->
...
...
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC004.xml
View file @
2b136631
...
@@ -394,7 +394,7 @@
...
@@ -394,7 +394,7 @@
<isNotEmpty
prepend=
" AND "
property=
"parentPrdtCode"
>
<isNotEmpty
prepend=
" AND "
property=
"parentPrdtCode"
>
B.PRDT_CODE = #parentPrdtCode#
B.PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
</isNotEmpty>
ORDER BY A.PR
OJ
_CODE
ORDER BY A.PR
DT
_CODE
</select>
</select>
<select
id=
"queryDate"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hpjx.hp.sc.domain.HPSC004"
>
<select
id=
"queryDate"
parameterClass=
"java.util.HashMap"
resultClass=
"com.baosight.hpjx.hp.sc.domain.HPSC004"
>
...
...
src/main/java/com/baosight/hpjx/hp/zl/service/ServiceHPZL001A.java
View file @
2b136631
...
@@ -11,9 +11,12 @@ import com.baosight.hpjx.hp.zl.tools.HPZLTools;
...
@@ -11,9 +11,12 @@ import com.baosight.hpjx.hp.zl.tools.HPZLTools;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.AssertUtils
;
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.FrameworkInfo
;
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
;
import
com.baosight.iplat4j.core.ioc.spring.ProjectConfig
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
@@ -59,7 +62,13 @@ public class ServiceHPZL001A extends ServiceEPBase {
...
@@ -59,7 +62,13 @@ public class ServiceHPZL001A extends ServiceEPBase {
@Override
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
try
{
inInfo
=
super
.
query
(
inInfo
,
HPZL001A
.
QUERY
,
new
HPZL001A
());
// 项目环境
String
projectEnv
=
ProjectInfo
.
getProjectEnv
();
if
(
"run"
.
equalsIgnoreCase
(
projectEnv
))
{
inInfo
=
super
.
query
(
inInfo
,
"HPZL001A.queryRun"
,
new
HPZL001A
());
}
else
{
inInfo
=
super
.
query
(
inInfo
,
"HPZL001A.queryDev"
,
new
HPZL001A
());
}
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
}
...
...
src/main/java/com/baosight/hpjx/hp/zl/sql/HPZL001A.xml
View file @
2b136631
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
A.CHECK_ID as "checkId",
<!-- 检查单ID -->
A.CHECK_ID as "checkId",
<!-- 检查单ID -->
A.DOC_TYPE as "docType",
<!-- 文件类型 -->
A.DOC_TYPE as "docType",
<!-- 文件类型 -->
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#
...
@@ -77,9 +86,9 @@
...
@@ -77,9 +86,9 @@
</dynamic>
</dynamic>
</sql>
</sql>
<select
id=
"query"
resultClass=
"com.baosight.hpjx.hp.zl.domain.HPZL001A"
>
<select
id=
"query
Dev
"
resultClass=
"com.baosight.hpjx.hp.zl.domain.HPZL001A"
>
SELECT
SELECT
<include
refid=
"column"
/>
<include
refid=
"column
Dev
"
/>
FROM ${hpjxSchema}.T_HPZL001A A, ${platSchema}.TEUDM02 B
FROM ${hpjxSchema}.T_HPZL001A A, ${platSchema}.TEUDM02 B
WHERE 1=1
WHERE 1=1
AND A.DOC_ID = B.DOC_ID
AND A.DOC_ID = B.DOC_ID
...
@@ -88,13 +97,31 @@
...
@@ -88,13 +97,31 @@
<include
refid=
"order"
/>
<include
refid=
"order"
/>
</select>
</select>
<select
id=
"count"
resultClass=
"int"
>
<select
id=
"count
Dev
"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPZL001A A, ${platSchema}.TEUDM02 B
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPZL001A A, ${platSchema}.TEUDM02 B
WHERE 1=1
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<include
refid=
"customCondition"
/>
</select>
</select>
<select
id=
"queryRun"
resultClass=
"com.baosight.hpjx.hp.zl.domain.HPZL001A"
>
SELECT
<include
refid=
"columnRun"
/>
FROM ${hpjxSchema}.T_HPZL001A A, ${platSchema}.TEUDM05 B
WHERE 1=1
AND A.DOC_ID = B.RES_ID
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<include
refid=
"order"
/>
</select>
<select
id=
"countRun"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPZL001A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
</select>
<insert
id=
"insert"
>
<insert
id=
"insert"
>
INSERT INTO ${hpjxSchema}.T_HPZL001A (
INSERT INTO ${hpjxSchema}.T_HPZL001A (
COMPANY_CODE,
<!-- 企业编码 预留 -->
COMPANY_CODE,
<!-- 企业编码 预留 -->
...
...
src/main/resources/spring/framework/applicationContext-s3.xml
View file @
2b136631
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
>
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
>
<bean
id=
"platFileUploader"
class=
"com.baosight.iplat4j.eu.dm.util.PlatFileUploader"
>
<!-- <bean id="platFileUploader" class="com.baosight.iplat4j.eu.dm.util.PlatFileUploader">--
>
<property
name=
"dao"
ref=
"platDao"
/
>
<!-- <property name="dao" ref="platDao"/>--
>
</bean
>
<!-- </bean>--
>
<bean
id=
"fileUpLoadManager"
class=
"com.baosight.iplat4j.eu.dm.PlatFileUploadManagerByAmazonS3"
>
<!-- <bean id="fileUpLoadManager" class="com.baosight.iplat4j.eu.dm.PlatFileUploadManagerByAmazonS3">--
>
<property
name=
"fileUploader"
ref=
"platFileUploader"
/
>
<!-- <property name="fileUploader" ref="platFileUploader"/>--
>
</bean
>
<!-- </bean>--
>
</beans>
</beans>
src/main/webapp/EU/DM/EUDM04.jsp
View file @
2b136631
...
@@ -8,10 +8,11 @@
...
@@ -8,10 +8,11 @@
Logger log = LoggerFactory.getLogger(IFileUploadManager.class);
Logger log = LoggerFactory.getLogger(IFileUploadManager.class);
try {
try {
String result = AdminFactoryConfig.getFileUpLoadInterface().uploadFile(pageContext);
String result = AdminFactoryConfig.getFileUpLoadInterface().uploadFile(pageContext);
out.print(result);
log.info("uploadFile result:{}", result);
log.info("uploadFile result:{}", result);
} catch (Exception e) {
} catch (Exception e) {
log.error("附件上传时出现异常{}", e.getMessage(), e);
log.error("附件上传时出现异常{}", e.getMessage(), e);
response.sendError(500, e.getMessage());
response.sendError(500, e.getMessage());
return
;
out.print("{msg: \"" + e.getMessage() + "\"}")
;
}
}
%>
%>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment