Procházet zdrojové kódy

用户管理接口 接口

chejianzheng před 3 měsíci
rodič
revize
872a9a6f55

+ 29 - 0
portal-service-application/src/main/java/com/hfln/portal/application/controller/web/WebStatsController.java

@@ -0,0 +1,29 @@
+
+package com.hfln.portal.application.controller.web;
+
+
+import cn.hfln.framework.catchlog.CatchAndLog;
+import com.hfln.portal.domain.gateway.WebStatsGateway;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@CatchAndLog
+@Tag(name = "web端统计相关")
+@Slf4j
+@RequestMapping("/web/stats")
+public class WebStatsController {
+
+    @Autowired
+    private WebStatsGateway webStatsGateway;
+
+//    @PostMapping("/addDic")
+//    @Operation(summary = "添加字典类值")
+//    public ApiResult<Void> addDic(@RequestBody @Valid DicAddParam param){
+//        webGateway.addDic(param);
+//        return ApiResult.success();
+//    }
+}

+ 14 - 0
portal-service-domain/src/main/java/com/hfln/portal/domain/gateway/WebStatsGateway.java

@@ -0,0 +1,14 @@
+package com.hfln.portal.domain.gateway;
+
+import com.hfln.portal.common.dto.data.pub.DicItemDto;
+
+import java.util.List;
+
+public interface WebStatsGateway {
+
+
+    List<DicItemDto> query(String dicType);
+
+//    void uploadWJ(MultipartFile file,  String fileType) throws IOException;
+}
+

+ 33 - 0
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/WebStatsGatewayImpl.java

@@ -0,0 +1,33 @@
+package com.hfln.portal.infrastructure.gateway.impl;
+
+import com.hfln.portal.common.dto.data.pub.DicItemDto;
+import com.hfln.portal.domain.customer.util.CopyUtils;
+import com.hfln.portal.domain.gateway.WebStatsGateway;
+import com.hfln.portal.infrastructure.service.OssFileService;
+import com.hfln.portal.infrastructure.service.TblDicItemService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Slf4j
+@Service
+public class WebStatsGatewayImpl implements WebStatsGateway {
+
+
+    @Autowired
+    private TblDicItemService tblDicItemService;
+
+
+    @Autowired
+    private OssFileService ossFileService;
+
+
+    @Override
+    public List<DicItemDto> query(String dicType) {
+        return CopyUtils.copyList(tblDicItemService.queryByDicType(dicType), DicItemDto.class);
+    }
+
+}
+

+ 7 - 4
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/mqtt/MqttSubHandle.java

@@ -374,10 +374,13 @@ public class MqttSubHandle {
                 target.setEvent(messageType);
                 devTargetService.save(target);*/
 
-                DevInfo devInfo = new DevInfo();
-                devInfo.setTargetPoints(targetPointsStr);
-                devInfo.setSignalTime(LocalDateTime.now());
-                devInfoService.update(devInfo, new LambdaUpdateWrapper<DevInfo>().eq(DevInfo::getClientId, clientId));
+                // todo 当前设备 监测 的最后一次 点位信息
+//                redisservice.hget(RedisCacheConstant.KEY_DEVICE_pre + clientId, "lastTargetTime“)
+//                redisservice.hget(RedisCacheConstant.KEY_DEVICE_pre + clientId, "lastTargetStr“)
+//                DevInfo devInfo = new DevInfo();
+//                devInfo.setTargetPoints(targetPointsStr);
+//                devInfo.setSignalTime(LocalDateTime.now());
+//                devInfoService.update(devInfo, new LambdaUpdateWrapper<DevInfo>().eq(DevInfo::getClientId, clientId));
             } else {
                 log.info("此次targetPoints与上次相同!");
             }

+ 1 - 1
portal-service-server/src/main/resources/bootstrap-dev.yml

@@ -119,4 +119,4 @@ oss:
   bucket: lnxx.oss-cn-shanghai.aliyuncs.com
   region: cn-shanghai
   expire:
-    seconds: 300
+    seconds: 3600

+ 1 - 1
portal-service-server/src/main/resources/bootstrap-local.yml

@@ -119,4 +119,4 @@ oss:
   bucket: lnxx.oss-cn-shanghai.aliyuncs.com
   region: cn-shanghai
   expire:
-    seconds: 300
+    seconds: 3600

+ 1 - 1
portal-service-server/src/main/resources/bootstrap-test.yml

@@ -118,4 +118,4 @@ oss:
   bucket: lnxx.oss-cn-shanghai.aliyuncs.com
   region: cn-shanghai
   expire:
-    seconds: 300
+    seconds: 3600