给收付款增加对供应商和客户期初收款的接口

This commit is contained in:
季圣华
2023-03-20 01:47:36 +08:00
parent 71e3d1fe95
commit b8cfcdcac6
10 changed files with 181 additions and 12 deletions

View File

@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.*;
import com.jsh.erp.datasource.mappers.AccountHeadMapperEx;
import com.jsh.erp.datasource.mappers.DepotHeadMapperEx;
import com.jsh.erp.datasource.mappers.SupplierMapper;
import com.jsh.erp.datasource.mappers.SupplierMapperEx;
import com.jsh.erp.datasource.mappers.*;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.accountHead.AccountHeadService;
@@ -56,6 +53,8 @@ public class SupplierService {
@Resource
private DepotHeadMapperEx depotHeadMapperEx;
@Resource
private AccountItemMapperEx accountItemMapperEx;
@Resource
private DepotHeadService depotHeadService;
@Resource
private AccountHeadService accountHeadService;
@@ -403,6 +402,29 @@ public class SupplierService {
return list;
}
public Map<String, Object> getBeginNeedByOrganId(Long organId) throws Exception {
Supplier supplier = getSupplier(organId);
Map<String, Object> map = new HashMap<>();
BigDecimal needDebt = BigDecimal.ZERO;
if("供应商".equals(supplier.getType())) {
needDebt = supplier.getBeginNeedPay();
} else if("客户".equals(supplier.getType())) {
needDebt = supplier.getBeginNeedGet();
}
BigDecimal finishDebt = accountItemMapperEx.getFinishDebtByOrganId(organId);
BigDecimal eachAmount = BigDecimal.ZERO;
if(needDebt != null && finishDebt != null) {
eachAmount = needDebt.subtract(finishDebt);
}
//应收欠款
map.put("needDebt", needDebt);
//已收欠款
map.put("finishDebt", finishDebt);
//本次收款
map.put("eachAmount", eachAmount);
return map;
}
public void importVendor(MultipartFile file, HttpServletRequest request) throws Exception{
String type = "供应商";
Workbook workbook = Workbook.getWorkbook(file.getInputStream());