bmmx 1 жил өмнө
parent
commit
c911aece2c

+ 73 - 66
.idea/workspace.xml

@@ -4,29 +4,11 @@
     <option name="autoReloadType" value="SELECTIVE" />
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   </component>
   <component name="ChangeListManager">
   <component name="ChangeListManager">
-    <list default="true" id="46b159bd-08ca-42f0-b80f-41d4944a8a29" name="Changes" comment="增加master缺失文件,3.11">
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/controller/admin/AppsClientsController.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/controller/admin/AppsController.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/controller/admin/AppsDescController.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/po/Apps.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/po/AppsClients.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/po/AppsDesc.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/vo/AppsAddVO.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/entity/vo/AppsVO.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/mapper/AppsClientsMapper.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/mapper/AppsDescMapper.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/mapper/AppsMapper.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/service/IAppsClientsService.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/service/IAppsDescService.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/service/IAppsService.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/service/impl/AppsClientsServiceImpl.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/service/impl/AppsDescServiceImpl.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/om/service/impl/AppsServiceImpl.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/resources/mapper/AppsClientsMapper.xml" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/resources/mapper/AppsDescMapper.xml" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/resources/mapper/AppsMapper.xml" afterDir="false" />
+    <list default="true" id="46b159bd-08ca-42f0-b80f-41d4944a8a29" name="Changes" comment="App端诊断日志上传">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/service/impl/DiagClientsServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/service/impl/DiagClientsServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/controller/user/APPBrandController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/controller/user/APPBrandController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/service/IBrandService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/service/IBrandService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/om/service/impl/BrandServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/om/service/impl/BrandServiceImpl.java" afterDir="false" />
     </list>
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -56,7 +38,9 @@
   <component name="MavenImportPreferences">
   <component name="MavenImportPreferences">
     <option name="generalSettings">
     <option name="generalSettings">
       <MavenGeneralSettings>
       <MavenGeneralSettings>
-        <option name="userSettingsFile" value="$USER_HOME$/.m2/settings.xml" />
+        <option name="customMavenHome" value="B:\apache-maven-3.8.8" />
+        <option name="mavenHomeTypeForPersistence" value="CUSTOM" />
+        <option name="userSettingsFile" value="B:\apache-maven-3.8.8\conf\settings.xml" />
       </MavenGeneralSettings>
       </MavenGeneralSettings>
     </option>
     </option>
   </component>
   </component>
@@ -71,40 +55,40 @@
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="showLibraryContents" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
   </component>
