From d5b7ec2f5564b863ee221fe5f8af0450a2ae3e9c Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 18 九月 2023 14:26:37 +0800
Subject: [PATCH] 基础字段

---
 server/company/src/main/java/com/doumee/api/business/GoodsController.java               |    3 
 server/company/src/main/java/com/doumee/api/business/BrandController.java               |    2 
 server/service/src/main/java/com/doumee/service/business/impl/WebParamServiceImpl.java  |    9 ++
 server/company/src/main/java/com/doumee/api/business/CategoryController.java            |    6 +
 server/company/src/main/java/com/doumee/config/shiro/ShiroConfig.java                   |   18 ++++
 server/service/src/main/java/com/doumee/dao/system/dto/WebLoginDTO.java                 |   26 ++++++
 server/service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java |   21 +++--
 server/service/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java  |   73 ++++++++++++++++-
 server/platform/src/main/java/com/doumee/shiro/ShiroConfig.java                         |    1 
 server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java     |   20 +++-
 server/service/src/main/java/com/doumee/config/shiroMemory/ShiroConfig.java             |    1 
 server/service/src/main/java/com/doumee/core/utils/Constants.java                       |    5 +
 server/service/src/main/java/com/doumee/service/business/impl/BrandServiceImpl.java     |   12 +-
 server/company/src/main/java/com/doumee/api/system/SystemController.java                |   14 +++
 server/service/src/main/java/com/doumee/dao/business/model/Category.java                |   11 ++
 server/service/src/main/java/com/doumee/service/business/CategoryService.java           |    2 
 16 files changed, 195 insertions(+), 29 deletions(-)

diff --git a/server/company/src/main/java/com/doumee/api/business/BrandController.java b/server/company/src/main/java/com/doumee/api/business/BrandController.java
index c10e7ad..92d5112 100644
--- a/server/company/src/main/java/com/doumee/api/business/BrandController.java
+++ b/server/company/src/main/java/com/doumee/api/business/BrandController.java
@@ -4,12 +4,14 @@
 import com.doumee.core.annotation.excel.ExcelExporter;
 import com.doumee.core.annotation.pr.PreventRepeat;
 import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.LoginUserInfo;
 import com.doumee.core.model.PageData;
 import com.doumee.core.model.PageWrap;
 import com.doumee.dao.business.model.Brand;
 import com.doumee.service.business.BrandService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
diff --git a/server/company/src/main/java/com/doumee/api/business/CategoryController.java b/server/company/src/main/java/com/doumee/api/business/CategoryController.java
index c167c2c..61e0f93 100644
--- a/server/company/src/main/java/com/doumee/api/business/CategoryController.java
+++ b/server/company/src/main/java/com/doumee/api/business/CategoryController.java
@@ -179,4 +179,10 @@
         return ApiResponse.success(baseCategory);
     }
 
+    @ApiOperation("鍒楄〃 - SaaSH5")
+    @PostMapping("/saasList")
+    public ApiResponse<List<Category>> saasList (@RequestBody Category category) {
+        return ApiResponse.success(categoryService.findListSaaS(category));
+    }
+
 }
diff --git a/server/company/src/main/java/com/doumee/api/business/GoodsController.java b/server/company/src/main/java/com/doumee/api/business/GoodsController.java
index 8cb0195..81803f2 100644
--- a/server/company/src/main/java/com/doumee/api/business/GoodsController.java
+++ b/server/company/src/main/java/com/doumee/api/business/GoodsController.java
@@ -12,6 +12,7 @@
 import com.doumee.dao.business.model.dto.GoodsRequest;
 import com.doumee.service.business.GoodsService;
 import io.swagger.annotations.*;
+import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -152,6 +153,8 @@
     @ApiOperation("鍒楄〃 - H5")
     @PostMapping("/list")
     public ApiResponse<List<Goods>> findList (@RequestBody Goods goods) {
+        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+        goods.setCompanyId(user.getCompanyId());
         return ApiResponse.success(goodsService.findList(goods));
     }
 
