2 Commits 2c78d2d863 ... 6aded20f01

Autore SHA1 Messaggio Data
  liangbo.huang 6aded20f01 修改C端页面是否显示业务菜单 2 settimane fa
  liangbo.huang c3d6639e6f c端增加当前企业贸易平台匹配接口 2 settimane fa

+ 6 - 6
trade-client/src/main/java/com/trade/client/enterprise/dto/EnterpriseStatusDto.java

@@ -6,9 +6,9 @@ public class EnterpriseStatusDto {
      */
     private String certificationStatus;
     /**
-     * 是否提交说明
+     * 是否显示所有功能菜单
      */
-    private String submitHint;
+    private Boolean showAllFunctions;
 
     public String getCertificationStatus() {
         return certificationStatus;
@@ -18,11 +18,11 @@ public class EnterpriseStatusDto {
         this.certificationStatus = certificationStatus;
     }
 
-    public String getSubmitHint() {
-        return submitHint;
+    public Boolean getShowAllFunctions() {
+        return showAllFunctions;
     }
 
-    public void setSubmitHint(String submitHint) {
-        this.submitHint = submitHint;
+    public void setShowAllFunctions(Boolean showAllFunctions) {
+        this.showAllFunctions = showAllFunctions;
     }
 }

+ 7 - 10
trade-client/src/main/java/com/trade/client/enterprise/service/impl/EnterpriseServiceImpl.java

@@ -68,19 +68,16 @@ public class EnterpriseServiceImpl implements EnterpriseService {
     @Override
     public EnterpriseStatusDto queryCertificationStatus() {
         EnterpriseStatusDto enterpriseStatusDto = new EnterpriseStatusDto();
+        enterpriseStatusDto.setCertificationStatus(DictConstants.CERTIFICATION_STATUS_UNSUBMITTED);
+        enterpriseStatusDto.setShowAllFunctions(Boolean.FALSE);
         Long customerUserId = UserUtils.getCustomerUserId();
-        Enterprise enterprise = enterpriseBaseService.getEnterpriseByCustomerId(customerUserId);
-        if (enterprise != null) {
-            enterpriseStatusDto.setCertificationStatus(enterprise.getCertificationStatus());
-        }
         EnterpriseChangeRecord record = enterpriseChangeRecordBaseService.getLatestRecord(customerUserId, null);
-        if (record != null && DictConstants.CERTIFICATION_STATUS_UNSUBMITTED.equals(record.getCertificationStatus())) {
-            if (enterprise == null) {
-                enterpriseStatusDto.setSubmitHint("未提交");
-            } else {
-                enterpriseStatusDto.setSubmitHint("资料更新未提交");
-            }
+        if (record != null) {
+            enterpriseStatusDto.setCertificationStatus(record.getCertificationStatus());
         }
+        Enterprise enterprise = enterpriseBaseService.getEnterpriseByCustomerId(customerUserId);
+        enterpriseStatusDto.setShowAllFunctions(enterprise != null
+                && DictConstants.CERTIFICATION_STATUS_PASSED.equals(enterprise.getCertificationStatus()));
         return enterpriseStatusDto;
     }
 

+ 22 - 0
trade-client/src/main/java/com/trade/client/tradingPlatform/TradingPlatformService.java

@@ -0,0 +1,22 @@
+package com.trade.client.tradingPlatform;
+
+
+import com.trade.service.tradingPlatform.dto.TradingPlatformDto;
+
+import java.util.List;
+
+/**
+ * 贸易平台服务接口
+ *
+ * @author hlb
+ */
+public interface TradingPlatformService {
+
+    /**
+     * 查询当前企业可匹配的贸易平台列表
+     ** @return
+     */
+    List<TradingPlatformDto> queryCanMatchTradingPlatforms();
+
+}
+

+ 38 - 0
trade-client/src/main/java/com/trade/client/tradingPlatform/controller/TradingPlatformController.java

@@ -0,0 +1,38 @@
+package com.trade.client.tradingPlatform.controller;
+
+import javax.annotation.Resource;
+
+import com.trade.client.tradingPlatform.TradingPlatformService;
+import org.springframework.web.bind.annotation.*;
+
+import com.trade.common.core.domain.ResponseResult;
+import com.trade.service.tradingPlatform.dto.TradingPlatformDto;
+
+import java.util.List;
+
+/**
+ * 贸易平台接口
+ *
+ * @author hlb
+ */
+@RestController
+@RequestMapping("/tradingPlatform")
+public class TradingPlatformController {
+
+    /**
+     * 服务对象
+     */
+    @Resource
+    private TradingPlatformService tradingPlatformService;
+
+    /**
+     * 查询当前企业可匹配的贸易平台列表
+     *
+     * @return 贸易平台
+     */
+    @GetMapping("/can/match")
+    public ResponseResult<List<TradingPlatformDto>> queryCanMatchTradingPlatforms() {
+        List<TradingPlatformDto> tradingPlatformDtoList = tradingPlatformService.queryCanMatchTradingPlatforms();
+        return ResponseResult.success(tradingPlatformDtoList);
+    }
+}

+ 59 - 0
trade-client/src/main/java/com/trade/client/tradingPlatform/service/TradingPlatformServiceImpl.java

@@ -0,0 +1,59 @@
+package com.trade.client.tradingPlatform.service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import com.trade.client.consumer.domain.model.LoginUserInfo;
+import com.trade.client.security.utils.UserUtils;
+import com.trade.client.tradingPlatform.TradingPlatformService;
+import com.trade.common.exception.ServiceException;
+import com.trade.common.utils.bean.BeanCopyUtils;
+import com.trade.service.enterprise.domain.Enterprise;
+import com.trade.service.enterprise.service.EnterpriseBaseService;
+import org.slf4j.Logger;
+import org.springframework.stereotype.Service;
+
+import com.trade.common.constant.HttpStatus;
+import com.trade.common.utils.LoggerUtil;
+import com.trade.service.tradingPlatform.domain.TradingPlatform;
+import com.trade.service.tradingPlatform.dto.*;
+import com.trade.service.tradingPlatform.service.TradingPlatformBaseService;
+
+import cn.hutool.core.util.StrUtil;
+
+/**
+ * 贸易平台服务实现类
+ *
+ * @author hlb
+ * @since 2024-06-05 17:00:44
+ */
+@Service("tradingPlatformService")
+public class TradingPlatformServiceImpl implements TradingPlatformService {
+
+    private static final Logger log = LoggerUtil.logger(LoggerUtil.LogFileNameEnum.SERVICES_LOG);
+    @Resource
+    private TradingPlatformBaseService tradingPlatformBaseService;
+    @Resource
+    private EnterpriseBaseService enterpriseBaseService;
+
+    @Override
+    public List<TradingPlatformDto> queryCanMatchTradingPlatforms() {
+        LoginUserInfo loginUserInfo = UserUtils.getLoginUser();
+        if (loginUserInfo == null) {
+            throw new ServiceException("请您重新登录", HttpStatus.BAD_REQUEST);
+        }
+        Enterprise enterprise = enterpriseBaseService.getEnterpriseByCustomerId(loginUserInfo.getCustomerUserId());
+        if (enterprise == null) {
+            throw new ServiceException("您没有关联的企业信息,请联系管理员", HttpStatus.BAD_REQUEST);
+        }
+        if (StrUtil.isEmpty(enterprise.getProxyDistrictCode())) {
+            return new ArrayList<>();
+        }
+        return tradingPlatformBaseService.lambdaQuery()
+                .eq(TradingPlatform::getDistrictCode, enterprise.getProxyDistrictCode()).list().stream()
+                .map(o -> BeanCopyUtils.copy(o, TradingPlatformDto.class)).collect(Collectors.toList());
+    }
+}