Commit 21963419 by yinyong

数据中心--资产负债表应收款项-导入、其他应收款项-导入、其他应付-导入、固定资产-导入、递延所得税资产-导入

parent 65f6e355
...@@ -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, @RequestParam(value = "logisticsPayableSum", required = true) BigDecimal logisticsPayableSum) { public String updateSheetLogisticsSupplier(@RequestParam(value = "date", required = true) String date, BigDecimal logisticsPayableSum, BigDecimal accountsReceivableImport, BigDecimal otherAccountsReceivableImport, BigDecimal otherAccountsPayableImport, BigDecimal fixedAssetsImport, BigDecimal ncaDeferredTaxAssetsImport) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
try{ try{
balanceSheetService.updateSheetSuppliserTransaction(date, logisticsPayableSum); balanceSheetService.updateSheetSuppliserTransaction(date, logisticsPayableSum, accountsReceivableImport, otherAccountsReceivableImport, otherAccountsPayableImport, fixedAssetsImport, ncaDeferredTaxAssetsImport);
result.put("success", true); result.put("success", true);
result.put("message", "success"); result.put("message", "success");
} catch (Exception e){ } catch (Exception e){
......
...@@ -90,6 +90,8 @@ public class DcBalanceSheet { ...@@ -90,6 +90,8 @@ public class DcBalanceSheet {
private BigDecimal otherAccountsPayable; private BigDecimal otherAccountsPayable;
private BigDecimal ncaDeferredTaxAssets;
private BigDecimal longTermAccountsPayable; private BigDecimal longTermAccountsPayable;
private Date statisticalTime; private Date statisticalTime;
......
...@@ -7,6 +7,7 @@ import com.bailuntec.balancesheet.entity.DcBalanceSheet; ...@@ -7,6 +7,7 @@ import com.bailuntec.balancesheet.entity.DcBalanceSheet;
import com.bailuntec.balancesheet.mapper.*; import com.bailuntec.balancesheet.mapper.*;
import com.bailuntec.balancesheet.util.DateTimeUtil; import com.bailuntec.balancesheet.util.DateTimeUtil;
import com.bailuntec.balancesheet.util.HttpUtil; import com.bailuntec.balancesheet.util.HttpUtil;
import org.apache.commons.codec.binary.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -603,26 +604,62 @@ public class BalanceSheetService { ...@@ -603,26 +604,62 @@ public class BalanceSheetService {
dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet); dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet);
} }
public void updateSheetSuppliserTransaction(String dateStr, BigDecimal logisticsPayableSum) throws ParseException { public void updateSheetSuppliserTransaction(String dateStr, BigDecimal logisticsPayableSum, BigDecimal accountsReceivableImport, BigDecimal otherAccountsReceivableImport, BigDecimal otherAccountsPayableImport, BigDecimal fixedAssetsImport, BigDecimal ncaDeferredTaxAssetsImport) 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();//物流供应商、成品供应商、半成品供应商
// 成品供应商应付款项 if(logisticsPayableSum != null) {
BigDecimal finishedAccountsPayableSum = dcSupplierTransactionMapper.getFinishedAccountsPayableSum(date); // 成品供应商应付款项
if(finishedAccountsPayableSum == null) finishedAccountsPayableSum = BigDecimal.ZERO; BigDecimal finishedAccountsPayableSum = dcSupplierTransactionMapper.getFinishedAccountsPayableSum(date);
dcBalanceSheet.setFinishedAccountsPayable(finishedAccountsPayableSum); if(finishedAccountsPayableSum == null) finishedAccountsPayableSum = BigDecimal.ZERO;
// 半成品供应商应付款项 dcBalanceSheet.setFinishedAccountsPayable(finishedAccountsPayableSum);
BigDecimal semiAccountsPayableSum = dcSupplierTransactionMapper.getSemiAccountsPayableSum(date); // 半成品供应商应付款项
if(semiAccountsPayableSum == null) semiAccountsPayableSum = BigDecimal.ZERO; BigDecimal semiAccountsPayableSum = dcSupplierTransactionMapper.getSemiAccountsPayableSum(date);
dcBalanceSheet.setSemiAccountsPayable(semiAccountsPayableSum); if(semiAccountsPayableSum == null) semiAccountsPayableSum = BigDecimal.ZERO;
// 物流供应商应付款项 dcBalanceSheet.setSemiAccountsPayable(semiAccountsPayableSum);
BigDecimal logisticsAccountsPayableSum = logisticsPayableSum; // 物流供应商应付款项
if(logisticsAccountsPayableSum == null) logisticsAccountsPayableSum = BigDecimal.ZERO; dcBalanceSheet.setLogisticsAccountsPayable(logisticsPayableSum);
dcBalanceSheet.setLogisticsAccountsPayable(logisticsAccountsPayableSum); // 应付款项
// 应付款项 BigDecimal accountsPayableSum = finishedAccountsPayableSum.add(semiAccountsPayableSum).add(logisticsPayableSum);
BigDecimal accountsPayableSum = finishedAccountsPayableSum.add(semiAccountsPayableSum).add(logisticsAccountsPayableSum); dcBalanceSheet.setAccountsPayable(accountsPayableSum);
dcBalanceSheet.setAccountsPayable(accountsPayableSum); }
if(accountsReceivableImport != null) {
// 应收款项
BigDecimal accountsReceivableSum = dcSupplierTransactionMapper.getAccountsReceivable(date);
if(accountsReceivableSum == null) accountsReceivableSum = BigDecimal.ZERO;
dcBalanceSheet.setAccountsReceivable(accountsReceivableSum.add(accountsReceivableImport));
}
if(otherAccountsReceivableImport != null) {
// 借支单未还金额
BigDecimal amountBorrowedSum = dcBalanceSheetMapper.getAmountBorrowed(date);
if(amountBorrowedSum == null) amountBorrowedSum = BigDecimal.ZERO;
dcBalanceSheet.setAmountBorrowed(amountBorrowedSum);
// 其他应收款
BigDecimal otherAccountsReceivable = dcOtherCostMapper.getOtherAccountsReceivableSum(date); // 其他应收款(加借支单未还金额)
if(otherAccountsReceivable == null) otherAccountsReceivable = BigDecimal.ZERO;
dcBalanceSheet.setOtherAccountsReceivable(otherAccountsReceivable.add(amountBorrowedSum).add(otherAccountsReceivableImport));
}
if(otherAccountsPayableImport != null) {
// 其他应付款
BigDecimal otherAccountsPayable = dcOtherCostMapper.getOtherAccountsPayableSum(date);
if(otherAccountsPayable == null) otherAccountsPayable = BigDecimal.ZERO;
dcBalanceSheet.setOtherAccountsPayable(otherAccountsPayable.add(otherAccountsPayableImport));
}
if(fixedAssetsImport != null) {
// 固定资产
BigDecimal fixedAssetsSum = dcFixedAssetsDetailMapper.getFixedAssetsSum(date);
if(fixedAssetsSum == null) fixedAssetsSum = BigDecimal.ZERO;
dcBalanceSheet.setFixedAssets(fixedAssetsSum.add(fixedAssetsImport));
}
if(ncaDeferredTaxAssetsImport != null) {
// 递延所得税资产
dcBalanceSheet.setNcaDeferredTaxAssets(ncaDeferredTaxAssetsImport);
}
dcBalanceSheet.setCompanyValue(0); dcBalanceSheet.setCompanyValue(0);
dcBalanceSheet.setStatisticalTime(date); dcBalanceSheet.setStatisticalTime(date);
dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet); dcBalanceSheetMapper.updateByCompanyAndDaySelective(dcBalanceSheet);
...@@ -718,7 +755,7 @@ public class BalanceSheetService { ...@@ -718,7 +755,7 @@ public class BalanceSheetService {
@Transactional @Transactional
public void generateBalanceSheet(Integer companyValue, String companyName, Date date) { public void generateBalanceSheet(Integer companyValue, String companyName, Date date) {
// 生成资产负债表 // 生成资产负债表
dcBalanceSheetMapper.insertBalanceSheet(companyValue, companyName, date); // dcBalanceSheetMapper.insertBalanceSheet(companyValue, companyName, date);
DcBalanceSheet dcBalanceSheet = new DcBalanceSheet(); DcBalanceSheet dcBalanceSheet = new DcBalanceSheet();
// 银行账户余额汇总 // 银行账户余额汇总
......
...@@ -383,6 +383,9 @@ ...@@ -383,6 +383,9 @@
<if test="longTermAccountsPayable != null"> <if test="longTermAccountsPayable != null">
long_term_accounts_payable = #{longTermAccountsPayable,jdbcType=DECIMAL}, long_term_accounts_payable = #{longTermAccountsPayable,jdbcType=DECIMAL},
</if> </if>
<if test="ncaDeferredTaxAssets != null">
nca_deferred_tax_assets = #{ncaDeferredTaxAssets,jdbcType=DECIMAL},
</if>
</set> </set>
where company_value = #{companyValue,jdbcType=INTEGER} and statistical_time = #{statisticalTime,jdbcType=DATE} where company_value = #{companyValue,jdbcType=INTEGER} and statistical_time = #{statisticalTime,jdbcType=DATE}
</update> </update>
......
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