初始化
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.pda.controller;
|
||||
|
||||
import com.ruoyi.api.domain.RequestEnter;
|
||||
import com.ruoyi.api.domain.WcsPort;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||
import com.ruoyi.pda.service.PdaService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/pda")
|
||||
@Slf4j
|
||||
public class PdaController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private PdaService pdaService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 入库扫码生成作业
|
||||
*/
|
||||
@RequestMapping("/addInJob")
|
||||
@ResponseBody
|
||||
public AjaxResult addInJob(@RequestBody RequestEnter requestEnter) {
|
||||
return pdaService.addInJob(requestEnter);
|
||||
}
|
||||
|
||||
@RequestMapping("/selectDetailByTray")
|
||||
@ResponseBody
|
||||
public AjaxResult selectDetailByTray(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
|
||||
return pdaService.selectDetailByTray(trayCodeMakeSure);
|
||||
}
|
||||
|
||||
@RequestMapping("/selectDetailByPDTray")
|
||||
@ResponseBody
|
||||
public AjaxResult selectDetailByPDTray(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
|
||||
return pdaService.selectDetailByPDTray(trayCodeMakeSure);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 出库确认
|
||||
*
|
||||
* @param trayCodeMakeSure 托盘信息
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:out:outMakeSure')")
|
||||
@PostMapping("/outMakeSure")
|
||||
@Log(title = "手持机出库确认", businessType = BusinessType.INSERT)
|
||||
@ResponseBody
|
||||
public AjaxResult outMakeSure(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
|
||||
return pdaService.outMakeSure(trayCodeMakeSure);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 盘点出库确认
|
||||
* @param trayCodeMakeSure 托盘信息
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:check:checkMakeSure')")
|
||||
@PostMapping("/checkMakeSure")
|
||||
@Log(title = "手持机盘点出库确认", businessType = BusinessType.INSERT)
|
||||
@ResponseBody
|
||||
public AjaxResult checkMakeSure(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
|
||||
return pdaService.checkMakeSure(trayCodeMakeSure);
|
||||
}
|
||||
|
||||
@RequestMapping("/selectWcsPort")
|
||||
@ResponseBody
|
||||
public AjaxResult selectWcsPort() {
|
||||
return pdaService.selectWcsPort();
|
||||
}
|
||||
|
||||
@RequestMapping("/updateWcsPort")
|
||||
@ResponseBody
|
||||
public AjaxResult updateWcsPort(@RequestBody WcsPort wcsPort) {
|
||||
return pdaService.updateWcsPort(wcsPort);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ruoyi.pda.domain;
|
||||
|
||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class TrayCodeMakeSure {
|
||||
//托盘码
|
||||
private String trayCode;
|
||||
//容器码
|
||||
private String containerCode;
|
||||
|
||||
private String warehouseId;
|
||||
|
||||
private String exitId;
|
||||
//拣选详情列表
|
||||
private List<MydoJobDetail> mydoJobDetailList;
|
||||
//盘点详情列表
|
||||
private List<MydoJobDetail> materials;
|
||||
//异常详情列表
|
||||
private List<MydoJobDetail> materialDetails;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.pda.domain;
|
||||
|
||||
public class TrayCodeMsg {
|
||||
|
||||
private String trayCode;
|
||||
|
||||
private String warehouseId;
|
||||
|
||||
private String inQuantity;
|
||||
|
||||
private String entranceId;
|
||||
|
||||
private String cargoSpaceId;
|
||||
|
||||
private String exitId;
|
||||
|
||||
private String stockinDetailId;
|
||||
|
||||
private String inOut;
|
||||
private String status;
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getInOut() {
|
||||
return inOut;
|
||||
}
|
||||
|
||||
public void setInOut(String inOut) {
|
||||
this.inOut = inOut;
|
||||
}
|
||||
|
||||
public String getStockinDetailId() {
|
||||
return stockinDetailId;
|
||||
}
|
||||
|
||||
public void setStockinDetailId(String stockinDetailId) {
|
||||
this.stockinDetailId = stockinDetailId;
|
||||
}
|
||||
|
||||
public String getExitId() {
|
||||
return exitId;
|
||||
}
|
||||
|
||||
public void setExitId(String exitId) {
|
||||
this.exitId = exitId;
|
||||
}
|
||||
|
||||
public String getCargoSpaceId() {
|
||||
return cargoSpaceId;
|
||||
}
|
||||
|
||||
public void setCargoSpaceId(String cargoSpaceId) {
|
||||
this.cargoSpaceId = cargoSpaceId;
|
||||
}
|
||||
|
||||
public String getEntranceId() {
|
||||
return entranceId;
|
||||
}
|
||||
|
||||
public void setEntranceId(String entranceId) {
|
||||
this.entranceId = entranceId;
|
||||
}
|
||||
|
||||
public String getTrayCode() {
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode) {
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getWarehouseId() {
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setWarehouseId(String warehouseId) {
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getInQuantity() {
|
||||
return inQuantity;
|
||||
}
|
||||
|
||||
public void setInQuantity(String inQuantity) {
|
||||
this.inQuantity = inQuantity;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.pda.mapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public interface PdaMapper {
|
||||
|
||||
void emptyTrayIn(HashMap<String, Object> map);
|
||||
|
||||
void emptyBoxIn(HashMap<String, Object> map);
|
||||
|
||||
void emptyTrayOut(HashMap<String, Object> map);
|
||||
|
||||
void emptyBoxOut(HashMap<String, Object> map);
|
||||
|
||||
void bindTrayMsg(HashMap<String, Object> map);
|
||||
|
||||
void addInJob(HashMap<String, Object> map);
|
||||
|
||||
void outMakeSure(HashMap<String, Object> map);
|
||||
|
||||
void checkMakeSure(HashMap<String, Object> map);
|
||||
|
||||
void pkIn(HashMap<String, Object> map);
|
||||
|
||||
void pkOut(HashMap<String, Object> map);
|
||||
|
||||
void outMakeSureException(HashMap<String, Object> map);
|
||||
}
|
||||
20
ruoyi-admin/src/main/java/com/ruoyi/pda/readme.md
Normal file
20
ruoyi-admin/src/main/java/com/ruoyi/pda/readme.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# 移动终端(PDA)目录说明
|
||||
|
||||
## 目录用途
|
||||
存放移动终端专用的业务代码和配置文件
|
||||
|
||||
## 主要功能
|
||||
- 处理PDA设备交互逻辑
|
||||
- 管理移动端数据同步
|
||||
- 处理离线操作和数据缓存
|
||||
- 移动端界面适配和优化
|
||||
|
||||
## 目录结构
|
||||
```
|
||||
pda/
|
||||
├── config/ # PDA配置文件
|
||||
├── controller/ # PDA控制器
|
||||
├── model/ # PDA数据模型
|
||||
├── service/ # PDA业务逻辑
|
||||
└── utils/ # PDA相关工具类
|
||||
```
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ruoyi.pda.service;
|
||||
|
||||
import com.ruoyi.api.domain.RequestEnter;
|
||||
import com.ruoyi.api.domain.WcsPort;
|
||||
import com.ruoyi.bas.container.domain.BasContainer;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||
import com.ruoyi.pda.domain.TrayCodeMsg;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface PdaService {
|
||||
|
||||
|
||||
|
||||
public AjaxResult addInJob(RequestEnter requestEnter);
|
||||
|
||||
public AjaxResult selectDetailByTray(TrayCodeMakeSure trayCodeMakeSure);
|
||||
public AjaxResult selectDetailByPDTray(TrayCodeMakeSure trayCodeMakeSure);
|
||||
|
||||
AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure);
|
||||
|
||||
AjaxResult checkMakeSure(TrayCodeMakeSure trayCodeMakeSure);
|
||||
|
||||
public AjaxResult selectWcsPort();
|
||||
|
||||
AjaxResult updateWcsPort(WcsPort wcsport);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.ruoyi.pda.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.domain.RequestEnter;
|
||||
import com.ruoyi.api.domain.WcsPort;
|
||||
import com.ruoyi.api.service.IToWcsService;
|
||||
import com.ruoyi.api.service.IToWmsService;
|
||||
import com.ruoyi.check.commit.domain.CheckCommitRecord;
|
||||
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
|
||||
import com.ruoyi.job.mydojobdetail.service.impl.MydoJobDetailServiceImpl;
|
||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||
import com.ruoyi.pda.mapper.PdaMapper;
|
||||
import com.ruoyi.pda.trayMsg.service.ITrayMsgService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PdaServiceImp implements PdaService {
|
||||
@Autowired
|
||||
private PdaMapper pdaMapper;
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
ISysRoleService sysRoleService;
|
||||
@Autowired
|
||||
IInStockinDetailService inStockinDetailService;
|
||||
@Autowired
|
||||
ITrayMsgService trayMsgService;
|
||||
@Autowired
|
||||
private ICheckCommitRecordService checkCommitRecordService;
|
||||
@Autowired
|
||||
private IToWmsService iToWmsService;
|
||||
@Autowired
|
||||
private IMydoJobDetailService mydoJobDetailService;
|
||||
@Autowired
|
||||
private IToWcsService toWcsService;
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult addInJob(RequestEnter requestEnter) {
|
||||
if(requestEnter.getEntranceId()!=null){
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setEntranceId(requestEnter.getEntranceId());
|
||||
mydoJob.setStatus("1");
|
||||
MydoJob mydoJob1 = mydoJobService.selectMydoJobByEntranceId(mydoJob);
|
||||
if(mydoJob1!=null){
|
||||
return AjaxResult.error("该入口已有作业");
|
||||
}
|
||||
}else{
|
||||
return AjaxResult.error("请选择出口");
|
||||
}
|
||||
requestEnter.setFlag("1");
|
||||
AjaxResult ajaxResult = iToWmsService.requestEnterByTrayCode(requestEnter);
|
||||
return ajaxResult;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectDetailByTray(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
String trayCode = trayCodeMakeSure.getTrayCode();
|
||||
String[] split = trayCode.split(" ");
|
||||
String productId = split[8].substring(10);
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setExitId(trayCodeMakeSure.getExitId());
|
||||
mydoJob.setProductId(productId);
|
||||
mydoJob.setStatus("3");
|
||||
mydoJob.setInOrOut("21");
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailListByExit(mydoJob);
|
||||
return AjaxResult.success(mydoJobDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectDetailByPDTray(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setExitId(trayCodeMakeSure.getExitId());
|
||||
mydoJob.setStatus("3");
|
||||
mydoJob.setInOrOut("26");
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectPdMydoJobDetailListByExit(mydoJob);
|
||||
return AjaxResult.success(mydoJobDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
String trayCode = trayCodeMakeSure.getTrayCode();
|
||||
String[] split = trayCode.split(" ");
|
||||
String productId = split[8].substring(10);
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setExitId(trayCodeMakeSure.getExitId());
|
||||
mydoJob.setProductId(productId);
|
||||
mydoJob.setStatus("3");
|
||||
mydoJob.setInOrOut("21");
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailListByExit(mydoJob);
|
||||
if(mydoJobDetails.size()==0){
|
||||
return AjaxResult.error("该物料没有出库作业,请检查");
|
||||
}
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", mydoJobDetails.get(0).getTrayCode());
|
||||
pdaMapper.outMakeSure(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
return AjaxResult.success();
|
||||
} else {
|
||||
return AjaxResult.error( map.get("v_resultmsg").toString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
//@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult checkMakeSure(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setExitId(trayCodeMakeSure.getExitId());
|
||||
mydoJob.setStatus("3");
|
||||
mydoJob.setInOrOut("26");
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectPdMydoJobDetailListByExit(mydoJob);
|
||||
if(mydoJobDetails.isEmpty()){
|
||||
return AjaxResult.error("该物料没有盘点出库作业,请检查");
|
||||
}
|
||||
|
||||
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMaterials();
|
||||
if (CollUtil.isNotEmpty(mydoJobDetailList)) {
|
||||
boolean flag = mydoJobDetailList.stream().anyMatch(x -> StrUtil.isEmpty(x.getStockId()) && "0".equals(x.getInQuantity()));
|
||||
if (flag) {
|
||||
return AjaxResult.warn(MessageUtils.message("warn.message8"));
|
||||
}
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
|
||||
//插入盘点提交表
|
||||
CheckCommitRecord checkCommitRecord = new CheckCommitRecord();
|
||||
checkCommitRecord.setQuantity(mydoJobDetail.getInQuantity());
|
||||
checkCommitRecord.setTrayCode(mydoJobDetails.get(0).getTrayCode());
|
||||
checkCommitRecord.setStockId(mydoJobDetail.getStockId());
|
||||
checkCommitRecord.setSpare1(mydoJobDetail.getInOrOutDId());
|
||||
checkCommitRecord.setSpare2(mydoJobDetail.getProductId());
|
||||
checkCommitRecord.setSpare3(mydoJobDetail.getOutQuantity());
|
||||
checkCommitRecordService.insertCheckCommitRecord(checkCommitRecord);
|
||||
|
||||
}
|
||||
}
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", mydoJobDetails.get(0).getTrayCode());
|
||||
pdaMapper.checkMakeSure(map);
|
||||
//iToWcsService.pushInMydoJob();
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
} else {
|
||||
throw new RuntimeException(map.get("v_resultmsg").toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectWcsPort() {
|
||||
AjaxResult ajaxResult = toWcsService.selectWcsPort();
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult updateWcsPort(WcsPort wcsport) {
|
||||
AjaxResult ajaxResult = toWcsService.updateWcsPort(wcsport);
|
||||
return ajaxResult;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.ruoyi.pda.trayMsg.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
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.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.pda.trayMsg.domain.TrayMsg;
|
||||
import com.ruoyi.pda.trayMsg.service.ITrayMsgService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* trayMsgController
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pda/trayMsg")
|
||||
public class TrayMsgController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITrayMsgService trayMsgService;
|
||||
@Autowired
|
||||
private IInStockinDetailService inStockinDetailService;
|
||||
|
||||
/**
|
||||
* 查询trayMsg列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:trayMsg:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TrayMsg trayMsg)
|
||||
{
|
||||
startPage();
|
||||
List<TrayMsg> list = trayMsgService.selectTrayMsgList(trayMsg);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出trayMsg列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:trayMsg:export')")
|
||||
@Log(title = "trayMsg", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TrayMsg trayMsg)
|
||||
{
|
||||
List<TrayMsg> list = trayMsgService.selectTrayMsgList(trayMsg);
|
||||
ExcelUtil<TrayMsg> util = new ExcelUtil<TrayMsg>(TrayMsg.class);
|
||||
util.exportExcel(response, list, "trayMsg数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取trayMsg详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:trayMsg:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(trayMsgService.selectTrayMsgById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增trayMsg
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:trayMsg:add')")
|
||||
@Log(title = "trayMsg", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TrayMsg trayMsg)
|
||||
{
|
||||
return toAjax(trayMsgService.insertTrayMsg(trayMsg));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改trayMsg
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:trayMsg:edit')")
|
||||
@Log(title = "trayMsg", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TrayMsg trayMsg)
|
||||
{
|
||||
return toAjax(trayMsgService.updateTrayMsg(trayMsg));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除trayMsg
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:trayMsg:remove')")
|
||||
@Log(title = "trayMsg", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(trayMsgService.deleteTrayMsgByIds(ids));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('pda:trayMsg:remove')")
|
||||
@RequestMapping("/remove")
|
||||
@Log(title = "trayMsg", businessType = BusinessType.DELETE)
|
||||
public AjaxResult remove(@RequestBody TrayMsg trayMsg)
|
||||
{
|
||||
List<TrayMsg> list = trayMsgService.selectTrayMsgList(trayMsg);
|
||||
int i = trayMsgService.deleteTrayMsgById(list.get(0).getId());
|
||||
if(i>0){
|
||||
// InStockinDetail inStockinDetail = new InStockinDetail();
|
||||
// inStockinDetail.setStockinDetailId(trayMsg.getStockinDetailId());
|
||||
InStockinDetail inStockinDetail1 = inStockinDetailService.selectInStockinDetailByStockinDetailId(trayMsg.getStockinDetailId());
|
||||
Integer num=Integer.parseInt(inStockinDetail1.getScanNum())-Integer.parseInt(list.get(0).getQuantity());
|
||||
inStockinDetail1.setScanNum(String.valueOf(num));
|
||||
inStockinDetailService.updateInStockinDetail(inStockinDetail1);
|
||||
}
|
||||
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.ruoyi.pda.trayMsg.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* trayMsg对象 tray_msg
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public class TrayMsg extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
private String id;
|
||||
|
||||
/** 托盘条码 */
|
||||
@Excel(name = "托盘条码")
|
||||
private String trayCode;
|
||||
|
||||
/** 子单编码 */
|
||||
@Excel(name = "子单编码")
|
||||
private String stockinDetailId;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private String quantity;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String warehouseId;
|
||||
|
||||
private String warehouseName;
|
||||
|
||||
private String warehouseType;
|
||||
|
||||
public String getWarehouseType() {
|
||||
return warehouseType;
|
||||
}
|
||||
|
||||
public void setWarehouseType(String warehouseType) {
|
||||
this.warehouseType = warehouseType;
|
||||
}
|
||||
|
||||
public String getWarehouseId() {
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setWarehouseId(String warehouseId) {
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setStockinDetailId(String stockinDetailId)
|
||||
{
|
||||
this.stockinDetailId = stockinDetailId;
|
||||
}
|
||||
|
||||
public String getStockinDetailId()
|
||||
{
|
||||
return stockinDetailId;
|
||||
}
|
||||
|
||||
public void setQuantity(String quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("stockinDetailId", getStockinDetailId())
|
||||
.append("quantity", getQuantity())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.pda.trayMsg.mapper;
|
||||
|
||||
import com.ruoyi.pda.trayMsg.domain.TrayMsg;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* trayMsgMapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface TrayMsgMapper
|
||||
{
|
||||
/**
|
||||
* 查询trayMsg
|
||||
*
|
||||
* @param id trayMsg主键
|
||||
* @return trayMsg
|
||||
*/
|
||||
public TrayMsg selectTrayMsgById(String id);
|
||||
|
||||
/**
|
||||
* 查询trayMsg列表
|
||||
*
|
||||
* @param trayMsg trayMsg
|
||||
* @return trayMsg集合
|
||||
*/
|
||||
public List<TrayMsg> selectTrayMsgList(TrayMsg trayMsg);
|
||||
|
||||
/**
|
||||
* 新增trayMsg
|
||||
*
|
||||
* @param trayMsg trayMsg
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTrayMsg(TrayMsg trayMsg);
|
||||
|
||||
/**
|
||||
* 修改trayMsg
|
||||
*
|
||||
* @param trayMsg trayMsg
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTrayMsg(TrayMsg trayMsg);
|
||||
|
||||
/**
|
||||
* 删除trayMsg
|
||||
*
|
||||
* @param id trayMsg主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTrayMsgById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除trayMsg
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTrayMsgByIds(String[] ids);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.pda.trayMsg.service;
|
||||
|
||||
import com.ruoyi.pda.trayMsg.domain.TrayMsg;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* trayMsgService接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface ITrayMsgService
|
||||
{
|
||||
/**
|
||||
* 查询trayMsg
|
||||
*
|
||||
* @param id trayMsg主键
|
||||
* @return trayMsg
|
||||
*/
|
||||
public TrayMsg selectTrayMsgById(String id);
|
||||
|
||||
/**
|
||||
* 查询trayMsg列表
|
||||
*
|
||||
* @param trayMsg trayMsg
|
||||
* @return trayMsg集合
|
||||
*/
|
||||
public List<TrayMsg> selectTrayMsgList(TrayMsg trayMsg);
|
||||
|
||||
/**
|
||||
* 新增trayMsg
|
||||
*
|
||||
* @param trayMsg trayMsg
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTrayMsg(TrayMsg trayMsg);
|
||||
|
||||
/**
|
||||
* 修改trayMsg
|
||||
*
|
||||
* @param trayMsg trayMsg
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTrayMsg(TrayMsg trayMsg);
|
||||
|
||||
/**
|
||||
* 批量删除trayMsg
|
||||
*
|
||||
* @param ids 需要删除的trayMsg主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTrayMsgByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除trayMsg信息
|
||||
*
|
||||
* @param id trayMsg主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTrayMsgById(String id);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.pda.trayMsg.service.impl;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.pda.trayMsg.domain.TrayMsg;
|
||||
import com.ruoyi.pda.trayMsg.mapper.TrayMsgMapper;
|
||||
import com.ruoyi.pda.trayMsg.service.ITrayMsgService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* trayMsgService业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@Service
|
||||
public class TrayMsgServiceImpl implements ITrayMsgService
|
||||
{
|
||||
@Autowired
|
||||
private TrayMsgMapper trayMsgMapper;
|
||||
|
||||
/**
|
||||
* 查询trayMsg
|
||||
*
|
||||
* @param id trayMsg主键
|
||||
* @return trayMsg
|
||||
*/
|
||||
@Override
|
||||
public TrayMsg selectTrayMsgById(String id)
|
||||
{
|
||||
return trayMsgMapper.selectTrayMsgById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询trayMsg列表
|
||||
*
|
||||
* @param trayMsg trayMsg
|
||||
* @return trayMsg
|
||||
*/
|
||||
@Override
|
||||
@DataScope(warehouseAlias = "w")
|
||||
public List<TrayMsg> selectTrayMsgList(TrayMsg trayMsg)
|
||||
{
|
||||
return trayMsgMapper.selectTrayMsgList(trayMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增trayMsg
|
||||
* @param trayMsg trayMsg
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTrayMsg(TrayMsg trayMsg)
|
||||
{
|
||||
return trayMsgMapper.insertTrayMsg(trayMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改trayMsg
|
||||
*
|
||||
* @param trayMsg trayMsg
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTrayMsg(TrayMsg trayMsg)
|
||||
{
|
||||
return trayMsgMapper.updateTrayMsg(trayMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除trayMsg
|
||||
*
|
||||
* @param ids 需要删除的trayMsg主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTrayMsgByIds(String[] ids)
|
||||
{
|
||||
return trayMsgMapper.deleteTrayMsgByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除trayMsg信息
|
||||
*
|
||||
* @param id trayMsg主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTrayMsgById(String id)
|
||||
{
|
||||
return trayMsgMapper.deleteTrayMsgById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user