|
@@ -1,27 +1,30 @@
|
|
|
package com.jsh.erp.controller.pda;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.jsh.erp.base.AjaxResult;
|
|
|
import com.jsh.erp.base.BaseController;
|
|
|
import com.jsh.erp.base.TableDataInfo;
|
|
|
import com.jsh.erp.datasource.entities.DepotHead;
|
|
|
import com.jsh.erp.datasource.entities.Supplier;
|
|
|
+import com.jsh.erp.datasource.entities.TaskStocktakingItem;
|
|
|
+import com.jsh.erp.datasource.entities.User;
|
|
|
import com.jsh.erp.datasource.pda.dto.PDADepotHeadDTO;
|
|
|
import com.jsh.erp.datasource.pda.dto.PDATaskStocktakingDTO;
|
|
|
import com.jsh.erp.datasource.pda.vo.PDADepotHeadVO;
|
|
|
import com.jsh.erp.datasource.pda.vo.PDADepotItemVO;
|
|
|
+import com.jsh.erp.datasource.pda.vo.PDATaskStocktakingItemVO;
|
|
|
import com.jsh.erp.datasource.pda.vo.PDATaskStocktakingVO;
|
|
|
+import com.jsh.erp.datasource.vo.TaskStocktakingVO;
|
|
|
import com.jsh.erp.query.LambdaQueryWrapperX;
|
|
|
-import com.jsh.erp.service.DepotHeadService;
|
|
|
-import com.jsh.erp.service.DepotItemService;
|
|
|
-import com.jsh.erp.service.SupplierService;
|
|
|
-import com.jsh.erp.service.TaskStocktakingService;
|
|
|
+import com.jsh.erp.service.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@@ -41,6 +44,12 @@ public class PdaController extends BaseController {
|
|
|
@Resource
|
|
|
private TaskStocktakingService taskStocktakingService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private TaskStocktakingItemService taskStocktakingItemService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 采购入库
|
|
|
* @return
|
|
@@ -113,23 +122,55 @@ public class PdaController extends BaseController {
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
-// @ApiModelProperty(value = "盘点任务详情-商品列表")
|
|
|
-// @GetMapping("/taskStocktakingItemList/{taskId}")
|
|
|
-// public TableDataInfo taskStocktakingItemList(@PathVariable("taskId") Long taskId){
|
|
|
-// startPage();
|
|
|
-// return getDataTable();
|
|
|
-// }
|
|
|
+ @ApiModelProperty(value = "盘点任务详情-商品列表")
|
|
|
+ @GetMapping("/taskStocktakingItemList/{taskId}")
|
|
|
+ public TableDataInfo taskStocktakingItemList(@PathVariable("taskId") Long taskId){
|
|
|
+ startPage();
|
|
|
+ List<PDATaskStocktakingItemVO> list = taskStocktakingService.pdaItemList(taskId);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
|
|
|
- @ApiModelProperty("盘点任务详情")
|
|
|
+ @ApiOperation("盘点任务详情")
|
|
|
@GetMapping("/taskStocktakingDetail/{taskId}")
|
|
|
- public AjaxResult taskStocktakingDetail(@PathVariable("taskId") Long taskId) {
|
|
|
+ public AjaxResult taskStocktakingDetail(@PathVariable("taskId") Long taskId) throws Exception{
|
|
|
+ TaskStocktakingVO taskStocktakingVO = taskStocktakingService.pdaDetail(taskId);
|
|
|
+ return AjaxResult.success(taskStocktakingVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("盘点")
|
|
|
+ @PostMapping("/stocktaking")
|
|
|
+ public AjaxResult stocktaking(@RequestBody TaskStocktakingItem taskStocktakingItem) throws Exception{
|
|
|
+ User currentUser = userService.getCurrentUser();
|
|
|
+ UpdateWrapper<TaskStocktakingItem> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("id", taskStocktakingItem.getId())
|
|
|
+ .set("creator", currentUser.getId())
|
|
|
+ .set("oper_time", new Date());
|
|
|
+ if (ObjectUtil.isNotEmpty(taskStocktakingItem.getNewInventory())) {
|
|
|
+ updateWrapper.set("new_inventory", taskStocktakingItem.getNewInventory());
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(taskStocktakingItem.getNewPosition())) {
|
|
|
+ updateWrapper.set("new_position", taskStocktakingItem.getNewPosition());
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(taskStocktakingItem.getDifferenceCount())) {
|
|
|
+ updateWrapper.set("difference_count", taskStocktakingItem.getDifferenceCount());
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(taskStocktakingItem.getDifferenceReason())){
|
|
|
+ updateWrapper.set("difference_reason", taskStocktakingItem.getDifferenceReason());
|
|
|
+ }
|
|
|
+ taskStocktakingItemService.update(updateWrapper);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation("用于返回字段说明")
|
|
|
+ @ApiOperation("订单-用于返回字段说明")
|
|
|
@GetMapping("test")
|
|
|
public AjaxResult test(PDADepotItemVO pdaDepotItemVO) {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("盘点-用于字段返回说明")
|
|
|
+ @GetMapping("taskTest")
|
|
|
+ public AjaxResult taskTest(PDATaskStocktakingVO pdaTaskStocktakingVO){
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
}
|