wenhongquan 9 bulan lalu
induk
melakukan
e7e99a9a8e

+ 1 - 1
ruoyi-admin/src/main/resources/application-dev.yml

@@ -12,7 +12,7 @@ spring.boot.admin.client:
 powerjob:
   worker:
     # 如何开启调度中心请查看文档教程
-    enabled: true
+    enabled: ${POWERJOB_ENABLE:true}
     # 需要先在 powerjob 登录页执行应用注册后才能使用
     app-name: ruoyi-worker
     allow-lazy-connect-server: false

+ 1 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -121,6 +121,7 @@ security:
     - /actuator/**
     - /system/commonOther/**
     - /system/dzbcPath/list
+    - /system/dzbcBanner/list
 
 # 多租户配置
 tenant:

+ 2 - 1
ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/core/OssClient.java

@@ -169,7 +169,8 @@ public class OssClient {
     public String getUrl() {
         String domain = properties.getDomain();
         String endpoint = properties.getEndpoint();
-        String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://";
+//        String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://";
+        String header = "https://";
         // 云服务商直接返回
         if (StringUtils.containsAny(endpoint, OssConstant.CLOUD_SERVICE)) {
             if (StringUtils.isNotBlank(domain)) {

+ 27 - 3
ruoyi-modules/ruoyi-khy/src/main/java/org/dromara/system/controller/TblBagController.java

@@ -5,6 +5,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
@@ -113,7 +114,7 @@ public class TblBagController extends BaseController {
                         if(((JSONObject)item2).getStr("type").equals("cabinet")){
                             ((JSONObject) item2).put("location",item.getDictValue());
                             cabinetMap.put( item.getDictLabel(),(JSONObject)item2);
-                            cabinetMap2.put(((JSONObject) item2).getStr("cabinetType"),(JSONObject)item2);
+                            cabinetMap2.put(((JSONObject) item2).getStr("wdcode"),(JSONObject)item2);
                         }
                     });
                 }
@@ -124,6 +125,28 @@ public class TblBagController extends BaseController {
         TblBagBo bo1 =new TblBagBo();
         bo1.getParams().put("remark","");
 
+
+
+        if(cabinetMap!=null && cabinetMap.size()>0) {
+            ThreadUtil.execAsync(()->{
+                try {
+                    List<JSONObject> cabinetList = new ArrayList<>();
+                    cabinetMap.keySet().forEach(i->{
+                        JSONObject c = cabinetMap.get(i);
+                        if(c.getStr("location")!=null&&c.getStr("wdcode")!=null){
+                            c.put("deviceId", c.getStr("code"));
+                            c.put("stationId", c.getStr("wdcode"));
+                            c.put("deviceType", "cabinet");
+                            cabinetList.add(c);
+                        }
+                    } );
+
+                    SPlatUtils.SysDevice(cabinetList);
+                }catch (Exception e){
+                }
+            });
+        }
+
         QueryWrapper queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("remark","");
         queryWrapper.in("id", ids);
@@ -134,7 +157,7 @@ public class TblBagController extends BaseController {
             bagList.forEach(item->{
                 if(cabinetMap2.containsKey(item.getDeviceId().toString())){
                     JSONObject json = new JSONObject();
-                    json.put("deviceId",item.getDeviceId());
+                    json.put("deviceId" ,cabinetMap2.get(item.getDeviceId()).getStr("code"));
                     json.put("cpCode",item.getCpCode());
                     json.put("waybillNo",item.getWaybillNo());
                     json.put("scTime",item.getScTime());
@@ -153,8 +176,9 @@ public class TblBagController extends BaseController {
                     BeanUtils.copyProperties(item, item1);
                     SpringUtils.getBean(ITblBagService.class).updateByBo(item1);
                 });
+                return R.ok();
             }
         }
-        return R.ok();
+        return R.fail("同步失败");
     }
 }

+ 1 - 1
ruoyi-modules/ruoyi-khy/src/main/java/org/dromara/system/domain/TblBag.java

@@ -32,7 +32,7 @@ public class TblBag extends BaseEntity {
     /**
      * 快递柜编号
      */
-    private Long deviceId;
+    private String deviceId;
 
     /**
      * 寄取  1:下行派件入库2:下行派件出库3:上行揽件入库4:上行派件出库

+ 1 - 1
ruoyi-modules/ruoyi-khy/src/main/java/org/dromara/system/domain/bo/TblBagBo.java

@@ -32,7 +32,7 @@ public class TblBagBo extends BaseEntity {
      * 快递柜编号
      */
 //    @NotNull(message = "快递柜编号不能为空", groups = { AddGroup.class, EditGroup.class })
-    private Long deviceId;
+    private String deviceId;
 
     /**
      * 寄取  1:下行派件入库2:下行派件出库3:上行揽件入库4:上行派件出库

+ 1 - 1
ruoyi-modules/ruoyi-khy/src/main/java/org/dromara/system/domain/vo/TblBagVo.java

@@ -40,7 +40,7 @@ public class TblBagVo implements Serializable {
      * 快递柜编号
      */
     @ExcelProperty(value = "快递柜编号")
-    private Long deviceId;
+    private String deviceId;
 
     /**
      * 寄取  1:下行派件入库2:下行派件出库3:上行揽件入库4:上行派件出库

+ 1 - 4
ruoyi-modules/ruoyi-khy/src/main/java/org/dromara/util/CabinetUtil.java

@@ -309,7 +309,7 @@ public class CabinetUtil implements BasicProcessor {
                         if(((JSONObject)item2).getStr("type").equals("cabinet")){
                             ((JSONObject) item2).put("location",item.getDictValue());
                             cabinetMap.put( item.getDictLabel(),(JSONObject)item2);
-                            cabinetMap2.put(((JSONObject) item2).getStr("cabinetType"),(JSONObject)item2);
+                            cabinetMap2.put(((JSONObject) item2).getStr("wdcode"),(JSONObject)item2);
                         }
                     });
                 }
@@ -380,9 +380,6 @@ public class CabinetUtil implements BasicProcessor {
             }
             SPlatUtils.pushExpressInfo(jsonObjectList);
 
-
-
-
         }catch (Exception e){
 
         }

+ 6 - 1
ruoyi-modules/ruoyi-khy/src/main/java/org/dromara/util/SPlatUtils.java

@@ -1,16 +1,19 @@
 package org.dromara.util;
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.crypto.SecureUtil;
 import cn.hutool.crypto.digest.MD5;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import lombok.extern.slf4j.Slf4j;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+@Slf4j
 public class SPlatUtils {
     public final static String SPLAT_URL = "http://116.63.183.174:5050";
 
@@ -59,12 +62,14 @@ public class SPlatUtils {
            params.put("vid","baiwei");
            params.put("cpCode",jsonObject.get("cpCode"));
            params.put("scType",jsonObject.get("scType"));
-           params.put("scTime",jsonObject.get("scTime"));
+           params.put("scTime", DateUtil.format(jsonObject.getDate("scTime"),"yyyy-MM-dd HH:mm:ss"));
            params.put("waybillNo",jsonObject.get("waybillNo"));
            HttpResponse response = HttpUtil.createPost(url).header("satoken",token).body(JSONUtil.toJsonStr( params))
                .execute();
+           log.info(response.body());
        }
 
+
    }