Jelajahi Sumber

feat: 新增游轮管理-房间管理

luofeiyun 2 minggu lalu
induk
melakukan
df2b7995a7
24 mengubah file dengan 1585 tambahan dan 5 penghapusan
  1. 7 1
      ship-module-resource/ship-module-resource-api/src/main/java/com/yc/ship/module/resource/enums/ErrorCodeConstants.java
  2. 135 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/room/ResourceRoomController.java
  3. 33 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/room/vo/ResourceRoomPageReqVO.java
  4. 48 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/room/vo/ResourceRoomRespVO.java
  5. 43 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/room/vo/ResourceRoomSaveReqVO.java
  6. 130 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/roommodel/ResourceRoomModelController.java
  7. 41 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/roommodel/vo/ResourceRoomModelPageReqVO.java
  8. 93 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/roommodel/vo/ResourceRoomModelRespVO.java
  9. 66 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/roommodel/vo/ResourceRoomModelSaveReqVO.java
  10. 69 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/room/ResourceRoomDO.java
  11. 97 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/roommodel/ResourceRoomModelDO.java
  12. 35 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/roommodelrooms/ResourceRoomModelRoomsDO.java
  13. 46 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/room/ResourceRoomMapper.java
  14. 26 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/roomModelRooms/ResourceRoomModelRoomsMapper.java
  15. 35 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/roommodel/ResourceRoomModelMapper.java
  16. 69 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/room/ResourceRoomService.java
  17. 121 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/room/ResourceRoomServiceImpl.java
  18. 18 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/roomModelRooms/ResourceRoomModelRoomsService.java
  19. 30 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/roomModelRooms/ResourceRoomModelRoomsServiceImpl.java
  20. 63 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/roommodel/ResourceRoomModelService.java
  21. 118 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/roommodel/ResourceRoomModelServiceImpl.java
  22. 2 2
      ship-server-web/src/main/java/com/yc/ship/framework/web/config/WebProperties.java
  23. 258 0
      ship-server-web/src/main/resources/application-test.yaml
  24. 2 2
      ship-server-web/src/main/resources/application.yaml

+ 7 - 1
ship-module-resource/ship-module-resource-api/src/main/java/com/yc/ship/module/resource/enums/ErrorCodeConstants.java

@@ -16,5 +16,11 @@ public interface ErrorCodeConstants {
 
     ErrorCode SHIP_TYPE_NOT_EXISTS = new ErrorCode(1_003_000_005, "游轮类型不存在");
 
-    ErrorCode SHIP_NOT_EXISTS = new ErrorCode(1_003_000_006, "资源管理-游轮管理不存在");
+    ErrorCode SHIP_NOT_EXISTS = new ErrorCode(1_003_000_006, "游轮不存在");
+
+    ErrorCode ROOM_MODEL_NOT_EXISTS = new ErrorCode(1_003_000_007, "房型不存在");
+
+    ErrorCode ROOM_NOT_EXISTS = new ErrorCode(1_003_000_008, "房间不存在");
+
+    ErrorCode ROOM_NUMS_EXISTS = new ErrorCode(1_003_000_008, "该房间号已存在");
 }

+ 135 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/room/ResourceRoomController.java

