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
9164969a
Commit
9164969a
authored
Mar 15, 2024
by
liulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品模板优化
parent
9c0fe266
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
134 additions
and
76 deletions
+134
-76
DdynamicEnum.java
src/main/java/com/baosight/hpjx/common/DdynamicEnum.java
+2
-2
ServiceHPMT001.java
.../java/com/baosight/hpjx/hp/mt/service/ServiceHPMT001.java
+3
-0
ServiceHPMT002.java
.../java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
+13
-7
HPMT001.xml
src/main/java/com/baosight/hpjx/hp/mt/sql/HPMT001.xml
+40
-61
HPMT002.xml
src/main/java/com/baosight/hpjx/hp/mt/sql/HPMT002.xml
+13
-6
UploadUtils.java
...main/java/com/baosight/hpjx/hp/mt/untils/UploadUtils.java
+4
-0
UploadUtils2.java
...ain/java/com/baosight/hpjx/hp/mt/untils/UploadUtils2.java
+59
-0
No files found.
src/main/java/com/baosight/hpjx/common/DdynamicEnum.java
View file @
9164969a
...
...
@@ -300,14 +300,14 @@ public enum DdynamicEnum {
* 用途:巡检填报APP下拉查询
* 编写:ll
*/
APP_MAP_BLOCK_PRDTCODE
(
"app_map_block_prdtcode"
,
"prdtCode"
,
"prdtName"
,
"HPMT002.queryPrdtCode"
),
APP_MAP_BLOCK_PRDTCODE
(
"app_map_block_prdtcode"
,
"prdtCode"
,
"prdtName"
,
"
prdtSpec"
,
"
HPMT002.queryPrdtCode"
),
/**
* 模块:巡检填报APP下拉
* 用途:巡检填报APP下拉查询
* 编写:ll
*/
APP_MAP_BLOCK_PARTCODE
(
"app_map_block_partcode"
,
"partCode"
,
"partName"
,
"HPMT002.queryPartCode"
),
APP_MAP_BLOCK_PARTCODE
(
"app_map_block_partcode"
,
"partCode"
,
"partName"
,
"
partSpec"
,
"
HPMT002.queryPartCode"
),
/**
* 模块:巡检填报APP下拉
...
...
src/main/java/com/baosight/hpjx/hp/mt/service/ServiceHPMT001.java
View file @
9164969a
...
...
@@ -161,10 +161,13 @@ public class ServiceHPMT001 extends ServiceBase {
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
;
}
...
...
src/main/java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
View file @
9164969a
...
...
@@ -80,9 +80,15 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap
.
put
(
"offset"
,
offset
);
sqlMap
.
put
(
"pageSize"
,
pageSize
);
List
<
Map
>
rows
=
this
.
dao
.
query
(
"HPMT002.pmProject"
,
sqlMap
);
List
<
Map
>
maps
=
new
ArrayList
<>();
for
(
Map
row
:
rows
)
{
if
(!
row
.
get
(
"actualCompletionNum"
).
equals
(
row
.
get
(
"num"
))){
maps
.
add
(
row
);
}
}
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
row
s
);
eiBlock
.
setRows
(
map
s
);
outInfo
.
setBlock
(
eiBlock
);
outInfo
.
set
(
"count"
,
count
.
get
(
0
));
return
outInfo
;
...
...
@@ -179,7 +185,7 @@ public class ServiceHPMT002 extends ServiceBase {
}
Map
Map
=
new
HashMap
();
Map
.
put
(
"checkId"
,
id
);
Map
.
put
(
"docType"
,
CommonConstant
.
YesNo
.
NO_0
);
Map
.
put
(
"docType"
,
1
);
List
<
HPZL001A
>
docIdlist
=
this
.
dao
.
query
(
"HPZL001A.queryDev"
,
Map
);
List
<
String
>
imgList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
docIdlist
.
size
();
i
++)
{
...
...
@@ -196,12 +202,12 @@ public class ServiceHPMT002 extends ServiceBase {
//处理的文件
Map
Map2
=
new
HashMap
();
Map2
.
put
(
"checkId"
,
id
);
Map2
.
put
(
"docType"
,
CommonConstant
.
YesNo
.
NO_0
);
List
<
HPZL001A
>
docIdlist2
=
this
.
dao
.
query
(
"HPZL001A.queryDev"
,
Map
);
Map2
.
put
(
"docType"
,
2
);
List
<
HPZL001A
>
docIdlist2
=
this
.
dao
.
query
(
"HPZL001A.queryDev"
,
Map
2
);
List
<
String
>
imgList2
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
docIdlist2
.
size
();
i
++)
{
Map
dirId
=
new
HashMap
();
HPZL001A
hpzl001A
=
docIdlist
.
get
(
i
);
HPZL001A
hpzl001A
=
docIdlist
2
.
get
(
i
);
String
docId
=
hpzl001A
.
getDocId
();
dirId
.
put
(
"docId"
,
docId
);
List
<
Map
>
query
=
this
.
dao
.
query
(
"HPMT002.queryFile"
,
dirId
);
...
...
@@ -302,7 +308,7 @@ public class ServiceHPMT002 extends ServiceBase {
while
(
num
<
docIds
.
length
)
{
HPZL001A
HPZL001A
=
new
HPZL001A
();
HPZL001A
.
setDeptCode
(
CommonConstant
.
YesNo
.
YES
);
HPZL001A
.
setDocType
(
CommonConstant
.
YesNo
.
NO_0
);
HPZL001A
.
setDocType
(
CommonConstant
.
YesNo
.
YES_1
);
HPZL001A
.
setBizType
(
"XJ_WC"
);
HPZL001A
.
setDocId
(
docIds
[
num
]);
HPZL001A
.
setCheckId
(
HPZL001
.
get
(
0
).
getId
());
...
...
@@ -351,7 +357,7 @@ public class ServiceHPMT002 extends ServiceBase {
while
(
num
<
docIds
.
length
)
{
HPZL001A
HPZL001A
=
new
HPZL001A
();
HPZL001A
.
setDeptCode
(
CommonConstant
.
YesNo
.
YES
);
HPZL001A
.
setDocType
(
CommonConstant
.
YesNo
.
YES_1
);
HPZL001A
.
setDocType
(
2
);
HPZL001A
.
setBizType
(
"XJ_CL"
);
HPZL001A
.
setDocId
(
docIds
[
num
]);
HPZL001A
.
setCheckId
(
HPZL001
.
get
(
0
).
getId
());
...
...
src/main/java/com/baosight/hpjx/hp/mt/sql/HPMT001.xml
View file @
9164969a
...
...
@@ -26,11 +26,12 @@
WHERE
SUBSTR(PLAN_COMPLETION_DATE,1,6) = #queryMonth#
AND COMPANY_CODE = #companyCode#
)
</select>
<select
id=
"pmOverview2"
resultClass=
"java.util.HashMap"
>
SELECT
CAST(SUM(
AMOUNT*
WEIGHT) AS DECIMAL(15,3)) AS actualWt
CAST(SUM(WEIGHT) AS DECIMAL(15,3)) AS actualWt
FROM
hpjx.t_hpkc003
WHERE
...
...
@@ -41,70 +42,48 @@
<select
id=
"pmBenchmarking"
resultClass=
"java.util.HashMap"
>
SELECT A.orgId,A.orgCname,COALESCE(B.actualWt,0) AS actualWt FROM (
SELECT
T1.DOCUMENT_DATE,
T1.FACTORY_NAME,
SUM(T1.ACTUAL_TOTAL_AMOUNT) AS ACTUAL_TOTAL_AMOUNT,
SUM(T1.ACTUAL_TOTAL_WT) AS ACTUAL_TOTAL_WT,
SUM(T2.TARGET_TOTAL_WT) AS TARGET_TOTAL_WT
FROM
(
SELECT
SUBSTR(T1.DOCUMENT_DATE,1,6) AS DOCUMENT_DATE,
T1.PROJ_CODE,
T1.PROJ_NAME,
T2.FACTORY_NAME,
SUM(T1.AMOUNT) AS ACTUAL_TOTAL_AMOUNT,
SUM(T1.WEIGHT) AS ACTUAL_TOTAL_WT
FROM
hpjx.t_hpkc003 AS T1
LEFT JOIN
(
SELECT
PROD_ORDER_NO,
FACTORY_NAME
FROM
hpjx.t_hpsc005a
WHERE
COMPANY_CODE = #companyCode#
GROUP BY
PROD_ORDER_NO) AS T2
ON
T1.PROD_ORDER_NO = T2.PROD_ORDER_NO
WHERE
SUBSTR(T1.DOCUMENT_DATE,1,6) = #queryMonth#
GROUP BY
T1.PROJ_CODE ) AS T1
LEFT JOIN
(
ORG_ID AS "orgId",
ORG_CNAME AS "orgCname"
FROM iplat.TXSOG01
WHERE 1=1
AND ORG_TYPE = 'factory' AND COMPANY_CODE = #companyCode#
AND IS_DELETED=0
) A LEFT JOIN (
SELECT
PROJ_CODE,
CAST(SUM(NUM*UNIT_WT) AS DECIMAL(15,3)) AS TARGET_TOTAL_WT
FROM
hpjx.t_hpsc004
SUM(A.WEIGHT) AS actualWt,
B.FACTORY_CODE,
B.FACTORY_NAME
FROM hpjx.t_hpkc003 A LEFT JOIN (
SELECT * FROM hpjx.t_hpsc005a
) B ON A.PROD_TASK_NO=B.PROD_TASK_NO AND A.COMPANY_CODE=B.COMPANY_CODE
WHERE
PROJ_CODE IN
(
SELECT
PROJ_CODE
FROM
(
SUBSTR(DOCUMENT_DATE,1,6) = #queryMonth#
AND A.COMPANY_CODE = #companyCode#
GROUP BY B.FACTORY_CODE
) B ON A.orgId=B.FACTORY_CODE AND A.orgCname=B.FACTORY_NAME
</select>
<select
id=
"pmBenchmarking2"
resultClass=
"java.util.HashMap"
>
SELECT A.orgId,A.orgCname,COALESCE(num,0) as num FROM (
SELECT
COMPANY_CODE,
PROJ_CODE,
REPLACE(PLAN_COMPLETION_DATE,'/','') AS PLAN_COMPLETION_DATE
FROM
hpjx.t_hpsc003
WHERE
LENGTH(PLAN_COMPLETION_DATE) > 6) AS T
ORG_ID AS "orgId",
ORG_CNAME AS "orgCname"
FROM iplat.TXSOG01
WHERE 1=1
AND ORG_TYPE = 'factory' AND COMPANY_CODE = #companyCode#
AND IS_DELETED=0
) A LEFT JOIN (
SELECT FACTORY_CODE,
FACTORY_NAME,
COUNT(*) AS "num"
FROM hpjx.`t_hpzl001`
WHERE
SUBSTR(PLAN_COMPLETION_DATE,1,6) = #queryMonth#
AND COMPANY_CODE = #companyCode#)
GROUP BY
PROJ_CODE ) AS T2
ON
T1.PROJ_CODE = T2.PROJ_CODE
GROUP BY
T1.FACTORY_NAME
SUBSTR(RECEIPT_DATE,1,6) = #queryMonth#
AND COMPANY_CODE = #companyCode# AND DELETE_FLAG=0
GROUP BY FACTORY_CODE,FACTORY_NAME
) B ON A.orgId=B.FACTORY_CODE AND A.orgCname=B.FACTORY_NAME
</select>
</sqlMap>
src/main/java/com/baosight/hpjx/hp/mt/sql/HPMT002.xml
View file @
9164969a
...
...
@@ -22,21 +22,21 @@
),'%') AS "schedule",
<!-- 进度 -->
(
SELECT
IFNULL( SUM( ACTUAL_COMPLETION_
NUM
), 0 )
IFNULL( SUM( ACTUAL_COMPLETION_
UNIT_WT
), 0 )
FROM
hpjx.T_HPSC004
WHERE
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
) AS "actualCompletionNum"
<!-- 完成
数
量 -->
) AS "actualCompletionNum"
<!-- 完成
重
量 -->
,
(
SELECT
IFNULL( SUM(
NUM
),2)
IFNULL( SUM(
TOTAL_WT
),2)
FROM
hpjx.T_HPSC004
WHERE
PARENT_ID = hpjx.T_HPSC003.PLAN_INFO_NO
) AS "num"
<!-- 计划
数
量 -->
) AS "num"
<!-- 计划
重
量 -->
FROM hpjx.T_HPSC003 WHERE COMPANY_CODE= #companyCode#
<isNotEmpty
prepend=
" AND "
property=
"projName"
>
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
...
...
@@ -242,7 +242,8 @@
<select
id=
"queryPrdtCode"
resultClass=
"java.util.HashMap"
>
SELECT DISTINCT
A.PRDT_CODE as "prdtCode",
CONCAT(A.PRDT_NAME,'-',A.PRDT_SPEC) as "prdtName"
A.PRDT_NAME as "prdtName",
A.PRDT_SPEC as "prdtSpec"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
...
...
@@ -262,7 +263,8 @@
<select
id=
"queryPartCode"
resultClass=
"java.util.HashMap"
>
SELECT DISTINCT
A.PART_CODE as "partCode",
CONCAT(A.PART_NAME,'-',A.PART_SPEC) as "partName"
A.PART_NAME as "partName",
A.PART_SPEC as "partSpec"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
...
...
@@ -309,4 +311,9 @@
</select>
<select
id=
"queryFvalue"
resultClass=
"java.util.HashMap"
>
SELECT FVALUE AS "fvalue" FROM iplat.TEDCC03 WHERE FKEY='docRootDir'
</select>
</sqlMap>
src/main/java/com/baosight/hpjx/hp/mt/untils/UploadUtils.java
View file @
9164969a
...
...
@@ -116,6 +116,10 @@ public class UploadUtils {
public
static
Map
<
String
,
String
>
getRealPath
(
String
path
)
{
String
postPath
=
preparePath
(
path
);
String
dirId
=
initPath
(
postPath
);
List
<
Map
>
query
=
dao
.
query
(
"HPMT002.queryFvalue"
);
if
(
query
.
get
(
0
).
get
(
"fvalue"
)!=
null
)
{
ROOT_PATH
=
(
String
)
query
.
get
(
0
).
get
(
"fvalue"
);
}
postPath
=
ROOT_PATH
+
"/"
+
postPath
;
Map
<
String
,
String
>
map
=
new
HashMap
();
map
.
put
(
"path"
,
postPath
);
...
...
src/main/java/com/baosight/hpjx/hp/mt/untils/UploadUtils2.java
0 → 100644
View file @
9164969a
package
com
.
baosight
.
hpjx
.
hp
.
mt
.
untils
;
import
com.baosight.iplat4j.core.data.ibatis.dao.Dao
;
import
com.baosight.iplat4j.core.data.id.UUIDHexIdGenerator
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext
;
import
com.baosight.iplat4j.core.util.DateUtils
;
import
com.baosight.iplat4j.core.util.StringUtils
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
com.baosight.iplat4j.eu.dm.PlatFileUploadUtils
;
import
com.baosight.iplat4j.eu.dm.domain.EUDM02
;
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.commons.CommonsMultipartFile
;
import
javax.imageio.ImageIO
;
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
;
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
();
Map
<
String
,
String
>
returnMap
=
null
;
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
;
}
}
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