浏览代码

初始化全天房计费规则

WIN-B904R0U0NNS\Administrator 2 年之前
父节点
当前提交
0e2ea7d423

+ 21 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/BusHotelController.java

@@ -1,11 +1,13 @@
 package org.jeecg.modules.business.controller;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -30,6 +32,8 @@ import org.jeecg.modules.business.entity.*;
 import org.jeecg.modules.business.service.*;
 import org.jeecg.modules.business.service.impl.BusCancelServiceImpl;
 import org.jeecg.modules.business.util.MapUtil;
+import org.jeecg.modules.rooms.DTO.CesAllDayPriceRuleDto;
+import org.jeecg.modules.rooms.service.CesAllDayPriceRuleServiceImpl;
 import org.jeecg.modules.system.entity.SysTenant;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.service.ISysTenantService;
@@ -103,6 +107,8 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
 	 private IBusParamPresetSyncService busParamPresetSyncService;
 	 @Autowired
 	 private IBusParamXcxRoomService busParamXcxRoomService;
+	 @Resource
+	 CesAllDayPriceRuleServiceImpl cesAllDayPriceRuleService;
 
 	/**
 	 * 分页列表查询
@@ -488,7 +494,21 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
 			busParamXcxRoomService.save(newModel);
 		}
 
-
+		//全天房计费规则
+		CesAllDayPriceRuleDto cesAllDayPriceRuleDto = new CesAllDayPriceRuleDto();
+		cesAllDayPriceRuleDto.setHotelId(busHotel.getId());
+		cesAllDayPriceRuleDto.setEnterTime("6:00");
+		cesAllDayPriceRuleDto.setLeaveTime("14:00");
+		cesAllDayPriceRuleDto.setTimeOutRule(1);
+		cesAllDayPriceRuleDto.setRuleType(1);
+		cesAllDayPriceRuleDto.setMinute(30);
+		cesAllDayPriceRuleDto.setPrice(BigDecimal.valueOf(10));
+		cesAllDayPriceRuleDto.setMoreThenMinute(10);
+		cesAllDayPriceRuleDto.setMoreThenPrice(BigDecimal.valueOf(5));
+		cesAllDayPriceRuleDto.setEndTime("18:00");
+		cesAllDayPriceRuleDto.setDayTime("30");
+		cesAllDayPriceRuleDto.setInvalid(false);
+		cesAllDayPriceRuleService.modifyWholeDayUnifyPrice(cesAllDayPriceRuleDto);
 		return Result.OK("添加成功!");
 	}