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
319bb65c
Commit
319bb65c
authored
Mar 23, 2024
by
liulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APP文件上传
parent
e2d5601a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
66 deletions
+64
-66
ServiceHPMT001.java
.../java/com/baosight/hpjx/hp/mt/service/ServiceHPMT001.java
+38
-31
ServiceHPMT002.java
.../java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
+0
-0
UploadUtils2.java
...ain/java/com/baosight/hpjx/hp/mt/untils/UploadUtils2.java
+25
-34
HPXSOrg.xml
src/main/java/com/baosight/hpjx/hp/xs/sql/HPXSOrg.xml
+1
-1
No files found.
src/main/java/com/baosight/hpjx/hp/mt/service/ServiceHPMT001.java
View file @
319bb65c
...
...
@@ -44,21 +44,23 @@ public class ServiceHPMT001 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmOverview
(
EiInfo
inInfo
)
{
String
queryMonth
=
inInfo
.
getString
(
"queryMonth"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"queryMonth"
,
queryMonth
);
sqlMap
.
put
(
"companyCode"
,
companyCode
);
List
<
Map
>
row1
=
this
.
dao
.
query
(
"HPMT001.pmOverview1"
,
sqlMap
);
//目标
List
<
Map
>
row2
=
this
.
dao
.
query
(
"HPMT001.pmOverview2"
,
sqlMap
);
//实际
List
<
Map
>
rows
=
new
ArrayList
<>();
public
Map
pmOverview
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMM"
);
try
{
String
queryMonth
=
inInfo
.
getString
(
"queryMonth"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
resultMap
.
put
(
"status"
,
403
);
resultMap
.
put
(
"message"
,
"票据过期或请求不合法,请重新登录或获取合法权限!"
);
return
resultMap
;
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"queryMonth"
,
queryMonth
);
sqlMap
.
put
(
"companyCode"
,
companyCode
);
List
<
Map
>
row1
=
this
.
dao
.
query
(
"HPMT001.pmOverview1"
,
sqlMap
);
//目标
List
<
Map
>
row2
=
this
.
dao
.
query
(
"HPMT001.pmOverview2"
,
sqlMap
);
//实际
List
<
Map
>
rows
=
new
ArrayList
<>();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMM"
);
Date
parse
=
sdf
.
parse
(
queryMonth
);
Calendar
instance
=
Calendar
.
getInstance
();
instance
.
setTime
(
parse
);
...
...
@@ -132,15 +134,13 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap
.
put
(
"actualWt_h_yoy"
,
actualWt
.
subtract
(
actualWt2
).
divide
(
actualWt2
,
BigDecimal
.
ROUND_UP
).
multiply
(
new
BigDecimal
(
100
)).
doubleValue
());
}
rows
.
add
(
resultMap
);
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
rows
);
outInfo
.
setBlock
(
eiBlock
);
return
outInfo
;
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
return
inInfo
;
resultMap
.
put
(
"status"
,
EiConstant
.
STATUS_SUCCESS
);
resultMap
.
put
(
"message"
,
"SUCCESS"
);
return
resultMap
;
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
LogUtils
.
getMsg
(
e
));
return
resultMap
;
}
}
...
...
@@ -151,24 +151,31 @@ public class ServiceHPMT001 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmBenchmarking
(
EiInfo
inInfo
)
{
public
Map
pmBenchmarking
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
queryMonth
=
inInfo
.
getString
(
"queryMonth"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
resultMap
.
put
(
"status"
,
403
);
resultMap
.
put
(
"message"
,
"票据过期或请求不合法,请重新登录或获取合法权限!"
);
return
resultMap
;
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"queryMonth"
,
queryMonth
);
sqlMap
.
put
(
"companyCode"
,
companyCode
);
List
<
Map
>
rows
=
this
.
dao
.
query
(
"HPMT001.pmBenchmarking"
,
sqlMap
);
List
<
Map
>
rows2
=
this
.
dao
.
query
(
"HPMT001.pmBenchmarking2"
,
sqlMap
);
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
rows
);
outInfo
.
setBlock
(
eiBlock
);
outInfo
.
set
(
"cout"
,
rows2
);
return
outInfo
;
resultMap
.
put
(
"result"
,
rows
);
resultMap
.
put
(
"result2"
,
rows2
);
resultMap
.
put
(
"status"
,
EiConstant
.
STATUS_SUCCESS
);
resultMap
.
put
(
"message"
,
"SUCCESS"
);
return
resultMap
;
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
LogUtils
.
getMsg
(
e
));
return
resultMap
;
}
}
}
src/main/java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
View file @
319bb65c
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hpjx/hp/mt/untils/UploadUtils2.java
View file @
319bb65c
...
...
@@ -14,53 +14,44 @@ import com.baosight.iplat4j.eu.dm.util.FileProcessUtils;
import
com.baosight.iplat4j.eu.dm.util.IFileUploader
;
import
net.sf.json.JSONObject
;
import
org.apache.commons.codec.binary.Base64
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
org.springframework.web.multipart.commons.CommonsMultipartResolver
;
import
javax.imageio.ImageIO
;
import
javax.servlet.http.HttpServletRequest
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
public
class
UploadUtils2
{
private
static
Dao
dao
=
(
Dao
)
PlatApplicationContext
.
getApplicationContext
().
getBean
(
"dao"
);
public
static
JSONObject
upload
(
CommonsMultipartFile
multipartFile
)
throws
Exception
{
JSONObject
documentJSON
=
new
JSONObject
();
String
docName
=
multipartFile
.
getOriginalFilename
();
Long
docSize
=
multipartFile
.
getSize
();
HashMap
<
String
,
String
>
inMap
=
new
HashMap
();
String
configPathDefine
=
null
;
Map
hashMap
=
new
HashMap
();
hashMap
.
put
(
"fkey"
,
"docRootDir"
);
List
<
Map
>
query
=
DaoBase
.
getInstance
().
query
(
"EDCC03.query"
,
hashMap
);
if
(
query
.
get
(
0
).
get
(
"fvalue"
)!=
null
)
{
configPathDefine
=
(
String
)
query
.
get
(
0
).
get
(
"fvalue"
);
}
inMap
.
put
(
"configPathDefine"
,
configPathDefine
);
Map
<
String
,
String
>
returnMap
=
PlatFileUploadUtils
.
uploadFile
(
multipartFile
,
inMap
);
String
docId
=
(
String
)
returnMap
.
get
(
"docId"
);
String
docUrl
=
(
String
)
returnMap
.
get
(
"docUrl"
);
docId
=
docId
==
null
?
""
:
docId
;
documentJSON
.
put
(
"docId"
,
docId
);
if
(
StringUtils
.
isNotEmpty
(
docUrl
))
{
documentJSON
.
put
(
"docUrl"
,
docUrl
);
}
else
{
documentJSON
.
remove
(
"docUrl"
);
}
documentJSON
.
put
(
"groupId"
,
returnMap
.
get
(
"groupId"
)
==
null
?
""
:
returnMap
.
get
(
"groupId"
));
documentJSON
.
put
(
"docName"
,
docName
);
documentJSON
.
put
(
"docSize"
,
docSize
);
documentJSON
.
put
(
"docType"
,
docName
.
substring
(
docName
.
lastIndexOf
(
46
)));
JSONObject
documentJSON
=
new
JSONObject
();
String
docName
=
multipartFile
.
getOriginalFilename
();
Long
docSize
=
multipartFile
.
getSize
();
HashMap
<
String
,
String
>
inMap
=
new
HashMap
();
inMap
.
put
(
"groupId"
,
"hk_file11"
);
inMap
.
put
(
"configPathDefine"
,
"A"
);
Map
<
String
,
String
>
returnMap
=
PlatFileUploadUtils
.
uploadFile
(
multipartFile
,
inMap
);
String
docId
=
(
String
)
returnMap
.
get
(
"docId"
);
String
docUrl
=
(
String
)
returnMap
.
get
(
"docUrl"
);
docId
=
docId
==
null
?
""
:
docId
;
documentJSON
.
put
(
"docId"
,
docId
);
if
(
StringUtils
.
isNotEmpty
(
docUrl
))
{
documentJSON
.
put
(
"docUrl"
,
docUrl
);
}
else
{
documentJSON
.
remove
(
"docUrl"
);
}
documentJSON
.
put
(
"groupId"
,
returnMap
.
get
(
"groupId"
)
==
null
?
""
:
returnMap
.
get
(
"groupId"
));
documentJSON
.
put
(
"docName"
,
docName
);
documentJSON
.
put
(
"docSize"
,
docSize
);
documentJSON
.
put
(
"docType"
,
docName
.
substring
(
docName
.
lastIndexOf
(
46
)));
return
documentJSON
;
}
}
}
src/main/java/com/baosight/hpjx/hp/xs/sql/HPXSOrg.xml
View file @
319bb65c
...
...
@@ -176,7 +176,7 @@
</select>
<!-- 查询组织信息 -->
<select
id=
"queryTedcm01"
resultClass=
"
com.baosight.iplat4j.common.ed.domain.TEDCM01
"
>
<select
id=
"queryTedcm01"
resultClass=
"
java.util.HashMap
"
>
SELECT
ITEM_CODE AS "itemCode",
ITEM_CNAME AS "itemCname"
...
...
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