修改提示语,导出增加项目基本信息表

master
OathK1per 2022-12-14 11:12:37 +08:00
parent 7792a1396f
commit 97cf52478b
6 changed files with 198 additions and 12 deletions

View File

@ -178,9 +178,15 @@ public class ProjectController extends BaseController {
"grossProfitRound", "grossProfitMarginRound", "huazhiRound", "huizhiRound", "huasanRound", "ziguangRound", "certaintyStr", "industryScenario", "resolvePlanStr", "customer", "terminalCustomer",
"valueRisk", "principal", "contractTime", "bidsTime", "isSecondStr", "signTypeStr", "mainContractCollectionTerms", "mainContractResolvePlan", "calculationCollection","stageName"};
exportExcelUtils.exportProjectExcel(headers0, columns0, project, "yyyy-MM-dd", 0, "项目立项(概算)信息", outputStream);
// String[] headers1 = {"项目负责人", "预计合同签订时间", "项目计划招标时间", "是否二次合作", "直签", "主合同收款条款", "主合同具体解决方案", "计收计划"};
// String[] columns1 = {"principal", "contractTime", "bidsTime", "isSecondStr", "signTypeStr", "mainContractCollectionTerms", "mainContractResolvePlan", "calculationCollection"};
// exportExcelUtils.exportProjectExcel(headers1, columns1, project, "yyyy-MM-dd", 0, "项目立项(概算)其他信息", outputStream);
ProjectBudget projectBudget = projectService.findBudgetByProjectId(project.getId());
String[] headers1 = {"部门名称", "项目编号", "项目名称", "合同名称", "项目类型", "项目计划开始时间", "项目计划结束时间", "垫资模式", "合作对象", "垫资利息", "垫资峰值", "合同金额",
"项目毛利", "项目毛利率", "华智产品金额", "汇智产品金额", "华三产品金额", "其他产品金额", "项目把握度", "行业场景应用", "项目解决方案", "客户名称", "最终用户名称",
"价值及风险", "项目负责人", "预计合同签订时间", "项目计划招标时间", "是否二次合作", "直签", "主合同收款条款", "主合同具体解决方案", "计收计划"};
String[] columns1 = {"deptNameBudget", "projectNoBudget", "nameBudget", "contractBudget", "typeDescBudget", "startDateBudget", "endDateBudget", "underwrittenModeStrBudget", "collaboratorBudget", "advanceInterestAmountRoundBudget", "advancePeakAmountRoundBudget", "contractRoundBudget",
"grossProfitRoundBudget", "grossProfitMarginRoundBudget", "huazhiRoundBudget", "huizhiRoundBudget", "huasanRoundBudget", "ziguangRoundBudget", "certaintyStrBudget", "industryScenarioBudget", "resolvePlanStrBudget", "customerBudget", "terminalCustomerBudget",
"valueRiskBudget", "principalBudget", "contractTimeBudget", "bidsTimeBudget", "isSecondStrBudget", "signTypeStrBudget", "mainContractCollectionTermsBudget", "mainContractResolvePlanBudget", "calculationCollectionBudget"};
exportExcelUtils.exportProjectBudgetExcel(headers1, columns1, projectBudget, "yyyy-MM-dd", 0, "项目基本信息", outputStream);
BudgetBean budgetBean = projectBudgetService.getBudget(project);
if (project.getStatus() < 5) {
exportExcelUtils.end(outputStream);
@ -1177,10 +1183,14 @@ public class ProjectController extends BaseController {
response.setHeader("Content-Type", "application/vnd.ms-excel");
ServletOutputStream outputStream = response.getOutputStream();
ExportExcelUtils exportExcelUtils = new ExportExcelUtils();
String[] headers1 = {"项目负责人", "预计合同签订时间", "项目计划招标时间", "是否二次合作", "直签", "主合同收款条款", "主合同具体解决方案", "计收计划"};
String[] columns1 = {"principal", "contractTime", "bidsTime", "isSecondStr", "signTypeStr", "mainContractCollectionTerms", "mainContractResolvePlan", "calculationCollection"};
exportExcelUtils.exportProjectExcel(headers1, columns1, project, "yyyy-MM-dd", 0, "项目立项(概算)其他信息", outputStream);
BudgetBean budgetBean = projectBudgetService.getBudget(project);
ProjectBudget projectBudget = projectService.findBudgetByProjectId(project.getId());
String[] headers1 = {"部门名称", "项目编号", "项目名称", "合同名称", "项目类型", "项目计划开始时间", "项目计划结束时间", "垫资模式", "合作对象", "垫资利息", "垫资峰值", "合同金额",
"项目毛利", "项目毛利率", "华智产品金额", "汇智产品金额", "华三产品金额", "其他产品金额", "项目把握度", "行业场景应用", "项目解决方案", "客户名称", "最终用户名称",
"价值及风险", "项目负责人", "预计合同签订时间", "项目计划招标时间", "是否二次合作", "直签", "主合同收款条款", "主合同具体解决方案", "计收计划"};
String[] columns1 = {"deptNameBudget", "projectNoBudget", "nameBudget", "contractBudget", "typeDescBudget", "startDateBudget", "endDateBudget", "underwrittenModeStrBudget", "collaboratorBudget", "advanceInterestAmountRoundBudget", "advancePeakAmountRoundBudget", "contractRoundBudget",
"grossProfitRoundBudget", "grossProfitMarginRoundBudget", "huazhiRoundBudget", "huizhiRoundBudget", "huasanRoundBudget", "ziguangRoundBudget", "certaintyStrBudget", "industryScenarioBudget", "resolvePlanStrBudget", "customerBudget", "terminalCustomerBudget",
"valueRiskBudget", "principalBudget", "contractTimeBudget", "bidsTimeBudget", "isSecondStrBudget", "signTypeStrBudget", "mainContractCollectionTermsBudget", "mainContractResolvePlanBudget", "calculationCollectionBudget"};
exportExcelUtils.exportProjectBudgetExcel(headers1, columns1, projectBudget, "yyyy-MM-dd", 0, "项目基本信息", outputStream);
exportExcelUtils.end(outputStream);
}

View File

@ -202,6 +202,33 @@ public class ProjectBudget {
@Column(name = "calculation_collection_budget")
private String calculationCollectionBudget;
@Transient
private String contractRoundBudget;
@Transient
private String huazhiRoundBudget;
@Transient
private String ziguangRoundBudget;
@Transient
private String huizhiRoundBudget;
@Transient
private String huasanRoundBudget;
@Transient
private String grossProfitRoundBudget;
@Transient
private String grossProfitMarginRoundBudget;
@Transient
private String advanceInterestAmountRoundBudget;
@Transient
private String advancePeakAmountRoundBudget;
public int getId() {
return id;
}
@ -561,4 +588,76 @@ public class ProjectBudget {
public void setCalculationCollectionBudget(String calculationCollectionBudget) {
this.calculationCollectionBudget = calculationCollectionBudget;
}
public String getContractRoundBudget() {
return contractRoundBudget;
}
public void setContractRoundBudget(String contractRoundBudget) {
this.contractRoundBudget = contractRoundBudget;
}
public String getHuazhiRoundBudget() {
return huazhiRoundBudget;
}
public void setHuazhiRoundBudget(String huazhiRoundBudget) {
this.huazhiRoundBudget = huazhiRoundBudget;
}
public String getZiguangRoundBudget() {
return ziguangRoundBudget;
}
public void setZiguangRoundBudget(String ziguangRoundBudget) {
this.ziguangRoundBudget = ziguangRoundBudget;
}
public String getHuizhiRoundBudget() {
return huizhiRoundBudget;
}
public void setHuizhiRoundBudget(String huizhiRoundBudget) {
this.huizhiRoundBudget = huizhiRoundBudget;
}
public String getHuasanRoundBudget() {
return huasanRoundBudget;
}
public void setHuasanRoundBudget(String huasanRoundBudget) {
this.huasanRoundBudget = huasanRoundBudget;
}
public String getGrossProfitRoundBudget() {
return grossProfitRoundBudget;
}
public void setGrossProfitRoundBudget(String grossProfitRoundBudget) {
this.grossProfitRoundBudget = grossProfitRoundBudget;
}
public String getGrossProfitMarginRoundBudget() {
return grossProfitMarginRoundBudget;
}
public void setGrossProfitMarginRoundBudget(String grossProfitMarginRoundBudget) {
this.grossProfitMarginRoundBudget = grossProfitMarginRoundBudget;
}
public String getAdvanceInterestAmountRoundBudget() {
return advanceInterestAmountRoundBudget;
}
public void setAdvanceInterestAmountRoundBudget(String advanceInterestAmountRoundBudget) {
this.advanceInterestAmountRoundBudget = advanceInterestAmountRoundBudget;
}
public String getAdvancePeakAmountRoundBudget() {
return advancePeakAmountRoundBudget;
}
public void setAdvancePeakAmountRoundBudget(String advancePeakAmountRoundBudget) {
this.advancePeakAmountRoundBudget = advancePeakAmountRoundBudget;
}
}

View File

@ -784,6 +784,13 @@ public class ProjectService {
return first;
}
public ProjectBudget findBudgetByProjectId(Integer id) {
QueryHelper queryHelper = new QueryHelper("SELECT p.*, FORMAT(p.contract_amount_budget,2) as contractRoundBudget, FORMAT(p.huazhi_product_amount_budget,2) as huazhiRoundBudget, FORMAT(p.huizhi_product_amount_budget,2) as huizhiRoundBudget, FORMAT(p.huasan_product_amount_budget,2) as huasanRoundBudget, FORMAT(p.ziguang_other_amount_budget,2) as ziguangRoundBudget" +
", FORMAT(p.gross_profit_budget,2) as grossProfitRoundBudget, FORMAT(p.gross_profit_margin_budget,2) as grossProfitMarginRoundBudget, FORMAT(p.advance_interest_amount_budget,2) as advanceInterestAmountRoundBudget, FORMAT(p.advance_peak_amount_budget,2) as advancePeakAmountRoundBudget","project_budget","p");
queryHelper.addCondition("p.project_id=?", id);
return pagination.findFirst(queryHelper.getSql(), ProjectBudget.class);
}
/**
*
*

View File

@ -127,6 +127,59 @@ public class ExportExcelUtils {
}
}
/**
*
*
* @param pattern
* "yyyy-MM-dd"
* @param rowIndex
*
* @throws IOException
*/
public void exportProjectBudgetExcel(String[] headers, String[] columns, ProjectBudget projectBudget, String pattern, int rowIndex, String sheetName, OutputStream outputStream) throws IOException{
// 遍历集合数据,产生数据行
int index = rowIndex;
XSSFSheet sheet = workbook.createSheet(sheetName);
sheet.setDefaultColumnWidth((short)20);
Font font3 = workbook.createFont();
font3.setColor(HSSFColor.HSSFColorPredefined.BLUE.getIndex());
for (int i = 0; i < columns.length; i++){
Row row = sheet.createRow(index++);
Cell firstCell = row.createCell(0);
firstCell.setCellStyle(style);
firstCell.setCellType(CellType.STRING);
firstCell.setCellValue(headers[i]);
Cell secondCell = row.createCell(1);
secondCell.setCellStyle(style2);
Object value = ObjectKit.get(projectBudget, columns[i]);
if(value == null){
secondCell.setCellType(CellType.STRING);
secondCell.setCellValue("");
}else{
if(value instanceof Integer){
secondCell.setCellType(CellType.NUMERIC);
secondCell.setCellValue((int)value);
} else if(value instanceof Long){
secondCell.setCellType(CellType.NUMERIC);
secondCell.setCellValue((long)value);
} else if(value instanceof Double){
secondCell.setCellType(CellType.NUMERIC);
secondCell.setCellValue((double)value);
} else if(value instanceof BigDecimal){
secondCell.setCellType(CellType.NUMERIC);
secondCell.setCellValue(Utils.format(((BigDecimal)value)));
} else if(value instanceof Date){
secondCell.setCellType(CellType.STRING);
String date_str = DateKit.toStr((Date) value, pattern);
secondCell.setCellValue(date_str);
} else{
secondCell.setCellType(CellType.STRING);
secondCell.setCellValue(value.toString());
}
}
}
}
public void exportBudgetExcel(BudgetBean budgetBean, CashFlowBean cashFlowBean, int rowIndex, String sheetName, ServletOutputStream outputStream, String otherName, String incomeTaxRates, String costTaxRates) {
// 遍历集合数据,产生数据行
int index = rowIndex;

View File

@ -352,24 +352,24 @@ function verifyBudgetPlan(){
//从采购成本明细中取“设备”大类下的总计---设备支出
if(costPurchaseDeviceTaxInclude != input_total_device_cost_budget_plan){
return "采购成本明细中取“设备”费用项目下的总计["+costPurchaseDeviceTaxInclude+"]与设备支出["+input_total_device_cost_budget_plan+"]不等";
return "采购成本明细中取“设备”费用项目下的总计["+costPurchaseDeviceTaxInclude+"]与资金计划表中设备支出["+input_total_device_cost_budget_plan+"]不等";
}
//从采购成本明细中取“服务+施工+其他”大类的总计---工程支出
var t = f2(f2(costPurchaseBuildTaxInclude)+f2(costPurchaseServiceTaxInclude)+f2(costPurchaseOtherTaxInclude));
if(t != f2(input_total_engineer_cost_budget_plan)){
return "采购成本明细中取“服务+施工+其他”费用项目的总计["+t+"]与工程支出["+input_total_engineer_cost_budget_plan+"]不等";
return "采购成本明细中取“服务+施工+其他”费用项目的总计["+t+"]与资金计划表中工程支出["+input_total_engineer_cost_budget_plan+"]不等";
}
//从项目管理成本取总计金额--经营性开支
if(costProjectManageTaxInclude != input_total_project_manage_budget_plan){
return "项目管理成本取总计金额["+costProjectManageTaxInclude+"]与经营性开支["+input_total_project_manage_budget_plan+"]不等";
return "项目管理成本取总计金额["+costProjectManageTaxInclude+"]与资金计划表中经营性开支["+input_total_project_manage_budget_plan+"]不等";
}
//从“销售收入明细”中取合计--销售收款
if(incomeTotalTaxInclude != input_total_sale_income_budget_plan){
return "销售收入明细金额["+incomeTotalTaxInclude+"]与销售收款["+input_total_sale_income_budget_plan+"]不等";
return "销售收入明细金额["+incomeTotalTaxInclude+"]与资金计划表中销售收款["+input_total_sale_income_budget_plan+"]不等";
}
//保证金支出和收入一致
if(input_total_earnest_money_cost_budget_plan != input_total_earnest_money_income_budget_plan){
return "保证金支出["+input_total_earnest_money_cost_budget_plan+"]与保证金收款["+input_total_earnest_money_income_budget_plan+"]不等";
return "资金计划表中保证金支出["+input_total_earnest_money_cost_budget_plan+"]与保证金收款["+input_total_earnest_money_income_budget_plan+"]不等";
}
return "";

View File

@ -458,6 +458,15 @@
<div class="am-tabs-bd palm-tabs-bd">
<div class="am-tab-panel am-fade am-in am-active" id="tab30">
<input name="projectId" id="projectId" type="hidden" value="${projectBudget.projectId}" />
<div class="am-u-sm-12 am-u-md-12" style="padding:0 1.6rem 1.6rem 1rem;margin:0;">
<div class="am-btn-toolbar" style="padding-left:.5rem;">
<div class="am-btn-group am-btn-group-xs">
<button type="button" class="am-btn am-btn-default" onclick="location.href='${base}/project/estimateSecondExport?id=${project.id!}'">
<span class="am-icon-archive"></span> 导出
</button>
</div>
</div>
</div>
<!--验证表单元素validate) begin-->
<table id="myTable" class="am-table am-table-bordered">
<tr class="am-text-nowrap">
@ -475,6 +484,14 @@
<input readonly value="${projectBudget.nameBudget!}" />
</td>
</tr>
<#if projectBudget.contractBudget??>
<tr class="am-text-nowrap">
<th class="table-title" colspan="1" ><span style="font-size: 15px">合同名称:</span></th>
<td class="table-title" colspan="5" >
<input readonly value="${projectBudget.contractBudget!}"/>
</td>
</tr>
</#if>
<tr class="am-text-nowrap">
<th class="table-title" colspan="1" ><span style="font-size: 15px">项目类型:</span></th>
<td class="table-title" colspan="1" >