|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import com.sun.org.apache.bcel.internal.generic.NEW;
|
|
|
import com.template.annotation.PassToken;
|
|
import com.template.annotation.PassToken;
|
|
|
import com.template.api.HouseOrderAPI;
|
|
import com.template.api.HouseOrderAPI;
|
|
|
import com.template.common.utils.*;
|
|
import com.template.common.utils.*;
|
|
@@ -35,6 +36,7 @@ import com.wechat.pay.java.service.payments.nativepay.NativePayService;
|
|
|
import com.wechat.pay.java.service.refund.RefundService;
|
|
import com.wechat.pay.java.service.refund.RefundService;
|
|
|
import com.wechat.pay.java.service.refund.model.QueryByOutRefundNoRequest;
|
|
import com.wechat.pay.java.service.refund.model.QueryByOutRefundNoRequest;
|
|
|
import com.wechat.pay.java.service.refund.model.Refund;
|
|
import com.wechat.pay.java.service.refund.model.Refund;
|
|
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
@@ -359,7 +361,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
// 预定人电话号码
|
|
// 预定人电话号码
|
|
|
houseOrder.setReservePhone(users.getPhone());
|
|
houseOrder.setReservePhone(users.getPhone());
|
|
|
log.info("预定人手机号码:" + users.getPhone());
|
|
log.info("预定人手机号码:" + users.getPhone());
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
// 预定人姓名
|
|
// 预定人姓名
|
|
|
houseOrder.setReserveName(establishOrderDto.getReserveName());
|
|
houseOrder.setReserveName(establishOrderDto.getReserveName());
|
|
|
log.info("预定人姓名:" + establishOrderDto.getReserveName());
|
|
log.info("预定人姓名:" + establishOrderDto.getReserveName());
|
|
@@ -1169,7 +1171,6 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
houseOrderBillService.save(houseOrderBill);
|
|
houseOrderBillService.save(houseOrderBill);
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
LambdaQueryWrapper<Unlocking> wrapperU = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Unlocking> wrapperU = new LambdaQueryWrapper<>();
|
|
|
wrapperU.eq(Unlocking::getOrderNumber, orderNumber)
|
|
wrapperU.eq(Unlocking::getOrderNumber, orderNumber)
|
|
@@ -1488,7 +1489,6 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
Users users = usersService.getById(liveUsersId);
|
|
Users users = usersService.getById(liveUsersId);
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
if (ObjectUtils.isNotEmpty(unlocking)) {
|
|
if (ObjectUtils.isNotEmpty(unlocking)) {
|
|
|
|
|
|
|
|
// 判断是什么类型的开锁方式
|
|
// 判断是什么类型的开锁方式
|
|
@@ -1813,61 +1813,176 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
headerRow.createCell(9).setCellValue("订单状态");
|
|
headerRow.createCell(9).setCellValue("订单状态");
|
|
|
headerRow.createCell(10).setCellValue("创建时间");
|
|
headerRow.createCell(10).setCellValue("创建时间");
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if (ObjectUtils.isNotEmpty(vos) && vos.size() > 0) {
|
|
if (ObjectUtils.isNotEmpty(vos) && vos.size() > 0) {
|
|
|
- for (int i = 0; i < vos.size(); i++) {
|
|
|
|
|
- ReportStatisticsExportVo vo = vos.get(i);
|
|
|
|
|
- Row dataRow1 = sheet.createRow(i + 1);
|
|
|
|
|
|
|
+ if ("5".equals(s)) {
|
|
|
|
|
+ headerRow.createCell(11).setCellValue("订单详情");
|
|
|
|
|
+ //水:2.1元/吨,电:0.62元/度
|
|
|
|
|
+ BigDecimal waterPrice = new BigDecimal(2.1);
|
|
|
|
|
+ BigDecimal electricPrice = new BigDecimal(0.62);
|
|
|
|
|
+
|
|
|
|
|
+ // 获取免费的额度
|
|
|
|
|
+ SubsidySetup subsidySetup = subsidySetupService.list(new LambdaQueryWrapper<>()).get(0);
|
|
|
|
|
+
|
|
|
|
|
+ BigDecimal water = subsidySetup.getFreeQuotaOfWater();
|
|
|
|
|
+ BigDecimal electric = subsidySetup.getFreeQuotaOfElectric();
|
|
|
|
|
|
|
|
- dataRow1.createCell(0).setCellValue(i + 1);
|
|
|
|
|
- dataRow1.createCell(1).setCellValue(vo.getOrderNumber());
|
|
|
|
|
- dataRow1.createCell(2).setCellValue(vo.getLiveName());
|
|
|
|
|
|
|
+ for (int i = 0; i < vos.size(); i++) {
|
|
|
|
|
+ ReportStatisticsExportVo vo = vos.get(i);
|
|
|
|
|
+ Row dataRow1 = sheet.createRow(i + 1);
|
|
|
|
|
+
|
|
|
|
|
+ dataRow1.createCell(0).setCellValue(i + 1);
|
|
|
|
|
+ dataRow1.createCell(1).setCellValue(vo.getOrderNumber());
|
|
|
|
|
+ dataRow1.createCell(2).setCellValue(vo.getLiveName());
|
|
|
// 房型是房间名称加房间类型
|
|
// 房型是房间名称加房间类型
|
|
|
- String roomName = vo.getRoomName();
|
|
|
|
|
- String roomType = vo.getRoomType();
|
|
|
|
|
- String type = "";
|
|
|
|
|
- if ("1".equals(roomType)) {
|
|
|
|
|
- type = "全";
|
|
|
|
|
- } else {
|
|
|
|
|
- type = "钟";
|
|
|
|
|
- }
|
|
|
|
|
- dataRow1.createCell(3).setCellValue(vo.getOrgName());
|
|
|
|
|
- dataRow1.createCell(4).setCellValue(vo.getCardNumber());
|
|
|
|
|
- if (ObjectUtils.isEmpty(roomName)) {
|
|
|
|
|
- dataRow1.createCell(5).setCellValue(roomName);
|
|
|
|
|
- } else {
|
|
|
|
|
- dataRow1.createCell(5).setCellValue(roomName + "(" + type + ")");
|
|
|
|
|
- }
|
|
|
|
|
- dataRow1.createCell(6).setCellValue(vo.getRoomNumber());
|
|
|
|
|
- dataRow1.createCell(7).setCellValue(vo.getPayPrice().doubleValue());
|
|
|
|
|
- dataRow1.createCell(8).setCellValue(vo.getPayTime());
|
|
|
|
|
|
|
+ String roomName = vo.getRoomName();
|
|
|
|
|
+ String roomType = vo.getRoomType();
|
|
|
|
|
+ String type = "";
|
|
|
|
|
+ if ("1".equals(roomType)) {
|
|
|
|
|
+ type = "全";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ type = "钟";
|
|
|
|
|
+ }
|
|
|
|
|
+ dataRow1.createCell(3).setCellValue(vo.getOrgName());
|
|
|
|
|
+ dataRow1.createCell(4).setCellValue(vo.getCardNumber());
|
|
|
|
|
+ if (ObjectUtils.isEmpty(roomName)) {
|
|
|
|
|
+ dataRow1.createCell(5).setCellValue(roomName);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dataRow1.createCell(5).setCellValue(roomName + "(" + type + ")");
|
|
|
|
|
+ }
|
|
|
|
|
+ dataRow1.createCell(6).setCellValue(vo.getRoomNumber());
|
|
|
|
|
+ dataRow1.createCell(7).setCellValue(vo.getPayPrice().doubleValue());
|
|
|
|
|
+ dataRow1.createCell(8).setCellValue(vo.getPayTime());
|
|
|
// 订单状态
|
|
// 订单状态
|
|
|
- String orderStatus = vo.getOrderStatus();
|
|
|
|
|
- String orderName = "";
|
|
|
|
|
- if ("1".equals(orderStatus)) {
|
|
|
|
|
- orderName = "待支付";
|
|
|
|
|
- } else if ("2".equals(orderStatus)) {
|
|
|
|
|
- orderName = "已支付";
|
|
|
|
|
- } else if ("3".equals(orderStatus)) {
|
|
|
|
|
- orderName = "待入住";
|
|
|
|
|
- } else if ("4".equals(orderStatus)) {
|
|
|
|
|
- orderName = "已入住";
|
|
|
|
|
- } else if ("5".equals(orderStatus)) {
|
|
|
|
|
- orderName = "待结账";
|
|
|
|
|
- } else if ("6".equals(orderStatus)) {
|
|
|
|
|
- orderName = "退款中";
|
|
|
|
|
- } else if ("7".equals(orderStatus)) {
|
|
|
|
|
- orderName = "已退款";
|
|
|
|
|
- } else if ("8".equals(orderStatus)) {
|
|
|
|
|
- orderName = "已退房";
|
|
|
|
|
- } else if ("9".equals(orderStatus)) {
|
|
|
|
|
- orderName = "已取消";
|
|
|
|
|
- } else if ("10".equals(orderStatus)) {
|
|
|
|
|
- orderName = "已支付未入住";
|
|
|
|
|
|
|
+ String orderStatus = vo.getOrderStatus();
|
|
|
|
|
+ String orderName = "";
|
|
|
|
|
+ if ("1".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "待支付";
|
|
|
|
|
+ } else if ("2".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已支付";
|
|
|
|
|
+ } else if ("3".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "待入住";
|
|
|
|
|
+ } else if ("4".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已入住";
|
|
|
|
|
+ } else if ("5".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "待结账";
|
|
|
|
|
+ } else if ("6".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "退款中";
|
|
|
|
|
+ } else if ("7".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已退款";
|
|
|
|
|
+ } else if ("8".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已退房";
|
|
|
|
|
+ } else if ("9".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已取消";
|
|
|
|
|
+ } else if ("10".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已支付未入住";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ dataRow1.createCell(9).setCellValue(orderName);
|
|
|
|
|
+ dataRow1.createCell(10).setCellValue(vo.getCreateTime());
|
|
|
|
|
+// 订单详情
|
|
|
|
|
+ List<HouseOrderWaterAndElectricVo> houseOrderWaters=houseOrderService.getWaterAndElectric(vo.getHouseOrderSource());
|
|
|
|
|
+ String details="";
|
|
|
|
|
+ for (int i2 = 0; i2 < houseOrderWaters.size(); i++) {
|
|
|
|
|
+ HouseOrderWaterAndElectricVo we = houseOrderWaters.get(i2);
|
|
|
|
|
+ we.setFreeWater(water);
|
|
|
|
|
+ we.setWaterPrice(waterPrice);
|
|
|
|
|
+// 计算总金额
|
|
|
|
|
+ BigDecimal waterConsume = we.getWaterConsume();
|
|
|
|
|
+ BigDecimal subtract=waterConsume.subtract(water);
|
|
|
|
|
+ if (subtract.doubleValue()<0) {
|
|
|
|
|
+ subtract=new BigDecimal(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ BigDecimal waterTotalPrice=subtract.multiply(waterPrice);
|
|
|
|
|
+ we.setWaterTotalPrice(waterTotalPrice);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ we.setFreeElectric(electric);
|
|
|
|
|
+ we.setElectricPrice(electricPrice);
|
|
|
|
|
+// 计算总金额
|
|
|
|
|
+ BigDecimal electricConsume = we.getElectricConsume();
|
|
|
|
|
+ BigDecimal subtract2=electricConsume.subtract(electric);
|
|
|
|
|
+ if (subtract2.doubleValue()<0) {
|
|
|
|
|
+ subtract2=new BigDecimal(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ BigDecimal electricTotalPrice=subtract2.multiply(electricPrice);
|
|
|
|
|
+ we.setElectricTotalPrice(electricTotalPrice);
|
|
|
|
|
+
|
|
|
|
|
+ if (i2==0) {
|
|
|
|
|
+ details="订单号: "+we.getOrderNumber()+","+"入住时间: "+we.getLiveTime()+","+"离店时间: "+we.getLeaveTime()+","+"房号: "+we.getRoomNumber()
|
|
|
|
|
+ +","+"用水量/吨: "+we.getWaterConsume()+","+"水价/元: "+we.getWaterPrice()+","+"水费补助/吨: "+we.getFreeWater()
|
|
|
|
|
+ +","+"产生水费/元: "+we.getWaterTotalPrice()+","+"用电量/度: "+we.getElectricConsume()+","+"电价/元: "+we.getElectricPrice()
|
|
|
|
|
+ +","+"电费补助/度: "+we.getFreeElectric()+","+"产生的电费/元: "+we.getElectricTotalPrice();
|
|
|
|
|
+ }else {
|
|
|
|
|
+ details=details+"\n"
|
|
|
|
|
+ +"订单号: "+we.getOrderNumber()+","+"入住时间: "+we.getLiveTime()+","+"离店时间: "+we.getLeaveTime()+","+"房号: "+we.getRoomNumber()
|
|
|
|
|
+ +","+"用水量/吨: "+we.getWaterConsume()+","+"水价/元: "+we.getWaterPrice()+","+"水费补助/吨: "+we.getFreeWater()
|
|
|
|
|
+ +","+"产生水费/元: "+we.getWaterTotalPrice()+","+"用电量/度: "+we.getElectricConsume()+","+"电价/元: "+we.getElectricPrice()
|
|
|
|
|
+ +","+"电费补助/度: "+we.getFreeElectric()+","+"产生的电费/元: "+we.getElectricTotalPrice();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ dataRow1.createCell(11).setCellValue(details);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- dataRow1.createCell(9).setCellValue(orderName);
|
|
|
|
|
- dataRow1.createCell(10).setCellValue(vo.getCreateTime());
|
|
|
|
|
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ for (int i = 0; i < vos.size(); i++) {
|
|
|
|
|
+ ReportStatisticsExportVo vo = vos.get(i);
|
|
|
|
|
+ Row dataRow1 = sheet.createRow(i + 1);
|
|
|
|
|
+
|
|
|
|
|
+ dataRow1.createCell(0).setCellValue(i + 1);
|
|
|
|
|
+ dataRow1.createCell(1).setCellValue(vo.getOrderNumber());
|
|
|
|
|
+ dataRow1.createCell(2).setCellValue(vo.getLiveName());
|
|
|
|
|
+// 房型是房间名称加房间类型
|
|
|
|
|
+ String roomName = vo.getRoomName();
|
|
|
|
|
+ String roomType = vo.getRoomType();
|
|
|
|
|
+ String type = "";
|
|
|
|
|
+ if ("1".equals(roomType)) {
|
|
|
|
|
+ type = "全";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ type = "钟";
|
|
|
|
|
+ }
|
|
|
|
|
+ dataRow1.createCell(3).setCellValue(vo.getOrgName());
|
|
|
|
|
+ dataRow1.createCell(4).setCellValue(vo.getCardNumber());
|
|
|
|
|
+ if (ObjectUtils.isEmpty(roomName)) {
|
|
|
|
|
+ dataRow1.createCell(5).setCellValue(roomName);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dataRow1.createCell(5).setCellValue(roomName + "(" + type + ")");
|
|
|
|
|
+ }
|
|
|
|
|
+ dataRow1.createCell(6).setCellValue(vo.getRoomNumber());
|
|
|
|
|
+ dataRow1.createCell(7).setCellValue(vo.getPayPrice().doubleValue());
|
|
|
|
|
+ dataRow1.createCell(8).setCellValue(vo.getPayTime());
|
|
|
|
|
+// 订单状态
|
|
|
|
|
+ String orderStatus = vo.getOrderStatus();
|
|
|
|
|
+ String orderName = "";
|
|
|
|
|
+ if ("1".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "待支付";
|
|
|
|
|
+ } else if ("2".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已支付";
|
|
|
|
|
+ } else if ("3".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "待入住";
|
|
|
|
|
+ } else if ("4".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已入住";
|
|
|
|
|
+ } else if ("5".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "待结账";
|
|
|
|
|
+ } else if ("6".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "退款中";
|
|
|
|
|
+ } else if ("7".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已退款";
|
|
|
|
|
+ } else if ("8".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已退房";
|
|
|
|
|
+ } else if ("9".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已取消";
|
|
|
|
|
+ } else if ("10".equals(orderStatus)) {
|
|
|
|
|
+ orderName = "已支付未入住";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ dataRow1.createCell(9).setCellValue(orderName);
|
|
|
|
|
+ dataRow1.createCell(10).setCellValue(vo.getCreateTime());
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1877,7 +1992,6 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
// return CommonResult.ok();
|
|
// return CommonResult.ok();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public CommonResult orderPage(String userId, int page, int size, String status) {
|
|
public CommonResult orderPage(String userId, int page, int size, String status) {
|
|
|
|
|
|
|
@@ -3612,6 +3726,62 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
return CommonResult.ok(vos);
|
|
return CommonResult.ok(vos);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CommonResult reportStatisticsParticulars(Integer id) {
|
|
|
|
|
+ HouseOrder houseOrder = houseOrderService.getById(id);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(houseOrder)) {
|
|
|
|
|
+ return CommonResult.fail("不存在该订单");
|
|
|
|
|
+ }
|
|
|
|
|
+ String houseOrderSource = houseOrder.getHouseOrderSource();
|
|
|
|
|
+ List<HouseOrderWaterVo> houseOrderWaters=houseOrderService.getWater(houseOrderSource);
|
|
|
|
|
+ List<HouseOrderElectricVo> houseOrderElectrics=houseOrderService.getElectric(houseOrderSource);
|
|
|
|
|
+
|
|
|
|
|
+ //水:2.1元/吨,电:0.62元/度
|
|
|
|
|
+ BigDecimal waterPrice = new BigDecimal(2.1);
|
|
|
|
|
+ BigDecimal electricPrice = new BigDecimal(0.62);
|
|
|
|
|
+
|
|
|
|
|
+ // 获取免费的额度
|
|
|
|
|
+ SubsidySetup subsidySetup = subsidySetupService.list(new LambdaQueryWrapper<>()).get(0);
|
|
|
|
|
+
|
|
|
|
|
+ BigDecimal water = subsidySetup.getFreeQuotaOfWater();
|
|
|
|
|
+ BigDecimal electric = subsidySetup.getFreeQuotaOfElectric();
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < houseOrderWaters.size(); i++) {
|
|
|
|
|
+ HouseOrderWaterVo houseOrderWaterVo = houseOrderWaters.get(i);
|
|
|
|
|
+ houseOrderWaterVo.setFreeWater(water);
|
|
|
|
|
+ houseOrderWaterVo.setWaterPrice(waterPrice);
|
|
|
|
|
+// 计算总金额
|
|
|
|
|
+ BigDecimal waterConsume = houseOrderWaterVo.getWaterConsume();
|
|
|
|
|
+ BigDecimal subtract=waterConsume.subtract(water);
|
|
|
|
|
+ if (subtract.doubleValue()<0) {
|
|
|
|
|
+ subtract=new BigDecimal(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ BigDecimal waterTotalPrice=subtract.multiply(waterPrice);
|
|
|
|
|
+ houseOrderWaterVo.setWaterTotalPrice(waterTotalPrice);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < houseOrderElectrics.size(); i++) {
|
|
|
|
|
+ HouseOrderElectricVo houseOrderElectricVo = houseOrderElectrics.get(i);
|
|
|
|
|
+ houseOrderElectricVo.setFreeElectric(electric);
|
|
|
|
|
+ houseOrderElectricVo.setElectricPrice(electricPrice);
|
|
|
|
|
+// 计算总金额
|
|
|
|
|
+ BigDecimal electricConsume = houseOrderElectricVo.getElectricConsume();
|
|
|
|
|
+ BigDecimal subtract=electricConsume.subtract(electric);
|
|
|
|
|
+ if (subtract.doubleValue()<0) {
|
|
|
|
|
+ subtract=new BigDecimal(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ BigDecimal electricTotalPrice=subtract.multiply(electricPrice);
|
|
|
|
|
+ houseOrderElectricVo.setElectricTotalPrice(electricTotalPrice);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ReportStatisticsParticularsVo vo = new ReportStatisticsParticularsVo();
|
|
|
|
|
+ vo.setHouseOrder(houseOrder);
|
|
|
|
|
+ vo.setWaterVos(houseOrderWaters);
|
|
|
|
|
+ vo.setElectricVos(houseOrderElectrics);
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
public static void main(String[] args) throws Exception {
|
|
|
// 获取签名
|
|
// 获取签名
|
|
@@ -3627,10 +3797,11 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
// 使用商户私钥对待签名串进行SHA256 with RSA签名,并对签名结果进行Base64编码得到签名值
|
|
// 使用商户私钥对待签名串进行SHA256 with RSA签名,并对签名结果进行Base64编码得到签名值
|
|
|
Signature sign = Signature.getInstance("SHA256withRSA");
|
|
Signature sign = Signature.getInstance("SHA256withRSA");
|
|
|
// sign.initSign(privateKey);
|
|
// sign.initSign(privateKey);
|
|
|
- sign.update(qmc.getBytes());
|
|
|
|
|
|
|
+// sign.update(qmc.getBytes());
|
|
|
String signature = RSATest.sign("KReLfbAgGZKc3slfEW9Jnhn7RLKqyrGF", qmc);
|
|
String signature = RSATest.sign("KReLfbAgGZKc3slfEW9Jnhn7RLKqyrGF", qmc);
|
|
|
System.out.println("signature = " + signature);
|
|
System.out.println("signature = " + signature);
|
|
|
-
|
|
|
|
|
|
|
+// String a="第一个订单"+"\n"+"第二个订单";
|
|
|
|
|
+// System.out.println(a);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3752,7 +3923,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// @Scheduled(cron = "0 0/1 * * * ?")
|
|
|
|
|
|
|
+ // @Scheduled(cron = "0 0/1 * * * ?")
|
|
|
public void pay() {
|
|
public void pay() {
|
|
|
// 计算上个免费的订单
|
|
// 计算上个免费的订单
|
|
|
LocalDateTime end = LocalDateTime.now().withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
|
LocalDateTime end = LocalDateTime.now().withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
|
@@ -3814,8 +3985,8 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
BigDecimal waterPrice = new BigDecimal(2.1);
|
|
BigDecimal waterPrice = new BigDecimal(2.1);
|
|
|
BigDecimal electricPrice = new BigDecimal(0.62);
|
|
BigDecimal electricPrice = new BigDecimal(0.62);
|
|
|
|
|
|
|
|
- water = water.multiply(waterPrice);
|
|
|
|
|
- electric = electric.multiply(electricPrice);
|
|
|
|
|
|
|
+// water = water.multiply(waterPrice);
|
|
|
|
|
+// electric = electric.multiply(electricPrice);
|
|
|
|
|
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
@@ -3844,34 +4015,57 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
BigDecimal electricTotal = new BigDecimal(0);
|
|
BigDecimal electricTotal = new BigDecimal(0);
|
|
|
BigDecimal electricCostTotal = new BigDecimal(0);
|
|
BigDecimal electricCostTotal = new BigDecimal(0);
|
|
|
|
|
|
|
|
- for (HouseOrder ownerClass : ownerClasses) {
|
|
|
|
|
|
|
+ String houseOrderSource = "";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < ownerClasses.size(); i++) {
|
|
|
|
|
+ HouseOrder ownerClass = ownerClasses.get(i);
|
|
|
|
|
+ String id = ownerClass.getId()+"";
|
|
|
|
|
+ if (i==0) {
|
|
|
|
|
+ houseOrderSource=id;
|
|
|
|
|
+ }else {
|
|
|
|
|
+ houseOrderSource=houseOrderSource+","+id;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 金额
|
|
// 金额
|
|
|
- BigDecimal electricCost = ownerClass.getElectricCost();
|
|
|
|
|
- electricCostTotal = electricCostTotal.add(electricCost);
|
|
|
|
|
|
|
+// BigDecimal electricCost = ownerClass.getElectricCost();
|
|
|
|
|
+
|
|
|
// 能耗
|
|
// 能耗
|
|
|
BigDecimal electricConsume = ownerClass.getElectricConsume();
|
|
BigDecimal electricConsume = ownerClass.getElectricConsume();
|
|
|
- electricTotal = electricTotal.add(electricConsume);
|
|
|
|
|
|
|
|
|
|
- BigDecimal waterCost = ownerClass.getWaterCost();
|
|
|
|
|
- waterCostTotal = waterCostTotal.add(waterCost);
|
|
|
|
|
|
|
+ if (electricConsume.subtract(electric).doubleValue() > 0) {
|
|
|
|
|
+// 超出的能耗
|
|
|
|
|
+ BigDecimal decimal = electricConsume.subtract(electric);
|
|
|
|
|
+// 超出的总能耗
|
|
|
|
|
+ electricTotal = electricTotal.add(decimal);
|
|
|
|
|
+
|
|
|
|
|
+// 超出的金额
|
|
|
|
|
+ BigDecimal multiply = decimal.multiply(electricPrice);
|
|
|
|
|
+// 超出的总金额
|
|
|
|
|
+ electricCostTotal = electricCostTotal.add(multiply);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
+// BigDecimal waterCost = ownerClass.getWaterCost();
|
|
|
BigDecimal waterConsume = ownerClass.getWaterConsume();
|
|
BigDecimal waterConsume = ownerClass.getWaterConsume();
|
|
|
- waterTotal = waterTotal.add(waterConsume);
|
|
|
|
|
|
|
+ if (waterConsume.subtract(water).doubleValue() > 0) {
|
|
|
|
|
+// 超出的能耗
|
|
|
|
|
+ BigDecimal decimal = waterConsume.subtract(water);
|
|
|
|
|
+// 超出的总能耗
|
|
|
|
|
+ waterTotal = waterTotal.add(decimal);
|
|
|
|
|
+
|
|
|
|
|
+// 超出的金额
|
|
|
|
|
+ BigDecimal multiply = decimal.multiply(waterPrice);
|
|
|
|
|
+// 超出的总金额
|
|
|
|
|
+ waterCostTotal = waterCostTotal.add(multiply);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 需支付金额
|
|
|
|
|
- BigDecimal payPrice = new BigDecimal(0);
|
|
|
|
|
-// 总额度大于免费额度
|
|
|
|
|
- if (waterTotal.subtract(water).doubleValue() > 0) {
|
|
|
|
|
- BigDecimal totalWaterPrice = waterCostTotal.subtract(water);
|
|
|
|
|
- payPrice = payPrice.add(totalWaterPrice);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// 需支付金额=电费+水费
|
|
|
|
|
+ BigDecimal payPrice = waterCostTotal.add(electricCostTotal);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- if (electricTotal.subtract(electric).doubleValue() > 0) {
|
|
|
|
|
- BigDecimal totalElectricPrice = electricCostTotal.subtract(electric);
|
|
|
|
|
- payPrice = payPrice.add(totalElectricPrice);
|
|
|
|
|
- }
|
|
|
|
|
if (payPrice.doubleValue() > 0) {
|
|
if (payPrice.doubleValue() > 0) {
|
|
|
HouseOrder houseOrder = new HouseOrder();
|
|
HouseOrder houseOrder = new HouseOrder();
|
|
|
// 订单号
|
|
// 订单号
|
|
@@ -3893,6 +4087,8 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
houseOrder.setReserveUserId(user);
|
|
houseOrder.setReserveUserId(user);
|
|
|
// 入住人id
|
|
// 入住人id
|
|
|
houseOrder.setLiveUsersId(user);
|
|
houseOrder.setLiveUsersId(user);
|
|
|
|
|
+// 居住天数
|
|
|
|
|
+ houseOrder.setLiveDay(ownerClasses.size() + "");
|
|
|
|
|
|
|
|
// 渠道
|
|
// 渠道
|
|
|
houseOrder.setOrderChannel("1");
|
|
houseOrder.setOrderChannel("1");
|
|
@@ -3908,6 +4104,7 @@ public class HouseOrderController implements HouseOrderAPI {
|
|
|
houseOrder.setReserveLeaveTime(end.format(dateTimeFormatter1));
|
|
houseOrder.setReserveLeaveTime(end.format(dateTimeFormatter1));
|
|
|
houseOrder.setLiveTime(Date.from(start.atZone(ZoneId.systemDefault()).toInstant()));
|
|
houseOrder.setLiveTime(Date.from(start.atZone(ZoneId.systemDefault()).toInstant()));
|
|
|
houseOrder.setLeaveTime(Date.from(end.atZone(ZoneId.systemDefault()).toInstant()));
|
|
houseOrder.setLeaveTime(Date.from(end.atZone(ZoneId.systemDefault()).toInstant()));
|
|
|
|
|
+ houseOrder.setHouseOrderSource(houseOrderSource);
|
|
|
|
|
|
|
|
houseOrders.add(houseOrder);
|
|
houseOrders.add(houseOrder);
|
|
|
}
|
|
}
|