Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
9a496ffa
Commit
9a496ffa
authored
Aug 08, 2022
by
季圣华
Browse files
完善首页数据统计接口的数据角色判断
parent
c42c3b71
Changes
8
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotHeadController.java
View file @
9a496ffa
...
@@ -103,12 +103,12 @@ public class DepotHeadController {
...
@@ -103,12 +103,12 @@ public class DepotHeadController {
public
BaseResponseInfo
findInDetail
(
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
public
BaseResponseInfo
findInDetail
(
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
value
=
"organId"
,
required
=
false
)
Integer
oId
,
@RequestParam
(
value
=
"organId"
,
required
=
false
)
Integer
oId
,
@RequestParam
(
"number"
)
String
number
,
@RequestParam
(
"number"
)
String
number
,
@RequestParam
(
"materialParam"
)
String
materialParam
,
@RequestParam
(
"materialParam"
)
String
materialParam
,
@RequestParam
(
value
=
"depotId"
,
required
=
false
)
Long
depotId
,
@RequestParam
(
value
=
"depotId"
,
required
=
false
)
Long
depotId
,
@RequestParam
(
"beginTime"
)
String
beginTime
,
@RequestParam
(
"beginTime"
)
String
beginTime
,
@RequestParam
(
"endTime"
)
String
endTime
,
@RequestParam
(
"endTime"
)
String
endTime
,
@RequestParam
(
value
=
"roleType"
,
required
=
false
)
String
roleType
,
@RequestParam
(
value
=
"roleType"
,
required
=
false
)
String
roleType
,
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"remark"
)
String
remark
,
@RequestParam
(
"remark"
)
String
remark
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
...
@@ -415,7 +415,8 @@ public class DepotHeadController {
...
@@ -415,7 +415,8 @@ public class DepotHeadController {
*/
*/
@GetMapping
(
value
=
"/getBuyAndSaleStatistics"
)
@GetMapping
(
value
=
"/getBuyAndSaleStatistics"
)
@ApiOperation
(
value
=
"统计今日采购额、昨日采购额、本月采购额、今年采购额|销售额|零售额"
)
@ApiOperation
(
value
=
"统计今日采购额、昨日采购额、本月采购额、今年采购额|销售额|零售额"
)
public
BaseResponseInfo
getBuyAndSaleStatistics
(
HttpServletRequest
request
)
{
public
BaseResponseInfo
getBuyAndSaleStatistics
(
@RequestParam
(
value
=
"roleType"
,
required
=
false
)
String
roleType
,
HttpServletRequest
request
)
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
try
{
String
today
=
Tools
.
getNow
()
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
today
=
Tools
.
getNow
()
+
BusinessConstants
.
DAY_FIRST_TIME
;
...
@@ -425,7 +426,7 @@ public class DepotHeadController {
...
@@ -425,7 +426,7 @@ public class DepotHeadController {
String
yearBegin
=
Tools
.
getYearBegin
()
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
yearBegin
=
Tools
.
getYearBegin
()
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
yearEnd
=
Tools
.
getYearEnd
()
+
BusinessConstants
.
DAY_LAST_TIME
;
String
yearEnd
=
Tools
.
getYearEnd
()
+
BusinessConstants
.
DAY_LAST_TIME
;
Map
<
String
,
Object
>
map
=
depotHeadService
.
getBuyAndSaleStatistics
(
today
,
monthFirstDay
,
Map
<
String
,
Object
>
map
=
depotHeadService
.
getBuyAndSaleStatistics
(
today
,
monthFirstDay
,
yesterdayBegin
,
yesterdayEnd
,
yearBegin
,
yearEnd
);
yesterdayBegin
,
yesterdayEnd
,
yearBegin
,
yearEnd
,
roleType
);
res
.
code
=
200
;
res
.
code
=
200
;
res
.
data
=
map
;
res
.
data
=
map
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
9a496ffa
...
@@ -633,17 +633,17 @@ public class DepotItemController {
...
@@ -633,17 +633,17 @@ public class DepotItemController {
*/
*/
@GetMapping
(
value
=
"/buyOrSalePrice"
)
@GetMapping
(
value
=
"/buyOrSalePrice"
)
@ApiOperation
(
value
=
"统计采购、销售、零售的总金额"
)
@ApiOperation
(
value
=
"统计采购、销售、零售的总金额"
)
public
BaseResponseInfo
buyOrSalePrice
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
public
BaseResponseInfo
buyOrSalePrice
(
@RequestParam
(
value
=
"roleType"
,
required
=
false
)
String
roleType
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
String
message
=
"成功"
;
try
{
try
{
List
<
String
>
list
=
Tools
.
getLastMonths
(
6
);
List
<
String
>
list
=
Tools
.
getLastMonths
(
6
);
JSONArray
buyPriceList
=
new
JSONArray
();
JSONArray
buyPriceList
=
new
JSONArray
();
for
(
String
month:
list
)
{
for
(
String
month:
list
)
{
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
BigDecimal
outPrice
=
depotItemService
.
inOrOutPrice
(
"入库"
,
"采购"
,
month
);
BigDecimal
outPrice
=
depotItemService
.
inOrOutPrice
(
"入库"
,
"采购"
,
month
,
roleType
);
BigDecimal
inPrice
=
depotItemService
.
inOrOutPrice
(
"出库"
,
"采购退货"
,
month
);
BigDecimal
inPrice
=
depotItemService
.
inOrOutPrice
(
"出库"
,
"采购退货"
,
month
,
roleType
);
obj
.
put
(
"x"
,
month
);
obj
.
put
(
"x"
,
month
);
obj
.
put
(
"y"
,
outPrice
.
subtract
(
inPrice
));
obj
.
put
(
"y"
,
outPrice
.
subtract
(
inPrice
));
buyPriceList
.
add
(
obj
);
buyPriceList
.
add
(
obj
);
...
@@ -652,8 +652,8 @@ public class DepotItemController {
...
@@ -652,8 +652,8 @@ public class DepotItemController {
JSONArray
salePriceList
=
new
JSONArray
();
JSONArray
salePriceList
=
new
JSONArray
();
for
(
String
month:
list
)
{
for
(
String
month:
list
)
{
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
BigDecimal
outPrice
=
depotItemService
.
inOrOutPrice
(
"出库"
,
"销售"
,
month
);
BigDecimal
outPrice
=
depotItemService
.
inOrOutPrice
(
"出库"
,
"销售"
,
month
,
roleType
);
BigDecimal
inPrice
=
depotItemService
.
inOrOutPrice
(
"入库"
,
"销售退货"
,
month
);
BigDecimal
inPrice
=
depotItemService
.
inOrOutPrice
(
"入库"
,
"销售退货"
,
month
,
roleType
);
obj
.
put
(
"x"
,
month
);
obj
.
put
(
"x"
,
month
);
obj
.
put
(
"y"
,
outPrice
.
subtract
(
inPrice
));
obj
.
put
(
"y"
,
outPrice
.
subtract
(
inPrice
));
salePriceList
.
add
(
obj
);
salePriceList
.
add
(
obj
);
...
@@ -662,8 +662,8 @@ public class DepotItemController {
...
@@ -662,8 +662,8 @@ public class DepotItemController {
JSONArray
retailPriceList
=
new
JSONArray
();
JSONArray
retailPriceList
=
new
JSONArray
();
for
(
String
month:
list
)
{
for
(
String
month:
list
)
{
JSONObject
obj
=
new
JSONObject
();
JSONObject
obj
=
new
JSONObject
();
BigDecimal
outPrice
=
depotItemService
.
inOrOutRetailPrice
(
"出库"
,
"零售"
,
month
);
BigDecimal
outPrice
=
depotItemService
.
inOrOutRetailPrice
(
"出库"
,
"零售"
,
month
,
roleType
);
BigDecimal
inPrice
=
depotItemService
.
inOrOutRetailPrice
(
"入库"
,
"零售退货"
,
month
);
BigDecimal
inPrice
=
depotItemService
.
inOrOutRetailPrice
(
"入库"
,
"零售退货"
,
month
,
roleType
);
obj
.
put
(
"x"
,
month
);
obj
.
put
(
"x"
,
month
);
obj
.
put
(
"y"
,
outPrice
.
subtract
(
inPrice
));
obj
.
put
(
"y"
,
outPrice
.
subtract
(
inPrice
));
retailPriceList
.
add
(
obj
);
retailPriceList
.
add
(
obj
);
...
@@ -673,8 +673,8 @@ public class DepotItemController {
...
@@ -673,8 +673,8 @@ public class DepotItemController {
res
.
data
=
map
;
res
.
data
=
map
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
message
=
"统计失败"
;
res
.
code
=
500
;
res
.
code
=
500
;
res
.
data
=
"统计失败"
;
}
}
return
res
;
return
res
;
}
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java
View file @
9a496ffa
...
@@ -186,13 +186,15 @@ public interface DepotHeadMapperEx {
...
@@ -186,13 +186,15 @@ public interface DepotHeadMapperEx {
@Param
(
"subType"
)
String
subType
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"hasSupplier"
)
Integer
hasSupplier
,
@Param
(
"hasSupplier"
)
Integer
hasSupplier
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"creatorArray"
)
String
[]
creatorArray
);
BigDecimal
getBuyAndSaleRetailStatistics
(
BigDecimal
getBuyAndSaleRetailStatistics
(
@Param
(
"type"
)
String
type
,
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"creatorArray"
)
String
[]
creatorArray
);
List
<
DepotHeadVo4List
>
debtList
(
List
<
DepotHeadVo4List
>
debtList
(
@Param
(
"organId"
)
Long
organId
,
@Param
(
"organId"
)
Long
organId
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
View file @
9a496ffa
...
@@ -88,13 +88,15 @@ public interface DepotItemMapperEx {
...
@@ -88,13 +88,15 @@ public interface DepotItemMapperEx {
@Param
(
"type"
)
String
type
,
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"creatorArray"
)
String
[]
creatorArray
);
BigDecimal
inOrOutRetailPrice
(
BigDecimal
inOrOutRetailPrice
(
@Param
(
"type"
)
String
type
,
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"creatorArray"
)
String
[]
creatorArray
);
BigDecimal
getStockCheckSumByDepotList
(
BigDecimal
getStockCheckSumByDepotList
(
@Param
(
"depotList"
)
List
<
Long
>
depotList
,
@Param
(
"depotList"
)
List
<
Long
>
depotList
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
9a496ffa
...
@@ -850,60 +850,62 @@ public class DepotHeadService {
...
@@ -850,60 +850,62 @@ public class DepotHeadService {
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
}
}
public
Map
<
String
,
Object
>
getBuyAndSaleStatistics
(
String
today
,
String
monthFirstDay
,
String
yesterdayBegin
,
String
yesterdayEnd
,
String
yearBegin
,
String
yearEnd
)
{
public
Map
<
String
,
Object
>
getBuyAndSaleStatistics
(
String
today
,
String
monthFirstDay
,
String
yesterdayBegin
,
String
yesterdayEnd
,
String
yearBegin
,
String
yearEnd
,
String
roleType
)
throws
Exception
{
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//今日
//今日
BigDecimal
todayBuy
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"采购"
,
BigDecimal
todayBuy
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"采购"
,
1
,
today
,
getNow3
());
//今日采购入库
1
,
today
,
getNow3
()
,
creatorArray
);
//今日采购入库
BigDecimal
todayBuyBack
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"采购退货"
,
BigDecimal
todayBuyBack
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"采购退货"
,
1
,
today
,
getNow3
());
//今日采购退货
1
,
today
,
getNow3
()
,
creatorArray
);
//今日采购退货
BigDecimal
todaySale
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"销售"
,
BigDecimal
todaySale
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"销售"
,
1
,
today
,
getNow3
());
//今日销售出库
1
,
today
,
getNow3
()
,
creatorArray
);
//今日销售出库
BigDecimal
todaySaleBack
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"销售退货"
,
BigDecimal
todaySaleBack
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"销售退货"
,
1
,
today
,
getNow3
());
//今日销售退货
1
,
today
,
getNow3
()
,
creatorArray
);
//今日销售退货
BigDecimal
todayRetailSale
=
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
BigDecimal
todayRetailSale
=
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
today
,
getNow3
());
//今日零售出库
today
,
getNow3
()
,
creatorArray
);
//今日零售出库
BigDecimal
todayRetailSaleBack
=
getBuyAndSaleRetailStatistics
(
"入库"
,
"零售退货"
,
BigDecimal
todayRetailSaleBack
=
getBuyAndSaleRetailStatistics
(
"入库"
,
"零售退货"
,
today
,
getNow3
());
//今日零售退货
today
,
getNow3
()
,
creatorArray
);
//今日零售退货
//本月
//本月
BigDecimal
monthBuy
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"采购"
,
BigDecimal
monthBuy
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"采购"
,
1
,
monthFirstDay
,
getNow3
());
//本月采购入库
1
,
monthFirstDay
,
getNow3
()
,
creatorArray
);
//本月采购入库
BigDecimal
monthBuyBack
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"采购退货"
,
BigDecimal
monthBuyBack
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"采购退货"
,
1
,
monthFirstDay
,
getNow3
());
//本月采购退货
1
,
monthFirstDay
,
getNow3
()
,
creatorArray
);
//本月采购退货
BigDecimal
monthSale
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"销售"
,
BigDecimal
monthSale
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"销售"
,
1
,
monthFirstDay
,
getNow3
());
//本月销售出库
1
,
monthFirstDay
,
getNow3
()
,
creatorArray
);
//本月销售出库
BigDecimal
monthSaleBack
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"销售退货"
,
BigDecimal
monthSaleBack
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"销售退货"
,
1
,
monthFirstDay
,
getNow3
());
//本月销售退货
1
,
monthFirstDay
,
getNow3
()
,
creatorArray
);
//本月销售退货
BigDecimal
monthRetailSale
=
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
BigDecimal
monthRetailSale
=
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
monthFirstDay
,
getNow3
());
//本月零售出库
monthFirstDay
,
getNow3
()
,
creatorArray
);
//本月零售出库
BigDecimal
monthRetailSaleBack
=
getBuyAndSaleRetailStatistics
(
"入库"
,
"零售退货"
,
BigDecimal
monthRetailSaleBack
=
getBuyAndSaleRetailStatistics
(
"入库"
,
"零售退货"
,
monthFirstDay
,
getNow3
());
//本月零售退货
monthFirstDay
,
getNow3
()
,
creatorArray
);
//本月零售退货
//昨日
//昨日
BigDecimal
yesterdayBuy
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"采购"
,
BigDecimal
yesterdayBuy
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"采购"
,
1
,
yesterdayBegin
,
yesterdayEnd
);
//昨日采购入库
1
,
yesterdayBegin
,
yesterdayEnd
,
creatorArray
);
//昨日采购入库
BigDecimal
yesterdayBuyBack
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"采购退货"
,
BigDecimal
yesterdayBuyBack
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"采购退货"
,
1
,
yesterdayBegin
,
yesterdayEnd
);
//昨日采购退货
1
,
yesterdayBegin
,
yesterdayEnd
,
creatorArray
);
//昨日采购退货
BigDecimal
yesterdaySale
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"销售"
,
BigDecimal
yesterdaySale
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"销售"
,
1
,
yesterdayBegin
,
yesterdayEnd
);
//昨日销售出库
1
,
yesterdayBegin
,
yesterdayEnd
,
creatorArray
);
//昨日销售出库
BigDecimal
yesterdaySaleBack
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"销售退货"
,
BigDecimal
yesterdaySaleBack
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"销售退货"
,
1
,
yesterdayBegin
,
yesterdayEnd
);
//昨日销售退货
1
,
yesterdayBegin
,
yesterdayEnd
,
creatorArray
);
//昨日销售退货
BigDecimal
yesterdayRetailSale
=
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
BigDecimal
yesterdayRetailSale
=
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
yesterdayBegin
,
yesterdayEnd
);
//昨日零售出库
yesterdayBegin
,
yesterdayEnd
,
creatorArray
);
//昨日零售出库
BigDecimal
yesterdayRetailSaleBack
=
getBuyAndSaleRetailStatistics
(
"入库"
,
"零售退货"
,
BigDecimal
yesterdayRetailSaleBack
=
getBuyAndSaleRetailStatistics
(
"入库"
,
"零售退货"
,
yesterdayBegin
,
yesterdayEnd
);
//昨日零售退货
yesterdayBegin
,
yesterdayEnd
,
creatorArray
);
//昨日零售退货
//今年
//今年
BigDecimal
yearBuy
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"采购"
,
BigDecimal
yearBuy
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"采购"
,
1
,
yearBegin
,
yearEnd
);
//今年采购入库
1
,
yearBegin
,
yearEnd
,
creatorArray
);
//今年采购入库
BigDecimal
yearBuyBack
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"采购退货"
,
BigDecimal
yearBuyBack
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"采购退货"
,
1
,
yearBegin
,
yearEnd
);
//今年采购退货
1
,
yearBegin
,
yearEnd
,
creatorArray
);
//今年采购退货
BigDecimal
yearSale
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"销售"
,
BigDecimal
yearSale
=
getBuyAndSaleBasicStatistics
(
"出库"
,
"销售"
,
1
,
yearBegin
,
yearEnd
);
//今年销售出库
1
,
yearBegin
,
yearEnd
,
creatorArray
);
//今年销售出库
BigDecimal
yearSaleBack
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"销售退货"
,
BigDecimal
yearSaleBack
=
getBuyAndSaleBasicStatistics
(
"入库"
,
"销售退货"
,
1
,
yearBegin
,
yearEnd
);
//今年销售退货
1
,
yearBegin
,
yearEnd
,
creatorArray
);
//今年销售退货
BigDecimal
yearRetailSale
=
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
BigDecimal
yearRetailSale
=
getBuyAndSaleRetailStatistics
(
"出库"
,
"零售"
,
yearBegin
,
yearEnd
);
//今年零售出库
yearBegin
,
yearEnd
,
creatorArray
);
//今年零售出库
BigDecimal
yearRetailSaleBack
=
getBuyAndSaleRetailStatistics
(
"入库"
,
"零售退货"
,
BigDecimal
yearRetailSaleBack
=
getBuyAndSaleRetailStatistics
(
"入库"
,
"零售退货"
,
yearBegin
,
yearEnd
);
//今年零售退货
yearBegin
,
yearEnd
,
creatorArray
);
//今年零售退货
map
.
put
(
"todayBuy"
,
todayBuy
.
subtract
(
todayBuyBack
));
map
.
put
(
"todayBuy"
,
todayBuy
.
subtract
(
todayBuyBack
));
map
.
put
(
"todaySale"
,
todaySale
.
subtract
(
todaySaleBack
));
map
.
put
(
"todaySale"
,
todaySale
.
subtract
(
todaySaleBack
));
map
.
put
(
"todayRetailSale"
,
todayRetailSale
.
subtract
(
todayRetailSaleBack
));
map
.
put
(
"todayRetailSale"
,
todayRetailSale
.
subtract
(
todayRetailSaleBack
));
...
@@ -919,12 +921,14 @@ public class DepotHeadService {
...
@@ -919,12 +921,14 @@ public class DepotHeadService {
return
map
;
return
map
;
}
}
public
BigDecimal
getBuyAndSaleBasicStatistics
(
String
type
,
String
subType
,
Integer
hasSupplier
,
String
beginTime
,
String
endTime
)
{
public
BigDecimal
getBuyAndSaleBasicStatistics
(
String
type
,
String
subType
,
Integer
hasSupplier
,
return
depotHeadMapperEx
.
getBuyAndSaleBasicStatistics
(
type
,
subType
,
hasSupplier
,
beginTime
,
endTime
);
String
beginTime
,
String
endTime
,
String
[]
creatorArray
)
{
return
depotHeadMapperEx
.
getBuyAndSaleBasicStatistics
(
type
,
subType
,
hasSupplier
,
beginTime
,
endTime
,
creatorArray
);
}
}
public
BigDecimal
getBuyAndSaleRetailStatistics
(
String
type
,
String
subType
,
String
beginTime
,
String
endTime
)
{
public
BigDecimal
getBuyAndSaleRetailStatistics
(
String
type
,
String
subType
,
return
depotHeadMapperEx
.
getBuyAndSaleRetailStatistics
(
type
,
subType
,
beginTime
,
endTime
).
abs
();
String
beginTime
,
String
endTime
,
String
[]
creatorArray
)
{
return
depotHeadMapperEx
.
getBuyAndSaleRetailStatistics
(
type
,
subType
,
beginTime
,
endTime
,
creatorArray
).
abs
();
}
}
public
DepotHead
getDepotHead
(
String
number
)
throws
Exception
{
public
DepotHead
getDepotHead
(
String
number
)
throws
Exception
{
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
9a496ffa
...
@@ -348,12 +348,13 @@ public class DepotItemService {
...
@@ -348,12 +348,13 @@ public class DepotItemService {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
public
BigDecimal
inOrOutPrice
(
String
type
,
String
subType
,
String
month
)
throws
Exception
{
public
BigDecimal
inOrOutPrice
(
String
type
,
String
subType
,
String
month
,
String
roleType
)
throws
Exception
{
BigDecimal
result
=
BigDecimal
.
ZERO
;
BigDecimal
result
=
BigDecimal
.
ZERO
;
try
{
try
{
String
[]
creatorArray
=
depotHeadService
.
getCreatorArray
(
roleType
);
String
beginTime
=
Tools
.
firstDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
beginTime
=
Tools
.
firstDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
endTime
=
Tools
.
lastDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_LAST_TIME
;
String
endTime
=
Tools
.
lastDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_LAST_TIME
;
result
=
depotItemMapperEx
.
inOrOutPrice
(
type
,
subType
,
beginTime
,
endTime
);
result
=
depotItemMapperEx
.
inOrOutPrice
(
type
,
subType
,
beginTime
,
endTime
,
creatorArray
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
}
}
...
@@ -368,12 +369,13 @@ public class DepotItemService {
...
@@ -368,12 +369,13 @@ public class DepotItemService {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
public
BigDecimal
inOrOutRetailPrice
(
String
type
,
String
subType
,
String
month
)
throws
Exception
{
public
BigDecimal
inOrOutRetailPrice
(
String
type
,
String
subType
,
String
month
,
String
roleType
)
throws
Exception
{
BigDecimal
result
=
BigDecimal
.
ZERO
;
BigDecimal
result
=
BigDecimal
.
ZERO
;
try
{
try
{
String
[]
creatorArray
=
depotHeadService
.
getCreatorArray
(
roleType
);
String
beginTime
=
Tools
.
firstDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
beginTime
=
Tools
.
firstDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_FIRST_TIME
;
String
endTime
=
Tools
.
lastDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_LAST_TIME
;
String
endTime
=
Tools
.
lastDayOfMonth
(
month
)
+
BusinessConstants
.
DAY_LAST_TIME
;
result
=
depotItemMapperEx
.
inOrOutRetailPrice
(
type
,
subType
,
beginTime
,
endTime
);
result
=
depotItemMapperEx
.
inOrOutRetailPrice
(
type
,
subType
,
beginTime
,
endTime
,
creatorArray
);
result
=
result
.
abs
();
result
=
result
.
abs
();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml
View file @
9a496ffa
...
@@ -721,6 +721,13 @@
...
@@ -721,6 +721,13 @@
<if
test=
"endTime != null"
>
<if
test=
"endTime != null"
>
and oper_time
<
= #{endTime}
and oper_time
<
= #{endTime}
</if>
</if>
<if
test=
"creatorArray != null"
>
and creator in (
<foreach
collection=
"creatorArray"
item=
"creator"
separator=
","
>
#{creator}
</foreach>
)
</if>
and ifnull(delete_flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
</select>
...
@@ -741,6 +748,13 @@
...
@@ -741,6 +748,13 @@
<if
test=
"endTime != null"
>
<if
test=
"endTime != null"
>
and oper_time
<
= #{endTime}
and oper_time
<
= #{endTime}
</if>
</if>
<if
test=
"creatorArray != null"
>
and creator in (
<foreach
collection=
"creatorArray"
item=
"creator"
separator=
","
>
#{creator}
</foreach>
)
</if>
and ifnull(delete_flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
</select>
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
9a496ffa
...
@@ -378,16 +378,30 @@
...
@@ -378,16 +378,30 @@
and dh.type=#{type} and dh.sub_type=#{subType}
and dh.type=#{type} and dh.sub_type=#{subType}
and dh.oper_time
>
= #{beginTime}
and dh.oper_time
>
= #{beginTime}
and dh.oper_time
<
= #{endTime}
and dh.oper_time
<
= #{endTime}
<if
test=
"creatorArray != null"
>
and dh.creator in (
<foreach
collection=
"creatorArray"
item=
"creator"
separator=
","
>
#{creator}
</foreach>
)
</if>
and ifnull(dh.delete_flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
</select>
</select>
<select
id=
"inOrOutRetailPrice"
resultType=
"java.math.BigDecimal"
>
<select
id=
"inOrOutRetailPrice"
resultType=
"java.math.BigDecimal"
>
select ifnull(sum(total_price),0) as allMoney from jsh_depot_head dh
select ifnull(sum(total_price),0) as allMoney from jsh_depot_head dh
where 1=1
where 1=1
and dh.type=#{type} and dh.sub_type=#{subType}
and dh.type=#{type} and dh.sub_type=#{subType}
and dh.oper_time
>
= #{beginTime}
and dh.oper_time
>
= #{beginTime}
and dh.oper_time
<
= #{endTime}
and dh.oper_time
<
= #{endTime}
and ifnull(dh.delete_flag,'0') !='1'
<if
test=
"creatorArray != null"
>
and dh.creator in (
<foreach
collection=
"creatorArray"
item=
"creator"
separator=
","
>
#{creator}
</foreach>
)
</if>
and ifnull(dh.delete_flag,'0') !='1'
</select>
</select>
<select
id=
"getStockCheckSumByDepotList"
resultType=
"java.math.BigDecimal"
>
<select
id=
"getStockCheckSumByDepotList"
resultType=
"java.math.BigDecimal"
>
...
...
Write
Preview
Supports
Markdown
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