|
@@ -17,7 +17,9 @@
|
|
package com.fjhx.scheduling.controller;
|
|
package com.fjhx.scheduling.controller;
|
|
|
|
|
|
import com.fjhx.entity.scheduling.Scheduling;
|
|
import com.fjhx.entity.scheduling.Scheduling;
|
|
|
|
+import com.fjhx.entity.stock.StockSchedulingTest;
|
|
import com.fjhx.scheduling.service.ISchedulingService;
|
|
import com.fjhx.scheduling.service.ISchedulingService;
|
|
|
|
+import com.fjhx.scheduling.service.StockSchedulingTestService;
|
|
import com.fjhx.utils.HmacUtil;
|
|
import com.fjhx.utils.HmacUtil;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
@@ -41,6 +43,7 @@ import java.util.Date;
|
|
public class SchedulingController extends BladeController {
|
|
public class SchedulingController extends BladeController {
|
|
|
|
|
|
private final ISchedulingService schedulingService;
|
|
private final ISchedulingService schedulingService;
|
|
|
|
+ private final StockSchedulingTestService stockSchedulingTestService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 新增
|
|
* 新增
|
|
@@ -55,4 +58,17 @@ public class SchedulingController extends BladeController {
|
|
return R.status(schedulingService.save(scheduling));
|
|
return R.status(schedulingService.save(scheduling));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 新增
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/test/save")
|
|
|
|
+ public R testSave(@RequestBody StockSchedulingTest scheduling, @RequestHeader("Authority") String authority, @RequestHeader("date") String date) {
|
|
|
|
+ if (!StringUtil.equals(HmacUtil.encrypt("fjhx" + date, "fjhx@2012"), authority)) {
|
|
|
|
+ return R.fail("无权限");
|
|
|
|
+ }
|
|
|
|
+ scheduling.setCreateTime(new Date());
|
|
|
|
+ scheduling.setId(null);
|
|
|
|
+ return R.status(stockSchedulingTestService.save(scheduling));
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|