|
@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@@ -158,15 +159,21 @@ public class StocktakingController extends BaseController {
|
|
|
|
|
|
@ApiOperation("完成任务")
|
|
|
@GetMapping("/taskComplete/{id}")
|
|
|
- public AjaxResult taskComplete(@PathVariable("id") Long id) {
|
|
|
- taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>().set("task_status", 3).eq("id", id));
|
|
|
+ public AjaxResult taskComplete(@PathVariable("id") Long id) throws Exception {
|
|
|
+ User currentUser = userService.getCurrentUser();
|
|
|
+ taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>().set("task_status", 3)
|
|
|
+ .set("oper_time", new Date())
|
|
|
+ .set("oper_by", currentUser.getId())
|
|
|
+ .eq("id", id));
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
@ApiOperation("任务更新库存")
|
|
|
- @GetMapping("/taskUpdateStock/{id}")
|
|
|
- public AjaxResult updateStock(@PathVariable("id") Long id) {
|
|
|
- taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>().set("task_status", 5).eq("id", id));
|
|
|
+ @GetMapping("/taskUpdateStock/{ids}")
|
|
|
+ public AjaxResult updateStock(@PathVariable("ids") Long[] ids) {
|
|
|
+ for (Long id : ids) {
|
|
|
+ taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>().set("task_status", 5).eq("id", id));
|
|
|
+ }
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|