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

This commit is contained in:
季圣华
2022-11-21 00:26:07 +08:00
parent 2bdfc18c9d
commit c0a3a6a0ec
5 changed files with 55 additions and 7 deletions

View File

@@ -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;
}
}
}