Преглед на файлове

Merge branch 'v2.3.1_nfby' into publish

wuyongyi преди 1 година
родител
ревизия
de9558a43c

+ 22 - 0
src/main/java/com/ywt/mg/domain/mealEntities/UserMealOrderView.java

@@ -111,6 +111,12 @@ public class UserMealOrderView implements Serializable {
     @Column(name = "need_package")
     private Boolean needPackage;
 
+    @Column(name ="total_cost_package_fee")
+    private Integer totalCostPackageFee;
+
+    @Column(name = "spec_price")
+    private Integer specPrice;
+
     public Integer getHospitalId() {
         return hospitalId;
     }
@@ -372,6 +378,22 @@ public class UserMealOrderView implements Serializable {
         this.needPackage = needPackage;
     }
 
+    public Integer getTotalCostPackageFee() {
+        return totalCostPackageFee;
+    }
+
+    public void setTotalCostPackageFee(Integer totalCostPackageFee) {
+        this.totalCostPackageFee = totalCostPackageFee;
+    }
+
+    public Integer getSpecPrice() {
+        return specPrice;
+    }
+
+    public void setSpecPrice(Integer specPrice) {
+        this.specPrice = specPrice;
+    }
+
     @Override
     public String toString() {
         return "UserMealOrderView{" +

+ 11 - 0
src/main/java/com/ywt/mg/params/mealOrder/MealOrderListRequest.java

@@ -78,6 +78,9 @@ public class MealOrderListRequest implements Serializable {
     @ApiModelProperty(value = "判断医院后台还是公司后台")
     private int hosp;
 
+    @ApiModelProperty(value = "是否需要打包")
+    private String needPackage;
+
 
     public String getOrderNo() {
         return orderNo;
@@ -270,4 +273,12 @@ public class MealOrderListRequest implements Serializable {
     public void setHosp(int hosp) {
         this.hosp = hosp;
     }
+
+    public String getNeedPackage() {
+        return needPackage;
+    }
+
+    public void setNeedPackage(String needPackage) {
+        this.needPackage = needPackage;
+    }
 }

+ 86 - 10
src/main/java/com/ywt/mg/services/MealOrderService.java

@@ -133,6 +133,11 @@ public class MealOrderService {
             paramList.add(paymentNo);
         }
 
+        if(!Checker.isNone(request.getNeedPackage())){
+            whereSql += " and (need_package = ?)";
+            paramList.add(Integer.parseInt(request.getNeedPackage()));
+        }
+
         int hospitalId = Checker.getIntegerValue(request.getHospitalId());
         if (hospitalId > 0) {
             whereSql += " and ( hospital_id = ?)";
@@ -325,6 +330,7 @@ public class MealOrderService {
             String col8 = "支付状态";
             String col9 = "支付方式";
             String col10 = "总价";
+            String col10_2 = "是否选打包";
             String col11 = "支付时间";
             String col12 = "退款时间";
             String col13 = "取餐时间";
@@ -350,12 +356,12 @@ public class MealOrderService {
                 // 管理后台显示支付流水号
                 columns = new String[]{
                         col2, col3, col3_1, col3_2, col18, col4, col5, col20, col21, col6, col19, col7, col8, col9,
-                        col10, col15, col16, col17, col17_1, col17_2, col11, col12, col13, col14
+                        col10, col15, col16, col17, col17_1, col17_2, col10_2, col11, col12, col13, col14
                 };
             } else {
                 columns = new String[]{
                         col2, col4, col5, col20, col6, col19, col7, col8, col9,
-                        col10, col15, col16, col17, col17_1, col17_2, col11, col12, col13, col14
+                        col10, col15, col16, col17, col17_1, col17_2, col10_2, col11, col12, col13, col14
                 };
             }
             List<Shop> shopList = shopService.getAllShops();
@@ -374,6 +380,8 @@ public class MealOrderService {
                 String totalPriceStr = FormatUtil.intShrink100ToStr(userMealOrderView.getOrderAmount());
                 map.getStringListSafely(col10).add(totalPriceStr);
                 String payTime = FormatUtil.createTimeFormatList(userMealOrderView.getPaymentTime());
+                String needPack = userMealOrderView.getNeedPackage() ? "是":"否";
+                map.getStringListSafely(col10_2).add(needPack);
                 map.getStringListSafely(col11).add(payTime);
                 String deliveryTime = FormatUtil.createTimeFormatList(userMealOrderView.getDeliveryTime());
                 map.getStringListSafely(col13).add(deliveryTime);
@@ -503,7 +511,7 @@ public class MealOrderService {
                             .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
                             .mapToInt(v -> Checker.getIntegerValue(v.getOrderAmount()))
                             .sum()), null));
-            customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "总成本", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "菜品成本总额", null));
             customExcelItemList.add(new CustomExcelItem(startColumn + 8, startRows, allCost, null));
             startRows += 1;
             // 微信支付
@@ -524,7 +532,7 @@ public class MealOrderService {
                             .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
                             .mapToInt(v -> Checker.getIntegerValue(v.getWechatPayAmount()))
                             .sum()), null));
-            customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "微信点单成本", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "菜品微信点单成本", null));
             customExcelItemList.add(new CustomExcelItem(startColumn + 8, startRows, wechatSinglePointCost, null));
             startRows += 1;
             // 金币支付
@@ -545,7 +553,7 @@ public class MealOrderService {
                             .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
                             .mapToInt(v -> Checker.getIntegerValue(v.getCoinPayAmount()))
                             .sum()), null));
-            customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "金币点单成本", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "菜品金币点单成本", null));
             customExcelItemList.add(new CustomExcelItem(startColumn + 8, startRows, coinSinglePointCost, null));
             startRows += 1;
             // 现场支付
