|
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -31,13 +32,13 @@ public class SyncProductStockTask {
|
|
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
|
|
|
- //@Scheduled(cron = "0 0/2 * * * ?")
|
|
|
|
|
|
|
+ @Scheduled(cron = "0 0/2 * * * ?")
|
|
|
public void SyncProductStock() {
|
|
public void SyncProductStock() {
|
|
|
SqlRowList rs2 = baseDao.queryForRowSet("select TO_CHAR(SYSDATE,'HH24') v_hour,TO_CHAR(SYSDATE,'MI') v_mi from dual");
|
|
SqlRowList rs2 = baseDao.queryForRowSet("select TO_CHAR(SYSDATE,'HH24') v_hour,TO_CHAR(SYSDATE,'MI') v_mi from dual");
|
|
|
while(rs2.next()) {
|
|
while(rs2.next()) {
|
|
|
String V_HOUR = rs2.getGeneralString("v_hour");
|
|
String V_HOUR = rs2.getGeneralString("v_hour");
|
|
|
String V_MI = rs2.getGeneralString("v_mi");
|
|
String V_MI = rs2.getGeneralString("v_mi");
|
|
|
- if (("08".equals(V_HOUR) || "20".equals(V_HOUR) )
|
|
|
|
|
|
|
+ if (("08".equals(V_HOUR) || "20".equals(V_HOUR) || "11".equals(V_HOUR) )
|
|
|
//&& ("00".equals(V_MI) || "04".equals(V_MI) )
|
|
//&& ("00".equals(V_MI) || "04".equals(V_MI) )
|
|
|
) {
|
|
) {
|
|
|
X5JsonHttpClient x5JsonHttpClient = new X5JsonHttpClient(configuration.getX5appid(), configuration.getX5appkey(), configuration.getX5ProductStockUrl());
|
|
X5JsonHttpClient x5JsonHttpClient = new X5JsonHttpClient(configuration.getX5appid(), configuration.getX5appkey(), configuration.getX5ProductStockUrl());
|