-  <component name="PropertiesComponent"><![CDATA[{
-  "keyToString": {
-    "ASKED_ADD_EXTERNAL_FILES": "true",
-    "Application.CodeGenerator.executor": "Run",
-    "Maven.OperationSystem [clean].executor": "Run",
-    "Maven.OperationSystem [package].executor": "Run",
-    "Maven.OperationSystem [validate].executor": "Run",
-    "RequestMappingsPanelOrder0": "0",
-    "RequestMappingsPanelOrder1": "1",
-    "RequestMappingsPanelWidth0": "75",
-    "RequestMappingsPanelWidth1": "75",
-    "RunOnceActivity.OpenProjectViewOnStart": "true",
-    "RunOnceActivity.ShowReadmeOnStart": "true",
-    "SHARE_PROJECT_CONFIGURATION_FILES": "true",
-    "Spring Boot.OperationApplication.executor": "Run",
-    "WebServerToolWindowFactoryState": "false",
-    "git-widget-placeholder": "master",
-    "ignore.virus.scanning.warn.message": "true",
-    "kotlin-language-version-configured": "true",
-    "last_opened_file_path": "C:/Users/wxy/IdeasProjects/outsourcing/OperationSystem/src/main/resources/mapper",
-    "node.js.detected.package.eslint": "true",
-    "node.js.detected.package.tslint": "true",
-    "node.js.selected.package.eslint": "(autodetect)",
-    "node.js.selected.package.tslint": "(autodetect)",
-    "nodejs_package_manager_path": "npm",
-    "npm.dev.executor": "Run",
-    "project.structure.last.edited": "库",
-    "project.structure.proportion": "0.15",
-    "project.structure.side.proportion": "0.2",
-    "settings.editor.selected.configurable": "MavenSettings",
-    "spring.configuration.checksum": "e5344c6eb967ac845090dcf3a4fa5dde",
-    "vue.rearranger.settings.migration": "true"
+  <component name="PropertiesComponent">{
+  &quot;keyToString&quot;: {
+    &quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
+    &quot;Application.CodeGenerator.executor&quot;: &quot;Run&quot;,
+    &quot;Maven.OperationSystem [clean].executor&quot;: &quot;Run&quot;,
+    &quot;Maven.OperationSystem [package].executor&quot;: &quot;Run&quot;,
+    &quot;Maven.OperationSystem [validate].executor&quot;: &quot;Run&quot;,
+    &quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
+    &quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
+    &quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
+    &quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
+    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
+    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
+    &quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
+    &quot;Spring Boot.OperationApplication.executor&quot;: &quot;Run&quot;,
+    &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
+    &quot;git-widget-placeholder&quot;: &quot;master&quot;,
+    &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
+    &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
+    &quot;last_opened_file_path&quot;: &quot;C:/Users/wxy/IdeasProjects/outsourcing/OperationSystem/src/main/resources/mapper&quot;,
+    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
+    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
+    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
+    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
+    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
+    &quot;npm.dev.executor&quot;: &quot;Run&quot;,
+    &quot;project.structure.last.edited&quot;: &quot;库&quot;,
+    &quot;project.structure.proportion&quot;: &quot;0.15&quot;,
+    &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
+    &quot;settings.editor.selected.configurable&quot;: &quot;MavenSettings&quot;,
+    &quot;spring.configuration.checksum&quot;: &quot;e5344c6eb967ac845090dcf3a4fa5dde&quot;,
+    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
   }
   }
-}]]></component>
+}</component>
   <component name="ReactorSettings">
   <component name="ReactorSettings">
     <option name="notificationShown" value="true" />
     <option name="notificationShown" value="true" />
   </component>
   </component>
@@ -174,20 +158,12 @@
     <recent_temporary>
     <recent_temporary>
       <list>
       <list>
         <item itemvalue="Spring Boot.OperationApplication" />
         <item itemvalue="Spring Boot.OperationApplication" />
-        <item itemvalue="应用程序.CodeGenerator" />
         <item itemvalue="npm.dev" />
         <item itemvalue="npm.dev" />
         <item itemvalue="Spring Boot.OperationApplication" />
         <item itemvalue="Spring Boot.OperationApplication" />
         <item itemvalue="npm.dev" />
         <item itemvalue="npm.dev" />
       </list>
       </list>
     </recent_temporary>
     </recent_temporary>
   </component>
   </component>
-  <component name="SharedIndexes">
-    <attachedChunks>
-      <set>
-        <option value="jdk-1.8.0_402-corretto-1.8.0_402-3183f394aec4-734fdc6e" />
-      </set>
-    </attachedChunks>
-  </component>
   <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
   <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
   <component name="TaskManager">
   <component name="TaskManager">
     <task active="true" id="Default" summary="Default task">
     <task active="true" id="Default" summary="Default task">
@@ -235,6 +211,10 @@
       <workItem from="1710143546149" duration="258000" />
       <workItem from="1710143546149" duration="258000" />
       <workItem from="1710143821704" duration="561000" />
       <workItem from="1710143821704" duration="561000" />
       <workItem from="1710335409948" duration="1570000" />
       <workItem from="1710335409948" duration="1570000" />
+      <workItem from="1710721567291" duration="198000" />
+      <workItem from="1710721799820" duration="2290000" />
+      <workItem from="1710740432278" duration="2248000" />
+      <workItem from="1710745462072" duration="7048000" />
     </task>
     </task>
     <task id="LOCAL-00001" summary="管理员登录">
     <task id="LOCAL-00001" summary="管理员登录">
       <option name="closed" value="true" />
       <option name="closed" value="true" />
