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
ced5cf4c
Commit
ced5cf4c
authored
Mar 08, 2024
by
liulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移动端接口优化
parent
097491c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
615 additions
and
20 deletions
+615
-20
DdynamicEnum.java
src/main/java/com/baosight/hpjx/common/DdynamicEnum.java
+31
-2
ServiceHPMT002.java
.../java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
+0
-0
HPMT002.xml
src/main/java/com/baosight/hpjx/hp/mt/sql/HPMT002.xml
+42
-7
BASE64DecodedMultipartFile.java
...aosight/hpjx/hp/mt/untils/BASE64DecodedMultipartFile.java
+59
-0
Base64ToMultipartFile.java
...com/baosight/hpjx/hp/mt/untils/Base64ToMultipartFile.java
+161
-0
Base64Utils.java
...main/java/com/baosight/hpjx/hp/mt/untils/Base64Utils.java
+31
-0
UploadUtils.java
...main/java/com/baosight/hpjx/hp/mt/untils/UploadUtils.java
+158
-6
HPSC005.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC005.xml
+34
-0
HPXSOrg.xml
src/main/java/com/baosight/hpjx/hp/xs/sql/HPXSOrg.xml
+15
-1
HPZL001.java
src/main/java/com/baosight/hpjx/hp/zl/domain/HPZL001.java
+51
-2
HPZL001A.java
src/main/java/com/baosight/hpjx/hp/zl/domain/HPZL001A.java
+25
-0
ServiceHPZL001B.java
...java/com/baosight/hpjx/hp/zl/service/ServiceHPZL001B.java
+2
-0
HPZL001.xml
src/main/java/com/baosight/hpjx/hp/zl/sql/HPZL001.xml
+5
-1
HPZL001A.xml
src/main/java/com/baosight/hpjx/hp/zl/sql/HPZL001A.xml
+1
-1
No files found.
src/main/java/com/baosight/hpjx/common/DdynamicEnum.java
View file @
ced5cf4c
...
...
@@ -127,6 +127,19 @@ public enum DdynamicEnum {
*/
FACTORY_GROUP_ECORD_BLOCK_ID
(
"factory_group_ecord_block_id"
,
"factoryCode"
,
"factoryName"
,
"groupCode"
,
"groupName"
,
"HPPZ011.queryComboBoxAll"
),
/**
* 模块:组管理
* 用途:组管理下拉框
* 编写:ll
*/
GROUP_PRO_BLOCK_ID
(
"group_pro_block_id"
,
"groupCode"
,
"groupName"
,
"HPXSOrg.queryList"
),
/**
* 模块:巡检移动端
* 用途:不良品类下拉
* 编写:ll
*/
POOR_TYPE_BLOCK_ID
(
"poor_type_block_id"
,
"itemCode"
,
"itemCname"
,
"HPXSOrg.queryTedcm01"
),
//------------------------------------生产管理-----------------------------------
/**
* 模块:项目档案
...
...
@@ -164,8 +177,21 @@ public enum DdynamicEnum {
* 编写:wwl
*/
PROJ_PROD_BLOCK_ID
(
"proj_prod_block_id"
,
"projCode"
,
"projName"
,
"HPSC005.queryProjComboBox"
),
/**
* 模块:项目档案(通过工厂、生产组)
* 用途:项目档案下拉框
* 编写:ll
*/
PROJ_PRODQUERY_BLOCK_ID
(
"proj_prodQuery_block_id"
,
"projCode"
,
"projName"
,
"HPSC005.queryProjComboBox2"
),
/**
* 模块:项目档案(通过工厂、生产组、项目号)
* 用途:移动端任务号、生产订单号
* 编写:ll
*/
PROJ_QUERYPROD_BLOCK_ID
(
"proj_queryProd_block_id"
,
"prodOrderNo"
,
"prodTaskNo"
,
"HPSC005.queryProjComboBox2"
),
//------------------------------------用户管理-----------------------------------
/**
...
...
@@ -225,6 +251,9 @@ public enum DdynamicEnum {
*/
FACTORY_CODE_BLOCK_ID
(
"factory_code_block_id"
,
"factoryCode"
,
"factoryName"
,
"HPXS001.queryFactoryCode"
);
/** 将结果集放入的块名 */
private
final
String
blockId
;
/** 字段名 */
...
...
src/main/java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
View file @
ced5cf4c
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hpjx/hp/mt/sql/HPMT002.xml
View file @
ced5cf4c
...
...
@@ -48,8 +48,16 @@
COUNT(POOR_TYPE) AS POOR_TYPE_NUM,
<!-- 单种不良品类数量 -->
CONCAT( FORMAT(COUNT(POOR_TYPE)/ (
SELECT COUNT(*) FROM hpjx.t_hpzl001 WHERE
COMPANY_CODE=#companyCode# )* 100,2),'%') AS NUM
FROM hpjx.t_hpzl001 WHERE COMPANY_CODE= #companyCode# AND DELETE_FLAG =0
COMPANY_CODE=#companyCode# )* 100,2),'%') AS NUM,
ITEM_CNAME AS ITEM_CNAME
FROM hpjx.t_hpzl001 A LEFT JOIN (
SELECT
ITEM_CODE,
ITEM_CNAME
FROM iplat.TEDCM01
WHERE CODESET_CODE = 'hpjx.hpjx.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode# AND DELETE_FLAG =0
GROUP BY POOR_TYPE
</select>
...
...
@@ -65,11 +73,21 @@
INVENT_NAME as "inventName",
<!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode",
<!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName",
<!-- 零件名称 -->
FACTORY_CODE as "factoryCode",
<!-- 厂区编码 -->
FACTORY_NAME as "factoryName",
<!-- 厂区名称 -->
ORG_NO as "orgNo",
<!-- 生产组编码 -->
ORG_NAME as "orgName",
<!-- 生产组名称 -->
POOR_TYPE as "poorType",
<!-- 不良品类 -->
STATUS as "status"
<!-- 单据状态 0未处理 1已处理 -->
FROM hpjx.t_hpzl001 WHERE COMPANY_CODE= #companyCode# AND STATUS=#status# AND DELETE_FLAG =0
STATUS as "status",
<!-- 单据状态 0未处理 1已处理 -->
B.ITEM_CNAME AS "itemCname"
FROM hpjx.t_hpzl001 A LEFT JOIN (
SELECT
ITEM_CODE,
ITEM_CNAME
FROM iplat.TEDCM01
WHERE CODESET_CODE = 'hpjx.hpjx.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode# AND STATUS=#status# AND DELETE_FLAG =0
</select>
<select
id=
"pmQualityDetail"
resultClass=
"java.util.HashMap"
>
...
...
@@ -84,15 +102,25 @@
INVENT_NAME as "inventName",
<!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode",
<!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName",
<!-- 零件名称 -->
FACTORY_CODE as "factoryCode",
<!-- 厂区编码 -->
FACTORY_NAME as "factoryName",
<!-- 厂区名称 -->
ORG_NO as "orgNo",
<!-- 生产组编码 -->
ORG_NAME as "orgName",
<!-- 生产组名称 -->
POOR_TYPE as "poorType",
<!-- 不良品类 -->
PROBLEM_DESC as "problemDesc",
<!-- 质量问题描述 -->
CHECK_USER as "checkUser",
<!-- 检查人 -->
CHECK_USER_NAME as "checkUserName",
<!-- 检查人名称 -->
STATUS as "status"
<!-- 单据状态 0未处理 1已处理 -->
FROM hpjx.t_hpzl001 WHERE COMPANY_CODE= #companyCode# AND STATUS=#status#
AND DELETE_FLAG = 0 AND CHECK_NO = #checkNo#
STATUS as "status",
<!-- 单据状态 0未处理 1已处理 -->
B.ITEM_CNAME AS "itemCname"
FROM hpjx.t_hpzl001 A LEFT JOIN (
SELECT
ITEM_CODE,
ITEM_CNAME
FROM iplat.TEDCM01
WHERE CODESET_CODE = 'hpjx.hpjx.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode#
AND DELETE_FLAG = 0 AND ID = #id#
</select>
<insert
id=
"insert"
>
...
...
@@ -109,6 +137,8 @@
INVENT_NAME,
<!-- 部件名称 -->
SUB_INVENT_CODE,
<!-- 零件编码 -->
SUB_INVENT_NAME,
<!-- 零件名称 -->
FACTORY_CODE as "factoryCode",
<!-- 厂区编码 -->
FACTORY_NAME as "factoryName",
<!-- 厂区名称 -->
ORG_NO,
<!-- 生产组编码 -->
ORG_NAME,
<!-- 生产组名称 -->
POOR_TYPE,
<!-- 不良品类 -->
...
...
@@ -127,4 +157,9 @@
#createdBy#, #createdName#, #createdTime#, #deleteFlag#)
</insert>
<select
id=
"queryFile"
resultClass=
"java.util.HashMap"
>
SELECT CHG_NAME FROM iplat.TEUDM02 where DOC_ID=#docId#
</select>
</sqlMap>
src/main/java/com/baosight/hpjx/hp/mt/untils/BASE64DecodedMultipartFile.java
0 → 100644
View file @
ced5cf4c
package
com
.
baosight
.
hpjx
.
hp
.
mt
.
untils
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.*
;
public
class
BASE64DecodedMultipartFile
implements
MultipartFile
{
private
final
byte
[]
imgContent
;
private
final
String
header
;
public
BASE64DecodedMultipartFile
(
byte
[]
imgContent
,
String
header
)
{
this
.
imgContent
=
imgContent
;
this
.
header
=
header
.
split
(
";"
)[
0
];
}
@Override
public
String
getName
()
{
return
System
.
currentTimeMillis
()
+
Math
.
random
()
+
"."
+
header
.
split
(
"/"
)[
1
];
}
@Override
public
String
getOriginalFilename
()
{
return
System
.
currentTimeMillis
()
+
(
int
)
Math
.
random
()
*
10000
+
"."
+
header
.
split
(
"/"
)[
1
];
}
@Override
public
String
getContentType
()
{
return
header
.
split
(
":"
)[
1
];
}
@Override
public
boolean
isEmpty
()
{
return
imgContent
==
null
||
imgContent
.
length
==
0
;
}
@Override
public
long
getSize
()
{
return
imgContent
.
length
;
}
@Override
public
byte
[]
getBytes
()
throws
IOException
{
return
imgContent
;
}
@Override
public
InputStream
getInputStream
()
throws
IOException
{
return
new
ByteArrayInputStream
(
imgContent
);
}
@Override
public
void
transferTo
(
File
dest
)
throws
IOException
,
IllegalStateException
{
new
FileOutputStream
(
dest
).
write
(
imgContent
);
}
}
src/main/java/com/baosight/hpjx/hp/mt/untils/Base64ToMultipartFile.java
0 → 100644
View file @
ced5cf4c
package
com
.
baosight
.
hpjx
.
hp
.
mt
.
untils
;
import
org.apache.commons.fileupload.disk.DiskFileItem
;
import
org.apache.commons.fileupload.disk.DiskFileItemFactory
;
import
org.apache.xerces.impl.dv.util.Base64
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
sun.misc.BASE64Decoder
;
import
java.io.*
;
public
class
Base64ToMultipartFile
implements
MultipartFile
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
Base64ToMultipartFile
.
class
);
private
final
byte
[]
imgContent
;
private
final
String
header
;
public
Base64ToMultipartFile
(
byte
[]
imgContent
,
String
header
)
{
this
.
imgContent
=
imgContent
;
this
.
header
=
header
.
split
(
";"
)[
0
];
}
@Override
public
String
getName
()
{
return
System
.
currentTimeMillis
()
+
Math
.
random
()
+
"."
+
header
.
split
(
"/"
)[
1
];
}
@Override
public
String
getOriginalFilename
()
{
return
System
.
currentTimeMillis
()
+
(
int
)
Math
.
random
()
*
10000
+
"."
+
header
.
split
(
"/"
)[
1
];
}
@Override
public
String
getContentType
()
{
return
header
.
split
(
":"
)[
1
];
}
@Override
public
boolean
isEmpty
()
{
return
imgContent
==
null
||
imgContent
.
length
==
0
;
}
@Override
public
long
getSize
()
{
return
imgContent
.
length
;
}
@Override
public
byte
[]
getBytes
()
throws
IOException
{
return
imgContent
;
}
@Override
public
InputStream
getInputStream
()
throws
IOException
{
ByteArrayInputStream
byteArrayInputStream
=
new
ByteArrayInputStream
(
imgContent
);
// 关闭流,不然文件会一直占用资源,无法对其操作
byteArrayInputStream
.
close
();
return
byteArrayInputStream
;
}
@Override
public
void
transferTo
(
File
dest
)
throws
IOException
,
IllegalStateException
{
FileOutputStream
fileOutputStream
=
new
FileOutputStream
(
dest
);
fileOutputStream
.
write
(
imgContent
);
// 关闭流,不然文件会一直占用资源,无法对其操作
fileOutputStream
.
close
();
}
/**
* base64转multipartFile
*
* @param
* @return
*/
public
static
MultipartFile
base64Convert
(
String
base64
)
{
String
[]
baseStrs
=
base64
.
split
(
","
);
BASE64Decoder
decoder
=
new
BASE64Decoder
();
byte
[]
b
=
new
byte
[
0
];
try
{
b
=
decoder
.
decodeBuffer
(
baseStrs
[
1
]);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
for
(
int
i
=
0
;
i
<
b
.
length
;
++
i
)
{
if
(
b
[
i
]
<
0
)
{
b
[
i
]
+=
256
;
}
}
return
new
Base64ToMultipartFile
(
b
,
baseStrs
[
0
]);
}
public
static
CommonsMultipartFile
base64toMultipartFile
(
String
base64filestr
){
final
File
file
=
base64ToFile
(
base64filestr
);
if
(
file
.
exists
()){
logger
.
info
(
"存在"
);
logger
.
info
(
"长度"
+
file
.
length
());
}
DiskFileItem
item
=
(
DiskFileItem
)
new
DiskFileItemFactory
().
createItem
(
file
.
getName
(),
"image/jpeg"
,
false
,
file
.
getName
());
InputStream
input
=
null
;
try
{
input
=
new
FileInputStream
(
file
);
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
OutputStream
os
=
null
;
try
{
os
=
item
.
getOutputStream
();
int
ret
=
input
.
read
();
while
(
ret
!=
-
1
)
{
os
.
write
(
ret
);
ret
=
input
.
read
();
}
os
.
flush
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
new
CommonsMultipartFile
(
item
);
}
public
static
File
base64ToFile
(
String
base64
)
{
if
(
base64
==
null
||
""
.
equals
(
base64
))
{
return
null
;
}
//getRealImgeStr 方法 截取bese64字符串 逗号后半部分有用的字符串
byte
[]
buff
=
Base64
.
decode
(
getRealImgeStr
(
base64
));
File
file
=
null
;
FileOutputStream
fout
=
null
;
try
{
file
=
File
.
createTempFile
(
"tmp"
,
".jpg"
);
fout
=
new
FileOutputStream
(
file
);
fout
.
write
(
buff
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
fout
!=
null
)
{
try
{
fout
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
return
file
;
}
public
static
String
getRealImgeStr
(
String
imgStr
){
String
[]
str
=
imgStr
.
split
(
","
);
return
str
[
1
];
}
}
src/main/java/com/baosight/hpjx/hp/mt/untils/Base64Utils.java
0 → 100644
View file @
ced5cf4c
package
com
.
baosight
.
hpjx
.
hp
.
mt
.
untils
;
import
org.springframework.web.multipart.MultipartFile
;
import
sun.misc.BASE64Decoder
;
import
java.io.IOException
;
public
class
Base64Utils
{
public
static
MultipartFile
base64ToMultipartFile
(
String
s
)
{
MultipartFile
image
=
null
;
StringBuilder
base64
=
new
StringBuilder
(
""
);
if
(
s
!=
null
&&
!
""
.
equals
(
s
))
{
base64
.
append
(
s
);
String
[]
baseStrs
=
base64
.
toString
().
split
(
","
);
BASE64Decoder
decoder
=
new
BASE64Decoder
();
byte
[]
b
=
new
byte
[
0
];
try
{
b
=
decoder
.
decodeBuffer
(
baseStrs
[
1
]);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
for
(
int
j
=
0
;
j
<
b
.
length
;
++
j
)
{
if
(
b
[
j
]
<
0
)
{
b
[
j
]
+=
256
;
}
}
image
=
new
BASE64DecodedMultipartFile
(
b
,
baseStrs
[
0
]);
}
return
image
;
}
}
src/main/java/com/baosight/hpjx/hp/mt/untils/
uploadUntil
.java
→
src/main/java/com/baosight/hpjx/hp/mt/untils/
UploadUtils
.java
View file @
ced5cf4c
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.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.MultipartFile
;
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
uploadUntil
{
import
static
com
.
baosight
.
iplat4j
.
eu
.
dm
.
util
.
FileUploadConstant
.
VIRTUAL_ROOT
;
public
class
UploadUtils
{
public
static
String
ROOT_PATH
=
"C:/workspace/java/hp-smart/file"
;
private
static
String
DEFAULT_INVALID_SUFFIX
;
private
static
String
MODULE_NAME
=
"EP"
;
private
static
String
PROJECT_NAME
=
"HPJX"
;
private
static
String
VIRTUAL_ROOT
=
"HPJX_EP_$"
;
public
static
IFileUploader
fileUploader
;
public
static
String
upload
(
CommonsMultipartFile
multipartFile
)
throws
IOException
{
private
static
Dao
dao
=
(
Dao
)
PlatApplicationContext
.
getApplicationContext
().
getBean
(
"dao"
);
public
static
JSONObject
upload
(
CommonsMultipartFile
multipartFile
)
throws
IOException
{
JSONObject
documentJSON
=
new
JSONObject
();
String
filePath
;
String
msg
;
...
...
@@ -25,9 +43,9 @@ public class uploadUntil {
String
docPath
;
filePath
=
multipartFile
.
getOriginalFilename
();
Long
docSize
=
multipartFile
.
getSize
();
String
chgName
=
fileUploader
.
transformFileName
(
filePath
);
String
chgName
=
transformFileName
(
filePath
);
String
attachmentName
;
Map
<
String
,
String
>
pathMap
=
fileUploader
.
getRealPath
(
"A"
);
Map
<
String
,
String
>
pathMap
=
getRealPath
(
"A"
);
msg
=
(
String
)
pathMap
.
get
(
"dirId"
);
category
=
(
String
)
pathMap
.
get
(
"path"
);
checkInvalidPath
(
category
);
...
...
@@ -46,7 +64,7 @@ public class uploadUntil {
map
.
put
(
"docSize"
,
docSize
);
map
.
put
(
"recCreator"
,
""
);
map
.
put
(
"recCreateTime"
,
DateUtils
.
curDateTimeStr14
());
fileUploader
.
uploadDoc
(
map
);
uploadDoc
(
map
);
attachmentName
=
category
+
"/"
+
chgName
;
multipartFile
.
transferTo
(
new
File
(
attachmentName
));
documentJSON
.
put
(
"docId"
,
docPath
);
...
...
@@ -57,9 +75,56 @@ public class uploadUntil {
documentJSON
.
put
(
"docUrl"
,
attachmentName
);
documentJSON
.
put
(
"docSize"
,
docSize
);
documentJSON
.
put
(
"docName"
,
filePath
);
return
documentJSON
;
}
private
static
String
transformFileName
(
String
originalFileName
)
{
String
dateMselStr14
=
DateUtils
.
curDateTimeStr14
();
String
uuid8
=
FileProcessUtils
.
getShortUuid
();
String
chgFileName
=
dateMselStr14
+
"_"
+
uuid8
;
String
dot
=
"."
;
int
index
=
originalFileName
.
lastIndexOf
(
dot
);
String
fileName
;
if
(
index
>
0
)
{
String
suffix
=
originalFileName
.
substring
(
index
+
1
);
String
invalidSuffixConfig
=
PlatApplicationContext
.
getProperty
(
"iplat.upload.invalidSuffix"
);
if
(!
StringUtils
.
isNotEmpty
(
invalidSuffixConfig
))
{
invalidSuffixConfig
=
DEFAULT_INVALID_SUFFIX
;
}
String
[]
invalidSuffixs
=
invalidSuffixConfig
.
split
(
","
);
String
[]
var11
=
invalidSuffixs
;
int
var12
=
invalidSuffixs
.
length
;
for
(
int
var13
=
0
;
var13
<
var12
;
++
var13
)
{
String
invalidSuffix
=
var11
[
var13
];
if
(
suffix
.
equalsIgnoreCase
(
invalidSuffix
))
{
throw
new
PlatException
(
"文件扩展名不合法!"
);
}
}
fileName
=
chgFileName
+
dot
+
suffix
;
}
else
{
fileName
=
chgFileName
.
toString
();
}
return
fileName
;
}
public
static
Map
<
String
,
String
>
getRealPath
(
String
path
)
{
String
postPath
=
preparePath
(
path
);
String
dirId
=
initPath
(
postPath
);
postPath
=
ROOT_PATH
+
"/"
+
postPath
;
Map
<
String
,
String
>
map
=
new
HashMap
();
map
.
put
(
"path"
,
postPath
);
map
.
put
(
"dirId"
,
dirId
);
return
map
;
}
return
""
;
public
static
String
preparePath
(
String
path
)
{
return
path
;
}
public
static
void
checkInvalidPath
(
String
realPath
)
{
...
...
@@ -83,4 +148,91 @@ public class uploadUntil {
}
}
public
static
String
initPath
(
String
path
)
{
String
[]
dirs
=
path
.
split
(
"/"
);
String
parentId
=
VIRTUAL_ROOT
;
String
dirPath
=
VIRTUAL_ROOT
;
String
dirId
=
null
;
String
realPath
=
""
;
try
{
for
(
int
i
=
0
;
i
<
dirs
.
length
;
++
i
)
{
HashMap
<
String
,
String
>
pathMap
=
new
HashMap
();
pathMap
.
put
(
"parentId"
,
parentId
);
pathMap
.
put
(
"dirEname"
,
dirs
[
i
]);
pathMap
.
put
(
"moduleEname"
,
MODULE_NAME
);
pathMap
.
put
(
"projectEname"
,
PROJECT_NAME
);
List
pathList
=
dao
.
query
(
"EUDM01.queryPath"
,
pathMap
);
realPath
=
realPath
+
dirs
[
i
]
+
"/"
;
if
(
pathList
.
size
()
==
0
)
{
Map
<
String
,
String
>
dirRow
=
new
HashMap
();
String
userId
=
String
.
valueOf
(
UserSession
.
getUserId
());
String
dateTime
=
DateUtils
.
curDateTimeStr14
();
dirId
=
UUIDHexIdGenerator
.
generate
().
toString
();
dirPath
=
dirPath
+
"."
+
dirId
;
dirRow
.
put
(
"dirId"
,
dirId
);
dirRow
.
put
(
"dirEname"
,
dirs
[
i
]);
dirRow
.
put
(
"dirCname"
,
dirs
[
i
]);
dirRow
.
put
(
"parentId"
,
parentId
);
dirRow
.
put
(
"isLeaf"
,
i
==
dirs
.
length
-
1
?
"1"
:
"0"
);
dirRow
.
put
(
"dirPath"
,
dirPath
);
dirRow
.
put
(
"projectEname"
,
PROJECT_NAME
);
dirRow
.
put
(
"moduleEname"
,
MODULE_NAME
);
dirRow
.
put
(
"recCreator"
,
userId
);
dirRow
.
put
(
"recCreateTime"
,
dateTime
);
dirRow
.
put
(
"recRevisor"
,
" "
);
dirRow
.
put
(
"recReviseTime"
,
" "
);
dirRow
.
put
(
"archiveFlag"
,
" "
);
dirRow
.
put
(
"archiveFlag"
,
" "
);
dirRow
.
put
(
"realPath"
,
realPath
);
dao
.
insert
(
"EUDM01.insert"
,
dirRow
);
Map
<
String
,
String
>
dirMap
=
new
HashMap
();
dirMap
.
put
(
"dirId"
,
parentId
);
List
list
=
dao
.
query
(
"EUDM01.query"
,
dirMap
);
if
(
null
!=
list
&&
list
.
size
()
>
0
)
{
Map
<
String
,
String
>
item
=
(
Map
)
list
.
get
(
0
);
if
(
"1"
.
equals
(
item
.
get
(
"isLeaf"
)))
{
item
.
put
(
"isLeaf"
,
"0"
);
dao
.
update
(
"EUDM01.update"
,
list
.
get
(
0
));
}
}
parentId
=
dirId
;
}
else
{
Map
<
String
,
String
>
item
=
(
Map
)
pathList
.
get
(
0
);
parentId
=
(
String
)
item
.
get
(
"dirId"
);
dirId
=
(
String
)
item
.
get
(
"dirId"
);
dirPath
=
(
String
)
item
.
get
(
"dirPath"
);
}
}
return
dirId
;
}
catch
(
Exception
var16
)
{
throw
new
PlatException
(
"上传附件,创建目录: "
+
path
+
" 失败!"
,
var16
);
}
}
public
static
boolean
uploadDoc
(
Map
docMap
)
{
EUDM02
document
=
new
EUDM02
();
document
.
fromMap
(
docMap
);
try
{
dao
.
insert
(
"EUDM02.insert"
,
document
);
boolean
success
=
true
;
return
success
;
}
catch
(
Exception
var5
)
{
throw
new
PlatException
(
"保存附件 "
+
docMap
.
get
(
"docName"
)
+
" 失败!"
,
var5
);
}
}
public
static
String
imageToBase64
(
BufferedImage
bufferedImage
)
{
Base64
encoder
=
new
Base64
();
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
try
{
ImageIO
.
write
(
bufferedImage
,
"jpg"
,
baos
);
}
catch
(
IOException
e
)
{
}
return
new
String
(
encoder
.
encode
((
baos
.
toByteArray
())));
}
}
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC005.xml
View file @
ced5cf4c
...
...
@@ -333,6 +333,40 @@
ORDER BY PROJ_CODE
</select>
<!-- 项目下拉框 -->
<select
id=
"queryProjComboBox2"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT DISTINCT
A.PROJ_CODE as "projCode",
A.PROJ_NAME as "projName",
A.PROD_ORDER_NO AS "prodOrderNo",
B.PROD_TASK_NO AS "prodTaskNo"
FROM ${hpjxSchema}.T_HPSC005 A LEFT JOIN ${hpjxSchema}.T_HPSC005A B ON A.COMPANY_CODE=B.COMPANY_CODE
AND A.PROD_ORDER_NO=B.PROD_ORDER_NO
WHERE 1=1
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projCode"
>
A.PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"status"
>
A.STATUS = #status#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"orgNo"
>
B.ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"parentPrdtCode"
>
A.PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"subInventCode"
>
A.PART_CODE = #subInventCode#
</isNotEmpty>
ORDER BY A.PROJ_CODE
</select>
<!-- 生产组下拉框 -->
<select
id=
"queryOrgComboBox"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT
...
...
src/main/java/com/baosight/hpjx/hp/xs/sql/HPXSOrg.xml
View file @
ced5cf4c
...
...
@@ -165,7 +165,10 @@
ORG_CNAME
FROM iplat.TXSOG01 WHERE COMPANY_CODE=#companyCode#
) B ON A.PARENT_ORG_ID=B.ORG_ENAME
WHERE A.ORG_TYPE = 'cutGroup' AND A.COMPANY_CODE=#companyCode#
WHERE A.ORG_TYPE = 'prodGroup' AND A.COMPANY_CODE=#companyCode#
<isNotEmpty
prepend=
" AND "
property=
"factoryCode"
>
A.PARENT_ORG_ID=#factoryCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"factoryName"
>
B.ORG_CNAME LIKE CONCAT('%', #factoryName#, '%')
</isNotEmpty>
...
...
@@ -174,4 +177,15 @@
</isNotEmpty>
</select>
<!-- 查询组织信息 -->
<select
id=
"queryTedcm01"
resultClass=
"com.baosight.iplat4j.common.ed.domain.TEDCM01"
>
SELECT
ITEM_CODE AS "itemCode",
ITEM_CNAME AS "itemCname"
FROM iplat.TEDCM01
WHERE CODESET_CODE = 'hpjx.hpjx.poorType'
</select>
</sqlMap>
src/main/java/com/baosight/hpjx/hp/zl/domain/HPZL001.java
View file @
ced5cf4c
...
...
@@ -48,7 +48,9 @@ public class HPZL001 extends DaoEPBase {
public
static
final
String
FIELD_UPDATED_NAME
=
"updatedName"
;
/* 更新人名称*/
public
static
final
String
FIELD_UPDATED_TIME
=
"updatedTime"
;
/* 更新时间*/
public
static
final
String
FIELD_DELETE_FLAG
=
"deleteFlag"
;
/* 是否删除*/
public
static
final
String
FIELD_FACTORY_CODE
=
"factoryCode"
;
/* 厂区编码*/
public
static
final
String
FIELD_FACTORY_NAME
=
"factoryName"
;
/* 厂区名称*/
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_COMPANY_CODE
=
"COMPANY_CODE"
;
/* 企业编码 预留*/
public
static
final
String
COL_DEP_CODE
=
"DEP_CODE"
;
/* 部门编码*/
...
...
@@ -76,6 +78,8 @@ public class HPZL001 extends DaoEPBase {
public
static
final
String
COL_UPDATED_NAME
=
"UPDATED_NAME"
;
/* 更新人名称*/
public
static
final
String
COL_UPDATED_TIME
=
"UPDATED_TIME"
;
/* 更新时间*/
public
static
final
String
COL_DELETE_FLAG
=
"DELETE_FLAG"
;
/* 是否删除*/
public
static
final
String
COL_FACTORY_CODE
=
"FACTORY_CODE"
;
/* 厂区编码*/
public
static
final
String
COL_FACTORY_NAME
=
"FACTORY_NAME"
;
/* 厂区名称*/
public
static
final
String
QUERY
=
"HPZL001.query"
;
public
static
final
String
COUNT
=
"HPZL001.count"
;
...
...
@@ -110,6 +114,8 @@ public class HPZL001 extends DaoEPBase {
private
String
updatedName
=
" "
;
/* 更新人名称*/
private
String
updatedTime
=
" "
;
/* 更新时间*/
private
Integer
deleteFlag
;
/* 是否删除*/
private
String
factoryCode
=
" "
;
/* 厂区编码*/
private
String
factoryName
=
" "
;
/* 厂区名称*/
/**
* initialize the metadata.
...
...
@@ -225,6 +231,14 @@ public class HPZL001 extends DaoEPBase {
eiColumn
=
new
EiColumn
(
FIELD_DELETE_FLAG
);
eiColumn
.
setDescName
(
"是否删除"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_FACTORY_CODE
);
eiColumn
.
setDescName
(
"厂区编码"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_FACTORY_NAME
);
eiColumn
.
setDescName
(
"厂区名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
...
...
@@ -669,6 +683,38 @@ public class HPZL001 extends DaoEPBase {
this
.
deleteFlag
=
deleteFlag
;
}
/**
* get the factoryCode - 厂区编码.
* @return the factoryCode
*/
public
String
getFactoryCode
()
{
return
this
.
factoryCode
;
}
/**
* set the factoryCode - 厂区编码.
*
* @param factoryCode - 厂区编码
*/
public
void
setFactoryCode
(
String
factoryCode
)
{
this
.
factoryCode
=
factoryCode
;
}
/**
* get the factoryName - 厂区名称.
* @return the factoryName
*/
public
String
getFactoryName
()
{
return
this
.
factoryName
;
}
/**
* set the factoryName - 厂区名称.
*
* @param factoryName - 厂区名称
*/
public
void
setFactoryName
(
String
factoryName
)
{
this
.
factoryName
=
factoryName
;
}
/**
* get the value from Map.
*
* @param map - source data map
...
...
@@ -703,6 +749,8 @@ public class HPZL001 extends DaoEPBase {
setUpdatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_NAME
)),
updatedName
));
setUpdatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_TIME
)),
updatedTime
));
setDeleteFlag
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DELETE_FLAG
)),
deleteFlag
));
setFactoryCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_FACTORY_CODE
)),
factoryCode
));
setFactoryName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_FACTORY_NAME
)),
factoryName
));
}
/**
...
...
@@ -739,7 +787,8 @@ public class HPZL001 extends DaoEPBase {
map
.
put
(
FIELD_UPDATED_NAME
,
StringUtils
.
toString
(
updatedName
,
eiMetadata
.
getMeta
(
FIELD_UPDATED_NAME
)));
map
.
put
(
FIELD_UPDATED_TIME
,
StringUtils
.
toString
(
updatedTime
,
eiMetadata
.
getMeta
(
FIELD_UPDATED_TIME
)));
map
.
put
(
FIELD_DELETE_FLAG
,
StringUtils
.
toString
(
deleteFlag
,
eiMetadata
.
getMeta
(
FIELD_DELETE_FLAG
)));
map
.
put
(
FIELD_FACTORY_CODE
,
StringUtils
.
toString
(
factoryCode
,
eiMetadata
.
getMeta
(
FIELD_FACTORY_CODE
)));
map
.
put
(
FIELD_FACTORY_NAME
,
StringUtils
.
toString
(
factoryName
,
eiMetadata
.
getMeta
(
FIELD_FACTORY_NAME
)));
return
map
;
}
}
src/main/java/com/baosight/hpjx/hp/zl/domain/HPZL001A.java
View file @
ced5cf4c
...
...
@@ -35,6 +35,7 @@ public class HPZL001A extends DaoEPBase {
public
static
final
String
FIELD_UPDATED_BY
=
"updatedBy"
;
/* 修改人*/
public
static
final
String
FIELD_UPDATED_NAME
=
"updatedName"
;
/* 修改人名称*/
public
static
final
String
FIELD_UPDATED_TIME
=
"updatedTime"
;
/* 修改时间*/
public
static
final
String
FIELD_BIZ_TYPE
=
"bizType"
;
/* 业务类型*/
public
static
final
String
COL_ID
=
"ID"
;
/* 主键ID*/
public
static
final
String
COL_COMPANY_CODE
=
"COMPANY_CODE"
;
/* 企业编码 预留*/
...
...
@@ -49,6 +50,7 @@ public class HPZL001A extends DaoEPBase {
public
static
final
String
COL_UPDATED_BY
=
"UPDATED_BY"
;
/* 修改人*/
public
static
final
String
COL_UPDATED_NAME
=
"UPDATED_NAME"
;
/* 修改人名称*/
public
static
final
String
COL_UPDATED_TIME
=
"UPDATED_TIME"
;
/* 修改时间*/
public
static
final
String
COL_BIZ_TYPE
=
"BIZ_TYPE"
;
/* 业务类型*/
public
static
final
String
QUERY
=
"HPZL001A.query"
;
public
static
final
String
COUNT
=
"HPZL001A.count"
;
...
...
@@ -69,6 +71,7 @@ public class HPZL001A extends DaoEPBase {
private
String
updatedBy
=
" "
;
/* 修改人*/
private
String
updatedName
=
" "
;
/* 修改人名称*/
private
String
updatedTime
=
" "
;
/* 修改时间*/
private
String
bizType
=
" "
;
/* 业务类型*/
/**
* initialize the metadata.
...
...
@@ -129,6 +132,10 @@ public class HPZL001A extends DaoEPBase {
eiColumn
.
setDescName
(
"修改时间"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_BIZ_TYPE
);
eiColumn
.
setDescName
(
"业务类型"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
...
...
@@ -348,6 +355,22 @@ public class HPZL001A extends DaoEPBase {
this
.
updatedTime
=
updatedTime
;
}
/**
* get the bizType - 业务类型.
* @return the bizType
*/
public
String
getBizType
()
{
return
this
.
bizType
;
}
/**
* set the bizType - 业务类型.
*
* @param bizType - 业务类型
*/
public
void
setBizType
(
String
bizType
)
{
this
.
bizType
=
bizType
;
}
/**
* get the value from Map.
*
* @param map - source data map
...
...
@@ -368,6 +391,7 @@ public class HPZL001A extends DaoEPBase {
setUpdatedBy
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_BY
)),
updatedBy
));
setUpdatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_NAME
)),
updatedName
));
setUpdatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_TIME
)),
updatedTime
));
setBizType
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_BIZ_TYPE
)),
bizType
));
}
/**
...
...
@@ -390,6 +414,7 @@ public class HPZL001A extends DaoEPBase {
map
.
put
(
FIELD_UPDATED_BY
,
StringUtils
.
toString
(
updatedBy
,
eiMetadata
.
getMeta
(
FIELD_UPDATED_BY
)));
map
.
put
(
FIELD_UPDATED_NAME
,
StringUtils
.
toString
(
updatedName
,
eiMetadata
.
getMeta
(
FIELD_UPDATED_NAME
)));
map
.
put
(
FIELD_UPDATED_TIME
,
StringUtils
.
toString
(
updatedTime
,
eiMetadata
.
getMeta
(
FIELD_UPDATED_TIME
)));
map
.
put
(
FIELD_BIZ_TYPE
,
StringUtils
.
toString
(
bizType
,
eiMetadata
.
getMeta
(
FIELD_BIZ_TYPE
)));
return
map
;
}
...
...
src/main/java/com/baosight/hpjx/hp/zl/service/ServiceHPZL001B.java
View file @
ced5cf4c
...
...
@@ -128,6 +128,8 @@ public class ServiceHPZL001B extends ServiceEPBase {
newZl001
.
setDeleteFlag
(
CommonConstant
.
YesNo
.
NO_0
);
newZl001
.
setCheckUser
(
UserSession
.
getLoginName
());
newZl001
.
setCheckUserName
(
UserSession
.
getLoginCName
());
newZl001
.
setFactoryCode
(
dbSc005b
.
getFactoryCode
());
newZl001
.
setFactoryName
(
dbSc005b
.
getFactoryName
());
DaoUtils
.
insert
(
HPZL001
.
INSERT
,
newZl001
);
}
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/baosight/hpjx/hp/zl/sql/HPZL001.xml
View file @
ced5cf4c
...
...
@@ -12,6 +12,8 @@
PROD_TASK_NO as "prodTaskNo",
<!-- 生产任务号 -->
PROJ_CODE as "projCode",
<!-- 项目号 -->
PROJ_NAME as "projName",
<!-- 项目名称 -->
FACTORY_CODE as "factoryCode",
<!-- 厂区编码 -->
FACTORY_NAME as "factoryName",
<!-- 厂区名称 -->
INVENT_CODE as "inventCode",
<!-- 部件编码 -->
INVENT_NAME as "inventName",
<!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode",
<!-- 零件编码 -->
...
...
@@ -138,6 +140,8 @@
INVENT_NAME,
<!-- 部件名称 -->
SUB_INVENT_CODE,
<!-- 零件编码 -->
SUB_INVENT_NAME,
<!-- 零件名称 -->
FACTORY_CODE,
<!-- 厂区编码 -->
FACTORY_NAME,
<!-- 厂区名称 -->
ORG_NO,
<!-- 生产组编码 -->
ORG_NAME,
<!-- 生产组名称 -->
POOR_TYPE,
<!-- 不良品类 -->
...
...
@@ -151,7 +155,7 @@
DELETE_FLAG
<!-- 是否删除 -->
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #checkNo#, #prodOrderNo#, #prodTaskNo#,
#projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#factoryCode#,#factoryName#,
#orgNo#, #orgName#, #poorType#, #problemDesc#,#checkUser#,#checkUserName#, #status#,
#createdBy#, #createdName#, #createdTime#, #deleteFlag#)
</insert>
...
...
src/main/java/com/baosight/hpjx/hp/zl/sql/HPZL001A.xml
View file @
ced5cf4c
...
...
@@ -15,7 +15,7 @@
A.CREATED_TIME as "createdTime",
<!-- 创建时间 -->
A.UPDATED_BY as "updatedBy",
<!-- 修改人 -->
A.UPDATED_NAME as "updatedName",
<!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime"
<!-- 修改时间 -->
A.UPDATED_TIME as "updatedTime"
<!-- 修改时间 -->
</sql>
<sql
id=
"condition"
>
...
...
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