|
@@ -50,6 +50,9 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
@Autowired
|
|
@Autowired
|
|
|
HouseOrderMapper houseOrderMapper;
|
|
HouseOrderMapper houseOrderMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ ApplicationProcedureTemporaryService apts;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public BigDecimal getHouseOrderPrice(int houseOrderNumber, String userId, String houseId, String liveTime, String leaveTime) {
|
|
public BigDecimal getHouseOrderPrice(int houseOrderNumber, String userId, String houseId, String liveTime, String leaveTime) {
|
|
|
|
|
|
|
@@ -105,6 +108,10 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
// 获取这断时间内的上 8 9节课的老师
|
|
// 获取这断时间内的上 8 9节课的老师
|
|
|
Users users = usersService.getById(userId);
|
|
Users users = usersService.getById(userId);
|
|
|
|
|
|
|
|
|
|
+// 判断你是老师还是临时人员
|
|
|
|
|
+ String department = users.getDepartment();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
LambdaQueryWrapper<ClassSchedule> wrapperCS = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ClassSchedule> wrapperCS = new LambdaQueryWrapper<>();
|
|
|
wrapperCS.eq(ClassSchedule::getJsgh, users.getCardNumber())
|
|
wrapperCS.eq(ClassSchedule::getJsgh, users.getCardNumber())
|
|
|
.between(ClassSchedule::getDateTime, state, end);
|
|
.between(ClassSchedule::getDateTime, state, end);
|
|
@@ -113,23 +120,25 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
BigDecimal totalPrice = new BigDecimal(0);
|
|
BigDecimal totalPrice = new BigDecimal(0);
|
|
|
for (int i = 0; i < until; i++) {
|
|
for (int i = 0; i < until; i++) {
|
|
|
LocalDate localDate1 = state.plusDays(i);
|
|
LocalDate localDate1 = state.plusDays(i);
|
|
|
|
|
+
|
|
|
|
|
+ LocalDateTime dateTime1 = stateTime.plusDays(i);
|
|
|
List<HousePrice> housePrices1 = housePriceService.getDatePrice(localDate1, houseId);
|
|
List<HousePrice> housePrices1 = housePriceService.getDatePrice(localDate1, houseId);
|
|
|
-// LocalDate localDate2 = state.plusDays(i+1);
|
|
|
|
|
-// List<HousePrice> housePrices = housePriceService.housePrice(localDate1, localDate2, houseId);
|
|
|
|
|
- if (ObjectUtils.isNotEmpty(scheduleList)) {
|
|
|
|
|
- for (ClassSchedule classSchedule : scheduleList) {
|
|
|
|
|
- String dateTime = classSchedule.getDateTime();
|
|
|
|
|
- String[] s = dateTime.split(" ");
|
|
|
|
|
- dateTime=s[0];
|
|
|
|
|
- LocalDate parse = LocalDate.parse(dateTime, dateTimeFormatter2);
|
|
|
|
|
- if (!localDate1.equals(parse)) {
|
|
|
|
|
- if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
|
|
- HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
|
|
- BigDecimal price = housePrice.getPrice();
|
|
|
|
|
- totalPrice = totalPrice.add(price);
|
|
|
|
|
- } else {
|
|
|
|
|
- totalPrice = totalPrice.add(roomPrice);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if ("4".equals(department)) {
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(scheduleList)) {
|
|
|
|
|
+ for (ClassSchedule classSchedule : scheduleList) {
|
|
|
|
|
+ String dateTime = classSchedule.getDateTime();
|
|
|
|
|
+ String[] s = dateTime.split(" ");
|
|
|
|
|
+ dateTime = s[0];
|
|
|
|
|
+ LocalDate parse = LocalDate.parse(dateTime, dateTimeFormatter2);
|
|
|
|
|
+ if (!localDate1.equals(parse)) {
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
|
|
+ HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
|
|
+ BigDecimal price = housePrice.getPrice();
|
|
|
|
|
+ totalPrice = totalPrice.add(price);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ totalPrice = totalPrice.add(roomPrice);
|
|
|
|
|
+ }
|
|
|
// for (HousePrice housePrice : housePrices1) {
|
|
// for (HousePrice housePrice : housePrices1) {
|
|
|
// String setDate = housePrice.getSetDate();
|
|
// String setDate = housePrice.getSetDate();
|
|
|
// String[] split = setDate.split(",");
|
|
// String[] split = setDate.split(",");
|
|
@@ -148,8 +157,58 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+// 需要先判断当前时间是否已经有过订单,有的话则不免费
|
|
|
|
|
+// dateTime1
|
|
|
|
|
+ List<HouseOrder> list = houseOrderMapper.getDate(dateTime1, userId);
|
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
|
|
+ HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
|
|
+ BigDecimal price = housePrice.getPrice();
|
|
|
|
|
+ totalPrice = totalPrice.add(price);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ totalPrice = totalPrice.add(roomPrice);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
|
|
+ HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
|
|
+ BigDecimal price = housePrice.getPrice();
|
|
|
|
|
+ totalPrice = totalPrice.add(price);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ totalPrice = totalPrice.add(roomPrice);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }else if ("7".equals(department)){
|
|
|
|
|
+ List<ApplicationProcedureTemporary> list=apts.getDate(dateTime1,userId);
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(list)) {
|
|
|
|
|
+// 当有临时表时需要判断是否已经有订单,有的话则原价
|
|
|
|
|
+ List<HouseOrder> list2 = houseOrderMapper.getDate(dateTime1, userId);
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(list2)) {
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
|
|
+ HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
|
|
+ BigDecimal price = housePrice.getPrice();
|
|
|
|
|
+ totalPrice = totalPrice.add(price);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ totalPrice = totalPrice.add(roomPrice);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
|
|
+ HousePrice housePrice = housePrices1.get(housePrices1.size() - 1);
|
|
|
|
|
+ BigDecimal price = housePrice.getPrice();
|
|
|
|
|
+ totalPrice = totalPrice.add(price);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ totalPrice = totalPrice.add(roomPrice);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
|
if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
@@ -257,7 +316,7 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
for (ClassSchedule classSchedule : scheduleList) {
|
|
for (ClassSchedule classSchedule : scheduleList) {
|
|
|
String dateTime = classSchedule.getDateTime();
|
|
String dateTime = classSchedule.getDateTime();
|
|
|
String[] s = dateTime.split(" ");
|
|
String[] s = dateTime.split(" ");
|
|
|
- dateTime=s[0];
|
|
|
|
|
|
|
+ dateTime = s[0];
|
|
|
LocalDate parse = LocalDate.parse(dateTime, dateTimeFormatter2);
|
|
LocalDate parse = LocalDate.parse(dateTime, dateTimeFormatter2);
|
|
|
if (!localDate1.equals(parse)) {
|
|
if (!localDate1.equals(parse)) {
|
|
|
if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
if (ObjectUtils.isNotEmpty(housePrices1)) {
|
|
@@ -323,15 +382,15 @@ public class HouseOrderServiceImpl extends ServiceImpl<HouseOrderMapper, HouseOr
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public PageUtils<HouseOrderPageListVo> pageList(int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack) {
|
|
|
|
|
|
|
+ public PageUtils<HouseOrderPageListVo> pageList(int page, int size, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime, String houseId, Integer keyType, Integer giveBack, Integer buildingId) {
|
|
|
Page<HouseOrderPageListVo> pageVo = new Page<>(page, size);
|
|
Page<HouseOrderPageListVo> pageVo = new Page<>(page, size);
|
|
|
- IPage<HouseOrderPageListVo> result = houseOrderMapper.pageList(pageVo, keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime,houseId,keyType,giveBack);
|
|
|
|
|
|
|
+ IPage<HouseOrderPageListVo> result = houseOrderMapper.pageList(pageVo, keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime, houseId, keyType, giveBack, buildingId);
|
|
|
return new PageUtils(result);
|
|
return new PageUtils(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<QueryExportVo> queryExport(String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime,String houseId,Integer keyType,Integer giveBack) {
|
|
|
|
|
- return houseOrderMapper.queryExport(keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime,houseId,keyType,giveBack);
|
|
|
|
|
|
|
+ public List<QueryExportVo> queryExport(String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime, String houseId, Integer keyType, Integer giveBack, Integer buildingId) {
|
|
|
|
|
+ return houseOrderMapper.queryExport(keyWord, houseType, orderStatus, payPriceStartTime, payPriceEndTime, refundStartTime, refundEndTime, cancelStartTime, cancelEndTime, liveStartTime, liveEndTime, leaveStartTime, leaveEndTime, houseId, keyType, giveBack, buildingId);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|