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
f04dcd22
Commit
f04dcd22
authored
Jun 08, 2021
by
季圣华
Browse files
1、解决组织递归bug,2、解决月份最后一天bug
parent
b156971b
Changes
4
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
View file @
f04dcd22
...
...
@@ -53,20 +53,23 @@ public interface DepotItemMapperEx {
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"MId"
)
Long
MId
,
@Param
(
"MonthTime"
)
String
MonthTime
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"sumType"
)
String
sumType
);
BigDecimal
buyOrSalePrice
(
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"MId"
)
Long
MId
,
@Param
(
"MonthTime"
)
String
MonthTime
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"sumType"
)
String
sumType
);
BigDecimal
inOrOutPrice
(
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"MonthTime"
)
String
MonthTime
);
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
BigDecimal
getStockCheckSum
(
@Param
(
"depotId"
)
Long
depotId
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
f04dcd22
...
...
@@ -18,6 +18,7 @@ import com.jsh.erp.service.systemConfig.SystemConfigService;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.utils.QueryUtils
;
import
com.jsh.erp.utils.StringUtil
;
import
com.jsh.erp.utils.Tools
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
...
...
@@ -259,13 +260,15 @@ public class DepotItemService {
return
result
;
}
public
BigDecimal
buyOrSale
(
String
type
,
String
subType
,
Long
MId
,
String
M
onthTime
,
String
sumType
)
throws
Exception
{
public
BigDecimal
buyOrSale
(
String
type
,
String
subType
,
Long
MId
,
String
m
onthTime
,
String
sumType
)
throws
Exception
{
BigDecimal
result
=
BigDecimal
.
ZERO
;
try
{
String
beginTime
=
monthTime
+
"-01 00:00:00"
;
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)
+
" 23:59:59"
;
if
(
SUM_TYPE
.
equals
(
sumType
))
{
result
=
depotItemMapperEx
.
buyOrSaleNumber
(
type
,
subType
,
MId
,
Month
Time
,
sumType
);
result
=
depotItemMapperEx
.
buyOrSaleNumber
(
type
,
subType
,
MId
,
beginTime
,
end
Time
,
sumType
);
}
else
{
result
=
depotItemMapperEx
.
buyOrSalePrice
(
type
,
subType
,
MId
,
Month
Time
,
sumType
);
result
=
depotItemMapperEx
.
buyOrSalePrice
(
type
,
subType
,
MId
,
beginTime
,
end
Time
,
sumType
);
}
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
...
...
@@ -278,14 +281,16 @@ public class DepotItemService {
* 统计采购或销售的总金额
* @param type
* @param subType
* @param
M
onth
Time
* @param
m
onth
* @return
* @throws Exception
*/
public
BigDecimal
inOrOutPrice
(
String
type
,
String
subType
,
String
M
onth
Time
)
throws
Exception
{
public
BigDecimal
inOrOutPrice
(
String
type
,
String
subType
,
String
m
onth
)
throws
Exception
{
BigDecimal
result
=
BigDecimal
.
ZERO
;
try
{
result
=
depotItemMapperEx
.
inOrOutPrice
(
type
,
subType
,
MonthTime
);
String
beginTime
=
month
+
"-01 00:00:00"
;
String
endTime
=
Tools
.
lastDayOfMonth
(
month
)
+
" 23:59:59"
;
result
=
depotItemMapperEx
.
inOrOutPrice
(
type
,
subType
,
beginTime
,
endTime
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationService.java
View file @
f04dcd22
...
...
@@ -275,7 +275,7 @@ public class OrganizationService {
* @return
*/
public
List
<
Long
>
getOrgIdByParentId
(
Long
orgId
)
{
List
<
Long
>
idList
=
new
ArrayList
<
Long
>();
List
<
Long
>
idList
=
new
ArrayList
<>();
OrganizationExample
example
=
new
OrganizationExample
();
example
.
createCriteria
().
andIdEqualTo
(
orgId
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
Organization
>
orgList
=
organizationMapper
.
selectByExample
(
example
);
...
...
@@ -292,9 +292,8 @@ public class OrganizationService {
* @return
*/
public
void
getOrgIdByParentNo
(
List
<
Long
>
idList
,
Long
id
)
{
List
<
Long
>
list
=
new
ArrayList
<
Long
>();
OrganizationExample
example
=
new
OrganizationExample
();
example
.
createCriteria
().
andParentId
Not
EqualTo
(
id
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
createCriteria
().
andParentIdEqualTo
(
id
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
Organization
>
orgList
=
organizationMapper
.
selectByExample
(
example
);
if
(
orgList
!=
null
&&
orgList
.
size
()>
0
)
{
for
(
Organization
o:
orgList
)
{
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
f04dcd22
...
...
@@ -212,8 +212,8 @@
where di.header_id = dh.id
and dh.type='${type}' and dh.sub_type='${subType}'
and di.material_id =${MId}
and dh.oper_time
>
=
'${MonthTime}-01 00:00:00'
and dh.oper_time
<
=
'${MonthTime}-31 23:59:59'
and dh.oper_time
>
=
#{beginTime}
and dh.oper_time
<
=
#{endTime}
and ifnull(dh.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
</select>
...
...
@@ -223,8 +223,8 @@
where di.header_id = dh.id
and dh.type='${type}' and dh.sub_type='${subType}'
and di.material_id =${MId}
and dh.oper_time
>
=
'${MonthTime}-01 00:00:00'
and dh.oper_time
<
=
'${MonthTime}-31 23:59:59'
and dh.oper_time
>
=
#{beginTime}
and dh.oper_time
<
=
#{endTime}
and ifnull(dh.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
</select>
...
...
@@ -233,8 +233,8 @@
select ifnull(sum(discount_last_money),0) as allMoney from jsh_depot_head dh
where 1=1
and dh.type='${type}' and dh.sub_type='${subType}'
and dh.oper_time
>
=
'${MonthTime}-01 00:00:00'
and dh.oper_time
<
=
'${MonthTime}-31 23:59:59'
and dh.oper_time
>
=
#{beginTime}
and dh.oper_time
<
=
#{endTime}
and ifnull(dh.delete_flag,'0') !='1'
</select>
...
...
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