|
@@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
import java.io.IOException;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -546,6 +547,9 @@ public class FinanceReportController extends BaseController {
|
|
|
List<Map<String,Object>> list=page.getContent();
|
|
|
for (Map<String, Object> map : list) {
|
|
|
map.put("price_1", "700");
|
|
|
+ map.put("sum_price_1", "0");
|
|
|
+ map.put("sum_price_2", "0");
|
|
|
+ map.put("sum_price_3", "0");
|
|
|
|
|
|
if(map.containsKey("type")) {
|
|
|
if(map.get("type")==null || Integer.parseInt(map.get("type").toString())!=1){
|
|
@@ -553,6 +557,22 @@ public class FinanceReportController extends BaseController {
|
|
|
map.put("unit_name", "");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if(map.containsKey("meal_type")) {
|
|
|
+ if(map.get("meal_type")!=null){
|
|
|
+ if(Integer.parseInt(map.get("meal_type").toString())==1){
|
|
|
+ map.put("meal_type", "优选套餐");
|
|
|
+ }else if(Integer.parseInt(map.get("meal_type").toString())==2){
|
|
|
+ map.put("meal_type", "VIP套餐");
|
|
|
+ }else if(Integer.parseInt(map.get("meal_type").toString())==3){
|
|
|
+ map.put("meal_type", "尊享套餐");
|
|
|
+ }else {
|
|
|
+ map.put("meal_type", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(map.containsKey("sign_type")) {
|
|
|
if(map.get("sign_type")!=null){
|
|
|
if(Integer.parseInt(map.get("sign_type").toString())==1){
|
|
@@ -567,20 +587,32 @@ public class FinanceReportController extends BaseController {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
map.put("count_1_m", "");
|
|
|
map.put("count_2_m", "");
|
|
|
|
|
|
if(map.containsKey("count_1")) {
|
|
|
if(Integer.parseInt(map.get("count_1").toString())>0) {
|
|
|
map.put("count_1_m", map.get("balance_month") );
|
|
|
+ map.put("sum_price_1", map.get("price")!=null && StringUtils.isNotEmpty(map.get("price").toString()) ?
|
|
|
+ new BigDecimal(map.get("price").toString()).doubleValue()*
|
|
|
+ 0.4
|
|
|
+ : 0);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if(map.containsKey("count_2")) {
|
|
|
if(Integer.parseInt(map.get("count_2").toString())>0) {
|
|
|
map.put("count_2_m", map.get("balance_month") );
|
|
|
+ map.put("sum_price_2", map.get("price_1")!=null && StringUtils.isNotEmpty(map.get("price_1").toString()) ?
|
|
|
+ new BigDecimal(map.get("price_1").toString()).doubleValue()*
|
|
|
+ new BigDecimal(map.get("count_2").toString()).intValue()
|
|
|
+ *0.4
|
|
|
+ : 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ map.put("sum_price_3", new BigDecimal(map.get("sum_price_1").toString()).doubleValue()+new BigDecimal(map.get("sum_price_2").toString()).doubleValue());
|
|
|
}
|
|
|
|
|
|
List<ExcelColumn> myColumns3 = new ArrayList<ExcelColumn>();
|
|
@@ -591,18 +623,25 @@ public class FinanceReportController extends BaseController {
|
|
|
myColumns3.add(new ExcelColumn("签约商户", "unit_name", 20));
|
|
|
myColumns3.add(new ExcelColumn("非签约商户", "external_unit_name", 20));
|
|
|
|
|
|
+ myColumns3.add(new ExcelColumn("套餐名称", "meal_type", 20));
|
|
|
myColumns3.add(new ExcelColumn("服务包名称", "sign_type", 20));
|
|
|
+
|
|
|
myColumns3.add(new ExcelColumn("服务包/月金额", "price", 20));
|
|
|
myColumns3.add(new ExcelColumn("总有效服务数", "sum_1", 20));
|
|
|
myColumns3.add(new ExcelColumn("总结束服务数", "sum_2", 20));
|
|
|
myColumns3.add(new ExcelColumn("服务包/结算月份", "count_1_m", 20));
|
|
|
|
|
|
+ myColumns3.add(new ExcelColumn("服务包应结算金额", "sum_price_1", 20));
|
|
|
+
|
|
|
myColumns3.add(new ExcelColumn("加油包/月金额", "price_1", 20));
|
|
|
myColumns3.add(new ExcelColumn("加油包/有效服务数", "sum_3", 20));
|
|
|
myColumns3.add(new ExcelColumn("加油包/结束服务数", "sum_4", 20));
|
|
|
myColumns3.add(new ExcelColumn("加油包/结算月份", "count_2_m", 20));
|
|
|
myColumns3.add(new ExcelColumn("加油包/结算数量", "count_2", 20));
|
|
|
|
|
|
+ myColumns3.add(new ExcelColumn("加油包应结算金额", "sum_price_2", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("总应结算金额", "sum_price_3", 20));
|
|
|
+
|
|
|
CustomizeToExcel.downFile(myColumns3, list, os);
|
|
|
}catch (IOException e) {
|
|
|
logger.error("异常", e);
|