lipenghui 1 месяц назад
Родитель
Сommit
103b369fe0

+ 0 - 3
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java

@@ -81,9 +81,6 @@ public class BpmMessageServiceImpl implements BpmMessageService {
         // 任务指定到具体人时 钉钉提醒
         // 根据审批人的id查询手机号
         AdminUserRespDTO user = adminUserApi.getUser(reqDTO.getAssigneeUserId());
-        // 构建消息提醒格式 【DeepOil】供应商审核流程-S20250314061116cce-中国石化,请前往 http://1.94.244.160:91/ 处理。 [2023-05-19 09:02:51]
-        // SupplierDO supplier = supplierService.getByBpmProcessId(reqDTO.getProcessInstanceId());
-        // String msg = "【DeepOil】供应商审核流程"+"-"+supplier.getCode()+"-"+supplier.getName()+",请前往 http://1.94.244.160:91/ 处理。"+"["+new Date()+"]";
         String msg = "【DeepOil】供应商审核流程 - 有新的供应商信息需要审核"+",请前往 http://1.94.244.160:91/ 处理。"+"["+new Date()+"]";
         String url = "";
         if ("故障上报流程".equals(reqDTO.getProcessInstanceName())){

+ 4 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/stat/IotStaticController.java

@@ -44,6 +44,7 @@ import com.google.common.collect.Lists;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.Data;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.client.RestTemplate;
@@ -88,6 +89,8 @@ public class IotStaticController {
     private RestTemplate restTemplate;
     @Autowired
     private IotMaintainService iotMaintainService;
+    @Value("${yanfan.url}")
+    private String yanfanUrl;
 
     @GetMapping("/main/day")
     public CommonResult<Map<String, Object>> getMaintainDay() {
@@ -371,8 +374,7 @@ public class IotStaticController {
         deviceHistoryParam.setBeginTime(beginTime);
         deviceHistoryParam.setEndTime(endTime);
 
-//        JSONObject jsonObject1 = restTemplate.postForObject("http://1.94.244.160:86/prod-api/login", ImmutableMap.of("username", "admin", "password", "123456"), JSONObject.class);
-        JSONObject jsonObject = restTemplate.postForObject("http://1.94.244.160:86/prod-api/data/center/deviceHistory", deviceHistoryParam, JSONObject.class);
+        JSONObject jsonObject = restTemplate.postForObject(yanfanUrl + "/prod-api/data/center/deviceHistory", deviceHistoryParam, JSONObject.class);
         JSONArray object = JSON.parseArray(JSON.toJSONString(jsonObject.get("data")));
 
         return CommonResult.success(object);

+ 4 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/job/MapLngLatJob.java

@@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
 import cn.iocoder.yudao.module.pms.dal.mysql.IotDeviceMapper;
 import com.alibaba.fastjson.JSON;
 import com.xingyuv.captcha.util.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
 
@@ -26,6 +27,8 @@ public class MapLngLatJob implements JobHandler {
     private IotDeviceMapper iotDeviceMapper;
     @Resource
     private RestTemplate restTemplate;
+    @Value("${yanfan.url}")
+    private String yanfanUrl;
 
     @Override
     @TenantIgnore
@@ -34,7 +37,7 @@ public class MapLngLatJob implements JobHandler {
         List<IotDeviceDO> iotDeviceDOS = iotDeviceMapper.selectDataCollect();
         iotDeviceDOS.forEach(deviceDO -> {
             if (Objects.nonNull(deviceDO.getYfDeviceId())) {
-                TableDataInfo tableDataInfo = restTemplate.getForObject("http://1.94.244.160:86/prod-api/iot/device/listThingsModel?deviceId="+deviceDO.getYfDeviceId()+"&pageNum=1&pageSize=200", TableDataInfo.class);
+                TableDataInfo tableDataInfo = restTemplate.getForObject(yanfanUrl + "/prod-api/iot/device/listThingsModel?deviceId="+deviceDO.getYfDeviceId()+"&pageNum=1&pageSize=200", TableDataInfo.class);
                 if (Objects.isNull(tableDataInfo)) {
                     return;
                 }

+ 4 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceServiceImpl.java

@@ -34,6 +34,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.ImmutableMap;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
@@ -78,6 +79,8 @@ public class IotDeviceServiceImpl implements IotDeviceService {
     private IotBomService iotBomService;
     @Resource
     private RestTemplate restTemplate;
+    @Value("${yanfan.url}")
+    private String yanfanUrl;
 
     @Override
     public List<IotDeviceDO> getMapDevice() {
@@ -86,7 +89,7 @@ public class IotDeviceServiceImpl implements IotDeviceService {
 
     @Override
     public List<ThingsModelDTO> getTdParams(IotDeviceDO iotDeviceDO) {
-        TableDataInfo tableDataInfo = restTemplate.getForObject("http://1.94.244.160:86/prod-api/iot/device/listThingsModel?deviceId="+iotDeviceDO.getYfDeviceId()+"&pageNum=1&pageSize=200", TableDataInfo.class);
+        TableDataInfo tableDataInfo = restTemplate.getForObject(yanfanUrl + "/prod-api/iot/device/listThingsModel?deviceId="+iotDeviceDO.getYfDeviceId()+"&pageNum=1&pageSize=200", TableDataInfo.class);
         if (tableDataInfo == null) {
             return new ArrayList<>();
         }

+ 4 - 2
yudao-server/src/main/resources/application-dev.yaml

@@ -53,13 +53,13 @@ spring:
         slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
           lazy: true # 开启懒加载,保证启动速度
 #          url: jdbc:mysql://1.94.244.160:3306/rqiot?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
-          url: jdbc:mysql://1.94.244.160:3306/yanfan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+          url: jdbc:mysql://172.21.20.20:3306/yanfan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
           username: root
           password: .N_Mdq!BR1W4
         # TDengine数据库
         tdengine:
           enabled: true
-          url: jdbc:TAOS-RS://1.94.244.160:6041/iot_log?allowMultiQueries=true
+          url: jdbc:TAOS-RS://172.21.10.65:6041/iot_log?allowMultiQueries=true
           username: root
           password: taosdata
           driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
@@ -266,6 +266,8 @@ iot:
     # 清除会话(设置为false,断开连接,重连后使用原来的会话 保留订阅的主题,能接收离线期间的消息)
     clearSession: true
 
+yanfan:
+  url: http://172.21.10.65
 
 # 插件配置
 pf4j: