Commit 1b048131 by yinyong

资产负债表物流供应商更改

parent 1f3c8ed8
...@@ -85,10 +85,10 @@ public class BalanceSheetController { ...@@ -85,10 +85,10 @@ public class BalanceSheetController {
} }
@GetMapping("/updateSheetLogisticsSupplier") @GetMapping("/updateSheetLogisticsSupplier")
public String updateSheetLogisticsSupplier(@RequestParam(value = "date", required = true) String date, BigDecimal logisticsPayableSum, BigDecimal accountsReceivableUpdate, BigDecimal accountsReceivableImport, BigDecimal otherAccountsReceivableImport, BigDecimal otherAccountsPayableImport, BigDecimal fixedAssetsImport, BigDecimal ncaDeferredTaxAssetsImport) { public String updateSheetLogisticsSupplier(@RequestParam(value = "date", required = true) String date, BigDecimal logisticsPayableSum, BigDecimal accountsReceivableUpdate, BigDecimal accountsReceivableImport, BigDecimal otherAccountsReceivableImport, BigDecimal otherAccountsPayableImport, BigDecimal fixedAssetsImport, BigDecimal ncaDeferredTaxAssetsImport, BigDecimal platformBalanceUpdate) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
try{ try{
balanceSheetService.updateSheetSuppliserTransaction(date, logisticsPayableSum, accountsReceivableUpdate, accountsReceivableImport, otherAccountsReceivableImport, otherAccountsPayableImport, fixedAssetsImport, ncaDeferredTaxAssetsImport); balanceSheetService.updateSheetSuppliserTransaction(date, logisticsPayableSum, accountsReceivableUpdate, accountsReceivableImport, otherAccountsReceivableImport, otherAccountsPayableImport, fixedAssetsImport, ncaDeferredTaxAssetsImport, platformBalanceUpdate);
result.put("success", true); result.put("success", true);
result.put("message", "success"); result.put("message", "success");
} catch (Exception e){ } catch (Exception e){
......
...@@ -146,6 +146,9 @@ public interface DcBalanceSheetMapper { ...@@ -146,6 +146,9 @@ public interface DcBalanceSheetMapper {
@Select("select accounts_receivable_import from dc_balance_sheet where statistical_time = #{lastDay} ") @Select("select accounts_receivable_import from dc_balance_sheet where statistical_time = #{lastDay} ")
BigDecimal getAccountsReceivableImport(@Param("lastDay") Date lastDay); BigDecimal getAccountsReceivableImport(@Param("lastDay") Date lastDay);
@Select("select finished_accounts_payable from dc_balance_sheet where statistical_time <= #{lastDay} and finished_accounts_payable > 0 order by finished_accounts_payable desc limit 1 ")
BigDecimal getFinashedAccountSumByOld(@Param("lastDay") Date lastDay);
@Select("select accounts_receivable_update from dc_balance_sheet where statistical_time = #{lastDay} ") @Select("select accounts_receivable_update from dc_balance_sheet where statistical_time = #{lastDay} ")
BigDecimal getAccountsReceivableUpdate(@Param("lastDay") Date lastDay); BigDecimal getAccountsReceivableUpdate(@Param("lastDay") Date lastDay);
......
...@@ -537,7 +537,7 @@ public class BalanceSheetService { ...@@ -537,7 +537,7 @@ public class BalanceSheetService {
logger.error(">>>>>获取物流供应商往来数据出错" + e.getMessage()); logger.error(">>>>>获取物流供应商往来数据出错" + e.getMessage());
} }
} }
// 应收账款 其他应付款 物流
/** /**
* 获取供应商往来数据:应付账款和预付账款 * 获取供应商往来数据:应付账款和预付账款
* @param date * @param date
...@@ -566,7 +566,9 @@ public class BalanceSheetService { ...@@ -566,7 +566,9 @@ public class BalanceSheetService {
DcBalanceSheet dcBalanceSheet = new DcBalanceSheet();//物流供应商、成品供应商、半成品供应商 DcBalanceSheet dcBalanceSheet = new DcBalanceSheet();//物流供应商、成品供应商、半成品供应商
// 成品供应商应付款项 // 成品供应商应付款项
BigDecimal finishedAccountsPayableSum = dcSupplierTransactionMapper.getFinishedAccountsPayableSum(date); BigDecimal finishedAccountsPayableSum = dcSupplierTransactionMapper.getFinishedAccountsPayableSum(date);
if(finishedAccountsPayableSum == null) finishedAccountsPayableSum = BigDecimal.ZERO; if(finishedAccountsPayableSum == null){
finishedAccountsPayableSum = dcBalanceSheetMapper.getFinashedAccountSumByOld(date);
}
dcBalanceSheet.setFinishedAccountsPayable(finishedAccountsPayableSum); dcBalanceSheet.setFinishedAccountsPayable(finishedAccountsPayableSum);
// 半成品供应商应付款项 // 半成品供应商应付款项
BigDecimal semiAccountsPayableSum = dcSupplierTransactionMapper.getSemiAccountsPayableSum(date); BigDecimal semiAccountsPayableSum = dcSupplierTransactionMapper.getSemiAccountsPayableSum(date);
...@@ -604,7 +606,7 @@ public class BalanceSheetService { ...@@ -604,7 +606,7 @@ public class BalanceSheetService {
dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet); dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet);
} }
public void updateSheetSuppliserTransaction(String dateStr, BigDecimal logisticsPayableSum, BigDecimal accountsReceivableUpdate,BigDecimal accountsReceivableImport, BigDecimal otherAccountsReceivableImport, BigDecimal otherAccountsPayableImport, BigDecimal fixedAssetsImport, BigDecimal ncaDeferredTaxAssetsImport) throws ParseException { public void updateSheetSuppliserTransaction(String dateStr, BigDecimal logisticsPayableSum, BigDecimal accountsReceivableUpdate,BigDecimal accountsReceivableImport, BigDecimal otherAccountsReceivableImport, BigDecimal otherAccountsPayableImport, BigDecimal fixedAssetsImport, BigDecimal ncaDeferredTaxAssetsImport, BigDecimal platformBalanceUpdate) throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = simpleDateFormat.parse(dateStr); Date date = simpleDateFormat.parse(dateStr);
DcBalanceSheet dcBalanceSheet = new DcBalanceSheet();//物流供应商、成品供应商、半成品供应商 DcBalanceSheet dcBalanceSheet = new DcBalanceSheet();//物流供应商、成品供应商、半成品供应商
...@@ -670,6 +672,21 @@ public class BalanceSheetService { ...@@ -670,6 +672,21 @@ public class BalanceSheetService {
// 递延所得税资产 // 递延所得税资产
dcBalanceSheet.setNcaDeferredTaxAssets(ncaDeferredTaxAssetsImport); dcBalanceSheet.setNcaDeferredTaxAssets(ncaDeferredTaxAssetsImport);
} }
if(platformBalanceUpdate != null) {
// 银行账户余额汇总
BigDecimal bankAccountBalanceSum = dcBankAccountBalanceMapper.getBalanceSum(date);
if(bankAccountBalanceSum == null) bankAccountBalanceSum = BigDecimal.ZERO;
dcBalanceSheet.setBankAccountBalance(bankAccountBalanceSum);
// 提现在途金额汇总
BigDecimal withdrawOnWaySum = dcWithdrawOnWayMapper.getWithdrawOnWaySum(date);
if(withdrawOnWaySum == null) withdrawOnWaySum = BigDecimal.ZERO;
dcBalanceSheet.setWithdrawAmount(withdrawOnWaySum);
// 第三方平台余额
dcBalanceSheet.setPlatformBalance(platformBalanceUpdate);
// 货币资金
dcBalanceSheet.setMonetaryFund(bankAccountBalanceSum.add(withdrawOnWaySum).add(platformBalanceUpdate)); // 货币资金 = 银行余额 + 提现在途 + 第三方平台余额
}
dcBalanceSheet.setCompanyValue(0); dcBalanceSheet.setCompanyValue(0);
dcBalanceSheet.setStatisticalTime(date); dcBalanceSheet.setStatisticalTime(date);
dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet); dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet);
......
Markdown is supported
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