Эх сурвалжийг харах

Merge remote-tracking branch 'origin/main' into main

# Conflicts:
#	edu-travel-service/edu-travel-service-commodity/pom.xml
#	edu-travel-service/edu-travel-service-upload/src/main/java/edu/travel/upload/web/UploadController.java
zhangwei 1 долоо хоног өмнө
parent
commit
e6ab4bebf4
31 өөрчлөгдсөн 783 нэмэгдсэн , 100 устгасан
  1. 18 0
      edu-travel-adapter/edu-travel-adapter-country/src/main/java/edu/travel/adapter/service/country/LanguageAdapter.java
  2. 5 4
      edu-travel-adapter/edu-travel-adapter-warehouse/src/main/java/edu/travel/adapter/service/warehouse/WarehouseAdapter.java
  3. 3 0
      edu-travel-common/edu-travel-common-datasource/src/main/java/edu/travel/config/FieldMetaObjectHandler.java
  4. 1 0
      edu-travel-common/edu-travel-common-resp/src/main/java/edu/travel/rpc/RPCBaseResponse.java
  5. 55 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/dto/ShopOpinionDto.java
  6. 57 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/dto/ShopOpinionTypeDto.java
  7. 8 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/opinion/ShopOpinionRemoteController.java
  8. 8 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/opinion/ShopOpinionTypeRemoteController.java
  9. 55 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/vo/ShopOpinionTypeVo.java
  10. 43 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/vo/ShopOpinionVo.java
  11. 5 0
      edu-travel-remote/edu-travel-remote-country/src/main/java/edu/travel/remote/ShopLanguageRemoteController.java
  12. 3 2
      edu-travel-remote/edu-travel-remote-warehouse/src/main/java/edu/travel/remote/ShopWarehouseRemoteController.java
  13. 10 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/entity/ShopOpinion.java
  14. 15 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/mapper/ShopOpinionMapper.java
  15. 19 1
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/mapper/ShopOpinionTypeMapper.java
  16. 9 1
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/ShopOpinionService.java
  17. 8 1
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/ShopOpinionTypeService.java
  18. 27 2
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopOpinionServiceImpl.java
  19. 104 3
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopOpinionTypeServiceImpl.java
  20. 81 2
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopOpinionController.java
  21. 91 3
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopOpinionTypeController.java
  22. 36 5
      edu-travel-service/edu-travel-service-commodity/src/main/resources/mapper/ShopOpinionTypeMapper.xml
  23. 0 4
      edu-travel-service/edu-travel-service-country/src/main/java/edu/travel/country/service/impl/BaseCountryServeServiceImpl.java
  24. 4 6
      edu-travel-service/edu-travel-service-country/src/main/java/edu/travel/country/web/ShopCurrencyController.java
  25. 7 7
      edu-travel-service/edu-travel-service-country/src/main/java/edu/travel/country/web/ShopLanguageController.java
  26. 34 0
      edu-travel-service/edu-travel-service-upload/src/main/java/edu/travel/upload/config/MD5Calculator.java
  27. 8 1
      edu-travel-service/edu-travel-service-upload/src/main/java/edu/travel/upload/web/UploadController.java
  28. 5 3
      edu-travel-service/edu-travel-service-warehouse/src/main/java/edu/travel/warehouse/service/ShopWarehouseService.java
  29. 58 51
      edu-travel-service/edu-travel-service-warehouse/src/main/java/edu/travel/warehouse/service/impl/ShopWarehouseServiceImpl.java
  30. 5 4
      edu-travel-service/edu-travel-service-warehouse/src/main/java/edu/travel/warehouse/web/ShopWarehouseController.java
  31. 1 0
      pom.xml

+ 18 - 0
edu-travel-adapter/edu-travel-adapter-country/src/main/java/edu/travel/adapter/service/country/LanguageAdapter.java

@@ -0,0 +1,18 @@
+package edu.travel.adapter.service.country;
+
+import edu.travel.adapter.annotation.AdapterAnnotation;
+import edu.travel.remote.ShopLanguageRemoteController;
+import edu.travel.rpc.RPCBaseResponse;
+import edu.travel.vo.ShopLanguageVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LanguageAdapter {
+    @Autowired
+    private ShopLanguageRemoteController  shopLanguageRemoteController;
+    @AdapterAnnotation
+    public RPCBaseResponse<ShopLanguageVo> getFormId(String id) {
+        return shopLanguageRemoteController.getFormId(id);
+    }
+}

+ 5 - 4
edu-travel-adapter/edu-travel-adapter-warehouse/src/main/java/edu/travel/adapter/service/warehouse/WarehouseAdapter.java