diff --git a/server/company/src/main/java/com/doumee/api/system/SystemController.java b/server/company/src/main/java/com/doumee/api/system/SystemController.java
index ed5bcde..1f3c5e3 100644
--- a/server/company/src/main/java/com/doumee/api/system/SystemController.java
+++ b/server/company/src/main/java/com/doumee/api/system/SystemController.java
@@ -9,13 +9,16 @@
 import com.doumee.core.utils.Constants;
 import com.doumee.dao.system.dto.LoginDTO;
 import com.doumee.dao.system.dto.UpdatePwdDto;
+import com.doumee.dao.system.dto.WebLoginDTO;
 import com.doumee.service.system.SystemLoginService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.subject.Subject;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -39,12 +42,21 @@
     private SystemLoginService systemLoginService;
 
     @PreventRepeat(limit = 10, lockTime = 10000)
-    @ApiOperation("鐧诲綍")
+    @ApiOperation("鐧诲綍 - 鍚庣")
     @PostMapping("/login")
     public ApiResponse<String> login (@Validated @RequestBody LoginDTO dto, HttpServletRequest request) {
         return ApiResponse.success(systemLoginService.loginByPassword(dto, Constants.ONE, request));
     }
 
+    @PreventRepeat(limit = 10, lockTime = 10000)
+    @ApiOperation("鐧诲綍 - H5")
+    @PostMapping("/loginH5")
+    public ApiResponse<String> loginH5 (@Validated @RequestBody WebLoginDTO dto, HttpServletRequest request) {
+        LoginDTO loginDTO = new LoginDTO();
+        BeanUtils.copyProperties(dto,loginDTO);
+        return ApiResponse.success(systemLoginService.loginByPassword(loginDTO, Constants.TWO, request));
+    }
+
     @ApiOperation("閫�鍑虹櫥褰�")
     @PostMapping("/logout")
     public ApiResponse logout () {
diff --git a/server/company/src/main/java/com/doumee/config/shiro/ShiroConfig.java b/server/company/src/main/java/com/doumee/config/shiro/ShiroConfig.java
index 6a9becb..c9bee5f 100644
--- a/server/company/src/main/java/com/doumee/config/shiro/ShiroConfig.java
+++ b/server/company/src/main/java/com/doumee/config/shiro/ShiroConfig.java
@@ -89,15 +89,33 @@
         Map<String, String> map = new LinkedHashMap<>();
         // 璺緞鎷︽埅閰嶇疆
         // 璺緞鎷︽埅閰嶇疆
+//        map.put("/system/dictData/companyUserRules","anon");
+//        map.put("/system/login", "anon");
+//        map.put("/system/logout", "anon");
+//        map.put("/common/captcha", "anon");
+//        map.put("/business/areas/*", "anon");
+//        map.put("/public/uploadPicture","anon");
+//        map.put("/public/uploadLocal","anon");
+
         map.put("/system/dictData/companyUserRules","anon");
         map.put("/system/login", "anon");
         map.put("/system/logout", "anon");
+        map.put("/system/loginH5", "anon");
         map.put("/common/captcha", "anon");
         map.put("/business/areas/*", "anon");
         map.put("/public/uploadPicture","anon");
         map.put("/public/uploadLocal","anon");
 
 
+        map.put("/business/company/register", "anon");
+        map.put("/business/labels/page","anon");
+        map.put("/business/*/list","anon");
+        map.put("/business/goods/goodsPage","anon");
+        map.put("/business/goods/h5Image","anon");
+        map.put("/business/goods/export","anon");
+        map.put("/business/goods/listForH5","anon");
+
+
         // - 鏀捐swagger
         map.put("/doc.html", "anon");
         map.put("/webjars/**", "anon");
diff --git a/server/platform/src/main/java/com/doumee/shiro/ShiroConfig.java b/server/platform/src/main/java/com/doumee/shiro/ShiroConfig.java
index 97bfa1e..5f49fff 100644
--- a/server/platform/src/main/java/com/doumee/shiro/ShiroConfig.java
+++ b/server/platform/src/main/java/com/doumee/shiro/ShiroConfig.java
@@ -91,6 +91,7 @@
         map.put("/system/dictData/companyUserRules","anon");
         map.put("/system/login", "anon");
         map.put("/system/logout", "anon");
+        map.put("/system/loginH5", "anon");
         map.put("/common/captcha", "anon");
         map.put("/business/areas/*", "anon");
         map.put("/public/uploadPicture","anon");
diff --git a/server/service/src/main/java/com/doumee/config/shiroMemory/ShiroConfig.java b/server/service/src/main/java/com/doumee/config/shiroMemory/ShiroConfig.java
index 509c63d..ef719af 100644
--- a/server/service/src/main/java/com/doumee/config/shiroMemory/ShiroConfig.java
+++ b/server/service/src/main/java/com/doumee/config/shiroMemory/ShiroConfig.java
@@ -75,6 +75,7 @@
         map.put("/system/dictData/companyUserRules","anon");
         map.put("/system/login", "anon");
         map.put("/system/logout", "anon");
+        map.put("/system/loginH5", "anon");
         map.put("/common/captcha", "anon");
         map.put("/business/areas/*", "anon");
         map.put("/business/company/register", "anon");
diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java
index 8cbd647..7c7b36b 100644
--- a/server/service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -24,6 +24,11 @@
     public static final String ENDPOINT = "ENDPOINT";
     public static final String RESOURCE_PATH = "RESOURCE_PATH";
     public static final String WEB_PARAM = "WEB_PARAM";
+    public static final String MAIN_COLOR = "MAIN_COLOR";
+    public static final String BG_IMG = "BG_IMG";
+    public static final String TOP_IMG = "TOP_IMG";
+    public static final String PK_IMG = "PK_IMG";
+    public static final String RANGE_SIZE = "RANGE_SIZE";
 
 
     public static final String SYSTEM ="SYSTEM";
diff --git a/server/service/src/main/java/com/doumee/dao/business/model/Category.java b/server/service/src/main/java/com/doumee/dao/business/model/Category.java
index 0c67dbb..3768bad 100644
--- a/server/service/src/main/java/com/doumee/dao/business/model/Category.java
+++ b/server/service/src/main/java/com/doumee/dao/business/model/Category.java
@@ -103,11 +103,11 @@
     @TableField(exist = false)
     private List<CateParam> paramList;
 
-    @ApiModelProperty(value = "灞炴��1 鍒楄〃鍊�")
+    @ApiModelProperty(value = "灞炴��1 鍒楄〃鍊�"  ,hidden = true)
     @TableField(exist = false)
     private List<CateAttr> attrFirstList;
 
-    @ApiModelProperty(value = "灞炴��2 鍒楄〃鍊�")
+    @ApiModelProperty(value = "灞炴��2 鍒楄〃鍊�"  ,hidden = true)
     @TableField(exist = false)
     private List<CateAttr> attrSecondList;
 
@@ -115,4 +115,11 @@
     @TableField(exist = false)
     private List<CateBudget> budgetList;
 
+    @ApiModelProperty(value = "灞炴��1 鍒楄〃鍊�")
+    @TableField(exist = false)
+    private List<CateParamSelect> cateParamFirstList;
+
+    @ApiModelProperty(value = "灞炴��2 鍒楄〃鍊�")
+    @TableField(exist = false)
+    private List<CateParamSelect> cateParamSecondList;
 }
