|
@@ -647,8 +647,6 @@ public class MealOrderService {
|
|
|
|
|
|
public void downloadMealOrderBillList(int downloadRecordId, String fileName, MealOrderListRequest request) {
|
|
|
try {
|
|
|
-
|
|
|
-
|
|
|
String col0 = "交易类型*";
|
|
|
String col1 = "系统参考号*";
|
|
|
String col2 = "交易金额*";
|
|
@@ -668,74 +666,37 @@ public class MealOrderService {
|
|
|
for (UserMealOrderView p : userMealOrderViews) {
|
|
|
MealOrderInfo info = new MealOrderInfo();
|
|
|
info.setId(p.getId());
|
|
|
-
|
|
|
// 订单号
|
|
|
info.setOrderNo(p.getOrderNo());
|
|
|
-
|
|
|
-// // 店铺名称
|
|
|
-// String shopName = mealOrderService.getShopName(shopList, Checker.getIntegerValue(p.getShopId()));
|
|
|
-// item.put("shopName", shopName);
|
|
|
- // 客户姓名
|
|
|
info.setContactName(p.getContactName());
|
|
|
info.setMobile(p.getMobile());
|
|
|
-
|
|
|
int typeInt = Checker.getIntegerValue(p.getType());
|
|
|
String typeStr = MealOrderTypeEnum.getDisplayName(typeInt);
|
|
|
info.setType(typeStr);
|
|
|
-// item.put("type", typeStr);
|
|
|
-// item.put("typeInt", typeInt);
|
|
|
// 状态
|
|
|
int statusInt = Checker.getIntegerValue(p.getStatus());
|
|
|
String statusStr = MealOrderStatusEnum.getDisplayName(statusInt);
|
|
|
info.setStatus(statusStr);
|
|
|
info.setStatusInt(statusInt);
|
|
|
-// item.put("statusInt", statusInt);
|
|
|
-// item.put("status", statusStr);
|
|
|
// 总价
|
|
|
info.setTotalStr(FormatUtil.intShrink100ToStr(p.getOrderAmount()));
|
|
|
info.setWechatInt(Checker.getIntegerValue(p.getWechatPayAmount()));
|
|
|
info.setPayType(Checker.getIntegerValue(p.getPayType()));
|
|
|
-// item.put("totalStr", FormatUtil.intShrink100ToStr(p.getOrderAmount()));
|
|
|
-// item.put("wechatStr", FormatUtil.intShrink100ToStr(p.getWechatPayAmount()));
|
|
|
-// item.put("wechatInt", Checker.getIntegerValue(p.getWechatPayAmount()));
|
|
|
-// item.put("coinStr", FormatUtil.intShrink100ToStr(p.getCoinPayAmount()));
|
|
|
-// item.put("cashStr", FormatUtil.intShrink100ToStr(p.getF2fPayAmount()));
|
|
|
// 支付时间
|
|
|
info.setPaymentTime(FormatUtil.createTimeFormatList(p.getPaymentTime()));
|
|
|
-// item.put("paymentTime", FormatUtil.createTimeFormatList(p.getPaymentTime()));
|
|
|
// 取餐时间
|
|
|
info.setCreateTime(FormatUtil.createTimeFormatList(p.getDeliveryTime()));
|
|
|
-// item.put("createTime", FormatUtil.createTimeFormatList(p.getDeliveryTime()));
|
|
|
- //支付方式
|
|
|
-// item.put("payType", OrderPayTypeEnum.valueOf(Checker.getIntegerValue(p.getPayType())).getDisplayName());
|
|
|
- //支付流水号
|
|
|
info.setPaymentNo(Checker.getStringValue(p.getPaymentNo()));
|
|
|
info.setRefundTime(FormatUtil.createTimeFormatList(p.getRefundTime()));
|
|
|
-// item.put("paymentNo", Checker.getStringValue(p.getPaymentNo()));
|
|
|
-// item.put("refundTime", FormatUtil.createTimeFormatList(p.getRefundTime()));
|
|
|
+
|
|
|
Integer paymentStatus = p.getPaymentStatus();
|
|
|
info.setPayStatus(paymentStatus == null ? PaymentStatusEnum.Pending.getDisplayName() :
|
|
|
MealPaymentStatusEnum.valueOf(paymentStatus).getDisplayName());
|
|
|
-// item.put("payStatus", paymentStatus == null ? PaymentStatusEnum.Pending.getDisplayName() :
|
|
|
-// PaymentStatusEnum.valueOf(paymentStatus).getDisplayName());
|
|
|
String extData = Checker.getStringValue(p.getExtData());
|
|
|
Map<String, Object> m = FormatUtil.stringToMapT(extData);
|
|
|
info.setRemark(m == null ? "" : (String) m.getOrDefault("refuseOrderRemark", ""));
|
|
|
-// item.put("remark", m == null ? "" : (String) m.getOrDefault("refuseOrderRemark", ""));
|
|
|
int hid = Checker.getIntegerValue(p.getHospitalId());
|
|
|
list.add(info);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// item.put("hospitalId", hid);
|
|
|
-// item.put("hospitalName", BizUtil.getHospitalNameByHospitalId(hid));
|
|
|
-// item.put("pickupCode", Checker.getStringValue(p.getPickupCode()));
|
|
|
-// item.put("staffId", p.getStaffId());
|
|
|
-// item.put("deptName", Checker.getStringValue(p.getDeptName()));
|
|
|
-// item.put("extStatus", Checker.getIntegerValue(p.getExtStatus()));
|
|
|
-
|
|
|
-// String transactionIdStr = orderPaymentService.getTransactionIdByOrderNo(orderPaymentList, Checker.getStringValue(p.getOrderNo()));
|
|
|
-// item.put("transactionId", transactionIdStr);
|
|
|
}
|
|
|
if (!Checker.isNone(list)) {
|
|
|
List<OrderPayment> orderPaymentList = orderPaymentService.getOrderPaymentListByMealOrderListB(list);
|
|
@@ -820,8 +781,7 @@ public class MealOrderService {
|
|
|
String typeName = "营养餐";
|
|
|
|
|
|
String[] bodyStr = {type, transactionId, totalStr, refundTimeStr, orderNo, typeName};
|
|
|
-// ExcelHelper.settingMainBodyLabelCell(sheet, cellFormat2, n, bodyStr);
|
|
|
-// n++;
|
|
|
+
|
|
|
map.getStringListSafely(col0).add(type);
|
|
|
map.getStringListSafely(col1).add(transactionId);
|
|
|
map.getStringListSafely(col2).add(totalStr);
|
|
@@ -838,7 +798,6 @@ public class MealOrderService {
|
|
|
refundTotal += amountInt;
|
|
|
refundValue += amountInt;
|
|
|
statisticalDataMap.put(refundKey, refundValue);
|
|
|
-
|
|
|
}
|
|
|
rowSize++;
|
|
|
}
|
|
@@ -847,7 +806,6 @@ public class MealOrderService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
int bill = 1;
|
|
|
List<ExcelCollectPojo> itemList = getStatisticsBillData(rowSize, payTotal, refundTotal, statisticalDataMap);
|
|
|
downloadRecordService.createFileAndUploadOssAndSaveToDataBase(fileName, downloadRecordId, map,
|
|
@@ -857,7 +815,6 @@ public class MealOrderService {
|
|
|
logger.error("/mealOrder/downloadMealOrderBillsList(): {}", e.getMessage(), e);
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private List<MealOrderInfo> getRefundMealOrderList(List<MealOrderInfo> list) {
|
|
@@ -895,7 +852,6 @@ public class MealOrderService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return customExcelItemList;
|
|
|
}
|
|
|
}
|