|
@@ -8,6 +8,7 @@ import thyyxxk.simzfeeoprnsystm.pojo.SiSetlinfo;
|
|
|
import thyyxxk.simzfeeoprnsystm.service.SiMzFeeService;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@Component
|
|
|
public class ScheduledTask {
|
|
@@ -20,11 +21,12 @@ public class ScheduledTask {
|
|
|
this.dao = dao;
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 0 2 * * ?")
|
|
|
- public void cancelSettlement() {
|
|
|
+ @Scheduled(fixedRate = 1000 * 60 * 60 * 2)
|
|
|
+ public void cancelSettlement() throws Exception {
|
|
|
List<SiSetlinfo> list = dao.selectSetlinfos();
|
|
|
- if (null != list && !list.isEmpty()) {
|
|
|
- list.forEach(service::revokeOutpatientSettlementForTask);
|
|
|
+ for (SiSetlinfo setlinfo : list) {
|
|
|
+ service.revokeOutpatientSettlementForTask(setlinfo);
|
|
|
+ TimeUnit.SECONDS.sleep(2);
|
|
|
}
|
|
|
}
|
|
|
}
|