项目初始化
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
package com.ruoyi.pda.controller;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.in.sotckindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.pda.domain.AddInJobRequest;
|
||||
import com.ruoyi.pda.domain.BindTrayRequest;
|
||||
import com.ruoyi.pda.service.PdaService;
|
||||
import io.netty.util.internal.ObjectUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 手持机 Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-05-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pda")
|
||||
public class PdaController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private PdaService pdaService;
|
||||
|
||||
/**
|
||||
* 入库待处理任务列表
|
||||
*/
|
||||
@GetMapping("/inboundTaskList")
|
||||
@PreAuthorize("@ss.hasPermi('in:bound:task:list')")
|
||||
public TableDataInfo list(InStockinDetail inStockinDetail) {
|
||||
startPage();
|
||||
List<InStockinDetail> list = pdaService.inboundTaskList(inStockinDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库绑盘(支持一托多料)
|
||||
* <p>
|
||||
* 请求体示例:
|
||||
* {
|
||||
* "trayCode": "T001",
|
||||
* "warehouseId": "WH01",
|
||||
* "items": [
|
||||
* { "stockinDetailId": "D001", "productId": "P001", "quantity": 10 },
|
||||
* { "stockinDetailId": "D002", "productId": "P002", "quantity": 20 }
|
||||
* ]
|
||||
* }
|
||||
*/
|
||||
@PostMapping("/bindTray")
|
||||
@PreAuthorize("@ss.hasPermi('in:bound:msg:add')")
|
||||
public AjaxResult bindTray(@RequestBody BindTrayRequest request) {
|
||||
try {
|
||||
String res = pdaService.bindTray(request);
|
||||
if (StringUtils.isEmpty(res)){
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
return AjaxResult.error(res);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成入库作业
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/addInJob")
|
||||
@PreAuthorize("@ss.hasPermi('in:job:add')")
|
||||
public AjaxResult addInJob(@RequestBody AddInJobRequest request){
|
||||
try {
|
||||
String res = pdaService.addInJob(request);
|
||||
return AjaxResult.success(res);
|
||||
} catch (RuntimeException e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库绑盘-查询物料信息
|
||||
* @param detailId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getProductInfoByInDetailId")
|
||||
@PreAuthorize("@ss.hasPermi('in:bound:task:info')")
|
||||
public AjaxResult getProductInfoByInDetailId(String detailId) {
|
||||
try {
|
||||
InStockinDetail info = pdaService.getProductInfoByInDetailId(detailId);
|
||||
return AjaxResult.success(info);
|
||||
} catch (RuntimeException e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user