Browse Source

票务资源、分类、规格、资源供应商提交

lishiqiang 7 months ago
parent
commit
5089cd0b90
54 changed files with 3831 additions and 9 deletions
  1. 4 0
      ship-module-ota/ship-module-ota-biz/src/main/java/com/yc/ship/module/ota/controller/admin/distributor/vo/DistributorRespVO.java
  2. 2 0
      ship-module-ota/ship-module-ota-biz/src/main/java/com/yc/ship/module/ota/controller/admin/distributor/vo/DistributorSaveReqVO.java
  3. 4 0
      ship-module-ota/ship-module-ota-biz/src/main/java/com/yc/ship/module/ota/dal/dataobject/distributor/DistributorDO.java
  4. 7 0
      ship-module-otc/ship-module-otc-biz/src/main/java/com/yc/ship/module/otc/controller/admin/otclevel/OtcLevelController.java
  5. 7 2
      ship-module-otc/ship-module-otc-biz/src/main/java/com/yc/ship/module/otc/dal/mysql/storeaudit/StoreAuditMapper.java
  6. 2 0
      ship-module-otc/ship-module-otc-biz/src/main/java/com/yc/ship/module/otc/service/otclevel/OtcLevelService.java
  7. 7 0
      ship-module-otc/ship-module-otc-biz/src/main/java/com/yc/ship/module/otc/service/otclevel/OtcLevelServiceImpl.java
  8. 6 0
      ship-module-resource/ship-module-resource-api/src/main/java/com/yc/ship/module/resource/enums/ErrorCodeConstants.java
  9. 94 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/baseprice/ProductBasePriceController.java
  10. 44 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/baseprice/vo/ProductBasePricePageReqVO.java
  11. 46 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/baseprice/vo/ProductBasePriceRespVO.java
  12. 33 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/baseprice/vo/ProductBasePriceSaveReqVO.java
  13. 103 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/productBase/ProductBaseController.java
  14. 33 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/productBase/vo/ProductBasePageReqVO.java
  15. 125 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/productBase/vo/ProductBaseRespVO.java
  16. 73 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/productBase/vo/ProductBaseSaveReqVO.java
  17. 113 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/ResourceController.java
  18. 56 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ReducedResourceRespVO.java
  19. 14 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourceAccessRespVO.java
  20. 61 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourcePageReqVO.java
  21. 75 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourceRespVO.java
  22. 49 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourceSaveReqVO.java
  23. 33 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourceSimpleRespVO.java
  24. 94 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/suppliercategory/SupplierCategoryController.java
  25. 15 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/suppliercategory/vo/SupplierCategoryPageReqVO.java
  26. 21 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/suppliercategory/vo/SupplierCategoryRespVO.java
  27. 16 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/suppliercategory/vo/SupplierCategorySaveReqVO.java
  28. 57 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/baseprice/ProductBasePriceDO.java
  29. 103 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/productBase/ProductBaseDO.java
  30. 84 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/resource/ResourceDO.java
  31. 32 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/suppliercategory/SupplierCategoryDO.java
  32. 37 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/baseprice/ProductBasePriceMapper.java
  33. 33 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/productBase/ProductBaseMapper.java
  34. 76 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/resource/ResourceMapper.java
  35. 24 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/suppliercategory/SupplierCategoryMapper.java
  36. 25 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/redis/RedisKeyConstants.java
  37. 66 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/baseprice/ProductBasePriceService.java
  38. 87 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/baseprice/ProductBasePriceServiceImpl.java
  39. 5 4
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/category/CategoryServiceImpl.java
  40. 82 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/productBase/ProductBaseService.java
  41. 247 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/productBase/ProductBaseServiceImpl.java
  42. 70 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/ResourceService.java
  43. 857 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/ResourceServiceImpl.java
  44. 125 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/util/DesUtil.java
  45. 118 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/util/EncryptUtils.java
  46. 143 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/util/MD5Utils.java
  47. 19 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/supplier/SupplierServiceImpl.java
  48. 59 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/suppliercategory/SupplierCategoryService.java
  49. 87 0
      ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/suppliercategory/SupplierCategoryServiceImpl.java
  50. 28 0
      ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/baseprice/ProductBasePriceMapper.xml
  51. 117 0
      ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/productBase/ProductBaseMapper.xml
  52. 88 0
      ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/resource/ResourceMapper.xml
  53. 12 0
      ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/suppliercategory/SupplierCategoryMapper.xml
  54. 13 3
      ship-server-web/src/main/resources/application.yaml

+ 4 - 0
ship-module-ota/ship-module-ota-biz/src/main/java/com/yc/ship/module/ota/controller/admin/distributor/vo/DistributorRespVO.java

