|
@@ -33,6 +33,9 @@ import java.util.Map;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
+import java.util.concurrent.ScheduledExecutorService;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -144,8 +147,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
|
cleanMapper.insert(billClean);
|
|
|
|
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," +sdf.format(new Date()));
|
|
|
- baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + billPcr.getTestLocation());
|
|
|
- baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + billPcr.getTestLocationId());
|
|
|
+ baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getNextLocation());
|
|
|
+ baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getNextId());
|
|
|
String status = baseProcess.getCurrentStatus();
|
|
|
String substring = status.substring(0, status.length() - 1);
|
|
|
|
|
@@ -153,6 +156,19 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
|
|
|
|
processMapper.updateById(baseProcess);
|
|
|
pcrMapper.updateById(billPcr);
|
|
|
+ ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
|
|
|
+ Runnable task = new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ //这里写业务
|
|
|
+ billPcr.setBillStatus(3);
|
|
|
+ pcrMapper.updateById(billPcr);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ // 设定延迟时间(两小时后执行,单位为秒)
|
|
|
+ long delay = 60*60*2;
|
|
|
+ // 执行定时任务
|
|
|
+ scheduler.schedule(task, delay, TimeUnit.SECONDS);
|
|
|
return new Result(10000, "修改成功!", true);
|
|
|
} else {
|
|
|
|
|
@@ -208,6 +224,19 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
|
baseProcess.setProcessType(1);
|
|
|
processMapper.updateById(baseProcess);
|
|
|
pcrMapper.updateById(billPcr);
|
|
|
+ ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
|
|
|
+ Runnable task = new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ //这里写业务
|
|
|
+ billPcr.setBillStatus(3);
|
|
|
+ pcrMapper.updateById(billPcr);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ // 设定延迟时间(两小时后执行,单位为秒)
|
|
|
+ long delay = 60*60*2;
|
|
|
+ // 执行定时任务
|
|
|
+ scheduler.schedule(task, delay, TimeUnit.SECONDS);
|
|
|
return new Result(10000, "修改成功!", true);
|
|
|
} else {
|
|
|
if (baseLocation.getId() == 2) {
|
|
@@ -249,4 +278,23 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
|
baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + billPcr.getTestLocationId());
|
|
|
baseProcess.setCurrentStatus(baseProcess.getCurrentStatus() + "," + 2);
|
|
|
}
|
|
|
+ public String add() {
|
|
|
+ ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
|
|
|
+ Runnable task = new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+
|
|
|
+ //这里写业务
|
|
|
+ System.out.println();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 设定延迟时间(两小时后执行,单位为秒)
|
|
|
+ long delay = 3;
|
|
|
+
|
|
|
+ // 执行定时任务
|
|
|
+ scheduler.schedule(task, delay, TimeUnit.SECONDS);
|
|
|
+ System.out.println("完结");
|
|
|
+ return "成功";
|
|
|
+ }
|
|
|
}
|