@@ -362,7 +342,31 @@
       <option name="project" value="LOCAL" />
       <option name="project" value="LOCAL" />
       <updated>1710146731016</updated>
       <updated>1710146731016</updated>
     </task>
     </task>
-    <option name="localTasksCounter" value="17" />
+    <task id="LOCAL-00017" summary="修复bug">
+      <option name="closed" value="true" />
+      <created>1710721918252</created>
+      <option name="number" value="00017" />
+      <option name="presentableId" value="LOCAL-00017" />
+      <option name="project" value="LOCAL" />
+      <updated>1710721918252</updated>
+    </task>
+    <task id="LOCAL-00018" summary="生成PcbClients代码">
+      <option name="closed" value="true" />
+      <created>1710740580202</created>
+      <option name="number" value="00018" />
+      <option name="presentableId" value="LOCAL-00018" />
+      <option name="project" value="LOCAL" />
+      <updated>1710740580202</updated>
+    </task>
+    <task id="LOCAL-00019" summary="App端诊断日志上传">
+      <option name="closed" value="true" />
+      <created>1710750450574</created>
+      <option name="number" value="00019" />
+      <option name="presentableId" value="LOCAL-00019" />
+      <option name="project" value="LOCAL" />
+      <updated>1710750450574</updated>
+    </task>
+    <option name="localTasksCounter" value="20" />
     <servers />
     <servers />
   </component>
   </component>
   <component name="TypeScriptGeneratedFilesManager">
   <component name="TypeScriptGeneratedFilesManager">
@@ -392,6 +396,9 @@
     <MESSAGE value="视频上传修正" />
     <MESSAGE value="视频上传修正" />
     <MESSAGE value="合并master,3.11" />
     <MESSAGE value="合并master,3.11" />
     <MESSAGE value="增加master缺失文件,3.11" />
     <MESSAGE value="增加master缺失文件,3.11" />
-    <option name="LAST_COMMIT_MESSAGE" value="增加master缺失文件,3.11" />
+    <MESSAGE value="修复bug" />
+    <MESSAGE value="生成PcbClients代码" />
+    <MESSAGE value="App端诊断日志上传" />
+    <option name="LAST_COMMIT_MESSAGE" value="App端诊断日志上传" />
   </component>
   </component>
 </project>
 </project>

+ 4 - 2
src/main/java/com/om/controller/user/APPBrandController.java

@@ -1,10 +1,12 @@
 package com.om.controller.user;
 package com.om.controller.user;
 
 
+import com.om.entity.dto.AppBaseDTO;
 import com.om.entity.vo.BrandVO;
 import com.om.entity.vo.BrandVO;
 import com.om.service.IBrandService;
 import com.om.service.IBrandService;
 import com.om.utils.Result;
 import com.om.utils.Result;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
@@ -21,8 +23,8 @@ public class APPBrandController {
 
 
 
 
     @GetMapping("getList")
     @GetMapping("getList")
-    public Result<List<BrandVO>> getAPPList(){
-       return brandService.getAPPList();
+    public Result<List<BrandVO>> getAPPList(@RequestBody AppBaseDTO dto){
+       return brandService.getAPPList(dto);
     }
     }
 
 
 }
 }

+ 2 - 1
src/main/java/com/om/service/IBrandService.java

@@ -1,5 +1,6 @@
 package com.om.service;
 package com.om.service;
 
 
+import com.om.entity.dto.AppBaseDTO;
 import com.om.entity.dto.BrandDTO;
 import com.om.entity.dto.BrandDTO;
 import com.om.entity.dto.BrandQueryPageDTO;
 import com.om.entity.dto.BrandQueryPageDTO;
 import com.om.entity.po.Brand;
 import com.om.entity.po.Brand;
