lyhzzz 1 week ago
parent
commit
5957983ea7

+ 13 - 0
src/main/java/com/fdkankan/fusion/controller/BaseController.java

@@ -15,6 +15,7 @@ import org.springframework.data.domain.Sort.Direction;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.WebDataBinder;
 import org.springframework.web.bind.annotation.InitBinder;
+import scala.Int;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -42,6 +43,18 @@ public class BaseController {
         Object userName = jwt.getPayload("nickName");
         return userName.toString();
     }
+
+    protected Integer getPlatformId(){
+        JWT jwt = JWTUtil.parseToken(getToken());
+        Object platformId = jwt.getPayload("platformId");
+        return Integer.valueOf(platformId.toString());
+    }
+
+    protected Integer getSysUserId(){
+        JWT jwt = JWTUtil.parseToken(getToken());
+        Object sysUserId = jwt.getPayload("id");
+        return Integer.valueOf(sysUserId.toString());
+    }
     protected String getDeptId(){
         return "";
     }

+ 7 - 1
src/main/java/com/fdkankan/fusion/controller/CaseOverviewController.java

@@ -1,6 +1,7 @@
 package com.fdkankan.fusion.controller;
 
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.fdkankan.fusion.aop.PushJm;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultCode;
@@ -13,6 +14,7 @@ import com.fdkankan.fusion.entity.CaseEntity;
 import com.fdkankan.fusion.entity.CaseOverview;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.httpClient.client.OtherClient;
+import com.fdkankan.fusion.service.ICaseFilesTypeIconService;
 import com.fdkankan.fusion.service.ICaseOverviewService;
 import com.fdkankan.fusion.service.ICaseService;
 import com.fdkankan.fusion.service.ICaseTabulationService;
@@ -33,7 +35,7 @@ import java.util.HashMap;
  */
 @RestController
 @RequestMapping("/caseOverview")
-public class CaseOverviewController {
+public class CaseOverviewController extends BaseController{
 
     @Autowired
     ICaseOverviewService caseOverviewService;
@@ -71,10 +73,14 @@ public class CaseOverviewController {
     @PostMapping("/addOrUpdate")
     @PushJm(event_content = "添加绘图")
     public ResultData addOrUpdate(@RequestBody CaseOverview caseOverview) {
+        caseOverview.setPlatformId(getPlatformId());
+        caseOverview.setSysUserId(getSysUserId());
         caseOverviewService.saveOrUpdate(caseOverview);
         if (caseOverview.getCaseTabulation() != null) {
             caseOverview.getCaseTabulation().setOverviewId(caseOverview.getId());
             caseOverview.getCaseTabulation().setCaseId(caseOverview.getCaseId());
+            caseOverview.getCaseTabulation().setSysUserId(caseOverview.getSysUserId());
+            caseOverview.getCaseTabulation().setPlatformId(caseOverview.getPlatformId());
             caseTabulationService.addOrUpdate(caseOverview.getCaseTabulation());
         }
         return ResultData.ok(caseOverview);

+ 3 - 1
src/main/java/com/fdkankan/fusion/controller/CaseTabulationController.java

@@ -32,7 +32,7 @@ import java.util.HashMap;
 @RestController
 @RequestMapping("/caseTabulation")
 @Slf4j
-public class CaseTabulationController {
+public class CaseTabulationController extends BaseController{
 
 
     @Autowired
@@ -68,6 +68,8 @@ public class CaseTabulationController {
     @PostMapping("/addOrUpdate")
     @PushJm(event_content = "添加制表")
     public ResultData addOrUpdate (@RequestBody CaseTabulation caseTabulation){
+        caseTabulation.setPlatformId(getPlatformId());
+        caseTabulation.setSysUserId(getSysUserId());
         caseTabulationService.addOrUpdate(caseTabulation);
         try {
             if( StringUtils.isNotBlank(caseTabulation.getListCover()) && caseTabulation.getOverviewId() != null){

+ 6 - 0
src/main/java/com/fdkankan/fusion/controller/MapConfigController.java

@@ -61,6 +61,7 @@ public class MapConfigController {
                 MapVo vo = new MapVo();
                 vo.setLocation(jsonObject1.getString(mapConfig.getRespLocationKey()));
                 vo.setAddress(jsonObject1.getString(mapConfig.getRespAddressKey()));
+                vo.setName(jsonObject1.getString(mapConfig.getRespNameKey()));
                 mapVos.add(vo);
             }
             return ResultData.ok(mapVos);
@@ -70,5 +71,10 @@ public class MapConfigController {
 
         return ResultData.ok();
     }
+
+    public static void main(String[] args) {
+        String s = HttpUtil.get("https://restapi.amap.com/v3/place/text?keywords={address}&offset=20&page=1&key=3609daa52e8ae4493393292213e2fb98&extensions=base");
+
+    }
 }
 

+ 6 - 0
src/main/java/com/fdkankan/fusion/entity/CaseOverview.java

@@ -80,6 +80,12 @@ public class CaseOverview implements Serializable {
     @TableField("sub_group")
     private Integer subGroup;
 
+    @TableField("sys_user_id")
+    private Integer sysUserId;
+
+    @TableField("platform_id")
+    private Integer platformId;
+
     @TableField(exist = false)
     private CaseTabulation caseTabulation;
 

+ 5 - 0
src/main/java/com/fdkankan/fusion/entity/CaseTabulation.java

@@ -87,4 +87,9 @@ public class CaseTabulation implements Serializable {
     @TableField("list_cover")
     private String listCover;
 
+    @TableField("sys_user_id")
+    private Integer sysUserId;
+
+    @TableField("platform_id")
+    private Integer platformId;
 }

+ 2 - 0
src/main/java/com/fdkankan/fusion/entity/MapConfig.java

@@ -46,6 +46,8 @@ public class MapConfig implements Serializable {
     @TableField("resp_address_key")
     private String respAddressKey;
 
+    @TableField("resp_name_key")
+    private String respNameKey;
 
     @TableField("tb_status")
     @TableLogic

+ 1 - 0
src/main/java/com/fdkankan/fusion/httpClient/request/ManageSceneParam.java

@@ -8,4 +8,5 @@ public class ManageSceneParam extends RequestBase {
     private Integer isObj =1;
     private String sceneName;
     private Integer sceneStatus = -2;
+    private String num;
 }

+ 1 - 0
src/main/java/com/fdkankan/fusion/response/MapVo.java

@@ -6,4 +6,5 @@ import lombok.Data;
 public class MapVo {
     private String location;
     private String address;
+    private String name;
 }