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
c0a3a6a0
Commit
c0a3a6a0
authored
Nov 21, 2022
by
季圣华
Browse files
给收付款单增加销售采购单号的接口查询
parent
2bdfc18c
Changes
5
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/AccountHeadMapperEx.java
View file @
c0a3a6a0
...
...
@@ -23,6 +23,7 @@ public interface AccountHeadMapperEx {
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"status"
)
String
status
,
@Param
(
"remark"
)
String
remark
,
@Param
(
"ahIdList"
)
List
<
Long
>
ahIdList
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"rows"
)
Integer
rows
);
...
...
@@ -37,7 +38,8 @@ public interface AccountHeadMapperEx {
@Param
(
"handsPersonId"
)
Long
handsPersonId
,
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"status"
)
String
status
,
@Param
(
"remark"
)
String
remark
);
@Param
(
"remark"
)
String
remark
,
@Param
(
"ahIdList"
)
List
<
Long
>
ahIdList
);
BigDecimal
findAllMoney
(
@Param
(
"supplierId"
)
Integer
supplierId
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadComponent.java
View file @
c0a3a6a0
...
...
@@ -42,8 +42,9 @@ public class AccountHeadComponent implements ICommonQuery {
Long
accountId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"accountId"
));
String
status
=
StringUtil
.
getInfo
(
search
,
"status"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
return
accountHeadService
.
select
(
type
,
roleType
,
billNo
,
beginTime
,
endTime
,
organId
,
creator
,
handsPersonId
,
accountId
,
status
,
remark
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
accountId
,
status
,
remark
,
number
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
}
@Override
...
...
@@ -60,8 +61,9 @@ public class AccountHeadComponent implements ICommonQuery {
Long
accountId
=
StringUtil
.
parseStrLong
(
StringUtil
.
getInfo
(
search
,
"accountId"
));
String
status
=
StringUtil
.
getInfo
(
search
,
"status"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
number
=
StringUtil
.
getInfo
(
search
,
"number"
);
return
accountHeadService
.
countAccountHead
(
type
,
roleType
,
billNo
,
beginTime
,
endTime
,
organId
,
creator
,
handsPersonId
,
accountId
,
status
,
remark
);
accountId
,
status
,
remark
,
number
);
}
@Override
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java
View file @
c0a3a6a0
...
...
@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.exception.JshException
;
import
com.jsh.erp.service.accountItem.AccountItemService
;
import
com.jsh.erp.service.depotHead.DepotHeadService
;
import
com.jsh.erp.service.log.LogService
;
import
com.jsh.erp.service.orgaUserRel.OrgaUserRelService
;
import
com.jsh.erp.service.supplier.SupplierService
;
...
...
@@ -44,6 +45,8 @@ public class AccountHeadService {
@Resource
private
AccountItemService
accountItemService
;
@Resource
private
DepotHeadService
depotHeadService
;
@Resource
private
UserService
userService
;
@Resource
private
SupplierService
supplierService
;
...
...
@@ -88,14 +91,15 @@ public class AccountHeadService {
public
List
<
AccountHeadVo4ListEx
>
select
(
String
type
,
String
roleType
,
String
billNo
,
String
beginTime
,
String
endTime
,
Long
organId
,
Long
creator
,
Long
handsPersonId
,
Long
accountId
,
String
status
,
String
remark
,
int
offset
,
int
rows
)
throws
Exception
{
String
remark
,
String
number
,
int
offset
,
int
rows
)
throws
Exception
{
List
<
AccountHeadVo4ListEx
>
resList
=
new
ArrayList
<>();
try
{
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
,
offset
,
rows
);
beginTime
,
endTime
,
organId
,
creator
,
handsPersonId
,
accountId
,
status
,
remark
,
ahIdList
,
offset
,
rows
);
if
(
null
!=
list
)
{
for
(
AccountHeadVo4ListEx
ah
:
list
)
{
if
(
ah
.
getChangeAmount
()
!=
null
)
{
...
...
@@ -118,14 +122,15 @@ public class AccountHeadService {
public
Long
countAccountHead
(
String
type
,
String
roleType
,
String
billNo
,
String
beginTime
,
String
endTime
,
Long
organId
,
Long
creator
,
Long
handsPersonId
,
Long
accountId
,
String
status
,
String
remark
)
throws
Exception
{
String
remark
,
String
number
)
throws
Exception
{
Long
result
=
null
;
try
{
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
);
beginTime
,
endTime
,
organId
,
creator
,
handsPersonId
,
accountId
,
status
,
remark
,
ahIdList
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java
View file @
c0a3a6a0
...
...
@@ -6,6 +6,7 @@ import com.jsh.erp.constants.BusinessConstants;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.AccountItem
;
import
com.jsh.erp.datasource.entities.AccountItemExample
;
import
com.jsh.erp.datasource.entities.DepotHead
;
import
com.jsh.erp.datasource.entities.User
;
import
com.jsh.erp.datasource.mappers.AccountItemMapper
;
import
com.jsh.erp.datasource.mappers.AccountItemMapperEx
;
...
...
@@ -26,6 +27,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -259,4 +261,29 @@ 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 @
c0a3a6a0
...
...
@@ -56,6 +56,12 @@
<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>
and ifnull(ah.delete_flag,'0') !='1'
order by ah.id desc
<if
test=
"offset != null and rows != null"
>
...
...
@@ -108,6 +114,12 @@
<bind
name=
"bindRemark"
value=
"'%'+remark+'%'"
/>
and 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>
and ifnull(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