@@ -41,6 +41,10 @@ public class DistributorRespVO {
     @ExcelProperty("分销商类型")
     private Long otaTypeId;
 
+    @Schema(description = "分销商等级", example = "23448")
+    @ExcelProperty("分销商等级")
+    private Long otcLevelId;
+
     @Schema(description = "分销商分组", example = "23448")
     @ExcelProperty("分销商分组")
     private Long otaCategoryId;

+ 2 - 0
ship-module-ota/ship-module-ota-biz/src/main/java/com/yc/ship/module/ota/controller/admin/distributor/vo/DistributorSaveReqVO.java

@@ -27,6 +27,8 @@ public class DistributorSaveReqVO {
     private Long otaTypeId;
     @Schema(description = "分销商分组", example = "23448")
     private Long otaCategoryId;
+    @Schema(description = "分销商等级", example = "23448")
+    private Long otcLevelId;
 
     @Schema(description = "全称", example = "王五")
     private String name;

+ 4 - 0
ship-module-ota/ship-module-ota-biz/src/main/java/com/yc/ship/module/ota/dal/dataobject/distributor/DistributorDO.java

@@ -47,6 +47,10 @@ public class DistributorDO extends TenantBaseDO {
      * 分销商类型
      */
     private Long otaTypeId;
+    /**
+     * 分销商等级
+     */
+    private Long otcLevelId;
     /**
      * 分销商分组ID
      */

+ 7 - 0
ship-module-otc/ship-module-otc-biz/src/main/java/com/yc/ship/module/otc/controller/admin/otclevel/OtcLevelController.java

@@ -70,6 +70,13 @@ public class OtcLevelController {
         return success(BeanUtils.toBean(level, OtcLevelRespVO.class));
     }
 
+    @GetMapping("/getLevelList")
+    @Operation(summary = "获得旅行社等级管理列表-选择")
+    public CommonResult<List<OtcLevelRespVO>> getLevelList() {
+        List<OtcLevelDO> level = levelService.getLevelList();
+        return success(BeanUtils.toBean(level, OtcLevelRespVO.class));
+    }
+
     @GetMapping("/page")
     @Operation(summary = "获得旅行社等级管理分页")
     @PreAuthorize("@ss.hasPermission('otc:level:query')")

+ 7 - 2
ship-module-otc/ship-module-otc-biz/src/main/java/com/yc/ship/module/otc/dal/mysql/storeaudit/StoreAuditMapper.java

@@ -25,8 +25,13 @@ public interface StoreAuditMapper extends BaseMapperX<StoreAuditDO> {
         String type = "";
         if (StringUtils.isNotBlank(menuType)) {
             String[] menuTypes = menuType.split("-");
-            reqVO.setOperateType(Integer.valueOf(menuTypes[0]));
-            type = menuTypes[1];
+            try {
+                reqVO.setOperateType(Integer.parseInt(menuTypes[0]));
+                type = menuTypes[1];
+            }catch (Exception ignored){
+
+            }
+
         }
         LambdaQueryWrapperX<StoreAuditDO> queryWrapperX = new LambdaQueryWrapperX<>();
         queryWrapperX.eqIfPresent(StoreAuditDO::getStoreId, reqVO.getStoreId());

+ 2 - 0
ship-module-otc/ship-module-otc-biz/src/main/java/com/yc/ship/module/otc/service/otclevel/OtcLevelService.java

@@ -6,6 +6,7 @@ import com.yc.ship.module.otc.controller.admin.otclevel.vo.OtcLevelSaveReqVO;
 import com.yc.ship.module.otc.dal.dataobject.otclevel.OtcLevelDO;
 
 import javax.validation.Valid;
+import java.util.List;
 
 /**
  * 旅行社等级管理 Service 接口
@@ -52,4 +53,5 @@ public interface OtcLevelService {
      */
     PageResult<OtcLevelDO> getLevelPage(OtcLevelPageReqVO pageReqVO);
 
+    List<OtcLevelDO> getLevelList();
 }

+ 7 - 0
ship-module-otc/ship-module-otc-biz/src/main/java/com/yc/ship/module/otc/service/otclevel/OtcLevelServiceImpl.java

@@ -12,6 +12,9 @@ import org.springframework.validation.annotation.Validated;
 
 import javax.annotation.Resource;
 
+import java.util.Collections;
+import java.util.List;
+
 import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static com.yc.ship.module.otc.enums.ErrorCodeConstants.LEVEL_NOT_EXISTS;
 
@@ -70,4 +73,8 @@ public class OtcLevelServiceImpl implements OtcLevelService {
         return levelMapper.selectPage(pageReqVO);
     }
 
+    @Override
+    public List<OtcLevelDO> getLevelList() {
+        return levelMapper.selectList();
+    }
 }

+ 6 - 0
ship-module-resource/ship-module-resource-api/src/main/java/com/yc/ship/module/resource/enums/ErrorCodeConstants.java

@@ -46,4 +46,10 @@ public interface ErrorCodeConstants {
     ErrorCode ROUTE_POINT_NOT_EXISTS = new ErrorCode(10_003, "产品路线点位不存在");
 
     String SUPPLIER_TYPE = "supplier_type";
+
+    // 基础产品
+    ErrorCode BASE_NOT_EXISTS = new ErrorCode(10_001, "基础产品不存在");
+    ErrorCode BASE_PRICE_NOT_EXISTS = new ErrorCode(10_002, "基础产品价格不存在");
+    ErrorCode GROUP_NOT_EXISTS = new ErrorCode(10_005, "组合产品规格信息不存在");
+    ErrorCode PRODUCT_BASE_STOCK_NOT_ENOUGH = new ErrorCode(10_007, "基础产品库存不足");
 }

+ 94 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/baseprice/ProductBasePriceController.java

@@ -0,0 +1,94 @@
+package com.yc.ship.module.resource.controller.admin.baseprice;
+
+import com.yc.ship.framework.common.pojo.CommonResult;
+import com.yc.ship.framework.common.pojo.PageParam;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+import com.yc.ship.framework.excel.core.util.ExcelUtils;
+import com.yc.ship.framework.operatelog.core.annotations.OperateLog;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePricePageReqVO;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceRespVO;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceSaveReqVO;
+import com.yc.ship.module.resource.dal.dataobject.baseprice.ProductBasePriceDO;
+import com.yc.ship.module.resource.service.baseprice.ProductBasePriceService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static com.yc.ship.framework.common.pojo.CommonResult.success;
+import static com.yc.ship.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
+
+
+@Tag(name = "管理后台 - 基础产品价格")
+@RestController
+@RequestMapping("/baseprice")
+@Validated
+public class ProductBasePriceController {
+
+    @Resource
+    private ProductBasePriceService basePriceService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建基础产品价格")
+    @PreAuthorize("@ss.hasPermission('product:base-price:create')")
+    public CommonResult<Long> createBasePrice(@Valid @RequestBody ProductBasePriceSaveReqVO createReqVO) {
+        return success(basePriceService.createBasePrice(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新基础产品价格")
+    @PreAuthorize("@ss.hasPermission('product:base-price:update')")
+    public CommonResult<Boolean> updateBasePrice(@Valid @RequestBody ProductBasePriceSaveReqVO updateReqVO) {
+        basePriceService.updateBasePrice(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除基础产品价格")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('product:base-price:delete')")
+    public CommonResult<Boolean> deleteBasePrice(@RequestParam("id") Long id) {
+        basePriceService.deleteBasePrice(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得基础产品价格")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('product:base-price:query')")
+    public CommonResult<ProductBasePriceRespVO> getBasePrice(@RequestParam("id") Long id) {
+        ProductBasePriceDO basePrice = basePriceService.getBasePrice(id);
+        return success(BeanUtils.toBean(basePrice, ProductBasePriceRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得基础产品价格分页")
+    @PreAuthorize("@ss.hasPermission('product:base-price:query')")
+    public CommonResult<PageResult<ProductBasePriceRespVO>> getBasePricePage(@Valid ProductBasePricePageReqVO pageReqVO) {
+        PageResult<ProductBasePriceDO> pageResult = basePriceService.getBasePricePage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, ProductBasePriceRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出基础产品价格 Excel")
+    @PreAuthorize("@ss.hasPermission('product:base-price:export')")
+    @OperateLog(type = EXPORT,enable = false)
+    public void exportBasePriceExcel(@Valid ProductBasePricePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ProductBasePriceDO> list = basePriceService.getBasePricePage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "基础产品价格.xls", "数据", ProductBasePriceRespVO.class,
+                        BeanUtils.toBean(list, ProductBasePriceRespVO.class));
+    }
+
+}

+ 44 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/baseprice/vo/ProductBasePricePageReqVO.java

@@ -0,0 +1,44 @@
+package com.yc.ship.module.resource.controller.admin.baseprice.vo;
+
+import com.yc.ship.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+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 ProductBasePricePageReqVO extends PageParam {
+
+    @Schema(description = "基础产品ID", example = "1129")
+    private Long productBaseId;
+
+    @Schema(description = "项目ID", example = "12571")
+    private Long projectId;
+
+    @Schema(description = "规格ID", example = "21250")
+    private Long specificationId;
+
+    @Schema(description = "成本价格", example = "26505")
+    private BigDecimal costPrice;
+
+    @Schema(description = "销售价格", example = "8982")
+    private BigDecimal salePrice;
+
+    @Schema(description = "价格类型:common通用 full全价 half半价 free免票", example = "1")
+    private String specType;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 46 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/baseprice/vo/ProductBasePriceRespVO.java

@@ -0,0 +1,46 @@
+package com.yc.ship.module.resource.controller.admin.baseprice.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 基础产品价格 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ProductBasePriceRespVO {
+
+    @Schema(description = "主键", example = "25707")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "基础产品ID", example = "1129")
+    @ExcelProperty("基础产品ID")
+    private Long productBaseId;
+
+    @Schema(description = "项目ID", example = "12571")
+    @ExcelProperty("项目ID")
+    private Long projectId;
+
+    @Schema(description = "规格ID", example = "21250")
+    private Long specificationId;
+
+    @Schema(description = "规格名称", example = "21250")
+    @ExcelProperty("规格名称")
+    private String specificationName;
+
+    @Schema(description = "成本价格", example = "26505")
+    @ExcelProperty("成本价格")
+    private BigDecimal costPrice;
+
+    @Schema(description = "销售价格", example = "8982")
+    @ExcelProperty("销售价格")
+    private BigDecimal salePrice;
+
+    @Schema(description = "价格类型:common通用 full全价 half半价 free免票", example = "1")
+    @ExcelProperty("价格类型:common通用 full全价 half半价 free免票")
+    private String specType;
+
+}

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

@@ -0,0 +1,33 @@
+package com.yc.ship.module.resource.controller.admin.baseprice.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 基础产品价格新增/修改 Request VO")
+@Data
+public class ProductBasePriceSaveReqVO {
+
+    @Schema(description = "主键", example = "25707")
+    private Long id;
+
+    @Schema(description = "基础产品ID", example = "1129")
+    private Long productBaseId;
+
+    @Schema(description = "项目ID", example = "12571")
+    private Long projectId;
+
+    @Schema(description = "规格ID", example = "21250")
+    private String specificationId;
+
+    @Schema(description = "成本价格", example = "26505")
+    private BigDecimal costPrice;
+
+    @Schema(description = "销售价格", example = "8982")
+    private BigDecimal salePrice;
+
+    @Schema(description = "价格类型:common通用 full全价 half半价 free免票", example = "common")
+    private String specType;
+
+}

+ 103 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/productBase/ProductBaseController.java

@@ -0,0 +1,103 @@
+package com.yc.ship.module.resource.controller.admin.productBase;
+
+import cn.hutool.core.lang.tree.TreeNode;
+import com.yc.ship.framework.common.pojo.CommonResult;
+import com.yc.ship.framework.common.pojo.PageParam;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.excel.core.util.ExcelUtils;
+import com.yc.ship.framework.operatelog.core.annotations.OperateLog;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBasePageReqVO;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseRespVO;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseSaveReqVO;
+import com.yc.ship.module.resource.service.productBase.ProductBaseService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static com.yc.ship.framework.common.pojo.CommonResult.success;
+import static com.yc.ship.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
+import static com.yc.ship.framework.operatelog.core.enums.OperateTypeEnum.PRODUCT;
+
+
+@Tag(name = "管理后台 - 基础产品")
+@RestController
+@RequestMapping("/base")
+@Validated
+public class ProductBaseController {
+
+    @Resource
+    private ProductBaseService baseService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建基础产品")
+    @OperateLog(type = PRODUCT)
+    @PreAuthorize("@ss.hasPermission('product:base:create')")
+    public CommonResult<Long> createBase(@Valid @RequestBody ProductBaseSaveReqVO createReqVO) {
+        return success(baseService.createBase(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新基础产品")
+    @OperateLog(type = PRODUCT)
+    @PreAuthorize("@ss.hasPermission('product:base:update')")
+    public CommonResult<Boolean> updateBase(@Valid @RequestBody ProductBaseSaveReqVO updateReqVO) {
+        baseService.updateBase(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除基础产品")
+    @OperateLog(type = PRODUCT)
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('product:base:delete')")
+    public CommonResult<Boolean> deleteBase(@RequestParam("id") Long id) {
+        baseService.deleteBase(id);
+        return success(true);
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得基础产品分页")
+    @PreAuthorize("@ss.hasPermission('product:base:query')")
+    public CommonResult<PageResult<ProductBaseRespVO>> getBasePage(@Valid ProductBasePageReqVO pageReqVO) {
+        return success(baseService.queryBasePage(pageReqVO));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出基础产品 Excel")
+    @PreAuthorize("@ss.hasPermission('product:base:export')")
+    @OperateLog(type = EXPORT,enable = false)
+    public void exportBaseExcel(@Valid ProductBasePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ProductBaseRespVO> list = baseService.queryBasePage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "基础产品.xls", "数据", ProductBaseRespVO.class, list);
+    }
+
+    @GetMapping("/list")
+    @Operation(summary = "获得基础产品(分页)")
+    public CommonResult<PageResult<ProductBaseRespVO>> list(@Valid ProductBasePageReqVO pageReqVO) {
+        return success(baseService.selectBasePage(pageReqVO));
+    }
+
+    @GetMapping("/base-list")
+    @Operation(summary = "获得基础产品(列表)")
+    public CommonResult<List<ProductBaseRespVO>> baseList(@Valid ProductBasePageReqVO pageReqVO) {
+        return success(baseService.selectBaseList(pageReqVO));
+    }
+
+    @GetMapping({"/base-tree-list"})
+    @Operation(summary = "获取基础产品产品列表树。(带项目)", description = "获取基础产品产品列表树。(带项目)")
+    public CommonResult<List<TreeNode<Long>>> getDistributorProductList() {
+        return success( baseService.getProductBaseTreeList());
+    }
+}

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

@@ -0,0 +1,33 @@
+package com.yc.ship.module.resource.controller.admin.productBase.vo;
+
+import com.yc.ship.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - 基础产品分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ProductBasePageReqVO extends PageParam {
+
+    @Schema(description = "基础产品名称", example = "门票")
+    private String name;
+
+    @Schema(description = "项目ID", example = "1")
+    private Long projectId;
+
+    @Schema(description = "规格ID", example = "1")
+    private Long specId;
+
+    @Schema(description = "产品ID", example = "1")
+    private Long productId;
+
+    @Schema(description = "供应商名称", example = "xxx公司")
+    private String supplierName;
+
+    @Schema(description = "启用状态", example = "1")
+    private Integer useStatus;
+
+}

+ 125 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/productBase/vo/ProductBaseRespVO.java

@@ -0,0 +1,125 @@
+package com.yc.ship.module.resource.controller.admin.productBase.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.yc.ship.framework.excel.core.annotations.DictFormat;
+import com.yc.ship.framework.excel.core.convert.DictConvert;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceRespVO;
+import com.yc.ship.module.resource.controller.admin.checkchannel.vo.CheckChannelRespVO;
+import com.yc.ship.module.resource.controller.admin.resource.vo.ResourceSimpleRespVO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Schema(description = "管理后台 - 基础产品 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ProductBaseRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3854")
+    private Long id;
+
+    @Schema(description = "名称", example = "赵六")
+    @ExcelProperty("名称")
+    private String name;
+
+    @Schema(description = "简称", example = "张三")
+    private String shortName;
+
+    @Schema(description = "项目ID", example = "16652")
+    private Long projectId;
+
+    @Schema(description = "所属资源ID", example = "16652")
+    private Long resourceCategoryId;
+
+    @Schema(description = "优先资源ID")
+    private Long firstResourceId;
+
+    @Schema(description = "固定使用资源ID")
+    private Long fixedResourceId;
+
+    @Schema(description = "资源类型")
+    @ExcelProperty("资源类型")
+    private String resourceName;
+
+    @Schema(description = "所属项目")
+    @ExcelProperty("所属项目")
+    private String projectName;
+
+    @Schema(description = "最低成本价", example = "99")
+    @ExcelProperty("最低成本价")
+    private BigDecimal costPrice;
+
+    @Schema(description = "最低销售价", example = "199")
+    @ExcelProperty("最低销售价")
+    private BigDecimal salePrice;
+
+    @DictFormat("yes_no")
+    @ExcelProperty(value = "能否退票", converter = DictConvert.class)
+    @Schema(description = "是否可以退票;0不可退,1可退")
+    private Integer isRefund;
+
+    @ExcelProperty("产品库存")
+    @Schema(description = "产品库存(不设置为无限)")
+    private Integer stock;
+
+    @DictFormat("use_status")
+    @ExcelProperty(value = "状态", converter = DictConvert.class)
+    @Schema(description = "是否启用0否 1是", example = "1")
+    private Integer useStatus;
+
+    @ColumnWidth(value = 20)
+    @Schema(description = "创建时间")
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @DictFormat("yes_no")
+    @ExcelProperty(value="能否重复购买", converter = DictConvert.class)
+    @Schema(description = "能否重复购买:0不可以,1可以")
+    private Integer canRepeatBuy;
+
+    @Schema(description = "有效期次数")
+    @ExcelProperty("有效期次数")
+    private Integer checkTimes;
+
+    @ExcelProperty("游玩天数")
+    @Schema(description = "游玩天数")
+    private Integer daySort;
+
+    @DictFormat("yes_no")
+    @ExcelProperty(value = "自动检票", converter = DictConvert.class)
+    @Schema(description = "是否自动检票;开启时只要组合票中有一张子票核销,该产品自动核销")
+    private Integer isAutoCheck;
+
+    @DictFormat("yes_no")
+    @ExcelProperty(value = "购买即核销", converter = DictConvert.class)
+    @Schema(description = "是否购买即核销")
+    private Integer isBuyCheck;
+
+    @Schema(description = "检票计算方式;(1.按基础票检票次数计算 2.按通道检票次数计算", example = "1")
+    private Integer checkType;
+
+    @Schema(description = "开始点位", example = "1209")
+    private Long startPoint;
+
+    @Schema(description = "结束点位", example = "6830")
+    private Long endPoint;
+
+    @Schema(description = "线路ID", example = "6830")
+    private Long routeId;
+
+    @Schema(description = " 产品检票通道")
+    private List<CheckChannelRespVO> checkChannelList;
+
+    @Schema(description = " 基础产品价格")
+    private List<ProductBasePriceRespVO> basePriceList;
+
+    @Schema(description = "资源列表")
+    private List<ResourceSimpleRespVO> resourceList;
+
+
+}

+ 73 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/productBase/vo/ProductBaseSaveReqVO.java

@@ -0,0 +1,73 @@
+package com.yc.ship.module.resource.controller.admin.productBase.vo;
+
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceSaveReqVO;
+import com.yc.ship.module.resource.controller.admin.checkchannel.vo.CheckChannelSaveReqVO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.List;
+
+@Schema(description = "管理后台 - 基础产品新增/修改 Request VO")
+@Data
+public class ProductBaseSaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3854")
+    private Long id;
+
+    @Schema(description = "名称", example = "赵六")
+    private String name;
+
+    @Schema(description = "简称", example = "张三")
+    private String shortName;
+
+    @Schema(description = "项目ID", example = "16652")
+    private Long projectId;
+
+    @Schema(description = "所属资源ID")
+    private Long resourceCategoryId;
+
+    @Schema(description = "优先资源ID")
+    private Long firstResourceId;
+
+    @Schema(description = "固定使用资源ID")
+    private Long fixedResourceId;
+
+    @Schema(description = "能否重复购买:0不可以,1可以")
+    private Integer canRepeatBuy;
+
+    @Schema(description = "检票计算方式;(1.按基础票检票次数计算 2.按通道检票次数计算", example = "1")
+    private Integer checkType;
+
+    @Schema(description = "有效期次数")
+    private Integer checkTimes;
+
+    @Schema(description = "是否可以退票;0不可退,1可退")
+    private Integer isRefund;
+
+    @Schema(description = "是否自动检票;开启时只要组合票中有一张子票核销,该产品自动核销")
+    private Integer isAutoCheck;
+
+    @Schema(description = "产品库存")
+    private Integer stock;
+
+    @Schema(description = "是否购买即核销")
+    private Integer isBuyCheck;
+
+    @Schema(description = "开始点位", example = "1209")
+    private Long startPoint;
+
+    @Schema(description = "结束点位", example = "6830")
+    private Long endPoint;
+
+    @Schema(description = "线路ID", example = "6830")
+    private Long routeId;
+
+    @Schema(description = "是否启用0否 1是", example = "1")
+    private Integer useStatus;
+
+    @Schema(description = " 产品检票通道")
+    private List<CheckChannelSaveReqVO> checkChannelList;
+
+    @Schema(description = " 基础产品价格")
+    private List<ProductBasePriceSaveReqVO> basePriceList;
+}

+ 113 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/ResourceController.java

@@ -0,0 +1,113 @@
+package com.yc.ship.module.resource.controller.admin.resource;
+
+import com.yc.ship.framework.common.pojo.CommonResult;
+import com.yc.ship.framework.common.pojo.PageParam;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+import com.yc.ship.framework.excel.core.util.ExcelUtils;
+import com.yc.ship.framework.operatelog.core.annotations.OperateLog;
+import com.yc.ship.module.resource.controller.admin.resource.vo.*;
+import com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO;
+import com.yc.ship.module.resource.service.resource.ResourceService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static com.yc.ship.framework.common.pojo.CommonResult.success;
+import static com.yc.ship.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
+
+
+@Tag(name = "管理后台 - 产品资源")
+@RestController
+@RequestMapping("/resource")
+@Validated
+public class ResourceController {
+
+    @Resource
+    private ResourceService resourceService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建产品资源")
+    @PreAuthorize("@ss.hasPermission('product:resource:create')")
+    public CommonResult<Long> createResource(@Valid @RequestBody ResourceSaveReqVO createReqVO) {
+        return success(resourceService.createResource(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新产品资源")
+    @PreAuthorize("@ss.hasPermission('product:resource:update')")
+    public CommonResult<Boolean> updateResource(@Valid @RequestBody ResourceSaveReqVO updateReqVO) {
+        resourceService.updateResource(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除产品资源")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('product:resource:delete')")
+    public CommonResult<Boolean> deleteResource(@RequestParam("id") Long id) {
+        resourceService.deleteResource(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得产品资源")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('product:resource:query')")
+    public CommonResult<ResourceRespVO> getResource(@RequestParam("id") Long id) {
+        ResourceDO resource = resourceService.getResource(id);
+        return success(BeanUtils.toBean(resource, ResourceRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得产品资源分页")
+    @PreAuthorize("@ss.hasPermission('product:resource:query')")
+    public CommonResult<PageResult<ResourceRespVO>> getResourcePage(@Valid ResourcePageReqVO pageReqVO) {
+        PageResult<ResourceDO> pageResult = resourceService.getResourcePage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, ResourceRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出产品资源 Excel")
+    @PreAuthorize("@ss.hasPermission('product:resource:export')")
+    @OperateLog(type = EXPORT,enable = false)
+    public void exportResourceExcel(@Valid ResourcePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ResourceDO> list = resourceService.getResourcePage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "产品资源.xls", "数据", ResourceRespVO.class,
+                        BeanUtils.toBean(list, ResourceRespVO.class));
+    }
+
+    @GetMapping({"/list-all-simple", "simple-list"})
+    @Operation(summary = "获取资源精简信息列表")
+    public CommonResult<List<ResourceSimpleRespVO>> getSimpleResourceList() {
+        List<ResourceDO> list = resourceService.getSimpleResourceList();
+        return success(BeanUtils.toBean(list, ResourceSimpleRespVO.class));
+    }
+
+    @GetMapping({"/getProductListByAccess"})
+    @Operation(summary = "获取第三方直连资源列表")
+    public CommonResult<List<ResourceAccessRespVO>> getProductListByAccess(String supplierId) {
+        List<ResourceAccessRespVO> list = resourceService.getProductListByAccessList(supplierId);
+        return success(list);
+    }
+
+    @GetMapping("/list-by-category")
+    @Operation(summary = "获取资源精简信息列表")
+    public CommonResult<List<ResourceSimpleRespVO>> getResourceList(Long categoryId) {
+        List<ResourceDO> list = resourceService.getResourceByCategoryId(categoryId);
+        return success(BeanUtils.toBean(list, ResourceSimpleRespVO.class));
+    }
+
+}

+ 56 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ReducedResourceRespVO.java

@@ -0,0 +1,56 @@
+package com.yc.ship.module.resource.controller.admin.resource.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 产品资源 Response VO")
+@Data
+public class ReducedResourceRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16598")
+    private Long id;
+
+    @Schema(description = "资源名称", example = "李四")
+    private String name;
+
+    @Schema(description = "供应商ID", example = "10875")
+    private Long supplierId;
+
+    @Schema(description = "来源", example = "1")
+    private Integer sourceType;
+
+    @Schema(description = "类别ID", example = "32017")
+    private String categoryId;
+
+    @Schema(description = "第三方资源ID", example = "13752")
+    private String thirdResourceId;
+
+    @Schema(description = "对接类型", example = "2")
+    private Integer accessType;
+
+    @Schema(description = "总库存;不填表示不限制")
+    private Integer stock;
+
+    @Schema(description = "供应商名称")
+    private String supplierName;
+
+    @Schema(description = "参考价")
+    private BigDecimal price;
+
+    @Schema(description = "产品id")
+    private Long productId;
+
+    @Schema(description = "产品名称")
+    private String productName;
+
+    @Schema(description = "基础产品id")
+    private Long productBaseId;
+
+    @Schema(description = "基础产品名称")
+    private String productBaseName;
+
+    @Schema(description = "扣减数")
+    private Integer reducedNum;
+}

+ 14 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourceAccessRespVO.java

@@ -0,0 +1,14 @@
+package com.yc.ship.module.resource.controller.admin.resource.vo;
+
+import lombok.Data;
+
+@Data
+public class ResourceAccessRespVO {
+
+    private String id;
+
+    private String name;
+
+    private String price;
+
+}

+ 61 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourcePageReqVO.java

@@ -0,0 +1,61 @@
+package com.yc.ship.module.resource.controller.admin.resource.vo;
+
+import com.yc.ship.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+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 ResourcePageReqVO extends PageParam {
+
+    @Schema(description = "资源名称", example = "李四")
+    private String name;
+
+    @Schema(description = "是否启用;0否 1是")
+    private Integer isUse;
+
+    @Schema(description = "供应商ID", example = "10875")
+    private Long supplierId;
+
+    @Schema(description = "来源", example = "1")
+    private Integer sourceType;
+
+    @Schema(description = "类别ID", example = "32017")
+    private String categoryId;
+
+    @Schema(description = "接入开始时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] startTime;
+
+    @Schema(description = "截止时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] endTime;
+
+    @Schema(description = "结算参考价", example = "6901")
+    private BigDecimal price;
+
+    @Schema(description = "第三方资源ID", example = "13752")
+    private String thirdResourceId;
+
+    @Schema(description = "对接类型", example = "2")
+    private Integer accessType;
+
+    @Schema(description = "总库存;不填表示不限制")
+    private Integer stock;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 75 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourceRespVO.java

@@ -0,0 +1,75 @@
+package com.yc.ship.module.resource.controller.admin.resource.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 产品资源 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ResourceRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16598")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "资源名称", example = "李四")
+    @ExcelProperty("资源名称")
+    private String name;
+
+    @Schema(description = "是否启用;0否 1是")
+    @ExcelProperty("是否启用;0否 1是")
+    private Integer isUse;
+
+    @Schema(description = "供应商ID", example = "10875")
+    @ExcelProperty("供应商ID")
+    private Long supplierId;
+
+    @Schema(description = "来源", example = "1")
+    @ExcelProperty("来源")
+    private Integer sourceType;
+
+    @Schema(description = "类别ID", example = "32017")
+    @ExcelProperty("类别ID")
+    private String categoryId;
+
+    @Schema(description = "接入开始时间")
+    @ExcelProperty("接入开始时间")
+    private LocalDateTime startTime;
+
+    @Schema(description = "截止时间")
+    @ExcelProperty("截止时间")
+    private LocalDateTime endTime;
+
+    @Schema(description = "结算参考价", example = "6901")
+    @ExcelProperty("结算参考价")
+    private BigDecimal price;
+
+    @Schema(description = "第三方资源ID", example = "13752")
+    @ExcelProperty("第三方资源ID")
+    private String thirdResourceId;
+
+    @Schema(description = "对接类型", example = "2")
+    @ExcelProperty("对接类型")
+    private Integer accessType;
+
+    @Schema(description = "总库存;不填表示不限制")
+    @ExcelProperty("总库存;不填表示不限制")
+    private Integer stock;
+
+    @Schema(description = "创建时间")
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "所属分类名称")
+    @ExcelProperty("所属分类名称")
+    private String categoryName;
+
+    @Schema(description = "供应商名称")
+    @ExcelProperty("供应商名称")
+    private String supplierName;
+}

+ 49 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/resource/vo/ResourceSaveReqVO.java

@@ -0,0 +1,49 @@
+package com.yc.ship.module.resource.controller.admin.resource.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 产品资源新增/修改 Request VO")
+@Data
+public class ResourceSaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16598")
+    private Long id;
+
+    @Schema(description = "资源名称", example = "李四")
+    private String name;
+
+    @Schema(description = "是否启用;0否 1是")
+    private Integer isUse;
+
+    @Schema(description = "供应商ID", example = "10875")
+    private Long supplierId;
+
+    @Schema(description = "来源", example = "1")
+    private Integer sourceType;
+
+    @Schema(description = "类别ID", example = "32017")
+    private String categoryId;
+
+    @Schema(description = "接入开始时间")
+    private LocalDateTime startTime;
+
+    @Schema(description = "截止时间")
+    private LocalDateTime endTime;
+
+    @Schema(description = "结算参考价", example = "6901")
+    private BigDecimal price;
+
+    @Schema(description = "第三方资源ID", example = "13752")
+    private String thirdResourceId;
+
+    @Schema(description = "对接类型", example = "2")
+    private Integer accessType;
+
+    @Schema(description = "总库存;不填表示不限制")
+    private Integer stock;
+
+}

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

@@ -0,0 +1,33 @@
+package com.yc.ship.module.resource.controller.admin.resource.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 资源信息 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ResourceSimpleRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6825")
+    private Long id;
+
+    @Schema(description = "名称", example = "赵六")
+    private String name;
+
+    @Schema(description = "资源对接类型:0系统未对接 1系统直连", example = "0")
+    private Integer accessType;
+
+    @Schema(description = "资源类型:0内部资源,1外部资源", example = "0")
+    private Integer sourceType;
+
+    @Schema(description = "类别ID", example = "0")
+    private Long categoryId;
+
+    @Schema(description = "供应商ID", example = "10875")
+    private Long supplierId;
+
+    @Schema(description = "供应商名称")
+    private String supplierName;
+
+}

+ 94 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/suppliercategory/SupplierCategoryController.java

@@ -0,0 +1,94 @@
+package com.yc.ship.module.resource.controller.admin.suppliercategory;
+
+import com.yc.ship.framework.common.pojo.CommonResult;
+import com.yc.ship.framework.common.pojo.PageParam;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+import com.yc.ship.framework.excel.core.util.ExcelUtils;
+import com.yc.ship.framework.operatelog.core.annotations.OperateLog;
+import com.yc.ship.module.resource.controller.admin.suppliercategory.vo.SupplierCategoryPageReqVO;
+import com.yc.ship.module.resource.controller.admin.suppliercategory.vo.SupplierCategoryRespVO;
+import com.yc.ship.module.resource.controller.admin.suppliercategory.vo.SupplierCategorySaveReqVO;
+import com.yc.ship.module.resource.dal.dataobject.suppliercategory.SupplierCategoryDO;
+import com.yc.ship.module.resource.service.suppliercategory.SupplierCategoryService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.List;
+
+import static com.yc.ship.framework.common.pojo.CommonResult.success;
+import static com.yc.ship.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
+
+
+@Tag(name = "管理后台 - 资源供应商与资源类型关联")
+@RestController
+@RequestMapping("/product/supplier-category")
+@Validated
+public class SupplierCategoryController {
+
+    @Resource
+    private SupplierCategoryService supplierCategoryService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建资源供应商与资源类型关联")
+    @PreAuthorize("@ss.hasPermission('product:supplier-category:create')")
+    public CommonResult<Long> createSupplierCategory(@Valid @RequestBody SupplierCategorySaveReqVO createReqVO) {
+        return success(supplierCategoryService.createSupplierCategory(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新资源供应商与资源类型关联")
+    @PreAuthorize("@ss.hasPermission('product:supplier-category:update')")
+    public CommonResult<Boolean> updateSupplierCategory(@Valid @RequestBody SupplierCategorySaveReqVO updateReqVO) {
+        supplierCategoryService.updateSupplierCategory(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除资源供应商与资源类型关联")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('product:supplier-category:delete')")
+    public CommonResult<Boolean> deleteSupplierCategory(@RequestParam("id") Long id) {
+        supplierCategoryService.deleteSupplierCategory(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得资源供应商与资源类型关联")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('product:supplier-category:query')")
+    public CommonResult<SupplierCategoryRespVO> getSupplierCategory(@RequestParam("id") Long id) {
+        SupplierCategoryDO supplierCategory = supplierCategoryService.getSupplierCategory(id);
+        return success(BeanUtils.toBean(supplierCategory, SupplierCategoryRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得资源供应商与资源类型关联分页")
+    @PreAuthorize("@ss.hasPermission('product:supplier-category:query')")
+    public CommonResult<PageResult<SupplierCategoryRespVO>> getSupplierCategoryPage(@Valid SupplierCategoryPageReqVO pageReqVO) {
+        PageResult<SupplierCategoryDO> pageResult = supplierCategoryService.getSupplierCategoryPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, SupplierCategoryRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出资源供应商与资源类型关联 Excel")
+    @PreAuthorize("@ss.hasPermission('product:supplier-category:export')")
+    @OperateLog(type = EXPORT,enable = false)
+    public void exportSupplierCategoryExcel(@Valid SupplierCategoryPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<SupplierCategoryDO> list = supplierCategoryService.getSupplierCategoryPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "资源供应商与资源类型关联.xls", "数据", SupplierCategoryRespVO.class,
+                        BeanUtils.toBean(list, SupplierCategoryRespVO.class));
+    }
+
+}

+ 15 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/suppliercategory/vo/SupplierCategoryPageReqVO.java

@@ -0,0 +1,15 @@
+package com.yc.ship.module.resource.controller.admin.suppliercategory.vo;
+
+import com.yc.ship.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - 资源供应商与资源类型关联分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class SupplierCategoryPageReqVO extends PageParam {
+
+}

+ 21 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/suppliercategory/vo/SupplierCategoryRespVO.java

@@ -0,0 +1,21 @@
+package com.yc.ship.module.resource.controller.admin.suppliercategory.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 资源供应商与资源类型关联 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class SupplierCategoryRespVO {
+
+    @Schema(description = "供应商主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6415")
+    @ExcelProperty("供应商主键")
+    private Long supplierId;
+
+    @Schema(description = "资源类型主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18619")
+    @ExcelProperty("资源类型主键")
+    private Long categoryId;
+
+}

+ 16 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/suppliercategory/vo/SupplierCategorySaveReqVO.java

@@ -0,0 +1,16 @@
+package com.yc.ship.module.resource.controller.admin.suppliercategory.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 资源供应商与资源类型关联新增/修改 Request VO")
+@Data
+public class SupplierCategorySaveReqVO {
+
+    @Schema(description = "供应商主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6415")
+    private Long supplierId;
+
+    @Schema(description = "资源类型主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18619")
+    private Long categoryId;
+
+}

+ 57 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/baseprice/ProductBasePriceDO.java

@@ -0,0 +1,57 @@
+package com.yc.ship.module.resource.dal.dataobject.baseprice;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.yc.ship.framework.mybatis.core.dataobject.BaseDO;
+import lombok.*;
+
+import java.math.BigDecimal;
+
+/**
+ * 基础产品价格 DO
+ *
+ * @author 管理员
+ */
+@TableName("product_base_price")
+@KeySequence("product_base_price_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ProductBasePriceDO extends BaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId(type= IdType.INPUT)
+    private Long id;
+    /**
+     * 基础产品ID
+     */
+    private Long productBaseId;
+    /**
+     * 项目ID
+     */
+    private Long projectId;
+    /**
+     * 规格ID
+     */
+    private Long specificationId;
+    /**
+     * 成本价格
+     */
+    private BigDecimal costPrice;
+    /**
+     * 销售价格
+     */
+    private BigDecimal salePrice;
+    /**
+     * 价格类型:common通用 full全价 half半价 free免票
+     */
+    private String specType;
+
+}

+ 103 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/productBase/ProductBaseDO.java

@@ -0,0 +1,103 @@
+package com.yc.ship.module.resource.dal.dataobject.productBase;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.yc.ship.framework.tenant.core.db.TenantBaseDO;
+import lombok.*;
+
+/**
+ * 基础产品 DO
+ *
+ * @author 管理员
+ */
+@TableName("product_base")
+@KeySequence("product_base_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ProductBaseDO extends TenantBaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId(type= IdType.INPUT)
+    private Long id;
+    /**
+     * 名称
+     */
+    private String name;
+    /**
+     * 简称
+     */
+    private String shortName;
+    /**
+     * 项目ID
+     */
+    private Long projectId;
+
+    /**
+     * 所属资源ID
+     */
+    private Long resourceCategoryId;
+    /**
+     * 优先资源ID
+     */
+    private Long firstResourceId;
+    /**
+     * 固定使用资源ID
+     */
+    private Long fixedResourceId;
+    /**
+     * 库存;不填表示不限制
+     */
+    private Integer stock;
+    /**
+     * 检票计算方式;(1.按基础票检票次数计算 2.按通道检票次数计算
+     */
+    private Integer checkType;
+    /**
+     * 有效期次数
+     */
+    private Integer checkTimes;
+    /**
+     * 能否重复购买:0不可以,1可以
+     */
+    private Integer canRepeatBuy;
+    /**
+     * 是否可以退票;0不可退,1可退
+     */
+    private Integer isRefund;
+    /**
+     * 是否自动检票;开启时只要组合票中有一张子票核销,该产品自动核销
+     */
+    private Integer isAutoCheck;
+    /**
+     * 是否购买即核销
+     */
+    private Integer isBuyCheck;
+    /**
+     * 开始点位
+     */
+    private Long startPoint;
+    /**
+     * 结束点位
+     */
+    private Long endPoint;
+    /**
+     * 线路ID
+     */
+    private Long routeId;
+    /**
+     * 是否启用0否 1是
+     */
+    private Integer useStatus;
+
+    @TableField(exist = false)
+    private String projectName;
+
+    @TableField(exist = false)
+    private String resourceName;
+
+}

+ 84 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/resource/ResourceDO.java

@@ -0,0 +1,84 @@
+package com.yc.ship.module.resource.dal.dataobject.resource;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.yc.ship.framework.tenant.core.db.TenantBaseDO;
+import lombok.*;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 产品资源 DO
+ *
+ * @author 管理员
+ */
+@TableName("product_resource")
+@KeySequence("product_resource_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResourceDO extends TenantBaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId(type= IdType.INPUT)
+    private Long id;
+    /**
+     * 资源名称
+     */
+    private String name;
+    /**
+     * 是否启用;0否 1是
+     */
+    private Integer isUse;
+    /**
+     * 供应商ID
+     */
+    private Long supplierId;
+    /**
+     * 来源
+     */
+    private Integer sourceType;
+    /**
+     * 类别ID
+     */
+    private String categoryId;
+    /**
+     * 接入开始时间
+     */
+    private LocalDateTime startTime;
+    /**
+     * 截止时间
+     */
+    private LocalDateTime endTime;
+    /**
+     * 结算参考价
+     */
+    private BigDecimal price;
+    /**
+     * 第三方资源ID
+     */
+    private String thirdResourceId;
+    /**
+     * 对接类型
+     */
+    @TableField(exist = false)
+    private Integer accessType;
+    /**
+     * 总库存;不填表示不限制
+     */
+    private Integer stock;
+
+
+    @TableField(exist = false)
+    private String categoryName;
+
+    @TableField(exist = false)
+    private String supplierName;
+
+
+}

+ 32 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/suppliercategory/SupplierCategoryDO.java

@@ -0,0 +1,32 @@
+package com.yc.ship.module.resource.dal.dataobject.suppliercategory;
+
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * 资源供应商与资源类型关联 DO
+ *
+ * @author 管理员
+ */
+@TableName("product_supplier_category")
+@KeySequence("product_supplier_category_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SupplierCategoryDO {
+
+    /**
+     * 供应商主键
+     */
+
+    private Long supplierId;
+    /**
+     * 资源类型主键
+     */
+
+    private Long categoryId;
+
+}

+ 37 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/baseprice/ProductBasePriceMapper.java

@@ -0,0 +1,37 @@
+package com.yc.ship.module.resource.dal.mysql.baseprice;
+
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
+import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePricePageReqVO;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceRespVO;
+import com.yc.ship.module.resource.dal.dataobject.baseprice.ProductBasePriceDO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+/**
+ * 基础产品价格 Mapper
+ *
+ * @author 管理员
+ */
+@Mapper
+public interface ProductBasePriceMapper extends BaseMapperX<ProductBasePriceDO> {
+
+    default PageResult<ProductBasePriceDO> selectPage(ProductBasePricePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<ProductBasePriceDO>()
+                .eqIfPresent(ProductBasePriceDO::getProductBaseId, reqVO.getProductBaseId())
+                .eqIfPresent(ProductBasePriceDO::getProjectId, reqVO.getProjectId())
+                .eqIfPresent(ProductBasePriceDO::getSpecificationId, reqVO.getSpecificationId())
+                .eqIfPresent(ProductBasePriceDO::getCostPrice, reqVO.getCostPrice())
+                .eqIfPresent(ProductBasePriceDO::getSalePrice, reqVO.getSalePrice())
+                .eqIfPresent(ProductBasePriceDO::getSpecType, reqVO.getSpecType())
+                .betweenIfPresent(ProductBasePriceDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(ProductBasePriceDO::getId));
+    }
+
+    List<ProductBasePriceRespVO> selectByBaseId(@Param("baseId") Long baseId);
+
+}

+ 33 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/productBase/ProductBaseMapper.java

@@ -0,0 +1,33 @@
+package com.yc.ship.module.resource.dal.mysql.productBase;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
+import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBasePageReqVO;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseRespVO;
+import com.yc.ship.module.resource.dal.dataobject.productBase.ProductBaseDO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * 基础产品 Mapper
+ *
+ * @author 管理员
+ */
+@Mapper
+public interface ProductBaseMapper extends BaseMapperX<ProductBaseDO> {
+
+    default PageResult<ProductBaseDO> selectPage(ProductBasePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<ProductBaseDO>()
+                .likeIfPresent(ProductBaseDO::getName, reqVO.getName())
+                .eqIfPresent(ProductBaseDO::getProjectId, reqVO.getProjectId())
+                .orderByDesc(ProductBaseDO::getId));
+    }
+
+    IPage<ProductBaseRespVO> queryProductBasePage(IPage<ProductBaseRespVO> page, @Param("reqVO") ProductBasePageReqVO pageReqVO);
+
+    IPage<ProductBaseRespVO> selectProductBasePage(IPage<ProductBaseRespVO> page, @Param("reqVO") ProductBasePageReqVO pageReqVO);
+
+}

+ 76 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/resource/ResourceMapper.java

@@ -0,0 +1,76 @@
+package com.yc.ship.module.resource.dal.mysql.resource;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
+import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.yc.ship.framework.tenant.core.aop.TenantIgnore;
+import com.yc.ship.module.resource.controller.admin.resource.vo.ResourcePageReqVO;
+import com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO;
+import com.yc.ship.module.resource.dal.dataobject.supplier.SupplierDO;
+import com.yc.ship.module.resource.enums.UseStatusEnum;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+/**
+ * 产品资源 Mapper
+ *
+ * @author 管理员
+ */
+@Mapper
+public interface ResourceMapper extends BaseMapperX<ResourceDO> {
+
+    default PageResult<ResourceDO> selectPage(ResourcePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<ResourceDO>()
+                .likeIfPresent(ResourceDO::getName, reqVO.getName())
+                .eqIfPresent(ResourceDO::getIsUse, reqVO.getIsUse())
+                .eqIfPresent(ResourceDO::getSupplierId, reqVO.getSupplierId())
+                .eqIfPresent(ResourceDO::getSourceType, reqVO.getSourceType())
+                .eqIfPresent(ResourceDO::getCategoryId, reqVO.getCategoryId())
+                .betweenIfPresent(ResourceDO::getStartTime, reqVO.getStartTime())
+                .betweenIfPresent(ResourceDO::getEndTime, reqVO.getEndTime())
+                .eqIfPresent(ResourceDO::getPrice, reqVO.getPrice())
+                .eqIfPresent(ResourceDO::getAccessType, reqVO.getAccessType())
+                .eqIfPresent(ResourceDO::getStock, reqVO.getStock())
+                .betweenIfPresent(ResourceDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(ResourceDO::getId));
+    }
+
+    IPage<ResourceDO> queryPage(IPage<SupplierDO> iPage, @Param("param")ResourcePageReqVO pageReqVO);
+
+    default List<ResourceDO> getSimpleResourceList(){
+        return selectList(new LambdaQueryWrapperX<ResourceDO>()
+                .eq(ResourceDO::getIsUse, UseStatusEnum.ENABLE.getStatus())
+                .orderByDesc(ResourceDO::getId)
+        );
+    }
+
+    /**
+     * 根据基础产品id获取资源
+     * @param id 基础产品id
+     * @return 资源
+     */
+    ResourceDO getByProductBaseId(@Param("id") Long id);
+
+    /**
+     * 根据基础产品id获取资源
+     * @param productBaseId 基础产品id
+     * @param excludeId 排除资源id
+     * @return 资源列表
+     */
+    List<ResourceDO> getListWithoutExcludeId(@Param("productBaseId") Long productBaseId, @Param("excludeId") Long excludeId);
+
+    /**
+     * 根据资源ID获取
+     * @param id
+     * @return
+     */
+    @TenantIgnore
+    ResourceDO getByResourceId(@Param("id") Long id);
+
+
+    List<ResourceDO> getResourceByCategoryId(@Param("categoryId") Long categoryId);
+}

+ 24 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/mysql/suppliercategory/SupplierCategoryMapper.java

@@ -0,0 +1,24 @@
+package com.yc.ship.module.resource.dal.mysql.suppliercategory;
+
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
+import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.yc.ship.module.resource.controller.admin.suppliercategory.vo.SupplierCategoryPageReqVO;
+import com.yc.ship.module.resource.dal.dataobject.suppliercategory.SupplierCategoryDO;
+import org.apache.ibatis.annotations.Mapper;
+
+
+/**
+ * 资源供应商与资源类型关联 Mapper
+ *
+ * @author 管理员
+ */
+@Mapper
+public interface SupplierCategoryMapper extends BaseMapperX<SupplierCategoryDO> {
+
+    default PageResult<SupplierCategoryDO> selectPage(SupplierCategoryPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<SupplierCategoryDO>()
+                .orderByDesc(SupplierCategoryDO::getSupplierId));
+    }
+
+}

+ 25 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/redis/RedisKeyConstants.java

@@ -0,0 +1,25 @@
+package com.yc.ship.module.resource.dal.redis;
+
+/**
+ * System Redis Key 枚举类
+ *
+ * @author 智胜慧旅
+ */
+public interface RedisKeyConstants {
+
+    /**
+     * 指定第三方供应商产品信息的缓存
+     * <p>
+     * KEY 格式:access_product_list:{id}
+     * VALUE 数据类型:List
+     */
+    String ACCESS_PRODUCT_LIST = "access_product_list";
+    /**
+     * 产品日库存缓存
+     */
+    String PRODUCT_DAY_STOCK = "product_day_stock";
+    String PRODUCT_SALE_RULE = "product_sale_rule";
+    String STOCK_DAY_PRICE = "stock_day_price";
+
+
+}

+ 66 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/baseprice/ProductBasePriceService.java

@@ -0,0 +1,66 @@
+package com.yc.ship.module.resource.service.baseprice;
+
+
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePricePageReqVO;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceRespVO;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceSaveReqVO;
+import com.yc.ship.module.resource.dal.dataobject.baseprice.ProductBasePriceDO;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 基础产品价格 Service 接口
+ *
+ * @author 管理员
+ */
+public interface ProductBasePriceService {
+
+    /**
+     * 创建基础产品价格
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createBasePrice(@Valid ProductBasePriceSaveReqVO createReqVO);
+
+    /**
+     * 更新基础产品价格
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateBasePrice(@Valid ProductBasePriceSaveReqVO updateReqVO);
+
+    /**
+     * 删除基础产品价格
+     *
+     * @param id 编号
+     */
+    void deleteBasePrice(Long id);
+
+    /**
+     * 删除基础产品价格
+     *
+     * @param baseId 编号
+     */
+    void deleteByProductBaseId(Long baseId);
+
+    /**
+     * 获得基础产品价格
+     *
+     * @param id 编号
+     * @return 基础产品价格
+     */
+    ProductBasePriceDO getBasePrice(Long id);
+
+    /**
+     * 获得基础产品价格分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 基础产品价格分页
+     */
+    PageResult<ProductBasePriceDO> getBasePricePage(ProductBasePricePageReqVO pageReqVO);
+
+    List<ProductBasePriceRespVO> queryPriceByBase(Long baseId);
+}

+ 87 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/baseprice/ProductBasePriceServiceImpl.java

@@ -0,0 +1,87 @@
+package com.yc.ship.module.resource.service.baseprice;
+
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePricePageReqVO;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceRespVO;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceSaveReqVO;
+import com.yc.ship.module.resource.dal.dataobject.baseprice.ProductBasePriceDO;
+import com.yc.ship.module.resource.dal.mysql.baseprice.ProductBasePriceMapper;
+import com.yc.ship.module.resource.enums.ErrorCodeConstants;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
+
+
+/**
+ * 基础产品价格 Service 实现类
+ *
+ * @author 管理员
+ */
+@Service
+@Validated
+public class ProductBasePriceServiceImpl implements ProductBasePriceService {
+
+    @Resource
+    private ProductBasePriceMapper basePriceMapper;
+
+    @Override
+    public Long createBasePrice(ProductBasePriceSaveReqVO createReqVO) {
+        // 插入
+        ProductBasePriceDO basePrice = BeanUtils.toBean(createReqVO, ProductBasePriceDO.class);
+        Long id= IdWorker.getId(basePrice);
+        basePrice.setId(id);
+        basePrice.setDeleted(false);
+        basePriceMapper.insert(basePrice);
+        // 返回
+        return basePrice.getId();
+    }
+
+    @Override
+    public void updateBasePrice(ProductBasePriceSaveReqVO updateReqVO) {
+        // 校验存在
+        validateBasePriceExists(updateReqVO.getId());
+        // 更新
+        ProductBasePriceDO updateObj = BeanUtils.toBean(updateReqVO, ProductBasePriceDO.class);
+        basePriceMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteBasePrice(Long id) {
+        // 校验存在
+        validateBasePriceExists(id);
+        // 删除
+        basePriceMapper.deleteById(id);
+    }
+
+    @Override
+    public void deleteByProductBaseId(Long baseId) {
+        basePriceMapper.delete(ProductBasePriceDO::getProductBaseId, baseId);
+    }
+
+    private void validateBasePriceExists(Long id) {
+        if (basePriceMapper.selectById(id) == null) {
+            throw exception(ErrorCodeConstants.BASE_PRICE_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public ProductBasePriceDO getBasePrice(Long id) {
+        return basePriceMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<ProductBasePriceDO> getBasePricePage(ProductBasePricePageReqVO pageReqVO) {
+        return basePriceMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public List<ProductBasePriceRespVO> queryPriceByBase(Long baseId) {
+        return basePriceMapper.selectByBaseId(baseId);
+    }
+}

+ 5 - 4
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/category/CategoryServiceImpl.java

@@ -69,10 +69,11 @@ public class CategoryServiceImpl implements CategoryService {
         categoryMapper.insert(category);
 
         // 全路径名称
-        List<CategoryRespVO> list = categoryMapper.getAllUpCategoryById(id, category.getType());
-        String fullPathName = list.stream().map(CategoryRespVO::getCateName).collect(Collectors.joining("/"));
-        category.setFullPathName(fullPathName);
-        categoryMapper.updateById(category);
+//        List<CategoryRespVO> list = categoryMapper.getAllUpCategoryById(id, category.getType());
+//        List<CategoryDO> list = categoryMapper.selectList();
+//        String fullPathName = list.stream().map(CategoryRespVO::getCateName).collect(Collectors.joining("/"));
+//        category.setFullPathName(fullPathName);
+//        categoryMapper.updateById(category);
 
         if (category.getType() == 2) {
             CategoryExtraDO categoryExtra;

+ 82 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/productBase/ProductBaseService.java

@@ -0,0 +1,82 @@
+package com.yc.ship.module.resource.service.productBase;
+
+import cn.hutool.core.lang.tree.TreeNode;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBasePageReqVO;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseRespVO;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseSaveReqVO;
+import com.yc.ship.module.resource.dal.dataobject.productBase.ProductBaseDO;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 基础产品 Service 接口
+ *
+ * @author 管理员
+ */
+public interface ProductBaseService {
+
+    /**
+     * 创建基础产品
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createBase(@Valid ProductBaseSaveReqVO createReqVO);
+
+    /**
+     * 更新基础产品
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateBase(@Valid ProductBaseSaveReqVO updateReqVO);
+
+    /**
+     * 删除基础产品
+     *
+     * @param id 编号
+     */
+    void deleteBase(Long id);
+
+    /**
+     * 获得基础产品
+     *
+     * @param id 编号
+     * @return 基础产品
+     */
+    ProductBaseRespVO getBase(Long id);
+
+    /**
+     * 获得基础产品分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 基础产品分页
+     */
+    PageResult<ProductBaseDO> getBasePage(ProductBasePageReqVO pageReqVO);
+
+    /**
+     * 获得基础产品分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 基础产品分页
+     */
+    PageResult<ProductBaseRespVO> queryBasePage(ProductBasePageReqVO pageReqVO);
+
+    /**
+     * 获得基础产品
+     *
+     * @param pageReqVO 分页查询
+     * @return 基础产品
+     */
+    PageResult<ProductBaseRespVO> selectBasePage(ProductBasePageReqVO pageReqVO);
+
+    /**
+     * 获得基础产品
+     * @param pageReqVO 查询
+     * @return 基础产品
+     */
+    List<ProductBaseRespVO> selectBaseList(ProductBasePageReqVO pageReqVO);
+
+    List<TreeNode<Long>> getProductBaseTreeList();
+}

+ 247 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/productBase/ProductBaseServiceImpl.java

@@ -0,0 +1,247 @@
+package com.yc.ship.module.resource.service.productBase;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.lang.tree.TreeNode;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+import com.yc.ship.framework.mybatis.core.query.MPJLambdaWrapperX;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceRespVO;
+import com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceSaveReqVO;
+import com.yc.ship.module.resource.controller.admin.checkchannel.vo.CheckChannelRespVO;
+import com.yc.ship.module.resource.controller.admin.checkchannel.vo.CheckChannelSaveReqVO;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBasePageReqVO;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseRespVO;
+import com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseSaveReqVO;
+import com.yc.ship.module.resource.controller.admin.resource.vo.ResourceSimpleRespVO;
+import com.yc.ship.module.resource.dal.dataobject.checkchannel.CheckChannelDO;
+import com.yc.ship.module.resource.dal.dataobject.productBase.ProductBaseDO;
+import com.yc.ship.module.resource.dal.dataobject.project.ProjectDO;
+import com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO;
+import com.yc.ship.module.resource.dal.mysql.checkchannel.CheckChannelMapper;
+import com.yc.ship.module.resource.dal.mysql.productBase.ProductBaseMapper;
+import com.yc.ship.module.resource.dal.mysql.resource.ResourceMapper;
+import com.yc.ship.module.resource.enums.ErrorCodeConstants;
+import com.yc.ship.module.resource.enums.UseStatusEnum;
+import com.yc.ship.module.resource.service.baseprice.ProductBasePriceService;
+import com.yc.ship.module.resource.service.checkchannel.CheckChannelService;
+import com.yc.ship.module.resource.service.project.ProjectService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
+
+
+/**
+ * 基础产品 Service 实现类
+ *
+ * @author 管理员
+ */
+@Service
+@Validated
+@RequiredArgsConstructor
+public class ProductBaseServiceImpl implements ProductBaseService {
+
+    private final ProductBaseMapper baseMapper;
+    private final ResourceMapper resourceMapper;
+    private final CheckChannelMapper checkChannelMapper;
+
+    private final CheckChannelService checkChannelService;
+    private final ProjectService projectService;
+    private final ProductBasePriceService basePriceService;
+
+    @Override
+    @Transactional
+    public Long createBase(ProductBaseSaveReqVO createReqVO) {
+        // 插入
+        ProductBaseDO base = BeanUtils.toBean(createReqVO, ProductBaseDO.class);
+        base.setId(IdWorker.getId(base));
+        base.setDeleted(false);
+        baseMapper.insert(base);
+
+        List<CheckChannelSaveReqVO> channelReqVOList = createReqVO.getCheckChannelList();
+        if (CollectionUtil.isNotEmpty(channelReqVOList)) {
+            for (CheckChannelSaveReqVO channelReqVO : channelReqVOList) {
+                CheckChannelDO checkChannelDO = BeanUtils.toBean(channelReqVO, CheckChannelDO.class);
+                checkChannelDO.setProductId(base.getId());
+                checkChannelMapper.insert(checkChannelDO);
+            }
+        }
+        List<ProductBasePriceSaveReqVO> basePriceReqVOList = createReqVO.getBasePriceList();
+        if (CollectionUtil.isNotEmpty(basePriceReqVOList)) {
+            for (ProductBasePriceSaveReqVO basePriceSaveReqVO : basePriceReqVOList) {
+                basePriceSaveReqVO.setProductBaseId(base.getId());
+                basePriceService.createBasePrice(basePriceSaveReqVO);
+            }
+        }
+        // 返回
+        return base.getId();
+    }
+
+    @Override
+    @Transactional
+    public void updateBase(ProductBaseSaveReqVO updateReqVO) {
+        // 校验存在
+        ProductBaseDO baseDO = validateBaseExists(updateReqVO.getId());
+        // 更新
+        ProductBaseDO updateObj = BeanUtils.toBean(updateReqVO, ProductBaseDO.class);
+
+        baseMapper.updateById(updateObj);
+
+        List<CheckChannelSaveReqVO> channelReqVOList = updateReqVO.getCheckChannelList();
+        if (CollectionUtil.isNotEmpty(channelReqVOList)) {
+            if (channelReqVOList.get(0).getId() != -1) {
+                checkChannelService.deleteByProductId(baseDO.getId());
+            }
+            for (CheckChannelSaveReqVO channelReqVO : channelReqVOList) {
+                channelReqVO.setId(null);
+                channelReqVO.setProductId(baseDO.getId());
+                checkChannelService.create(channelReqVO);
+            }
+        } else {
+            checkChannelService.deleteByProductId(baseDO.getId());
+        }
+        List<ProductBasePriceSaveReqVO> basePriceList = updateReqVO.getBasePriceList();
+        if (CollectionUtil.isNotEmpty(basePriceList)) {
+            // 删除原规格并添加新规格
+            basePriceService.deleteByProductBaseId(updateObj.getId());
+            for (ProductBasePriceSaveReqVO basePriceSaveReqVO : basePriceList) {
+                basePriceSaveReqVO.setProductBaseId(updateObj.getId());
+                basePriceService.createBasePrice(basePriceSaveReqVO);
+            }
+        }
+    }
+
+    @Override
+    public void deleteBase(Long id) {
+        // 校验存在
+        validateBaseExists(id);
+        basePriceService.deleteByProductBaseId(id);
+        baseMapper.deleteById(id);
+    }
+
+    private ProductBaseDO validateBaseExists(Long id) {
+        ProductBaseDO productBaseDO = baseMapper.selectById(id);
+        if (productBaseDO == null) {
+            throw exception(ErrorCodeConstants.BASE_NOT_EXISTS);
+        }
+        return productBaseDO;
+    }
+
+    @Override
+    public ProductBaseRespVO getBase(Long id) {
+        ProductBaseDO base = baseMapper.selectById(id);
+        ProductBaseRespVO baseRespVO = BeanUtils.toBean(base, ProductBaseRespVO.class);
+        List<CheckChannelRespVO> channelRespVOList = checkChannelService.getCheckChannelByBase(id);
+        List<ProductBasePriceRespVO> priceRespVOList = basePriceService.queryPriceByBase(id);
+        baseRespVO.setCheckChannelList(channelRespVOList);
+        baseRespVO.setBasePriceList(priceRespVOList);
+        return baseRespVO;
+    }
+
+    @Override
+    public PageResult<ProductBaseDO> getBasePage(ProductBasePageReqVO pageReqVO) {
+        //联表查询
+        MPJLambdaWrapper<ProductBaseDO> wrapper = new MPJLambdaWrapperX<ProductBaseDO>()
+                .selectAll(ProductBaseDO.class)
+                .selectAs(ProductBaseDO::getStock, ProductBaseDO::getStock)
+                .likeIfPresent(ProductBaseDO::getName, pageReqVO.getName())
+                .eqIfPresent(ProductBaseDO::getProjectId, pageReqVO.getProjectId())
+                .orderByDesc(ProductBaseDO::getId);
+
+        return baseMapper.selectJoinPage(pageReqVO, ProductBaseDO.class, wrapper);
+    }
+
+    @Override
+    public PageResult<ProductBaseRespVO> queryBasePage(ProductBasePageReqVO pageReqVO) {
+        IPage<ProductBaseRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
+        IPage<ProductBaseRespVO> iPage = baseMapper.queryProductBasePage(page, pageReqVO);
+        iPage.getRecords().forEach(vo -> {
+            List<CheckChannelRespVO> checkChannelList = checkChannelService.getCheckChannelByBase(vo.getId());
+            vo.setCheckChannelList(checkChannelList);
+            // 查询 最低成本价 与 最低销售价
+            List<ProductBasePriceRespVO> basePriceList = basePriceService.queryPriceByBase(vo.getId());
+            vo.setBasePriceList(basePriceList);
+            BigDecimal minCastPrice = BigDecimal.ZERO;
+            BigDecimal minSalePrice = BigDecimal.ZERO;
+            List<ProductBasePriceRespVO> list = basePriceList.stream()
+                    .filter(price -> !Objects.equals(price.getSpecType(), "free"))
+                    .collect(Collectors.toList());
+            if (!list.isEmpty()) {
+                minCastPrice = list.stream().min(Comparator.comparing(ProductBasePriceRespVO::getCostPrice)).get().getCostPrice();
+                minSalePrice = list.stream().min(Comparator.comparing(ProductBasePriceRespVO::getSalePrice)).get().getSalePrice();
+            }
+            vo.setCostPrice(minCastPrice);
+            vo.setSalePrice(minSalePrice);
+        });
+        return new PageResult<>(iPage.getRecords(), iPage.getTotal());
+    }
+
+    @Override
+    public PageResult<ProductBaseRespVO> selectBasePage(ProductBasePageReqVO pageReqVO) {
+        IPage<ProductBaseRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
+        IPage<ProductBaseRespVO> iPage = baseMapper.selectProductBasePage(page, pageReqVO);
+        iPage.getRecords().forEach(vo -> {
+            List<ProductBasePriceRespVO> priceRespVOList = basePriceService.queryPriceByBase(vo.getId());
+            vo.setBasePriceList(priceRespVOList);
+            BigDecimal minCastPrice = BigDecimal.ZERO;
+            BigDecimal minSalePrice = BigDecimal.ZERO;
+            List<ProductBasePriceRespVO> list = priceRespVOList.stream()
+                    .filter(price -> !Objects.equals(price.getSpecType(), "free"))
+                    .collect(Collectors.toList());
+            if (!list.isEmpty()) {
+                minCastPrice = list.stream().min(Comparator.comparing(ProductBasePriceRespVO::getCostPrice)).get().getCostPrice();
+                minSalePrice = list.stream().min(Comparator.comparing(ProductBasePriceRespVO::getSalePrice)).get().getSalePrice();
+            }
+            vo.setCostPrice(minCastPrice);
+            vo.setSalePrice(minSalePrice);
+            List<ResourceDO> resourceList = resourceMapper.getListWithoutExcludeId(vo.getId(), null);
+            vo.setResourceList(BeanUtils.toBean(resourceList, ResourceSimpleRespVO.class));
+        });
+        return new PageResult<>(iPage.getRecords(), iPage.getTotal());
+    }
+
+    @Override
+    public List<ProductBaseRespVO> selectBaseList(ProductBasePageReqVO pageReqVO) {
+        IPage<ProductBaseRespVO> page = new Page<>(-1, -1);
+        IPage<ProductBaseRespVO> iPage = baseMapper.selectProductBasePage(page, pageReqVO);
+        return iPage.getRecords();
+    }
+
+    @Override
+    public List<TreeNode<Long>> getProductBaseTreeList() {
+        List<ProjectDO> projectList = projectService.getProjectList();
+        List<TreeNode<Long>> projectTree = projectList.stream()
+                .map(e -> new TreeNode<>(e.getId(), e.getParentId(), e.getName(), e.getSort()))
+                .collect(Collectors.toList());
+        List<TreeNode<Long>> resultList = new ArrayList<>();
+        resultList.addAll(projectTree);
+        projectTree.forEach(treeNode -> {
+            MPJLambdaWrapper<ProductBaseDO> wrapper = new MPJLambdaWrapperX<ProductBaseDO>()
+                    .selectAll(ProductBaseDO.class)
+                    .innerJoin(ProjectDO.class, ProjectDO::getId, ProductBaseDO::getProjectId)
+                    .eq(ProductBaseDO::getUseStatus, UseStatusEnum.ENABLE.getStatus())
+                    .eq(ProductBaseDO::getProjectId, Long.parseLong(treeNode.getId().toString()))
+                    .groupBy(ProductBaseDO::getId);
+            List<ProductBaseDO> productBaseList = baseMapper.selectJoinList(ProductBaseDO.class, wrapper);
+            if (CollUtil.isNotEmpty(productBaseList)) {
+                List<TreeNode<Long>> productTreeList = productBaseList.stream().map(e -> new TreeNode<>(e.getId(), e.getProjectId(), e.getName(), null)).collect(Collectors.toList());
+                resultList.addAll(productTreeList);
+            }
+        });
+        return resultList;
+    }
+}

+ 70 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/ResourceService.java

@@ -0,0 +1,70 @@
+package com.yc.ship.module.resource.service.resource;
+
+
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.module.resource.controller.admin.resource.vo.ResourceAccessRespVO;
+import com.yc.ship.module.resource.controller.admin.resource.vo.ResourcePageReqVO;
+import com.yc.ship.module.resource.controller.admin.resource.vo.ResourceSaveReqVO;
+import com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 产品资源 Service 接口
+ *
+ * @author 管理员
+ */
+public interface ResourceService {
+
+    /**
+     * 创建产品资源
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createResource(@Valid ResourceSaveReqVO createReqVO);
+
+    /**
+     * 更新产品资源
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateResource(@Valid ResourceSaveReqVO updateReqVO);
+
+    /**
+     * 删除产品资源
+     *
+     * @param id 编号
+     */
+    void deleteResource(Long id);
+
+    /**
+     * 获得产品资源
+     *
+     * @param id 编号
+     * @return 产品资源
+     */
+    ResourceDO getResource(Long id);
+
+    /**
+     * 获得产品资源分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 产品资源分页
+     */
+    PageResult<ResourceDO> getResourcePage(ResourcePageReqVO pageReqVO);
+
+    List<ResourceDO> getSimpleResourceList();
+
+    List<ResourceDO> getResourceByCategoryId(Long categoryId);
+
+    /***
+     *@Description 获取第三方直连资源列表(九凤谷、船舶物资)
+     *@author 李事樯
+     *@date 2024/8/15 20:34
+      *@param supplierId
+     *@return 
+     */
+    List<ResourceAccessRespVO> getProductListByAccessList(String supplierId);
+}

File diff suppressed because it is too large
+ 857 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/ResourceServiceImpl.java


+ 125 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/util/DesUtil.java

@@ -0,0 +1,125 @@
+package com.yc.ship.module.resource.service.resource.util;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.logging.log4j.util.Base64Util;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESKeySpec;
+import java.io.IOException;
+import java.security.SecureRandom;
+
+/**
+ * DesUtil for 同程 SameWay
+ * @Title: DesUtil.java
+ * @Package: com.wisesoft.scenic.util
+ * @Description: TODO
+ * @author: zhoulonggui
+ * @date: 2017年5月17日 下午2:51:24
+ * @version: V1.0
+ */
+public class DesUtil {
+	
+	/** */
+	private static final String DES = "DES";
+	
+	/**
+     * Description 根据键值进行加密
+     * @param data 
+     * @param key  加密键byte数组
+     * @return
+     * @throws Exception
+     */
+	public static String encrypt(String data, String key) throws Exception {
+        /*byte[] bt = encrypt(data.getBytes("UTF-8"), key.getBytes("UTF-8"));
+        String strs = new BASE64Encoder().encode(bt);
+        return strs;*/
+        //System.out.println("新方式加密:" + new String(Base64.encodeBase64(bt)));
+		byte[] bt = encrypt(data.getBytes("UTF-8"), key.getBytes("UTF-8"));
+        String strs = new String(Base64.encodeBase64(bt));
+		return strs;
+    }
+    
+    /**
+     * Description 根据键值进行解密
+     * @param data
+     * @param key  加密键byte数组
+     * @return
+     * @throws IOException
+     * @throws Exception
+     */
+    public static String decrypt(String data, String key) throws Exception,
+            Exception {
+        if (data == null) {
+			return null;
+		}
+        /*BASE64Decoder decoder = new BASE64Decoder();
+        byte[] buf = decoder.decodeBuffer(data);
+        byte[] bt = decrypt(buf,key.getBytes("UTF-8"));
+        return new String(bt, "UTF-8");*/
+        byte[] dataByte = Base64.decodeBase64(data.getBytes("UTF-8"));
+        byte[] btRs = decrypt(dataByte,key.getBytes("UTF-8"));
+        //System.out.println("新方式解密:" + new String(btRs, "UTF-8"));
+        return new String(btRs, "UTF-8");
+    }
+    
+    /**
+     * Description 根据键值进行加密
+     * @param data
+     * @param key  加密键byte数组
+     * @return
+     * @throws Exception
+     */
+    private static byte[] encrypt(byte[] data, byte[] key) throws Exception {
+        // 生成一个可信任的随机数源
+        SecureRandom sr = new SecureRandom();
+        // 从原始密钥数据创建DESKeySpec对象
+        DESKeySpec dks = new DESKeySpec(key);
+        // 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
+        SecretKey securekey = keyFactory.generateSecret(dks);
+        // Cipher对象实际完成加密操作
+        Cipher cipher = Cipher.getInstance(DES);
+        // 用密钥初始化Cipher对象
+        cipher.init(Cipher.ENCRYPT_MODE, securekey, sr);
+        return cipher.doFinal(data);
+    }
+    /**
+     * Description 根据键值进行解密
+     * @param data
+     * @param key  加密键byte数组
+     * @return
+     * @throws Exception
+     */
+    private static byte[] decrypt(byte[] data, byte[] key) throws Exception {
+        // 生成一个可信任的随机数源
+        SecureRandom sr = new SecureRandom();
+        // 从原始密钥数据创建DESKeySpec对象
+        DESKeySpec dks = new DESKeySpec(key);
+        // 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
+        SecretKey securekey = keyFactory.generateSecret(dks);
+        // Cipher对象实际完成解密操作
+        Cipher cipher = Cipher.getInstance(/*"DES/CBC/PKCS5Padding"*/DES);
+        // 用密钥初始化Cipher对象
+        cipher.init(Cipher.DECRYPT_MODE, securekey, sr);
+        return cipher.doFinal(data);
+    }
+    
+    public static void main(String[] args) throws Exception{
+//        try {
+//            String res = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><response><header><resultCode>1010</resultCode><resultMessage>邮件发送失败,请稍后重试!</resultMessage></header></response>";
+//            Document resDoc = DocumentHelper.parseText(res);
+//            Element root = resDoc.getRootElement();
+//            Element header = root.element("header");
+//            String resultCode = header.elementText("resultCode");
+//            System.out.println(resultCode);
+//        }catch (Exception e){
+//            e.printStackTrace();
+//        }
+        System.out.println(Base64Util.encode("123"));
+//        System.out.println(encrypt("111111","tnciEgpo9250iwX5fuJO0bG1"));
+//        System.out.println(decrypt("jBx2+bhFv8BbDVZigUhtvroltKxKY6exLKoAXczhrptBbEwV0tuNWEoto77UoeBoHqcWOZIP5tXKaFucOtHcW/lWi6ynuL5hfFXVx+aSgzWsfaZ51hRQPj3h4B5DnSrYInn0jouTQsGSIQxZS/ugTJaziENsSjPYUFMRpiVEnwBQAkTqwRu85H4Tp3bj5piur6fkNwjn/5d24Q0sk5G2VAIje09Pzc8Q45DnSvj9GuVFbHh3UvaIsXLKlXuX4FS7EQtqEZqFz1UFFWuFMYmG2ihspWtwHZXuTQ3Z2HXNr/QuCBXNG9tpj8vfrM4SYB2RnHCHIxXHzQi0kBWzeAtYXvqWzXUYYiHMvOIGaMxiv9KKzt8R2Rv3iDXB7y7Peb3OHDZYF0OL06Q=","TFD9BEOK"));
+	}
+}

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

@@ -0,0 +1,118 @@
+package com.yc.ship.module.resource.service.resource.util; /**
+ * @author :李事樯
+ * @description:TODO
+ * @date :2024/8/12 15:15
+ **/
+
+
+import cn.hutool.json.JSONUtil;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.*;
+
+public  class EncryptUtils {
+
+    // Base64 ------------------
+    public static String base64Enc(String src) {
+        if (src == null || src.length() == 0 || src.trim().length() == 0) return "";
+        return new String(base64Enc(src.getBytes()));
+    }
+
+    public static String base64Dec(String src) {
+        if (src == null || src.length() == 0 || src.trim().length() == 0) return "";
+        return new String(base64Dec(src.getBytes()));
+    }
+    public static byte[] base64Enc(byte[] bytes) {
+        return Base64.getEncoder().encode(bytes);
+    }
+
+    public static byte[] base64Dec(byte[] bytes) {
+        return Base64.getDecoder().decode(bytes);
+    }
+
+    public static String getMd5(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
+        MessageDigest md5 = MessageDigest.getInstance("MD5");
+        byte[] bytes = md5.digest(text.getBytes(StandardCharsets.UTF_8));
+
+        StringBuilder builder = new StringBuilder();
+
+        for (byte aByte : bytes) {
+            builder.append(Integer.toHexString((0x000000FF & aByte) | 0xFFFFFF00).substring(6));
+        }
+        return builder.toString();
+    }
+
+    public static Map<String, Object> mapIterators(Map<String, Object> map){
+        Map<String, Object> keymap = new TreeMap<String, Object>();
+
+        Set<String> keySet = map.keySet();
+        Iterator<String> iter = keySet.iterator();
+        while (iter.hasNext()) {
+            String key = iter.next();
+            keymap.put(key, map.get(key));
+        }
+        return keymap;
+    }
+
+    public static String mapIterator(Map<String, Object> map){
+        Map<String, Object> keymap = new TreeMap<String, Object>();
+
+        Set<String> keySet = map.keySet();
+        Iterator<String> iter = keySet.iterator();
+        while (iter.hasNext()) {
+            String key = iter.next();
+            keymap.put(key, map.get(key));
+        }
+        return JSONUtil.toJsonStr(keymap);
+    }
+
+    /**
+     * 获取sign
+     * @param params
+     * @param secret
+     * @return
+     */
+    public static String getSign(Map<String, String> params, String secret) {
+        Map<String, String> sortedParams = new TreeMap(params);
+        StringBuilder builder = new StringBuilder();
+        builder.append(secret);
+        Iterator var4 = sortedParams.entrySet().iterator();
+
+        while(var4.hasNext()) {
+            Map.Entry<String, String> param = (Map.Entry)var4.next();
+            builder.append((String)param.getKey()).append((String)param.getValue());
+        }
+
+        builder.append(secret);
+        // md5 加密
+        return md5Hex(builder.toString());
+    }
+    private static String md5Hex(String data) {
+        return toHexString(md5(data));
+    }
+
+    private static byte[] md5(String data) {
+        return getDigest().digest((data.getBytes()));
+    }
+    private static MessageDigest getDigest() {
+        try {
+            return MessageDigest.getInstance("MD5");
+        } catch (NoSuchAlgorithmException var1) {
+            throw new RuntimeException(var1);
+        }
+    }
+
+    private static String toHexString(byte[] b) {
+        StringBuffer sb = new StringBuffer();
+
+        for(int i = 0; i < b.length; ++i) {
+            sb.append("0123456789abcdef".charAt(b[i] >>> 4 & 15));
+            sb.append("0123456789abcdef".charAt(b[i] & 15));
+        }
+        return sb.toString();
+    }
+
+}

+ 143 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/resource/util/MD5Utils.java

@@ -0,0 +1,143 @@
+package com.yc.ship.module.resource.service.resource.util;
+
+import cn.hutool.json.JSONUtil;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+public class MD5Utils {
+	
+	private final static char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+			'a', 'b', 'c', 'd', 'e', 'f' };
+	
+	public static String MD5(String s) {
+		
+		try {
+			byte[] strTemp = s.getBytes("utf-8");
+			MessageDigest mdTemp = MessageDigest.getInstance("MD5"); 
+			mdTemp.update(strTemp);
+			byte[] md = mdTemp.digest();
+			int j = md.length;
+			char str[] = new char[j * 2];
+			int k = 0;
+			for (int i = 0; i < j; i++) {
+				byte byte0 = md[i];
+				str[k++] = hexDigits[byte0 >>> 4 & 0xf];
+				str[k++] = hexDigits[byte0 & 0xf];
+			}
+			return new String(str);
+		} catch (Exception e) {
+			return null;
+		}
+	}
+
+	/**
+	 *生成md5
+	 *@param source
+	 * @return
+	 */
+	public static String getMD5(byte[] source) {
+		String s = null;
+		char[] hexDigits = { // 用来将字节转换成 16 进制表示的字符
+				'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+		try {
+			MessageDigest md = MessageDigest.getInstance("MD5");
+			md.update(source);
+			byte[] tmp = md.digest();          // MD5 的计算结果是一个 128 位的长整数,
+			// 用字节表示就是 16 个字节
+			char[] str = new char[16 * 2];   // 每个字节用 16 进制表示的话,使用两个字符,
+			// 所以表示成 16 进制需要 32 个字符
+			int k = 0;                                // 表示转换结果中对应的字符位置
+			for (int i = 0; i < 16; i++) {    // 从第一个字节开始,对 MD5 的每一个字节
+				// 转换成 16 进制字符的转换
+				byte byte0 = tmp[i];  // 取第 i 个字节
+				str[k++] = hexDigits[byte0 >>> 4 & 0xf];  // 取字节中高 4 位的数字转换,
+				// >>> 为逻辑右移,将符号位一起右移
+				str[k++] = hexDigits[byte0 & 0xf];   // 取字节中低 4 位的数字转换
+			}
+			s = new String(str);  // 换后的结果转换为字符串
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return s;
+	}
+
+	public static String getMd5(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
+		MessageDigest md5 = MessageDigest.getInstance("MD5");
+		byte[] bytes = md5.digest(text.getBytes(StandardCharsets.UTF_8));
+
+		StringBuilder builder = new StringBuilder();
+
+		for (byte aByte : bytes) {
+			builder.append(Integer.toHexString((0x000000FF & aByte) | 0xFFFFFF00).substring(6));
+		}
+		return builder.toString();
+	}
+
+
+	public static String mapIterator(Map<String, Object> map){
+		Map<String, Object> keymap = new TreeMap<String, Object>();
+		Set<String> keySet = map.keySet();
+		Iterator<String> iter = keySet.iterator();
+		while (iter.hasNext()) {
+			String key = iter.next();
+			keymap.put(key, map.get(key));
+		}
+		return JSONUtil.toJsonStr(keymap);
+	}
+
+	/**
+	 * 获取sign
+	 * @param params
+	 * @param secret
+	 * @return
+	 */
+	public static String getSign(Map<String, String> params, String secret) {
+		Map<String, String> sortedParams = new TreeMap(params);
+		StringBuilder builder = new StringBuilder();
+		builder.append(secret);
+		Iterator var4 = sortedParams.entrySet().iterator();
+
+		while(var4.hasNext()) {
+			Map.Entry<String, String> param = (Map.Entry)var4.next();
+			builder.append((String)param.getKey()).append((String)param.getValue());
+		}
+
+		builder.append(secret);
+		// md5 加密
+		return md5Hex(builder.toString());
+	}
+	private static String md5Hex(String data) {
+		return toHexString(md5(data));
+	}
+
+	private static byte[] md5(String data) {
+		return getDigest().digest((data.getBytes()));
+	}
+
+	private static MessageDigest getDigest() {
+		try {
+			return MessageDigest.getInstance("MD5");
+		} catch (NoSuchAlgorithmException var1) {
+			throw new RuntimeException(var1);
+		}
+	}
+
+	private static String toHexString(byte[] b) {
+		StringBuffer sb = new StringBuffer();
+
+		for(int i = 0; i < b.length; ++i) {
+			sb.append("0123456789abcdef".charAt(b[i] >>> 4 & 15));
+			sb.append("0123456789abcdef".charAt(b[i] & 15));
+		}
+		return sb.toString();
+	}
+
+}

+ 19 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/supplier/SupplierServiceImpl.java

@@ -8,8 +8,11 @@ import com.yc.ship.framework.common.util.object.BeanUtils;
 import com.yc.ship.framework.mybatis.core.util.MyBatisUtils;
 import com.yc.ship.module.resource.controller.admin.supplier.vo.*;
 import com.yc.ship.module.resource.dal.dataobject.supplier.SupplierDO;
+import com.yc.ship.module.resource.dal.dataobject.suppliercategory.SupplierCategoryDO;
 import com.yc.ship.module.resource.dal.mysql.supplier.SupplierMapper;
 import com.yc.ship.module.resource.enums.ErrorCodeConstants;
+import com.yc.ship.module.resource.service.suppliercategory.SupplierCategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
@@ -18,6 +21,7 @@ import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static com.yc.ship.module.system.enums.ErrorCodeConstants.USER_IMPORT_LIST_IS_EMPTY;
@@ -34,6 +38,8 @@ public class SupplierServiceImpl implements SupplierService {
 
     @Resource
     private SupplierMapper supplierMapper;
+    @Autowired
+    private SupplierCategoryService supplierCategoryService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -44,6 +50,10 @@ public class SupplierServiceImpl implements SupplierService {
         supplier.setId(id);
         supplier.setDeleted(false);
         supplierMapper.insert(supplier);
+        List<Long> resourceList = createReqVO.getResourceType();
+        if (CollUtil.isNotEmpty(resourceList)) {
+            supplierCategoryService.saveBatch(resourceList, id);
+        }
         // 返回
         return supplier.getId();
     }
@@ -56,6 +66,11 @@ public class SupplierServiceImpl implements SupplierService {
         // 更新
         SupplierDO updateObj = BeanUtils.toBean(updateReqVO, SupplierDO.class);
         supplierMapper.updateById(updateObj);
+        supplierCategoryService.deleteSupplierCategory(updateObj.getId());
+        List<Long> resourceList = updateReqVO.getResourceType();
+        if (CollUtil.isNotEmpty(resourceList)) {
+            supplierCategoryService.saveBatch(resourceList, updateObj.getId());
+        }
     }
 
     @Override
@@ -65,6 +80,7 @@ public class SupplierServiceImpl implements SupplierService {
         validateSupplierExists(id);
         // 删除
         supplierMapper.deleteById(id);
+        supplierCategoryService.deleteSupplierCategory(id);
     }
 
     private void validateSupplierExists(Long id) {
@@ -81,7 +97,10 @@ public class SupplierServiceImpl implements SupplierService {
     @Override
     public SupplierRespVO getSupplierById(Long id) {
         SupplierDO supplierDO = supplierMapper.selectById(id);
+        List<SupplierCategoryDO> list = supplierCategoryService.getSupplierCategoryList(id);
+        List<Long> categoryList = list.stream().map(SupplierCategoryDO::getCategoryId).collect(Collectors.toList());
         SupplierRespVO respVO = BeanUtils.toBean(supplierDO, SupplierRespVO.class);
+        respVO.setResourceType(categoryList);
         return respVO;
     }
 

+ 59 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/suppliercategory/SupplierCategoryService.java

@@ -0,0 +1,59 @@
+package com.yc.ship.module.resource.service.suppliercategory;
+
+
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.module.resource.controller.admin.suppliercategory.vo.SupplierCategoryPageReqVO;
+import com.yc.ship.module.resource.controller.admin.suppliercategory.vo.SupplierCategorySaveReqVO;
+import com.yc.ship.module.resource.dal.dataobject.suppliercategory.SupplierCategoryDO;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 资源供应商与资源类型关联 Service 接口
+ *
+ * @author 管理员
+ */
+public interface SupplierCategoryService {
+
+    /**
+     * 创建资源供应商与资源类型关联
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createSupplierCategory(@Valid SupplierCategorySaveReqVO createReqVO);
+
+    /**
+     * 更新资源供应商与资源类型关联
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateSupplierCategory(@Valid SupplierCategorySaveReqVO updateReqVO);
+
+    /**
+     * 删除资源供应商与资源类型关联
+     *
+     * @param id 编号
+     */
+    void deleteSupplierCategory(Long id);
+
+    /**
+     * 获得资源供应商与资源类型关联
+     *
+     * @param id 编号
+     * @return 资源供应商与资源类型关联
+     */
+    SupplierCategoryDO getSupplierCategory(Long id);
+    List<SupplierCategoryDO> getSupplierCategoryList(Long id);
+
+    /**
+     * 获得资源供应商与资源类型关联分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 资源供应商与资源类型关联分页
+     */
+    PageResult<SupplierCategoryDO> getSupplierCategoryPage(SupplierCategoryPageReqVO pageReqVO);
+
+    void saveBatch(List<Long> resourceList, Long id);
+}

+ 87 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/suppliercategory/SupplierCategoryServiceImpl.java

@@ -0,0 +1,87 @@
+package com.yc.ship.module.resource.service.suppliercategory;
+
+import com.yc.ship.framework.common.pojo.PageResult;
+import com.yc.ship.framework.common.util.object.BeanUtils;
+import com.yc.ship.module.resource.controller.admin.suppliercategory.vo.SupplierCategoryPageReqVO;
+import com.yc.ship.module.resource.controller.admin.suppliercategory.vo.SupplierCategorySaveReqVO;
+import com.yc.ship.module.resource.dal.dataobject.suppliercategory.SupplierCategoryDO;
+import com.yc.ship.module.resource.dal.mysql.suppliercategory.SupplierCategoryMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static com.yc.ship.module.resource.enums.ErrorCodeConstants.SUPPLIER_CATEGORY_NOT_EXISTS;
+
+
+/**
+ * 资源供应商与资源类型关联 Service 实现类
+ *
+ * @author 管理员
+ */
+@Service
+@Validated
+public class SupplierCategoryServiceImpl implements SupplierCategoryService {
+
+    @Resource
+    private SupplierCategoryMapper supplierCategoryMapper;
+
+    @Override
+    public Long createSupplierCategory(SupplierCategorySaveReqVO createReqVO) {
+        // 插入
+        SupplierCategoryDO supplierCategory = BeanUtils.toBean(createReqVO, SupplierCategoryDO.class);
+        supplierCategoryMapper.insert(supplierCategory);
+        // 返回
+        return supplierCategory.getSupplierId();
+    }
+
+    @Override
+    public void updateSupplierCategory(SupplierCategorySaveReqVO updateReqVO) {
+        // 校验存在
+        validateSupplierCategoryExists(updateReqVO.getSupplierId(), updateReqVO.getCategoryId());
+        // 更新
+        SupplierCategoryDO updateObj = BeanUtils.toBean(updateReqVO, SupplierCategoryDO.class);
+        supplierCategoryMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteSupplierCategory(Long supplierId) {
+        // 校验存在
+//        validateSupplierCategoryExists(id);
+        // 删除
+        supplierCategoryMapper.delete(SupplierCategoryDO::getSupplierId, supplierId);
+    }
+
+    private void validateSupplierCategoryExists(Long supplierId, Long categoryId) {
+        if (supplierCategoryMapper.selectOne(SupplierCategoryDO::getSupplierId, supplierId, SupplierCategoryDO::getCategoryId, categoryId) == null) {
+            throw exception(SUPPLIER_CATEGORY_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public SupplierCategoryDO getSupplierCategory(Long id) {
+        return supplierCategoryMapper.selectById(id);
+    }
+
+    @Override
+    public List<SupplierCategoryDO> getSupplierCategoryList(Long id) {
+        return supplierCategoryMapper.selectList(SupplierCategoryDO::getSupplierId, id);
+    }
+
+    @Override
+    public PageResult<SupplierCategoryDO> getSupplierCategoryPage(SupplierCategoryPageReqVO pageReqVO) {
+        return supplierCategoryMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public void saveBatch(List<Long> resourceList, Long supplierId) {
+        for (Long resource : resourceList) {
+            SupplierCategoryDO categoryDO = new SupplierCategoryDO();
+            categoryDO.setCategoryId(resource);
+            categoryDO.setSupplierId(supplierId);
+            supplierCategoryMapper.insert(categoryDO);
+        }
+    }
+}

+ 28 - 0
ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/baseprice/ProductBasePriceMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yc.ship.module.resource.dal.mysql.baseprice.ProductBasePriceMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+    <select id="selectByBaseId" resultType="com.yc.ship.module.resource.controller.admin.baseprice.vo.ProductBasePriceRespVO">
+        SELECT
+            pb.id,
+            pb.product_base_id productBaseId,
+            pb.project_id projectId,
+            pb.sale_price salePrice,
+            pb.spec_type specType,
+            pb.specification_id specificationId,
+            pb.cost_price costPrice,
+            pb.sale_price salePrice,
+            pp.name specificationName
+        FROM product_base_price pb
+        inner join product_project pp on pp.id = pb.specification_id
+        WHERE pb.deleted = 0 and pb.product_base_id = #{baseId}
+        ORDER BY pb.id
+    </select>
+
+</mapper>

+ 117 - 0
ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/productBase/ProductBaseMapper.xml

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yc.ship.module.resource.dal.mysql.productBase.ProductBaseMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+    <select id="queryProductBasePage" resultType="com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseRespVO">
+        SELECT
+            pb.id,
+            pb.`name`,
+            pb.short_name shortName,
+            pb.project_id projectId,
+            pb.resource_category_id resourceCategoryId,
+            pb.first_resource_id firstResourceId,
+            pb.fixed_resource_id fixedResourceId,
+            pb.can_repeat_buy canRepeatBuy,
+            pb.check_type checkType,
+            pb.check_times checkTimes,
+            pb.is_refund isRefund,
+            pb.is_auto_check isAutoCheck,
+            pb.is_buy_check isBuyCheck,
+            pb.start_point startPoint,
+            pb.end_point endPoint,
+            pb.route_id routeId,
+            pb.stock,
+            pb.use_status useStatus,
+            pb.create_time createTime,
+            pc.cate_name resourceName,
+            pp.`name` projectName
+        FROM
+            product_base pb
+                INNER JOIN product_category pc ON pc.id = pb.resource_category_id
+                INNER JOIN product_project pp ON pp.id = pb.project_id
+        WHERE
+            pb.deleted = 0
+            <if test="reqVO.name != null and reqVO.name != ''">
+                AND pb.name like CONCAT('%', #{reqVO.name}, '%')
+            </if>
+            <if test="reqVO.projectId != null and reqVO.projectId != ''">
+                AND pb.project_id = #{reqVO.projectId}
+            </if>
+            <if test="reqVO.useStatus != null and reqVO.useStatus != ''">
+                AND pb.use_status = #{reqVO.useStatus}
+            </if>
+        ORDER BY pb.create_time desc,pb.id
+    </select>
+
+    <select id="selectProductBasePage" resultType="com.yc.ship.module.resource.controller.admin.productBase.vo.ProductBaseRespVO">
+        SELECT
+        DISTINCT
+            pb.id,
+            pb.`name`,
+            pb.short_name shortName,
+            pb.project_id projectId,
+            pb.resource_category_id resourceCategoryId,
+            pb.first_resource_id firstResourceId,
+            pb.fixed_resource_id fixedResourceId,
+            pb.can_repeat_buy canRepeatBuy,
+            pb.check_type checkType,
+            pb.check_times checkTimes,
+            pb.is_refund isRefund,
+            pb.is_auto_check isAutoCheck,
+            pb.is_buy_check isBuyCheck,
+            pb.start_point startPoint,
+            pb.end_point endPoint,
+            pb.route_id routeId,
+            pb.stock,
+            <if test="reqVO.productId != null and reqVO.productId != ''">
+                pg.day_sort daySort,
+            </if>
+            pb.use_status useStatus,
+            pb.create_time createTime,
+            pc.cate_name resourceName,
+            pp.`name` projectName
+        FROM
+            product_base pb
+                INNER JOIN product_project pp ON pp.id = pb.project_id
+                INNER JOIN product_category pc ON pc.id = pb.resource_category_id
+                <if test="reqVO.supplierName != null and reqVO.supplierName != ''">
+                    INNER JOIN product_resource pr ON pr.category_id = pb.resource_category_id
+                    INNER JOIN product_supplier ps ON ps.id = pr.supplier_id
+                </if>
+                <if test="reqVO.productId != null and reqVO.productId != ''">
+                    INNER JOIN product_group pg ON pg.product_base_id = pb.id AND pg.deleted = 0
+                </if>
+                <if test="reqVO.specId != null and reqVO.specId != ''">
+                    INNER JOIN product_base_price basePrice ON basePrice.product_base_id = pb.id
+                </if>
+        WHERE
+            pb.deleted = 0
+            <if test="reqVO.name != null and reqVO.name != ''">
+                AND pb.name like CONCAT('%', #{reqVO.name}, '%')
+            </if>
+            <if test="reqVO.projectId != null and reqVO.projectId != ''">
+                AND pb.project_id = #{reqVO.projectId}
+            </if>
+            <if test="reqVO.useStatus != null and reqVO.useStatus != ''">
+                AND pb.use_status = #{reqVO.useStatus}
+            </if>
+            <if test="reqVO.productId != null and reqVO.productId != ''">
+                AND pg.product_id = #{reqVO.productId}
+            </if>
+            <if test="reqVO.supplierName != null and reqVO.supplierName != ''">
+                AND ps.`name` LIKE CONCAT('%', #{reqVO.supplierName}, '%')
+            </if>
+            <if test="reqVO.specId != null and reqVO.specId != ''">
+                AND basePrice.specification_id = #{reqVO.specId} group by pb.id
+            </if>
+        ORDER BY pb.create_time desc
+    </select>
+
+</mapper>

+ 88 - 0
ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/resource/ResourceMapper.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yc.ship.module.resource.dal.mysql.resource.ResourceMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+    <select id="queryPage" resultType="com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO">
+        SELECT
+            pr.id,ps.is_system_direct accessType,price,pr.is_use,pr.name,pr.source_type,pr.start_time,pr.end_time,
+            pr.third_resource_id,pr.category_id,pc.cate_name as category_name,
+            pr.supplier_id,ps.name as supplier_name,pr.create_time , pr.update_time
+        from product_resource pr
+        LEFT JOIN product_supplier ps on pr.supplier_id = ps.id
+        LEFT JOIN product_category pc on pc.id = pr.category_id
+        where 1=1
+        AND pr.deleted = 0
+        AND ps.deleted = 0
+        AND pc.deleted = 0
+        <if test="param.name != null and param.name !=''">
+            <bind name="bindName" value="'%'+param.name+'%'"/>
+            and pr.name like #{bindName}
+        </if>
+        <if test="param.sourceType != null ">
+            and FIND_IN_SET(pr.source_type,#{param.sourceType})
+        </if>
+        <if test="param.accessType != null ">
+            and FIND_IN_SET(pr.access_type,#{param.accessType})
+        </if>
+        <if test="param.isUse != null">
+            and FIND_IN_SET(pr.is_use,#{param.isUse})
+        </if>
+        <if test="param.categoryId != null and param.categoryId !=''  and param.categoryId !=0 ">
+            and pr.category_id =#{param.categoryId}
+        </if>
+        <if test="param.supplierId != null and param.supplierId !=''">
+            and pr.supplier_id =#{param.supplierId}
+        </if>
+        order by pr.create_time desc , pr.update_time desc
+
+    </select>
+
+    <select id="getByProductBaseId" resultType="com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO">
+        SELECT pr.*, ps.`name` supplierName, ps.is_system_direct accessType FROM product_resource pr
+            INNER JOIN product_group pg ON pg.first_resource_id = pr.id
+            INNER JOIN product_base pb ON pb.id = pg.product_base_id
+            INNER JOIN product_supplier ps ON ps.id = pr.supplier_id
+        WHERE pr.is_use = 1 and pr.deleted = 0 and pb.id = #{id} GROUP BY pr.id
+    </select>
+
+    <select id="getListWithoutExcludeId" resultType="com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO">
+        SELECT pr.*, ps.`name` supplierName, ps.is_system_direct accessType FROM product_resource pr
+            INNER JOIN product_base pb ON pb.resource_category_id = pr.category_id
+        INNER JOIN product_supplier ps ON ps.id = pr.supplier_id
+
+        WHERE pr.is_use = 1
+            AND pr.deleted = 0
+            AND pb.id = #{productBaseId}
+        and (pb.fixed_resource_id = pr.id or pb.fixed_resource_id is null)
+        <if test="excludeId != null">
+            AND pr.id != #{excludeId}
+        </if>
+        ORDER BY case WHEN pr.id = pb.first_resource_id then 1 ELSE 0 end desc,pr.price, IFNUll(pr.stock, 99999) DESC
+    </select>
+
+    <select id="getByResourceId" resultType="com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO">
+        SELECT pr.*, ps.`name` supplierName, ps.is_system_direct accessType FROM product_resource pr
+         INNER JOIN product_supplier ps ON ps.id = pr.supplier_id
+        WHERE pr.is_use = 1 and pr.deleted = 0 and pr.id = #{id} 
+    </select>
+
+    <select id="getResourceByCategoryId" resultType="com.yc.ship.module.resource.dal.dataobject.resource.ResourceDO">
+        SELECT * FROM product_resource
+        WHERE deleted = 0 AND category_id IN (
+            WITH recursive temp AS (
+                SELECT c.* FROM product_category c WHERE c.id = #{categoryId}
+                UNION ALL
+                SELECT c.* FROM product_category c INNER JOIN temp t2 ON t2.id = c.parent_id
+                WHERE c.deleted = 0 AND c.use_status = 1
+            ) SELECT pc.id
+            FROM temp pc )
+
+    </select>
+</mapper>

+ 12 - 0
ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/suppliercategory/SupplierCategoryMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.yc.ship.module.resource.dal.mysql.suppliercategory.SupplierCategoryMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

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

@@ -3,7 +3,7 @@ spring:
     name: yudao-server
 
   profiles:
-    active: local
+    active: lsq
 
   main:
     allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
@@ -67,6 +67,8 @@ flowable:
 mybatis-plus:
   configuration:
     map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    shrink-whitespaces-in-sql: true
   global-config:
     db-config:
       id-type: AUTO # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
@@ -296,6 +298,7 @@ yudao:
       - system_mail_log
       - system_notify_template
       - system_sequence_number
+      - product_supplier_category
     ignore-caches:
       - user_role_ids
       - permission_menu_ids
@@ -328,7 +331,14 @@ yudao:
         key: pLXUGAwK5305
         customer: E77DF18BE109F454A5CD319E44BF5177
 
-debug: false
+debug: true
 # 插件配置 TODO 芋艿:【IOT】需要处理下
 pf4j:
-  pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录
+  pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录
+
+xxl:
+  job:
+    executor:
+      appname: ${spring.application.name} # 执行器 AppName
+      logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径
+    accessToken: default_token # 执行器通讯TOKEN