@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 @Component
@@ -39,14 +40,14 @@ public class WarehouseAdapter {
 
     //库房连表新增
     @AdapterAnnotation
-    public RPCBaseResponse<ShopWarehouseVo> saveAllForm(@RequestBody ShopWarehouseSaveDto entity) {
-        return shopWarehouseRemoteController.saveAllForm(entity);
+    public RPCBaseResponse<ShopWarehouseVo> saveAllForm(@RequestBody ShopWarehouseSaveDto entity, HttpServletRequest request) {
+        return shopWarehouseRemoteController.saveAllForm(entity,request);
     }
 
     //库房连表修改
     @AdapterAnnotation
-    public RPCBaseResponse<ShopWarehouseVo> updateWarehouse(@RequestBody ShopWarehouseSaveDto entity) {
-        return shopWarehouseRemoteController.updateWarehouse(entity);
+    public RPCBaseResponse<ShopWarehouseVo> updateWarehouse(@RequestBody ShopWarehouseSaveDto entity,HttpServletRequest request) {
+        return shopWarehouseRemoteController.updateWarehouse(entity,request);
     }
 
     //查询库房详情

+ 3 - 0
edu-travel-common/edu-travel-common-datasource/src/main/java/edu/travel/config/FieldMetaObjectHandler.java

@@ -32,6 +32,9 @@ public class FieldMetaObjectHandler implements MetaObjectHandler {
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
         Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
         Object principal = authentication.getPrincipal();
+        if (principal == null) {
+            return;
+        }
         Long userId = null;
 
         if (!(principal instanceof String && "anonymousUser".equals(principal))) {

+ 1 - 0
edu-travel-common/edu-travel-common-resp/src/main/java/edu/travel/rpc/RPCBaseResponse.java

@@ -15,6 +15,7 @@ public class RPCBaseResponse<T> implements Serializable {
     private T data;
 
     public <T> RPCBaseResponse(int i, String message, T data, int total, int currentPage, int pageSize) {
+
     }
     public static <T> RPCBaseResponse<T> success(T data) {
         return new RPCBaseResponse<>(200, "success", data);

+ 55 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/dto/ShopOpinionDto.java

@@ -0,0 +1,55 @@
+package edu.travel.remote.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import edu.travel.entity.BaseEntity;
+import edu.travel.po.PagePO;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+/**
+ * 意见表
+ */
+@Data
+public class ShopOpinionDto extends PagePO {
+    /**
+     * 意见类型ID
+     */
+    private Long id;
+
+    /**
+     * 国家id
+     */
+    private Long countryId;
+
+    /**
+     * 意见类型id
+     */
+    private Long typeId;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 意见处理,默认0,0未处理,1已处理
+     */
+    private Integer state;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+}

+ 57 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/dto/ShopOpinionTypeDto.java

@@ -0,0 +1,57 @@
+package edu.travel.remote.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import edu.travel.entity.BaseEntity;
+import edu.travel.po.PagePO;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 意见类型
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName(value = "shop_opinion_type")
+public class ShopOpinionTypeDto extends PagePO {
+    /**
+     * 意见类型ID
+     */
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 类型名
+     */
+    @TableField(value = "type_name")
+    private String typeName;
+
+    /**
+     * 类型描述
+     */
+    @TableField(value = "type_description")
+    private String typeDescription;
+
+    /**
+     * 状态 0启用 1禁用
+     */
+    @TableField(value = "status")
+    private String status;
+
+    /**
+     * 其他类型(用户填写)
+     */
+    @TableField(value = "other_type")
+    private String otherType;
+
+    /**
+     * 语言id
+     */
+    @TableField(value = "language_id")
+    private String languageId;
+
+}

+ 8 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/opinion/ShopOpinionRemoteController.java

@@ -0,0 +1,8 @@
+package edu.travel.remote.opinion;
+
+import edu.travel.remote.base.RemoteBaseController;
+import edu.travel.remote.dto.ShopOpinionDto;
+import edu.travel.remote.vo.ShopOpinionVo;
+
+public interface ShopOpinionRemoteController extends RemoteBaseController<ShopOpinionVo, ShopOpinionDto> {
+}

+ 8 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/opinion/ShopOpinionTypeRemoteController.java

@@ -0,0 +1,8 @@
+package edu.travel.remote.opinion;
+
+import edu.travel.remote.base.RemoteBaseController;
+import edu.travel.remote.dto.ShopOpinionTypeDto;
+import edu.travel.remote.vo.ShopOpinionTypeVo;
+
+public interface ShopOpinionTypeRemoteController extends RemoteBaseController<ShopOpinionTypeVo, ShopOpinionTypeDto> {
+}

+ 55 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/vo/ShopOpinionTypeVo.java

@@ -0,0 +1,55 @@
+package edu.travel.remote.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import edu.travel.entity.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Map;
+
+/**
+ * 意见类型
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName(value = "shop_opinion_type")
+public class ShopOpinionTypeVo extends BaseEntity {
+    /**
+     * 意见类型ID
+     */
+    private Long id;
+
+    /**
+     * 类型名
+     */
+    private String typeName;
+
+    /**
+     * 类型描述
+     */
+    private String typeDescription;
+
+    /**
+     * 状态 0启用 1禁用
+     */
+    private String status;
+
+    /**
+     * 其他类型(用户填写)
+     */
+    private String otherType;
+
+    /**
+     * 语言id
+     */
+    private String languageId;
+    /**
+     * map
+     */
+    private Map<String, Object> map;
+}

+ 43 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/vo/ShopOpinionVo.java

@@ -0,0 +1,43 @@
+package edu.travel.remote.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import edu.travel.entity.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 意见表
+ */
+@Data
+public class ShopOpinionVo extends BaseEntity {
+    /**
+     * 意见类型ID
+     */
+    private Long id;
+
+    /**
+     * 国家id
+     */
+    private Long countryId;
+
+    /**
+     * 意见类型id
+     */
+    private Long typeId;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 意见处理,默认0,0未处理,1已处理
+     */
+    private Integer state;
+
+
+}

+ 5 - 0
edu-travel-remote/edu-travel-remote-country/src/main/java/edu/travel/remote/ShopLanguageRemoteController.java

@@ -9,6 +9,7 @@ import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -18,5 +19,9 @@ public interface ShopLanguageRemoteController extends RemoteBaseController<ShopL
     //语言分页
     @GetMapping("/getLanguagePage")
     public RPCBaseResponse<IPage<ShopLanguageVo>> getLanguagePage(ShopLanguageDto shopLanguageDto);
+    @GetMapping("/getFormId")
+    public RPCBaseResponse<ShopLanguageVo> getFormId(@RequestParam(
+            "id"
+    ) String id);
 
 }

+ 3 - 2
edu-travel-remote/edu-travel-remote-warehouse/src/main/java/edu/travel/remote/ShopWarehouseRemoteController.java

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 @FeignClient(path = "/shopWarehouse", name = "warehouse-dev")
@@ -23,7 +24,7 @@ public interface ShopWarehouseRemoteController extends RemoteBaseController<Shop
     @GetMapping("/getWarehouseTenantRole")
     public RPCBaseResponse<List<ShopWarehouseStaffVo>> getWarehouseTenantRole(String id);
     @PostMapping("/saveAllForm")
-    public RPCBaseResponse<ShopWarehouseVo> saveAllForm(@RequestBody ShopWarehouseSaveDto entity);
+    public RPCBaseResponse<ShopWarehouseVo> saveAllForm(@RequestBody ShopWarehouseSaveDto entity, HttpServletRequest request);
     @PostMapping("/updateWarehouse")
-    public RPCBaseResponse<ShopWarehouseVo> updateWarehouse(@RequestBody ShopWarehouseSaveDto entity);
+    public RPCBaseResponse<ShopWarehouseVo> updateWarehouse(@RequestBody ShopWarehouseSaveDto entity,HttpServletRequest request);
 }

+ 10 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/entity/ShopOpinion.java

@@ -5,7 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.util.Date;
+import java.util.Map;
 
+import edu.travel.annotation.LinkOne;
+import edu.travel.commodity.mapper.ShopOpinionTypeMapper;
+import edu.travel.commodity.service.ShopOpinionTypeService;
 import edu.travel.entity.BaseEntity;
 import lombok.AllArgsConstructor;
 import lombok.Data;
@@ -48,6 +52,12 @@ public class ShopOpinion extends BaseEntity {
      */
     @TableField(value = "`state`")
     private Integer state;
+    /**
+     * map
+     */
+    @TableField(exist = false)
+    @LinkOne(linkField = "typeId", linkMapper = ShopOpinionTypeMapper.class, linkPrimaryField = "id")
+    private Map<String, Object> map;
 
 
 }

+ 15 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/mapper/ShopOpinionMapper.java

@@ -1,7 +1,22 @@
 package edu.travel.commodity.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import edu.travel.commodity.entity.ShopOpinion;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 public interface ShopOpinionMapper extends BaseMapper<ShopOpinion> {
+    @Select({
+            "<script>",
+            "SELECT so.*, sot.type_name, sot.type_description ",
+            "FROM shop_opinion so ",
+            "LEFT JOIN shop_opinion_type sot ON so.type_id = sot.id ",
+            "<where>",
+            "${ew.sqlSegment}",
+            "</where>",
+            "</script>"
+    })
+    IPage<ShopOpinion> selectOpinionsWithType(IPage<ShopOpinion> page, @Param("ew") LambdaQueryWrapper<ShopOpinion> queryWrapper);
 }

+ 19 - 1
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/mapper/ShopOpinionTypeMapper.java

@@ -2,6 +2,24 @@ package edu.travel.commodity.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import edu.travel.commodity.entity.ShopOpinionType;
+import edu.travel.remote.vo.ShopOpinionTypeVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ShopOpinionTypeMapper extends BaseMapper<ShopOpinionType> {
-}
+
+    // 查询带有语言信息的意见类型
+    List<ShopOpinionType> selectOpinionTypeWithLanguage(
+            @Param("typeName") String typeName,
+            @Param("status") String status,
+            @Param("pageSize") int pageSize,
+            @Param("offset") int offset
+    );
+
+    // 统计符合条件的意见类型数量
+    int countAll(
+            @Param("typeName") String typeName,
+            @Param("status") String status
+    );
+}

+ 9 - 1
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/ShopOpinionService.java

@@ -1,8 +1,16 @@
 package edu.travel.commodity.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import edu.travel.commodity.entity.ShopOpinion;
 import com.baomidou.mybatisplus.extension.service.IService;
-public interface ShopOpinionService extends IService<ShopOpinion>{
+import edu.travel.remote.dto.ShopOpinionDto;
+import edu.travel.remote.vo.ShopOpinionVo;
+import edu.travel.rpc.RPCBaseResponse;
+
+import java.util.List;
 
+public interface ShopOpinionService extends IService<ShopOpinion>{
 
+//分页连表
+    RPCBaseResponse<List<ShopOpinion>> getAllFormPage(ShopOpinionDto dto);
 }

+ 8 - 1
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/ShopOpinionTypeService.java

@@ -1,8 +1,15 @@
 package edu.travel.commodity.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import edu.travel.commodity.entity.ShopOpinionType;
 import com.baomidou.mybatisplus.extension.service.IService;
-public interface ShopOpinionTypeService extends IService<ShopOpinionType>{
+import edu.travel.remote.dto.ShopOpinionTypeDto;
+import edu.travel.remote.vo.ShopOpinionTypeVo;
+import edu.travel.rpc.RPCBaseResponse;
+
+import java.util.List;
 
+public interface ShopOpinionTypeService extends IService<ShopOpinionType>{
 
+    RPCBaseResponse<IPage<ShopOpinionTypeVo>> getAllOpinionTypeLanguage(ShopOpinionTypeDto dto);
 }

+ 27 - 2
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopOpinionServiceImpl.java

@@ -1,12 +1,37 @@
 package edu.travel.commodity.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import edu.travel.commodity.entity.ShopOpinion;
 import edu.travel.commodity.mapper.ShopOpinionMapper;
 import edu.travel.commodity.service.ShopOpinionService;
+import edu.travel.remote.dto.ShopOpinionDto;
+import edu.travel.remote.vo.ShopOpinionVo;
+import edu.travel.rpc.RPCBaseResponse;
+import edu.travel.service.SysServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
 @Service
-public class ShopOpinionServiceImpl extends ServiceImpl<ShopOpinionMapper, ShopOpinion> implements ShopOpinionService {
-
+public class ShopOpinionServiceImpl extends SysServiceImpl<ShopOpinionMapper, ShopOpinion> implements ShopOpinionService {
+    @Override
+    public RPCBaseResponse<List<ShopOpinion>> getAllFormPage(ShopOpinionDto dto) {
+        // 创建 LambdaQueryWrapper 对象
+        LambdaQueryWrapper<ShopOpinion> queryWrapper = new LambdaQueryWrapper<>();
+        // 动态添加查询条件
+        queryWrapper.eq(dto.getCountryId() != null,ShopOpinion::getCountryId, dto.getCountryId());
+        queryWrapper.eq(dto.getTypeId() != null,ShopOpinion::getTypeId, dto.getTypeId());
+        queryWrapper.eq(dto.getState() != null,ShopOpinion::getState, dto.getState());
+        // 使用模糊查询
+        queryWrapper.like(dto.getDescription() != null && !dto.getDescription().isEmpty(),ShopOpinion::getDescription, dto.getDescription());
+        // 分页查询
+        IPage<ShopOpinion> page = new Page<>(dto.getCurrentPage(), dto.getPageSize());
+        // 使用自定义方法查询带联表的结果
+        IPage<ShopOpinion> resultPage = super.getPageLink(queryWrapper,page);
+        // 返回结果
+        return new RPCBaseResponse<>(200, "SUCCESS", resultPage.getRecords());
+    }
 }

+ 104 - 3
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopOpinionTypeServiceImpl.java

@@ -1,12 +1,113 @@
 package edu.travel.commodity.service.impl;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import edu.travel.adapter.service.country.LanguageAdapter;
 import edu.travel.commodity.entity.ShopOpinionType;
 import edu.travel.commodity.mapper.ShopOpinionTypeMapper;
 import edu.travel.commodity.service.ShopOpinionTypeService;
+import edu.travel.remote.dto.ShopOpinionTypeDto;
+import edu.travel.remote.vo.ShopOpinionTypeVo;
+import edu.travel.rpc.RPCBaseResponse;
+import edu.travel.service.SysServiceImpl;
+import edu.travel.vo.ShopLanguageVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+
 @Service
-public class ShopOpinionTypeServiceImpl extends ServiceImpl<ShopOpinionTypeMapper, ShopOpinionType> implements ShopOpinionTypeService {
+public class ShopOpinionTypeServiceImpl extends SysServiceImpl<ShopOpinionTypeMapper, ShopOpinionType> implements ShopOpinionTypeService {
+
+    @Autowired
+    private ShopOpinionTypeMapper shopOpinionTypeMapper;
+    @Autowired
+    private LanguageAdapter languageAdapter;
+
+    /**
+     * 分页动态查询(联表)
+     * @param dto
+     * @return
+     */
+    public RPCBaseResponse<IPage<ShopOpinionTypeVo>> getAllOpinionTypeLanguage(ShopOpinionTypeDto dto) {
+        // 创建分页对象
+        Page<ShopOpinionTypeVo> shopOpinionTypeVoPage = new Page<>(dto.getCurrentPage(), dto.getPageSize());
+
+        // 查询意见类型数据
+        List<ShopOpinionType> opinionTypes = shopOpinionTypeMapper.selectOpinionTypeWithLanguage(
+                dto.getTypeName(),
+                dto.getStatus(),
+                dto.getPageSize(),
+                (dto.getCurrentPage() - 1) * dto.getPageSize()
+        );
+
+        // 转换为 ShopOpinionTypeVo 列表
+        List<ShopOpinionTypeVo> opinionTypeList = opinionTypes.stream()
+                .map(this::convertToVo) // 确保这里的 convertToVo 方法返回 `ShopOpinionTypeVo`
+                .collect(Collectors.toList());
+
+        int total = shopOpinionTypeMapper.countAll(dto.getTypeName(), dto.getStatus());
+
+        // 提取语言id
+        Set<String> languageIds = opinionTypeList.stream()
+                .map(ShopOpinionTypeVo::getLanguageId)
+                .collect(Collectors.toSet());
+
+        // 查询语言信息
+        Map<String, ShopOpinionTypeVo> shopOpinionTypeVoMap = fetchLanguageData(languageIds);
+
+        // 将语言信息放入对应的仓库列表中
+        for (ShopOpinionTypeVo opinionTypeVo : opinionTypeList) {
+            if (opinionTypeVo.getMap() == null) {
+                opinionTypeVo.setMap(new HashMap<>()); // 确保 map 被初始化
+            }
+            if (shopOpinionTypeVoMap.containsKey(opinionTypeVo.getLanguageId())) {
+                opinionTypeVo.getMap().put("language", shopOpinionTypeVoMap.get(opinionTypeVo.getLanguageId()));
+            }
+        }
+
+        // 封装返回
+        IPage<ShopOpinionTypeVo> pageVoLink = new Page<>();
+        pageVoLink.setRecords(opinionTypeList);
+        pageVoLink.setTotal(total);
+        pageVoLink.setCurrent(dto.getCurrentPage());
+        pageVoLink.setSize(dto.getPageSize());
+
+        return new RPCBaseResponse<>(200, "SUCCESS", pageVoLink);
+    }
+
+    // 将 ShopOpinionType 转换为 ShopOpinionTypeVo 的方法
+    private ShopOpinionTypeVo convertToVo(ShopOpinionType opinionType) {
+        ShopOpinionTypeVo vo = new ShopOpinionTypeVo();
+        vo.setId(opinionType.getId());
+        vo.setTypeName(opinionType.getTypeName());
+        vo.setLanguageId(opinionType.getLanguageId());
+        // 设置其他字段,如果有的话
+        return vo;
+    }
 
-}
+    // 查询语言数据的方法
+    private Map<String, ShopOpinionTypeVo> fetchLanguageData(Set<String> languageIds) {
+        // 这里是伪代码,您需要实现实际的语言数据查询逻辑
+        Map<String, ShopOpinionTypeVo> languageMap = new HashMap<>();
+        // 假设有一个适配器可以获取语言信息
+        for (String languageId : languageIds) {
+            ShopLanguageVo languageVo = languageAdapter.getFormId(languageId).getData();
+            if (languageVo != null) {
+                ShopOpinionTypeVo opinionTypeVo = new ShopOpinionTypeVo();
+                opinionTypeVo.setLanguageId(languageId);
+                opinionTypeVo.setMap(new HashMap<>()); // 初始化 map
+                opinionTypeVo.getMap().put("languageNameZh", languageVo.getLanguageNameZh());
+                opinionTypeVo.getMap().put("languageNameEn", languageVo.getLanguageNameEn());
+                opinionTypeVo.getMap().put("languageNameLocal", languageVo.getLanguageNameLocal());
+                languageMap.put(languageId, opinionTypeVo);
+            }
+        }
+        return languageMap;
+    }
+}

+ 81 - 2
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopOpinionController.java

@@ -1,23 +1,102 @@
 package edu.travel.commodity.web;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import edu.travel.commodity.entity.ShopOpinion;
 import edu.travel.commodity.service.ShopOpinionService;
+import edu.travel.remote.dto.ShopOpinionDto;
+import edu.travel.remote.opinion.ShopOpinionRemoteController;
+import edu.travel.remote.vo.ShopOpinionVo;
+import edu.travel.rpc.RPCBaseResponse;
+import edu.travel.web.BaseController;
+import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.*;
 
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.util.List;
+
 /**
 * 意见表(shop_opinion)表控制层
 *
 * @author xxxxx
 */
 @RestController
-@RequestMapping("/shop_opinion")
-public class ShopOpinionController {
+@RequestMapping("/shopOpinion")
+public class ShopOpinionController extends BaseController<ShopOpinion> implements ShopOpinionRemoteController {
 /**
 * 服务对象
 */
     @Autowired
     private ShopOpinionService shopOpinionService;
+    /**
+     * 分页查询(连表)
+     */
+    @GetMapping("/getAllFormPage")
+    public RPCBaseResponse<List<ShopOpinion>> getAllFormPage(ShopOpinionDto dto) {
+        return shopOpinionService.getAllFormPage(dto);
+     }
+    /**
+     *获取意见
+     */
+    @Override
+    @GetMapping("/getFormId")
+    public RPCBaseResponse<ShopOpinionVo> getFormId(String id) {
+        RPCBaseResponse<ShopOpinion> shopOpinionRPCBaseResponse = super.getId(id);
+        RPCBaseResponse<ShopOpinionVo> shopOpinionVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopOpinionRPCBaseResponse, shopOpinionVoRPCBaseResponse);
+        return shopOpinionVoRPCBaseResponse;
+    }
+
+    /**
+     * 更新意见
+     */
+    @Override
+    @PostMapping("/updateTargetFormId")
+    public RPCBaseResponse<ShopOpinionVo> updateTargetFormId(ShopOpinionDto entity) {
+        ShopOpinion shopOpinion = new ShopOpinion();
+        BeanUtils.copyProperties(entity, shopOpinion);
+        RPCBaseResponse<ShopOpinion> shopOpinionRPCBaseResponse = super.updateTargetById(shopOpinion);
+        RPCBaseResponse<ShopOpinionVo> shopOpinionVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopOpinionRPCBaseResponse, shopOpinionVoRPCBaseResponse);
+        return shopOpinionVoRPCBaseResponse;
+    }
+
+    /**
+     * 新增意见
+     */
+    @Override
+    @PostMapping("/saveFormTarget")
+    public RPCBaseResponse<ShopOpinionVo> saveFormTarget(ShopOpinionDto entity) {
+        ShopOpinion shopOpinion = new ShopOpinion();
+        BeanUtils.copyProperties(entity, shopOpinion);
+        RPCBaseResponse<ShopOpinion> shopOpinionRPCBaseResponse = super.saveTarget(shopOpinion);
+        RPCBaseResponse<ShopOpinionVo> shopOpinionVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopOpinionRPCBaseResponse, shopOpinionVoRPCBaseResponse);
+        return shopOpinionVoRPCBaseResponse;
+    }
+
+    /**
+     * 删除意见
+     */
+    @Override
+    @PostMapping("/deleteTargetFormId")
+    public RPCBaseResponse<ShopOpinionVo> deleteTargetFormId(List<String> ids) {
+        RPCBaseResponse<ShopOpinion> shopOpinionRPCBaseResponse = super.deleteTargetById(ids);
+        RPCBaseResponse<ShopOpinionVo> shopOpinionVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopOpinionRPCBaseResponse, shopOpinionVoRPCBaseResponse);
+        return shopOpinionVoRPCBaseResponse;
+    }
 
+    /**
+     * 获取所有意见
+     */
+    @Override
+    @GetMapping("/getAllForm")
+    public RPCBaseResponse<List<ShopOpinionVo>> getAllForm() {
+        RPCBaseResponse<List<ShopOpinion>> countryRPCBaseResponse = super.listAll();
+        RPCBaseResponse<List<ShopOpinionVo>> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(countryRPCBaseResponse, baseCountryVoRPCBaseResponse);
+        return baseCountryVoRPCBaseResponse;
+    }
 
 }

+ 91 - 3
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopOpinionTypeController.java

@@ -1,10 +1,20 @@
 package edu.travel.commodity.web;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import edu.travel.commodity.entity.ShopOpinionType;
 import edu.travel.commodity.service.ShopOpinionTypeService;
+import edu.travel.remote.dto.ShopOpinionTypeDto;
+import edu.travel.remote.opinion.ShopOpinionTypeRemoteController;
+import edu.travel.remote.vo.ShopOpinionTypeVo;
+import edu.travel.rpc.RPCBaseResponse;
+import edu.travel.web.BaseController;
+import org.springframework.beans.BeanUtils;
 import org.springframework.web.bind.annotation.*;
 
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.util.List;
+
 /**
 * 意见类型(shop_opinion_type)表控制层
 *
@@ -12,12 +22,90 @@ import org.springframework.beans.factory.annotation.Autowired;
 */
 @RestController
 @RequestMapping("/shop_opinion_type")
-public class ShopOpinionTypeController {
+public class ShopOpinionTypeController extends BaseController<ShopOpinionType> implements ShopOpinionTypeRemoteController {
 /**
 * 服务对象
 */
-    @Autowired
-    private ShopOpinionTypeService shopOpinionTypeService;
+@Autowired
+private ShopOpinionTypeService shopOpinionTypeService;
+    /**
+     * 连表查询意见类型
+     */
+    @GetMapping("/getAllOpinionTypeLanguage")
+    public RPCBaseResponse<IPage<ShopOpinionTypeVo>> getAllOpinionTypeLanguage(ShopOpinionTypeDto dto) {
+        return shopOpinionTypeService.getAllOpinionTypeLanguage(dto);
+    }
+
+    /**
+     * 通过id查询意见类型
+     * @param id
+     * @return
+     */
+    @Override
+    @GetMapping("/getFormId")
+    public RPCBaseResponse<ShopOpinionTypeVo> getFormId(String id) {
+        RPCBaseResponse<ShopOpinionType> shopOpinionTypeRPCBaseResponse = super.getId(id);
+        RPCBaseResponse<ShopOpinionTypeVo> shopOpinionTypeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopOpinionTypeRPCBaseResponse, shopOpinionTypeVoRPCBaseResponse);
+        return shopOpinionTypeVoRPCBaseResponse;
+    }
+
+    /**
+     * 更新意见类型
+     * @param entity
+     * @return
+     */
+    @Override
+    @PostMapping("/updateFormTarget")
+    public RPCBaseResponse<ShopOpinionTypeVo> updateTargetFormId(ShopOpinionTypeDto entity) {
+        ShopOpinionType shopOpinionType = new ShopOpinionType();
+        BeanUtils.copyProperties(entity, shopOpinionType);
+        RPCBaseResponse<ShopOpinionType> shopOpinionTypeRPCBaseResponse = super.updateTargetById(shopOpinionType);
+        RPCBaseResponse<ShopOpinionTypeVo> shopOpinionTypeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopOpinionTypeRPCBaseResponse, shopOpinionTypeVoRPCBaseResponse);
+        return shopOpinionTypeVoRPCBaseResponse;
+    }
+
+    /**
+     * 新增意见类型
+     * @param entity
+     * @return
+     */
+    @Override
+    @PostMapping("/saveFormTarget")
+    public RPCBaseResponse<ShopOpinionTypeVo> saveFormTarget(ShopOpinionTypeDto entity) {
+        ShopOpinionType shopOpinionType = new ShopOpinionType();
+        BeanUtils.copyProperties(entity, shopOpinionType);
+        RPCBaseResponse<ShopOpinionType> shopOpinionTypeRPCBaseResponse = super.saveTarget(shopOpinionType);
+        RPCBaseResponse<ShopOpinionTypeVo> shopOpinionTypeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopOpinionTypeRPCBaseResponse, shopOpinionTypeVoRPCBaseResponse);
+        return shopOpinionTypeVoRPCBaseResponse;
+    }
 
+    /**
+     * 删除意见类型
+     * @param ids
+     * @return
+     */
+    @Override
+    @DeleteMapping("/deleteFormId")
+    public RPCBaseResponse<ShopOpinionTypeVo> deleteTargetFormId(List<String> ids) {
+        RPCBaseResponse<ShopOpinionType> shopOpinionTypeRPCBaseResponse = super.deleteTargetById(ids);
+        RPCBaseResponse<ShopOpinionTypeVo> shopOpinionTypeVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopOpinionTypeRPCBaseResponse, shopOpinionTypeVoRPCBaseResponse);
+        return shopOpinionTypeVoRPCBaseResponse;
+    }
 
+    /**
+     * 获取所有意见类型信息
+     * @return
+     */
+    @Override
+    @GetMapping("/getAllForm")
+    public RPCBaseResponse<List<ShopOpinionTypeVo>> getAllForm() {
+        RPCBaseResponse<List<ShopOpinionType>> countryRPCBaseResponse = super.listAll();
+        RPCBaseResponse<List<ShopOpinionTypeVo>> baseCountryVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(countryRPCBaseResponse, baseCountryVoRPCBaseResponse);
+        return baseCountryVoRPCBaseResponse;
+    }
 }

