Selaa lähdekoodia

【华信科eis】【测试】

wub 3 vuotta sitten
vanhempi
commit
662521b4e1

+ 7 - 3
src/main/java/com/uas/eis/task/SyncProductStockTask.java

@@ -32,16 +32,18 @@ public class SyncProductStockTask {
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    //@Scheduled(cron = "0 0/2 * * * ?")
-    @Scheduled(cron = "0 0 2,8,14,20 * * ?")
+    @Scheduled(cron = "0 0/2 * * * ?")
+    //@Scheduled(cron = "0 0 2,8,14,15,20 * * ?")
     public void SyncProductStock() {
         SqlRowList rs2 = baseDao.queryForRowSet("select TO_CHAR(SYSDATE,'HH24') v_hour,TO_CHAR(SYSDATE,'MI') v_mi from dual");
         while(rs2.next()) {
+            baseDao.execute("update CUSTOMTABLE set ct_varchar50_11=to_char(sysdate,'yyyy-mm-dd HH24:mi:ss') where ct_id=1033910");
             String V_HOUR = rs2.getGeneralString("v_hour");
             String V_MI = rs2.getGeneralString("v_mi");
-            if (("08".equals(V_HOUR) || "20".equals(V_HOUR) || "02".equals(V_HOUR) || "14".equals(V_HOUR) )
+            if (("08".equals(V_HOUR) || "20".equals(V_HOUR) || "02".equals(V_HOUR) || "14".equals(V_HOUR) || "15".equals(V_HOUR) )
              //       && ("00".equals(V_MI)  )
             ) {
+                baseDao.execute("update CUSTOMTABLE set ct_varchar50_12=to_char(sysdate,'yyyy-mm-dd HH24:mi:ss') where ct_id=1033910");
                 X5JsonHttpClient x5JsonHttpClient = new X5JsonHttpClient(configuration.getX5appid(), configuration.getX5appkey(), configuration.getX5ProductStockUrl());
                 Map<String, Object> data = new HashMap<>();
                 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -55,6 +57,7 @@ public class SyncProductStockTask {
                         "and ct_statuscode='AUDITED' order by ct_id desc) where rownum=1)" +
                         "                 order by cd_detno) A) where rn<=1000";
                 SqlRowList rs = baseDao.queryForRowSet(Sql);
+                baseDao.execute("update CUSTOMTABLE set ct_varchar50_15=to_char(sysdate,'yyyy-mm-dd HH24:mi:ss') where ct_id=1033910");
                 while (rs.next()) {
                     Map<String, Object> map = new HashMap<>();
                     map.put("factory_code", configuration.getX5vendercode());
@@ -71,6 +74,7 @@ public class SyncProductStockTask {
                 }
                 data.put("data", list);
                 if (list.size() > 0) {
+                    baseDao.execute("update CUSTOMTABLE set ct_varchar50_16=to_char(sysdate,'yyyy-mm-dd HH24:mi:ss') where ct_id=1033910");
                     x5JsonHttpClient.post(data, configuration, baseDao, "ProductStock");
                 }
             }

+ 4 - 0
src/main/java/com/uas/eis/task/httpclient/X5JsonHttpClient.java

@@ -37,6 +37,7 @@ public class X5JsonHttpClient extends X5HttpClient {
 
     public <T> X5Response<T> post(Object body, Configuration configuration, BaseDao baseDao, String type) {
         String kind="";
+        baseDao.execute("update CUSTOMTABLE set ct_varchar50_17=to_char(sysdate,'yyyy-mm-dd HH24:mi:ss') where ct_id=1033910");
         if("ProductStock".equals(type)){
             kind="物料库存同步";
         }else if("ProductWIP".equals(type)){
@@ -66,17 +67,20 @@ public class X5JsonHttpClient extends X5HttpClient {
         String data = X5StringUtils.encodeBase64(JSON.toJSONString(x5Request));
         String encoding = null;
         String account=configuration.getX5username()+":"+configuration.getX5password();
+        baseDao.execute("update CUSTOMTABLE set ct_varchar50_18=to_char(sysdate,'yyyy-mm-dd HH24:mi:ss') where ct_id=1033910");
         try {
             encoding = DatatypeConverter.printBase64Binary(account.getBytes("UTF-8"));  //username  password 自行修改  中间":"不可少
         } catch (UnsupportedEncodingException e) {
             e.printStackTrace();
         }
         try {
+            baseDao.execute("update CUSTOMTABLE set ct_varchar50_19=to_char(sysdate,'yyyy-mm-dd HH24:mi:ss') where ct_id=1033910");
             Response executeResult = Request.Post(url).addHeader("Content-Type", "application/x-www-form-urlencoded").setHeader("Authorization","Basic " + encoding).connectTimeout(DEFAULT_COMMECT_TIMEOUT).socketTimeout(DEFAULT_SOCKET_TIMEOUT).bodyForm(Form.form().add("data", data).build()).execute();
             HttpResponse httpResponse = executeResult.returnResponse();
             StatusLine statusLine = httpResponse.getStatusLine();
             int statusCode = statusLine.getStatusCode();
             String responseContent = EntityUtils.toString(httpResponse.getEntity(), "utf-8");
+            baseDao.execute("update CUSTOMTABLE set ct_varchar50_10=to_char(sysdate,'yyyy-mm-dd HH24:mi:ss') where ct_id=1033910");
             if (statusCode == 200) {
                 x5Response = JSON.parseObject(responseContent, X5Response.class);
                 String HeaderCode = x5Response.getHeader().getCode();