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
76bcf58e
Commit
76bcf58e
authored
Nov 21, 2022
by
季圣华
Browse files
优化收付款单的查询
parent
60fc7b8d
Changes
4
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/AccountHeadMapperEx.java
View file @
76bcf58e
...
...
@@ -23,7 +23,7 @@ public interface AccountHeadMapperEx {
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"status"
)
String
status
,
@Param
(
"remark"
)
String
remark
,
@Param
(
"
ahIdList"
)
List
<
Long
>
ahIdList
,
@Param
(
"
number"
)
String
number
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"rows"
)
Integer
rows
);
...
...
@@ -39,7 +39,7 @@ public interface AccountHeadMapperEx {
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"status"
)
String
status
,
@Param
(
"remark"
)
String
remark
,
@Param
(
"
ahIdList"
)
List
<
Long
>
ahIdList
);
@Param
(
"
number"
)
String
number
);
BigDecimal
findAllMoney
(
@Param
(
"supplierId"
)
Integer
supplierId
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java
View file @
76bcf58e
...
...
@@ -97,9 +97,8 @@ public class AccountHeadService {
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
List
<
Long
>
ahIdList
=
accountItemService
.
getAhIdListByBillNumber
(
number
);
List
<
AccountHeadVo4ListEx
>
list
=
accountHeadMapperEx
.
selectByConditionAccountHead
(
type
,
creatorArray
,
billNo
,
beginTime
,
endTime
,
organId
,
creator
,
handsPersonId
,
accountId
,
status
,
remark
,
ahIdList
,
offset
,
rows
);
beginTime
,
endTime
,
organId
,
creator
,
handsPersonId
,
accountId
,
status
,
remark
,
number
,
offset
,
rows
);
if
(
null
!=
list
)
{
for
(
AccountHeadVo4ListEx
ah
:
list
)
{
if
(
ah
.
getChangeAmount
()
!=
null
)
{
...
...
@@ -128,9 +127,8 @@ public class AccountHeadService {
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
List
<
Long
>
ahIdList
=
accountItemService
.
getAhIdListByBillNumber
(
number
);
result
=
accountHeadMapperEx
.
countsByAccountHead
(
type
,
creatorArray
,
billNo
,
beginTime
,
endTime
,
organId
,
creator
,
handsPersonId
,
accountId
,
status
,
remark
,
ahIdList
);
beginTime
,
endTime
,
organId
,
creator
,
handsPersonId
,
accountId
,
status
,
remark
,
number
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java
View file @
76bcf58e
...
...
@@ -261,29 +261,4 @@ public class AccountItemService {
public
BigDecimal
getEachAmountByBillId
(
Long
billId
)
{
return
accountItemMapperEx
.
getEachAmountByBillId
(
billId
).
abs
();
}
public
List
<
Long
>
getAhIdListByBillNumber
(
String
number
)
throws
Exception
{
if
(
StringUtil
.
isNotEmpty
(
number
))
{
DepotHead
depotHead
=
depotHeadService
.
getDepotHead
(
number
);
if
(
depotHead
.
getId
()!=
null
)
{
List
<
Long
>
ahIdList
=
new
ArrayList
<>();
AccountItemExample
example
=
new
AccountItemExample
();
example
.
createCriteria
().
andBillIdEqualTo
(
depotHead
.
getId
()).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
AccountItem
>
list
=
accountItemMapper
.
selectByExample
(
example
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AccountItem
accountItem:
list
)
{
ahIdList
.
add
(
accountItem
.
getHeaderId
());
}
return
ahIdList
;
}
else
{
return
null
;
}
}
else
{
return
null
;
}
}
else
{
return
null
;
}
}
}
jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapperEx.xml
View file @
76bcf58e
...
...
@@ -12,6 +12,8 @@
<select
id=
"selectByConditionAccountHead"
parameterType=
"com.jsh.erp.datasource.entities.AccountHeadExample"
resultMap=
"ResultMapEx"
>
select ah.*, s.supplier OrganName, p.Name HandsPersonName, u.username userName, a.Name AccountName
from jsh_account_head ah
left join jsh_account_item ai on ah.id=ai.header_id and ifnull(ai.delete_flag,'0') !='1'
left join jsh_depot_head dh on dh.id=ai.bill_id and ifnull(dh.delete_flag,'0') !='1'
left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_user u on ah.creator=u.id and ifnull(u.Status,'0') !='1'
left join jsh_person p on ah.hands_person_id=p.id and ifnull(p.delete_Flag,'0') !='1'
...
...
@@ -56,11 +58,9 @@
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and ah.remark like #{bindRemark}
</if>
<if
test=
"ahIdList!=null and ahIdList.size()>0"
>
and ah.id in
<foreach
collection=
"ahIdList"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
<if
test=
"number != null and number !=''"
>
<bind
name=
"bindNumber"
value=
"'%'+number+'%'"
/>
and dh.number like #{bindNumber}
</if>
and ifnull(ah.delete_flag,'0') !='1'
order by ah.id desc
...
...
@@ -72,55 +72,55 @@
<select
id=
"countsByAccountHead"
resultType=
"java.lang.Long"
>
SELECT
COUNT(id)
FROM jsh_account_head
COUNT(ah.id)
FROM jsh_account_head ah
left join jsh_account_item ai on ah.id=ai.header_id and ifnull(ai.delete_flag,'0') !='1'
left join jsh_depot_head dh on dh.id=ai.bill_id and ifnull(dh.delete_flag,'0') !='1'
WHERE 1=1
<if
test=
"billNo != null"
>
<bind
name=
"bindBillNo"
value=
"'%'+billNo+'%'"
/>
and bill_no like #{bindBillNo}
and
ah.
bill_no like #{bindBillNo}
</if>
<if
test=
"type != null"
>
and type=#{type}
and
ah.
type=#{type}
</if>
<if
test=
"beginTime != null"
>
and bill_time
>
= #{beginTime}
and
ah.
bill_time
>
= #{beginTime}
</if>
<if
test=
"endTime != null"
>
and bill_time
<
= #{endTime}
and
ah.
bill_time
<
= #{endTime}
</if>
<if
test=
"organId != null"
>
and organ_id=#{organId}
and
ah.
organ_id=#{organId}
</if>
<if
test=
"handsPersonId != null"
>
and hands_person_id=#{handsPersonId}
and
ah.
hands_person_id=#{handsPersonId}
</if>
<if
test=
"creator != null"
>
and creator=#{creator}
and
ah.
creator=#{creator}
</if>
<if
test=
"creatorArray != null"
>
and creator in (
and
ah.
creator in (
<foreach
collection=
"creatorArray"
item=
"creator"
separator=
","
>
#{creator}
</foreach>
)
</if>
<if
test=
"accountId != null"
>
and account_id=#{accountId}
and
ah.
account_id=#{accountId}
</if>
<if
test=
"status != null and status != ''"
>
and status=#{status}
and
ah.
status=#{status}
</if>
<if
test=
"remark != null and remark !=''"
>
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and remark like #{bindRemark}
and
ah.
remark like #{bindRemark}
</if>
<if
test=
"ahIdList!=null and ahIdList.size()>0"
>
and id in
<foreach
collection=
"ahIdList"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
<if
test=
"number != null and number !=''"
>
<bind
name=
"bindNumber"
value=
"'%'+number+'%'"
/>
and dh.number like #{bindNumber}
</if>
and ifnull(delete_flag,'0') !='1'
and ifnull(
ah.
delete_flag,'0') !='1'
</select>
<select
id=
"findAllMoney"
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