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
8f00b2c9
Commit
8f00b2c9
authored
May 29, 2022
by
季圣华
Browse files
解决BUG:采购订单选择销售订单的时候状态没有筛选
parent
5e536d7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java
View file @
8f00b2c9
...
@@ -23,6 +23,7 @@ public interface DepotHeadMapperEx {
...
@@ -23,6 +23,7 @@ public interface DepotHeadMapperEx {
@Param
(
"subType"
)
String
subType
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"creatorArray"
)
String
[]
creatorArray
,
@Param
(
"creatorArray"
)
String
[]
creatorArray
,
@Param
(
"statusArray"
)
String
[]
statusArray
,
@Param
(
"statusArray"
)
String
[]
statusArray
,
@Param
(
"purchaseStatusArray"
)
String
[]
purchaseStatusArray
,
@Param
(
"number"
)
String
number
,
@Param
(
"number"
)
String
number
,
@Param
(
"linkNumber"
)
String
linkNumber
,
@Param
(
"linkNumber"
)
String
linkNumber
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"beginTime"
)
String
beginTime
,
...
@@ -42,6 +43,7 @@ public interface DepotHeadMapperEx {
...
@@ -42,6 +43,7 @@ public interface DepotHeadMapperEx {
@Param
(
"subType"
)
String
subType
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"creatorArray"
)
String
[]
creatorArray
,
@Param
(
"creatorArray"
)
String
[]
creatorArray
,
@Param
(
"statusArray"
)
String
[]
statusArray
,
@Param
(
"statusArray"
)
String
[]
statusArray
,
@Param
(
"purchaseStatusArray"
)
String
[]
purchaseStatusArray
,
@Param
(
"number"
)
String
number
,
@Param
(
"number"
)
String
number
,
@Param
(
"linkNumber"
)
String
linkNumber
,
@Param
(
"linkNumber"
)
String
linkNumber
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"beginTime"
)
String
beginTime
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadComponent.java
View file @
8f00b2c9
...
@@ -35,6 +35,7 @@ public class DepotHeadComponent implements ICommonQuery {
...
@@ -35,6 +35,7 @@ public class DepotHeadComponent implements ICommonQuery {
String
subType
=
StringUtil
.
getInfo
(
search
,
"subType"
);
String
subType
=
StringUtil
.
getInfo
(
search
,
"subType"
);
String
roleType
=
StringUtil
.
getInfo
(
search
,
"roleType"
);
String
roleType
=
StringUtil
.
getInfo
(
search
,
"roleType"
);
String
status
=
StringUtil
.
getInfo
(
search
,
"status"
);
String
status
=
StringUtil
.
getInfo
(
search
,
"status"
);
String
purchaseStatus
=
StringUtil
.
getInfo
(
search
,
"purchaseStatus"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
String
linkNumber
=
StringUtil
.
getInfo
(
search
,
"linkNumber"
);
String
linkNumber
=
StringUtil
.
getInfo
(
search
,
"linkNumber"
);
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
...
@@ -45,7 +46,7 @@ public class DepotHeadComponent implements ICommonQuery {
...
@@ -45,7 +46,7 @@ public class DepotHeadComponent implements ICommonQuery {
Long
depotId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"depotId"
));
Long
depotId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"depotId"
));
Long
accountId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"accountId"
));
Long
accountId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"accountId"
));
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
return
depotHeadService
.
select
(
type
,
subType
,
roleType
,
status
,
number
,
linkNumber
,
beginTime
,
endTime
,
materialParam
,
return
depotHeadService
.
select
(
type
,
subType
,
roleType
,
status
,
purchaseStatus
,
number
,
linkNumber
,
beginTime
,
endTime
,
materialParam
,
organId
,
creator
,
depotId
,
accountId
,
remark
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
organId
,
creator
,
depotId
,
accountId
,
remark
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
}
}
...
@@ -56,6 +57,7 @@ public class DepotHeadComponent implements ICommonQuery {
...
@@ -56,6 +57,7 @@ public class DepotHeadComponent implements ICommonQuery {
String
subType
=
StringUtil
.
getInfo
(
search
,
"subType"
);
String
subType
=
StringUtil
.
getInfo
(
search
,
"subType"
);
String
roleType
=
StringUtil
.
getInfo
(
search
,
"roleType"
);
String
roleType
=
StringUtil
.
getInfo
(
search
,
"roleType"
);
String
status
=
StringUtil
.
getInfo
(
search
,
"status"
);
String
status
=
StringUtil
.
getInfo
(
search
,
"status"
);
String
purchaseStatus
=
StringUtil
.
getInfo
(
search
,
"purchaseStatus"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
String
linkNumber
=
StringUtil
.
getInfo
(
search
,
"linkNumber"
);
String
linkNumber
=
StringUtil
.
getInfo
(
search
,
"linkNumber"
);
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
String
beginTime
=
StringUtil
.
getInfo
(
search
,
"beginTime"
);
...
@@ -66,7 +68,7 @@ public class DepotHeadComponent implements ICommonQuery {
...
@@ -66,7 +68,7 @@ public class DepotHeadComponent implements ICommonQuery {
Long
depotId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"depotId"
));
Long
depotId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"depotId"
));
Long
accountId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"accountId"
));
Long
accountId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"accountId"
));
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
return
depotHeadService
.
countDepotHead
(
type
,
subType
,
roleType
,
status
,
number
,
linkNumber
,
beginTime
,
endTime
,
materialParam
,
return
depotHeadService
.
countDepotHead
(
type
,
subType
,
roleType
,
status
,
purchaseStatus
,
number
,
linkNumber
,
beginTime
,
endTime
,
materialParam
,
organId
,
creator
,
depotId
,
accountId
,
remark
);
organId
,
creator
,
depotId
,
accountId
,
remark
);
}
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
8f00b2c9
...
@@ -98,7 +98,7 @@ public class DepotHeadService {
...
@@ -98,7 +98,7 @@ public class DepotHeadService {
return
list
;
return
list
;
}
}
public
List
<
DepotHeadVo4List
>
select
(
String
type
,
String
subType
,
String
roleType
,
String
status
,
String
number
,
String
linkNumber
,
public
List
<
DepotHeadVo4List
>
select
(
String
type
,
String
subType
,
String
roleType
,
String
status
,
String
purchaseStatus
,
String
number
,
String
linkNumber
,
String
beginTime
,
String
endTime
,
String
materialParam
,
Long
organId
,
Long
creator
,
Long
depotId
,
Long
accountId
,
String
remark
,
int
offset
,
int
rows
)
throws
Exception
{
String
beginTime
,
String
endTime
,
String
materialParam
,
Long
organId
,
Long
creator
,
Long
depotId
,
Long
accountId
,
String
remark
,
int
offset
,
int
rows
)
throws
Exception
{
List
<
DepotHeadVo4List
>
resList
=
new
ArrayList
<>();
List
<
DepotHeadVo4List
>
resList
=
new
ArrayList
<>();
List
<
DepotHeadVo4List
>
list
=
new
ArrayList
<>();
List
<
DepotHeadVo4List
>
list
=
new
ArrayList
<>();
...
@@ -106,11 +106,12 @@ public class DepotHeadService {
...
@@ -106,11 +106,12 @@ public class DepotHeadService {
String
[]
depotArray
=
getDepotArray
(
subType
);
String
[]
depotArray
=
getDepotArray
(
subType
);
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
String
[]
statusArray
=
StringUtil
.
isNotEmpty
(
status
)
?
status
.
split
(
","
)
:
null
;
String
[]
statusArray
=
StringUtil
.
isNotEmpty
(
status
)
?
status
.
split
(
","
)
:
null
;
String
[]
purchaseStatusArray
=
StringUtil
.
isNotEmpty
(
purchaseStatus
)
?
purchaseStatus
.
split
(
","
)
:
null
;
Map
<
Long
,
String
>
personMap
=
personService
.
getPersonMap
();
Map
<
Long
,
String
>
personMap
=
personService
.
getPersonMap
();
Map
<
Long
,
String
>
accountMap
=
accountService
.
getAccountMap
();
Map
<
Long
,
String
>
accountMap
=
accountService
.
getAccountMap
();
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
list
=
depotHeadMapperEx
.
selectByConditionDepotHead
(
type
,
subType
,
creatorArray
,
statusArray
,
number
,
linkNumber
,
beginTime
,
endTime
,
list
=
depotHeadMapperEx
.
selectByConditionDepotHead
(
type
,
subType
,
creatorArray
,
statusArray
,
purchaseStatusArray
,
number
,
linkNumber
,
beginTime
,
endTime
,
materialParam
,
organId
,
creator
,
depotId
,
depotArray
,
accountId
,
remark
,
offset
,
rows
);
materialParam
,
organId
,
creator
,
depotId
,
depotArray
,
accountId
,
remark
,
offset
,
rows
);
if
(
null
!=
list
)
{
if
(
null
!=
list
)
{
for
(
DepotHeadVo4List
dh
:
list
)
{
for
(
DepotHeadVo4List
dh
:
list
)
{
...
@@ -152,16 +153,17 @@ public class DepotHeadService {
...
@@ -152,16 +153,17 @@ public class DepotHeadService {
return
resList
;
return
resList
;
}
}
public
Long
countDepotHead
(
String
type
,
String
subType
,
String
roleType
,
String
status
,
String
number
,
String
linkNumber
,
public
Long
countDepotHead
(
String
type
,
String
subType
,
String
roleType
,
String
status
,
String
purchaseStatus
,
String
number
,
String
linkNumber
,
String
beginTime
,
String
endTime
,
String
materialParam
,
Long
organId
,
Long
creator
,
Long
depotId
,
Long
accountId
,
String
remark
)
throws
Exception
{
String
beginTime
,
String
endTime
,
String
materialParam
,
Long
organId
,
Long
creator
,
Long
depotId
,
Long
accountId
,
String
remark
)
throws
Exception
{
Long
result
=
null
;
Long
result
=
null
;
try
{
try
{
String
[]
depotArray
=
getDepotArray
(
subType
);
String
[]
depotArray
=
getDepotArray
(
subType
);
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
String
[]
statusArray
=
StringUtil
.
isNotEmpty
(
status
)
?
status
.
split
(
","
)
:
null
;
String
[]
statusArray
=
StringUtil
.
isNotEmpty
(
status
)
?
status
.
split
(
","
)
:
null
;
String
[]
purchaseStatusArray
=
StringUtil
.
isNotEmpty
(
purchaseStatus
)
?
purchaseStatus
.
split
(
","
)
:
null
;
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
result
=
depotHeadMapperEx
.
countsByDepotHead
(
type
,
subType
,
creatorArray
,
statusArray
,
number
,
linkNumber
,
beginTime
,
endTime
,
result
=
depotHeadMapperEx
.
countsByDepotHead
(
type
,
subType
,
creatorArray
,
statusArray
,
purchaseStatusArray
,
number
,
linkNumber
,
beginTime
,
endTime
,
materialParam
,
organId
,
creator
,
depotId
,
depotArray
,
accountId
,
remark
);
materialParam
,
organId
,
creator
,
depotId
,
depotArray
,
accountId
,
remark
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
...
@@ -750,10 +752,13 @@ public class DepotHeadService {
...
@@ -750,10 +752,13 @@ public class DepotHeadService {
if
(
depotHead
.
getDeposit
()!=
null
&&
StringUtil
.
isNotEmpty
(
depotHead
.
getLinkNumber
()))
{
if
(
depotHead
.
getDeposit
()!=
null
&&
StringUtil
.
isNotEmpty
(
depotHead
.
getLinkNumber
()))
{
BigDecimal
finishDeposit
=
depotHeadMapperEx
.
getFinishDepositByNumberExceptCurrent
(
depotHead
.
getLinkNumber
(),
depotHead
.
getNumber
());
BigDecimal
finishDeposit
=
depotHeadMapperEx
.
getFinishDepositByNumberExceptCurrent
(
depotHead
.
getLinkNumber
(),
depotHead
.
getNumber
());
//订单中的订金金额
//订单中的订金金额
BigDecimal
preDeposit
=
getDepotHead
(
depotHead
.
getLinkNumber
()).
getChangeAmount
().
abs
();
BigDecimal
changeAmount
=
getDepotHead
(
depotHead
.
getLinkNumber
()).
getChangeAmount
();
if
(
depotHead
.
getDeposit
().
add
(
finishDeposit
).
compareTo
(
preDeposit
)>
0
)
{
if
(
changeAmount
!=
null
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE
,
BigDecimal
preDeposit
=
changeAmount
.
abs
();
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG
));
if
(
depotHead
.
getDeposit
().
add
(
finishDeposit
).
compareTo
(
preDeposit
)>
0
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG
));
}
}
}
}
}
try
{
try
{
...
@@ -833,10 +838,13 @@ public class DepotHeadService {
...
@@ -833,10 +838,13 @@ public class DepotHeadService {
if
(
depotHead
.
getDeposit
()!=
null
&&
StringUtil
.
isNotEmpty
(
depotHead
.
getLinkNumber
()))
{
if
(
depotHead
.
getDeposit
()!=
null
&&
StringUtil
.
isNotEmpty
(
depotHead
.
getLinkNumber
()))
{
BigDecimal
finishDeposit
=
depotHeadMapperEx
.
getFinishDepositByNumberExceptCurrent
(
depotHead
.
getLinkNumber
(),
depotHead
.
getNumber
());
BigDecimal
finishDeposit
=
depotHeadMapperEx
.
getFinishDepositByNumberExceptCurrent
(
depotHead
.
getLinkNumber
(),
depotHead
.
getNumber
());
//订单中的订金金额
//订单中的订金金额
BigDecimal
preDeposit
=
getDepotHead
(
depotHead
.
getLinkNumber
()).
getChangeAmount
().
abs
();
BigDecimal
changeAmount
=
getDepotHead
(
depotHead
.
getLinkNumber
()).
getChangeAmount
();
if
(
depotHead
.
getDeposit
().
add
(
finishDeposit
).
compareTo
(
preDeposit
)>
0
)
{
if
(
changeAmount
!=
null
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE
,
BigDecimal
preDeposit
=
changeAmount
.
abs
();
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG
));
if
(
depotHead
.
getDeposit
().
add
(
finishDeposit
).
compareTo
(
preDeposit
)>
0
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG
));
}
}
}
}
}
try
{
try
{
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml
View file @
8f00b2c9
...
@@ -72,6 +72,13 @@
...
@@ -72,6 +72,13 @@
</foreach>
</foreach>
)
)
</if>
</if>
<if
test=
"purchaseStatusArray != null and purchaseStatusArray !=''"
>
and dh.purchase_status in (
<foreach
collection=
"purchaseStatusArray"
item=
"purchaseStatus"
separator=
","
>
#{purchaseStatus}
</foreach>
)
</if>
<if
test=
"number != null"
>
<if
test=
"number != null"
>
<bind
name=
"bindNumber"
value=
"'%'+number+'%'"
/>
<bind
name=
"bindNumber"
value=
"'%'+number+'%'"
/>
and dh.number like #{bindNumber}
and dh.number like #{bindNumber}
...
@@ -148,6 +155,13 @@
...
@@ -148,6 +155,13 @@
</foreach>
</foreach>
)
)
</if>
</if>
<if
test=
"purchaseStatusArray != null and purchaseStatusArray !=''"
>
and dh.purchase_status in (
<foreach
collection=
"purchaseStatusArray"
item=
"purchaseStatus"
separator=
","
>
#{purchaseStatus}
</foreach>
)
</if>
<if
test=
"number != null"
>
<if
test=
"number != null"
>
<bind
name=
"bindNumber"
value=
"'%'+number+'%'"
/>
<bind
name=
"bindNumber"
value=
"'%'+number+'%'"
/>
and dh.number like #{bindNumber}
and dh.number like #{bindNumber}
...
...
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