浏览代码

寄存代发

yuansh 4 天之前
父节点
当前提交
37758bec35

+ 3 - 1
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -881,6 +881,8 @@ public class DateUtils extends PropertyEditorSupport {
 
     public static void main(String[] args) {
         System.out.println(nowYear());
-        System.out.println(getYear());
+        System.out.println(formatDate());
+        String date= DateUtils.formatDate()+" 00:00:00";
+        System.out.println(date);
     }
 }

+ 5 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInterfaceSyncServiceImpl.java

@@ -14,6 +14,7 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.baseCode.entity.BaseProductArchive;
 import org.jeecg.modules.baseCode.entity.BaseShipArchive;
 import org.jeecg.modules.baseCode.mapper.BaseProductArchiveMapper;
@@ -45,6 +46,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.time.Instant;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -90,7 +92,9 @@ public class SaleInterfaceSyncServiceImpl extends ServiceImpl<SaleInterfaceSyncM
 
         try {
 
-            JsonNode jsonNode = HttpUtils.getDateListByUrl(null);
+            Date submitDate = saleInterfaceSync.getRequestedDeliveryDate();
+            String date = DateUtils.date2Str(submitDate,new SimpleDateFormat("yyyy-MM-dd"));
+            JsonNode jsonNode = HttpUtils.getDateListByUrl(null,date);
             String content = jsonNode.get("content").toPrettyString();
 
             String numberOfElements = jsonNode.get("numberOfElements").toPrettyString();

+ 16 - 9
srm-module-code/src/main/java/org/jeecg/modules/saleCode/util/HttpUtils.java

@@ -130,22 +130,23 @@ public class HttpUtils {
     public static void main(String[] args) throws Exception {
 //        String token = getAccessToken();
 //        System.out.println("======="+token);
-        String ACCESS_TOKEN="m4uTcejqjMj1LuJUzPi67LM7Oq48FndY";
-//        JsonNode jsonNode = getDateListByUrl(ACCESS_TOKEN);
+        String ACCESS_TOKEN="lsywoSYFwf204Q7WNtuWoO47iZImsNXL";
+        JsonNode jsonNode = getDateListByUrl(ACCESS_TOKEN,null);
+        System.out.println("================1===--------------");
+        System.out.println(jsonNode.toString());
 ////        ObjectMapper mapper = new ObjectMapper();
 //////
 //////
-       JsonNode jsonNodeAll = getDateByUrl("22efb768-da48-415e-88d3-924350b6c23e",ACCESS_TOKEN);
+//       JsonNode jsonNodeAll = getDateByUrl("22efb768-da48-415e-88d3-924350b6c23e",ACCESS_TOKEN);
 ////////
-//        System.out.println("================1===--------------");
-//       System.out.println(jsonNode.toString());
+
 ////
-        String buyerContact = jsonNodeAll.get("lineItems").toPrettyString();
+//        String buyerContact = jsonNodeAll.get("lineItems").toPrettyString();
 //////
 //////
 ////////        JsonNode jsonNodeAll2 = mapper.readTree(buyerContact);
-        System.out.println("==============111--------------");
-        System.out.println(buyerContact);
+//        System.out.println("==============111--------------");
+//        System.out.println(buyerContact);
 ////        Map<String, Object> buyerContact2Map = mapper.readValue(buyerContact, new TypeReference<Map<String, Object>>() {
 ////                });
 //        List<Map<String, Object>> result = mapper.readValue(buyerContact, new TypeReference<List<Map<String, Object>>>() {});
@@ -190,15 +191,21 @@ public class HttpUtils {
 //        System.out.println(totalPages);
     }
 
-    public static JsonNode getDateListByUrl(String ACCESS_TOKEN ) throws Exception {
+    public static JsonNode getDateListByUrl(String ACCESS_TOKEN,String date) throws Exception {
 
         if(StringUtils.isBlank(ACCESS_TOKEN)){
             ACCESS_TOKEN = getAccessToken();
         }
 
+        if(StringUtils.isBlank(date)){
+            date= DateUtils.formatDate()+" 00:00:00";
+//            date= "2025-05-14 00:00:00";
+        }
         try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
 
             URIBuilder uriBuilder = new URIBuilder(API_URL_LIST)
+                    .addParameter("type", "RequestForQuote")   // 询价
+                    .addParameter("submittedDate", date)   // 日期开始
                     .addParameter("pageNumber", "1")   // 页码参数
                     .addParameter("pageSize", "50");              // 每页数量