Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-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
hg-smart
Commits
c73ae9be
Commit
c73ae9be
authored
May 08, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-05-08 优化工序单价导入提示显示
parent
f6546259
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
61 deletions
+68
-61
ServiceHGSJ003.java
.../java/com/baosight/hggp/hg/sj/service/ServiceHGSJ003.java
+15
-9
ExcelUtils.java
src/main/java/com/baosight/hggp/util/ExcelUtils.java
+52
-51
HGSJ003.js
src/main/webapp/HG/SJ/HGSJ003.js
+1
-1
No files found.
src/main/java/com/baosight/hggp/hg/sj/service/ServiceHGSJ003.java
View file @
c73ae9be
...
@@ -174,14 +174,20 @@ public class ServiceHGSJ003 extends ServiceEPBase {
...
@@ -174,14 +174,20 @@ public class ServiceHGSJ003 extends ServiceEPBase {
@OperationLogAnnotation
(
operModul
=
"工艺单价"
,
operType
=
"导入"
,
operDesc
=
"导入操作"
)
@OperationLogAnnotation
(
operModul
=
"工艺单价"
,
operType
=
"导入"
,
operDesc
=
"导入操作"
)
public
EiInfo
importDate
(
EiInfo
inInfo
)
{
public
EiInfo
importDate
(
EiInfo
inInfo
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>(
10
);
try
{
String
fileName
=
inInfo
.
getString
(
"fileName"
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>(
10
);
Map
<
String
,
Object
>
map
=
HGSJTools
.
Hgsj003
.
getCompany
(
UserSession
.
getLoginName
(),
OrgTypeEnum
.
COMPANY
.
getCode
());
String
fileName
=
inInfo
.
getString
(
"fileName"
);
params
.
put
(
HGSJ003
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
Map
<
String
,
Object
>
map
=
HGSJTools
.
Hgsj003
.
getCompany
(
UserSession
.
getLoginName
(),
OrgTypeEnum
.
COMPANY
.
getCode
());
params
.
put
(
HGSJ003
.
FIELD_FACTORY_CODE
,
map
.
get
(
"orgEname"
));
params
.
put
(
HGSJ003
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
params
.
put
(
HGSJ003
.
FIELD_FACTORY_NAME
,
map
.
get
(
"orgCname"
));
params
.
put
(
HGSJ003
.
FIELD_FACTORY_CODE
,
map
.
get
(
"orgEname"
));
//解析文件,将文件中数据传入到inInfo中
params
.
put
(
HGSJ003
.
FIELD_FACTORY_NAME
,
map
.
get
(
"orgCname"
));
return
ExcelUtils
.
importFromExcel
(
inInfo
,
fileName
,
params
,
new
HGSJ003
());
//解析文件,将文件中数据传入到inInfo中
ExcelUtils
.
importFromExcel
(
inInfo
,
fileName
,
params
,
new
HGSJ003
());
}
catch
(
Exception
e
){
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"导入失败"
);
}
return
inInfo
;
}
}
@OperationLogAnnotation
(
operModul
=
"工艺单价"
,
operType
=
"下载模板"
,
operDesc
=
"下载模板"
)
@OperationLogAnnotation
(
operModul
=
"工艺单价"
,
operType
=
"下载模板"
,
operDesc
=
"下载模板"
)
...
@@ -194,7 +200,7 @@ public class ServiceHGSJ003 extends ServiceEPBase {
...
@@ -194,7 +200,7 @@ public class ServiceHGSJ003 extends ServiceEPBase {
param
.
put
(
"loginName"
,
UserSession
.
getLoginName
());
param
.
put
(
"loginName"
,
UserSession
.
getLoginName
());
param
.
put
(
HGSJ003
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
param
.
put
(
HGSJ003
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
List
list
=
new
ArrayList
<>(
Arrays
.
asList
(
HGSJ003
.
FIELD_PROCESS_CODE
,
HGSJ003
.
FIELD_PROCESS_NAME
,
HGSJ003
.
FIELD_PROCESS_CLASS
,
List
list
=
new
ArrayList
<>(
Arrays
.
asList
(
HGSJ003
.
FIELD_PROCESS_CODE
,
HGSJ003
.
FIELD_PROCESS_NAME
,
HGSJ003
.
FIELD_PROCESS_CLASS
_NAME
,
HGSJ003
.
FIELD_UNIT
,
HGSJ003
.
FIELD_LENGTH
,
HGSJ003
.
FIELD_WIDTH
,
HGSJ003
.
FIELD_THICK
));
HGSJ003
.
FIELD_UNIT
,
HGSJ003
.
FIELD_LENGTH
,
HGSJ003
.
FIELD_WIDTH
,
HGSJ003
.
FIELD_THICK
));
return
ExcelUtils
.
exportToExcel
(
ACConstants
.
SQL_COUNT
,
ACConstants
.
SQL_TEMPLATE
,
param
,
list
,
new
HGSJ003
());
return
ExcelUtils
.
exportToExcel
(
ACConstants
.
SQL_COUNT
,
ACConstants
.
SQL_TEMPLATE
,
param
,
list
,
new
HGSJ003
());
...
...
src/main/java/com/baosight/hggp/util/ExcelUtils.java
View file @
c73ae9be
...
@@ -172,16 +172,16 @@ public class ExcelUtils {
...
@@ -172,16 +172,16 @@ public class ExcelUtils {
String
className
=
insertSql
.
substring
(
0
,
7
);
String
className
=
insertSql
.
substring
(
0
,
7
);
List
<
Map
>
arrayList
=
inInfo
.
getBlock
(
SQL_OK_BLOCK
).
getRows
();
List
<
Map
>
arrayList
=
inInfo
.
getBlock
(
SQL_OK_BLOCK
).
getRows
();
// 数据校验
// 数据校验
switch
(
className
)
{
switch
(
className
)
{
/**
/**
* 物料
* 物料
*/
*/
case
"HPSC002"
:
case
"HPSC002"
:
materialCheck
(
inInfo
);
materialCheck
(
inInfo
);
if
(!
inInfo
.
getString
(
"checkStatus"
).
equals
(
"true"
))
{
if
(!
inInfo
.
getString
(
"checkStatus"
).
equals
(
"true"
))
{
// HPSC002 HPSC002 = new HPSC002();
// HPSC002 HPSC002 = new HPSC002();
EiBlock
okBlock
=
inInfo
.
getBlock
(
CHECK_OK_BLOCK
);
EiBlock
okBlock
=
inInfo
.
getBlock
(
CHECK_OK_BLOCK
);
// for (int i = 0; i < okBlock.getRowCount(); i++) {
// for (int i = 0; i < okBlock.getRowCount(); i++) {
// Map<?, ?> map = okBlock.getRow(i);
// Map<?, ?> map = okBlock.getRow(i);
// HPSC002.fromMap(map);
// HPSC002.fromMap(map);
...
@@ -192,53 +192,54 @@ public class ExcelUtils {
...
@@ -192,53 +192,54 @@ public class ExcelUtils {
// if (!HPSC002.getParentId().equals("root")) {
// if (!HPSC002.getParentId().equals("root")) {
// checkTreeNodeLeaf(HPSC002.getParentId());
// checkTreeNodeLeaf(HPSC002.getParentId());
// }
// }
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"导入成功"
+
okBlock
.
getRowCount
()+
"条"
);
inInfo
.
setMsg
(
"导入成功"
+
okBlock
.
getRowCount
()
+
"条"
);
}
else
{
}
else
{
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
}
}
break
;
break
;
/**
/**
* 下料
* 下料
*/
*/
case
"HPSC006"
:
case
"HPSC006"
:
materialCheck2
(
inInfo
);
materialCheck2
(
inInfo
);
if
(!
inInfo
.
getString
(
"checkStatus"
).
equals
(
"true"
))
{
if
(!
inInfo
.
getString
(
"checkStatus"
).
equals
(
"true"
))
{
// HPSC006 HPSC006 = new HPSC006();
// HPSC006 HPSC006 = new HPSC006();
EiBlock
okBlock
=
inInfo
.
getBlock
(
CHECK_OK_BLOCK
);
EiBlock
okBlock
=
inInfo
.
getBlock
(
CHECK_OK_BLOCK
);
for
(
int
i
=
0
;
i
<
okBlock
.
getRowCount
();
i
++)
{
for
(
int
i
=
0
;
i
<
okBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
okBlock
.
getRow
(
i
);
Map
<?,
?>
map
=
okBlock
.
getRow
(
i
);
// HPSC006.fromMap(map);
// HPSC006.fromMap(map);
// DaoUtils.insert("HPSC006.insert",HPSC006);
// DaoUtils.insert("HPSC006.insert",HPSC006);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"导入成功"
+
okBlock
.
getRowCount
()
+
"条"
);
}
else
{
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
}
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
break
;
inInfo
.
setMsg
(
"导入成功"
+
okBlock
.
getRowCount
()+
"条"
);
case
"HGSJ003"
:
}
else
{
HGSJ003
hgsj003
=
new
HGSJ003
();
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
Map
<
String
,
String
>
mapSmall
=
HGSJTools
.
Hgsj003
.
getSmallCode
(
"hggp.hgsj.processClass"
);
}
for
(
Map
<?,
?>
map
:
arrayList
)
{
break
;
String
processClass
=
MapUtils
.
getString
(
mapSmall
,
map
.
get
(
HGSJ003
.
FIELD_PROCESS_CLASS_NAME
));
case
"HGSJ003"
:
AssertUtils
.
isEmpty
(
processClass
,
String
.
format
(
"工序分类[%s]代码不存在,添加失败!"
,
map
.
get
(
HGSJ003
.
FIELD_PROCESS_CLASS_NAME
)));
HGSJ003
hgsj003
=
new
HGSJ003
();
hgsj003
.
fromMap
(
map
);
Map
<
String
,
String
>
mapSmall
=
HGSJTools
.
Hgsj003
.
getSmallCode
(
"hggp.hgsj.processClass"
);
// 设置规格
for
(
Map
<?,
?>
map
:
arrayList
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
hgsj003
.
getSpec
()))
{
String
processClass
=
MapUtils
.
getString
(
mapSmall
,
map
.
get
(
HGSJ003
.
FIELD_PROCESS_CLASS_NAME
));
hgsj003
.
setSpec
(
HGSJTools
.
Hgsj003
.
jointSpec
(
hgsj003
.
getLength
(),
hgsj003
.
getWidth
(),
hgsj003
.
getThick
()));
AssertUtils
.
isEmpty
(
processClass
,
String
.
format
(
"工序分类[%s]代码不存在,添加失败!"
,
map
.
get
(
HGSJ003
.
FIELD_PROCESS_CLASS_NAME
)));
}
hgsj003
.
fromMap
(
map
);
// 去除空格
// 设置规格
hgsj003
.
setSpec
(
StringUtils
.
trimToEmpty
(
hgsj003
.
getSpec
()));
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
hgsj003
.
getSpec
()))
{
hgsj003
.
setProcessClass
(
Integer
.
valueOf
(
processClass
));
hgsj003
.
setSpec
(
HGSJTools
.
Hgsj003
.
jointSpec
(
hgsj003
.
getLength
(),
hgsj003
.
getWidth
(),
hgsj003
.
getThick
()));
//校验
checkAddData
(
hgsj003
);
DaoUtils
.
insert
(
HGSJ003
.
INSERT
,
hgsj003
);
}
}
// 去除空格
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
hgsj003
.
setSpec
(
StringUtils
.
trimToEmpty
(
hgsj003
.
getSpec
()));
inInfo
.
setMsg
(
"导入成功"
+
arrayList
.
size
()
+
"条"
);
hgsj003
.
setProcessClass
(
Integer
.
valueOf
(
processClass
));
break
;
//校验
default
:
checkAddData
(
hgsj003
);
}
DaoUtils
.
insert
(
HGSJ003
.
INSERT
,
hgsj003
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"导入成功"
+
arrayList
.
size
()+
"条"
);
default
:
}
return
inInfo
;
return
inInfo
;
}
}
...
...
src/main/webapp/HG/SJ/HGSJ003.js
View file @
c73ae9be
...
@@ -161,7 +161,7 @@ $(function (){
...
@@ -161,7 +161,7 @@ $(function (){
NotificationUtil
(
"请导入xls或xlsx文件"
,
"error"
);
NotificationUtil
(
"请导入xls或xlsx文件"
,
"error"
);
return
;
return
;
}
}
if
(
ei
.
status
==
=
"-1"
)
{
if
(
ei
.
status
==
"-1"
)
{
NotificationUtil
(
NotificationUtil
(
{
msg
:
ei
.
msg
,
detailMsg
:
ei
.
detailMsg
},
"error"
);
{
msg
:
ei
.
msg
,
detailMsg
:
ei
.
detailMsg
},
"error"
);
}
else
{
}
else
{
...
...
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