diff --git a/server/service/src/main/java/com/doumee/dao/system/dto/WebLoginDTO.java b/server/service/src/main/java/com/doumee/dao/system/dto/WebLoginDTO.java
new file mode 100644
index 0000000..22575c6
--- /dev/null
+++ b/server/service/src/main/java/com/doumee/dao/system/dto/WebLoginDTO.java
@@ -0,0 +1,26 @@
+package com.doumee.dao.system.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @author Eva.Caesar Liu
+ * @date 2023/02/14 11:14
+ */
+@Data
+@ApiModel("H5涓绘挱鐧诲綍鍙傛暟")
+public class WebLoginDTO implements Serializable {
+
+    @NotBlank(message = "鐢ㄦ埛鍚嶄笉鑳戒负绌�")
+    @ApiModelProperty(value = "鐢ㄦ埛鍚�")
+    private String username;
+
+    @NotBlank(message = "瀵嗙爜涓嶈兘涓虹┖")
+    @ApiModelProperty(value = "瀵嗙爜")
+    private String password;
+
+}
diff --git a/server/service/src/main/java/com/doumee/service/business/CategoryService.java b/server/service/src/main/java/com/doumee/service/business/CategoryService.java
index 3131e15..8e83906 100644
--- a/server/service/src/main/java/com/doumee/service/business/CategoryService.java
+++ b/server/service/src/main/java/com/doumee/service/business/CategoryService.java
@@ -85,6 +85,8 @@
      */
     List<Category> findList(Category category);
 
