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
abfcdd85
Commit
abfcdd85
authored
Jan 22, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.按月统计库存收发存
parent
23a9f843
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
99 additions
and
56 deletions
+99
-56
ServiceHPKC009.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC009.java
+79
-38
HPKC001.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC001.xml
+2
-2
HPKC002.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC002.xml
+2
-2
HPKC003.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC003.xml
+2
-2
HPKC004.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC004.xml
+2
-2
HPKC006.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC006.xml
+2
-2
HPKC007.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC007.xml
+2
-2
DateUtils.java
src/main/java/com/baosight/hpjx/util/DateUtils.java
+1
-0
HPKC009.jsp
src/main/webapp/HP/KC/HPKC009.jsp
+7
-6
No files found.
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC009.java
View file @
abfcdd85
...
@@ -16,27 +16,22 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ007;
...
@@ -16,27 +16,22 @@ import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import
com.baosight.hpjx.hp.pz.domain.HPPZ009
;
import
com.baosight.hpjx.hp.pz.domain.HPPZ009
;
import
com.baosight.hpjx.hp.pz.domain.THppz004
;
import
com.baosight.hpjx.hp.pz.domain.THppz004
;
import
com.baosight.hpjx.hp.pz.tools.HPPZTools
;
import
com.baosight.hpjx.hp.pz.tools.HPPZTools
;
import
com.baosight.hpjx.hp.xs.tools.HPXSUserTools
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.RsaUtils
;
import
com.baosight.hpjx.util.StringUtil
;
import
com.baosight.hpjx.util.StringUtil
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
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.service.soa.XLocalManager
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
com.baosight.xservices.xs.constants.LoginConstants
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.temporal.TemporalAdjusters
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -60,7 +55,7 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -60,7 +55,7 @@ public class ServiceHPKC009 extends ServiceBase {
*/
*/
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
try
{
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
WH_RECORD_BLOCK_ID
),
null
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
WH_RECORD_
QUERY_
BLOCK_ID
),
null
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_NAME_BLOCK_ID
),
null
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_NAME_BLOCK_ID
),
null
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HPKC009
().
eiMetadata
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HPKC009
().
eiMetadata
);
}
catch
(
PlatException
e
)
{
}
catch
(
PlatException
e
)
{
...
@@ -82,6 +77,7 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -82,6 +77,7 @@ public class ServiceHPKC009 extends ServiceBase {
String
receiptDate
=
MapUtils
.
getString
(
queryRow
,
"dateProc"
);
String
receiptDate
=
MapUtils
.
getString
(
queryRow
,
"dateProc"
);
queryRow
.
put
(
"dateProc"
,
StringUtil
.
removeSpecifiedCharacter
(
receiptDate
,
queryRow
.
put
(
"dateProc"
,
StringUtil
.
removeSpecifiedCharacter
(
receiptDate
,
StringUtil
.
DEFAULT_CHARACTER_TO_BE_REMOVED
));
StringUtil
.
DEFAULT_CHARACTER_TO_BE_REMOVED
));
queryRow
.
put
(
"dateType"
,
CommonConstant
.
DateType
.
MONTH
);
inInfo
=
super
.
query
(
inInfo
,
"HPKC009.query"
,
new
HPPZ009
());
inInfo
=
super
.
query
(
inInfo
,
"HPKC009.query"
,
new
HPPZ009
());
List
sum
=
dao
.
query
(
"HPKC009.querySum"
,
queryRow
);
List
sum
=
dao
.
query
(
"HPKC009.querySum"
,
queryRow
);
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
set
(
EiConstant
.
COLUMN_TOTAL_SUM
,
sum
.
get
(
0
));
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
set
(
EiConstant
.
COLUMN_TOTAL_SUM
,
sum
.
get
(
0
));
...
@@ -102,18 +98,22 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -102,18 +98,22 @@ public class ServiceHPKC009 extends ServiceBase {
List
<
HPKC009
>
results
=
new
ArrayList
<>();
List
<
HPKC009
>
results
=
new
ArrayList
<>();
// 取昨天的日期
// 取昨天的日期
Map
queryMap
=
new
HashMap
();
Map
queryMap
=
new
HashMap
();
LocalDate
nowData
=
LocalDate
.
now
();
LocalDate
nowDate
=
LocalDate
.
now
();
queryMap
.
put
(
"yesterday"
,
nowData
.
minusDays
(
1
).
format
(
DateUtils
.
SHORT_DATE
));
String
yesterDay
=
LocalDate
.
now
().
minusDays
(
1
).
format
(
DateUtils
.
SHORT_DATE
);
queryMap
.
put
(
"beforeDay"
,
nowData
.
minusDays
(
2
).
format
(
DateUtils
.
SHORT_DATE
));
queryMap
.
put
(
"yesterFrom"
,
yesterDay
);
queryMap
.
put
(
"yesterTo"
,
yesterDay
);
queryMap
.
put
(
"yesterDate"
,
yesterDay
);
queryMap
.
put
(
"beforeDate"
,
nowDate
.
minusDays
(
2
).
format
(
DateUtils
.
SHORT_DATE
));
queryMap
.
put
(
"dateType"
,
CommonConstant
.
DateType
.
DAY
);
// 0.清除数据
// 0.清除数据
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"yester
day
"
));
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"yester
Date
"
));
dao
.
delete
(
HPSqlConstant
.
HPKC009
.
DELETE_BY_TIME
,
queryMap
);
dao
.
delete
(
HPSqlConstant
.
HPKC009
.
DELETE_BY_TIME
,
queryMap
);
// 1、统计采购库存
// 1、统计采购库存
results
.
addAll
(
this
.
stat
Day
Cg
(
queryMap
));
results
.
addAll
(
this
.
statCg
(
queryMap
));
// 2、统计生产库存
// 2、统计生产库存
results
.
addAll
(
this
.
stat
Day
Sc
(
queryMap
));
results
.
addAll
(
this
.
statSc
(
queryMap
));
// 3、统计其他库存
// 3、统计其他库存
results
.
addAll
(
this
.
stat
Day
Qt
(
queryMap
));
results
.
addAll
(
this
.
statQt
(
queryMap
));
// 4、设置基础信息
// 4、设置基础信息
this
.
setBaseInfo
(
results
);
this
.
setBaseInfo
(
results
);
// 5、写入数据库
// 5、写入数据库
...
@@ -121,7 +121,48 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -121,7 +121,48 @@ public class ServiceHPKC009 extends ServiceBase {
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"按天统计成功"
);
inInfo
.
setMsg
(
"按天统计成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"保存失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"按天统计失败"
);
}
return
inInfo
;
}
/**
* 按月统计
*
* @param inInfo
* @return
*/
public
EiInfo
statMonth
(
EiInfo
inInfo
)
{
try
{
List
<
HPKC009
>
results
=
new
ArrayList
<>();
// 上个月的日期
Map
queryMap
=
new
HashMap
();
LocalDate
nowDate
=
LocalDate
.
now
();
LocalDate
yesterMonth
=
nowDate
.
minusMonths
(
1
);
queryMap
.
put
(
"yesterFrom"
,
yesterMonth
.
with
(
TemporalAdjusters
.
firstDayOfMonth
())
.
format
(
DateUtils
.
SHORT_DATE
));
queryMap
.
put
(
"yesterTo"
,
yesterMonth
.
with
(
TemporalAdjusters
.
lastDayOfMonth
())
.
format
(
DateUtils
.
SHORT_DATE
));
queryMap
.
put
(
"yesterDate"
,
yesterMonth
.
format
(
DateUtils
.
SHORT_MONTH
));
queryMap
.
put
(
"beforeDate"
,
nowDate
.
minusMonths
(
2
).
format
(
DateUtils
.
SHORT_MONTH
));
queryMap
.
put
(
"dateType"
,
CommonConstant
.
DateType
.
MONTH
);
// 0.清除数据
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"yesterDate"
));
dao
.
delete
(
HPSqlConstant
.
HPKC009
.
DELETE_BY_TIME
,
queryMap
);
// 1、统计采购库存
results
.
addAll
(
this
.
statCg
(
queryMap
));
// 2、统计生产库存
results
.
addAll
(
this
.
statSc
(
queryMap
));
// 3、统计其他库存
results
.
addAll
(
this
.
statQt
(
queryMap
));
// 4、设置基础信息
this
.
setBaseInfo
(
results
);
// 5、写入数据库
DaoUtils
.
insert
(
"HPKC009.insert"
,
results
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"按月统计成功"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"按月统计失败"
);
}
}
return
inInfo
;
return
inInfo
;
}
}
...
@@ -131,26 +172,26 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -131,26 +172,26 @@ public class ServiceHPKC009 extends ServiceBase {
*
*
* @return
* @return
*/
*/
private
List
<
HPKC009
>
stat
Day
Cg
(
Map
queryMap
)
{
private
List
<
HPKC009
>
statCg
(
Map
queryMap
)
{
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
// 1.1、期末库存
// 1.1、期末库存
List
<
HPKC001
>
aItems
=
dao
.
query
(
"HPKC001.statDa
y
"
,
new
HashMap
<>());
List
<
HPKC001
>
aItems
=
dao
.
query
(
"HPKC001.statDa
te
"
,
new
HashMap
<>());
// 1.2、收入
// 1.2、收入
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yester
day
"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yester
From
"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yester
day
"
)
+
"235959"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yester
To
"
)
+
"235959"
);
List
<
HPKC001
>
bKc001s
=
dao
.
query
(
"HPKC001.statDa
y
"
,
queryMap
);
List
<
HPKC001
>
bKc001s
=
dao
.
query
(
"HPKC001.statDa
te
"
,
queryMap
);
Map
<
String
,
HPKC001
>
bKc001Map
=
bKc001s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
Map
<
String
,
HPKC001
>
bKc001Map
=
bKc001s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getMaterialType
()
+
"#"
+
item
.
getMaterialCode
()
+
"#"
+
item
.
getMaterialType
()
+
"#"
+
item
.
getMaterialCode
()
+
"#"
+
item
.
getSpec
(),
item
->
item
));
+
item
.
getSpec
(),
item
->
item
));
// 1.3、发出
// 1.3、发出
List
<
HPKC002
>
cKc002s
=
dao
.
query
(
"HPKC002.statDa
y
"
,
queryMap
);
List
<
HPKC002
>
cKc002s
=
dao
.
query
(
"HPKC002.statDa
te
"
,
queryMap
);
Map
<
String
,
HPKC002
>
cKc001Map
=
cKc002s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
Map
<
String
,
HPKC002
>
cKc001Map
=
cKc002s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getMaterialType
()
+
"#"
+
item
.
getMaterialCode
()
+
"#"
+
item
.
getMaterialType
()
+
"#"
+
item
.
getMaterialCode
()
+
"#"
+
item
.
getSpec
(),
item
->
item
));
+
item
.
getSpec
(),
item
->
item
));
// 1.4、期初库存
// 1.4、期初库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDa
y
"
));
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDa
te
"
));
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
CG
);
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
CG
);
List
<
HPKC009
>
dKc009s
=
dao
.
query
(
"HPKC009.query"
,
new
HashMap
<>());
List
<
HPKC009
>
dKc009s
=
dao
.
query
(
"HPKC009.query"
,
new
HashMap
<>());
Map
<
String
,
HPKC009
>
dKc009Map
=
dKc009s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
Map
<
String
,
HPKC009
>
dKc009Map
=
dKc009s
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
...
@@ -166,8 +207,8 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -166,8 +207,8 @@ public class ServiceHPKC009 extends ServiceBase {
kc009
.
setInventType
(
aItem
.
getMaterialType
());
kc009
.
setInventType
(
aItem
.
getMaterialType
());
kc009
.
setInventCode
(
aItem
.
getMaterialCode
());
kc009
.
setInventCode
(
aItem
.
getMaterialCode
());
kc009
.
setKcType
(
HPConstant
.
KcType
.
CG
);
kc009
.
setKcType
(
HPConstant
.
KcType
.
CG
);
kc009
.
setDateType
(
CommonConstant
.
DateType
.
DAY
);
kc009
.
setDateType
(
queryMap
.
get
(
"dateType"
).
toString
()
);
kc009
.
setDateProc
(
queryMap
.
get
(
"yester
day
"
).
toString
());
kc009
.
setDateProc
(
queryMap
.
get
(
"yester
Date
"
).
toString
());
// 期末
// 期末
kc009
.
setEndAmount
(
BigDecimal
.
valueOf
(
aItem
.
getQuantity
()));
kc009
.
setEndAmount
(
BigDecimal
.
valueOf
(
aItem
.
getQuantity
()));
kc009
.
setEndWeight
(
aItem
.
getWeight
());
kc009
.
setEndWeight
(
aItem
.
getWeight
());
...
@@ -201,24 +242,24 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -201,24 +242,24 @@ public class ServiceHPKC009 extends ServiceBase {
* @param queryMap
* @param queryMap
* @return
* @return
*/
*/
private
List
<
HPKC009
>
stat
Day
Sc
(
Map
queryMap
)
{
private
List
<
HPKC009
>
statSc
(
Map
queryMap
)
{
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
// 1.1、期末库存
// 1.1、期末库存
List
<
HPKC003
>
aItems
=
dao
.
query
(
"HPKC003.statDa
y
"
,
new
HashMap
<>());
List
<
HPKC003
>
aItems
=
dao
.
query
(
"HPKC003.statDa
te
"
,
new
HashMap
<>());
// 1.2、收入
// 1.2、收入
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yesterday"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yesterday"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yesterday"
)
+
"235959"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yesterday"
)
+
"235959"
);
List
<
HPKC003
>
bItems
=
dao
.
query
(
"HPKC003.statDa
y
"
,
queryMap
);
List
<
HPKC003
>
bItems
=
dao
.
query
(
"HPKC003.statDa
te
"
,
queryMap
);
Map
<
String
,
HPKC003
>
bItemMap
=
bItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
Map
<
String
,
HPKC003
>
bItemMap
=
bItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWarehouseCode
()
+
"#"
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWarehouseCode
()
+
"#"
+
item
.
getMaterialType
()
+
"#"
+
item
.
getMaterialCode
(),
item
->
item
));
+
item
.
getMaterialType
()
+
"#"
+
item
.
getMaterialCode
(),
item
->
item
));
// 1.3、发出
// 1.3、发出
List
<
HPKC004
>
cItems
=
dao
.
query
(
"HPKC004.statDa
y
"
,
queryMap
);
List
<
HPKC004
>
cItems
=
dao
.
query
(
"HPKC004.statDa
te
"
,
queryMap
);
Map
<
String
,
HPKC004
>
cItemMap
=
cItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
Map
<
String
,
HPKC004
>
cItemMap
=
cItems
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
item
.
getCompanyCode
()
+
"#"
+
item
.
getDepCode
()
+
"#"
+
item
.
getWhCode
()
+
"#"
+
item
.
getMatType
()
+
"#"
+
item
.
getMatCode
(),
item
->
item
));
+
item
.
getMatType
()
+
"#"
+
item
.
getMatCode
(),
item
->
item
));
// 1.4、期初库存
// 1.4、期初库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDa
y
"
));
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDa
te
"
));
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
SC
);
queryMap
.
put
(
"kcType"
,
HPConstant
.
KcType
.
SC
);
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
->
...
@@ -234,8 +275,8 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -234,8 +275,8 @@ public class ServiceHPKC009 extends ServiceBase {
kc009
.
setInventType
(
aItem
.
getMaterialType
()
+
""
);
kc009
.
setInventType
(
aItem
.
getMaterialType
()
+
""
);
kc009
.
setInventCode
(
aItem
.
getMaterialCode
());
kc009
.
setInventCode
(
aItem
.
getMaterialCode
());
kc009
.
setKcType
(
HPConstant
.
KcType
.
SC
);
kc009
.
setKcType
(
HPConstant
.
KcType
.
SC
);
kc009
.
setDateType
(
CommonConstant
.
DateType
.
DAY
);
kc009
.
setDateType
(
queryMap
.
get
(
"dateType"
).
toString
()
);
kc009
.
setDateProc
(
queryMap
.
get
(
"yester
day
"
).
toString
());
kc009
.
setDateProc
(
queryMap
.
get
(
"yester
Date
"
).
toString
());
// 期末
// 期末
kc009
.
setEndAmount
(
new
BigDecimal
(
aItem
.
getNumber
()));
kc009
.
setEndAmount
(
new
BigDecimal
(
aItem
.
getNumber
()));
kc009
.
setEndWeight
(
new
BigDecimal
(
aItem
.
getWeight
()));
kc009
.
setEndWeight
(
new
BigDecimal
(
aItem
.
getWeight
()));
...
@@ -269,24 +310,24 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -269,24 +310,24 @@ public class ServiceHPKC009 extends ServiceBase {
* @param queryMap
* @param queryMap
* @return
* @return
*/
*/
private
List
<
HPKC009
>
stat
Day
Qt
(
Map
queryMap
)
{
private
List
<
HPKC009
>
statQt
(
Map
queryMap
)
{
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
Map
<
String
,
HPKC009
>
kc009Map
=
new
HashMap
();
// 1.1、期末库存
// 1.1、期末库存
List
<
HPKC006
>
aItems
=
dao
.
query
(
"HPKC006.statDa
y
"
,
new
HashMap
<>());
List
<
HPKC006
>
aItems
=
dao
.
query
(
"HPKC006.statDa
te
"
,
new
HashMap
<>());
// 1.2、收入
// 1.2、收入
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yesterday"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeFrom"
,
queryMap
.
get
(
"yesterday"
)
+
"000000"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yesterday"
)
+
"235959"
);
queryMap
.
put
(
"createdTimeTo"
,
queryMap
.
get
(
"yesterday"
)
+
"235959"
);
List
<
HPKC006
>
bItems
=
dao
.
query
(
"HPKC006.statDa
y
"
,
queryMap
);
List
<
HPKC006
>
bItems
=
dao
.
query
(
"HPKC006.statDa
te
"
,
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
.
getMatType
()
+
"#"
+
item
.
getMatCode
(),
item
->
item
));
+
item
.
getMatType
()
+
"#"
+
item
.
getMatCode
(),
item
->
item
));
// 1.3、发出
// 1.3、发出
List
<
HPKC007
>
cItems
=
dao
.
query
(
"HPKC007.statDa
y
"
,
queryMap
);
List
<
HPKC007
>
cItems
=
dao
.
query
(
"HPKC007.statDa
te
"
,
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
.
getMatType
()
+
"#"
+
item
.
getMatCode
(),
item
->
item
));
+
item
.
getMatType
()
+
"#"
+
item
.
getMatCode
(),
item
->
item
));
// 1.4、期初库存
// 1.4、期初库存
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDa
y
"
));
queryMap
.
put
(
"dateProc"
,
queryMap
.
get
(
"beforeDa
te
"
));
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
->
...
@@ -300,8 +341,8 @@ public class ServiceHPKC009 extends ServiceBase {
...
@@ -300,8 +341,8 @@ public class ServiceHPKC009 extends ServiceBase {
kc009
.
setInventType
(
aItem
.
getMatType
());
kc009
.
setInventType
(
aItem
.
getMatType
());
kc009
.
setInventCode
(
aItem
.
getMatCode
());
kc009
.
setInventCode
(
aItem
.
getMatCode
());
kc009
.
setKcType
(
HPConstant
.
KcType
.
QT
);
kc009
.
setKcType
(
HPConstant
.
KcType
.
QT
);
kc009
.
setDateType
(
CommonConstant
.
DateType
.
DAY
);
kc009
.
setDateType
(
queryMap
.
get
(
"dateType"
).
toString
()
);
kc009
.
setDateProc
(
queryMap
.
get
(
"yester
day
"
).
toString
());
kc009
.
setDateProc
(
queryMap
.
get
(
"yester
Date
"
).
toString
());
// 期末
// 期末
kc009
.
setEndAmount
(
aItem
.
getAmount
());
kc009
.
setEndAmount
(
aItem
.
getAmount
());
kc009
.
setEndWeight
(
aItem
.
getWeight
());
kc009
.
setEndWeight
(
aItem
.
getWeight
());
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC001.xml
View file @
abfcdd85
...
@@ -172,8 +172,8 @@
...
@@ -172,8 +172,8 @@
WHERE ID = #id#
WHERE ID = #id#
</update>
</update>
<!--
按天统计
-->
<!--
统计库存
-->
<select
id=
"statDa
y
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC001"
>
<select
id=
"statDa
te
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC001"
>
SELECT
SELECT
COMPANY_CODE AS "companyCode",
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
DEP_CODE AS "depCode",
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC002.xml
View file @
abfcdd85
...
@@ -170,8 +170,8 @@
...
@@ -170,8 +170,8 @@
WHERE ID = #id#
WHERE ID = #id#
</update>
</update>
<!--
按天统计
-->
<!--
统计库存
-->
<select
id=
"statDa
y
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC002"
>
<select
id=
"statDa
te
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC002"
>
SELECT
SELECT
COMPANY_CODE AS "companyCode",
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
DEP_CODE AS "depCode",
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC003.xml
View file @
abfcdd85
...
@@ -173,8 +173,8 @@
...
@@ -173,8 +173,8 @@
ID = #id#
ID = #id#
</update>
</update>
<!--
按天统计
-->
<!--
统计库存
-->
<select
id=
"statDa
y
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC003"
>
<select
id=
"statDa
te
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC003"
>
SELECT
SELECT
COMPANY_CODE AS "companyCode",
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
DEP_CODE AS "depCode",
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC004.xml
View file @
abfcdd85
...
@@ -247,8 +247,8 @@
...
@@ -247,8 +247,8 @@
ID = #id#
ID = #id#
</update>
</update>
<!--
按天统计
-->
<!--
统计库存
-->
<select
id=
"statDa
y
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC004"
>
<select
id=
"statDa
te
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC004"
>
SELECT
SELECT
COMPANY_CODE AS "companyCode",
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
DEP_CODE AS "depCode",
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC006.xml
View file @
abfcdd85
...
@@ -120,8 +120,8 @@
...
@@ -120,8 +120,8 @@
ID = #id#
ID = #id#
</update>
</update>
<!--
按天统计
-->
<!--
统计库存
-->
<select
id=
"statDa
y
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC006"
>
<select
id=
"statDa
te
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC006"
>
SELECT
SELECT
COMPANY_CODE AS "companyCode",
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
DEP_CODE AS "depCode",
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC007.xml
View file @
abfcdd85
...
@@ -163,8 +163,8 @@
...
@@ -163,8 +163,8 @@
ID = #id#
ID = #id#
</update>
</update>
<!--
按天统计
-->
<!--
统计库存
-->
<select
id=
"statDa
y
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC007"
>
<select
id=
"statDa
te
"
resultClass=
"com.baosight.hpjx.hp.kc.domain.HPKC007"
>
SELECT
SELECT
COMPANY_CODE AS "companyCode",
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
DEP_CODE AS "depCode",
...
...
src/main/java/com/baosight/hpjx/util/DateUtils.java
View file @
abfcdd85
...
@@ -27,6 +27,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
...
@@ -27,6 +27,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public
static
final
DateTimeFormatter
DATETIME
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
public
static
final
DateTimeFormatter
DATETIME
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
public
static
final
DateTimeFormatter
SHORT_DATE
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
);
public
static
final
DateTimeFormatter
SHORT_DATE
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
);
public
static
final
DateTimeFormatter
DATE
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
public
static
final
DateTimeFormatter
DATE
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
public
static
final
DateTimeFormatter
SHORT_MONTH
=
DateTimeFormatter
.
ofPattern
(
"yyyyMM"
);
public
static
final
DateTimeFormatter
YEAR_MONTH
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
);
public
static
final
DateTimeFormatter
YEAR_MONTH
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
);
/**
/**
...
...
src/main/webapp/HP/KC/HPKC009.jsp
View file @
abfcdd85
...
@@ -8,12 +8,16 @@
...
@@ -8,12 +8,16 @@
<EF:EFPage
title=
"库存收发存"
>
<EF:EFPage
title=
"库存收发存"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<div
class=
"row"
>
<div
class=
"row"
>
<EF:EFDatePicker
ename=
"inqu_status-0-dateProc"
cname=
"日期:"
<EF:EFDatePicker
ename=
"inqu_status-0-dateProc"
cname=
"日期:"
start=
"year"
depth=
"year"
role=
"date"
format=
"yyyy-MM
-dd
"
readonly=
"true"
/>
role=
"date"
format=
"yyyy-MM"
readonly=
"true"
/>
<EF:EFSelect
ename=
"inqu_status-0-inventType"
cname=
"存货类型:"
filter=
"contains"
defaultValue=
""
>
<EF:EFSelect
ename=
"inqu_status-0-inventType"
cname=
"存货类型:"
filter=
"contains"
defaultValue=
""
>
<EF:EFOption
label=
"请选择"
value=
""
/>
<EF:EFOption
label=
"请选择"
value=
""
/>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
/>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.inventType"
/>
</EF:EFSelect>
</EF:EFSelect>
<EF:EFSelect
ename=
"inqu_status-0-whCode"
cname=
"仓库名称"
filter=
"contains"
defultValue=
""
>
<EF:EFOption
label=
"请选择"
value=
""
/>
<EF:EFOptions
blockId=
"whName_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
</div>
</div>
</EF:EFRegion>
</EF:EFRegion>
...
@@ -23,12 +27,9 @@
...
@@ -23,12 +27,9 @@
<EF:EFComboColumn
cname=
"库存类型"
ename=
"kcType"
enable=
"false"
width=
"80"
align=
"center"
>
<EF:EFComboColumn
cname=
"库存类型"
ename=
"kcType"
enable=
"false"
width=
"80"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.kcType"
/>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.kcType"
/>
</EF:EFComboColumn>
</EF:EFComboColumn>
<EF:EFComboColumn
cname=
"日期类型"
ename=
"dateType"
enable=
"false"
width=
"80"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hpjx.hpkc.dateType"
/>
</EF:EFComboColumn>
<EF:EFColumn
cname=
"日期"
ename=
"dateProc"
enable=
"false"
width=
"90"
align=
"center"
/>
<EF:EFColumn
cname=
"日期"
ename=
"dateProc"
enable=
"false"
width=
"90"
align=
"center"
/>
<EF:EFComboColumn
cname=
"仓库名称"
ename=
"whCode"
enable=
"false"
columnTemplate=
"#=textField#"
<EF:EFComboColumn
cname=
"仓库名称"
ename=
"whCode"
enable=
"false"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
blockName=
"wh
_record
_block_id"
itemTemplate=
"#=textField#"
blockName=
"wh
Name
_block_id"
textField=
"textField"
valueField=
"valueField"
textField=
"textField"
valueField=
"valueField"
align=
"center"
filter=
"contains"
width=
"100"
>
align=
"center"
filter=
"contains"
width=
"100"
>
</EF:EFComboColumn>
</EF:EFComboColumn>
...
...
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