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
88191fb9
Commit
88191fb9
authored
Apr 07, 2024
by
wancheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app代码优化
parent
ace52f87
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
154 additions
and
131 deletions
+154
-131
ServiceHPMT002.java
.../java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
+140
-117
HPZL001A.java
src/main/java/com/baosight/hpjx/hp/zl/domain/HPZL001A.java
+14
-14
No files found.
src/main/java/com/baosight/hpjx/hp/mt/service/ServiceHPMT002.java
View file @
88191fb9
package
com
.
baosight
.
hpjx
.
hp
.
mt
.
service
;
import
cn.hutool.core.util.PageUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baosight.hpjx.common.DdynamicEnum
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoBase
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.hp.mt.untils.Base64ToMultipartFile
;
import
com.baosight.hpjx.hp.mt.untils.Base64Utils
;
import
com.baosight.hpjx.hp.mt.untils.UploadUtils
;
import
com.baosight.hpjx.hp.mt.untils.UploadUtils2
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002A
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005
;
import
com.baosight.hpjx.hp.xs.domain.User
;
import
com.baosight.hpjx.hp.zl.domain.HPZL001
;
import
com.baosight.hpjx.hp.zl.domain.HPZL001A
;
...
...
@@ -22,7 +28,12 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
net.sf.json.JSONObject
;
import
org.apache.commons.collections.MapUtils
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
javax.imageio.ImageIO
;
...
...
@@ -55,34 +66,32 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmProject
(
EiInfo
inInfo
)
{
public
Map
pmProject
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
projName
=
inInfo
.
getString
(
"projName"
);
int
offset
=
inInfo
.
getInt
(
"offset"
);
//当前页
int
pageSize
=
inInfo
.
getInt
(
"pageSize"
);
//每页条数
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"companyCode"
,
companyCode
);
sqlMap
.
put
(
"projName"
,
projName
);
List
count
=
this
.
dao
.
query
(
"HPMT002.pmProjectCount"
,
sqlMap
);
List
<
Map
>
count
=
this
.
dao
.
query
(
"HPMT002.pmProjectCount"
,
sqlMap
);
offset
=(
offset
-
1
)*
pageSize
;
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
);
}
resultMap
.
put
(
"result"
,
rows
);
resultMap
.
put
(
"count"
,
count
.
size
());
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
;
}
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
maps
);
outInfo
.
setBlock
(
eiBlock
);
outInfo
.
set
(
"count"
,
count
.
get
(
0
));
return
outInfo
;
}
/**
...
...
@@ -91,18 +100,24 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmProjectCount
(
EiInfo
inInfo
)
{
public
Map
pmProjectCount
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
projName
=
inInfo
.
getString
(
"projName"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"companyCode"
,
companyCode
);
sqlMap
.
put
(
"projName"
,
projName
);
int
count
=
this
.
dao
.
count
(
"HPMT002.pmProjectCount"
,
sqlMap
);
inInfo
.
set
(
"count"
,
count
);
return
inInfo
;
resultMap
.
put
(
"count"
,
count
);
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
;
}
}
/**
...
...
@@ -111,20 +126,24 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmQuality
(
EiInfo
inInfo
)
{
public
Map
pmQuality
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
queryMonth
=
inInfo
.
getString
(
"queryMonth"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"companyCode"
,
companyCode
);
sqlMap
.
put
(
"queryMonth"
,
queryMonth
);
List
<
Map
>
rows
=
this
.
dao
.
query
(
"HPMT002.pmQuality"
,
sqlMap
);
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
rows
);
outInfo
.
setBlock
(
eiBlock
);
return
outInfo
;
resultMap
.
put
(
"result"
,
rows
);
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
;
}
}
/**
...
...
@@ -133,15 +152,14 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmQualityList
(
EiInfo
inInfo
)
{
public
Map
pmQualityList
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
status
=
inInfo
.
getString
(
"status"
);
String
projName
=
inInfo
.
getString
(
"projName"
);
int
offset
=
inInfo
.
getInt
(
"offset"
);
//当前页
int
pageSize
=
inInfo
.
getInt
(
"pageSize"
);
//每页条数
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"companyCode"
,
companyCode
);
sqlMap
.
put
(
"projName"
,
projName
);
...
...
@@ -151,12 +169,16 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap
.
put
(
"offset"
,
offset
);
sqlMap
.
put
(
"pageSize"
,
pageSize
);
List
<
Map
>
rows
=
this
.
dao
.
query
(
"HPMT002.pmQualityList"
,
sqlMap
);
EiInfo
outInfo
=
new
EiInfo
();
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
rows
);
outInfo
.
setBlock
(
eiBlock
);
outInfo
.
set
(
"count"
,
count
.
get
(
0
));
return
outInfo
;
resultMap
.
put
(
"result"
,
rows
);
resultMap
.
put
(
"count"
,
count
.
get
(
0
));
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
;
}
}
...
...
@@ -166,60 +188,47 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmQualityDetail
(
EiInfo
inInfo
)
{
EiInfo
outInfo
=
new
EiInfo
();
public
Map
pmQualityDetail
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
id
=
inInfo
.
getString
(
"id"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
outInfo
.
setMsg
(
"账号异常"
);
}
Map
Map
=
new
HashMap
();
Map
.
put
(
"checkId"
,
id
);
Map
.
put
(
"docType"
,
1
);
List
<
HPZL001A
>
docIdlist
=
this
.
dao
.
query
(
"HPZL001A.query
Dev
"
,
Map
);
List
<
HPZL001A
>
docIdlist
=
this
.
dao
.
query
(
"HPZL001A.query
Run
"
,
Map
);
List
<
String
>
imgList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
docIdlist
.
size
();
i
++)
{
Map
dirId
=
new
HashMap
();
HPZL001A
hpzl001A
=
docIdlist
.
get
(
i
);
String
docId
=
hpzl001A
.
getDocId
();
dirId
.
put
(
"docId"
,
docId
);
List
<
Map
>
query
=
this
.
dao
.
query
(
"HPMT002.queryFile"
,
dirId
);
File
file
=
new
File
(
UploadUtils
.
ROOT_PATH
+
"/A/"
+
query
.
get
(
0
).
get
(
"CHG_NAME"
));
BufferedImage
bf
=
ImageIO
.
read
(
file
);
String
imgBase64
=
UploadUtils
.
imageToBase64
(
bf
);
imgList
.
add
(
imgBase64
);
imgList
.
add
(
docId
);
}
//处理的文件
Map
Map2
=
new
HashMap
();
Map2
.
put
(
"checkId"
,
id
);
Map2
.
put
(
"docType"
,
2
);
List
<
HPZL001A
>
docIdlist2
=
this
.
dao
.
query
(
"HPZL001A.query
Dev
"
,
Map2
);
List
<
HPZL001A
>
docIdlist2
=
this
.
dao
.
query
(
"HPZL001A.query
Run
"
,
Map2
);
List
<
String
>
imgList2
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
docIdlist2
.
size
();
i
++)
{
Map
dirId
=
new
HashMap
();
HPZL001A
hpzl001A
=
docIdlist2
.
get
(
i
);
String
docId
=
hpzl001A
.
getDocId
();
dirId
.
put
(
"docId"
,
docId
);
List
<
Map
>
query
=
this
.
dao
.
query
(
"HPMT002.queryFile"
,
dirId
);
File
file
=
new
File
(
UploadUtils
.
ROOT_PATH
+
"/A/"
+
query
.
get
(
0
).
get
(
"CHG_NAME"
));
BufferedImage
bf
=
ImageIO
.
read
(
file
);
String
imgBase64
=
UploadUtils
.
imageToBase64
(
bf
);
imgList2
.
add
(
imgBase64
);
imgList2
.
add
(
docId
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"companyCode"
,
companyCode
);
sqlMap
.
put
(
"id"
,
id
);
List
<
Map
>
rows
=
this
.
dao
.
query
(
"HPMT002.pmQualityDetail"
,
sqlMap
);
EiBlock
eiBlock
=
new
EiBlock
(
EiConstant
.
resultBlock
);
eiBlock
.
setRows
(
rows
);
outInfo
.
setBlock
(
eiBlock
);
outInfo
.
set
(
"img"
,
imgList
);
outInfo
.
set
(
"img2"
,
imgList2
);
}
catch
(
Exception
e
){
outInfo
.
setMsg
(
"账号异常"
);
resultMap
.
put
(
"result"
,
rows
);
resultMap
.
put
(
"img"
,
imgList
);
resultMap
.
put
(
"img2"
,
imgList2
);
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
;
}
return
outInfo
;
}
/**
...
...
@@ -228,16 +237,15 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmQualityXl
(
EiInfo
inInfo
)
{
public
Map
pmQualityXl
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
factoryId
=
inInfo
.
getString
(
"factoryId"
);
//工厂id
String
prodCode
=
inInfo
.
getString
(
"projCode"
);
//项目id
String
orgNo
=
inInfo
.
getString
(
"orgNo"
);
//生产组id
String
inventCode
=
inInfo
.
getString
(
"inventCode"
);
//部件id
String
subInventCode
=
inInfo
.
getString
(
"subInventCode"
);
//零件id
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"companyCode"
,
companyCode
);
sqlMap
.
put
(
"factoryCode"
,
factoryId
);
...
...
@@ -247,16 +255,30 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap
.
put
(
"subInventCode"
,
subInventCode
);
EiInfo
outInfo
=
new
EiInfo
();
TEDCM01
tedcm01
=
new
TEDCM01
();
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
APP_MAP_BLOCK_FACTORY
),
null
,
false
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
APP_MAP_BLOCK_PROJCODE
),
sqlMap
,
false
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
APP_MAP_BLOCK_PRDTCODE
),
sqlMap
,
false
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
APP_MAP_BLOCK_ORG_NO
),
sqlMap
,
false
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
APP_MAP_BLOCK_PARTCODE
),
sqlMap
,
false
);
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
POOR_TYPE_BLOCK_ID
),
null
,
false
);
List
<
Map
>
queryFactory
=
this
.
dao
.
query
(
"HPMT002.queryFactory"
,
sqlMap
);
List
<
Map
>
queryProjCode
=
this
.
dao
.
query
(
"HPMT002.queryProjCode"
,
sqlMap
);
List
<
Map
>
queryPrdtCode
=
this
.
dao
.
query
(
"HPMT002.queryPrdtCode"
,
sqlMap
);
List
<
Map
>
queryOrgNo
=
this
.
dao
.
query
(
"HPMT002.queryOrgNo"
,
sqlMap
);
List
<
Map
>
queryPartCode
=
this
.
dao
.
query
(
"HPMT002.queryPartCode"
,
sqlMap
);
List
<
Map
>
queryTedcm01
=
this
.
dao
.
query
(
"HPXSOrg.queryTedcm01"
,
tedcm01
);
if
(
subInventCode
!=
null
&&!
subInventCode
.
equals
(
""
)){
CommonMethod
.
initBlock
(
outInfo
,
Arrays
.
asList
(
DdynamicEnum
.
APP_MAP_BLOCK_PRODTASKNO
),
sqlMap
,
false
);
List
<
Map
>
queryProdTaskNo
=
this
.
dao
.
query
(
"HPMT002.queryProdTaskNo"
,
sqlMap
);
resultMap
.
put
(
"ProdTaskNo"
,
queryProdTaskNo
);
}
resultMap
.
put
(
"Factory"
,
queryFactory
);
resultMap
.
put
(
"ProjCode"
,
queryProjCode
);
resultMap
.
put
(
"PrdtCode"
,
queryPrdtCode
);
resultMap
.
put
(
"OrgNo"
,
queryOrgNo
);
resultMap
.
put
(
"PartCode"
,
queryPartCode
);
resultMap
.
put
(
"Tedcm01"
,
queryTedcm01
);
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
;
}
return
outInfo
;
}
/**
...
...
@@ -265,13 +287,11 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmInsertQuality
(
EiInfo
inInfo
)
{
public
Map
pmInsertQuality
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
docId
=
inInfo
.
getString
(
"docId"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
try
{
HPZL001
fZl001
=
new
HPZL001
();
Map
attr
=
inInfo
.
getAttr
();
fZl001
.
fromMap
(
attr
);
...
...
@@ -289,16 +309,16 @@ public class ServiceHPMT002 extends ServiceBase {
fZl001
.
setStatus
(
CommonConstant
.
YesNo
.
NO_0
);
DaoUtils
.
insert
(
HPZL001
.
INSERT
,
fZl001
);
//处理文件
if
(!
docId
.
equals
(
""
))
{
if
(!
docId
.
equals
(
""
))
{
Map
fZl0012
=
new
HashMap
();
fZl0012
.
put
(
"checkNo"
,
fZl001
.
getCheckNo
());
List
<
HPZL001
>
HPZL001
=
dao
.
query
(
"HPZL001.query"
,
fZl0012
);
List
<
HPZL001
>
HPZL001
=
dao
.
query
(
"HPZL001.query"
,
fZl0012
);
//绑定文件
String
[]
docIds
=
docId
.
split
(
","
);
int
num
=
0
;
while
(
num
<
docIds
.
length
)
{
HPZL001A
HPZL001A
=
new
HPZL001A
();
HPZL001A
.
setDep
Code
(
CommonConstant
.
YesNo
.
YES
);
HPZL001A
.
setDept
Code
(
CommonConstant
.
YesNo
.
YES
);
HPZL001A
.
setDocType
(
CommonConstant
.
YesNo
.
YES_1
);
HPZL001A
.
setBizType
(
"XJ_WC"
);
HPZL001A
.
setDocId
(
docIds
[
num
]);
...
...
@@ -308,28 +328,29 @@ public class ServiceHPMT002 extends ServiceBase {
num
++;
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"新增成功!"
);
resultMap
.
put
(
"status"
,
EiConstant
.
STATUS_SUCCESS
);
resultMap
.
put
(
"message"
,
"SUCCESS"
);
return
resultMap
;
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"新增失败"
);
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
LogUtils
.
getMsg
(
e
));
return
resultMap
;
}
return
inInfo
;
}
/**
* 生产管理-质量巡检处理
*
* @param inInfo
* @return
*/
public
EiInfo
pmModifyQuality
(
EiInfo
inInfo
)
{
public
Map
pmModifyQuality
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
docId
=
inInfo
.
getString
(
"docId"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
try
{
HPZL001
fZl001
=
new
HPZL001
();
Map
attr
=
inInfo
.
getAttr
();
fZl001
.
fromMap
(
attr
);
...
...
@@ -347,7 +368,7 @@ public class ServiceHPMT002 extends ServiceBase {
int
num
=
0
;
while
(
num
<
docIds
.
length
)
{
HPZL001A
HPZL001A
=
new
HPZL001A
();
HPZL001A
.
setDepCode
(
CommonConstant
.
YesNo
.
YES
);
HPZL001A
.
setDep
t
Code
(
CommonConstant
.
YesNo
.
YES
);
HPZL001A
.
setDocType
(
2
);
HPZL001A
.
setBizType
(
"XJ_CL"
);
HPZL001A
.
setDocId
(
docIds
[
num
]);
...
...
@@ -357,11 +378,14 @@ public class ServiceHPMT002 extends ServiceBase {
num
++;
}
}
inInfo
.
setMsg
(
"处理成功!"
);
resultMap
.
put
(
"status"
,
EiConstant
.
STATUS_SUCCESS
);
resultMap
.
put
(
"message"
,
"SUCCESS"
);
return
resultMap
;
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"处理失败"
);
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
LogUtils
.
getMsg
(
e
));
return
resultMap
;
}
return
inInfo
;
}
...
...
@@ -371,23 +395,22 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public
EiInfo
pmUploadFile
(
EiInfo
inInfo
)
{
String
files
=
inInfo
.
getString
(
"files"
);
String
companyCode
=
UserSessionUtils
.
getCompanyCode
();
if
(
StrUtil
.
isEmpty
(
companyCode
))
{
inInfo
.
setMsg
(
"账号异常"
);
}
public
Map
pmUploadFile
(
EiInfo
inInfo
)
{
Map
resultMap
=
new
HashMap
();
try
{
String
files
=
inInfo
.
getString
(
"files"
);
CommonsMultipartFile
multipartFile
=
Base64ToMultipartFile
.
base64toMultipartFile
(
files
);
JSONObject
upload
=
UploadUtils
.
upload
(
multipartFile
);
inInfo
.
set
(
"id"
,
upload
.
getString
(
"docId"
));
inInfo
.
setMsg
(
"上传成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"上传失败"
);
System
.
out
.
println
(
"--------------------------------转换Base64成功"
);
JSONObject
upload
=
UploadUtils2
.
upload
(
multipartFile
);
resultMap
.
put
(
"id"
,
upload
.
getString
(
"docId"
));
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
;
}
return
inInfo
;
}
}
src/main/java/com/baosight/hpjx/hp/zl/domain/HPZL001A.java
View file @
88191fb9
...
...
@@ -24,7 +24,7 @@ public class HPZL001A extends DaoEPBase {
public
static
final
String
FIELD_ID
=
"id"
;
/* 主键ID*/
public
static
final
String
FIELD_COMPANY_CODE
=
"companyCode"
;
/* 企业编码 预留*/
public
static
final
String
FIELD_DEP
_CODE
=
"dep
Code"
;
/* 部门编码 预留*/
public
static
final
String
FIELD_DEP
T_CODE
=
"dept
Code"
;
/* 部门编码 预留*/
public
static
final
String
FIELD_DOC_TYPE
=
"docType"
;
/* 附件类型*/
public
static
final
String
FIELD_CHECK_ID
=
"checkId"
;
/* 质量巡检单ID*/
public
static
final
String
FIELD_DOC_ID
=
"docId"
;
/* 文件ID*/
...
...
@@ -39,7 +39,7 @@ public class HPZL001A extends DaoEPBase {
public
static
final
String
COL_ID
=
"ID"
;
/* 主键ID*/
public
static
final
String
COL_COMPANY_CODE
=
"COMPANY_CODE"
;
/* 企业编码 预留*/
public
static
final
String
COL_DEP
_CODE
=
"DEP
_CODE"
;
/* 部门编码 预留*/
public
static
final
String
COL_DEP
T_CODE
=
"DEPT
_CODE"
;
/* 部门编码 预留*/
public
static
final
String
COL_DOC_TYPE
=
"DOC_TYPE"
;
/* 附件类型*/
public
static
final
String
COL_CHECK_ID
=
"CHECK_ID"
;
/* 质量巡检单ID*/
public
static
final
String
COL_DOC_ID
=
"DOC_ID"
;
/* 文件ID*/
...
...
@@ -60,7 +60,7 @@ public class HPZL001A extends DaoEPBase {
private
Long
id
;
/* 主键ID*/
private
String
companyCode
=
" "
;
/* 企业编码 预留*/
private
String
depCode
=
" "
;
/* 部门编码 预留*/
private
String
dep
t
Code
=
" "
;
/* 部门编码 预留*/
private
Integer
docType
;
/* 附件类型*/
private
Long
checkId
;
/* 质量巡检单ID*/
private
String
docId
=
" "
;
/* 文件ID*/
...
...
@@ -88,7 +88,7 @@ public class HPZL001A extends DaoEPBase {
eiColumn
.
setDescName
(
"企业编码 预留"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DEP_CODE
);
eiColumn
=
new
EiColumn
(
FIELD_DEP
T
_CODE
);
eiColumn
.
setDescName
(
"部门编码 预留"
);
eiMetadata
.
addMeta
(
eiColumn
);
...
...
@@ -179,20 +179,20 @@ public class HPZL001A extends DaoEPBase {
this
.
companyCode
=
companyCode
;
}
/**
* get the depCode - 部门编码 预留.
* @return the depCode
* get the dep
t
Code - 部门编码 预留.
* @return the dep
t
Code
*/
public
String
getDepCode
()
{
return
this
.
depCode
;
public
String
getDep
t
Code
()
{
return
this
.
dep
t
Code
;
}
/**
* set the depCode - 部门编码 预留.
* set the dep
t
Code - 部门编码 预留.
*
* @param depCode - 部门编码 预留
* @param dep
t
Code - 部门编码 预留
*/
public
void
setDep
Code
(
String
dep
Code
)
{
this
.
dep
Code
=
dep
Code
;
public
void
setDep
tCode
(
String
dept
Code
)
{
this
.
dep
tCode
=
dept
Code
;
}
/**
* get the docType - 附件类型.
...
...
@@ -380,7 +380,7 @@ public class HPZL001A extends DaoEPBase {
setId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_ID
)),
id
));
setCompanyCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_COMPANY_CODE
)),
companyCode
));
setDep
Code
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DEP_CODE
)),
dep
Code
));
setDep
tCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DEPT_CODE
)),
dept
Code
));
setDocType
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DOC_TYPE
)),
docType
));
setCheckId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CHECK_ID
)),
checkId
));
setDocId
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DOC_ID
)),
docId
));
...
...
@@ -403,7 +403,7 @@ public class HPZL001A extends DaoEPBase {
Map
map
=
new
HashMap
();
map
.
put
(
FIELD_ID
,
StringUtils
.
toString
(
id
,
eiMetadata
.
getMeta
(
FIELD_ID
)));
map
.
put
(
FIELD_COMPANY_CODE
,
StringUtils
.
toString
(
companyCode
,
eiMetadata
.
getMeta
(
FIELD_COMPANY_CODE
)));
map
.
put
(
FIELD_DEP
_CODE
,
StringUtils
.
toString
(
depCode
,
eiMetadata
.
getMeta
(
FIELD_DEP
_CODE
)));
map
.
put
(
FIELD_DEP
T_CODE
,
StringUtils
.
toString
(
deptCode
,
eiMetadata
.
getMeta
(
FIELD_DEPT
_CODE
)));
map
.
put
(
FIELD_DOC_TYPE
,
StringUtils
.
toString
(
docType
,
eiMetadata
.
getMeta
(
FIELD_DOC_TYPE
)));
map
.
put
(
FIELD_CHECK_ID
,
StringUtils
.
toString
(
checkId
,
eiMetadata
.
getMeta
(
FIELD_CHECK_ID
)));
map
.
put
(
FIELD_DOC_ID
,
StringUtils
.
toString
(
docId
,
eiMetadata
.
getMeta
(
FIELD_DOC_ID
)));
...
...
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