+    List<Category> findListSaaS(Category category);
+
     List<Category> companyFindList(Category category);
     /**
      * 鏌ヨ绫诲埆
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/BrandServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/BrandServiceImpl.java
index 4a73f34..9d448c7 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/BrandServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/BrandServiceImpl.java
@@ -158,8 +158,9 @@
         if (Objects.isNull(user.getCompanyId())) {
             wrapper.lambda().eq(Brand::getType,Constants.ONE);
         }else {
-            wrapper.lambda().eq(Brand::getCompanyId,brand.getCompanyId())
-                    .or().eq(Brand::getType,Constants.ZERO);
+            wrapper.lambda().and(i->i.eq(Brand::getCompanyId,user.getCompanyId())
+                            .or().eq(Brand::getType,Constants.ZERO)
+            );
         }
         List<Brand> list = brandMapper.selectList(wrapper);
         String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
@@ -187,10 +188,9 @@
         if (Objects.isNull(user.getCompanyId())) {
             queryWrapper.lambda().eq(Brand::getType,Constants.ONE);
         }else {
-            queryWrapper.lambda().and(wreapper->{
-                wreapper.eq(Brand::getType,pageWrap.getModel().getCompanyId())
-                        .or().eq(Brand::getType,Constants.ZERO);});
-
+            queryWrapper.lambda().and(i->i.eq(Brand::getCompanyId,user.getCompanyId())
+                    .or().eq(Brand::getType,Constants.ZERO)
+            );
         }
         queryWrapper.lambda().orderByAsc(Brand::getSortnum);
         IPage<Brand> brandIPage = brandMapper.selectPage(page, queryWrapper);
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
index 233aebf..e084723 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
@@ -11,6 +11,7 @@
 import com.doumee.core.utils.Utils;
 import com.doumee.dao.business.CateAttrMapper;
 import com.doumee.dao.business.CateParamMapper;
+import com.doumee.dao.business.CateParamSelectMapper;
 import com.doumee.dao.business.CategoryMapper;
 import com.doumee.dao.business.model.*;
 import com.doumee.service.business.CategoryService;
@@ -47,6 +48,9 @@
 
     @Autowired
     private SystemDictDataBiz systemDictDataBiz;
+
+    @Autowired
+    private CateParamSelectMapper cateParamSelectMapper;
 
     @Override
     public Integer create(Category category) {
@@ -410,13 +414,15 @@
 
     @Override
     public List<Category> findList(Category category) {
+        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         QueryWrapper<Category> wrapper = new QueryWrapper<>(category)
                 .eq("STATUS",Constants.ZERO)
                 .eq("ISDELETED",Constants.ZERO)
+                .eq("COMPANY_ID",user.getCompanyId())
                 .orderByAsc(" SORTNUM ");
         List<Category> list = categoryMapper.selectList(wrapper);
-        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()
-                + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode();
+        String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.FILE_DIR).getCode()
+                + systemDictDataBiz.queryByCode(Constants.OSS, Constants.CATEGORY_IMG).getCode();
         for (Category c:list) {
             c.setPrefixUrl(prefixUrl);
             c.setAttrFirstList(cateAttrMapper.selectList(new QueryWrapper<CateAttr>().eq("TYPE",Constants.ZERO).eq("ISDELETED",Constants.ZERO).eq("CATEGORY_ID",c.getId()).orderByAsc(" SORTNUM ")));
@@ -426,6 +432,61 @@
         return list;
     }
 
+
+
+    @Override
+    public List<Category> findListSaaS(Category category) {
+        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+        if(!user.getType().equals(Constants.UserType.ZHUBO.getKey())){
+            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐢ㄦ埛绫诲埆閿欒锛岄潪涓绘挱鐢ㄦ埛!");
+        }
+        QueryWrapper<Category> wrapper = new QueryWrapper<>(category)
+                .eq("STATUS",Constants.ZERO)
+                .eq("ISDELETED",Constants.ZERO)
+                .eq("COMPANY_ID",user.getCompanyId())
+                .orderByAsc(" SORTNUM ");
+        List<Category> list = categoryMapper.selectList(wrapper);
+        String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.FILE_DIR).getCode()
+                + systemDictDataBiz.queryByCode(Constants.OSS, Constants.CATEGORY_IMG).getCode();
+        for (Category c:list) {
+            c.setPrefixUrl(prefixUrl);
+//            c.setAttrFirstList(cateAttrMapper.selectList(new QueryWrapper<CateAttr>().eq("TYPE",Constants.ZERO).eq("ISDELETED",Constants.ZERO).eq("CATEGORY_ID",c.getId()).orderByAsc(" SORTNUM ")));
+//            c.setAttrSecondList(cateAttrMapper.selectList(new QueryWrapper<CateAttr>().eq("TYPE",Constants.ONE).eq("ISDELETED",Constants.ZERO).eq("CATEGORY_ID",c.getId()).orderByAsc(" SORTNUM ")));
+            c.setBudgetList(cateBudgetMapper.selectList(new QueryWrapper<CateBudget>().eq("CATEGORY_ID",c.getId()).orderByAsc(" SORTNUM ")));
+            this.getParamSelect(c);
+        }
+        return list;
+    }
+
+
+    public void getParamSelect(Category category){
+        List<CateParam> cateParamList =  cateParamMapper.selectList(new QueryWrapper<CateParam>()
+                .eq("CATEGORY_ID",category.getId())
+                .eq("ISSELECT",Constants.ONE)
+                .eq("ISDELETED",Constants.ZERO)
+                .orderByAsc(" SORTNUM ")
+                .last(" limit 2 ")
+        );
+        if(!Objects.isNull(cateParamList)&&cateParamList.size()>Constants.ZERO){
+            for (int i = 0; i < cateParamList.size(); i++) {
+                CateParam cateParam = cateParamList.get(i);
+                List<CateParamSelect> cateParamSelectList = cateParamSelectMapper.selectList(new QueryWrapper<CateParamSelect>()
+                        .eq("PARAM_ID",cateParam.getId())
+                        .eq("ISDELETED",Constants.ZERO));
+                if(i==0){
+                    category.setAttrFirst(cateParam.getName());
+                    category.setCateParamFirstList(cateParamSelectList);
+                }else if(i==1){
+                    category.setAttrSecond(cateParam.getName());
+                    category.setCateParamSecondList(cateParamSelectList);
+                }
+
+            }
+        }
+    }
+
+
+
     @Override
     public List<Category> findListForGoods(Integer goodsId) {
         QueryWrapper<Category> wrapper = new QueryWrapper<Category>()
@@ -433,8 +494,8 @@
                 .eq("ISDELETED",Constants.ZERO)
                 .orderByAsc(" SORTNUM ");
         List<Category> list = categoryMapper.selectList(wrapper);
-        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()
-                + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode();
+        String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.FILE_DIR).getCode()
+                + systemDictDataBiz.queryByCode(Constants.OSS, Constants.CATEGORY_IMG).getCode();
         for (Category c:list) {
             c.setPrefixUrl(prefixUrl);
             c.setAttrFirstList(cateAttrMapper.selectList(new QueryWrapper<CateAttr>().eq("TYPE",Constants.ZERO).eq("ISDELETED",Constants.ZERO).eq("CATEGORY_ID",c.getId()).orderByAsc(" SORTNUM ")));
@@ -491,8 +552,8 @@
                 .eq("ISDELETED",Constants.ZERO)
                 .orderByAsc(" SORTNUM ");
         List<Category> list = categoryMapper.selectList(wrapper);
-        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()
-                + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode();
+        String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.FILE_DIR).getCode()
+                + systemDictDataBiz.queryByCode(Constants.OSS, Constants.CATEGORY_IMG).getCode();
         for (Category c:list) {
             c.setPrefixUrl(prefixUrl);
             c.setBudgetList(cateBudgetMapper.selectList(new QueryWrapper<CateBudget>().eq("STATUS",Constants.ZERO).eq("CATEGORY_ID",c.getId()).orderByAsc(" SORTNUM ")));
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
index a049452..1023bb5 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
@@ -23,6 +23,7 @@
 import com.doumee.dao.business.model.dto.PlatGoodsParam;
 import com.doumee.service.business.GoodsService;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import lombok.extern.java.Log;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -1027,6 +1028,7 @@
     @Override
     public void export(HttpServletRequest request, HttpServletResponse response) throws Exception {
         try {
+            LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
             String fileName = "浜у搧瀵煎叆琛�"+System.currentTimeMillis()+".xlsx";
             // 鑾峰彇鏂囦欢杈撳叆娴�
             InputStream inputStream =  this.getClass().getClassLoader().getResourceAsStream("static/file/goodsExcelTemp.xlsx");
@@ -1040,7 +1042,10 @@
             // sheet.getPhysicalNumberOfRows()鑾峰彇鎬荤殑琛屾暟
             // 寰幆璇诲彇姣忎竴琛�
             Row row = sheet.createRow(1);
-            List<Category> categoryList = categoryMapper.selectList(new QueryWrapper<Category>().eq("ISDELETED",0));
+            List<Category> categoryList = categoryMapper.selectList(
+                    new QueryWrapper<Category>().eq("ISDELETED",0)
+                            .eq("COMPANY_ID",loginUserInfo.getCompanyId())
+            );
             categoryList.forEach(i->{
                 i.setParamList(cateParamMapper.selectList(new QueryWrapper<CateParam>().eq("ISDELETED",0).eq("CATEGORY_ID",i.getId())));
             });
@@ -1105,8 +1110,8 @@
                 .apply(!Objects.isNull(pageWrap.getModel()) && !Objects.isNull(pageWrap.getModel().getEPrice()), "  t.PRICE <=  "+pageWrap.getModel().getEPrice()+" ");
         queryWrapper.orderByDesc(Goods::getId);
         IPage<Goods> goodsIPage =  goodsJoinMapper.selectJoinPage(page, Goods.class, queryWrapper);
-        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()
-                + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode();
+        String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
+                + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode();
         goodsIPage.getRecords().forEach(i->{
             i.setPrefixUrl(prefixUrl);
             i.setMultifileList(multifileMapper.selectList(new QueryWrapper<Multifile>().eq("OBJ_ID",i.getId()).orderByAsc(" SORTNUM ")));
@@ -1118,6 +1123,10 @@
 
     @Override
     public List<Goods> findListForH5(GoodsRequest goodsRequest) {
+        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+        if(!loginUserInfo.getType().equals(Constants.UserType.ZHUBO.getKey())){
+            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炰富鎾敤鎴锋棤娉曚娇鐢�");
+        }
         MPJLambdaWrapper<Goods> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper.selectAll(Goods.class);
         queryWrapper.selectAs(Category::getName, Goods::getCategoryName);
@@ -1129,6 +1138,7 @@
         queryWrapper.leftJoin(Brand.class, Brand::getId, Goods::getBrandId);
         queryWrapper.eq(Goods::getStatus,Constants.ZERO);
         queryWrapper.eq(Goods::getIsdeleted,Constants.ZERO);
+        queryWrapper.eq(Goods::getCompanyId,loginUserInfo.getCompanyId());
         queryWrapper.eq(!Objects.isNull(goodsRequest) && !Objects.isNull(goodsRequest.getCategoryId()), Goods::getCategoryId, goodsRequest.getCategoryId())
                 .eq(!Objects.isNull(goodsRequest) && !Objects.isNull(goodsRequest.getBrandId()), Goods::getBrandId, goodsRequest.getBrandId())
                 .and(!Objects.isNull(goodsRequest) && StringUtils.isNotBlank(goodsRequest.getKeyword()),
@@ -1142,8 +1152,8 @@
                 .apply(!Objects.isNull(goodsRequest) && !Objects.isNull(goodsRequest.getEPrice()), "  t.PRICE <=  "+goodsRequest.getEPrice()+" ");
         queryWrapper.orderByDesc(Goods::getId);
         List<Goods> goodsList = goodsJoinMapper.selectJoinList(Goods.class,queryWrapper);
-        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()
-                + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode();
+        String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
+                + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode();
         goodsList.forEach(i->{
             i.setPrefixUrl(prefixUrl);
             i.setMultifileList(multifileMapper.selectList(new QueryWrapper<Multifile>().eq("OBJ_ID",i.getId()).orderByAsc(" SORTNUM ")));
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/WebParamServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/WebParamServiceImpl.java
index 2d9043e..4e811eb 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/WebParamServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/WebParamServiceImpl.java
@@ -48,6 +48,15 @@
         if(!Objects.isNull(webParam)){
             webParam.setResourcePath(systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() +
                     systemDictDataBiz.queryByCode(Constants.OSS,Constants.WEB_PARAM).getCode());
+        }else{
+            webParam = new WebParam();
+            webParam.setResourcePath(systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() +
+                    systemDictDataBiz.queryByCode(Constants.OSS,Constants.WEB_PARAM).getCode());
+            webParam.setBgImg(systemDictDataBiz.queryByCode(Constants.WEB_PARAM,Constants.BG_IMG).getCode());
+            webParam.setTopImg(systemDictDataBiz.queryByCode(Constants.WEB_PARAM,Constants.TOP_IMG).getCode());
+            webParam.setPkImg(systemDictDataBiz.queryByCode(Constants.WEB_PARAM,Constants.PK_IMG).getCode());
+            webParam.setMainColor(systemDictDataBiz.queryByCode(Constants.WEB_PARAM,Constants.MAIN_COLOR).getCode());
+            webParam.setRangeSize(systemDictDataBiz.queryByCode(Constants.WEB_PARAM,Constants.RANGE_SIZE).getCode());
         }
         return webParam;
     }
diff --git a/server/service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java b/server/service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
index 452b0a0..2f4ce06 100644
--- a/server/service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
@@ -3,6 +3,7 @@
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
 import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.utils.Constants;
 import com.doumee.core.utils.Utils;
 import com.doumee.dao.system.dto.LoginDTO;
 import com.doumee.dao.system.model.SystemLoginLog;
@@ -49,16 +50,18 @@
         loginLog.setOsInfo(Utils.User_Client.getOS(request));
         loginLog.setServerIp(Utils.Server.getIP());
         // 鏍¢獙楠岃瘉鐮�
-        try {
-            if(captchaCheck){
-                captchaService.check(dto.getUuid(), dto.getCode());
+        if(type!= Constants.TWO){
+            try {
+                if(captchaCheck){
+                    captchaService.check(dto.getUuid(), dto.getCode());
+                }
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                loginLog.setReason(e.getMessage().length() > 200 ? (e.getMessage().substring(0, 190) + "...") : e.getMessage());
+                loginLog.setSuccess(Boolean.FALSE);
+                systemLoginLogService.create(loginLog);
+                throw e;
             }
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            loginLog.setReason(e.getMessage().length() > 200 ? (e.getMessage().substring(0, 190) + "...") : e.getMessage());
-            loginLog.setSuccess(Boolean.FALSE);
-            systemLoginLogService.create(loginLog);
-            throw e;
         }
         // 鏍¢獙鐢ㄦ埛鍚嶅拰瀵嗙爜
         Subject subject = SecurityUtils.getSubject();

--
Gitblit v1.9.3