|
|
@@ -19,6 +19,7 @@ import com.th.demo.service.ware.OutService;
|
|
19
|
19
|
import com.th.demo.tools.JSONTools;
|
|
20
|
20
|
import com.th.demo.tools.Tools;
|
|
21
|
21
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
22
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
22
|
23
|
import org.springframework.stereotype.Service;
|
|
23
|
24
|
import org.springframework.transaction.annotation.Transactional;
|
|
24
|
25
|
|
|
|
@@ -54,6 +55,8 @@ public class OutServiceImpl implements OutService {
|
|
54
|
55
|
|
|
55
|
56
|
String result = Type.FAIL;
|
|
56
|
57
|
int num = 0;
|
|
|
58
|
+ // 定时任务执行统计
|
|
|
59
|
+ int count = 0;
|
|
57
|
60
|
|
|
58
|
61
|
@Override
|
|
59
|
62
|
public String out(String json, String userId, String belongId) {
|
|
|
@@ -357,4 +360,22 @@ public class OutServiceImpl implements OutService {
|
|
357
|
360
|
}
|
|
358
|
361
|
|
|
359
|
362
|
|
|
|
363
|
+ /**
|
|
|
364
|
+ * 库存状态检测方法(定时)
|
|
|
365
|
+ */
|
|
|
366
|
+ @Scheduled(cron = "0 * * * * *")
|
|
|
367
|
+ public void checkStock() {
|
|
|
368
|
+ count += 1;
|
|
|
369
|
+// 查询未出库状态,出库单存在的数据
|
|
|
370
|
+// List<String> list = distributionMapper.selectWaitOutIds();
|
|
|
371
|
+// if(!list.isEmpty()){
|
|
|
372
|
+// for (String storeId : list) {
|
|
|
373
|
+//// 根据id修改主表出库状态
|
|
|
374
|
+// distributionMapper.updateOutStatus(storeId);
|
|
|
375
|
+// }
|
|
|
376
|
+// }
|
|
|
377
|
+ System.out.println("执行定时任务_______"+count);
|
|
|
378
|
+
|
|
|
379
|
+ }
|
|
|
380
|
+
|
|
360
|
381
|
}
|