@@ -32,6 +33,6 @@ public interface IBrandService extends IService<Brand> {
 
 
     Result<BrandQueryPageVO> queryPageList(BrandQueryPageDTO dto);
     Result<BrandQueryPageVO> queryPageList(BrandQueryPageDTO dto);
 
 
-    Result<List<BrandVO>> getAPPList();
+    Result<List<BrandVO>> getAPPList(AppBaseDTO dto);
 
 
 }
 }

+ 41 - 4
src/main/java/com/om/service/impl/BrandServiceImpl.java

@@ -3,10 +3,13 @@ package com.om.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.om.entity.dto.AppBaseDTO;
 import com.om.entity.dto.BrandDTO;
 import com.om.entity.dto.BrandDTO;
 import com.om.entity.dto.BrandQueryPageDTO;
 import com.om.entity.dto.BrandQueryPageDTO;
+import com.om.entity.dto.GuidDTO;
 import com.om.entity.po.Brand;
 import com.om.entity.po.Brand;
 import com.om.entity.po.BrandClient;
 import com.om.entity.po.BrandClient;
+import com.om.entity.po.Client;
 import com.om.entity.vo.BrandQueryPageVO;
 import com.om.entity.vo.BrandQueryPageVO;
 import com.om.entity.vo.BrandVO;
 import com.om.entity.vo.BrandVO;
 import com.om.exception.BadReqException;
 import com.om.exception.BadReqException;
@@ -14,6 +17,8 @@ import com.om.mapper.BrandMapper;
 import com.om.service.IBrandClientService;
 import com.om.service.IBrandClientService;
 import com.om.service.IBrandService;
 import com.om.service.IBrandService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.om.service.IClientService;
+import com.om.utils.JwtUtils;
 import com.om.utils.Result;
 import com.om.utils.Result;
 import com.om.utils.UserContext;
 import com.om.utils.UserContext;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -40,6 +45,12 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
     @Resource
     @Resource
     private IBrandClientService brandClientService;
     private IBrandClientService brandClientService;
 
 
+    @Resource
+    private JwtUtils jwtUtils;
+
+    @Resource
+    private IClientService clientService;
+
     @Override
     @Override
     @Transactional
     @Transactional
     public Result createBrand(BrandDTO dto) {
     public Result createBrand(BrandDTO dto) {
@@ -245,12 +256,38 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
     }
     }
 
 
     @Override
     @Override
-    public Result<List<BrandVO>> getAPPList() {
-        //获取当前登录用户
-        Integer userId = UserContext.getUserId();
+    public Result<List<BrandVO>> getAPPList(AppBaseDTO dto) {
+        if (BeanUtil.isEmpty(dto)){
+            throw new BadReqException("数据为空");
+        }
 
 
+        String guid = dto.getGuid();
+        GuidDTO guidDTO = jwtUtils.getGuidDTOFromToken(guid);
+        String clientNum = guidDTO.getClientNum();
+        //根据客户端编号查询客户端id
+        Client client = clientService.lambdaQuery()
+                .eq(Client::getNumber, clientNum)
+                .one();
+        if (BeanUtil.isEmpty(client)){
+            throw new BadReqException("该客户端不存在!!");
+        }
+        //根据客户端id查询品牌客户端关联表
+        List<BrandClient> brandClients = brandClientService.lambdaQuery()
+                .eq(BrandClient::getClientId, client.getId())
+                .list();
+        List<Integer> brandids = brandClients.stream().map(c -> c.getBrandId()).collect(Collectors.toList());
+        if (brandids.isEmpty()){
+           return Result.ok();
+        }
+        List<Brand> brands = this.listByIds(brandids);
+        List<BrandVO> brandVOS = new ArrayList<>();
+        for (Brand brand : brands) {
+            BrandVO brandVO = BeanUtil.copyProperties(brand, BrandVO.class);
+
+            brandVOS.add(brandVO);
+        }
 
 
 
 
-        return null;
+        return Result.ok(brandVOS);
     }
     }
 }
 }