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
9fe1ab9f
Commit
9fe1ab9f
authored
Jan 25, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.物料清单多附件管理
parent
55d67351
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
814 additions
and
74 deletions
+814
-74
ServiceHPKC001.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC001.java
+37
-40
ServiceHPKC002.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002.java
+5
-7
ServiceHPKC009.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC009.java
+20
-10
HPKC006.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC006.xml
+2
-1
HPKC007.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC007.xml
+3
-2
HPPZTools.java
src/main/java/com/baosight/hpjx/hp/pz/tools/HPPZTools.java
+1
-1
HPSC002A.java
src/main/java/com/baosight/hpjx/hp/sc/domain/HPSC002A.java
+370
-0
ServiceHPSC002.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
+1
-2
ServiceHPSC002A.java
...java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002A.java
+115
-0
HPSC002A.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC002A.xml
+113
-0
LogUtils.java
src/main/java/com/baosight/hpjx/util/LogUtils.java
+3
-3
HPSC002.js
src/main/webapp/HP/SC/HPSC002.js
+18
-8
HPSC002A.js
src/main/webapp/HP/SC/HPSC002A.js
+91
-0
HPSC002A.jsp
src/main/webapp/HP/SC/HPSC002A.jsp
+35
-0
No files found.
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC001.java
View file @
9fe1ab9f
...
@@ -77,11 +77,9 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -77,11 +77,9 @@ public class ServiceHPKC001 extends ServiceBase {
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
insertEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
insertEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
//存货类型
//存货类型
insertEntity
.
set
MaterialTypeName
(
InventTypeEnun
.
getNameByCode
(
insertEntity
.
getMaterial
Type
()));
insertEntity
.
set
InventName
(
InventTypeEnun
.
getNameByCode
(
insertEntity
.
getInvent
Type
()));
// 生成单据号
// 生成单据号
insertEntity
.
setDocumentCode
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC001_NUMBER
));
insertEntity
.
setReceiptDate
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC001_NUMBER
));
insertEntity
.
setStatus
(
1
);
insertEntity
.
setApprovalStatus
(
ApprovalStatusEnum
.
SAVED
.
getCode
());
dao
.
insert
(
"HPKC001.insert"
,
insertEntity
);
dao
.
insert
(
"HPKC001.insert"
,
insertEntity
);
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
=
this
.
query
(
inInfo
);
...
@@ -108,8 +106,8 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -108,8 +106,8 @@ public class ServiceHPKC001 extends ServiceBase {
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPKC001
entity
=
new
HPKC001
();
HPKC001
entity
=
new
HPKC001
();
entity
.
fromMap
(
resultRows
.
get
(
i
));
entity
.
fromMap
(
resultRows
.
get
(
i
));
AssertUtils
.
isEmpty
(
entity
.
get
Material
Type
(),
"存货类型不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
get
Invent
Type
(),
"存货类型不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
get
Material
Code
(),
"物料不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
get
Invent
Code
(),
"物料不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
getWhCode
(),
"仓库不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
getWhCode
(),
"仓库不能为空"
);
}
}
...
@@ -125,12 +123,12 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -125,12 +123,12 @@ public class ServiceHPKC001 extends ServiceBase {
HPKC001
entity
=
new
HPKC001
();
HPKC001
entity
=
new
HPKC001
();
entity
.
fromMap
(
resultRows
.
get
(
i
));
entity
.
fromMap
(
resultRows
.
get
(
i
));
AssertUtils
.
isNull
(
entity
.
getId
(),
"请先保存再提交"
);
AssertUtils
.
isNull
(
entity
.
getId
(),
"请先保存再提交"
);
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
SUBMIT
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.SUBMIT.getCode()){
throw
new
PlatException
(
"单据已提交,不能重复提交"
);
//
throw new PlatException("单据已提交,不能重复提交");
}
//
}
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
APPROVED
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.APPROVED.getCode()){
throw
new
PlatException
(
"单据审批通过,不能再次提交"
);
//
throw new PlatException("单据审批通过,不能再次提交");
}
//
}
}
}
}
}
...
@@ -148,27 +146,27 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -148,27 +146,27 @@ public class ServiceHPKC001 extends ServiceBase {
AssertUtils
.
isNull
(
entity
.
getId
(),
"请先保存数据"
);
AssertUtils
.
isNull
(
entity
.
getId
(),
"请先保存数据"
);
//审批通过操作
//审批通过操作
if
(
approvalFlag
==
ApprovalStatusEnum
.
APPROVED
.
getCode
()){
if
(
approvalFlag
==
ApprovalStatusEnum
.
APPROVED
.
getCode
()){
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
SAVED
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.SAVED.getCode()){
throw
new
PlatException
(
"已保存的数据,请先提交"
);
//
throw new PlatException("已保存的数据,请先提交");
}
//
}
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
REJECTION
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.REJECTION.getCode()){
throw
new
PlatException
(
"审批拒绝的数据,请先提交"
);
//
throw new PlatException("审批拒绝的数据,请先提交");
}
//
}
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
APPROVED
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.APPROVED.getCode()){
throw
new
PlatException
(
"数据已经审批通过,不能重复审批"
);
//
throw new PlatException("数据已经审批通过,不能重复审批");
}
//
}
}
}
//审批拒绝操作
//审批拒绝操作
if
(
approvalFlag
==
ApprovalStatusEnum
.
REJECTION
.
getCode
()){
if
(
approvalFlag
==
ApprovalStatusEnum
.
REJECTION
.
getCode
()){
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
SAVED
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.SAVED.getCode()){
throw
new
PlatException
(
"已保存的数据,请先提交"
);
//
throw new PlatException("已保存的数据,请先提交");
}
//
}
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
REJECTION
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.REJECTION.getCode()){
throw
new
PlatException
(
"审批拒绝的数据,请先提交"
);
//
throw new PlatException("审批拒绝的数据,请先提交");
}
//
}
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
APPROVED
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.APPROVED.getCode()){
throw
new
PlatException
(
"数据已经审批通过,不能重复审批"
);
//
throw new PlatException("数据已经审批通过,不能重复审批");
}
//
}
}
}
}
}
}
}
...
@@ -194,7 +192,7 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -194,7 +192,7 @@ public class ServiceHPKC001 extends ServiceBase {
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
updateEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
updateEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
//存货类型
//存货类型
updateEntity
.
set
MaterialTypeName
(
InventTypeEnun
.
getNameByCode
(
updateEntity
.
getMaterial
Type
()));
updateEntity
.
set
InventName
(
InventTypeEnun
.
getNameByCode
(
updateEntity
.
getInvent
Type
()));
dao
.
insert
(
"HPKC001.update"
,
updateEntity
);
dao
.
insert
(
"HPKC001.update"
,
updateEntity
);
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
=
this
.
query
(
inInfo
);
...
@@ -225,7 +223,6 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -225,7 +223,6 @@ public class ServiceHPKC001 extends ServiceBase {
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
HPKC001
.
fromMap
(
map
);
HPKC001
.
fromMap
(
map
);
HPKC001
.
setApprovalStatus
(
ApprovalStatusEnum
.
SUBMIT
.
getCode
());
entityList
.
add
(
HPKC001
);
entityList
.
add
(
HPKC001
);
}
}
this
.
dao
.
updateBatch
(
"HPKC001.approvalStatusUpdate"
,
entityList
);
this
.
dao
.
updateBatch
(
"HPKC001.approvalStatusUpdate"
,
entityList
);
...
@@ -255,7 +252,7 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -255,7 +252,7 @@ public class ServiceHPKC001 extends ServiceBase {
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
HPKC001
.
fromMap
(
map
);
HPKC001
.
fromMap
(
map
);
HPKC001
.
setApprovalStatus
(
ApprovalStatusEnum
.
APPROVED
.
getCode
());
//
HPKC001.setApprovalStatus(ApprovalStatusEnum.APPROVED.getCode());
entityList
.
add
(
HPKC001
);
entityList
.
add
(
HPKC001
);
}
}
this
.
dao
.
updateBatch
(
"HPKC001.approvalStatusUpdate"
,
entityList
);
this
.
dao
.
updateBatch
(
"HPKC001.approvalStatusUpdate"
,
entityList
);
...
@@ -286,7 +283,7 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -286,7 +283,7 @@ public class ServiceHPKC001 extends ServiceBase {
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
HPKC001
.
fromMap
(
map
);
HPKC001
.
fromMap
(
map
);
HPKC001
.
setApprovalStatus
(
ApprovalStatusEnum
.
REJECTION
.
getCode
());
//
HPKC001.setApprovalStatus(ApprovalStatusEnum.REJECTION.getCode());
entityList
.
add
(
HPKC001
);
entityList
.
add
(
HPKC001
);
}
}
this
.
dao
.
updateBatch
(
"HPKC001.approvalStatusUpdate"
,
entityList
);
this
.
dao
.
updateBatch
(
"HPKC001.approvalStatusUpdate"
,
entityList
);
...
@@ -341,12 +338,12 @@ public class ServiceHPKC001 extends ServiceBase {
...
@@ -341,12 +338,12 @@ public class ServiceHPKC001 extends ServiceBase {
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPKC001
entity
=
new
HPKC001
();
HPKC001
entity
=
new
HPKC001
();
entity
.
fromMap
(
resultRows
.
get
(
i
));
entity
.
fromMap
(
resultRows
.
get
(
i
));
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
SUBMIT
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.SUBMIT.getCode()){
throw
new
PlatException
(
"已提交采购入库单不能删除"
);
//
throw new PlatException("已提交采购入库单不能删除");
}
//
}
if
(
entity
.
getApprovalStatus
()
==
ApprovalStatusEnum
.
APPROVED
.
getCode
()){
//
if(entity.getApprovalStatus() == ApprovalStatusEnum.APPROVED.getCode()){
throw
new
PlatException
(
"已审批通过采购入库单不能删除"
);
//
throw new PlatException("已审批通过采购入库单不能删除");
}
//
}
}
}
}
}
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC002.java
View file @
9fe1ab9f
...
@@ -76,11 +76,9 @@ public class ServiceHPKC002 extends ServiceBase {
...
@@ -76,11 +76,9 @@ public class ServiceHPKC002 extends ServiceBase {
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
insertEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
insertEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
//存货类型
//存货类型
insertEntity
.
set
MaterialTypeName
(
InventTypeEnun
.
getNameByCode
(
insertEntity
.
getMaterial
Type
()));
insertEntity
.
set
InventName
(
InventTypeEnun
.
getNameByCode
(
insertEntity
.
getInvent
Type
()));
// 生成单据号
// 生成单据号
insertEntity
.
setDocumentCode
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC002_NUMBER
));
insertEntity
.
setReceiptDate
(
SequenceGenerator
.
getNextSequence
(
HPConstant
.
SequenceId
.
HPKC002_NUMBER
));
insertEntity
.
setStatus
(
1
);
insertEntity
.
setApprovalStatus
(
0
);
dao
.
insert
(
"HPKC002.insert"
,
insertEntity
);
dao
.
insert
(
"HPKC002.insert"
,
insertEntity
);
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
=
this
.
query
(
inInfo
);
...
@@ -107,8 +105,8 @@ public class ServiceHPKC002 extends ServiceBase {
...
@@ -107,8 +105,8 @@ public class ServiceHPKC002 extends ServiceBase {
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPKC002
entity
=
new
HPKC002
();
HPKC002
entity
=
new
HPKC002
();
entity
.
fromMap
(
resultRows
.
get
(
i
));
entity
.
fromMap
(
resultRows
.
get
(
i
));
AssertUtils
.
isEmpty
(
entity
.
get
Material
Type
(),
"存货类型不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
get
Invent
Type
(),
"存货类型不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
get
Material
Code
(),
"物料不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
get
Invent
Code
(),
"物料不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
getWhCode
(),
"仓库不能为空"
);
AssertUtils
.
isEmpty
(
entity
.
getWhCode
(),
"仓库不能为空"
);
}
}
...
@@ -135,7 +133,7 @@ public class ServiceHPKC002 extends ServiceBase {
...
@@ -135,7 +133,7 @@ public class ServiceHPKC002 extends ServiceBase {
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
List
query
=
dao
.
query
(
"HPPZ007.queryByWhCode"
,
params
);
updateEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
updateEntity
.
setWhName
(((
HPPZ007
)
query
.
get
(
0
)).
getWhName
());
//存货类型
//存货类型
updateEntity
.
set
MaterialTypeName
(
InventTypeEnun
.
getNameByCode
(
updateEntity
.
getMaterial
Type
()));
updateEntity
.
set
InventName
(
InventTypeEnun
.
getNameByCode
(
updateEntity
.
getInvent
Type
()));
dao
.
insert
(
"HPKC002.update"
,
updateEntity
);
dao
.
insert
(
"HPKC002.update"
,
updateEntity
);
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
=
this
.
query
(
inInfo
);
...
...
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC009.java
View file @
9fe1ab9f
...
@@ -26,6 +26,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
...
@@ -26,6 +26,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
...
@@ -119,8 +120,8 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -119,8 +120,8 @@ public class ServiceHPKC009 extends ServiceBase {
// 4、设置基础信息
// 4、设置基础信息
this
.
setBaseInfo
(
results
);
this
.
setBaseInfo
(
results
);
// 5、写入数据库
// 5、写入数据库
DaoUtils
.
insert
(
"HPKC009.insert"
,
results
);
dao
.
insertBatch
(
HPKC009
.
INSERT
,
results
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_
DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_
SUCCESS
);
inInfo
.
setMsg
(
"按天统计成功"
);
inInfo
.
setMsg
(
"按天统计成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"按天统计失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"按天统计失败"
);
...
@@ -160,8 +161,8 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -160,8 +161,8 @@ public class ServiceHPKC009 extends ServiceBase {
// 4、设置基础信息
// 4、设置基础信息
this
.
setBaseInfo
(
results
);
this
.
setBaseInfo
(
results
);
// 5、写入数据库
// 5、写入数据库
DaoUtils
.
insert
(
"HPKC009.insert"
,
results
);
dao
.
insertBatch
(
HPKC009
.
INSERT
,
results
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_
DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_
SUCCESS
);
inInfo
.
setMsg
(
"按月统计成功"
);
inInfo
.
setMsg
(
"按月统计成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"按月统计失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"按月统计失败"
);
...
@@ -322,23 +323,27 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -322,23 +323,27 @@ public class ServiceHPKC009 extends ServiceBase {
List
<
HPKC006
>
bItems
=
dao
.
query
(
HPSqlConstant
.
HPKC006
.
STAT_DATE
,
queryMap
);
List
<
HPKC006
>
bItems
=
dao
.
query
(
HPSqlConstant
.
HPKC006
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC006
>
bItemMap
=
bItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
Map
<
String
,
HPKC006
>
bItemMap
=
bItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
(),
item
->
item
));
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 1.3、发出
// 1.3、发出
List
<
HPKC007
>
cItems
=
dao
.
query
(
HPSqlConstant
.
HPKC007
.
STAT_DATE
,
queryMap
);
List
<
HPKC007
>
cItems
=
dao
.
query
(
HPSqlConstant
.
HPKC007
.
STAT_DATE
,
queryMap
);
Map
<
String
,
HPKC007
>
cItemMap
=
cItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
Map
<
String
,
HPKC007
>
cItemMap
=
cItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
(),
item
->
item
));
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 1.4、期初库存
// 1.4、期初库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDate"
));
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDate"
));
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
QT
);
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
QT
);
List
<
HPKC009
>
dItems
=
dao
.
query
(
HPKC009
.
QUERY
,
new
HashMap
<>());
List
<
HPKC009
>
dItems
=
dao
.
query
(
HPKC009
.
QUERY
,
new
HashMap
<>());
Map
<
String
,
HPKC009
>
dItemMap
=
dItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
Map
<
String
,
HPKC009
>
dItemMap
=
dItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
(),
item
->
item
));
+
item
.
getInventType
()
+
"#"
+
item
.
getInventCode
()
+
"#"
+
item
.
getInventRecordId
(),
item
->
item
));
// 根据期末库存生成收发存对象
// 根据期末库存生成收发存对象
for
(
HPKC006
aItem
:
aItems
)
{
for
(
HPKC006
aItem
:
aItems
)
{
String
key
=
aItem
.
getCompanyCode
()
+
"#"
+
aItem
.
getDepCode
()
+
"#"
String
key
=
aItem
.
getCompanyCode
()
+
"#"
+
aItem
.
getDepCode
()
+
"#"
+
aItem
.
getWhCode
()
+
"#"
+
aItem
.
getInventType
()
+
"#"
+
aItem
.
getInventCode
();
+
aItem
.
getWhCode
()
+
"#"
+
aItem
.
getInventType
()
+
"#"
+
aItem
.
getInventCode
()
+
"#"
+
aItem
.
getInventRecordId
();
HPKC009
kc009
=
BeanUtils
.
copy
(
aItem
,
HPKC009
.
class
);
HPKC009
kc009
=
BeanUtils
.
copy
(
aItem
,
HPKC009
.
class
);
kc009
.
setInventType
(
aItem
.
getInventType
());
kc009
.
setInventType
(
aItem
.
getInventType
());
kc009
.
setInventCode
(
aItem
.
getInventCode
());
kc009
.
setInventCode
(
aItem
.
getInventCode
());
...
@@ -385,13 +390,18 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -385,13 +390,18 @@ public class ServiceHPKC009 extends ServiceBase {
List
<
String
>
inventCodes
=
kc009s
.
stream
().
map
(
HPKC009:
:
getInventCode
).
collect
(
Collectors
.
toList
());
List
<
String
>
inventCodes
=
kc009s
.
stream
().
map
(
HPKC009:
:
getInventCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
HPPZ004
>
mapPz004
=
HPPZTools
.
mapPz004
(
inventCodes
);
Map
<
String
,
HPPZ004
>
mapPz004
=
HPPZTools
.
mapPz004
(
inventCodes
);
for
(
HPKC009
kc009
:
kc009s
)
{
for
(
HPKC009
kc009
:
kc009s
)
{
String
whCode
=
kc009
.
getWhCode
();
// 仓库名称
// 仓库名称
String
whCode
=
kc009
.
getWhCode
();
HPPZ007
pz007
=
mapPz007
==
null
?
null
:
mapPz007
.
get
(
whCode
);
HPPZ007
pz007
=
mapPz007
==
null
?
null
:
mapPz007
.
get
(
whCode
);
kc009
.
setWhName
(
pz007
==
null
?
""
:
pz007
.
getWhName
());
kc009
.
setWhName
(
pz007
==
null
?
""
:
pz007
.
getWhName
());
// 存货名称
// 存货名称
HPPZ004
pz004
=
mapPz004
==
null
?
null
:
mapPz004
.
get
(
whCode
);
String
inventCode
=
kc009
.
getInventCode
();
HPPZ004
pz004
=
mapPz004
==
null
?
null
:
mapPz004
.
get
(
inventCode
);
kc009
.
setInventName
(
pz004
==
null
?
""
:
pz004
.
getInventName
());
kc009
.
setInventName
(
pz004
==
null
?
""
:
pz004
.
getInventName
());
// 创建时间
kc009
.
setCreatedBy
(
UserSession
.
getLoginName
());
kc009
.
setCreatedName
(
UserSession
.
getLoginCName
());
kc009
.
setCreatedTime
(
DateUtils
.
shortDateTime
());
}
}
}
}
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC006.xml
View file @
9fe1ab9f
...
@@ -191,6 +191,7 @@
...
@@ -191,6 +191,7 @@
WH_CODE AS "whCode",
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
INVENT_CODE AS "inventCode",
INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC006
FROM ${hpjxSchema}.T_HPKC006
...
@@ -198,7 +199,7 @@
...
@@ -198,7 +199,7 @@
<isNotEmpty
prepend=
" AND "
property=
"createdTimeFrom"
>
<isNotEmpty
prepend=
" AND "
property=
"createdTimeFrom"
>
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE
, INVENT_RECORD_ID
</select>
</select>
</sqlMap>
</sqlMap>
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC007.xml
View file @
9fe1ab9f
...
@@ -185,14 +185,15 @@
...
@@ -185,14 +185,15 @@
WH_CODE AS "whCode",
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
INVENT_CODE AS "inventCode",
INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC00
4
FROM ${hpjxSchema}.T_HPKC00
7
WHERE 1=1
WHERE 1=1
<isNotEmpty
prepend=
" AND "
property=
"createdTimeFrom"
>
<isNotEmpty
prepend=
" AND "
property=
"createdTimeFrom"
>
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE
, INVENT_RECORD_ID
</select>
</select>
</sqlMap>
</sqlMap>
src/main/java/com/baosight/hpjx/hp/pz/tools/HPPZTools.java
View file @
9fe1ab9f
...
@@ -61,7 +61,7 @@ public class HPPZTools {
...
@@ -61,7 +61,7 @@ public class HPPZTools {
}
}
Map
queryMap
=
new
HashMap
();
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"inventCodes"
,
inventCodes
);
queryMap
.
put
(
"inventCodes"
,
inventCodes
);
return
DaoBase
.
getInstance
().
query
(
"HPPZ004.query"
,
queryMap
);
return
DaoBase
.
getInstance
().
query
(
HPPZ004
.
QUERY
,
queryMap
);
}
}
/**
/**
...
...
src/main/java/com/baosight/hpjx/hp/sc/domain/HPSC002A.java
0 → 100644
View file @
9fe1ab9f
package
com
.
baosight
.
hpjx
.
hp
.
sc
.
domain
;
import
com.baosight.iplat4j.core.util.NumberUtils
;
import
com.baosight.iplat4j.core.ei.EiColumn
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.baosight.iplat4j.core.util.StringUtils
;
/**
* Project: <br>
* Title:THpsc002a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-01-25 16:47:50 create
*/
public
class
HPSC002A
extends
DaoEPBase
{
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
String
FIELD_ID
=
"id"
;
/* 主键ID*/
public
static
final
String
FIELD_COMPANY_CODE
=
"companyCode"
;
/* 企业编码 预留*/
public
static
final
String
FIELD_DEPT_CODE
=
"deptCode"
;
/* 部门编码 预留*/
public
static
final
String
FIELD_MAT_ID
=
"matId"
;
/* 物料ID*/
public
static
final
String
FIELD_DOC_ID
=
"docId"
;
/* 文件ID*/
public
static
final
String
FIELD_DOC_NAME
=
"docName"
;
/* 文件名称*/
public
static
final
String
FIELD_CREATED_BY
=
"createdBy"
;
/* 创建人*/
public
static
final
String
FIELD_CREATED_NAME
=
"createdName"
;
/* 创建人名称*/
public
static
final
String
FIELD_CREATED_TIME
=
"createdTime"
;
/* 创建时间*/
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
COL_ID
=
"ID"
;
/* 主键ID*/
public
static
final
String
COL_COMPANY_CODE
=
"COMPANY_CODE"
;
/* 企业编码 预留*/
public
static
final
String
COL_DEPT_CODE
=
"DEPT_CODE"
;
/* 部门编码 预留*/
public
static
final
String
COL_MAT_ID
=
"MAT_ID"
;
/* 物料ID*/
public
static
final
String
COL_DOC_ID
=
"DOC_ID"
;
/* 文件ID*/
public
static
final
String
COL_DOC_NAME
=
"DOC_NAME"
;
/* 文件文件*/
public
static
final
String
COL_CREATED_BY
=
"CREATED_BY"
;
/* 创建人*/
public
static
final
String
COL_CREATED_NAME
=
"CREATED_NAME"
;
/* 创建人名称*/
public
static
final
String
COL_CREATED_TIME
=
"CREATED_TIME"
;
/* 创建时间*/
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
QUERY
=
"HPSC002A.query"
;
public
static
final
String
COUNT
=
"HPSC002A.count"
;
public
static
final
String
INSERT
=
"HPSC002A.insert"
;
public
static
final
String
UPDATE
=
"HPSC002A.update"
;
public
static
final
String
DELETE
=
"HPSC002A.delete"
;
private
Long
id
=
null
;
/* 主键ID*/
private
String
companyCode
=
" "
;
/* 企业编码 预留*/
private
String
deptCode
=
" "
;
/* 部门编码 预留*/
private
Long
matId
=
null
;
/* 物料ID*/
private
String
docId
=
" "
;
/* 文件ID*/
private
String
docName
=
" "
;
/* 文件名称*/
private
String
createdBy
=
" "
;
/* 创建人*/
private
String
createdName
=
" "
;
/* 创建人名称*/
private
String
createdTime
=
" "
;
/* 创建时间*/
private
String
updatedBy
=
" "
;
/* 修改人*/
private
String
updatedName
=
" "
;
/* 修改人名称*/
private
String
updatedTime
=
" "
;
/* 修改时间*/
/**
* initialize the metadata.
*/
public
void
initMetaData
()
{
EiColumn
eiColumn
;
eiColumn
=
new
EiColumn
(
FIELD_ID
);
eiColumn
.
setPrimaryKey
(
true
);
eiColumn
.
setDescName
(
"主键ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_COMPANY_CODE
);
eiColumn
.
setDescName
(
"企业编码 预留"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DEPT_CODE
);
eiColumn
.
setDescName
(
"部门编码 预留"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_MAT_ID
);
eiColumn
.
setDescName
(
"物料ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DOC_ID
);
eiColumn
.
setDescName
(
"文件ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DOC_NAME
);
eiColumn
.
setDescName
(
"文件名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CREATED_BY
);
eiColumn
.
setDescName
(
"创建人"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CREATED_NAME
);
eiColumn
.
setDescName
(
"创建人名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_CREATED_TIME
);
eiColumn
.
setDescName
(
"创建时间"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_UPDATED_BY
);
eiColumn
.
setDescName
(
"修改人"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_UPDATED_NAME
);
eiColumn
.
setDescName
(
"修改人名称"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_UPDATED_TIME
);
eiColumn
.
setDescName
(
"修改时间"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
/**
* the constructor.
*/
public
HPSC002A
()
{
initMetaData
();
}
/**
* get the id - 主键ID.
* @return the id
*/
public
Long
getId
()
{
return
this
.
id
;
}
/**
* set the id - 主键ID.
*
* @param id - 主键ID
*/
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
/**
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public
String
getCompanyCode
()
{
return
this
.
companyCode
;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public
void
setCompanyCode
(
String
companyCode
)
{
this
.
companyCode
=
companyCode
;
}
/**
* get the deptCode - 部门编码 预留.
* @return the deptCode
*/
public
String
getDeptCode
()
{
return
this
.
deptCode
;
}
/**
* set the deptCode - 部门编码 预留.
*
* @param deptCode - 部门编码 预留
*/
public
void
setDeptCode
(
String
deptCode
)
{
this
.
deptCode
=
deptCode
;
}
/**
* get the matId - 物料ID.
* @return the matId
*/
public
Long
getMatId
()
{
return
this
.
matId
;
}
/**
* set the matId - 物料ID.
*
* @param matId - 物料ID
*/
public
void
setMatId
(
Long
matId
)
{
this
.
matId
=
matId
;
}
/**
* get the docId - 文件ID.
* @return the docId
*/
public
String
getDocId
()
{
return
this
.
docId
;
}
/**
* set the docId - 文件ID.
*
* @param docId - 文件ID
*/
public
void
setDocId
(
String
docId
)
{
this
.
docId
=
docId
;
}
/**
* get the docName - 文件名称.
* @return the docName
*/
public
String
getDocName
()
{
return
this
.
getDocName
();
}
/**
* set the docName - 文件名称.
*
* @param docName - 文件名称
*/
public
void
setDocName
(
String
docName
)
{
this
.
docName
=
docName
;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public
String
getCreatedBy
()
{
return
this
.
createdBy
;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public
void
setCreatedBy
(
String
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public
String
getCreatedName
()
{
return
this
.
createdName
;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public
void
setCreatedName
(
String
createdName
)
{
this
.
createdName
=
createdName
;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public
String
getCreatedTime
()
{
return
this
.
createdTime
;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public
void
setCreatedTime
(
String
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
/**
* get the updatedBy - 修改人.
* @return the updatedBy
*/
public
String
getUpdatedBy
()
{
return
this
.
updatedBy
;
}
/**
* set the updatedBy - 修改人.
*
* @param updatedBy - 修改人
*/
public
void
setUpdatedBy
(
String
updatedBy
)
{
this
.
updatedBy
=
updatedBy
;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public
String
getUpdatedName
()
{
return
this
.
updatedName
;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public
void
setUpdatedName
(
String
updatedName
)
{
this
.
updatedName
=
updatedName
;
}
/**
* get the updatedTime - 修改时间.
* @return the updatedTime
*/
public
String
getUpdatedTime
()
{
return
this
.
updatedTime
;
}
/**
* set the updatedTime - 修改时间.
*
* @param updatedTime - 修改时间
*/
public
void
setUpdatedTime
(
String
updatedTime
)
{
this
.
updatedTime
=
updatedTime
;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public
void
fromMap
(
Map
map
)
{
setId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_ID
)),
id
));
setCompanyCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_COMPANY_CODE
)),
companyCode
));
setDeptCode
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DEPT_CODE
)),
deptCode
));
setMatId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
FIELD_MAT_ID
)),
matId
));
setDocId
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DOC_ID
)),
docId
));
setDocName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DOC_NAME
)),
docName
));
setCreatedBy
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_BY
)),
createdBy
));
setCreatedName
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_NAME
)),
createdName
));
setCreatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_CREATED_TIME
)),
createdTime
));
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
));
}
/**
* set the value to Map.
*/
@Override
public
Map
toMap
()
{
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_DEPT_CODE
,
StringUtils
.
toString
(
deptCode
,
eiMetadata
.
getMeta
(
FIELD_DEPT_CODE
)));
map
.
put
(
FIELD_MAT_ID
,
StringUtils
.
toString
(
matId
,
eiMetadata
.
getMeta
(
FIELD_MAT_ID
)));
map
.
put
(
FIELD_DOC_ID
,
StringUtils
.
toString
(
docId
,
eiMetadata
.
getMeta
(
FIELD_DOC_ID
)));
map
.
put
(
FIELD_DOC_NAME
,
StringUtils
.
toString
(
docName
,
eiMetadata
.
getMeta
(
FIELD_DOC_NAME
)));
map
.
put
(
FIELD_CREATED_BY
,
StringUtils
.
toString
(
createdBy
,
eiMetadata
.
getMeta
(
FIELD_CREATED_BY
)));
map
.
put
(
FIELD_CREATED_NAME
,
StringUtils
.
toString
(
createdName
,
eiMetadata
.
getMeta
(
FIELD_CREATED_NAME
)));
map
.
put
(
FIELD_CREATED_TIME
,
StringUtils
.
toString
(
createdTime
,
eiMetadata
.
getMeta
(
FIELD_CREATED_TIME
)));
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
)));
return
map
;
}
}
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
View file @
9fe1ab9f
...
@@ -253,9 +253,8 @@ public class ServiceHPSC002 extends ServiceBase {
...
@@ -253,9 +253,8 @@ public class ServiceHPSC002 extends ServiceBase {
return
eiInfo
;
return
eiInfo
;
}
}
/**
/**
*
审核 反审.
*
绑定附件
*/
*/
public
EiInfo
bindDocIdById
(
EiInfo
eiInfo
)
{
public
EiInfo
bindDocIdById
(
EiInfo
eiInfo
)
{
THPSC002
hppz002
=
new
THPSC002
();
THPSC002
hppz002
=
new
THPSC002
();
...
...
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002A.java
0 → 100644
View file @
9fe1ab9f
package
com
.
baosight
.
hpjx
.
hp
.
sc
.
service
;
import
com.baosight.hpjx.core.constant.CommonConstant
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.hp.constant.HPConstant
;
import
com.baosight.hpjx.hp.kc.domain.HPKC002
;
import
com.baosight.hpjx.hp.kc.domain.HPKC005
;
import
com.baosight.hpjx.hp.kc.tools.HPKCTools
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002A
;
import
com.baosight.hpjx.hp.sc.domain.THPSC002
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.ObjectUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public
class
ServiceHPSC002A
extends
ServiceEPBase
{
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
// 查询物料ID所对应的项目名称和产品名称
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
List
<
THPSC002
>
dbSc002s
=
dao
.
query
(
"HPSC002.query"
,
queryMap
);
THPSC002
dbSc002
=
dbSc002s
.
get
(
0
);
inInfo
.
set
(
"inqu_status-0-matId"
,
queryMap
.
get
(
"id"
));
inInfo
.
set
(
"inqu_status-0-projName"
,
dbSc002
.
getProjName
());
inInfo
.
set
(
"inqu_status-0-prdtName"
,
dbSc002
.
getPrdtName
());
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HPSC002A
().
eiMetadata
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
}
return
inInfo
;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
inInfo
=
super
.
query
(
inInfo
,
HPSC002A
.
QUERY
,
new
HPSC002A
());
}
catch
(
Throwable
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@Override
public
EiInfo
insert
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPSC002A
fSc002A
=
new
HPSC002A
();
fSc002A
.
fromMap
(
resultRows
.
get
(
i
));
DaoUtils
.
insert
(
HPSC002A
.
INSERT
,
fSc002A
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据新增成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"新增失败"
);
}
return
inInfo
;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
for
(
int
i
=
0
;
i
<
resultRows
.
size
();
i
++)
{
HPSC002A
fSc002A
=
new
HPSC002A
();
fSc002A
.
fromMap
(
resultRows
.
get
(
i
));
DaoUtils
.
update
(
HPSC002A
.
DELETE
,
fSc002A
);
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"删除失败"
);
}
return
inInfo
;
}
}
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC002A.xml
0 → 100644
View file @
9fe1ab9f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap
namespace=
"HPSC002A"
>
<sql
id=
"column"
>
A.ID as "id",
A.COMPANY_CODE as "companyCode",
<!-- 企业编码 预留 -->
A.DEPT_CODE as "deptCode",
<!-- 部门编码 预留 -->
A.MAT_ID as "matId",
<!-- 物料ID -->
A.DOC_ID as "docId",
<!-- 文件ID -->
B.DOC_NAME as "docName",
<!-- 文件名称 -->
A.CREATED_BY as "createdBy",
<!-- 创建人 -->
A.CREATED_NAME as "createdName",
<!-- 创建人名称 -->
A.CREATED_TIME as "createdTime",
<!-- 创建时间 -->
A.UPDATED_BY as "updatedBy",
<!-- 修改人 -->
A.UPDATED_NAME as "updatedName",
<!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime"
<!-- 修改时间 -->
</sql>
<sql
id=
"condition"
>
<isNotEmpty
prepend=
" AND "
property=
"id"
>
A.ID = #id#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyCode"
>
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"deptCode"
>
A.DEPT_CODE = #deptCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"matId"
>
A.MAT_ID = #matId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"docId"
>
A.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdBy"
>
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdName"
>
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdTime"
>
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedBy"
>
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedName"
>
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"updatedTime"
>
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
</sql>
<sql
id=
"customCondition"
>
<isNotEmpty
prepend=
" AND "
property=
"createdDateFrom"
>
A.CREATED_TIME
>
= CONCAT(REPLACE(#depositDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"createdDateTo"
>
A.CREATED_TIME
<
= CONCAT(REPLACE(#depositDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql
id=
"order"
>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"order"
>
$orderBy$
</isNotEmpty>
<isEmpty
property=
"order"
>
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select
id=
"query"
resultClass=
"com.baosight.hpjx.hp.sc.domain.HPSC002A"
>
SELECT
<include
refid=
"column"
/>
FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B
WHERE 1=1
AND A.DOC_ID = B.DOC_ID
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
<include
refid=
"order"
/>
</select>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSC002A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"customCondition"
/>
</select>
<insert
id=
"insert"
>
INSERT INTO ${hpjxSchema}.T_HPSC002A (
COMPANY_CODE,
<!-- 企业编码 预留 -->
DEPT_CODE,
<!-- 部门编码 预留 -->
MAT_ID,
<!-- 物料ID -->
DOC_ID,
<!-- 文件ID -->
CREATED_BY,
<!-- 创建人 -->
CREATED_NAME,
<!-- 创建人名称 -->
CREATED_TIME
<!-- 创建时间 -->
) VALUES (
#companyCode#, #deptCode#, #matId#, #docId#, #createdBy#,
#createdName#, #createdTime#
)
</insert>
<delete
id=
"delete"
>
DELETE FROM ${hpjxSchema}.T_HPSC002A WHERE ID = #id#
</delete>
</sqlMap>
src/main/java/com/baosight/hpjx/util/LogUtils.java
View file @
9fe1ab9f
...
@@ -25,7 +25,7 @@ public class LogUtils {
...
@@ -25,7 +25,7 @@ public class LogUtils {
* @param title 标题
* @param title 标题
* @return
* @return
*/
*/
public
static
void
setDetailMsg
(
EiInfo
inInfo
,
Exception
e
,
String
title
)
{
public
static
void
setDetailMsg
(
EiInfo
inInfo
,
Throwable
e
,
String
title
)
{
title
=
StringUtils
.
isEmpty
(
title
)
?
"服务异常"
:
title
;
title
=
StringUtils
.
isEmpty
(
title
)
?
"服务异常"
:
title
;
// 打印日志
// 打印日志
print
(
e
,
title
);
print
(
e
,
title
);
...
@@ -58,7 +58,7 @@ public class LogUtils {
...
@@ -58,7 +58,7 @@ public class LogUtils {
* @param title 标题
* @param title 标题
* @return
* @return
*/
*/
public
static
void
setMsg
(
EiInfo
inInfo
,
Exception
e
,
String
title
)
{
public
static
void
setMsg
(
EiInfo
inInfo
,
Throwable
e
,
String
title
)
{
title
=
StringUtils
.
isEmpty
(
title
)
?
"服务异常"
:
title
;
title
=
StringUtils
.
isEmpty
(
title
)
?
"服务异常"
:
title
;
// 打印日志
// 打印日志
print
(
e
,
title
);
print
(
e
,
title
);
...
@@ -86,7 +86,7 @@ public class LogUtils {
...
@@ -86,7 +86,7 @@ public class LogUtils {
* @param e 异常堆栈
* @param e 异常堆栈
* @param title 标题
* @param title 标题
*/
*/
private
static
void
print
(
Exception
e
,
String
title
)
{
private
static
void
print
(
Throwable
e
,
String
title
)
{
if
(
e
!=
null
)
{
if
(
e
!=
null
)
{
logger
.
error
(
title
.
concat
(
":{}"
),
e
.
getMessage
(),
e
);
logger
.
error
(
title
.
concat
(
":{}"
),
e
.
getMessage
(),
e
);
}
}
...
...
src/main/webapp/HP/SC/HPSC002.js
View file @
9fe1ab9f
...
@@ -181,16 +181,12 @@ $(function () {
...
@@ -181,16 +181,12 @@ $(function () {
template
:
function
(
item
)
{
template
:
function
(
item
)
{
console
.
log
(
item
)
console
.
log
(
item
)
let
auditStatus
=
item
.
status
;
let
auditStatus
=
item
.
status
;
let
filePath1
=
item
.
filePath1
;
let
leaf
=
item
.
leaf
let
leaf
=
item
.
leaf
let
template
=
''
;
let
template
=
''
;
if
(
filePath1
===
' '
)
{
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
template
=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
// + 'onclick="openUploadFile(' + item.id + ',1)" >附件上传</a>';
'onclick="openUploadFile('
+
item
.
id
+
',1)" >附件上传</a>'
;
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
}
else
{
+
'onclick="showUploadFile('
+
item
.
id
+
')" >附件清单</a>'
;
template
=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'href="'
+
ctx
+
'/EU/DM/EUDM06.jsp?docId='
+
filePath1
+
'" >下载</a>'
;
}
if
(
leaf
===
'1'
)
{
if
(
leaf
===
'1'
)
{
if
(
auditStatus
==
0
)
{
if
(
auditStatus
==
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
...
@@ -239,6 +235,20 @@ function openUploadFile(id) {
...
@@ -239,6 +235,20 @@ function openUploadFile(id) {
rowId
=
id
;
rowId
=
id
;
}
}
/**
* 显示附件清单
*
* @param id
*/
function
showUploadFile
(
id
)
{
JSColorbox
.
open
({
href
:
"HPSC002A?methodName=initLoad&inqu_status-0-id="
+
id
,
title
:
"<div style='text-align: center;'>附件清单</div>"
,
width
:
"80%"
,
height
:
"80%"
,
});
}
function
check
(
id
,
auditStatus
)
{
function
check
(
id
,
auditStatus
)
{
const
inEiInfo
=
new
EiInfo
();
const
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-id"
,
id
);
inEiInfo
.
set
(
"result-0-id"
,
id
);
...
...
src/main/webapp/HP/SC/HPSC002A.js
0 → 100644
View file @
9fe1ab9f
$
(
function
()
{
IPLATUI
.
EFGrid
=
{
"result"
:
{
columns
:
[{
field
:
"operator"
,
template
:
function
(
item
)
{
let
template
=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'href="'
+
IPLATUI
.
CONTEXT_PATH
+
'/EU/DM/EUDM06.jsp?docId='
+
item
.
filePath
+
'" >附件下载</a>'
;
return
template
;
}
}],
dataBound
:
function
()
{
}
}
};
// 关闭事件
IPLATUI
.
EFWindow
=
{
"uploadFile"
:
{
close
:
function
(
e
)
{
let
$iframe
=
uploadFileWindow
.
element
.
children
(
"iframe"
);
let
iframejQuery
=
$iframe
[
0
].
contentWindow
.
$
;
// 子窗口中的jQuery对象
let
uploadFile
=
iframejQuery
(
"#fileDocId"
).
val
();
let
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-matId"
,
$
(
"#inqu_status-0-matId"
).
val
());
inEiInfo
.
set
(
"result-0-docId"
,
uploadFile
);
EiCommunicator
.
send
(
'HPSC002A'
,
'insert'
,
inEiInfo
,
{
onSuccess
(
response
)
{
resultGrid
.
dataSource
.
page
(
1
);
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
}
},
{
async
:
false
});
}
}
};
$
(
"#ef_form_head"
).
hide
();
// 查询
$
(
"#QUERY"
).
on
(
"click"
,
query
);
// 附件上传
$
(
"#UPLOAD_FILE"
).
on
(
"click"
,
uploadFile
);
// 查询
$
(
"#BTN_DELETE"
).
on
(
"click"
,
deleteFunc
);
});
/**
* 页面加载时执行
*/
$
(
window
).
load
(
function
()
{
// 初始化查询
query
();
});
/**
* 查询
*/
var
query
=
function
(
e
)
{
resultGrid
.
dataSource
.
page
(
1
);
}
/**
* 文件上传
*
*/
function
uploadFile
()
{
uploadFileWindow
.
open
().
center
();
}
/**
* 删除
*/
function
deleteFunc
()
{
var
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
==
0
)
{
message
(
"请先勾选数据!"
);
return
;
}
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
删除
\"
操作?"
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HPSC002A"
,
"delete"
,
true
);
}
})
}
src/main/webapp/HP/SC/HPSC002A.jsp
0 → 100644
View file @
9fe1ab9f
<!DOCTYPE html>
<
%@
page
contentType=
"text/html; charset=UTF-8"
%
>
<
%@
taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%
>
<
%@
taglib
prefix=
"EF"
tagdir=
"/WEB-INF/tags/EF"
%
>
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<EF:EFPage
title=
"附件清单"
>
<EF:EFRegion
id=
"inqu"
title=
"查询区域"
type=
"query"
>
<EF:EFInput
cname=
"物料ID"
ename=
"matId"
blockId=
"inqu_status"
row=
"0"
type=
"hidden"
/>
<div
class=
"row"
>
<EF:EFInput
cname=
"项目名称"
ename=
"projName"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
readonly=
"true"
/>
<EF:EFInput
cname=
"产品名称"
ename=
"prdtName"
blockId=
"inqu_status"
row=
"0"
colWidth=
"3"
readonly=
"true"
/>
<EF:EFDateSpan
startCname=
"创建日期(从)"
endCname=
"至"
blockId=
"inqu_status"
startName=
"createdDateFrom"
endName=
"createdDateTo"
row=
"0"
role=
"date"
format=
"yyyy-MM-dd"
ratio=
"3:3"
satrtRatio=
"4:8"
endRatio=
"4:8"
readonly=
"true"
>
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"记录集"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"ID"
hidden=
"true"
/>
<EF:EFColumn
ename=
"docId"
cname=
"文件ID"
enable=
"false"
width=
"150"
/>
<EF:EFColumn
ename=
"docName"
cname=
"文件名称"
enable=
"false"
width=
"150"
/>
<EF:EFColumn
ename=
"createdTime"
cname=
"创建时间"
enable=
"false"
width=
"140"
align=
"center"
parseFormats=
"['yyyyMMddHHmmss']"
editType=
"datetime"
dateFormat=
"yyyy-MM-dd HH:mm:ss"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
enable=
"false"
width=
"200"
align=
"center"
/>
</EF:EFGrid>
</EF:EFRegion>
<
%
--
EEDM8010
页面加载时,不会加载
EEDM6000
(
lazyload=
"true"
)
--
%
>
<EF:EFWindow
id=
"uploadFile"
url=
"${ctx}/web/HPSC099"
lazyload=
"true"
refresh=
"true"
>
</EF:EFWindow>
</EF:EFPage>
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