@@ -566,7 +574,7 @@ public class MealOrderService {
                             .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
                             .mapToInt(v -> Checker.getIntegerValue(v.getF2fPayAmount()))
                             .sum()), null));
-            customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "现场点单成本", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 7, startRows, "菜品现场点单成本", null));
             customExcelItemList.add(new CustomExcelItem(startColumn + 8, startRows, p2fSinglePointCost, null));
             startRows += 1;
             // 洗碗费
@@ -587,6 +595,37 @@ public class MealOrderService {
                             .filter(v -> Checker.getIntegerValue(v.getPackageFee()) > 0)
                             .mapToInt(v -> Checker.getIntegerValue(v.getPackageFee()))
                             .sum()), null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "包装费退款总额", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v ->  Checker.getIntegerValue(v.getPackageFee()) > 0 && RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
+                            .mapToInt(v ->  Checker.getIntegerValue(v.getPackageFee()))
+                            .sum()), null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "包装费实际支付总额", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
+                            .mapToInt(v -> Checker.getIntegerValue(v.getPackageFee()))
+                            .sum()), null));
+            startRows += 1;
+            customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "包装费成本总额", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v -> Checker.getIntegerValue(v.getTotalCostPackageFee()) > 0)
+                            .mapToInt(v -> Checker.getIntegerValue(v.getPackageFee()))
+                            .sum()), null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "包装费成本退款总额", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v ->  Checker.getIntegerValue(v.getTotalCostPackageFee()) > 0 && RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
+                            .mapToInt(v ->  Checker.getIntegerValue(v.getPackageFee()))
+                            .sum()), null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "包装费实际成本总额", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
+                            .mapToInt(v -> Checker.getIntegerValue(v.getTotalCostPackageFee()))
+                            .sum()), null));
             startRows += 1;
             customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "配送费总额", null));
             customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
@@ -594,6 +633,37 @@ public class MealOrderService {
                             .filter(v -> Checker.getIntegerValue(v.getDeliveryFee()) > 0)
                             .mapToInt(v -> Checker.getIntegerValue(v.getDeliveryFee()))
                             .sum()), null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "配送费退款总额", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v ->  Checker.getIntegerValue(v.getDeliveryFee()) > 0 && RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
+                            .mapToInt(v ->  Checker.getIntegerValue(v.getDeliveryFee()))
+                            .sum()), null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "配送费实际支付总额", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
+                            .mapToInt(v -> Checker.getIntegerValue(v.getDeliveryFee()))
+                            .sum()), null));
+            startRows += 1;
+            customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows, "总额(做法-加料)", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 2, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v -> Checker.getIntegerValue(v.getSpecPrice()) > 0)
+                            .mapToInt(v -> Checker.getIntegerValue(v.getSpecPrice()))
+                            .sum()), null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 3, startRows, "退款总额(做法-加料)", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 4, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v ->  Checker.getIntegerValue(v.getSpecPrice()) > 0 && RefundStatusEnum.SUCCESS.getValue() == Checker.getIntegerValue(v.getRefundStatus()))
+                            .mapToInt(v ->  Checker.getIntegerValue(v.getSpecPrice()))
+                            .sum()), null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 5, startRows, "实际总额(做法-加料)", null));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 6, startRows,
+                    FormatUtil.intShrink100ToStr(orders.stream()
+                            .filter(v -> RefundStatusEnum.SUCCESS.getValue() != Checker.getIntegerValue(v.getRefundStatus()))
+                            .mapToInt(v -> Checker.getIntegerValue(v.getSpecPrice()))
+                            .sum()), null));
             startRows += 2;
             // v1.3.1_nfyybyfy 新增职工统计
             // 职工支付
@@ -653,13 +723,19 @@ public class MealOrderService {
             customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows + 4,
                     "4、总成本=微信点单成本+金币点单成本+现场点单成本(也等于各个菜品成本价乘以份数的相加的总额);", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
             customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows + 5,
-                    "5、微信点单成本:支付方式是“微信支付”的订单,其各个菜品成本价乘以份数的相加的总额(不包含退款订单);", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
+                    "5、菜品微信点单成本:支付方式是“微信支付”的订单,其各个菜品成本价乘以份数的相加的总额(不包含退款订单);", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
             customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows + 6,
-                    "   金币点单成本:支付方式是“微信+金币”的订单,其各个菜品成本价乘以份数的相加的总额(不包含退款订单);", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
+                    " 菜品金币点单成本:支付方式是“微信+金币”的订单,其各个菜品成本价乘以份数的相加的总额(不包含退款订单);", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
             customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows + 7,
-                    "   现场点单成本:支付方式是“现场支付”的订单,其各个菜品成本价乘以份数的相加的总额(不包含退款订单);", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
+                    " 菜品现场点单成本:支付方式是“现场支付”的订单,其各个菜品成本价乘以份数的相加的总额(不包含退款订单);", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
             customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows + 8,
-                    "6、2元洗碗费总额:支付方式是“微信+金币”的订单,其微信支付部分的总额(不包含退款订单)。", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
+                    "6、2元洗碗费总额:支付方式是“微信+金币”的订单,其微信支付部分的总额(不包含退款订单);", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows + 9,
+                    "7、包装费总额=包装费退款总额+包装费实际总额;包装费成本总额=包装费成本退款总额+包装费实际成本总额;", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows + 10,
+                    "8、配送费总额=配送费退款总额+配送费实际总额;", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
+            customExcelItemList.add(new CustomExcelItem(startColumn + 1, startRows + 11,
+                    "9、总额(做法-加料)=退款总额(做法-加料)+实际总额(做法-加料)。", ExcelDownloadSrvOld.getCellFormat4StatRemarkWithNoSetBorder()));
         }
         return customExcelItemList;
     }