|
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
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.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -20,6 +21,9 @@ import org.jeecg.common.util.TokenUtils;
|
|
|
import org.jeecg.modules.business.entity.*;
|
|
import org.jeecg.modules.business.entity.*;
|
|
|
import org.jeecg.modules.business.service.*;
|
|
import org.jeecg.modules.business.service.*;
|
|
|
import org.jeecg.modules.business.util.MapUtil;
|
|
import org.jeecg.modules.business.util.MapUtil;
|
|
|
|
|
+import org.jeecg.modules.quartz.entity.QuartzJob;
|
|
|
|
|
+import org.jeecg.modules.quartz.service.IQuartzJobService;
|
|
|
|
|
+import org.jeecg.modules.quartz.service.impl.QuartzJobServiceImpl;
|
|
|
import org.jeecg.modules.rooms.DTO.CesAllDayPriceRuleDto;
|
|
import org.jeecg.modules.rooms.DTO.CesAllDayPriceRuleDto;
|
|
|
import org.jeecg.modules.rooms.entity.CesHousePriceScheme;
|
|
import org.jeecg.modules.rooms.entity.CesHousePriceScheme;
|
|
|
import org.jeecg.modules.rooms.service.CesAllDayPriceRuleServiceImpl;
|
|
import org.jeecg.modules.rooms.service.CesAllDayPriceRuleServiceImpl;
|
|
@@ -94,6 +98,12 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
@Resource
|
|
@Resource
|
|
|
CesHousePriceSchemeServiceImpl housePriceSchemeService;
|
|
CesHousePriceSchemeServiceImpl housePriceSchemeService;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ IBusRoomPayTypeService roomPayTypeService;
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ IQuartzJobService quartzJobService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 分页列表查询
|
|
* 分页列表查询
|
|
|
*
|
|
*
|
|
@@ -162,9 +172,6 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
queryDict.eq(BusDict::getTenantId, "0");
|
|
queryDict.eq(BusDict::getTenantId, "0");
|
|
|
List<BusDict> listDict = busDictService.list(queryDict);
|
|
List<BusDict> listDict = busDictService.list(queryDict);
|
|
|
if (listDict != null && listDict.size() > 0){
|
|
if (listDict != null && listDict.size() > 0){
|
|
|
-// for (BusDict busDict : listDict) {
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
List<BusDict> batchModels = new ArrayList<>();
|
|
List<BusDict> batchModels = new ArrayList<>();
|
|
|
listDict.forEach( item -> {
|
|
listDict.forEach( item -> {
|
|
|
BusDict newModel = new BusDict();
|
|
BusDict newModel = new BusDict();
|
|
@@ -181,6 +188,30 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
busDictService.saveBatch(batchModels);
|
|
busDictService.saveBatch(batchModels);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //添加酒店后初始化收费方式
|
|
|
|
|
+ LambdaQueryWrapper<BusRoomPayType> queryPayType = new LambdaQueryWrapper<>();
|
|
|
|
|
+ queryPayType.eq(BusRoomPayType::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
|
|
|
|
+ queryPayType.eq(BusRoomPayType::getHotelId, "0");
|
|
|
|
|
+ queryPayType.eq(BusRoomPayType::getTenantId, "0");
|
|
|
|
|
+ queryPayType.eq(BusRoomPayType::getIsMust, true);
|
|
|
|
|
+ List<BusRoomPayType> payTypeList = roomPayTypeService.list(queryPayType);
|
|
|
|
|
+ if (payTypeList != null && !payTypeList.isEmpty()){
|
|
|
|
|
+ List<BusRoomPayType> batchModels = new ArrayList<>();
|
|
|
|
|
+ payTypeList.forEach( item -> {
|
|
|
|
|
+ BusRoomPayType newModel = new BusRoomPayType();
|
|
|
|
|
+ newModel.setTenantId(busHotel.getTenantId());
|
|
|
|
|
+ newModel.setHotelId(busHotel.getId());
|
|
|
|
|
+ newModel.setName(item.getName());
|
|
|
|
|
+ newModel.setIsDeposit(item.getIsDeposit());
|
|
|
|
|
+ newModel.setIsClosing(item.getIsClosing());
|
|
|
|
|
+ newModel.setIsMust(item.getIsMust());
|
|
|
|
|
+ newModel.setStatus(item.getStatus());
|
|
|
|
|
+ newModel.setDelFlag(item.getDelFlag());
|
|
|
|
|
+ batchModels.add(newModel);
|
|
|
|
|
+ });
|
|
|
|
|
+ roomPayTypeService.saveBatch(batchModels);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//初始化打印模板
|
|
//初始化打印模板
|
|
|
LambdaQueryWrapper<BusPrintTemplate> queryPrintTemplate = new LambdaQueryWrapper<BusPrintTemplate>();
|
|
LambdaQueryWrapper<BusPrintTemplate> queryPrintTemplate = new LambdaQueryWrapper<BusPrintTemplate>();
|
|
|
queryPrintTemplate.eq(BusPrintTemplate::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
|
queryPrintTemplate.eq(BusPrintTemplate::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
|
@@ -478,6 +509,27 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
busParamXcxRoomService.save(newModel);
|
|
busParamXcxRoomService.save(newModel);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //定时任务
|
|
|
|
|
+ ArrayList<QuartzJob> quartzJobs = new ArrayList<>();
|
|
|
|
|
+ QuartzJob quartzJob1 = new QuartzJob();
|
|
|
|
|
+ quartzJob1.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
|
|
|
+ quartzJob1.setJobClassName("org.jeecg.modules.quartz.job.LivingRoomOrderFeeJob");
|
|
|
|
|
+ quartzJob1.setCronExpression("0 */1 * * * ?");
|
|
|
|
|
+ quartzJob1.setParameter(busHotel.getId());
|
|
|
|
|
+ quartzJob1.setStatus(CommonConstant.STATUS_DISABLE);
|
|
|
|
|
+
|
|
|
|
|
+ QuartzJob quartzJob2 = new QuartzJob();
|
|
|
|
|
+ quartzJob2.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
|
|
|
+ quartzJob2.setJobClassName("org.jeecg.modules.quartz.job.NightAuditJob");
|
|
|
|
|
+ quartzJob2.setCronExpression("0 00 06 * * ? ");
|
|
|
|
|
+ quartzJob2.setParameter(busHotel.getId());
|
|
|
|
|
+ quartzJob2.setStatus(CommonConstant.STATUS_DISABLE);
|
|
|
|
|
+ quartzJobs.add(quartzJob1);
|
|
|
|
|
+ quartzJobs.add(quartzJob2);
|
|
|
|
|
+ quartzJobService.saveBatch(quartzJobs);
|
|
|
|
|
+ quartzJobService.resumeJob(quartzJob1);
|
|
|
|
|
+ quartzJobService.resumeJob(quartzJob2);
|
|
|
|
|
+
|
|
|
//全天房计费规则
|
|
//全天房计费规则
|
|
|
CesAllDayPriceRuleDto cesAllDayPriceRuleDto = new CesAllDayPriceRuleDto();
|
|
CesAllDayPriceRuleDto cesAllDayPriceRuleDto = new CesAllDayPriceRuleDto();
|
|
|
cesAllDayPriceRuleDto.setHotelId(busHotel.getId());
|
|
cesAllDayPriceRuleDto.setHotelId(busHotel.getId());
|
|
@@ -493,7 +545,7 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
cesAllDayPriceRuleDto.setDayTime("30");
|
|
cesAllDayPriceRuleDto.setDayTime("30");
|
|
|
cesAllDayPriceRuleDto.setInvalid(false);
|
|
cesAllDayPriceRuleDto.setInvalid(false);
|
|
|
cesAllDayPriceRuleService.modifyWholeDayUnifyPrice(cesAllDayPriceRuleDto);
|
|
cesAllDayPriceRuleService.modifyWholeDayUnifyPrice(cesAllDayPriceRuleDto);
|
|
|
-
|
|
|
|
|
|
|
+ // 基础房价方案 平日方案,周末方案,节假日方案
|
|
|
List<CesHousePriceScheme> priceSchemeList = new ArrayList<>(3);
|
|
List<CesHousePriceScheme> priceSchemeList = new ArrayList<>(3);
|
|
|
CesHousePriceScheme priceScheme = new CesHousePriceScheme();
|
|
CesHousePriceScheme priceScheme = new CesHousePriceScheme();
|
|
|
CesHousePriceScheme weekScheme = new CesHousePriceScheme();
|
|
CesHousePriceScheme weekScheme = new CesHousePriceScheme();
|
|
@@ -516,6 +568,7 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 编辑
|
|
* 编辑
|
|
|
*
|
|
*
|