+ 36 - 5
edu-travel-service/edu-travel-service-commodity/src/main/resources/mapper/ShopOpinionTypeMapper.xml

@@ -1,9 +1,10 @@
 <?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="edu.travel.commodity.mapper.ShopOpinionTypeMapper">
+
   <resultMap id="BaseResultMap" type="edu.travel.commodity.entity.ShopOpinionType">
     <!--@mbg.generated-->
-    <!--@Table shop_opinion_type-->
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="type_name" jdbcType="VARCHAR" property="typeName" />
     <result column="type_description" jdbcType="VARCHAR" property="typeDescription" />
@@ -17,9 +18,39 @@
     <result column="project" jdbcType="VARCHAR" property="project" />
     <result column="language_id" jdbcType="BIGINT" property="languageId" />
   </resultMap>
+
   <sql id="Base_Column_List">
-    <!--@mbg.generated-->
-    id, type_name, create_time, update_time, other_type, create_user_id, update_user_id, language_id,type_description,status,
-    delete_flag, project
+    id, type_name, create_time, update_time, other_type, create_user_id, update_user_id, language_id, type_description, status,
+        delete_flag, project
   </sql>
-</mapper>
+
+  <select id="selectOpinionTypeWithLanguage" resultMap="BaseResultMap">
+    SELECT sot.*
+    FROM shop_opinion_type sot
+    LEFT JOIN shop_language sl ON sot.language_id = sl.id
+    <where>
+      <if test="typeName != null and typeName != ''">
+        AND sot.type_name LIKE CONCAT('%', #{typeName}, '%')
+      </if>
+      <if test="status != null">
+        AND sot.status = #{status}
+      </if>
+    </where>
+    LIMIT #{pageSize} OFFSET #{offset}
+  </select>
+
+  <select id="countAll" resultType="int">
+    SELECT COUNT(*)
+    FROM shop_opinion_type sot
+    <where>
+      <if test="typeName != null and typeName != ''">
+        AND sot.type_name LIKE CONCAT('%', #{typeName}, '%')
+      </if>
+      <if test="status != null">
+        AND sot.status = #{status}
+      </if>
+    </where>
+  </select>
+
+
+</mapper>

+ 0 - 4
edu-travel-service/edu-travel-service-country/src/main/java/edu/travel/country/service/impl/BaseCountryServeServiceImpl.java

@@ -1,8 +1,6 @@
 package edu.travel.country.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 
 import edu.travel.country.entity.BaseCountry;
 import edu.travel.country.entity.BaseCountryServe;
@@ -25,8 +23,6 @@ import java.util.*;
 public class BaseCountryServeServiceImpl extends SysServiceImpl<BaseCountryServeMapper, BaseCountryServe> implements BaseCountryServeService {
     @Autowired
     private BaseCountryMapper baseCountryMapper;
-    @Autowired
-    private ShopCurrencyMapper shopCurrencyMapper;
 
 //分页连表
 @Override

+ 4 - 6
edu-travel-service/edu-travel-service-country/src/main/java/edu/travel/country/web/ShopCurrencyController.java

@@ -1,6 +1,5 @@
 package edu.travel.country.web;
 
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import edu.travel.country.entity.ShopCurrency;
 import edu.travel.country.service.ShopCurrencyService;
@@ -32,7 +31,6 @@ public class ShopCurrencyController extends BaseController<ShopCurrency> impleme
     /**
      * 分页
      */
-
     @GetMapping("/getCurrencyPage")
     public RPCBaseResponse<IPage<ShopCurrencyVo>> getCurrencyPage(ShopCurrencyDto dto) {
         return shopCurrencyService.getCurrencyPage(dto);
@@ -58,7 +56,7 @@ public class ShopCurrencyController extends BaseController<ShopCurrency> impleme
      * @return
      */
     @Override
-    @PostMapping("/updateCurrencyFormId")
+    @PostMapping("/updateTargetFormId")
     public RPCBaseResponse<ShopCurrencyVo> updateTargetFormId(@RequestBody ShopCurrencyDto entity) {
         ShopCurrency shopCurrency = new ShopCurrency();
         BeanUtils.copyProperties(entity, shopCurrency);
@@ -74,7 +72,7 @@ public class ShopCurrencyController extends BaseController<ShopCurrency> impleme
      * @return
      */
     @Override
-    @PostMapping("/saveCurrencyForm")
+    @PostMapping("/saveFormTarget")
     public RPCBaseResponse<ShopCurrencyVo> saveFormTarget(@RequestBody ShopCurrencyDto entity) {
         ShopCurrency shopCurrency = new ShopCurrency();
         BeanUtils.copyProperties(entity, shopCurrency);
@@ -90,7 +88,7 @@ public class ShopCurrencyController extends BaseController<ShopCurrency> impleme
      * @return
      */
     @Override
-    @PostMapping("/deleteCurrencyFormId")
+    @PostMapping("/deleteTargetFormId")
     public RPCBaseResponse<ShopCurrencyVo> deleteTargetFormId(@RequestBody List<String> ids) {
         RPCBaseResponse<ShopCurrency> shopCurrencyRPCBaseResponse = super.deleteTargetById(ids);
         RPCBaseResponse<ShopCurrencyVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
@@ -103,7 +101,7 @@ public class ShopCurrencyController extends BaseController<ShopCurrency> impleme
      * @return
      */
     @Override
-    @GetMapping("/listCurrencyForm")
+    @GetMapping("/getAllForm")
     public RPCBaseResponse<List<ShopCurrencyVo>> getAllForm() {
         RPCBaseResponse<List<ShopCurrency>> listRPCBaseResponse = super.listAll();
         RPCBaseResponse<List<ShopCurrencyVo>> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();

+ 7 - 7
edu-travel-service/edu-travel-service-country/src/main/java/edu/travel/country/web/ShopLanguageController.java

@@ -20,7 +20,7 @@ import java.util.List;
 * @author xxxxx
 */
 @RestController
-@RequestMapping("/shop_language")
+@RequestMapping("/shopLanguage")
 public class ShopLanguageController extends BaseController<ShopLanguage> implements ShopLanguageRemoteController {
     /**
      * 服务对象
@@ -42,8 +42,8 @@ public class ShopLanguageController extends BaseController<ShopLanguage> impleme
      * @return
      */
     @Override
-    @GetMapping("/getLanguageFormId")
-    public RPCBaseResponse<ShopLanguageVo> getFormId(String id) {
+    @GetMapping("/getFormId")
+    public RPCBaseResponse<ShopLanguageVo> getFormId(@RequestParam("id") String id) {
         RPCBaseResponse<ShopLanguage> languageRPCBaseResponse = super.getId(id);
         RPCBaseResponse<ShopLanguageVo> shopLanguageVoRPCBaseResponse = new RPCBaseResponse<>();
         BeanUtils.copyProperties(languageRPCBaseResponse, shopLanguageVoRPCBaseResponse);
@@ -56,7 +56,7 @@ public class ShopLanguageController extends BaseController<ShopLanguage> impleme
      * @return
      */
     @Override
-    @PostMapping("/updateLanguageFormId")
+    @PostMapping("/updateTargetFormId")
     public RPCBaseResponse<ShopLanguageVo> updateTargetFormId(@RequestBody ShopLanguageDto entity) {
         ShopLanguage shopLanguage = new ShopLanguage();
         BeanUtils.copyProperties(entity, shopLanguage);
@@ -72,7 +72,7 @@ public class ShopLanguageController extends BaseController<ShopLanguage> impleme
      * @return
      */
     @Override
-    @PostMapping("/saveLanguageForm")
+    @PostMapping("/saveFormTarget")
     public RPCBaseResponse<ShopLanguageVo> saveFormTarget(@RequestBody ShopLanguageDto entity) {
         ShopLanguage shopLanguage = new ShopLanguage();
         BeanUtils.copyProperties(entity, shopLanguage);
@@ -88,7 +88,7 @@ public class ShopLanguageController extends BaseController<ShopLanguage> impleme
      * @return
      */
     @Override
-    @PostMapping("/deleteLanguageFormId")
+    @PostMapping("/deleteTargetFormId")
     public RPCBaseResponse<ShopLanguageVo> deleteTargetFormId(@RequestBody List<String> ids) {
         RPCBaseResponse<ShopLanguage> languageRPCBaseResponse = super.deleteTargetById(ids);
         RPCBaseResponse<ShopLanguageVo> shopLanguageVoRPCBaseResponse = new RPCBaseResponse<>();
@@ -101,7 +101,7 @@ public class ShopLanguageController extends BaseController<ShopLanguage> impleme
      * @return
      */
     @Override
-    @GetMapping("/LanguagelistForm")
+    @GetMapping("/getAllForm")
     public RPCBaseResponse<List<ShopLanguageVo>> getAllForm() {
         RPCBaseResponse<List<ShopLanguage>> listRPCBaseResponse = super.listAll();
         RPCBaseResponse<List<ShopLanguageVo>> shopLanguageVoRPCBaseResponse = new RPCBaseResponse<>();

+ 34 - 0
edu-travel-service/edu-travel-service-upload/src/main/java/edu/travel/upload/config/MD5Calculator.java

@@ -0,0 +1,34 @@
+package edu.travel.upload.config;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class MD5Calculator {
+
+    public static String calculateMD5(byte[] data) {
+        try {
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            byte[] hashBytes = md.digest(data);
+            return bytesToHex(hashBytes);
+        } catch (NoSuchAlgorithmException e) {
+            // MD5算法在所有Java实现中都应可用,此处异常理论上不会发生
+            throw new RuntimeException("MD5 algorithm not available", e);
+        }
+    }
+
+    private static String bytesToHex(byte[] bytes) {
+        StringBuilder hexString = new StringBuilder();
+        for (byte b : bytes) {
+            String hex = String.format("%02x", b & 0xFF);
+            hexString.append(hex);
+        }
+        return hexString.toString();
+    }
+
+    public static void main(String[] args) {
+        byte[] testData = "Hello, World!".getBytes();
+        String md5Hash = calculateMD5(testData);
+        System.out.println("MD5 Hash: " + md5Hash);
+        // 输出:MD5 Hash: 65a8e27d8879283831b664bd8b7f0ad4
+    }
+}

+ 8 - 1
edu-travel-service/edu-travel-service-upload/src/main/java/edu/travel/upload/web/UploadController.java

@@ -1,12 +1,14 @@
 package edu.travel.upload.web;
 
 import com.alibaba.fastjson.JSON;
+import cn.hutool.core.lang.Assert;
 import com.obs.services.ObsClient;
 import com.obs.services.model.*;
 import edu.travel.remote.upload.UploadRemoteController;
 import edu.travel.remote.upload.dto.EduFileBlobDTO;
 import edu.travel.remote.upload.dto.EduFileDTO;
 import edu.travel.rpc.RPCBaseResponse;
+import edu.travel.upload.config.MD5Calculator;
 import edu.travel.upload.entity.EduFile;
 import edu.travel.upload.entity.EduFileBlob;
 import edu.travel.upload.obs.property.ObsProperties;
@@ -30,7 +32,6 @@ import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
 import java.util.concurrent.ThreadPoolExecutor;
-import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/upload")
@@ -83,6 +84,11 @@ public class UploadController implements UploadRemoteController {
     @PostMapping(value = "/uploadBlob",headers = {"content-type=multipart/form-data"})
     @PreAuthorize("permitAll()")
     public RPCBaseResponse uploadBigFile(EduFileBlobDTO eduFileBlob, MultipartFile file) throws IOException {
+        byte[] bytes = file.getBytes();
+        String calculateMD5 = MD5Calculator.calculateMD5(bytes);
+        if (!eduFileBlob.getBlobMd5().equals(calculateMD5)) {
+            return RPCBaseResponse.error("分片md5不一致");
+        }
         EduFileBlob fileBlob = new EduFileBlob();
         BeanUtils.copyProperties(eduFileBlob, fileBlob);
         boolean exists = obsClient.headBucket(obsProperties.getBucketName());
@@ -91,6 +97,7 @@ public class UploadController implements UploadRemoteController {
             HeaderResponse response = obsClient.createBucket(obsProperties.getBucketName());
             logger.info("创建桶成功" + response.getRequestId());
         }
+
         obsClient.putObject(obsProperties.getBucketName(),"/service/chunk/"+eduFileBlob.getUploadId()+"/"+fileBlob.getBlobNum(),file.getInputStream());
         boolean save = eduFileBlobService.save(fileBlob);
         if (save){

+ 5 - 3
edu-travel-service/edu-travel-service-warehouse/src/main/java/edu/travel/warehouse/service/ShopWarehouseService.java

@@ -8,7 +8,9 @@ import edu.travel.rpc.RPCBaseResponse;
 import edu.travel.vo.ShopWarehouseStaffVo;
 import edu.travel.vo.ShopWarehouseVo;
 import edu.travel.warehouse.entity.ShopWarehouse;
+import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 public interface ShopWarehouseService extends IService<ShopWarehouse> {
@@ -20,7 +22,7 @@ public interface ShopWarehouseService extends IService<ShopWarehouse> {
     //库房关联人员(角色)查询
     RPCBaseResponse<List<ShopWarehouseStaffVo>> getWarehouseTenantRole(String id);
 //连表新增
-    RPCBaseResponse<ShopWarehouseVo> saveAllForm(ShopWarehouseSaveDto entity);
-
-    RPCBaseResponse<ShopWarehouseVo> updateWarehouse(ShopWarehouseSaveDto entity);
+    RPCBaseResponse<ShopWarehouseVo> saveAllForm(@RequestBody ShopWarehouseSaveDto entity, HttpServletRequest request);
+//连表修改
+    RPCBaseResponse<ShopWarehouseVo> updateWarehouse(@RequestBody ShopWarehouseSaveDto entity, HttpServletRequest request);
 }

+ 58 - 51
edu-travel-service/edu-travel-service-warehouse/src/main/java/edu/travel/warehouse/service/impl/ShopWarehouseServiceImpl.java

@@ -29,7 +29,9 @@ import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -118,8 +120,10 @@ public class ShopWarehouseServiceImpl extends SysServiceImpl<ShopWarehouseMapper
 
         // 将国家信息和用户角色信息放入对应的仓库列表项中
         for (ShopWarehouseVo warehouseVo : warehouseList) {
+            if (warehouseVo.getMap() == null) {
+                warehouseVo.setMap(new HashMap<>()); // 确保 map 被初始化
+            }
             if (baseCountryServeVoMap.containsKey(warehouseVo.getCountryServeId())) {
-                warehouseVo.setMap(new HashMap<>()); // 初始化 map
                 warehouseVo.getMap().put("countryServe", baseCountryServeVoMap.get(warehouseVo.getCountryServeId()));
             }
             if (staffMap.containsKey(warehouseVo.getId())) {
@@ -299,65 +303,60 @@ public class ShopWarehouseServiceImpl extends SysServiceImpl<ShopWarehouseMapper
      * @return
      */
     @Override
-    @Transactional // 确保方法在事务中执行
-    public RPCBaseResponse<ShopWarehouseVo> saveAllForm(ShopWarehouseSaveDto entity) {
+    @Transactional
+    public RPCBaseResponse<ShopWarehouseVo> saveAllForm(@RequestBody ShopWarehouseSaveDto entity, HttpServletRequest request) {
         // 创建一个新的 ShopWarehouse 实体
         ShopWarehouse warehouse = new ShopWarehouse();
 
+        // 从请求头中获取 project 的值
+        String project = request.getHeader("Project");
+        warehouse.setProject(project); // 设置 project
+
         // 获取当前用户 ID
-        Long currentUserId = getCurrentUserId(); // 获取当前用户 ID
+        Long currentUserId = getCurrentUserId();
 
         // 将 DTO 中的属性复制到实体对象中
         copyWarehouseProperties(entity, warehouse);
-        warehouse.setCreateUserId(String.valueOf(currentUserId)); // 填充创建人 ID
+        warehouse.setCreateUserId(String.valueOf(currentUserId));
+
+        // 检查项目是否存在
+        if (warehouse.getProject() == null) {
+            return new RPCBaseResponse<>(400, "项目不能为空", null);
+        }
 
         // 插入仓库信息到数据库
         shopWarehouseMapper.insert(warehouse);
 
         // 如果存在员工列表,则保存员工角色信息
         if (entity.getStaffList() != null && !entity.getStaffList().isEmpty()) {
-            saveStaffRoles(entity.getStaffList(), warehouse.getId(), currentUserId); // 传入用户 ID
+            saveStaffRoles(entity.getStaffList(), warehouse.getId(), currentUserId, project); // 传入 project
         }
 
         // 构建并返回响应对象
-        ShopWarehouseVo warehouseVo = new ShopWarehouseVo();
-        warehouseVo.setId(warehouse.getId());
-        warehouseVo.setWarehouseName(warehouse.getWarehouseName());
-        warehouseVo.setProject(warehouse.getProject());
-        warehouseVo.setCreateTime(warehouse.getCreateTime());
-        warehouseVo.setCreateUserId(warehouse.getCreateUserId());
-        warehouseVo.setUpdateTime(warehouse.getUpdateTime());
-        warehouseVo.setUpdateUserId(warehouse.getUpdateUserId());
-        warehouseVo.setDeleteFlag(warehouse.getDeleteFlag());
-        warehouseVo.setParentId(warehouse.getParentId());
-        warehouseVo.setLongitude(warehouse.getLongitude());
-        warehouseVo.setLatitude(warehouse.getLatitude());
-        warehouseVo.setCountryServeId(warehouse.getCountryServeId());
-        warehouseVo.setDetailedAddress(warehouse.getDetailedAddress());
-        warehouseVo.setStatus(warehouse.getStatus());
-        // 其他字段映射...
-
-        // 返回成功的响应
-        return new RPCBaseResponse<>(200, "SUCCESS", warehouseVo);
+        return buildWarehouseResponse(warehouse);
     }
 
     @Override
-    @Transactional // 确保方法在事务中执行
-    public RPCBaseResponse<ShopWarehouseVo> updateWarehouse(ShopWarehouseSaveDto entity) {
+    @Transactional
+    public RPCBaseResponse<ShopWarehouseVo> updateWarehouse(@RequestBody ShopWarehouseSaveDto entity, HttpServletRequest request) {
         // 根据 ID 查找现有的仓库信息
         ShopWarehouse existingWarehouse = shopWarehouseMapper.selectById(entity.getId());
 
         // 如果找不到该仓库,返回错误响应
         if (existingWarehouse == null) {
-            return new RPCBaseResponse<>(404, "NULL", null);
+            return new RPCBaseResponse<>(404, "找不到仓库", null);
         }
 
+        // 从请求头中获取 project 的值
+        String project = request.getHeader("Project");
+        existingWarehouse.setProject(project); // 设置 project
+
         // 更新现有仓库的属性
         copyWarehouseProperties(entity, existingWarehouse);
 
         // 获取当前用户 ID
-        Long currentUserId = getCurrentUserId(); // 获取当前用户 ID
-        existingWarehouse.setUpdateUserId(String.valueOf(currentUserId)); // 填充更新人 ID
+        Long currentUserId = getCurrentUserId();
+        existingWarehouse.setUpdateUserId(String.valueOf(currentUserId));
 
         // 更新仓库信息到数据库
         shopWarehouseMapper.updateById(existingWarehouse);
@@ -367,31 +366,14 @@ public class ShopWarehouseServiceImpl extends SysServiceImpl<ShopWarehouseMapper
             // 先删除原有员工信息
             shopWarehouseStaffMapper.deleteByWarehouseId(existingWarehouse.getId());
             // 然后插入新的员工角色信息
-            saveStaffRoles(entity.getStaffList(), existingWarehouse.getId(), currentUserId); // 传入用户 ID
+            saveStaffRoles(entity.getStaffList(), existingWarehouse.getId(), currentUserId, project); // 传入 project
         }
 
         // 构建并返回响应对象
-        ShopWarehouseVo warehouseVo = new ShopWarehouseVo();
-        warehouseVo.setId(existingWarehouse.getId());
-        warehouseVo.setWarehouseName(existingWarehouse.getWarehouseName());
-        warehouseVo.setProject(existingWarehouse.getProject());
-        warehouseVo.setCreateTime(existingWarehouse.getCreateTime());
-        warehouseVo.setCreateUserId(existingWarehouse.getCreateUserId());
-        warehouseVo.setUpdateTime(existingWarehouse.getUpdateTime());
-        warehouseVo.setUpdateUserId(existingWarehouse.getUpdateUserId());
-        warehouseVo.setDeleteFlag(existingWarehouse.getDeleteFlag());
-        warehouseVo.setParentId(existingWarehouse.getParentId());
-        warehouseVo.setLongitude(existingWarehouse.getLongitude());
-        warehouseVo.setLatitude(existingWarehouse.getLatitude());
-        warehouseVo.setCountryServeId(existingWarehouse.getCountryServeId());
-        warehouseVo.setDetailedAddress(existingWarehouse.getDetailedAddress());
-        warehouseVo.setStatus(existingWarehouse.getStatus());
-        // 其他字段映射...
-
-        // 返回成功的响应
-        return new RPCBaseResponse<>(200, "更新成功", warehouseVo);
+        return buildWarehouseResponse(existingWarehouse);
     }
 
+
     // 复制仓库属性的方法
     private void copyWarehouseProperties(ShopWarehouseSaveDto source, ShopWarehouse target) {
         target.setParentId(source.getParentId());
@@ -422,14 +404,39 @@ public class ShopWarehouseServiceImpl extends SysServiceImpl<ShopWarehouseMapper
         return userId;
     }
     // 保存员工角色信息的方法
-    private void saveStaffRoles(List<ShopWarehouseStaffDto> staffList, Long warehouseId, Long currentUserId) {
+    private void saveStaffRoles(List<ShopWarehouseStaffDto> staffList, Long warehouseId, Long currentUserId, String project) {
         for (ShopWarehouseStaffDto staffDto : staffList) {
             ShopWarehouseStaff staff = new ShopWarehouseStaff();
             staff.setWarehouseId(warehouseId);
             staff.setUserId(staffDto.getUserId());
             staff.setRoleId(staffDto.getRoleId());
             staff.setCreateUserId(String.valueOf(currentUserId)); // 设置创建用户 ID
+            staff.setProject(project); // 设置项目
+
+            // 插入员工角色信息
             shopWarehouseStaffMapper.insert(staff);
         }
     }
+    //返回方法
+    private RPCBaseResponse<ShopWarehouseVo> buildWarehouseResponse(ShopWarehouse warehouse) {
+        ShopWarehouseVo warehouseVo = new ShopWarehouseVo();
+        warehouseVo.setId(warehouse.getId());
+        warehouseVo.setWarehouseName(warehouse.getWarehouseName());
+        warehouseVo.setProject(warehouse.getProject()); // 设置项目
+        warehouseVo.setCreateTime(warehouse.getCreateTime());
+        warehouseVo.setCreateUserId(warehouse.getCreateUserId());
+        warehouseVo.setUpdateTime(warehouse.getUpdateTime());
+        warehouseVo.setUpdateUserId(warehouse.getUpdateUserId());
+        warehouseVo.setDeleteFlag(warehouse.getDeleteFlag());
+        warehouseVo.setParentId(warehouse.getParentId());
+        warehouseVo.setLongitude(warehouse.getLongitude());
+        warehouseVo.setLatitude(warehouse.getLatitude());
+        warehouseVo.setCountryServeId(warehouse.getCountryServeId());
+        warehouseVo.setDetailedAddress(warehouse.getDetailedAddress());
+        warehouseVo.setStatus(warehouse.getStatus());
+        // 其他字段映射...
+
+        return new RPCBaseResponse<>(200, "SUCCESS", warehouseVo);
+    }
+
 }

+ 5 - 4
edu-travel-service/edu-travel-service-warehouse/src/main/java/edu/travel/warehouse/web/ShopWarehouseController.java

@@ -14,6 +14,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -56,15 +57,15 @@ public class ShopWarehouseController extends BaseController<ShopWarehouse> imple
      * 库房连表新增
      */
     @PostMapping("/saveAllForm")
-    public RPCBaseResponse<ShopWarehouseVo> saveAllForm(@RequestBody ShopWarehouseSaveDto entity){
-        return shopWarehouseService.saveAllForm(entity);
+    public RPCBaseResponse<ShopWarehouseVo> saveAllForm(@RequestBody ShopWarehouseSaveDto entity, HttpServletRequest request){
+        return shopWarehouseService.saveAllForm(entity,request);
     }
     /**
      * 库房连表修改
      */
     @PostMapping("/updateWarehouse")
-    public RPCBaseResponse<ShopWarehouseVo> updateWarehouse(@RequestBody ShopWarehouseSaveDto entity){
-        return shopWarehouseService.updateWarehouse(entity);
+    public RPCBaseResponse<ShopWarehouseVo> updateWarehouse(@RequestBody ShopWarehouseSaveDto entity, HttpServletRequest request){
+        return shopWarehouseService.updateWarehouse(entity,request);
     }
 
 

+ 1 - 0
pom.xml

@@ -15,6 +15,7 @@
     <module>edu-travel-model</module>
       <module>edu-travel-api</module>
       <module>edu-travel-adapter</module>
+    <module>edu-travel-adapter/edu-travel-adapter-warehouse</module>
   </modules>
   <parent>
     <groupId>org.springframework.boot</groupId>