hu il y a 2 ans
Parent
commit
97eef85cbd

+ 4 - 3
src/custom/service/AutoDockItemService.java

@@ -32,13 +32,14 @@ public class AutoDockItemService extends ServiceController {
         RowsMap itemRowsMap = itemRows.toRowsMap("itemno");
         RowsMap itemRowsMapAll = itemRowsAll.toRowsMap("itemno");
         ERPDocking erpDocking =new ERPDocking();
-        Rows servicesRows = dbConnect.runSqlQuery("select lastruntime from sys_services where classname='AutoDockItemService'");
+        Rows servicesRows = dbConnect.runSqlQuery("select lastruntime,lastruntime1 from sys_services where classname='AutoDockItemService'");
         Date date =new Date();
         if(!servicesRows.isEmpty()){
-            if(StringUtils.isNotBlank(servicesRows.get(0).getString("lastruntime"))){
-                date=servicesRows.get(0).getDate("lastruntime");
+            if(StringUtils.isNotBlank(servicesRows.get(0).getString("lastruntime1"))){
+                date=servicesRows.get(0).getDate("lastruntime1");
             }
         }
+        dbConnect.runSqlUpdate("update sys_services set lastruntime1=now() where classname='AutoDockItemService'");
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         JSONArray jsonArray = erpDocking.getErpItemRows(simpleDateFormat.format(date), 100000, 1);
         if(!jsonArray.isEmpty()){

+ 2 - 0
src/custom/utility/ERPDocking.java

@@ -82,6 +82,8 @@ public class ERPDocking {
         map.put("content-Type", "application/json");
         String result = new WebRequest().doPost(object.toString(), "http://124.71.196.182:8001/rest/ws_v2/basicDrp", map);
         JSONObject resultobject = JSONObject.parseObject(result);
+        System.out.println(object.toString());
+         System.out.println(resultobject.toJSONString());
         if(resultobject.getString("errcode").equals("0")){
             return resultobject.getJSONObject("results").getJSONArray("list");
         }else {