给财务单据增加查询条件

This commit is contained in:
季圣华
2021-07-15 23:11:39 +08:00
parent 6a4b4e27be
commit 9fadc1e063
4 changed files with 39 additions and 8 deletions

View File

@@ -17,6 +17,9 @@ public interface AccountHeadMapperEx {
@Param("billNo") String billNo,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime,
@Param("organId") Long organId,
@Param("creator") Long creator,
@Param("handsPersonId") Long handsPersonId,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
@@ -25,7 +28,10 @@ public interface AccountHeadMapperEx {
@Param("creatorArray") String[] creatorArray,
@Param("billNo") String billNo,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime);
@Param("endTime") String endTime,
@Param("organId") Long organId,
@Param("creator") Long creator,
@Param("handsPersonId") Long handsPersonId);
BigDecimal findAllMoney(
@Param("supplierId") Integer supplierId,

View File

@@ -36,8 +36,10 @@ public class AccountHeadComponent implements ICommonQuery {
String billNo = StringUtil.getInfo(search, "billNo");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String order = QueryUtils.order(map);
return accountHeadService.select(type, roleType, billNo, beginTime, endTime, QueryUtils.offset(map), QueryUtils.rows(map));
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId"));
return accountHeadService.select(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
@@ -48,7 +50,10 @@ public class AccountHeadComponent implements ICommonQuery {
String billNo = StringUtil.getInfo(search, "billNo");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
return accountHeadService.countAccountHead(type, roleType, billNo, beginTime, endTime);
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId"));
return accountHeadService.countAccountHead(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId);
}
@Override

View File

@@ -87,13 +87,14 @@ public class AccountHeadService {
return list;
}
public List<AccountHeadVo4ListEx> select(String type, String roleType, String billNo, String beginTime, String endTime, int offset, int rows) throws Exception{
public List<AccountHeadVo4ListEx> select(String type, String roleType, String billNo, String beginTime, String endTime,
Long organId, Long creator, Long handsPersonId, 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<AccountHeadVo4ListEx> list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo, beginTime, endTime, offset, rows);
List<AccountHeadVo4ListEx> list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo, beginTime, endTime, organId, creator, handsPersonId, offset, rows);
if (null != list) {
for (AccountHeadVo4ListEx ah : list) {
if(ah.getChangeAmount() != null) {
@@ -114,13 +115,14 @@ public class AccountHeadService {
return resList;
}
public Long countAccountHead(String type, String roleType, String billNo, String beginTime, String endTime) throws Exception{
public Long countAccountHead(String type, String roleType, String billNo, String beginTime, String endTime,
Long organId, Long creator, Long handsPersonId) 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);
result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo, beginTime, endTime);
result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo, beginTime, endTime, organId, creator, handsPersonId);
}catch(Exception e){
JshException.readFail(logger, e);
}

View File

@@ -30,6 +30,15 @@
<if test="endTime != null">
and ah.bill_time &lt;= #{endTime}
</if>
<if test="organId != null">
and ah.organ_id=#{organId}
</if>
<if test="handsPersonId != null">
and ah.hands_person_id=#{handsPersonId}
</if>
<if test="creator != null">
and ah.creator=#{creator}
</if>
<if test="creatorArray != null">
and ah.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
@@ -63,6 +72,15 @@
<if test="endTime != null">
and bill_time &lt;= #{endTime}
</if>
<if test="organId != null">
and organ_id=#{organId}
</if>
<if test="handsPersonId != null">
and hands_person_id=#{handsPersonId}
</if>
<if test="creator != null">
and creator=#{creator}
</if>
<if test="creatorArray != null">
and creator in (
<foreach collection="creatorArray" item="creator" separator=",">