From b16b717fe5758cbe8d444c90a0436b83f95a8626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98wangjiuyun?= <‘1595161655@qq.com> Date: Fri, 25 Oct 2024 18:06:05 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +- .../resources/application-local.properties | 6 +- .../static/assets/js/project_budget.js | 8 +- .../static/assets/js/project_budget_cost.js | 2 +- .../static/assets/js/project_budget_income.js | 10 +- .../templates/admin/project_approve.ftl | 100 ++++++------ .../templates/admin/project_budget_edit.ftl | 143 +++++++++--------- .../templates/admin/project_estimate_add.ftl | 36 ++--- .../templates/admin/project_estimate_edit.ftl | 36 ++--- 10 files changed, 175 insertions(+), 172 deletions(-) diff --git a/build.gradle b/build.gradle index 945decc..c2060c1 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ dependencies { compile 'com.jfinal:jfinal:2.2' compile 'com.alibaba:druid:1.1.9' - compile 'mysql:mysql-connector-java:6.0.6' + compile 'mysql:mysql-connector-java:8.0.33' //compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3' //shiro compile group: 'org.apache.shiro', name: 'shiro-spring', version: '1.4.0' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 95f84e8..cd0d3bf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Oct 28 15:13:01 CST 2021 +#Fri Oct 25 15:43:46 CST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-rc-2-bin.zip diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 7a5d2fb..90c2231 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -1,7 +1,7 @@ -spring.datasource.url=jdbc:mysql://127.0.0.1:3306/fourcal?\ +spring.datasource.url=jdbc:mysql://192.168.124.202:3306/fourcal?\ characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&rewriteBatchedStatements=true&useSSL=false -spring.datasource.username=root -spring.datasource.password=sagacity +spring.datasource.username=fourcal +spring.datasource.password=unissense@123 spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect #spring.jpa.properties.hibernate.hbm2ddl.auto=update diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js index c1f0b4f..3b66599 100644 --- a/src/main/resources/static/assets/js/project_budget.js +++ b/src/main/resources/static/assets/js/project_budget.js @@ -134,12 +134,12 @@ $(function () { var dataManage = collectData("am-modal-prompt-input-cost-project-manage"); if (dataManage.length <= 0) { - window.confirm('请填写项目管理成本表'); + window.confirm('项目管理费用'); $("#saveDraft").attr('disabled', false); return; } - var dataManageCheck = convertDetailVerifyCheck(dataManage, COST_PROJECT_MANAGE_DETAIL2, "项目管理成本表"); + var dataManageCheck = convertDetailVerifyCheck(dataManage, COST_PROJECT_MANAGE_DETAIL2, "项目管理费用"); if (dataManageCheck == null) { $("#saveDraft").attr('disabled', false); return; @@ -252,12 +252,12 @@ $(function () { var dataManage = collectData("am-modal-prompt-input-cost-project-manage"); console.log("dataManage: " + dataManage.length); if (dataManage.length <= 4) { - window.confirm('请填写项目管理成本表'); + window.confirm('请填写项目管理费用'); $("#saveApprove").attr('disabled', false); return; } - var dataManageCheck = convertDetailVerifyCheck(dataManage, COST_PROJECT_MANAGE_DETAIL, "项目管理成本表"); + var dataManageCheck = convertDetailVerifyCheck(dataManage, COST_PROJECT_MANAGE_DETAIL, "项目管理费用"); if (dataManageCheck == null) { $("#saveApprove").attr('disabled', false); return; diff --git a/src/main/resources/static/assets/js/project_budget_cost.js b/src/main/resources/static/assets/js/project_budget_cost.js index e9fc531..890fd82 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -199,7 +199,7 @@ function appendTrCost() { ''+ diff --git a/src/main/resources/static/assets/js/project_budget_income.js b/src/main/resources/static/assets/js/project_budget_income.js index 95ec060..6e5c54a 100644 --- a/src/main/resources/static/assets/js/project_budget_income.js +++ b/src/main/resources/static/assets/js/project_budget_income.js @@ -179,11 +179,11 @@ function appendTrIncome() { ' \n' + ' \n' + ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + + // ' \n' + + // ' \n' + + // ' \n' + + // ' \n' + + // ' \n' + ' \n' + ' \n' + ' \n' + diff --git a/src/main/resources/templates/admin/project_approve.ftl b/src/main/resources/templates/admin/project_approve.ftl index 246105d..99e2c48 100644 --- a/src/main/resources/templates/admin/project_approve.ftl +++ b/src/main/resources/templates/admin/project_approve.ftl @@ -387,19 +387,19 @@ - - 主合同收款条款: - - - - - - 主合同具体解决方案: - - - +<#-- --> +<#-- 主合同收款条款:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- 主合同具体解决方案:--> +<#-- --> +<#-- --> +<#-- --> 计收计划: @@ -491,7 +491,7 @@
  • 收入明细表
  • 收款计划表
  • 采购成本明细表
  • -
  • 项目管理成本表
  • +
  • 项目管理费用
  • 资金计划表
  • @@ -754,20 +754,20 @@ - - 主合同收款条款: - - - - - - 主合同具体解决方案: - - - - +<#-- --> +<#-- 主合同收款条款:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- 主合同具体解决方案:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> 计收计划: @@ -798,13 +798,13 @@ 序号 - 类别 + 产品大类 名称 - 规格类型 - 参数 - 单位 - 数量 - 单价 +<#-- 规格类型--> +<#-- 参数--> +<#-- 单位--> +<#-- 数量--> +<#-- 单价--> 税率(%) 含税总金额(元) 不含税金额(元) @@ -838,22 +838,22 @@ - - - - - - +<#-- class="am-modal-prompt-input am-modal-prompt-input-income"--> +<#-- value="${incomeDetail.spec!}">--> +<#-- +<#-- class="am-modal-prompt-input am-modal-prompt-input-income"--> +<#-- value="${incomeDetail.param!}">--> +<#-- +<#-- class="am-modal-prompt-input am-modal-prompt-input-income"--> +<#-- value="${incomeDetail.unit!}">--> +<#-- +<#-- class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-amount"--> +<#-- value="${Utils.format(incomeDetail.amount,'0.00')}">--> +<#-- +<#-- class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-price"--> +<#-- value="${Utils.format2(incomeDetail.price,'0.00')}">--> +<#-- class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-tax-rate" value="${Utils.format(incomeDetail.taxRate,'0.00')}"> 收入明细表
  • 收款计划表
  • 采购成本明细表
  • -
  • 项目管理成本表
  • +
  • 项目管理费用
  • 资金计划表
  • 项目预算信息
  • @@ -304,19 +304,19 @@ - - 主合同收款条款: - - - - - - 主合同具体解决方案: - - - +<#-- --> +<#-- 主合同收款条款:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- 主合同具体解决方案:--> +<#-- --> +<#-- --> +<#-- --> 计收计划: @@ -707,24 +707,24 @@ - - 主合同收款条款: - - - - - - 主合同具体解决方案: - - - - +<#-- --> +<#-- 主合同收款条款:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- 主合同具体解决方案:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> 计收计划: @@ -761,13 +761,13 @@ 序号 - 类别 + 产品大类 名称 - 规格类型 - 参数 - 单位 - 数量 - 单价 +<#-- 规格类型--> +<#-- 参数--> +<#-- 单位--> +<#-- 数量--> +<#-- 单价--> 税率(%) 含税总金额(元) 不含税金额(元) @@ -788,11 +788,11 @@ - - - - > - +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> @@ -805,11 +805,11 @@ - - - - > - +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> @@ -927,7 +927,7 @@ @@ -1273,7 +1273,7 @@ (备注:本表所用税率为:${incomeTaxRates!}) - 成本 + 采购成本 <#-- 采购成本明细表 项目管理成本表--> @@ -1297,7 +1297,7 @@ - + @@ -1318,14 +1318,7 @@ - - - - - - - - + @@ -1355,15 +1348,25 @@ + + + + + +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> - + - + (备注:财务计取以不含税方式核算) @@ -1382,20 +1385,20 @@ - + - + - - - - - - - + +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- -->
    成本 采购成本施工工程
    成本项目管理成本项目管理成本
    成本 其他费用项目 不含税金额(元)
    成本项目管理成本
    财务费用 资金占用成本
    公司管理费用
    公司管理费用合计
    项目毛利A(元) 毛利A=收入明细表金额总计(不含税)-采购成本明细表金额总计(不含税)项目毛利A=收入合计(不含税)-采购成本合计(不含税)
    项目毛利(元)项目毛利B(元) 毛利=收入总计(不含税)-成本总计(不含税)-财务费用总计(不含税)
    项目贡献利润(元)贡献利润=项目毛利(不含税)-公司管理费用总计(不含税)项目毛利B=项目毛利A-财务费用-项目管理费用
    项目贡献利润(元)贡献利润=项目毛利(不含税)-公司管理费用总计(不含税)
    diff --git a/src/main/resources/templates/admin/project_estimate_add.ftl b/src/main/resources/templates/admin/project_estimate_add.ftl index 32a7145..ac00262 100644 --- a/src/main/resources/templates/admin/project_estimate_add.ftl +++ b/src/main/resources/templates/admin/project_estimate_add.ftl @@ -300,24 +300,24 @@ - - 主合同收款条款: - - - - - - 主合同具体解决方案: - - - - +<#-- --> +<#-- 主合同收款条款:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- 主合同具体解决方案:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> 计收计划: diff --git a/src/main/resources/templates/admin/project_estimate_edit.ftl b/src/main/resources/templates/admin/project_estimate_edit.ftl index 6efafbb..2d1b7ea 100644 --- a/src/main/resources/templates/admin/project_estimate_edit.ftl +++ b/src/main/resources/templates/admin/project_estimate_edit.ftl @@ -347,24 +347,24 @@ - - 主合同收款条款: - - - - - - 主合同具体解决方案: - - - - +<#-- --> +<#-- 主合同收款条款:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- 主合同具体解决方案:--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> 计收计划: From 4662f1bbbdebb2566184ed5f740f2904bc92da12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98wangjiuyun?= <‘1595161655@qq.com> Date: Mon, 28 Oct 2024 17:05:31 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=9C=AA=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/assets/js/project_budget.js | 18 ++- .../static/assets/js/project_budget_cost.js | 77 +++++----- .../js/project_budget_cost_project_manage.js | 41 +++--- .../static/assets/js/project_budget_income.js | 22 ++- .../static/assets/js/project_budget_plan.js | 64 +++++++- .../static/assets/js/project_common.js | 10 +- .../templates/admin/project_budget_edit.ftl | 139 ++++++++++-------- 7 files changed, 231 insertions(+), 140 deletions(-) diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js index 3b66599..46e77a6 100644 --- a/src/main/resources/static/assets/js/project_budget.js +++ b/src/main/resources/static/assets/js/project_budget.js @@ -728,13 +728,16 @@ function bindChangeableInput() { //税率改变 $(".input-changeable-tax-rate").change(function () { var taxRate = f2($(this).val()); - //找到对应的数量和单价 - var amount = f2($(this).parent().parent().find(".input-changeable-amount").val()); - var price = f5($(this).parent().parent().find(".input-changeable-price").val()); - console.log(amount, price, taxRate); - - $(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(amount * price / (1 + taxRate / 100))); - $(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(amount * price * taxRate /(100 + taxRate))); + var rowVal=$(this).parent().parent().find(".input-changeable-total-tax-include").val() + $(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(rowVal * (1 - (taxRate / 100)))); + $(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(rowVal * (taxRate / 100))); + }); + // 不含税金额改变 + $(".input-changeable-total-tax-include").change(function () { + var rowVal = f2($(this).val()); + var taxRate=$(this).parent().parent().find(".input-changeable-tax-rate").val() + $(this).parent().parent().find(".input-changeable-total-tax-exclude").val(f2Fixed(rowVal * (1 - (taxRate / 100)))); + $(this).parent().parent().find(".input-changeable-total-tax").val(f2Fixed(rowVal * (taxRate / 100))); }); } @@ -985,3 +988,4 @@ function updateBudgetPlanDetailDataUnsubmit(data,returnData) { //更新现金流量 updateCashFlow(); } + diff --git a/src/main/resources/static/assets/js/project_budget_cost.js b/src/main/resources/static/assets/js/project_budget_cost.js index 890fd82..8f3c8b7 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -6,41 +6,41 @@ COST_DETAIL2={ "num":[false,"序号","string"], "type":[false,"费用项目","string"], "category":[false,"采购类别","string"], - "name":[false,"名称","string"], - "unit":[false,"单位","string"], - "amount":[false,"数量","number"], - "price":[false,"单价","price"], + // "name":[false,"名称","string"], + // "unit":[false,"单位","string"], + // "amount":[false,"数量","number"], + // "price":[false,"单价","price"], "taxRate":[false,"税率","number"], "totalTaxInclude":[false,"含税总金额","number"], "totalTaxExclude":[false,"不含税金额","number"], "totalTax":[false,"税金","number"], - "contractParty":[false,"签约方","string"], - "isUnderwritten":[false,"是否垫资","string"], - "underwrittenAmount":[false,"预估垫资金额","number"], - "payTime":[false,"支出时间","string"], - "payAmount":[false,"支出金额","number"], - "payWay":[false,"付款方式","string"], + // "contractParty":[false,"签约方","string"], + // "isUnderwritten":[false,"是否垫资","string"], + // "underwrittenAmount":[false,"预估垫资金额","number"], + // "payTime":[false,"支出时间","string"], + // "payAmount":[false,"支出金额","number"], + // "payWay":[false,"付款方式","string"], "remark":[false,"备注","string"] }; COST_DETAIL={ "num":[false,"序号","string"], "type":[true,"费用项目","string"], - "category":[true,"采购类别","string"], + "category":[true,"产品大类","string"], "name":[true,"名称","string"], - "unit":[true,"单位","string"], - "amount":[true,"数量","number"], - "price":[true,"单价","price"], + // "unit":[true,"单位","string"], + // "amount":[true,"数量","number"], + // "price":[true,"单价","price"], "taxRate":[true,"税率","number"], "totalTaxInclude":[true,"含税总金额","number"], "totalTaxExclude":[true,"不含税金额","number"], "totalTax":[true,"税金","number"], - "contractParty":[false,"签约方","string"], - "isUnderwritten":[false,"是否垫资","string"], - "underwrittenAmount":[false,"预估垫资金额","number"], - "payTime":[false,"支出时间","string"], - "payAmount":[false,"支出金额","number"], - "payWay":[false,"付款方式","string"], + "contractParty":[false,"供应商","string"], + // "isUnderwritten":[false,"是否垫资","string"], + // "underwrittenAmount":[false,"预估垫资金额","number"], + // "payTime":[false,"支出时间","string"], + // "payAmount":[false,"支出金额","number"], + // "payWay":[false,"付款方式","string"], "remark":[false,"备注","string"] }; /* @@ -220,26 +220,26 @@ function appendTrCost() { ''+ ''+ - ''+ - ''+ - ''+ - ''+ + // ''+ + // ''+ + // ''+ + // ''+ ''+ - ''+ + ''+ ''+ ''+ '\n' + - '\n' + - ' \n' + - '\n' + - '\n' + - '\n' + - '\n' + - '\n' + + // '\n' + + // ' \n' + + // '\n' + + // '\n' + + // '\n' + + // '\n' + + // '\n' + '\n' + ''+ ''; @@ -319,6 +319,11 @@ function bindCostTotal() { $(".input-changeable-total-underwritten-amount-cost").change(function () { updateTotal("input-changeable-total-underwritten-amount-cost", "input-changeable-total-total-underwritten-amount-cost"); }); + $(".input-changeable-total-tax-include-cost").change(function () { + updateTotal("input-changeable-total-tax-include-cost", "input-changeable-total-total-tax-include-cost"); + updateTotal("input-changeable-total-tax-exclude-cost", "input-changeable-total-total-tax-exclude-cost"); + updateTotal("input-changeable-total-tax-cost", "input-changeable-total-total-tax-cost"); + }); } /** diff --git a/src/main/resources/static/assets/js/project_budget_cost_project_manage.js b/src/main/resources/static/assets/js/project_budget_cost_project_manage.js index 69044f5..57f6eea 100644 --- a/src/main/resources/static/assets/js/project_budget_cost_project_manage.js +++ b/src/main/resources/static/assets/js/project_budget_cost_project_manage.js @@ -4,13 +4,10 @@ //COST_PROJECT_MANAGE_DETAIL_ARR=["type","name","detail","unit","amount","price","total","predictMethod","predictWhy","remark","deletable"]; COST_PROJECT_MANAGE_DETAIL2={ "num":[false,"序号","string"], - "type":[false,"财务费用类别","string"], + "type":[false,"费用类别","string"], "name1":[false,"业务项目","string"], - "name2":[false,"业务项目","string"], "detail":[false,"项目明细","string"], - "unit":[false,"单位","string"], - "amount":[false,"数量","number"], - "price":[false,"单价","price"], + "detail1":[false,"项目明细","string"], "total":[false,"总金额","number"], "payTime":[false,"支出时间","string"], "payAmount":[false,"支出金额","number"], @@ -22,20 +19,17 @@ COST_PROJECT_MANAGE_DETAIL2={ COST_PROJECT_MANAGE_DETAIL={ "num":[false,"序号","string"], - "type":[true,"财务费用类别","string"], + "type":[false,"费用类别","string"], "name1":[false,"业务项目","string"], - "name2":[false,"业务项目","string"], - "detail":[true,"项目明细","string"], - "unit":[true,"单位","string"], - "amount":[true,"数量","number"], - "price":[true,"单价","price"], - "total":[true,"总金额","number"], + "detail":[false,"项目明细","string"], + "detail1":[false,"项目明细","string"], + "total":[false,"总金额","number"], "payTime":[false,"支出时间","string"], "payAmount":[false,"支出金额","number"], "predictMethod":[false,"预估计算方法","string"], "predictWhy":[false,"预估依据","string"], "remark":[false,"备注","string"], - "deletable":[true,"是否可删除","string"] + "deletable":[false,"是否可删除","string"] }; SELECT_TYPE_CATEGORY_MAP_DATA_MANAGER={}; @@ -98,6 +92,15 @@ $(function () { var data = collectData("am-modal-prompt-input-cost-project-manage"); //data = prepareAjaxData(data, COST_PROJECT_MANAGE_DETAIL_ARR, $("#id").val(),true); data = prepareAjaxDataVerify(data, COST_PROJECT_MANAGE_DETAIL2, $("#id").val()); + var totalTotal=data.details.reduce((total,now)=>{ + return now.total+total + },0) + var projectGrossProfitA=$('[name="projectGrossProfitA"]').val() + if(Number(totalTotal)> (Number(projectGrossProfitA)*0.1) ){ + layuiAlert(`总金额合计不能超过毛利A(${projectGrossProfitA})的10%`); + return + } + // if(data.managePayAmountTotal) if(data){ postAjax(base+"/project/budgetEditSaveCostProjectManageDetail", data, updateCostProjectManageData); } @@ -144,10 +147,10 @@ function appendTrCostProjectManage() { ' \n' + ' \n' + ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + + // ' \n' + + // ' \n' + + // ' \n' + + ' \n' + ' \n' + ' \n' + ' \n' + @@ -212,6 +215,9 @@ function bindCostManageTotal() { $(".input-changeable-pay-amount-project-manage").change(function () { updateTotal("input-changeable-pay-amount-project-manage", "input-changeable-total-pay-amount-project-manage"); }); + $(".input-changeable-total-project-manage").change(function () { + updateTotal("input-changeable-total-project-manage", "input-changeable-total-total-project-manage"); + }); } /** @@ -322,6 +328,7 @@ function bindChangeableInputProjectManage() { $(this).parent().parent().find(".input-changeable-total-project-manage").val(f2Fixed(amount*price)); }); + } /** * 更新页面收入的数据【累加】 diff --git a/src/main/resources/static/assets/js/project_budget_income.js b/src/main/resources/static/assets/js/project_budget_income.js index 6e5c54a..e6b58aa 100644 --- a/src/main/resources/static/assets/js/project_budget_income.js +++ b/src/main/resources/static/assets/js/project_budget_income.js @@ -5,12 +5,12 @@ INCOME_DETAIL2={ "num":[false,"序号","string"], "type":[false,"类别","string"], - "name":[false,"名称","string"], - "spec":[false,"规格类型","string"], - "param":[false,"参数","string"], - "unit":[false,"单位","string"], - "amount":[false,"数量","number"], - "price":[false,"单价","price"], + "name":[false,"产品大类","string"], + // "spec":[false,"规格类型","string"], + // "param":[false,"参数","string"], + // "unit":[false,"单位","string"], + // "amount":[false,"数量","number"], + // "price":[false,"单价","price"], "taxRate":[false,"税率","number"], "totalTaxInclude":[false,"含税总金额","number"], "totalTaxExclude":[false,"不含税金额","number"], @@ -185,7 +185,7 @@ function appendTrIncome() { // ' \n' + // ' \n' + ' \n' + - ' \n' + + ' \n' + ' \n' + ' \n' + ' \n' + @@ -216,6 +216,8 @@ function bindDeleteBtnIncome() { updateTotal("input-changeable-total-tax-include-income", "input-changeable-total-total-tax-include-income"); updateTotal("input-changeable-total-tax-exclude-income", "input-changeable-total-total-tax-exclude-income"); updateTotal("input-changeable-total-tax-income", "input-changeable-total-total-tax-income"); + + }); } @@ -241,4 +243,10 @@ function bindIncomeTotal() { updateTotal("input-changeable-total-tax-exclude-income", "input-changeable-total-total-tax-exclude-income"); updateTotal("input-changeable-total-tax-income", "input-changeable-total-total-tax-income"); }); + $(".input-changeable-total-tax-include-income").change(function () { + updateTotal("input-changeable-total-tax-include-income", "input-changeable-total-total-tax-include-income"); + updateTotal("input-changeable-total-tax-exclude-income", "input-changeable-total-total-tax-exclude-income"); + updateTotal("input-changeable-total-tax-income", "input-changeable-total-total-tax-income"); + }); + } \ No newline at end of file diff --git a/src/main/resources/static/assets/js/project_budget_plan.js b/src/main/resources/static/assets/js/project_budget_plan.js index 8a47d62..219d5ba 100644 --- a/src/main/resources/static/assets/js/project_budget_plan.js +++ b/src/main/resources/static/assets/js/project_budget_plan.js @@ -4,8 +4,10 @@ BUDGET_PLAN_DETAIL_ARR=["month","deviceCost","engineerCost","projectManageCost","earnestMoneyCost","totalCost","saleIncome","earnestMoneyIncome","totalIncome","fundBalance","capitalInterest","underwrittenPlan","repaymentPlan"]; BUDGET_PLAN_DETAIL2={ "month":[true,"月份"], - "deviceCost":[false,"设备支出","number"], - "engineerCost":[false,"工程支出","number"], + "deviceCost":[false,"设备付款","number"], + "projectCost":[false,"工程付款","number"], + "serviceCost ":[false,"服务付款","number"], + "otherCost":[false,"其他付款","number"], "projectManageCost":[false,"经营性开支","number"], "earnestMoneyCost":[false,"保证金支出","number"], "totalCost":[false,"支出合计","number"], @@ -20,8 +22,10 @@ BUDGET_PLAN_DETAIL2={ BUDGET_PLAN_DETAIL={ "month":[true,"月份"], - "deviceCost":[true,"设备支出","number"], - "engineerCost":[true,"工程支出","number"], + "deviceCost":[true,"设备付款","number"], + "projectCost":[false,"工程付款","number"], + "serviceCost ":[false,"服务付款","number"], + "otherCost":[false,"其他付款","number"], "projectManageCost":[true,"经营性开支","number"], "earnestMoneyCost":[true,"保证金支出","number"], "totalCost":[true,"支出合计","number"], @@ -416,7 +420,11 @@ function appendTrBudgetPlan2() { var template = '\n' + ' \n' + ' \n' + - ' \n' + + // ' \n' + + ' \n' + + ' \n' + + ' \n' + + ' \n' + ' \n' + ' \n' + @@ -548,17 +556,57 @@ function bindChangeableInputBudgetPlanDetail() { updatePageData(); }); //工程支出改变 - $(".input-changeable-engineer-cost-budget-plan").change(function () { + $(".input-changeable-projectCost-cost-budget-plan").change(function () { var engineerCost = f2($(this).val()); //找到对应的设备支出、经营性支出、保证金支出 var deviceCost = f2($(this).parent().parent().find(".input-changeable-device-cost-budget-plan").val()); var projectManageCost = f2($(this).parent().parent().find(".input-changeable-project-manage-cost-budget-plan").val()); var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); + var engineerCost2 = f2($(this).parent().parent().find(".input-changeable-serviceCost-cost-budget-plan").val()); + var engineerCost3 = f2($(this).parent().parent().find(".input-changeable-otherCost-cost-budget-plan").val()); //更新本月所有项支出 - $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost)); + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost+engineerCost2+engineerCost3)); //更新所有月工程支出总额 - updateBudgetPlanTotal("input-changeable-engineer-cost-budget-plan","input-total-engineer-cost-budget-plan"); + updateBudgetPlanTotal("input-changeable-projectCost-cost-budget-plan","input-total-projectCost-cost-budget-plan"); + //更新所有月支出总额 + updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-total-cost-budget-plan"); + updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-title-total-cost-budget-plan"); + + updatePageData(); + }); + $(".input-changeable-serviceCost-cost-budget-plan").change(function () { + var engineerCost = f2($(this).val()); + //找到对应的设备支出、经营性支出、保证金支出 + var deviceCost = f2($(this).parent().parent().find(".input-changeable-device-cost-budget-plan").val()); + var projectManageCost = f2($(this).parent().parent().find(".input-changeable-project-manage-cost-budget-plan").val()); + var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); + var engineerCost2 = f2($(this).parent().parent().find(".input-changeable-serviceCost-cost-budget-plan").val()); + var engineerCost3 = f2($(this).parent().parent().find(".input-changeable-otherCost-cost-budget-plan").val()); + + //更新本月所有项支出 + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost+engineerCost2+engineerCost3)); + //更新所有月工程支出总额 + updateBudgetPlanTotal("input-changeable-serviceCost-cost-budget-plan","input-total-serviceCost-cost-budget-plan"); + //更新所有月支出总额 + updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-total-cost-budget-plan"); + updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-title-total-cost-budget-plan"); + + updatePageData(); + }); + $(".input-changeable-otherCost-cost-budget-plan").change(function () { + var engineerCost = f2($(this).val()); + //找到对应的设备支出、经营性支出、保证金支出 + var deviceCost = f2($(this).parent().parent().find(".input-changeable-device-cost-budget-plan").val()); + var projectManageCost = f2($(this).parent().parent().find(".input-changeable-project-manage-cost-budget-plan").val()); + var earnestMoneyCost = f2($(this).parent().parent().find(".input-changeable-earnest-money-cost-budget-plan").val()); + var engineerCost2 = f2($(this).parent().parent().find(".input-changeable-serviceCost-cost-budget-plan").val()); + var engineerCost3 = f2($(this).parent().parent().find(".input-changeable-otherCost-cost-budget-plan").val()); + + //更新本月所有项支出 + $(this).parent().parent().find(".input-changeable-total-cost-budget-plan").val(f2Fixed(deviceCost+engineerCost+projectManageCost+earnestMoneyCost+engineerCost2+engineerCost3)); + //更新所有月工程支出总额 + updateBudgetPlanTotal("input-changeable-otherCost-cost-budget-plan","input-total-otherCost-cost-budget-plan"); //更新所有月支出总额 updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-total-cost-budget-plan"); updateBudgetPlanTotal("input-changeable-total-cost-budget-plan","input-total-title-total-cost-budget-plan"); diff --git a/src/main/resources/static/assets/js/project_common.js b/src/main/resources/static/assets/js/project_common.js index a1ec21e..798f7a1 100644 --- a/src/main/resources/static/assets/js/project_common.js +++ b/src/main/resources/static/assets/js/project_common.js @@ -260,14 +260,15 @@ function calCostInclude() { var costPurchaseBuildTaxInclude = inputVal("costPurchaseBuildTaxInclude"); var costPurchaseServiceTaxInclude = inputVal("costPurchaseServiceTaxInclude"); var costPurchaseOtherTaxInclude = inputVal("costPurchaseOtherTaxInclude"); - var costProjectManageTaxInclude = inputVal("costProjectManageTaxInclude"); + // var costProjectManageTaxInclude = inputVal("costProjectManageTaxInclude"); + // f2(costProjectManageTaxInclude) var costOtherOtherTaxInclude = inputVal("costOtherOtherTaxInclude"); var $costTotalTaxInclude = $("input[name='costTotalTaxInclude']"); $costTotalTaxInclude.val(f2Fixed(f2(costPurchaseDeviceTaxInclude) +f2(costPurchaseBuildTaxInclude) +f2(costPurchaseServiceTaxInclude)+f2(costPurchaseOtherTaxInclude) - +f2(costProjectManageTaxInclude)+f2(costOtherOtherTaxInclude))); + +f2(costOtherOtherTaxInclude))); } /** * 统计成本(不含税),有一项没填就置空 @@ -277,7 +278,8 @@ function calCostExclude() { var costPurchaseBuildTaxExclude = inputVal("costPurchaseBuildTaxExclude"); var costPurchaseServiceTaxExclude = inputVal("costPurchaseServiceTaxExclude"); var costPurchaseOtherTaxExclude = inputVal("costPurchaseOtherTaxExclude"); - var costProjectManageTaxExclude = inputVal("costProjectManageTaxExclude"); + // var costProjectManageTaxExclude = inputVal("costProjectManageTaxExclude");\ + // f2(costProjectManageTaxExclude) var costOtherOtherTaxExclude = inputVal("costOtherOtherTaxExclude"); @@ -285,7 +287,7 @@ function calCostExclude() { $costTotalTaxExclude.val(f2Fixed(f2(costPurchaseDeviceTaxExclude)+f2(costPurchaseBuildTaxExclude) +f2(costPurchaseServiceTaxExclude)+f2(costPurchaseOtherTaxExclude) - +f2(costProjectManageTaxExclude)+f2(costOtherOtherTaxExclude))); + +f2(costOtherOtherTaxExclude))); } /** * 统计其他其他税金 diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index e95471f..7d95f91 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -107,8 +107,8 @@
  • 项目基本信息
  • 收入明细表
  • 收款计划表
  • -
  • 采购成本明细表
  • -
  • 项目管理费用
  • +
  • 采购成本项目
  • +
  • 项目管理费用表
  • 资金计划表
  • 项目预算信息
  • @@ -794,7 +794,7 @@ <#-- --> <#-- --> - + @@ -899,27 +899,27 @@ 序号 - 费用项目 - 采购类别 - 名称 - 单位 - 数量 - 单价 + 采购成本项目 + 产品大类 +<#-- 名称--> +<#-- 单位--> +<#-- 数量--> +<#-- 单价--> 税率(%) 含税总金额(元) 不含税金额(元) 税金(元) - 签约方 - 是否垫资 - 预估垫资金额(元) - 支出时间 - 支出金额(元) - 付款方式 + 供应商 +<#-- 是否垫资--> +<#-- 预估垫资金额(元)--> +<#-- 支出时间--> +<#-- 支出金额(元)--> +<#-- 付款方式--> 备注 操作 - + <#if costDetails??> <#list costDetails as costDetail> @@ -947,26 +947,26 @@ - - - > - +<#-- --> +<#-- --> +<#-- --> +<#-- --> - + - - - - - - - +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> @@ -976,20 +976,20 @@ - - - > - +<#-- --> +<#-- --> +<#-- --> +<#-- --> - - - - - +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> @@ -1013,12 +1013,12 @@ 序号 - 财务费用类别 + 费用类别 业务项目 项目明细 - 单位 - 数量 - 单价 +<#-- 单位--> +<#-- 数量--> +<#-- 单价--> 总金额(元) 支出时间 支出金额(元) @@ -1063,10 +1063,10 @@ type="text"<#else>type="hidden" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage am-modal-prompt-input-cost-project-manage-category2" value="${costProjectManageDetail.name!}"> - - oninput="if(value.length>8)value=value.slice(0,8)"> - - +<#-- --> +<#-- --> +<#-- --> + @@ -1083,9 +1083,9 @@ - - > - +<#-- --> +<#-- --> +<#-- --> @@ -1133,11 +1133,17 @@ - - - - - + +<#-- --> + + + + + + + + + @@ -1152,7 +1158,11 @@ - + + + + + @@ -1168,7 +1178,11 @@ - + + + + + @@ -1187,7 +1201,10 @@ - + + + + @@ -1366,7 +1383,7 @@ 合计 - + (备注:财务计取以不含税方式核算) From 8b8878890618ab58a0820062884cff11486ae09c Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Mon, 28 Oct 2024 19:01:21 +0800 Subject: [PATCH 3/9] =?UTF-8?q?feat=20=E6=94=B6=E5=85=A5=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8:=201:=E5=AF=BC=E5=87=BA=E4=BF=AE=E6=94=B9=202:?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E8=AE=A1=E5=88=92=E6=94=B9=E4=B8=BA=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E8=A1=A8=20=20=E6=95=B4=E4=BD=93=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/backend/ProjectController.java | 18 +++--- .../work/model/ProjectBudgetPayPlanTemp.java | 19 ++++++ .../ProjectBudgetPayPlanTempRepository.java | 10 +++ .../work/service/ProjectBudgetService.java | 17 +++-- .../work/utils/excel/ExportExcelUtils.java | 63 +++++++++---------- 5 files changed, 82 insertions(+), 45 deletions(-) create mode 100644 src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTemp.java create mode 100644 src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTempRepository.java diff --git a/src/main/java/cn/palmte/work/controller/backend/ProjectController.java b/src/main/java/cn/palmte/work/controller/backend/ProjectController.java index 4c4dbe4..3e2f4d8 100644 --- a/src/main/java/cn/palmte/work/controller/backend/ProjectController.java +++ b/src/main/java/cn/palmte/work/controller/backend/ProjectController.java @@ -605,15 +605,15 @@ public class ProjectController extends BaseController { public ResponseMsg budgetEditSaveBudgetPayPlan(@RequestBody String body) { JSONObject jsonObject = JSON.parseObject(body); JSONArray details = jsonObject.getJSONArray(DETAILS); - List detailList = new ArrayList<>(details.size()); + List detailList = new ArrayList<>(details.size()); for (int i = 0; i < details.size(); i++) { - ProjectBudgetPayPlan detail = details.getObject(i, ProjectBudgetPayPlan.class); + ProjectBudgetPayPlanTemp detail = details.getObject(i, ProjectBudgetPayPlanTemp.class); detailList.add(detail); } Project project = projectService.getProject(jsonObject.getInteger(PROJECT_ID)); - projectBudgetService.saveBudgetPayPlan(project, detailList); + projectBudgetService.saveBudgetPayPlanTemp(project, detailList); return ResponseMsg.buildSuccessMsg("成功"); } @@ -1254,8 +1254,8 @@ public class ProjectController extends BaseController { //收入明细 List budgetIncomeDetail = projectBudgetService.getBudgetIncomeDetail(project); BigDecimal incomeTotalAmount = projectBudgetService.getBudgetIncomeAmount(project); - String[] headers2 = {"序号", "类别", "名称", "规格类型", "参数", "单位", "数量", "单价", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)"}; - String[] columns2 = {"tempId", "type", "name", "spec", "param", "unit", "amount", "price", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax"}; + String[] headers2 = {"序号", "产品大类", "名称", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)"}; + String[] columns2 = {"tempId", "type", "name", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax"}; exportExcelUtils.exportIncomeDetailExcel(headers2, columns2, project, budgetBean, budgetIncomeDetail, incomeTotalAmount, "yyyy-MM-dd", 0, "收入明细表", outputStream); exportExcelUtils.end(outputStream); @@ -1302,8 +1302,8 @@ public class ProjectController extends BaseController { BigDecimal costPayAmountTotal = projectBudgetService.getBudgetCostPayAmountTotal(project); List procurementTypes = procurementTypeService.allProcurementTypeList(); Map procurementMap = procurementTypes.stream().collect(Collectors.toMap(ProcurementType::getId, ProcurementType::getName)); - String[] headers3 = {"序号", "费用项目", "采购类别", "名称", "单位", "数量", "单价", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)", "签约方", "是否垫资", "预估垫资金额(元)", "支出时间", "支出金额(元)", "付款方式", "备注"}; - String[] columns3 = {"tempId", "type", "category", "name", "unit", "amount", "price", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax", "contractParty", "isUnderwritten", "underwrittenAmount", "payTime", "payAmount", "payWay", "remark"}; + String[] headers3 = {"序号", "采购成本项目", "产品大类", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)", "供应商", "备注"}; + String[] columns3 = {"tempId", "type", "category", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax", "contractParty", "remark"}; exportExcelUtils.exportCostDetailExcel(headers3, columns3, project, budgetBean, budgetCostDetail, costTotalAmount, costUnderwrittenAmountTotal, costPayAmountTotal, procurementMap, "yyyy-MM-dd", 0, "采购成本明细表", outputStream); exportExcelUtils.end(outputStream); @@ -1325,8 +1325,8 @@ public class ProjectController extends BaseController { List budgetCostProjectManageDetail = projectBudgetService.getBudgetCostProjectManageDetail(project); BigDecimal costProjectManageTotalAmount = projectBudgetService.getBudgetCostProjectManageAmount(project); BigDecimal managePayAmountTotal = projectBudgetService.getBudgetCostProjectManagePayAmount(project); - String[] headers4 = {"序号", "财务费用类别", "业务项目", "项目明细", "单位", "数量", "单价", "总金额(元)", "支出时间", "支出金额(元)", "预估计算方法", "预估依据", "备注"}; - String[] columns4 = {"tempId", "type", "name", "detail", "unit", "amount", "price", "total", "payTime", "payAmount", "predictMethod", "predictWhy", "remark"}; + String[] headers4 = {"序号", "费用类别", "业务项目", "项目明细", "总金额(元)", "支出时间", "支出金额(元)", "预估计算方法", "预估依据", "备注"}; + String[] columns4 = {"tempId", "type", "name", "detail", "total", "payTime", "payAmount", "predictMethod", "predictWhy", "remark"}; exportExcelUtils.exportCostManageDetailExcel(headers4, columns4, project, budgetBean, budgetCostProjectManageDetail, costProjectManageTotalAmount, managePayAmountTotal, "yyyy-MM-dd", 0, "项目管理成本表", outputStream); exportExcelUtils.end(outputStream); diff --git a/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTemp.java b/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTemp.java new file mode 100644 index 0000000..17aaf00 --- /dev/null +++ b/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTemp.java @@ -0,0 +1,19 @@ +package cn.palmte.work.model; + +import org.springframework.beans.BeanUtils; + +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * 项目付款计划表 + */ +@Entity +@Table(name = "project_budget_pay_plan_temp") +public class ProjectBudgetPayPlanTemp extends ProjectBudgetPayPlanBase { + public ProjectBudgetPayPlan toProjectBudgetPayPlanDetail() { + ProjectBudgetPayPlan projectBudgetPayPlan = new ProjectBudgetPayPlan(); + BeanUtils.copyProperties(this, projectBudgetPayPlan); + return projectBudgetPayPlan; + } +} \ No newline at end of file diff --git a/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTempRepository.java b/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTempRepository.java new file mode 100644 index 0000000..e527afb --- /dev/null +++ b/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTempRepository.java @@ -0,0 +1,10 @@ +package cn.palmte.work.model; + +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface ProjectBudgetPayPlanTempRepository extends JpaRepository { + List findAllByProjectIdEquals(int id); + +} diff --git a/src/main/java/cn/palmte/work/service/ProjectBudgetService.java b/src/main/java/cn/palmte/work/service/ProjectBudgetService.java index 7994279..8740341 100644 --- a/src/main/java/cn/palmte/work/service/ProjectBudgetService.java +++ b/src/main/java/cn/palmte/work/service/ProjectBudgetService.java @@ -13,7 +13,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import top.jfunc.common.utils.CollectionUtil; -import java.lang.reflect.InvocationTargetException; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -41,6 +40,8 @@ public class ProjectBudgetService { @Autowired private ProjectBudgetPayPlanRepository projectBudgetPayPlanRepository; @Autowired + private ProjectBudgetPayPlanTempRepository projectBudgetPayPlanTempRepository; + @Autowired private ProjectBudgetIncomePlanDetailTempRepository projectBudgetIncomePlanDetailTempRepository; @Autowired private ProjectBudgetCostDetailRepository projectBudgetCostDetailRepository; @@ -1105,6 +1106,14 @@ public class ProjectBudgetService { .collect(Collectors.toList()); projectBudgetCostDetailRepository.save(costDetails); } + //付款计划表 + List projectBudgetPayPlanTemps = projectBudgetPayPlanTempRepository.findAllByProjectIdEquals(p.getId()); + if(CollectionUtil.isNotEmpty(projectBudgetPayPlanTemps)){ + List costDetails = projectBudgetPayPlanTemps.stream() + .map(ProjectBudgetPayPlanTemp::toProjectBudgetPayPlanDetail) + .collect(Collectors.toList()); + projectBudgetPayPlanRepository.save(costDetails); + } //项目管理明细 List projectBudgetCostProjectManageDetailTemps = projectBudgetCostProjectManageDetailTempRepository.findAllByProjectIdEquals(p.getId()); if(CollectionUtil.isNotEmpty(projectBudgetCostProjectManageDetailTemps)){ @@ -1345,13 +1354,13 @@ public class ProjectBudgetService { return projectBudgetPayPlanRepository.findAllByProjectIdEquals(project.getId()); } - public void saveBudgetPayPlan(Project project, List detailList) { + public void saveBudgetPayPlanTemp(Project project, List detailList) { if(CollectionUtil.isNotEmpty(detailList)){ - for (ProjectBudgetPayPlan temp : detailList) { + for (ProjectBudgetPayPlanTemp temp : detailList) { temp.setProjectId(project.getId()); // temp.setUnderwrittenTaxRate(project.getUnderwrittenTaxRate()); } - projectBudgetPayPlanRepository.save(detailList); + projectBudgetPayPlanTempRepository.save(detailList); } } } diff --git a/src/main/java/cn/palmte/work/utils/excel/ExportExcelUtils.java b/src/main/java/cn/palmte/work/utils/excel/ExportExcelUtils.java index ec94315..6243552 100644 --- a/src/main/java/cn/palmte/work/utils/excel/ExportExcelUtils.java +++ b/src/main/java/cn/palmte/work/utils/excel/ExportExcelUtils.java @@ -7,18 +7,14 @@ import cn.palmte.work.utils.ObjectKit; import cn.palmte.work.utils.Utils; import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.streaming.SXSSFSheet; -import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import top.jfunc.common.db.bean.Record; import javax.servlet.ServletOutputStream; import java.io.IOException; import java.io.OutputStream; import java.math.BigDecimal; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -196,7 +192,7 @@ public class ExportExcelUtils { index = index + 3; // 成本 Row costRow = sheet.createRow(index++); - createTitleRow(costRow, "成本"); + createTitleRow(costRow, "采购成本"); index = createCostRow(budgetBean, sheet, index, otherName, costTaxRates); index = index + 3; // 管理 @@ -363,7 +359,7 @@ public class ExportExcelUtils { createEngineerCostRow(budgetBean, sheet, index++); createServiceCostRow(budgetBean, sheet, index++); createOtherCostRow(budgetBean, sheet, index++); - createManageCostRow(budgetBean, sheet, index++); + // createManageCostRow(budgetBean, sheet, index++); createOtherRow(budgetBean, sheet, index++, otherName); createTotalCostRow(budgetBean, sheet, index++); Row row = sheet.createRow(index++); @@ -443,7 +439,7 @@ public class ExportExcelUtils { Cell thirdCell = row.createCell(2); thirdCell.setCellStyle(style2); thirdCell.setCellType(CellType.STRING); - thirdCell.setCellValue("施工"); + thirdCell.setCellValue("工程"); Cell fourthCell = row.createCell(3); fourthCell.setCellStyle(style2); fourthCell.setCellType(CellType.NUMERIC); @@ -523,23 +519,11 @@ public class ExportExcelUtils { Cell secondCell = row.createCell(1); secondCell.setCellStyle(style2); secondCell.setCellType(CellType.STRING); - secondCell.setCellValue("项目管理成本"); + secondCell.setCellValue("项目管理费用"); Cell thirdCell = row.createCell(2); thirdCell.setCellStyle(style2); thirdCell.setCellType(CellType.STRING); - thirdCell.setCellValue("项目管理成本"); - Cell fourthCell = row.createCell(3); - fourthCell.setCellStyle(style2); - fourthCell.setCellType(CellType.NUMERIC); - fourthCell.setCellValue(Utils.format(budgetBean.getCostProjectManageTaxInclude())); - Cell fifthCell = row.createCell(4); - fifthCell.setCellStyle(style2); - fifthCell.setCellType(CellType.NUMERIC); - fifthCell.setCellValue(Utils.format(budgetBean.getCostProjectManageTaxExclude())); - Cell sixthCell = row.createCell(5); - sixthCell.setCellStyle(style2); - sixthCell.setCellType(CellType.STRING); - sixthCell.setCellValue("财务计取以不含税方式核算"); + thirdCell.setCellValue(Utils.format(budgetBean.getCostProjectManageTaxExclude())); } private void createOtherRow(BudgetBean budgetBean, XSSFSheet sheet, int index, String otherName) { @@ -598,10 +582,28 @@ public class ExportExcelUtils { sixthCell.setCellValue(Utils.format(budgetBean.getCostTotalTax())); } + private void createManageTotalCostRow(BudgetBean budgetBean, XSSFSheet sheet, int index) { + Row row = sheet.createRow(index); + Cell firstCell = row.createCell(0); + firstCell.setCellStyle(style2); + firstCell.setCellType(CellType.STRING); + firstCell.setCellValue("合计"); + Cell secondCell = row.createCell(1); + secondCell.setCellStyle(style2); + secondCell.setCellType(CellType.STRING); + secondCell.setCellValue(""); + Cell thirdCell = row.createCell(2); + thirdCell.setCellStyle(style2); + thirdCell.setCellType(CellType.STRING); + thirdCell.setCellValue(Utils.format(budgetBean.getCostProjectManageTaxExclude().add(budgetBean.getCostExpropriationTaxExclude()))); + } + private int createManageRow(BudgetBean budgetBean, XSSFSheet sheet, int index) { createSubTitleManageRow(sheet, index++); createExpropriationRow(budgetBean, sheet, index++); - createCompanyManageRow(budgetBean, sheet, index++); + createManageCostRow(budgetBean, sheet, index++); + createManageTotalCostRow(budgetBean, sheet, index++); + // createCompanyManageRow(budgetBean, sheet, index++); Row row = sheet.createRow(index++); Cell remarkCell = row.createCell(0); remarkCell.setCellStyle(style); @@ -663,7 +665,7 @@ public class ExportExcelUtils { createGrossProfitARow(budgetBean, sheet, index++); createGrossProfitRow(budgetBean, sheet, index++); // createGrossProfitMarginRow(budgetBean, sheet, index++); - createContributionProfitRow(budgetBean, sheet, index++); +// createContributionProfitRow(budgetBean, sheet, index++); // createContributionProfitRateRow(budgetBean, sheet, index++); return index; } @@ -706,7 +708,7 @@ public class ExportExcelUtils { Cell fourthCell = row.createCell(3); fourthCell.setCellStyle(style2); fourthCell.setCellType(CellType.STRING); - fourthCell.setCellValue("毛利=收入总计(不含税)-成本总计(不含税)"); + fourthCell.setCellValue("项目毛利A=收入合计(不含税)-采购成本合计(不含税)"); } private void createGrossProfitRow(BudgetBean budgetBean, XSSFSheet sheet, int index) { @@ -714,7 +716,7 @@ public class ExportExcelUtils { Cell firstCell = row.createCell(0); firstCell.setCellStyle(style2); firstCell.setCellType(CellType.STRING); - firstCell.setCellValue("项目毛利(元)"); + firstCell.setCellValue("项目毛利B(元)"); Cell secondCell = row.createCell(1); secondCell.setCellStyle(style2); secondCell.setCellType(CellType.NUMERIC); @@ -722,11 +724,11 @@ public class ExportExcelUtils { Cell thirdCell = row.createCell(2); thirdCell.setCellStyle(style2); thirdCell.setCellType(CellType.NUMERIC); - thirdCell.setCellValue(Utils.format(budgetBean.getProjectGrossProfit())); + thirdCell.setCellValue(Utils.format(budgetBean.getProjectGrossProfitA().subtract(budgetBean.getCostProjectManageTaxExclude()).subtract(budgetBean.getCostExpropriationTaxExclude()))); Cell fourthCell = row.createCell(3); fourthCell.setCellStyle(style2); fourthCell.setCellType(CellType.STRING); - fourthCell.setCellValue("毛利=收入总计(不含税)-成本总计(不含税)-财务费用总计(不含税)"); + fourthCell.setCellValue("项目毛利B=项目毛利A-财务费用-项目管理费用"); } // private void createGrossProfitMarginRow(BudgetBean budgetBean, XSSFSheet sheet, int index) { @@ -1375,13 +1377,10 @@ public class ExportExcelUtils { if (i == 0) { totalCell.setCellType(CellType.STRING); totalCell.setCellValue("总计"); - } else if (i == 5) { - totalCell.setCellType(CellType.NUMERIC); - totalCell.setCellValue(Utils.format(costProjectManageTotalAmount)); - } else if (i == 7) { + } else if (i == 4) { totalCell.setCellType(CellType.NUMERIC); totalCell.setCellValue(Utils.format(budgetBean.getCostProjectManageTaxExclude())); - } else if (i == 9) { + } else if (i == 6) { totalCell.setCellType(CellType.NUMERIC); totalCell.setCellValue(Utils.format(managePayAmountTotal)); } else { From b65457f0ecfa832b34e796560d5b3851aeb1fc30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98wangjiuyun?= <‘1595161655@qq.com> Date: Mon, 28 Oct 2024 20:03:47 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=83=A8=E5=88=86?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/assets/js/project_budget.js | 7 +- .../static/assets/js/project_budget_cost.js | 36 +- .../static/assets/js/project_budget_income.js | 22 +- .../static/assets/js/project_budget_pay.js | 340 ++++++++++++++++++ .../static/assets/js/project_budget_plan.js | 6 +- .../templates/admin/project_approve.ftl | 1 + .../templates/admin/project_budget_edit.ftl | 114 ++++-- 7 files changed, 449 insertions(+), 77 deletions(-) create mode 100644 src/main/resources/static/assets/js/project_budget_pay.js diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js index 46e77a6..38e595d 100644 --- a/src/main/resources/static/assets/js/project_budget.js +++ b/src/main/resources/static/assets/js/project_budget.js @@ -185,7 +185,12 @@ $(function () { // return; // } // console.log(message); - + // 保存付款计划表 + var dataPay = collectData("am-modal-prompt-input-pay"); + dataPay = prepareAjaxDataVerify(dataPay, pay_DETAIL2, $("#id").val()); + if(dataPay){ + postAjax(base+"/project/budgetEditSaveBudgetPayPlan", dataPay); + } var startTime = $("#startDate").val(); var endTime = $("#endDate").val(); if (startTime > endTime) { diff --git a/src/main/resources/static/assets/js/project_budget_cost.js b/src/main/resources/static/assets/js/project_budget_cost.js index 8f3c8b7..b21e529 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -4,43 +4,25 @@ //COST_DETAIL_ARR=["type","category","name","unit","amount","price","taxRate","totalTaxInclude","totalTaxExclude"]; COST_DETAIL2={ "num":[false,"序号","string"], - "type":[false,"费用项目","string"], - "category":[false,"采购类别","string"], - // "name":[false,"名称","string"], - // "unit":[false,"单位","string"], - // "amount":[false,"数量","number"], - // "price":[false,"单价","price"], + "type":[false,"采购成本项目","string"], + "category":[false,"产品大类","string"], "taxRate":[false,"税率","number"], "totalTaxInclude":[false,"含税总金额","number"], "totalTaxExclude":[false,"不含税金额","number"], "totalTax":[false,"税金","number"], - // "contractParty":[false,"签约方","string"], - // "isUnderwritten":[false,"是否垫资","string"], - // "underwrittenAmount":[false,"预估垫资金额","number"], - // "payTime":[false,"支出时间","string"], - // "payAmount":[false,"支出金额","number"], - // "payWay":[false,"付款方式","string"], + "contractParty":[false,"供应商","string"], "remark":[false,"备注","string"] }; COST_DETAIL={ "num":[false,"序号","string"], - "type":[true,"费用项目","string"], - "category":[true,"产品大类","string"], - "name":[true,"名称","string"], - // "unit":[true,"单位","string"], - // "amount":[true,"数量","number"], - // "price":[true,"单价","price"], - "taxRate":[true,"税率","number"], - "totalTaxInclude":[true,"含税总金额","number"], - "totalTaxExclude":[true,"不含税金额","number"], - "totalTax":[true,"税金","number"], + "type":[false,"采购成本项目","string"], + "category":[false,"产品大类","string"], + "taxRate":[false,"税率","number"], + "totalTaxInclude":[false,"含税总金额","number"], + "totalTaxExclude":[false,"不含税金额","number"], + "totalTax":[false,"税金","number"], "contractParty":[false,"供应商","string"], - // "isUnderwritten":[false,"是否垫资","string"], - // "underwrittenAmount":[false,"预估垫资金额","number"], - // "payTime":[false,"支出时间","string"], - // "payAmount":[false,"支出金额","number"], - // "payWay":[false,"付款方式","string"], "remark":[false,"备注","string"] }; /* diff --git a/src/main/resources/static/assets/js/project_budget_income.js b/src/main/resources/static/assets/js/project_budget_income.js index e6b58aa..06f8767 100644 --- a/src/main/resources/static/assets/js/project_budget_income.js +++ b/src/main/resources/static/assets/js/project_budget_income.js @@ -6,11 +6,6 @@ INCOME_DETAIL2={ "num":[false,"序号","string"], "type":[false,"类别","string"], "name":[false,"产品大类","string"], - // "spec":[false,"规格类型","string"], - // "param":[false,"参数","string"], - // "unit":[false,"单位","string"], - // "amount":[false,"数量","number"], - // "price":[false,"单价","price"], "taxRate":[false,"税率","number"], "totalTaxInclude":[false,"含税总金额","number"], "totalTaxExclude":[false,"不含税金额","number"], @@ -19,17 +14,12 @@ INCOME_DETAIL2={ INCOME_DETAIL={ "num":[false,"序号","string"], - "type":[true,"类别","string"], - "name":[true,"名称","string"], - "spec":[true,"规格类型","string"], - "param":[true,"参数","string"], - "unit":[true,"单位","string"], - "amount":[true,"数量","number"], - "price":[true,"单价","price"], - "taxRate":[true,"税率","number"], - "totalTaxInclude":[true,"含税总金额","number"], - "totalTaxExclude":[true,"不含税金额","number"], - "totalTax":[true,"税金","number"] + "type":[false,"类别","string"], + "name":[false,"产品大类","string"], + "taxRate":[false,"税率","number"], + "totalTaxInclude":[false,"含税总金额","number"], + "totalTaxExclude":[false,"不含税金额","number"], + "totalTax":[false,"税金","number"] }; /*$(function () { diff --git a/src/main/resources/static/assets/js/project_budget_pay.js b/src/main/resources/static/assets/js/project_budget_pay.js new file mode 100644 index 0000000..7f3c174 --- /dev/null +++ b/src/main/resources/static/assets/js/project_budget_pay.js @@ -0,0 +1,340 @@ +/** + * 一个采购成本详情的字段 + */ +//COST_DETAIL_ARR=["type","category","name","unit","amount","price","taxRate","totalTaxInclude","totalTaxExclude"]; +pay_DETAIL2={ + "num":[false,"序号","string"], + "payPoint":[false,"付款节点","string"], + "payTime":[false,"付款时间","string"], + "payProject":[false,"采购成本项目","number"], + "payAmount":[false,"付款金额","number"], + "supplier":[false,"供应商","number"], +}; + +pay_DETAIL={ + "num":[false,"序号","string"], + "payPoint":[false,"付款节点","string"], + "payTime":[false,"付款时间","string"], + "payProject":[false,"采购成本项目","number"], + "payAmount":[false,"付款金额","number"], + "supplier":[false,"供应商","number"], +}; +/* +[ + {"id":"1","name":"xxx1"},{"id":"2","name":"xxx2"} +] + */ +SELECT_TYPE_CATEGORY_DATA=[]; +/*{ + "1":[ + { + "id":"1", + "name":"华智产品" + }, + { + "id":"2", + "name":"紫光其他产品" + }, + { + "id":"3", + "name":"外购产品" + } + ], + "2":[ + { + "id":"4", + "name":"外购工程" + } + ], + "3":[ + { + "id":"5", + "name":"华智服务" + }, + { + "id":"6", + "name":"紫光其他服务" + }, + { + "id":"7", + "name":"外购服务" + } + ], + "4":[ + { + "id":"8", + "name":"其他" + } + ] +};*/ +SELECT_TYPE_CATEGORY_MAP_DATA={}; +/*{ + "1":"1", + "2":"1", + "3":"1", + "4":"2", + "5":"3", + "6":"3", + "7":"3", + "8":"4" +}; +*/ +SELECT_CATEGORY_TYPE_MAP_DATA={}; + +/*$(function () { + $("#cost-detail").click(function () { + $('#my-prompt-cost-detail').modal({ + relatedTarget: this, + closeOnConfirm:false, + onConfirm: function(e) { + //不能使用e.data,因为无法获取动态添加的 + var data = collectData("am-modal-prompt-input-cost"); + //data = prepareAjaxData(data, COST_DETAIL_ARR, $("#id").val(),false); + data = prepareAjaxDataVerify(data, COST_DETAIL, $("#id").val()); + if(data){ + postAjax(base+"/project/budgetEditSaveCostDetail", data, updateCostData); + } + }, + onCancel: function(e) { + } + }); + }); + $("#costAddBtn").click(function () { + appendTrCost(); + }); + + + + //初始化大类和类别的数据 + getAjax(base+"/procurement/type/map", null, initTypeCategory); +});*/ + +$(function () { +}); + +//保存采购成本明细表 +$(function () { + $("#payTableSave").click(function () { + //不能使用e.data,因为无法获取动态添加的 + var data = collectData("am-modal-prompt-input-pay"); + //data = prepareAjaxData(data, COST_DETAIL_ARR, $("#id").val(),false); + data = prepareAjaxDataVerify(data, pay_DETAIL2, $("#id").val()); + if(data){ + postAjax(base+"/project/budgetEditSaveBudgetPayPlan", data, updateCostData); + } + }); + + $("#payAddBtn").click(function () { + appendTrPay(); + $("#payAddBtn").blur(); + }); + + //绑定删除按钮 + bindDeleteBtnPay(); + + //初始化大类和类别的数据 + getAjax(base+"/procurement/type/map", null, initTypeCategory); +}); + +/** + * 采购成本增加一行 + */ +function appendTrPay() { + //console.log(SELECT_TYPE_CATEGORY_DATA); + var options = '\r\n'; + SELECT_TYPE_CATEGORY_DATA.forEach(function (e) { + options+='\r\n'; + }); + + var template = '' + + '' + + ''+ + ''+ + ''+ + ''+ + ''+ + '' + + '' + + ''+ + + ''; + + $("#payTotal").before(template); + //重新绑定删除事件和input修改事件 + bindDeleteBtnPay(); + //绑定序号 + bindNum(); + //绑定时间 + bindTime(); + //绑定总计值 + bindPayTotal(); + //绑定数字输入框保留两位小数 + bindNumberInput(); + + if ($('#costTable').find('tbody') && $('#costTable').find('tbody')[0]) { + $('#costTable').find('tbody')[0].scrollTop = $('#costTable').find('tbody')[0].scrollHeight + } +} + +/** + * 绑定时间选择器 + */ +function bindTime() { + $('[data-am-datepicker]').datepicker(); +} + +/** + * 绑定每一行的删除事件,删除当前的一行tr,修改总计值 + */ +function bindDeleteBtnPay() { + $(".am-modal-line-delete").click(function () { + //删除自己对应的tr + $(this).parent().parent().remove(); + bindNum(); + updateTotal("input-changeable-pay-amount", "input-changeable-pay-amount-total"); + }); +} + +/** + * 绑定每个可改变的输入框,修改后改变对应输入框的值 + */ +function bindPayTotal() { + //数量改变 + $(".input-changeable-pay-amount").change(function () { + updateTotal("input-changeable-pay-amount", "input-changeable-pay-amount-total"); + }); +} + +/** + * 更新页面收入的数据【累加】 + */ +function updateCostData(data, returnData) { + var details = data.details; + var deviceTaxInclude = 0; + var deviceTaxExclude = 0; + var deviceTax = 0; + var buildTaxInclude = 0; + var buildTaxExclude = 0; + var buildTax = 0; + var serviceTaxInclude = 0; + var serviceTaxExclude = 0; + var serviceTax = 0; + var otherTaxInclude = 0; + var otherTaxExclude = 0; + var otherTax = 0; + var costTaxRates = ""; + var set = new Set(); + details.forEach(function (t, number, ts) { + if(t["type"] == "1"){ + //设备类 + deviceTaxInclude += f2(t["totalTaxInclude"]); + deviceTaxExclude += f2(t["totalTaxExclude"]); + deviceTax += f2(t["totalTax"]); + }else if(t["type"] == "2"){ + //施工类 + buildTaxInclude += f2(t["totalTaxInclude"]); + buildTaxExclude += f2(t["totalTaxExclude"]); + buildTax += f2(t["totalTax"]); + }else if(t["type"] == "3"){ + //服务类 + serviceTaxInclude += f2(t["totalTaxInclude"]); + serviceTaxExclude += f2(t["totalTaxExclude"]); + serviceTax += f2(t["totalTax"]); + }else if(t["type"] == "4"){ + //其他类 + otherTaxInclude += f2(t["totalTaxInclude"]); + otherTaxExclude += f2(t["totalTaxExclude"]); + otherTax += f2(t["totalTax"]); + } + if (!set.has(t["taxRate"])) { + costTaxRates += f2Fixed(t["taxRate"]) + "%,"; + set.add(t["taxRate"]); + } + }); + $("input[name='costPurchaseDeviceTaxInclude']").val(f2Fixed(deviceTaxInclude)); + $("input[name='costPurchaseDeviceTaxExclude']").val(f2Fixed(deviceTaxExclude)); + $("input[name='costPurchaseDeviceTax']").val(f2Fixed(deviceTax)); + $("input[name='costPurchaseBuildTaxInclude']").val(f2Fixed(buildTaxInclude)); + $("input[name='costPurchaseBuildTaxExclude']").val(f2Fixed(buildTaxExclude)); + $("input[name='costPurchaseBuildTax']").val(f2Fixed(buildTax)); + $("input[name='costPurchaseServiceTaxInclude']").val(f2Fixed(serviceTaxInclude)); + $("input[name='costPurchaseServiceTaxExclude']").val(f2Fixed(serviceTaxExclude)); + $("input[name='costPurchaseServiceTax']").val(f2Fixed(serviceTax)); + $("input[name='costPurchaseOtherTaxInclude']").val(f2Fixed(otherTaxInclude)); + $("input[name='costPurchaseOtherTaxExclude']").val(f2Fixed(otherTaxExclude)); + $("input[name='costPurchaseOtherTax']").val(f2Fixed(otherTax)); + + + //资金计划表中的 + $(".input-total-title-device-cost-budget-plan").val(f2Fixed(deviceTaxInclude)); + $(".input-total-title-engineer-cost-budget-plan").val(f2Fixed(f2(serviceTaxInclude)+f2(buildTaxInclude)+f2(otherTaxInclude))); + $(".input-total-title-total-cost-budget-plan").val(f2Fixed(f2(deviceTaxInclude)+f2(buildTaxInclude)+f2(serviceTaxInclude)+f2(otherTaxInclude) + +f2($(".input-total-title-project-manage-cost-budget-plan").val()) + +f2($(".input-total-title-earnest-money-cost-budget-plan").val()))); + + /* var costOtherOtherTaxInclude = f2($("input[name='costOtherOtherTaxInclude']").val()); + var costOtherOtherTaxExclude = f2($("input[name='costOtherOtherTaxExclude']").val()); + + var costProjectManageTaxInclude = f2($("input[name='costProjectManageTaxInclude']").val()); + var costProjectManageTaxExclude = f2($("input[name='costProjectManageTaxExclude']").val()); + + $("input[name='costTotalTaxInclude']").val(f2(deviceTaxInclude+buildTaxInclude+serviceTaxInclude+otherTaxInclude+costOtherOtherTaxInclude+costProjectManageTaxInclude)); + $("input[name='costTotalTaxExclude']").val(f2(deviceTaxExclude+buildTaxExclude+serviceTaxExclude+otherTaxExclude+costOtherOtherTaxExclude+costProjectManageTaxExclude));*/ + + calCostExclude(); + calCostInclude(); + calCostTotalTax(); + updateProjectContributionProfitRate(); + if (costTaxRates.length > 0) { + $(".costTaxRates").text(costTaxRates.substr(0, costTaxRates.length - 1)); + } + + layuiAlert("保存成功"); + $('#my-prompt-cost-detail').modal('close'); +} + +/** + * 大类类别联动效果 + */ +/** + * 初始化数据 + * SELECT_TYPE_CATEGORY_MAP_DATA + * SELECT_CATEGORY_TYPE_MAP_DATA + * SELECT_TYPE_CATEGORY_DATA + */ +function initTypeCategory(params, data) { + var d = data.data; + var map = d.map; + + Object.keys(map).forEach(function (t, number) { + var temp = []; + map[t].forEach(function (g) { + temp.push({ + name:g.name, + id:g.id+"" + }); + }); + SELECT_TYPE_CATEGORY_MAP_DATA[t]= temp; + }); + + var procurementTypes = d.procurementTypes; + procurementTypes.forEach(function (e) { + SELECT_TYPE_CATEGORY_DATA.push({ + id:e.id+"", + name:e.name + }); + SELECT_CATEGORY_TYPE_MAP_DATA[e.id]=e.type; + }); + //--请选择--的映射 + //SELECT_CATEGORY_TYPE_MAP_DATA["xxxx"]="xxxx"; + + // console.log(SELECT_TYPE_CATEGORY_MAP_DATA); + // console.log(SELECT_TYPE_CATEGORY_DATA); + // console.log(SELECT_CATEGORY_TYPE_MAP_DATA); +} diff --git a/src/main/resources/static/assets/js/project_budget_plan.js b/src/main/resources/static/assets/js/project_budget_plan.js index 219d5ba..0a28620 100644 --- a/src/main/resources/static/assets/js/project_budget_plan.js +++ b/src/main/resources/static/assets/js/project_budget_plan.js @@ -421,9 +421,9 @@ function appendTrBudgetPlan2() { ' \n' + ' \n' + // ' \n' + - ' \n' + - ' \n' + - ' \n' + + ' \n' + + ' \n' + + ' \n' + ' \n' + ' \n' + diff --git a/src/main/resources/templates/admin/project_approve.ftl b/src/main/resources/templates/admin/project_approve.ftl index 99e2c48..c900859 100644 --- a/src/main/resources/templates/admin/project_approve.ftl +++ b/src/main/resources/templates/admin/project_approve.ftl @@ -3113,6 +3113,7 @@ + diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index 7d95f91..beedf50 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -107,7 +107,8 @@
  • 项目基本信息
  • 收入明细表
  • 收款计划表
  • -
  • 采购成本项目
  • +
  • 采购成本明细表
  • +
  • 付款计划表
  • 项目管理费用表
  • 资金计划表
  • 项目预算信息
  • @@ -833,7 +834,7 @@
    - +
    @@ -901,20 +902,11 @@ -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> @@ -947,26 +939,11 @@ -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> -<#-- --> @@ -1201,9 +1178,9 @@ - - - + + + @@ -1501,6 +1478,82 @@
    序号序号 采购成本项目 产品大类名称单位数量单价税率(%) 含税总金额(元) 不含税金额(元) 税金(元) 供应商是否垫资预估垫资金额(元)支出时间支出金额(元)付款方式备注 操作
    --> -<#-- --> -<#--
    +
    +
    +
    +
    +<#--
    --> +<#--
    --> +<#--
    --> +<#-- --> +<#-- --> +<#--
    --> + +<#-- --> +<#--
    --> +<#--
    --> +
    +
    + + + + + + + + + + + + + + <#if budgetPayPlan??> + <#list budgetPayPlan as payDetail> + + + + + + + + + + + + + + + + + + + + + +
    序号付款节点付款时间采购成本项目付款金额供应商操作
    + +
    +
    + +
    + +
    + +
    +
    @@ -1522,7 +1575,8 @@ - + From e735747a1b5b4cba2de2037f57fc315e7f20b72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98wangjiuyun?= <‘1595161655@qq.com> Date: Mon, 28 Oct 2024 20:24:14 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/assets/js/project_budget_plan.js | 12 ++++++++---- .../templates/admin/project_budget_edit.ftl | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/resources/static/assets/js/project_budget_plan.js b/src/main/resources/static/assets/js/project_budget_plan.js index 0a28620..dd4e6aa 100644 --- a/src/main/resources/static/assets/js/project_budget_plan.js +++ b/src/main/resources/static/assets/js/project_budget_plan.js @@ -386,10 +386,14 @@ function verifyBudgetPlan(){ function appendTrBudgetPlan() { var template = '\n' + ' \n' + - ' \n' + - ' \n' + - ' \n' + - ' \n' + + ' \n' + + + ' \n' + + ' \n' + + ' \n' + + + ' \n' + + ' \n' + ' \n' + ' \n' + ' \n' + diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index beedf50..95e0d76 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -1177,10 +1177,10 @@ <#list projectBudgetPlanDetails as projectBudgetPlanDetail> - - - - + + + + From 5c10b6a64e0a156f8fd691f042efdf37f03e7f33 Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Mon, 28 Oct 2024 20:30:29 +0800 Subject: [PATCH 6/9] =?UTF-8?q?feat=20=E6=94=B6=E5=85=A5=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8:=201:=E4=BB=98=E6=AC=BE=E8=AE=A1=E5=88=92=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=B8=B4=E6=97=B6=E8=A1=A8=20=20=E6=95=B4=E4=BD=93?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/backend/ProjectController.java | 8 +- .../work/model/ProjectBudgetPayPlanTemp.java | 1 + .../work/service/ProjectBudgetService.java | 106 ++++++------------ 3 files changed, 40 insertions(+), 75 deletions(-) diff --git a/src/main/java/cn/palmte/work/controller/backend/ProjectController.java b/src/main/java/cn/palmte/work/controller/backend/ProjectController.java index 3e2f4d8..d9d9f9b 100644 --- a/src/main/java/cn/palmte/work/controller/backend/ProjectController.java +++ b/src/main/java/cn/palmte/work/controller/backend/ProjectController.java @@ -1132,7 +1132,7 @@ public class ProjectController extends BaseController { @RequestMapping("/incomeTemplate") public void incomeTemplate(HttpServletResponse response) throws Exception{ - String[] headers = new String[]{"类别", "名称", "规格类型", "参数", "单位", "数量", "单价", "税率(%)"}; + String[] headers = new String[]{"类别", "产品大类", "税率(%)","含税总金额(元)"}; downloadHeader(response , Utils.generateExcelName("收入明细表批量导入模板")); ExportUtils exportUtils = new ExportUtils(headers); exportUtils.write(response.getOutputStream()); @@ -1167,7 +1167,7 @@ public class ProjectController extends BaseController { @RequestMapping("/costTemplate") public void costTemplate(HttpServletResponse response) throws Exception{ - String[] headers = new String[]{"费用项目", "采购类别", "名称", "单位", "数量", "单价", "税率(%)", "签约方", "是否垫资", "预估垫资金额(元)", "支出时间", "支出金额(元)", "付款方式", "备注"}; + String[] headers = new String[]{"采购成本项目", "产品大类", "税率(%)","含税总金额(元)" ,"供应商", "备注"}; downloadHeader(response , Utils.generateExcelName("采购成本明细表批量导入模板")); ExportUtils exportUtils = new ExportUtils(headers); exportUtils.write(response.getOutputStream()); @@ -1254,7 +1254,7 @@ public class ProjectController extends BaseController { //收入明细 List budgetIncomeDetail = projectBudgetService.getBudgetIncomeDetail(project); BigDecimal incomeTotalAmount = projectBudgetService.getBudgetIncomeAmount(project); - String[] headers2 = {"序号", "产品大类", "名称", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)"}; + String[] headers2 = {"序号", "类别", "产品大类", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)"}; String[] columns2 = {"tempId", "type", "name", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax"}; exportExcelUtils.exportIncomeDetailExcel(headers2, columns2, project, budgetBean, budgetIncomeDetail, incomeTotalAmount, "yyyy-MM-dd", 0, "收入明细表", outputStream); @@ -1347,7 +1347,7 @@ public class ProjectController extends BaseController { //资金计划明细 List projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project); ProjectBudgetPlanDetail projectBudgetPlanDetailTotal = projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails); - String[] headers5 = {"月份", "设备支出", "工程支出(含服务+施工+其他)", "经营性开支", "保证金支出", "支出合计", "销售收款", "保证金收款", "收款合计", "资金余额", "资金利息", "垫资计划", "还款计划"}; + String[] headers5 = {"月份", "设备支出", "工程支出(含服务+施工+其他)", "项目管理费用付款", "保证金付款", "付款合计", "销售收款", "保证金收款", "收款合计", "资金余额", "资金利息", "垫资计划", "还款计划"}; String[] row5 = {"month", "deviceCost", "engineerCost", "projectManageCost", "earnestMoneyCost", "totalCost", "saleIncome", "earnestMoneyIncome", "totalIncome", "fundBalance", "capitalInterest", "underwrittenPlan", "repaymentPlan"}; exportExcelUtils.exportPlanDetailExcel(headers5, row5, project, budgetBean, projectBudgetPlanDetails, projectBudgetPlanDetailTotal, "yyyy-MM-dd", 0, "资金计划表", outputStream); diff --git a/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTemp.java b/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTemp.java index 17aaf00..e7367ae 100644 --- a/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTemp.java +++ b/src/main/java/cn/palmte/work/model/ProjectBudgetPayPlanTemp.java @@ -14,6 +14,7 @@ public class ProjectBudgetPayPlanTemp extends ProjectBudgetPayPlanBase { public ProjectBudgetPayPlan toProjectBudgetPayPlanDetail() { ProjectBudgetPayPlan projectBudgetPayPlan = new ProjectBudgetPayPlan(); BeanUtils.copyProperties(this, projectBudgetPayPlan); + projectBudgetPayPlan.setId(null); return projectBudgetPayPlan; } } \ No newline at end of file diff --git a/src/main/java/cn/palmte/work/service/ProjectBudgetService.java b/src/main/java/cn/palmte/work/service/ProjectBudgetService.java index 8740341..09568ba 100644 --- a/src/main/java/cn/palmte/work/service/ProjectBudgetService.java +++ b/src/main/java/cn/palmte/work/service/ProjectBudgetService.java @@ -1143,6 +1143,15 @@ public class ProjectBudgetService { clearBudgetCostProjectManageDetail(p); //资金计划明细 clearBudgetPlanDetail(p); + //付款计划表 + clearBudgetPayPlan(p); + } + + private void clearBudgetPayPlan(Project p) { + List costDetails = projectBudgetPayPlanRepository.findAllByProjectIdEquals(p.getId()); + if(CollectionUtil.isNotEmpty(costDetails)){ + projectBudgetPayPlanRepository.deleteInBatch(costDetails); + } } @Transactional(rollbackFor = Exception.class) @@ -1192,36 +1201,22 @@ public class ProjectBudgetService { } else { throw new Exception("该类别不存在"); } - key = "名称"; + key = "产品大类"; o1 = m.get(key); temp.setName((String) o1); - key = "规格类型"; - o1 = m.get(key); - temp.setSpec((String) o1); - key = "参数"; - o1 = m.get(key); - temp.setParam((String) o1); - key = "单位"; - o1 = m.get(key); - temp.setUnit((String) o1); try { - key = "数量"; - o1 = m.get(key); - if (o1 != null) { - temp.setAmount(new BigDecimal((String) o1)); - } - key = "单价"; - o1 = m.get(key); - if (o1 != null) { - temp.setPrice(new BigDecimal((String) o1)); - } key = "税率(%)"; o1 = m.get(key); if (o1 != null) { temp.setTaxRate(new BigDecimal((String) o1)); } + key = "含税总金额(元)"; + o1 = m.get(key); + if (o1 != null) { + temp.setTotalTaxInclude(new BigDecimal((String) o1)); + } } catch (Exception e) { - throw new Exception("数量、单价、税率需为数字"); + throw new Exception("税率、含税总金额需为数字"); } incomeDetailTempList.add(temp); } @@ -1261,7 +1256,7 @@ public class ProjectBudgetService { String key; Object o1; temp.setProjectId(id); - key = "费用项目"; + key = "采购成本项目"; o1 = m.get(key); String type = (String) o1; if ("设备".equals(type)) { @@ -1275,75 +1270,36 @@ public class ProjectBudgetService { } else { throw new Exception("该费用项目不存在"); } - key = "采购类别"; + key = "产品大类"; o1 = m.get(key); String category = (String) o1; ProcurementType procurementType = procurementTypeRepository.findByName(category); if (procurementType != null && procurementType.getType() == temp.getType()) { temp.setCategory(procurementType.getId()); } else { - throw new Exception("该采购类别不存在或者与费用项目不匹配"); + throw new Exception("该采购类别不存在或者与采购成本项目不匹配"); } - key = "名称"; - o1 = m.get(key); - temp.setName((String) o1); - key = "单位"; - o1 = m.get(key); - temp.setUnit((String) o1); - key = "签约方"; + + key = "供应商"; o1 = m.get(key); temp.setContractParty((String) o1); - key = "是否垫资"; - o1 = m.get(key); - String isUnderwritten = (String) o1; - if ("是".equals(isUnderwritten)) { - temp.setIsUnderwritten(1); - } else if ("否".equals(isUnderwritten)) { - temp.setIsUnderwritten(2); - } else { - temp.setIsUnderwritten(0); - } + try { - key = "数量"; - o1 = m.get(key); - if (o1 != null) { - temp.setAmount(new BigDecimal((String) o1)); - } - key = "单价"; - o1 = m.get(key); - if (o1 != null) { - temp.setPrice(new BigDecimal((String) o1)); - } + key = "税率(%)"; o1 = m.get(key); if (o1 != null) { temp.setTaxRate(new BigDecimal((String) o1)); } - key = "预估垫资金额(元)"; + key = "含税总金额(元)"; o1 = m.get(key); if (o1 != null) { - temp.setUnderwrittenAmount(new BigDecimal((String) o1)); - } - key = "支出金额(元)"; - o1 = m.get(key); - if (o1 != null) { - temp.setPayAmount(new BigDecimal((String) o1)); + temp.setTotalTaxInclude(new BigDecimal((String) o1)); } + } catch (Exception e) { - throw new Exception("数量、单价、税率、预估垫资金额和支出金额需为数字"); + throw new Exception("税率、含税总金额(元)需为数字"); } - try { - key = "支出时间"; - o1 = m.get(key); - if (o1 != null) { - temp.setPayTime(DateKit.getDate((String) o1, DateKit.DATE_FORMAT)); - } - } catch (Exception e) { - throw new Exception("支出时间需为时间格式yyyy-MM-dd"); - } - key = "付款方式"; - o1 = m.get(key); - temp.setPayWay((String) o1); key = "备注"; o1 = m.get(key); temp.setRemark((String) o1); @@ -1355,6 +1311,7 @@ public class ProjectBudgetService { } public void saveBudgetPayPlanTemp(Project project, List detailList) { + clearBudgetPauPlanTemp(project); if(CollectionUtil.isNotEmpty(detailList)){ for (ProjectBudgetPayPlanTemp temp : detailList) { temp.setProjectId(project.getId()); @@ -1363,4 +1320,11 @@ public class ProjectBudgetService { projectBudgetPayPlanTempRepository.save(detailList); } } + + private void clearBudgetPauPlanTemp(Project project) { + List allByProjectIdEquals = projectBudgetPayPlanTempRepository.findAllByProjectIdEquals(project.getId()); + if(CollectionUtil.isNotEmpty(allByProjectIdEquals)){ + projectBudgetPayPlanTempRepository.deleteInBatch(allByProjectIdEquals); + } + } } From 35e8f01d1c147b91c30294582079674878fb5ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98wangjiuyun?= <‘1595161655@qq.com> Date: Mon, 28 Oct 2024 20:31:15 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/assets/js/project_budget_pay.js | 4 ++-- src/main/resources/templates/admin/project_budget_edit.ftl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/static/assets/js/project_budget_pay.js b/src/main/resources/static/assets/js/project_budget_pay.js index 7f3c174..15253f8 100644 --- a/src/main/resources/static/assets/js/project_budget_pay.js +++ b/src/main/resources/static/assets/js/project_budget_pay.js @@ -8,7 +8,7 @@ pay_DETAIL2={ "payTime":[false,"付款时间","string"], "payProject":[false,"采购成本项目","number"], "payAmount":[false,"付款金额","number"], - "supplier":[false,"供应商","number"], + "supplier":[false,"供应商","string"], }; pay_DETAIL={ @@ -17,7 +17,7 @@ pay_DETAIL={ "payTime":[false,"付款时间","string"], "payProject":[false,"采购成本项目","number"], "payAmount":[false,"付款金额","number"], - "supplier":[false,"供应商","number"], + "supplier":[false,"供应商","string"], }; /* [ diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index 95e0d76..e36e8cc 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -1517,7 +1517,7 @@ - + \n' + - ' \n' + + ' \n' + ' \n' + ' \n' + @@ -425,9 +425,9 @@ function appendTrBudgetPlan2() { ' \n' + ' \n' + // ' \n' + - ' \n' + - ' \n' + - ' \n' + + ' \n' + + ' \n' + + ' \n' + ' \n' + ' \n' + diff --git a/src/main/resources/templates/admin/project_budget_edit.ftl b/src/main/resources/templates/admin/project_budget_edit.ftl index e36e8cc..033251d 100644 --- a/src/main/resources/templates/admin/project_budget_edit.ftl +++ b/src/main/resources/templates/admin/project_budget_edit.ftl @@ -1134,7 +1134,7 @@ - + @@ -1177,7 +1177,7 @@ <#list projectBudgetPlanDetails as projectBudgetPlanDetail> - +