|
|
@@ -1790,7 +1790,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CommonResult reportStatistics(String permissionSettingId, String state, String keyWord, String startTime, String endTime, int page, int size) {
|
|
|
+ public CommonResult reportStatistics(String permissionSettingId, String state, String keyWord, String startTime, String endTime, int page, int size,String dateBill) {
|
|
|
PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
|
|
|
if (ObjectUtils.isEmpty(permissionSetting)) {
|
|
|
return CommonResult.fail("非法进入");
|
|
|
@@ -1813,7 +1813,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
s = "5";
|
|
|
}
|
|
|
|
|
|
- PageUtils<ReportStatisticsVo> pageUtils = houseOrderService.reportStatisticsPage(s, keyWord, startTime, endTime, page, size);
|
|
|
+ PageUtils<ReportStatisticsVo> pageUtils = houseOrderService.reportStatisticsPage(s, keyWord, startTime, endTime, page, size,dateBill);
|
|
|
|
|
|
return CommonResult.ok(pageUtils);
|
|
|
|
|
|
@@ -1821,7 +1821,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void reportStatisticsExport(HttpServletResponse response, String permissionSettingId, String state, String keyWord, String startTime, String endTime) {
|
|
|
+ public void reportStatisticsExport(HttpServletResponse response, String permissionSettingId, String state, String keyWord, String startTime, String endTime,String dateBill) {
|
|
|
// PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
|
|
|
// if (ObjectUtils.isEmpty(permissionSetting)) {
|
|
|
// return CommonResult.fail("非法进入");
|
|
|
@@ -1844,14 +1844,13 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
s = "5";
|
|
|
}
|
|
|
|
|
|
- List<ReportStatisticsExportVo> vos = houseOrderService.reportStatisticsExport(s, keyWord, startTime, endTime);
|
|
|
+ List<ReportStatisticsExportVo> vos = houseOrderService.reportStatisticsExport(s, keyWord, startTime, endTime,dateBill);
|
|
|
|
|
|
// 导出
|
|
|
Workbook workbook = new XSSFWorkbook();
|
|
|
Sheet sheet = workbook.createSheet("报表统计");
|
|
|
Row headerRow = sheet.createRow(0);
|
|
|
headerRow.createCell(0).setCellValue("序号");
|
|
|
- headerRow.createCell(1).setCellValue("订单编号");
|
|
|
headerRow.createCell(2).setCellValue("入住人");
|
|
|
headerRow.createCell(3).setCellValue("部门");
|
|
|
headerRow.createCell(4).setCellValue("职工卡号");
|
|
|
@@ -1866,6 +1865,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
|
|
|
if (ObjectUtils.isNotEmpty(vos) && vos.size() > 0) {
|
|
|
if ("5".equals(s)) {
|
|
|
+ headerRow.createCell(1).setCellValue("账期");
|
|
|
headerRow.createCell(11).setCellValue("订单详情");
|
|
|
//水:2.1元/吨,电:0.62元/度
|
|
|
BigDecimal waterPrice = new BigDecimal(2.1);
|
|
|
@@ -1882,7 +1882,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
Row dataRow1 = sheet.createRow(i + 1);
|
|
|
|
|
|
dataRow1.createCell(0).setCellValue(i + 1);
|
|
|
- dataRow1.createCell(1).setCellValue(vo.getOrderNumber());
|
|
|
+ dataRow1.createCell(1).setCellValue(vo.getDateBill());
|
|
|
dataRow1.createCell(2).setCellValue(vo.getLiveName());
|
|
|
// 房型是房间名称加房间类型
|
|
|
String roomName = vo.getRoomName();
|
|
|
@@ -1977,6 +1977,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
|
|
|
|
|
|
} else {
|
|
|
+ headerRow.createCell(1).setCellValue("订单编号");
|
|
|
for (int i = 0; i < vos.size(); i++) {
|
|
|
ReportStatisticsExportVo vo = vos.get(i);
|
|
|
Row dataRow1 = sheet.createRow(i + 1);
|
|
|
@@ -3851,23 +3852,35 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
// 获取签名
|
|
|
// 随机字符串
|
|
|
- String nonceStr = WxUtil.getWxNonceStr();
|
|
|
- // 时间戳
|
|
|
- long timestamp = System.currentTimeMillis() / 1000;
|
|
|
-// 构造签名串
|
|
|
- String qmc = "GET" + "\n"
|
|
|
- + "/v3/pay/transactions/h5" + "\n"
|
|
|
- + timestamp + "\n"
|
|
|
- + nonceStr + "\n";
|
|
|
-// 使用商户私钥对待签名串进行SHA256 with RSA签名,并对签名结果进行Base64编码得到签名值
|
|
|
- Signature sign = Signature.getInstance("SHA256withRSA");
|
|
|
-// sign.initSign(privateKey);
|
|
|
-// sign.update(qmc.getBytes());
|
|
|
- String signature = RSATest.sign("KReLfbAgGZKc3slfEW9Jnhn7RLKqyrGF", qmc);
|
|
|
- System.out.println("signature = " + signature);
|
|
|
+// String nonceStr = WxUtil.getWxNonceStr();
|
|
|
+// // 时间戳
|
|
|
+// long timestamp = System.currentTimeMillis() / 1000;
|
|
|
+//// 构造签名串
|
|
|
+// String qmc = "GET" + "\n"
|
|
|
+// + "/v3/pay/transactions/h5" + "\n"
|
|
|
+// + timestamp + "\n"
|
|
|
+// + nonceStr + "\n";
|
|
|
+//// 使用商户私钥对待签名串进行SHA256 with RSA签名,并对签名结果进行Base64编码得到签名值
|
|
|
+// Signature sign = Signature.getInstance("SHA256withRSA");
|
|
|
+//// sign.initSign(privateKey);
|
|
|
+//// sign.update(qmc.getBytes());
|
|
|
+// String signature = RSATest.sign("KReLfbAgGZKc3slfEW9Jnhn7RLKqyrGF", qmc);
|
|
|
+// System.out.println("signature = " + signature);
|
|
|
// String a="第一个订单"+"\n"+"第二个订单";
|
|
|
// System.out.println(a);
|
|
|
|
|
|
+ DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
+
|
|
|
+// 计算上个免费的订单
|
|
|
+ LocalDateTime end = LocalDateTime.now().withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
|
|
+ LocalDateTime start = end.minusMonths(1);
|
|
|
+
|
|
|
+ String dateBill=start.toLocalDate().format(dateTimeFormatter2);
|
|
|
+ String dateBill2=start.format(dateTimeFormatter2);
|
|
|
+ System.out.println("dateBill = " + dateBill);
|
|
|
+ System.out.println("dateBill2 = " + dateBill2);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -4056,11 +4069,15 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
// electric = electric.multiply(electricPrice);
|
|
|
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
|
|
|
// 计算上个免费的订单
|
|
|
LocalDateTime end = LocalDateTime.now().withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
|
|
LocalDateTime start = end.minusMonths(1);
|
|
|
|
|
|
+ String dateBill=start.toLocalDate().format(dateTimeFormatter2);
|
|
|
+
|
|
|
+
|
|
|
LambdaQueryWrapper<HouseOrder> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.between(HouseOrder::getLeaveTime, start, end)
|
|
|
.eq(HouseOrder::getPayPrice, 0)
|
|
|
@@ -4173,6 +4190,9 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
houseOrder.setLeaveTime(Date.from(end.atZone(ZoneId.systemDefault()).toInstant()));
|
|
|
houseOrder.setHouseOrderSource(houseOrderSource);
|
|
|
|
|
|
+// 结账日期
|
|
|
+ houseOrder.setDateBill(dateBill);
|
|
|
+
|
|
|
houseOrders.add(houseOrder);
|
|
|
}
|
|
|
|