From dbcb55f3d6bd4f5a509b87459617d7522115a501 Mon Sep 17 00:00:00 2001 From: OathK1per Date: Tue, 16 Aug 2022 16:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9B=E7=AE=97=E6=A6=82=E7=AE=97=EF=BC=8C?= =?UTF-8?q?=E5=90=88=E4=BD=9C=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/MonthlySettleController.java | 14 +- .../palmte/work/utils/excel/ExportUtils.java | 14 ++ src/main/resources/application-dev.properties | 2 +- .../resources/application-local.properties | 2 +- .../resources/application-pretest.properties | 2 +- .../resources/application-prod.properties | 2 +- src/main/resources/application-sit.properties | 2 +- .../static/assets/js/project_budget.js | 8 +- .../static/assets/js/project_budget_cost.js | 19 ++- .../static/assets/js/project_budget_income.js | 16 +- .../templates/admin/monthly_settle_info.ftl | 147 +++++++++++++++--- .../templates/admin/project_approve.ftl | 4 +- .../templates/admin/project_list.ftl | 4 +- 13 files changed, 193 insertions(+), 43 deletions(-) diff --git a/src/main/java/cn/palmte/work/controller/backend/MonthlySettleController.java b/src/main/java/cn/palmte/work/controller/backend/MonthlySettleController.java index cfefa74..01b6408 100644 --- a/src/main/java/cn/palmte/work/controller/backend/MonthlySettleController.java +++ b/src/main/java/cn/palmte/work/controller/backend/MonthlySettleController.java @@ -55,21 +55,23 @@ public class MonthlySettleController extends BaseController { ConcurrentHashMap searchInfo = getSearchInfo(keywords, model); model.put("pager", monthlySettleService.list(searchInfo, pageNumber, pageSize)); model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils")); - return "/admin/monthlySettle_list"; + return "/admin/monthly_settle_list"; } @RequestMapping("/info") public String info(@RequestParam("id") int id, Map model) { MonthlySettle monthlySettle = monthlySettleRepository.findOne(id); model.put("monthlySettle", monthlySettle); - return "/admin/monthlySettle_info"; + model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils")); + return "/admin/monthly_settle_info"; } @RequestMapping("/infoByTime") public String infoByTime(@RequestParam("time") String time, @RequestParam("projectName") String projectName, Map model) { MonthlySettle monthlySettle = monthlySettleRepository.findByMonthAndProjectName(time, projectName); model.put("monthlySettle", monthlySettle); - return "/admin/monthlySettle_info"; + model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils")); + return "/admin/monthly_settle_info"; } private void setModel(@RequestParam(value = "keywords", required = false) String keywords, Map model) { @@ -79,7 +81,7 @@ public class MonthlySettleController extends BaseController { @RequestMapping("/export") public void export(@RequestParam(value = "keywords", required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException { Map searchInfo = getSearchInfo(keywords); - downloadHeader(httpServletResponse, Utils.generateExcelName("人员信息"), "application/octet-stream"); + downloadHeader(httpServletResponse, Utils.generateExcelName("月度结算表"), "application/octet-stream"); String[] headers = {"项目编号", "项目名称", "项目类型", "合同编号", "合同方", "合同金额", "合同签订时间", "最终业主", "累计已收款", "已采购累计付款", "已采购累计未付款", "超期垫资金额", "销售累计开票金额", "销售经理", "项目经理", "收款节点", "收款要求时间", "收款金额", "实际收款时间", "实际收款金额", "实际欠收金额", "到货证明", "项目风险预警", "已计收金额", "未计收金额", "超期天数", "验收报告时间"}; String[] exportColumns = {"projectNo", "projectName", "projectType", "contractNo", "contractParty", "contractAmount", "contractSignTime", "owner", "totalCollect", @@ -97,8 +99,8 @@ public class MonthlySettleController extends BaseController { String[] exportColumns = {"month", "projectNo", "projectName", "projectType", "contractNo", "contractParty", "contractAmount", "contractSignTime", "owner", "totalCollect", "totalPurchasedPaid", "totalPurchasedUnpaid", "timeOutAmount", "totalBillAmount", "saleManager", "projectManager", "collectPoint", "collectRequiredTime", "collectAmount", "collectActualTime", "collectActualAmount", "uncollectActualAmount", "timeOutDay", "productCertificate", "inspectionReportTime", "riskWarning", "uncalColAmount", "calColAmount"}; - ExportUtils.exportToExcel(headers, exportColumns, 1, 10000, - httpServletResponse.getOutputStream(), (pageNumber, pageSize) -> monthlySettleService.findOne(id, time, projectName)); + ExportUtils.exportToExcel2(headers, exportColumns, 1, 10000, + httpServletResponse.getOutputStream(), monthlySettleService.findOne(id, time, projectName)); } /** diff --git a/src/main/java/cn/palmte/work/utils/excel/ExportUtils.java b/src/main/java/cn/palmte/work/utils/excel/ExportUtils.java index 51d2ee5..2091249 100644 --- a/src/main/java/cn/palmte/work/utils/excel/ExportUtils.java +++ b/src/main/java/cn/palmte/work/utils/excel/ExportUtils.java @@ -212,6 +212,20 @@ public class ExportUtils { return workbook; } + /** + * 分页查询数据导出到Excel的工具类 + * @param pageNumber 从那一页开始 + */ + public static ExportUtils exportToExcel2(String[] headers , String[] columns , int pageNumber , int pageSize , OutputStream outputStream , List list) throws IOException{ + ExportUtils exportUtils = new ExportUtils(headers); + int rowIndex = 1; + exportUtils.exportExcel(columns,list,"yyyy-MM-dd HH:mm:ss",rowIndex); + if( null!= outputStream) { + exportUtils.write(outputStream); + } + return exportUtils; + } + /** * 分页查询数据导出到Excel的工具类 * @param pageNumber 从那一页开始 diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 6c366a6..c42a3c2 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -10,4 +10,4 @@ spring.jpa.show-sql=true admin.domain=https://dzgtest.palmte.cn upload.path=/mnt/dzg/image -upload.prefix=https://dzgtest.palmte.cn/upload \ No newline at end of file +upload.prefix=https://dzgtest.palmte.cn/fourcal/upload \ No newline at end of file diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 5aeb99b..811f3ae 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -10,4 +10,4 @@ spring.jpa.show-sql=true admin.domain=https://dzgtest.palmte.cn upload.path=/mnt/dzg/image -upload.prefix=https://dzgtest.palmte.cn/upload \ No newline at end of file +upload.prefix=https://dzgtest.palmte.cn/fourcal/upload \ No newline at end of file diff --git a/src/main/resources/application-pretest.properties b/src/main/resources/application-pretest.properties index 04d3b21..00a244e 100644 --- a/src/main/resources/application-pretest.properties +++ b/src/main/resources/application-pretest.properties @@ -8,4 +8,4 @@ spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect spring.jpa.show-sql=true upload.path=/data/file/image -upload.prefix=https://dzgtest.palmte.cn/upload \ No newline at end of file +upload.prefix=https://dzgtest.palmte.cn/fourcal/upload \ No newline at end of file diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 2c272f6..808e652 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -8,4 +8,4 @@ spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect #spring.jpa.show-sql=true upload.path=/home/data/fourcal -upload.prefix=/upload/fourcal \ No newline at end of file +upload.prefix=/fourcal/upload \ No newline at end of file diff --git a/src/main/resources/application-sit.properties b/src/main/resources/application-sit.properties index 5bf79c3..9b85128 100644 --- a/src/main/resources/application-sit.properties +++ b/src/main/resources/application-sit.properties @@ -10,4 +10,4 @@ spring.jpa.show-sql=true admin.domain=https://dzgtest.palmte.cn upload.path=/home/data/dzg/fourcal -upload.prefix=https://dzgtest.palmte.cn/upload/fourcal \ No newline at end of file +upload.prefix=https://dzgtest.palmte.cn/fourcal/upload \ No newline at end of file diff --git a/src/main/resources/static/assets/js/project_budget.js b/src/main/resources/static/assets/js/project_budget.js index 99ab495..630e907 100644 --- a/src/main/resources/static/assets/js/project_budget.js +++ b/src/main/resources/static/assets/js/project_budget.js @@ -7,7 +7,8 @@ INCOME_DETAIL={ "price":[true,"单价","price"], "taxRate":[true,"税率","number"], "totalTaxInclude":[true,"含税总金额","number"], - "totalTaxExclude":[true,"不含税金额","number"] + "totalTaxExclude":[true,"不含税金额","number"], + "totalTax":[true,"税金","number"] }; COST_DETAIL={ @@ -20,7 +21,8 @@ COST_DETAIL={ "price":[true,"单价","price"], "taxRate":[true,"税率","number"], "totalTaxInclude":[true,"含税总金额","number"], - "totalTaxExclude":[true,"不含税金额","number"] + "totalTaxExclude":[true,"不含税金额","number"], + "totalTax":[true,"税金","number"] }; COST_PROJECT_MANAGE_DETAIL={ @@ -702,6 +704,8 @@ function updateIncomeDataUnsubmit(incomeDetails) { var serviceTaxInclude = 0; var serviceTaxExclude = 0; incomeDetails.forEach(function (t, number, ts) { + console.log("income cost " + t["type"] + ", " + t["taxRate"] + ", " + t["totalTaxInclude"] + ", " + t["totalTaxExclud"]); + if(t["type"] == "1"){ //设备类 deviceTaxInclude += f2(t["totalTaxInclude"]); 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 122bba6..f9ccd88 100644 --- a/src/main/resources/static/assets/js/project_budget_cost.js +++ b/src/main/resources/static/assets/js/project_budget_cost.js @@ -12,7 +12,8 @@ COST_DETAIL={ "price":[true,"单价","price"], "taxRate":[true,"税率","number"], "totalTaxInclude":[true,"含税总金额","number"], - "totalTaxExclude":[true,"不含税金额","number"] + "totalTaxExclude":[true,"不含税金额","number"], + "totalTax":[true,"税金","number"] }; /* [ @@ -225,6 +226,7 @@ function bindDeleteBtnCost() { updateAmount("input-changeable-amount-cost", "input-changeable-total-amount-cost"); 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"); }); } @@ -237,15 +239,18 @@ function bindCostTotal() { updateAmount("input-changeable-amount-cost", "input-changeable-total-amount-cost"); 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"); }); //单价改变 $(".input-changeable-price-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"); }); //税率改变 $(".input-changeable-tax-rate-cost").change(function () { 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"); }); } @@ -256,41 +261,53 @@ 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 = ""; 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"]); } costTaxRates += 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(deviceTax)); $("input[name='costPurchaseServiceTaxInclude']").val(f2Fixed(serviceTaxInclude)); $("input[name='costPurchaseServiceTaxExclude']").val(f2Fixed(serviceTaxExclude)); + $("input[name='costPurchaseServiceTax']").val(f2Fixed(deviceTax)); $("input[name='costPurchaseOtherTaxInclude']").val(f2Fixed(otherTaxInclude)); $("input[name='costPurchaseOtherTaxExclude']").val(f2Fixed(otherTaxExclude)); + $("input[name='costPurchaseOtherTax']").val(f2Fixed(deviceTax)); //资金计划表中的 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 30b0f6e..bc31616 100644 --- a/src/main/resources/static/assets/js/project_budget_income.js +++ b/src/main/resources/static/assets/js/project_budget_income.js @@ -11,7 +11,8 @@ INCOME_DETAIL={ "price":[true,"单价","price"], "taxRate":[true,"税率","number"], "totalTaxInclude":[true,"含税总金额","number"], - "totalTaxExclude":[true,"不含税金额","number"] + "totalTaxExclude":[true,"不含税金额","number"], + "totalTax":[true,"税金","number"] }; /*$(function () { @@ -79,37 +80,49 @@ function updateIncomeData(data,returnData) { var incomeDetails = data.details; var deviceTaxInclude = 0; var deviceTaxExclude = 0; + var deviceTax = 0; var engineerTaxInclude = 0; var engineerTaxExclude = 0; + var engineerTax = 0; var serviceTaxInclude = 0; var serviceTaxExclude = 0; + var serviceTax = 0; var incomeTaxRates = ""; incomeDetails.forEach(function (t, number, ts) { + console.log("income income " + t["type"] + ", " + t["taxRate"] + ", " + t["totalTaxInclude"] + ", " + t["totalTaxExclude"]); + if(t["type"] == "1"){ //设备类 deviceTaxInclude += f2(t["totalTaxInclude"]); deviceTaxExclude += f2(t["totalTaxExclude"]); + deviceTax += f2(t["totalTax"]); }else if(t["type"] == "2"){ //工程类 engineerTaxInclude += f2(t["totalTaxInclude"]); engineerTaxExclude += f2(t["totalTaxExclude"]); + engineerTax += f2(t["totalTax"]); }else if(t["type"] == "3"){ //服务类 serviceTaxInclude += f2(t["totalTaxInclude"]); serviceTaxExclude += f2(t["totalTaxExclude"]); + serviceTax += f2(t["totalTax"]); } incomeTaxRates += t["taxRate"] + "%,"; }); console.log("incomeTaxRates: " + incomeTaxRates); $("input[name='incomeDeviceTaxInclude']").val(f2Fixed(deviceTaxInclude)); $("input[name='incomeDeviceTaxExclude']").val(f2Fixed(deviceTaxExclude)); + $("input[name='incomeDeviceTax']").val(f2Fixed(deviceTax)); $("input[name='incomeEngineerTaxInclude']").val(f2Fixed(engineerTaxInclude)); $("input[name='incomeEngineerTaxExclude']").val(f2Fixed(engineerTaxExclude)); + $("input[name='incomeEngineerTax']").val(f2Fixed(engineerTax)); $("input[name='incomeServiceTaxInclude']").val(f2Fixed(serviceTaxInclude)); $("input[name='incomeServiceTaxExclude']").val(f2Fixed(serviceTaxExclude)); + $("input[name='incomeServiceTax']").val(f2Fixed(serviceTax)); $("input[name='incomeTotalTaxInclude']").val(f2Fixed(deviceTaxInclude+engineerTaxInclude+serviceTaxInclude)); $("input[name='incomeTotalTaxExclude']").val(f2Fixed(deviceTaxExclude+engineerTaxExclude+serviceTaxExclude)); + $("input[name='incomeTotalTax']").val(f2Fixed(deviceTax+engineerTax+serviceTax)); $(".input-total-title-sale-income-budget-plan").val($("input[name='incomeTotalTaxInclude']").val()); @@ -173,6 +186,7 @@ function bindDeleteBtnIncome() { updateAmount("input-changeable-amount-income", "input-changeable-total-amount-income"); 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"); }); } diff --git a/src/main/resources/templates/admin/monthly_settle_info.ftl b/src/main/resources/templates/admin/monthly_settle_info.ftl index 1913f74..884061d 100644 --- a/src/main/resources/templates/admin/monthly_settle_info.ftl +++ b/src/main/resources/templates/admin/monthly_settle_info.ftl @@ -2,11 +2,108 @@ <#import "../common/defaultLayout.ftl" as defaultLayout> <@defaultLayout.layout> +
月度结算表明细 / - ${monthlySettle.name}
+ ${monthlySettle.projectName!}
@@ -15,21 +112,21 @@
-
-
-
- -
-
-
-
-
+<#--
--> +<#--
--> +<#--
--> +<#-- --> +<#--
--> +<#--
--> +<#--
--> +<#--
--> +<#--
-->
- +
@@ -37,7 +134,7 @@
- +
@@ -45,7 +142,7 @@
- +
@@ -53,7 +150,7 @@
- +
@@ -61,7 +158,7 @@
- +
@@ -69,7 +166,7 @@
- +
@@ -77,7 +174,7 @@
- +
@@ -85,7 +182,7 @@
- +
@@ -117,7 +214,7 @@
- +
@@ -125,7 +222,7 @@
- +
@@ -197,7 +294,7 @@
- +
@@ -205,7 +302,7 @@
- +
@@ -263,8 +360,9 @@
- +