@@ -0,0 +1,135 @@
+package com.yc.ship.module.resource.controller.admin.room;
+
+import com.yc.ship.framework.common.util.collection.CollectionUtils;
+import com.yc.ship.module.resource.dal.dataobject.roommodel.ResourceRoomModelDO;
+import com.yc.ship.module.resource.dal.dataobject.ship.ResourceShipDO;
+import com.yc.ship.module.resource.service.roommodel.ResourceRoomModelService;
+import com.yc.ship.module.resource.service.ship.ResourceShipService;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import com.yc.ship.framework.common.pojo.PageParam;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.pojo.CommonResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+import static com.yc.ship.framework.common.pojo.CommonResult.success;
+
+import com.yc.ship.framework.excel.core.util.ExcelUtils;
+
+import com.yc.ship.framework.apilog.core.annotation.ApiAccessLog;
+import static com.yc.ship.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import com.yc.ship.module.resource.controller.admin.room.vo.*;
+import com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO;
+import com.yc.ship.module.resource.service.room.ResourceRoomService;
+
+@Tag(name = "管理后台 - 资源管理-游轮房间管理")
+@RestController
+@RequestMapping("/resource/room")
+@Validated
+public class ResourceRoomController {
+
+    @Resource
+    private ResourceRoomService roomService;
+
+    @Resource
+    private ResourceShipService shipService;
+
+    @Resource
+    private ResourceRoomModelService modelService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建资源管理-游轮房间管理")
+    @PreAuthorize("@ss.hasPermission('resource:room:create')")
+    public CommonResult<Long> createRoom(@Valid @RequestBody ResourceRoomSaveReqVO createReqVO) {
+        return success(roomService.createRoom(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新资源管理-游轮房间管理")
+    @PreAuthorize("@ss.hasPermission('resource:room:update')")
+    public CommonResult<Boolean> updateRoom(@Valid @RequestBody ResourceRoomSaveReqVO updateReqVO) {
+        roomService.updateRoom(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除资源管理-游轮房间管理")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('resource:room:delete')")
+    public CommonResult<Boolean> deleteRoom(@RequestParam("id") Long id) {
+        roomService.deleteRoom(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得资源管理-游轮房间管理")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('resource:room:query')")
+    public CommonResult<ResourceRoomRespVO> getRoom(@RequestParam("id") Long id) {
+        ResourceRoomDO room = roomService.getRoom(id);
+        return success(BeanUtils.toBean(room, ResourceRoomRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得资源管理-游轮房间管理分页")
+    @PreAuthorize("@ss.hasPermission('resource:room:query')")
+    public CommonResult<PageResult<ResourceRoomRespVO>> getRoomPage(@Valid ResourceRoomPageReqVO pageReqVO) {
+        PageResult<ResourceRoomDO> pageResult = roomService.getRoomPage(pageReqVO);
+        PageResult<ResourceRoomRespVO> page = BeanUtils.toBean(pageResult, ResourceRoomRespVO.class);
+        List<ResourceRoomRespVO> list = page.getList();
+        //处理游轮名称
+        List<Long> shipIds = CollectionUtils.convertList(list, ResourceRoomRespVO::getShipId);
+        List<ResourceShipDO> shipList = shipService.getList(shipIds);
+        Map<Long, ResourceShipDO> longResourceShipDOMap = CollectionUtils.convertMap(shipList, ResourceShipDO::getId);
+
+        //处理房型名称
+        List<Long> modelIds = CollectionUtils.convertList(list, ResourceRoomRespVO::getRoomModelId);
+        List<ResourceRoomModelDO> modelList = modelService.getList(modelIds);
+        Map<Long, ResourceRoomModelDO> longResourceRoomModelDOMap = CollectionUtils.convertMap(modelList, ResourceRoomModelDO::getId);
+        list.stream().forEach(item -> {
+            item.setShipName(longResourceShipDOMap.get(item.getShipId()).getName());
+            item.setRoomModelName(longResourceRoomModelDOMap.get(item.getRoomModelId()).getName());
+        });
+        return success(page);
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出资源管理-游轮房间管理 Excel")
+    @PreAuthorize("@ss.hasPermission('resource:room:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportRoomExcel(@Valid ResourceRoomPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ResourceRoomDO> list = roomService.getRoomPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "资源管理-游轮房间管理.xls", "数据", ResourceRoomRespVO.class,
+                        BeanUtils.toBean(list, ResourceRoomRespVO.class));
+    }
+
+    @GetMapping("/getRoomListByShipId")
+    @Operation(summary = "根据游轮ID获取游轮房间列表")
+    public CommonResult<List<ResourceRoomRespVO>> getRoomListByShipId(@RequestParam("shipId") String shipId) {
+        List<ResourceRoomDO> list = roomService.getRoomListByShipId(shipId);
+        return success(BeanUtils.toBean(list, ResourceRoomRespVO.class));
+    }
+
+    @GetMapping("/getRoomListByShipIdAndFloors")
+    @Operation(summary = "根据游轮ID获取游轮房间管理")
+    public CommonResult<List<ResourceRoomRespVO>> getRoomListByShipIdAndFloors(@RequestParam("shipId") String shipId, @RequestParam("floors") String floors) {
+        List<ResourceRoomDO> list = roomService.getRoomListByShipIdAndFloors(shipId, floors);
+        return success(BeanUtils.toBean(list, ResourceRoomRespVO.class));
+    }
+
+}

+ 33 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/room/vo/ResourceRoomPageReqVO.java

@@ -0,0 +1,33 @@
+package com.yc.ship.module.resource.controller.admin.room.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import com.yc.ship.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static com.yc.ship.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 资源管理-游轮房间管理分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ResourceRoomPageReqVO extends PageParam {
+
+    @Schema(description = "房间号")
+    private Integer roomNum;
+
+    @Schema(description = "房型")
+    private Long roomModelId;
+
+    @Schema(description = "所属游轮", example = "2552")
+    private Long shipId;
+
+    @Schema(description = "所属楼层")
+    private Integer floors;
+
+    @Schema(description = "状态", example = "1")
+    private Integer status;
+
+}

+ 48 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/room/vo/ResourceRoomRespVO.java

@@ -0,0 +1,48 @@
+package com.yc.ship.module.resource.controller.admin.room.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import com.alibaba.excel.annotation.*;
+import com.yc.ship.framework.excel.core.annotations.DictFormat;
+import com.yc.ship.framework.excel.core.convert.DictConvert;
+
+@Schema(description = "管理后台 - 资源管理-游轮房间管理 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ResourceRoomRespVO {
+
+    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1388")
+    @ExcelProperty("ID")
+    private Long id;
+
+    @Schema(description = "房间号")
+    @ExcelProperty("房间号")
+    private Integer roomNum;
+
+    @Schema(description = "房型")
+    @ExcelProperty("房型")
+    private Long roomModelId;
+
+    @Schema(description = "房型名称")
+    @ExcelProperty("房型名称")
+    private String roomModelName;
+
+    @Schema(description = "所属游轮", example = "2552")
+    @ExcelProperty("所属游轮")
+    private Long shipId;
+
+    @Schema(description = "游轮名称")
+    @ExcelProperty("游轮名称")
+    private String shipName;
+
+    @Schema(description = "所属楼层")
+    @ExcelProperty("所属楼层")
+    private Integer floors;
+
+    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty(value = "状态", converter = DictConvert.class)
+    @DictFormat("common_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+    private Integer status;
+
+}

+ 43 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/room/vo/ResourceRoomSaveReqVO.java

@@ -0,0 +1,43 @@
+package com.yc.ship.module.resource.controller.admin.room.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 资源管理-游轮房间管理新增/修改 Request VO")
+@Data
+public class ResourceRoomSaveReqVO {
+
+    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1388")
+    private Long id;
+
+    @Schema(description = "房间号")
+    private Integer roomNum;
+
+    @Schema(description = "房型")
+    private Long roomModelId;
+
+    @Schema(description = "所属游轮", example = "2552")
+    private Long shipId;
+
+    @Schema(description = "所属楼层")
+    private Integer floors;
+
+    @Schema(description = "房间介绍")
+    private String brief;
+
+    @Schema(description = "房间视频", example = "https://www.iocoder.cn")
+    private String videoUrl;
+
+    @Schema(description = "房间图片", example = "https://www.iocoder.cn")
+    private String pciUrl;
+
+    @Schema(description = "备注", example = "你猜")
+    private String remark;
+
+    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @NotNull(message = "状态不能为空")
+    private Integer status;
+
+}

+ 130 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/roommodel/ResourceRoomModelController.java

@@ -0,0 +1,130 @@
+package com.yc.ship.module.resource.controller.admin.roommodel;
+
+import com.yc.ship.framework.common.util.collection.CollectionUtils;
+import com.yc.ship.module.resource.dal.dataobject.roommodelrooms.ResourceRoomModelRoomsDO;
+import com.yc.ship.module.resource.dal.dataobject.ship.ResourceShipDO;
+import com.yc.ship.module.resource.service.roomModelRooms.ResourceRoomModelRoomsService;
+import com.yc.ship.module.resource.service.ship.ResourceShipService;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+import java.util.stream.Collectors;
+
+import com.yc.ship.framework.common.pojo.PageParam;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.pojo.CommonResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+import static com.yc.ship.framework.common.pojo.CommonResult.success;
+
+import com.yc.ship.framework.excel.core.util.ExcelUtils;
+
+import com.yc.ship.framework.apilog.core.annotation.ApiAccessLog;
+import static com.yc.ship.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import com.yc.ship.module.resource.controller.admin.roommodel.vo.*;
+import com.yc.ship.module.resource.dal.dataobject.roommodel.ResourceRoomModelDO;
+import com.yc.ship.module.resource.service.roommodel.ResourceRoomModelService;
+
+@Tag(name = "管理后台 - 资源管理-房型管理")
+@RestController
+@RequestMapping("/resource/room-model")
+@Validated
+public class ResourceRoomModelController {
+
+    @Resource
+    private ResourceRoomModelService roomModelService;
+
+    @Resource
+    private ResourceShipService shipService;
+
+    @Resource
+    private ResourceRoomModelRoomsService roomModelRoomsService;
+
+
+    @PostMapping("/create")
+    @Operation(summary = "创建资源管理-房型管理")
+    @PreAuthorize("@ss.hasPermission('resource:room-model:create')")
+    public CommonResult<Long> createRoomModel(@Valid @RequestBody ResourceRoomModelSaveReqVO createReqVO) {
+        return success(roomModelService.createRoomModel(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新资源管理-房型管理")
+    @PreAuthorize("@ss.hasPermission('resource:room-model:update')")
+    public CommonResult<Boolean> updateRoomModel(@Valid @RequestBody ResourceRoomModelSaveReqVO updateReqVO) {
+        roomModelService.updateRoomModel(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除资源管理-房型管理")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('resource:room-model:delete')")
+    public CommonResult<Boolean> deleteRoomModel(@RequestParam("id") Long id) {
+        roomModelService.deleteRoomModel(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得资源管理-房型管理")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('resource:room-model:query')")
+    public CommonResult<ResourceRoomModelRespVO> getRoomModel(@RequestParam("id") Long id) {
+        ResourceRoomModelDO roomModel = roomModelService.getRoomModel(id);
+        ResourceRoomModelRespVO vo = BeanUtils.toBean(roomModel, ResourceRoomModelRespVO.class);
+        List<ResourceRoomModelRoomsDO> list = roomModelRoomsService.getList(id);
+        if(!(list.isEmpty())) {
+            List<Long> roomIds = CollectionUtils.convertList(list, ResourceRoomModelRoomsDO::getRoomId);
+            vo.setRoomNums(roomIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
+        }
+        return success(vo);
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得资源管理-房型管理分页")
+    @PreAuthorize("@ss.hasPermission('resource:room-model:query')")
+    public CommonResult<PageResult<ResourceRoomModelRespVO>> getRoomModelPage(@Valid ResourceRoomModelPageReqVO pageReqVO) {
+        PageResult<ResourceRoomModelDO> pageResult = roomModelService.getRoomModelPage(pageReqVO);
+        PageResult<ResourceRoomModelRespVO> page = BeanUtils.toBean(pageResult, ResourceRoomModelRespVO.class);
+        List<ResourceRoomModelRespVO> list = page.getList();
+        List<Long> shipIds = CollectionUtils.convertList(list, ResourceRoomModelRespVO::getShipId);
+        List<ResourceShipDO> shipList = shipService.getList(shipIds);
+        Map<Long, ResourceShipDO> longResourceShipDOMap = CollectionUtils.convertMap(shipList, ResourceShipDO::getId);
+        list.stream().forEach(item -> {
+            item.setShipName(longResourceShipDOMap.get(item.getShipId()).getName());
+            item.setFloorsNumStr(item.getFloorsNum());
+        });
+        return success(page);
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出资源管理-房型管理 Excel")
+    @PreAuthorize("@ss.hasPermission('resource:room-model:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportRoomModelExcel(@Valid ResourceRoomModelPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ResourceRoomModelDO> list = roomModelService.getRoomModelPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "资源管理-房型管理.xls", "数据", ResourceRoomModelRespVO.class,
+                        BeanUtils.toBean(list, ResourceRoomModelRespVO.class));
+    }
+    @GetMapping("/getRoomModelListByShipId")
+    @Operation(summary = "根据游轮ID获取游轮房间管理")
+    public CommonResult<List<ResourceRoomModelRespVO>> getRoomModelListByShipId(@RequestParam("shipId") String shipId) {
+        List<ResourceRoomModelDO> roomModelList = roomModelService.getRoomModelListByShipId(shipId);
+        List<ResourceRoomModelRespVO> list = BeanUtils.toBean(roomModelList, ResourceRoomModelRespVO.class);
+        return success(list);
+    }
+
+}

+ 41 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/roommodel/vo/ResourceRoomModelPageReqVO.java

@@ -0,0 +1,41 @@
+package com.yc.ship.module.resource.controller.admin.roommodel.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import com.yc.ship.framework.common.pojo.PageParam;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static com.yc.ship.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 资源管理-房型管理分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ResourceRoomModelPageReqVO extends PageParam {
+
+    @Schema(description = "房型名称", example = "王五")
+    private String name;
+
+    @Schema(description = "房型编码")
+    private String code;
+
+    @Schema(description = "所属游轮", example = "1463")
+    private Long shipId;
+
+    @Schema(description = "是否套房")
+    private Integer suite;
+
+    @Schema(description = "状态", example = "2")
+    private Integer status;
+
+    @Schema(description = "关联房间", example = "")
+    private String roomNums;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 93 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/roommodel/vo/ResourceRoomModelRespVO.java

@@ -0,0 +1,93 @@
+package com.yc.ship.module.resource.controller.admin.roommodel.vo;
+
+import com.yc.ship.framework.common.util.collection.CollectionUtils;
+import com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import java.util.stream.Collectors;
+
+import com.alibaba.excel.annotation.*;
+import com.yc.ship.framework.excel.core.annotations.DictFormat;
+import com.yc.ship.framework.excel.core.convert.DictConvert;
+
+@Schema(description = "管理后台 - 资源管理-房型管理 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ResourceRoomModelRespVO {
+
+    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14780")
+    @ExcelProperty("ID")
+    private Long id;
+
+    @Schema(description = "房型名称", example = "王五")
+    @ExcelProperty("房型名称")
+    private String name;
+
+    @Schema(description = "房型编码")
+    @ExcelProperty("房型编码")
+    private String code;
+
+    @Schema(description = "所在楼层(多选,逗号分割)")
+    @ExcelProperty("所在楼层(多选,逗号分割)")
+    private String floorsNum;
+
+    @Schema(description = "所在楼层(多选,逗号分割)")
+    @ExcelProperty("所在楼层(多选,逗号分割)")
+    private String floorsNumStr;
+
+    @Schema(description = "关联房间")
+    @ExcelProperty("关联房间")
+    private String roomNums;
+
+    @Schema(description = "所属游轮", example = "1463")
+    @ExcelProperty("所属游轮")
+    private Long shipId;
+
+    @Schema(description = "所属游轮名称")
+    @ExcelProperty("所属游轮名称")
+    private String shipName;
+
+    @Schema(description = "卫生间面积(㎡)")
+    @ExcelProperty("卫生间面积(㎡)")
+    private String bathroomArea;
+
+    @Schema(description = "床位数")
+    @ExcelProperty("床位数")
+    private Integer bedNum;
+
+    @Schema(description = "阳台面积(㎡)")
+    @ExcelProperty("阳台面积(㎡)")
+    private String balconyArea;
+
+    @Schema(description = "床尺寸(m)")
+    @ExcelProperty("床尺寸(m)")
+    private String bedSize;
+
+    @Schema(description = "成本价(元/晚)", example = "1742")
+    @ExcelProperty("成本价(元/晚)")
+    private BigDecimal price;
+
+    @Schema(description = "是否套房")
+    @ExcelProperty(value = "是否套房", converter = DictConvert.class)
+    @DictFormat("infra_boolean_string") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+    private Integer suite;
+
+    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty(value = "状态", converter = DictConvert.class)
+    @DictFormat("common_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+    private Integer status;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    public void setFloorsNumStr(String floorsNum) {
+        String[] split = floorsNum.split(",");
+        this.floorsNumStr = Arrays.stream(split).map(element -> element + "F").collect(Collectors.joining( ","));
+    }
+
+}

+ 66 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/roommodel/vo/ResourceRoomModelSaveReqVO.java

@@ -0,0 +1,66 @@
+package com.yc.ship.module.resource.controller.admin.roommodel.vo;
+
+import com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 资源管理-房型管理新增/修改 Request VO")
+@Data
+public class ResourceRoomModelSaveReqVO {
+
+    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14780")
+    private Long id;
+
+    @Schema(description = "房型名称", example = "王五")
+    private String name;
+
+    @Schema(description = "房型编码")
+    private String code;
+
+    @Schema(description = "所在楼层(多选,逗号分割)")
+    private String floorsNum;
+    
+    @Schema(description = "关联房间")
+    private String roomNums;
+
+    @Schema(description = "所属游轮", example = "1463")
+    private Long shipId;
+
+    @Schema(description = "卫生间面积(㎡)")
+    private String bathroomArea;
+
+    @Schema(description = "床位数")
+    private Integer bedNum;
+
+    @Schema(description = "阳台面积(㎡)")
+    private String balconyArea;
+
+    @Schema(description = "床尺寸(m)")
+    private String bedSize;
+
+    @Schema(description = "成本价(元/晚)", example = "1742")
+    private BigDecimal price;
+
+    @Schema(description = "是否套房")
+    private Integer suite;
+
+    @Schema(description = "房型介绍")
+    private String introduce;
+
+    @Schema(description = "房型图片", example = "https://www.iocoder.cn")
+    private String picUrl;
+
+    @Schema(description = "房型视频", example = "https://www.iocoder.cn")
+    private String videoUrl;
+
+    @Schema(description = "备注", example = "随便")
+    private String remark;
+
+    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @NotNull(message = "状态不能为空")
+    private Integer status;
+
+}

+ 69 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/room/ResourceRoomDO.java

@@ -0,0 +1,69 @@
+package com.yc.ship.module.resource.dal.dataobject.room;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import com.yc.ship.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 资源管理-游轮房间管理 DO
+ *
+ * @author flycloud
+ */
+@TableName("resource_room")
+@KeySequence("resource_room_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResourceRoomDO extends BaseDO {
+
+    /**
+     * ID
+     */
+    @TableId
+    private Long id;
+    /**
+     * 房间号
+     */
+    private Integer roomNum;
+    /**
+     * 房型
+     */
+    private Long roomModelId;
+    /**
+     * 所属游轮
+     */
+    private Long shipId;
+    /**
+     * 所属楼层
+     */
+    private Integer floors;
+    /**
+     * 房间介绍
+     */
+    private String brief;
+    /**
+     * 房间视频
+     */
+    private String videoUrl;
+    /**
+     * 房间图片
+     */
+    private String pciUrl;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 状态
+     *
+     * 枚举 {@link TODO common_status 对应的类}
+     */
+    private Integer status;
+
+}

+ 97 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/roommodel/ResourceRoomModelDO.java

@@ -0,0 +1,97 @@
+package com.yc.ship.module.resource.dal.dataobject.roommodel;
+
+import com.yc.ship.framework.tenant.core.db.TenantBaseDO;
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import com.yc.ship.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 资源管理-房型管理 DO
+ *
+ * @author flycloud
+ */
+@TableName("resource_room_model")
+@KeySequence("resource_room_model_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResourceRoomModelDO extends TenantBaseDO {
+
+    /**
+     * ID
+     */
+    @TableId
+    private Long id;
+    /**
+     * 房型名称
+     */
+    private String name;
+    /**
+     * 房型编码
+     */
+    private String code;
+    /**
+     * 所在楼层(多选,逗号分割)
+     */
+    private String floorsNum;
+    /**
+     * 所属游轮
+     */
+    private Long shipId;
+    /**
+     * 卫生间面积(㎡)
+     */
+    private String bathroomArea;
+    /**
+     * 床位数
+     */
+    private Integer bedNum;
+    /**
+     * 阳台面积(㎡)
+     */
+    private String balconyArea;
+    /**
+     * 床尺寸(m)
+     */
+    private String bedSize;
+    /**
+     * 成本价(元/晚)
+     */
+    private BigDecimal price;
+    /**
+     * 是否套房
+     *
+     * 枚举 {@link TODO infra_boolean_string 对应的类}
+     */
+    private Integer suite;
+    /**
+     * 房型介绍
+     */
+    private String introduce;
+    /**
+     * 房型图片
+     */
+    private String picUrl;
+    /**
+     * 房型视频
+     */
+    private String videoUrl;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 状态
+     *
+     * 枚举 {@link TODO common_status 对应的类}
+     */
+    private Integer status;
+
+}

+ 35 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/roommodelrooms/ResourceRoomModelRoomsDO.java

@@ -0,0 +1,35 @@
+package com.yc.ship.module.resource.dal.dataobject.roommodelrooms;
+
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yc.ship.framework.tenant.core.db.TenantBaseDO;
+import lombok.*;
+
+/**
+ * 资源管理-房型关联房间管理 DO
+ *
+ * @author flycloud
+ */
+@TableName("resource_room_model_rooms")
+@KeySequence("resource_room_model_rooms_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResourceRoomModelRoomsDO extends TenantBaseDO {
+
+    @TableId
+    private Long id;
+    /**
+     * 房间ID
+     */
+    private Long roomId;
+
+    /**
+     * 房型ID
+     */
+    private Long roomModelId;
+}

+ 46 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/room/ResourceRoomMapper.java

@@ -0,0 +1,46 @@
+package com.yc.ship.module.resource.dal.mysql.room;
+
+import java.util.*;
+
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
+import com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO;
+import org.apache.ibatis.annotations.Mapper;
+import com.yc.ship.module.resource.controller.admin.room.vo.*;
+
+/**
+ * 资源管理-游轮房间管理 Mapper
+ *
+ * @author flycloud
+ */
+@Mapper
+public interface ResourceRoomMapper extends BaseMapperX<ResourceRoomDO> {
+
+    default PageResult<ResourceRoomDO> selectPage(ResourceRoomPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<ResourceRoomDO>()
+                .eqIfPresent(ResourceRoomDO::getRoomNum, reqVO.getRoomNum())
+                .eqIfPresent(ResourceRoomDO::getRoomModelId, reqVO.getRoomModelId())
+                .eqIfPresent(ResourceRoomDO::getShipId, reqVO.getShipId())
+                .eqIfPresent(ResourceRoomDO::getFloors, reqVO.getFloors())
+                .eqIfPresent(ResourceRoomDO::getStatus, reqVO.getStatus())
+                .orderByDesc(ResourceRoomDO::getId));
+    }
+
+    default List<ResourceRoomDO> selectByShipId(String shipId) {
+        return selectList(new LambdaQueryWrapperX<ResourceRoomDO>()
+                .eqIfPresent(ResourceRoomDO::getShipId, shipId));
+    }
+
+    default ResourceRoomDO selectByShipIdAndRoomNums(Integer roomNum, Long shipId) {
+        return selectOne(new LambdaQueryWrapperX<ResourceRoomDO>()
+                .eqIfPresent(ResourceRoomDO::getRoomNum, roomNum)
+                .eqIfPresent(ResourceRoomDO::getShipId, shipId));
+    }
+
+    default List<ResourceRoomDO> selectByShipIdAndFloors(String shipId, List<Integer> floorList) {
+        return selectList(new LambdaQueryWrapperX<ResourceRoomDO>()
+                .eqIfPresent(ResourceRoomDO::getShipId, shipId)
+                .inIfPresent(ResourceRoomDO::getFloors, floorList));
+    }
+}

+ 26 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/roomModelRooms/ResourceRoomModelRoomsMapper.java

@@ -0,0 +1,26 @@
+package com.yc.ship.module.resource.dal.mysql.roomModelRooms;
+
+import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
+import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.yc.ship.module.resource.dal.dataobject.roommodelrooms.ResourceRoomModelRoomsDO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface ResourceRoomModelRoomsMapper extends BaseMapperX<ResourceRoomModelRoomsDO> {
+    default void deleteByRoomId(Long id) {
+        delete(new LambdaQueryWrapperX<ResourceRoomModelRoomsDO>()
+                .eq(ResourceRoomModelRoomsDO::getRoomId, id));
+    }
+
+    default void deleteByRoomModelId(Long modelId) {
+        delete(new LambdaQueryWrapperX<ResourceRoomModelRoomsDO>()
+                .eq(ResourceRoomModelRoomsDO::getRoomModelId, modelId));
+    }
+
+    default List<ResourceRoomModelRoomsDO> selectListByRoomModelId(Long roomModelId) {
+        return selectList(new LambdaQueryWrapperX<ResourceRoomModelRoomsDO>()
+                .eq(ResourceRoomModelRoomsDO::getRoomModelId, roomModelId));
+    }
+}

+ 35 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/roommodel/ResourceRoomModelMapper.java

@@ -0,0 +1,35 @@
+package com.yc.ship.module.resource.dal.mysql.roommodel;
+
+import java.util.*;
+
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
+import com.yc.ship.module.resource.dal.dataobject.roommodel.ResourceRoomModelDO;
+import org.apache.ibatis.annotations.Mapper;
+import com.yc.ship.module.resource.controller.admin.roommodel.vo.*;
+
+/**
+ * 资源管理-房型管理 Mapper
+ *
+ * @author flycloud
+ */
+@Mapper
+public interface ResourceRoomModelMapper extends BaseMapperX<ResourceRoomModelDO> {
+
+    default PageResult<ResourceRoomModelDO> selectPage(ResourceRoomModelPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<ResourceRoomModelDO>()
+                .likeIfPresent(ResourceRoomModelDO::getName, reqVO.getName())
+                .eqIfPresent(ResourceRoomModelDO::getCode, reqVO.getCode())
+                .eqIfPresent(ResourceRoomModelDO::getShipId, reqVO.getShipId())
+                .eqIfPresent(ResourceRoomModelDO::getSuite, reqVO.getSuite())
+                .eqIfPresent(ResourceRoomModelDO::getStatus, reqVO.getStatus())
+                .betweenIfPresent(ResourceRoomModelDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(ResourceRoomModelDO::getId));
+    }
+
+    default List<ResourceRoomModelDO> selectListByShipId(String shipId) {
+        return selectList(new LambdaQueryWrapperX<ResourceRoomModelDO>()
+                .eqIfPresent(ResourceRoomModelDO::getShipId, shipId));
+    }
+}

+ 69 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/room/ResourceRoomService.java

@@ -0,0 +1,69 @@
+package com.yc.ship.module.resource.service.room;
+
+import java.util.*;
+import javax.validation.*;
+import com.yc.ship.module.resource.controller.admin.room.vo.*;
+import com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.pojo.PageParam;
+
+/**
+ * 资源管理-游轮房间管理 Service 接口
+ *
+ * @author flycloud
+ */
+public interface ResourceRoomService {
+
+    /**
+     * 创建资源管理-游轮房间管理
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createRoom(@Valid ResourceRoomSaveReqVO createReqVO);
+
+    /**
+     * 更新资源管理-游轮房间管理
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateRoom(@Valid ResourceRoomSaveReqVO updateReqVO);
+
+    /**
+     * 删除资源管理-游轮房间管理
+     *
+     * @param id 编号
+     */
+    void deleteRoom(Long id);
+
+    /**
+     * 获得资源管理-游轮房间管理
+     *
+     * @param id 编号
+     * @return 资源管理-游轮房间管理
+     */
+    ResourceRoomDO getRoom(Long id);
+
+    /**
+     * 获得资源管理-游轮房间管理分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 资源管理-游轮房间管理分页
+     */
+    PageResult<ResourceRoomDO> getRoomPage(ResourceRoomPageReqVO pageReqVO);
+
+    /**
+     * 根据游轮ID获取房间列表
+     * @param shipId
+     * @return
+     */
+    List<ResourceRoomDO> getRoomListByShipId(String shipId);
+
+    /**
+     * 根据游轮ID和楼层获取房间列表
+     * @param shipId
+     * @param floors
+     * @return
+     */
+    List<ResourceRoomDO> getRoomListByShipIdAndFloors(String shipId, String floors);
+}

+ 121 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/room/ResourceRoomServiceImpl.java

@@ -0,0 +1,121 @@
+package com.yc.ship.module.resource.service.room;
+
+import com.yc.ship.module.resource.dal.dataobject.roommodelrooms.ResourceRoomModelRoomsDO;
+import com.yc.ship.module.resource.dal.mysql.roomModelRooms.ResourceRoomModelRoomsMapper;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+import com.yc.ship.module.resource.controller.admin.room.vo.*;
+import com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+
+import com.yc.ship.module.resource.dal.mysql.room.ResourceRoomMapper;
+
+import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static com.yc.ship.module.resource.enums.ErrorCodeConstants.*;
+
+/**
+ * 资源管理-游轮房间管理 Service 实现类
+ *
+ * @author flycloud
+ */
+@Service
+@Validated
+public class ResourceRoomServiceImpl implements ResourceRoomService {
+
+    @Resource
+    private ResourceRoomMapper roomMapper;
+
+    @Resource
+    private ResourceRoomModelRoomsMapper roomModelRoomsMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Long createRoom(ResourceRoomSaveReqVO createReqVO) {
+        // 插入
+        ResourceRoomDO room = BeanUtils.toBean(createReqVO, ResourceRoomDO.class);
+        validateRoomNumsExists(room.getRoomNum(), room.getShipId());
+        roomMapper.insert(room);
+        //添加到房间房型关联表中
+        handleRoomModelRooms(room);
+        // 返回
+        return room.getId();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateRoom(ResourceRoomSaveReqVO updateReqVO) {
+        // 校验存在
+        validateRoomExists(updateReqVO.getId());
+        // 更新
+        ResourceRoomDO updateObj = BeanUtils.toBean(updateReqVO, ResourceRoomDO.class);
+        roomMapper.updateById(updateObj);
+        //更新房间房型关联表中的数据
+        handleRoomModelRooms(updateObj);
+    }
+
+    private void handleRoomModelRooms(ResourceRoomDO room) {
+        roomModelRoomsMapper.deleteByRoomId(room.getId());
+        ResourceRoomModelRoomsDO roomModelRooms = ResourceRoomModelRoomsDO.builder()
+                .roomId(room.getId())
+                .roomModelId(room.getRoomModelId())
+                .build();
+        roomModelRoomsMapper.insert(roomModelRooms);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void deleteRoom(Long id) {
+        // 校验存在
+        validateRoomExists(id);
+        // 删除
+        roomMapper.deleteById(id);
+        roomModelRoomsMapper.deleteByRoomId(id);
+    }
+
+    private void validateRoomExists(Long id) {
+        if (roomMapper.selectById(id) == null) {
+            throw exception(ROOM_NOT_EXISTS);
+        }
+    }
+
+    /**
+     * 验证同一游轮上相同房间号是否已存在
+     * @param roomNum 房间号
+     * @param shipId  游轮ID
+     */
+    private void validateRoomNumsExists(Integer roomNum, Long shipId) {
+        if (roomMapper.selectByShipIdAndRoomNums(roomNum, shipId) != null) {
+            throw exception(ROOM_NUMS_EXISTS);
+        }
+    }
+
+    @Override
+    public ResourceRoomDO getRoom(Long id) {
+        return roomMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<ResourceRoomDO> getRoomPage(ResourceRoomPageReqVO pageReqVO) {
+        return roomMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public List<ResourceRoomDO> getRoomListByShipId(String shipId) {
+        return roomMapper.selectByShipId(shipId);
+    }
+
+    @Override
+    public List<ResourceRoomDO> getRoomListByShipIdAndFloors(String shipId, String floors) {
+        List<Integer> floorList = Arrays.stream(floors.split(",")).map(Integer::parseInt).collect(Collectors.toList());
+        return roomMapper.selectByShipIdAndFloors(shipId, floorList);
+    }
+
+}

+ 18 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/roomModelRooms/ResourceRoomModelRoomsService.java

@@ -0,0 +1,18 @@
+package com.yc.ship.module.resource.service.roomModelRooms;
+
+
+import com.yc.ship.module.resource.dal.dataobject.roommodelrooms.ResourceRoomModelRoomsDO;
+
+import java.util.List;
+
+/**
+ * 资源管理-房型管理 Service 接口
+ *
+ * @author flycloud
+ */
+public interface ResourceRoomModelRoomsService {
+
+    List<ResourceRoomModelRoomsDO> getList(Long roomModelId);
+
+
+}

+ 30 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/roomModelRooms/ResourceRoomModelRoomsServiceImpl.java

@@ -0,0 +1,30 @@
+package com.yc.ship.module.resource.service.roomModelRooms;
+
+import com.yc.ship.module.resource.dal.dataobject.roommodelrooms.ResourceRoomModelRoomsDO;
+import com.yc.ship.module.resource.dal.mysql.roomModelRooms.ResourceRoomModelRoomsMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 资源管理-房型管理 Service 实现类
+ *
+ * @author flycloud
+ */
+@Service
+@Validated
+public class ResourceRoomModelRoomsServiceImpl implements ResourceRoomModelRoomsService {
+
+
+
+    @Resource
+    private ResourceRoomModelRoomsMapper roomModelRoomsMapper;
+
+
+    @Override
+    public List<ResourceRoomModelRoomsDO> getList(Long roomModelId) {
+        return roomModelRoomsMapper.selectListByRoomModelId(roomModelId);
+    }
+}

+ 63 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/roommodel/ResourceRoomModelService.java

@@ -0,0 +1,63 @@
+package com.yc.ship.module.resource.service.roommodel;
+
+import java.util.*;
+import javax.validation.*;
+import com.yc.ship.module.resource.controller.admin.roommodel.vo.*;
+import com.yc.ship.module.resource.dal.dataobject.roommodel.ResourceRoomModelDO;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.pojo.PageParam;
+
+/**
+ * 资源管理-房型管理 Service 接口
+ *
+ * @author flycloud
+ */
+public interface ResourceRoomModelService {
+
+    /**
+     * 创建资源管理-房型管理
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createRoomModel(@Valid ResourceRoomModelSaveReqVO createReqVO);
+
+    /**
+     * 更新资源管理-房型管理
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateRoomModel(@Valid ResourceRoomModelSaveReqVO updateReqVO);
+
+    /**
+     * 删除资源管理-房型管理
+     *
+     * @param id 编号
+     */
+    void deleteRoomModel(Long id);
+
+    /**
+     * 获得资源管理-房型管理
+     *
+     * @param id 编号
+     * @return 资源管理-房型管理
+     */
+    ResourceRoomModelDO getRoomModel(Long id);
+
+    /**
+     * 获得资源管理-房型管理分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 资源管理-房型管理分页
+     */
+    PageResult<ResourceRoomModelDO> getRoomModelPage(ResourceRoomModelPageReqVO pageReqVO);
+
+    /**
+     * 根据游轮ID获取房型列表
+     * @param shipId
+     * @return
+     */
+    List<ResourceRoomModelDO> getRoomModelListByShipId(String shipId);
+
+    List<ResourceRoomModelDO> getList(List<Long> modelIds);
+}

+ 118 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/roommodel/ResourceRoomModelServiceImpl.java

@@ -0,0 +1,118 @@
+package com.yc.ship.module.resource.service.roommodel;
+
+import com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO;
+import com.yc.ship.module.resource.dal.dataobject.roommodelrooms.ResourceRoomModelRoomsDO;
+import com.yc.ship.module.resource.dal.mysql.roomModelRooms.ResourceRoomModelRoomsMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import com.yc.ship.module.resource.controller.admin.roommodel.vo.*;
+import com.yc.ship.module.resource.dal.dataobject.roommodel.ResourceRoomModelDO;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.pojo.PageParam;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+
+import com.yc.ship.module.resource.dal.mysql.roommodel.ResourceRoomModelMapper;
+
+import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static com.yc.ship.module.resource.enums.ErrorCodeConstants.*;
+
+/**
+ * 资源管理-房型管理 Service 实现类
+ *
+ * @author flycloud
+ */
+@Service
+@Validated
+public class ResourceRoomModelServiceImpl implements ResourceRoomModelService {
+
+    @Resource
+    private ResourceRoomModelMapper roomModelMapper;
+
+    @Resource
+    private ResourceRoomModelRoomsMapper roomModelRoomsMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Long createRoomModel(ResourceRoomModelSaveReqVO createReqVO) {
+        // 插入
+        ResourceRoomModelDO roomModel = BeanUtils.toBean(createReqVO, ResourceRoomModelDO.class);
+        roomModelMapper.insert(roomModel);
+        //处理关联房间
+        handleRoomModelRooms(roomModel.getId(), createReqVO.getRoomNums());
+        // 返回
+        return roomModel.getId();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateRoomModel(ResourceRoomModelSaveReqVO updateReqVO) {
+        // 校验存在
+        validateRoomModelExists(updateReqVO.getId());
+        // 更新
+        ResourceRoomModelDO updateObj = BeanUtils.toBean(updateReqVO, ResourceRoomModelDO.class);
+        roomModelMapper.updateById(updateObj);
+        //处理关联房间
+        handleRoomModelRooms(updateReqVO.getId(), updateReqVO.getRoomNums());
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void deleteRoomModel(Long id) {
+        // 校验存在
+        validateRoomModelExists(id);
+        // 删除
+        roomModelMapper.deleteById(id);
+        roomModelRoomsMapper.deleteByRoomModelId(id);
+    }
+
+    private void validateRoomModelExists(Long id) {
+        if (roomModelMapper.selectById(id) == null) {
+            throw exception(ROOM_MODEL_NOT_EXISTS);
+        }
+    }
+
+    private void handleRoomModelRooms(Long modelId, String roomNumIds) {
+        roomModelRoomsMapper.deleteByRoomModelId(modelId);
+        if(StringUtils.isNotBlank(roomNumIds)) {
+            String[] split = roomNumIds.split(",");
+            List<ResourceRoomModelRoomsDO> list = new ArrayList<>();
+            for (String s : split) {
+                ResourceRoomModelRoomsDO roomModelRooms = ResourceRoomModelRoomsDO.builder()
+                        .roomId(Long.valueOf(s))
+                        .roomModelId(modelId)
+                        .build();
+                list.add(roomModelRooms);
+            }
+            roomModelRoomsMapper.insertBatch(list);
+        }
+    }
+
+    @Override
+    public ResourceRoomModelDO getRoomModel(Long id) {
+        return roomModelMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<ResourceRoomModelDO> getRoomModelPage(ResourceRoomModelPageReqVO pageReqVO) {
+        return roomModelMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public List<ResourceRoomModelDO> getRoomModelListByShipId(String shipId) {
+        return roomModelMapper.selectListByShipId(shipId);
+    }
+
+    @Override
+    public List<ResourceRoomModelDO> getList(List<Long> modelIds) {
+        if(modelIds.isEmpty()) {
+            return Collections.emptyList();
+        }
+        return roomModelMapper.selectByIds(modelIds);
+    }
+
+}

+ 2 - 2
ship-server-web/src/main/java/com/yc/ship/framework/web/config/WebProperties.java

@@ -21,8 +21,8 @@ public class WebProperties {
 //    @Value("${yudao.web.app-url:'app-api'}")
     private String appUrl="app-api";
 
-    @Value("${yudao.web.admin-url:ship-api}")
-    private String adminUrl;
+//    @Value("${yudao.web.admin-url:ship-api}")
+    private String adminUrl = "ship-ota-api";
 
     @NotNull(message = "APP API 不能为空")
     private Api appApi = new Api(appUrl, "**.controller.app.**");

+ 258 - 0
ship-server-web/src/main/resources/application-test.yaml

@@ -0,0 +1,258 @@
+server:
+  port: 48083
+
+--- #################### 数据库相关配置 ####################
+spring:
+  autoconfigure:
+    # noinspection SpringBootApplicationYaml
+    exclude:
+      - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
+      - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置
+      - de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置
+      - de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置
+      - de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
+      - org.springframework.ai.autoconfigure.vectorstore.qdrant.QdrantVectorStoreAutoConfiguration # 禁用 AI 模块的 Qdrant,手动创建
+      - org.springframework.ai.autoconfigure.vectorstore.milvus.MilvusVectorStoreAutoConfiguration # 禁用 AI 模块的 Milvus,手动创建
+  # 数据源配置项
+  datasource:
+    druid: # Druid 【监控】相关的全局配置
+      web-stat-filter:
+        enabled: true
+      stat-view-servlet:
+        enabled: true
+        allow: # 设置白名单,不填则允许所有访问
+        url-pattern: /druid/*
+        login-username: # 控制台管理用户名和密码
+        login-password:
+      filter:
+        stat:
+          enabled: true
+          log-slow-sql: true # 慢 SQL 记录
+          slow-sql-millis: 100
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+    dynamic: # 多数据源配置
+      druid: # Druid 【连接池】相关的全局配置
+        initial-size: 1 # 初始连接数
+        min-idle: 1 # 最小连接池数量
+        max-active: 20 # 最大连接池数量
+        max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
+        time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
+        min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
+        max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
+        validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
+        test-while-idle: true
+        test-on-borrow: false
+        test-on-return: false
+      primary: master
+      datasource:
+        master:
+          url: jdbc:mysql://172.16.10.80:3306/db_yc_ship_lfy?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
+          username: root
+          password: W1ses0ft@zshl
+        slave: # 模拟从库,可根据自己需要修改
+          lazy: true # 开启懒加载,保证启动速度
+          url: jdbc:mysql://172.16.10.80:3306/db_yc_ship_lfy?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
+          username: root
+          password: W1ses0ft@zshl
+
+  # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
+  redis:
+    host: 172.16.10.24 # 地址
+    port: 6380 #端口
+    database: 10 # 数据库索引
+    password: 123456 # 密码,建议生产环境开启
+
+--- #################### 定时任务相关配置 ####################
+
+# Quartz 配置项,对应 QuartzProperties 配置类
+spring:
+  quartz:
+    auto-startup: true # 本地开发环境,尽量不要开启 Job
+    scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName
+    job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。
+    wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true
+    properties: # 添加 Quartz Scheduler 附加属性,更多可以看 http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/configuration.html 文档
+      org:
+        quartz:
+          # Scheduler 相关配置
+          scheduler:
+            instanceName: schedulerName
+            instanceId: AUTO # 自动生成 instance ID
+          # JobStore 相关配置
+          jobStore:
+            # JobStore 实现类。可见博客:https://blog.csdn.net/weixin_42458219/article/details/122247162
+            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
+            isClustered: true # 是集群模式
+            clusterCheckinInterval: 15000 # 集群检查频率,单位:毫秒。默认为 15000,即 15 秒
+            misfireThreshold: 60000 # misfire 阀值,单位:毫秒。
+          # 线程池相关配置
+          threadPool:
+            threadCount: 25 # 线程池大小。默认为 10 。
+            threadPriority: 5 # 线程优先级
+            class: org.quartz.simpl.SimpleThreadPool # 线程池类型
+    jdbc: # 使用 JDBC 的 JobStore 的时候,JDBC 的配置
+      initialize-schema: NEVER # 是否自动使用 SQL 初始化 Quartz 表结构。这里设置成 never ,我们手动创建表结构。
+
+--- #################### 消息队列相关 ####################
+
+# rocketmq 配置项,对应 RocketMQProperties 配置类
+rocketmq:
+  name-server: 127.0.0.1:9876 # RocketMQ Namesrv
+
+spring:
+  # RabbitMQ 配置项,对应 RabbitProperties 配置类
+  rabbitmq:
+    host: 172.16.10.24 # RabbitMQ 服务的地址
+    port: 5672 # RabbitMQ 服务的端口
+    username: dayuding # RabbitMQ 服务的账号
+    password: wisesoft123 # RabbitMQ 服务的密码
+  # Kafka 配置项,对应 KafkaProperties 配置类
+  kafka:
+    bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔
+
+--- #################### 服务保障相关配置 ####################
+
+# Lock4j 配置项
+lock4j:
+  acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
+  expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
+
+--- #################### 监控相关配置 ####################
+
+# Actuator 监控端点的配置项
+management:
+  endpoints:
+    web:
+      base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
+      exposure:
+        include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
+
+# Spring Boot Admin 配置项
+spring:
+  boot:
+    admin:
+      # Spring Boot Admin Client 客户端的相关配置
+      client:
+        url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
+        instance:
+          service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
+      # Spring Boot Admin Server 服务端的相关配置
+      context-path: /admin # 配置 Spring
+
+# 日志文件配置
+logging:
+  file:
+    name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
+  level:
+    # 配置自己写的 MyBatis Mapper 打印日志
+    com.yc.ship.module.bpm.dal.mysql: debug
+    com.yc.ship.module.infra.dal.mysql: debug
+    com.yc.ship.module.infra.dal.mysql.logger.ApiErrorLogMapper: INFO # 配置 ApiErrorLogMapper 的日志级别为 info,避免和 GlobalExceptionHandler 重复打印
+    com.yc.ship.module.infra.dal.mysql.job.JobLogMapper: INFO # 配置 JobLogMapper 的日志级别为 info
+    com.yc.ship.module.infra.dal.mysql.file.FileConfigMapper: INFO # 配置 FileConfigMapper 的日志级别为 info
+    com.yc.ship.module.pay.dal.mysql: debug
+    com.yc.ship.module.pay.dal.mysql.notify.PayNotifyTaskMapper: INFO # 配置 PayNotifyTaskMapper 的日志级别为 info
+    com.yc.ship.module.system.dal.mysql: debug
+    com.yc.ship.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info
+    com.yc.ship.module.tool.dal.mysql: debug
+    com.yc.ship.module.member.dal.mysql: debug
+    com.yc.ship.module.trade.dal.mysql: debug
+    com.yc.ship.module.promotion.dal.mysql: debug
+    com.yc.ship.module.statistics.dal.mysql: debug
+    com.yc.ship.module.crm.dal.mysql: debug
+    com.yc.ship.module.erp.dal.mysql: debug
+    com.yc.ship.module.iot.dal.mysql: debug
+    com.yc.ship.module.iot.dal.tdengine: DEBUG
+    com.yc.ship.module.ai.dal.mysql: debug
+    com.yc.ship.module.buss.dal.mysql: debug
+    com.yc.ship.module.ota.dal.mysql: debug
+    com.yc.ship.module.product.dal.mysql: debug
+    com.yc.ship.module.otc.dal.mysql: debug
+    com.yc.ship.module.resource.dal.mysql: debug
+    org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示
+
+debug: false
+
+--- #################### 微信公众号、小程序相关配置 ####################
+wx:
+  mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
+#    app-id: wx041349c6f39b268b # 测试号(牛希尧提供的)
+#    secret: 5abee519483bc9f8cb37ce280e814bd0
+    app-id: wx5b23ba7a5589ecbb # 测试号(自己的)
+    secret: 2a7b3b20c537e52e74afd395eb85f61f
+#    app-id: wxa69ab825b163be19 # 测试号(Kongdy 提供的)
+#    secret: bd4f9fab889591b62aeac0d7b8d8b4a0
+    # 存储配置,解决 AccessToken 的跨节点的共享
+    config-storage:
+      type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
+      key-prefix: wx # Redis Key 的前缀
+      http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
+  miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
+    #    appid: wx62056c0d5e8db250 # 测试号(牛希尧提供的)
+    #    secret: 333ae72f41552af1e998fe1f54e1584a
+#    appid: wx63c280fe3248a3e7 # wenhualian的接口测试号
+#    secret: 6f270509224a7ae1296bbf1c8cb97aed
+    appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的)
+    secret: 4a1a04e07f6a4a0751b39c3064a92c8b
+#    appid: wx66186af0759f47c9 # 测试号(puhui 提供的)
+#    secret: 3218bcbd112cbc614c7264ceb20144ac
+    config-storage:
+      type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
+      key-prefix: wa # Redis Key 的前缀
+      http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
+
+--- #################### 芋道相关配置 ####################
+
+# 芋道配置项,设置当前项目所有自定义的配置
+yudao:
+  captcha:
+    enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试;
+  security:
+    mock-enable: true
+  pay:
+    order-notify-url: http://yunai.natapp1.cc/ship-ota-api/pay/notify/order # 支付渠道的【支付】回调地址
+    refund-notify-url: http://yunai.natapp1.cc/ship-ota-api/pay/notify/refund # 支付渠道的【退款】回调地址
+    transfer-notify-url: http://yunai.natapp1.cc/ship-ota-api/pay/notify/transfer # 支付渠道的【转账】回调地址
+  access-log: # 访问日志的配置项
+    enable: false
+  demo: false # 关闭演示模式
+  wxa-code:
+    env-version: develop # 小程序版本: 正式版为 "release";体验版为 "trial";开发版为 "develop"
+  wxa-subscribe-message:
+    miniprogram-state: developer # 跳转小程序类型:开发版为 “developer”;体验版为 “trial”为;正式版为 “formal”
+  tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
+
+justauth:
+  enabled: true
+  type:
+    DINGTALK: # 钉钉
+      client-id: dingvrnreaje3yqvzhxg
+      client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI
+      ignore-check-redirect-uri: true
+    WECHAT_ENTERPRISE: # 企业微信
+      client-id: wwd411c69a39ad2e54
+      client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
+      agent-id: 1000004
+      ignore-check-redirect-uri: true
+    # noinspection SpringBootApplicationYaml
+    WECHAT_MINI_PROGRAM: # 微信小程序
+      client-id: ${wx.miniapp.appid}
+      client-secret: ${wx.miniapp.secret}
+      ignore-check-redirect-uri: true
+      ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验
+    WECHAT_MP: # 微信公众号
+      client-id: ${wx.mp.app-id}
+      client-secret: ${wx.mp.secret}
+      ignore-check-redirect-uri: true
+  cache:
+    type: REDIS
+    prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
+    timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
+
+--- #################### iot相关配置 TODO 芋艿【IOT】:再瞅瞅 ####################
+pf4j:
+#  pluginsDir: /tmp/
+  pluginsDir: ../plugins

+ 2 - 2
ship-server-web/src/main/resources/application.yaml

@@ -3,7 +3,7 @@ spring:
     name: yudao-server
 
   profiles:
-    active: local
+    active: test
 
   main:
     allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
@@ -69,7 +69,7 @@ mybatis-plus:
     map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
   global-config:
     db-config:
-      id-type: ASSIGN_ID # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
+      id-type: AUTO # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
 #      id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
 #      id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
 #      id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解