给单据增加账户、状态和备注的筛选接口

This commit is contained in:
神话
2022-05-07 22:55:02 +08:00
parent d51868f994
commit 44b8ea4699
8 changed files with 80 additions and 18 deletions

View File

@@ -20,6 +20,9 @@ public interface AccountHeadMapperEx {
@Param("organId") Long organId,
@Param("creator") Long creator,
@Param("handsPersonId") Long handsPersonId,
@Param("accountId") Long accountId,
@Param("status") String status,
@Param("remark") String remark,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
@@ -31,7 +34,10 @@ public interface AccountHeadMapperEx {
@Param("endTime") String endTime,
@Param("organId") Long organId,
@Param("creator") Long creator,
@Param("handsPersonId") Long handsPersonId);
@Param("handsPersonId") Long handsPersonId,
@Param("accountId") Long accountId,
@Param("status") String status,
@Param("remark") String remark);
BigDecimal findAllMoney(
@Param("supplierId") Integer supplierId,

View File

@@ -32,6 +32,8 @@ public interface DepotHeadMapperEx {
@Param("creator") Long creator,
@Param("depotId") Long depotId,
@Param("depotArray") String[] depotArray,
@Param("accountId") Long accountId,
@Param("remark") String remark,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
@@ -48,7 +50,9 @@ public interface DepotHeadMapperEx {
@Param("organId") Long organId,
@Param("creator") Long creator,
@Param("depotId") Long depotId,
@Param("depotArray") String[] depotArray);
@Param("depotArray") String[] depotArray,
@Param("accountId") Long accountId,
@Param("remark") String remark);
String findMaterialsListByHeaderId(
@Param("id") Long id);

View File

@@ -39,7 +39,11 @@ public class AccountHeadComponent implements ICommonQuery {
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));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String status = StringUtil.getInfo(search, "status");
String remark = StringUtil.getInfo(search, "remark");
return accountHeadService.select(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId,
accountId, status, remark, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
@@ -53,7 +57,11 @@ public class AccountHeadComponent implements ICommonQuery {
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);
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String status = StringUtil.getInfo(search, "status");
String remark = StringUtil.getInfo(search, "remark");
return accountHeadService.countAccountHead(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId,
accountId, status, remark);
}
@Override

View File

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

View File

@@ -43,8 +43,10 @@ public class DepotHeadComponent implements ICommonQuery {
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId"));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String remark = StringUtil.getInfo(search, "remark");
return depotHeadService.select(type, subType, roleType, status, number, linkNumber, beginTime, endTime, materialParam,
organId, creator, depotId, QueryUtils.offset(map), QueryUtils.rows(map));
organId, creator, depotId, accountId, remark, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
@@ -62,8 +64,10 @@ public class DepotHeadComponent implements ICommonQuery {
Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId"));
Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator"));
Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId"));
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String remark = StringUtil.getInfo(search, "remark");
return depotHeadService.countDepotHead(type, subType, roleType, status, number, linkNumber, beginTime, endTime, materialParam,
organId, creator, depotId);
organId, creator, depotId, accountId, remark);
}
@Override

View File

@@ -101,7 +101,7 @@ public class DepotHeadService {
}
public List<DepotHeadVo4List> select(String type, String subType, String roleType, String status, String number, String linkNumber,
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, 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> list=new ArrayList<>();
try{
@@ -113,7 +113,7 @@ public class DepotHeadService {
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, statusArray, number, linkNumber, beginTime, endTime,
materialParam, organId, creator, depotId, depotArray, offset, rows);
materialParam, organId, creator, depotId, depotArray, accountId, remark, offset, rows);
if (null != list) {
for (DepotHeadVo4List dh : list) {
if(accountMap!=null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) {
@@ -151,7 +151,7 @@ public class DepotHeadService {
}
public Long countDepotHead(String type, String subType, String roleType, String status, String number, String linkNumber,
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId) throws Exception{
String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark) throws Exception{
Long result=null;
try{
String [] depotArray = getDepotArray(subType);
@@ -160,7 +160,7 @@ public class DepotHeadService {
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, statusArray, number, linkNumber, beginTime, endTime,
materialParam, organId, creator, depotId, depotArray);
materialParam, organId, creator, depotId, depotArray, accountId, remark);
}catch(Exception e){
JshException.readFail(logger, e);
}
@@ -720,8 +720,8 @@ public class DepotHeadService {
if(StringUtil.isNotEmpty(depotHead.getAccountMoneyList())) {
//校验多账户的结算金额
String accountMoneyList = depotHead.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", "");
int sum = StringUtil.getArrSum(accountMoneyList.split(","));
BigDecimal manyAccountSum = BigDecimal.valueOf(sum).abs();
BigDecimal sum = StringUtil.getArrSum(accountMoneyList.split(","));
BigDecimal manyAccountSum = sum.abs();
if(manyAccountSum.compareTo(depotHead.getChangeAmount().abs())!=0) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG));
@@ -787,8 +787,8 @@ public class DepotHeadService {
if(StringUtil.isNotEmpty(depotHead.getAccountMoneyList())) {
//校验多账户的结算金额
String accountMoneyList = depotHead.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", "");
int sum = StringUtil.getArrSum(accountMoneyList.split(","));
BigDecimal manyAccountSum = BigDecimal.valueOf(sum).abs();
BigDecimal sum = StringUtil.getArrSum(accountMoneyList.split(","));
BigDecimal manyAccountSum = sum.abs();
if(manyAccountSum.compareTo(depotHead.getChangeAmount().abs())!=0) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG));

View File

@@ -46,6 +46,16 @@
</foreach>
)
</if>
<if test="accountId != null">
and ah.account_id=#{accountId}
</if>
<if test="status != null and status != ''">
and ah.status=#{status}
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and ah.remark like #{bindRemark}
</if>
and ifnull(ah.delete_flag,'0') !='1'
order by ah.id desc
<if test="offset != null and rows != null">
@@ -88,6 +98,16 @@
</foreach>
)
</if>
<if test="accountId != null">
and account_id=#{accountId}
</if>
<if test="status != null and status != ''">
and status=#{status}
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
</select>

View File

@@ -113,6 +113,14 @@
</foreach>
)
</if>
<if test="accountId != null">
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
and (dh.account_id=#{accountId} or dh.account_id_list like #{bindAccountId})
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and dh.remark like #{bindRemark}
</if>
and ifnull(dh.delete_flag,'0') !='1'
order by dh.id desc
<if test="offset != null and rows != null">
@@ -181,6 +189,14 @@
</foreach>
)
</if>
<if test="accountId != null">
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
and (dh.account_id=#{accountId} or dh.account_id_list like #{bindAccountId})
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and dh.remark like #{bindRemark}
</if>
and ifnull(dh.delete_Flag,'0') !='1') tb
</select>