Commit c0a3a6a0 authored by 季圣华's avatar 季圣华
Browse files

给收付款单增加销售采购单号的接口查询

parent 2bdfc18c
...@@ -23,6 +23,7 @@ public interface AccountHeadMapperEx { ...@@ -23,6 +23,7 @@ public interface AccountHeadMapperEx {
@Param("accountId") Long accountId, @Param("accountId") Long accountId,
@Param("status") String status, @Param("status") String status,
@Param("remark") String remark, @Param("remark") String remark,
@Param("ahIdList") List<Long> ahIdList,
@Param("offset") Integer offset, @Param("offset") Integer offset,
@Param("rows") Integer rows); @Param("rows") Integer rows);
...@@ -37,7 +38,8 @@ public interface AccountHeadMapperEx { ...@@ -37,7 +38,8 @@ public interface AccountHeadMapperEx {
@Param("handsPersonId") Long handsPersonId, @Param("handsPersonId") Long handsPersonId,
@Param("accountId") Long accountId, @Param("accountId") Long accountId,
@Param("status") String status, @Param("status") String status,
@Param("remark") String remark); @Param("remark") String remark,
@Param("ahIdList") List<Long> ahIdList);
BigDecimal findAllMoney( BigDecimal findAllMoney(
@Param("supplierId") Integer supplierId, @Param("supplierId") Integer supplierId,
......
...@@ -42,8 +42,9 @@ public class AccountHeadComponent implements ICommonQuery { ...@@ -42,8 +42,9 @@ public class AccountHeadComponent implements ICommonQuery {
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId")); Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String status = StringUtil.getInfo(search, "status"); String status = StringUtil.getInfo(search, "status");
String remark = StringUtil.getInfo(search, "remark"); String remark = StringUtil.getInfo(search, "remark");
String number = StringUtil.getInfo(search, "number");
return accountHeadService.select(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId, 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 @Override
...@@ -60,8 +61,9 @@ public class AccountHeadComponent implements ICommonQuery { ...@@ -60,8 +61,9 @@ public class AccountHeadComponent implements ICommonQuery {
Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId")); Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId"));
String status = StringUtil.getInfo(search, "status"); String status = StringUtil.getInfo(search, "status");
String remark = StringUtil.getInfo(search, "remark"); String remark = StringUtil.getInfo(search, "remark");
String number = StringUtil.getInfo(search, "number");
return accountHeadService.countAccountHead(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId, return accountHeadService.countAccountHead(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId,
accountId, status, remark); accountId, status, remark, number);
} }
@Override @Override
......
...@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx; ...@@ -10,6 +10,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException; import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.accountItem.AccountItemService; 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.log.LogService;
import com.jsh.erp.service.orgaUserRel.OrgaUserRelService; import com.jsh.erp.service.orgaUserRel.OrgaUserRelService;
import com.jsh.erp.service.supplier.SupplierService; import com.jsh.erp.service.supplier.SupplierService;
...@@ -44,6 +45,8 @@ public class AccountHeadService { ...@@ -44,6 +45,8 @@ public class AccountHeadService {
@Resource @Resource
private AccountItemService accountItemService; private AccountItemService accountItemService;
@Resource @Resource
private DepotHeadService depotHeadService;
@Resource
private UserService userService; private UserService userService;
@Resource @Resource
private SupplierService supplierService; private SupplierService supplierService;
...@@ -88,14 +91,15 @@ public class AccountHeadService { ...@@ -88,14 +91,15 @@ public class AccountHeadService {
public List<AccountHeadVo4ListEx> select(String type, String roleType, String billNo, String beginTime, String endTime, public List<AccountHeadVo4ListEx> select(String type, String roleType, String billNo, String beginTime, String endTime,
Long organId, Long creator, Long handsPersonId, Long accountId, String status, 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<>(); List<AccountHeadVo4ListEx> resList = new ArrayList<>();
try{ try{
String [] creatorArray = getCreatorArray(roleType); String [] creatorArray = getCreatorArray(roleType);
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<Long> ahIdList = accountItemService.getAhIdListByBillNumber(number);
List<AccountHeadVo4ListEx> list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo, 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) { if (null != list) {
for (AccountHeadVo4ListEx ah : list) { for (AccountHeadVo4ListEx ah : list) {
if(ah.getChangeAmount() != null) { if(ah.getChangeAmount() != null) {
...@@ -118,14 +122,15 @@ public class AccountHeadService { ...@@ -118,14 +122,15 @@ public class AccountHeadService {
public Long countAccountHead(String type, String roleType, String billNo, String beginTime, String endTime, public Long countAccountHead(String type, String roleType, String billNo, String beginTime, String endTime,
Long organId, Long creator, Long handsPersonId, Long accountId, String status, Long organId, Long creator, Long handsPersonId, Long accountId, String status,
String remark) throws Exception{ String remark, String number) throws Exception{
Long result=null; Long result=null;
try{ try{
String [] creatorArray = getCreatorArray(roleType); String [] creatorArray = getCreatorArray(roleType);
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<Long> ahIdList = accountItemService.getAhIdListByBillNumber(number);
result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo, 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){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
......
...@@ -6,6 +6,7 @@ import com.jsh.erp.constants.BusinessConstants; ...@@ -6,6 +6,7 @@ import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.AccountItem; import com.jsh.erp.datasource.entities.AccountItem;
import com.jsh.erp.datasource.entities.AccountItemExample; 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.entities.User;
import com.jsh.erp.datasource.mappers.AccountItemMapper; import com.jsh.erp.datasource.mappers.AccountItemMapper;
import com.jsh.erp.datasource.mappers.AccountItemMapperEx; import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
...@@ -26,6 +27,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; ...@@ -26,6 +27,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -259,4 +261,29 @@ public class AccountItemService { ...@@ -259,4 +261,29 @@ public class AccountItemService {
public BigDecimal getEachAmountByBillId(Long billId) { public BigDecimal getEachAmountByBillId(Long billId) {
return accountItemMapperEx.getEachAmountByBillId(billId).abs(); 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;
}
}
} }
...@@ -56,6 +56,12 @@ ...@@ -56,6 +56,12 @@
<bind name="bindRemark" value="'%'+remark+'%'"/> <bind name="bindRemark" value="'%'+remark+'%'"/>
and ah.remark like #{bindRemark} and ah.remark like #{bindRemark}
</if> </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' and ifnull(ah.delete_flag,'0') !='1'
order by ah.id desc order by ah.id desc
<if test="offset != null and rows != null"> <if test="offset != null and rows != null">
...@@ -108,6 +114,12 @@ ...@@ -108,6 +114,12 @@
<bind name="bindRemark" value="'%'+remark+'%'"/> <bind name="bindRemark" value="'%'+remark+'%'"/>
and remark like #{bindRemark} and remark like #{bindRemark}
</if> </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' and ifnull(delete_flag,'0') !='1'
</select> </select>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment