盘点逻辑修改 出库异常逻辑修改
This commit is contained in:
@@ -5,6 +5,8 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
@@ -12,6 +14,8 @@ import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.bas.taskNo.service.IBasTaskNoService;
|
||||
import com.ruoyi.check.difference.domain.CheckDifferenceRecord;
|
||||
import com.ruoyi.check.difference.service.ICheckDifferenceRecordService;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
@@ -19,8 +23,10 @@ import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
|
||||
import com.ruoyi.out.domain.OutExceptionRecord;
|
||||
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
|
||||
import com.ruoyi.out.outStockoutDetail.service.IOutStockoutDetailService;
|
||||
import com.ruoyi.out.service.IOutExceptionRecordService;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -55,6 +61,10 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
private IOutStockoutDetailService outStockoutDetailService;
|
||||
@Autowired
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
@Autowired
|
||||
private ICheckDifferenceRecordService checkDifferenceRecordService;
|
||||
@Autowired
|
||||
private IOutExceptionRecordService outExceptionRecordService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -138,6 +148,9 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
if (job == null) {
|
||||
return AjaxResult.warn("任务不存在");
|
||||
}
|
||||
if(!"1".equals(job.getStatus())) {
|
||||
return AjaxResult.warn("任务已开始");
|
||||
}
|
||||
MydoJobDetail param = new MydoJobDetail();
|
||||
param.setJobId(jobId);
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
|
||||
@@ -181,88 +194,85 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
if (job == null) {
|
||||
return AjaxResult.warn("任务不存在");
|
||||
}
|
||||
if ("6".equals(job.getInOrOut())){
|
||||
//托盘盘点入库,放入原货位,直接修改货位状态,库存状态
|
||||
//入库作业
|
||||
MydoJobDetail param = new MydoJobDetail();
|
||||
param.setJobId(jobId);
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
|
||||
if (CollUtil.isNotEmpty(mydoJobDetails)) {
|
||||
List<BasStock> list = new ArrayList<>();
|
||||
|
||||
//修改货位
|
||||
BasCargoSpace basCargoSpace = new BasCargoSpace();
|
||||
basCargoSpace.setStatus("8");
|
||||
if ("5".equals(job.getInOrOut()) || "6".equals(job.getInOrOut())) {
|
||||
//查询盘点信息中的异常信息
|
||||
CheckDifferenceRecord checkDifferenceRecordParam = new CheckDifferenceRecord();
|
||||
checkDifferenceRecordParam.setTrayCode(job.getTrayCode());
|
||||
checkDifferenceRecordParam.setWarehouseId(job.getWarehouseId());
|
||||
List<CheckDifferenceRecord> checkDifferenceRecords = checkDifferenceRecordService.selectCheckDifferenceRecordList(checkDifferenceRecordParam);
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||
//如果存在盘点异常信息 根据托盘条码和物料id 筛选异常信息
|
||||
Optional<CheckDifferenceRecord> first = checkDifferenceRecords.stream().filter(x -> x.getTrayCode().equals(job.getTrayCode()) && x.getProductId().equals(mydoJobDetail.getProductId())).findFirst();
|
||||
if (first.isPresent()) {
|
||||
//生成盘点待审批库存
|
||||
BasStock stockByInStockinDetail = getStockByInStockinDetail(mydoJobDetail, job, "2");
|
||||
list.add(stockByInStockinDetail);
|
||||
//修改异常记录中的库存id
|
||||
CheckDifferenceRecord checkDifferenceRecord = first.get();
|
||||
checkDifferenceRecord.setStockId(stockByInStockinDetail.getStockId());
|
||||
checkDifferenceRecordService.updateCheckDifferenceRecord(checkDifferenceRecord);
|
||||
|
||||
} else {
|
||||
//正常库存
|
||||
list.add(getStockByInStockinDetail(mydoJobDetail, job, "1"));
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
//查找是否存在异常信息
|
||||
OutExceptionRecord outExceptionRecordParam = new OutExceptionRecord();
|
||||
outExceptionRecordParam.setTrayCode(job.getTrayCode());
|
||||
outExceptionRecordParam.setWarehouseId(job.getWarehouseId());
|
||||
List<OutExceptionRecord> outExceptionRecords = outExceptionRecordService.selectOutExceptionRecordList(outExceptionRecordParam);
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||
Optional<OutExceptionRecord> first = outExceptionRecords.stream().filter(x -> x.getTrayCode().equals(job.getTrayCode()) && x.getProductId().equals(mydoJobDetail.getProductId())).findFirst();
|
||||
if (first.isPresent()){
|
||||
//生成异常库存
|
||||
BasStock stockByInStockinDetail = getStockByInStockinDetail(mydoJobDetail, job, "2");
|
||||
list.add(stockByInStockinDetail);
|
||||
//修改异常记录中的库存id
|
||||
OutExceptionRecord outExceptionRecord = first.get();
|
||||
outExceptionRecord.setStockId(stockByInStockinDetail.getStockId());
|
||||
outExceptionRecordService.updateOutExceptionRecord(outExceptionRecord);
|
||||
}else {
|
||||
//正常库存
|
||||
list.add(getStockByInStockinDetail(mydoJobDetail, job, "1"));
|
||||
}
|
||||
}
|
||||
//删除异常库存记录
|
||||
Long[] outExceptionIds = (Long[]) outExceptionRecords.stream().map(OutExceptionRecord::getOutGuid).toArray();
|
||||
if (outExceptionIds.length>0){
|
||||
outExceptionRecordService.deleteOutExceptionRecordByOutGuids(outExceptionIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//修改货位状态
|
||||
basCargoSpace.setStatus("2");
|
||||
basCargoSpace.setTrayCode(job.getTrayCode());
|
||||
basCargoSpace.setCargoSpaceId(job.getCargoSpaceId());
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
|
||||
//插入库存信息
|
||||
basStockService.insertBasStockList(list);
|
||||
|
||||
//修改物料状态
|
||||
BasStock basStockParam = new BasStock();
|
||||
basStockParam.setTrayCode(job.getTrayCode());
|
||||
List<BasStock> basStocks = basStockService.selectBasStockList(basStockParam);
|
||||
for (BasStock basStock : basStocks) {
|
||||
basStock.setProductStatus("2");
|
||||
basStockService.updateBasStock(basStock);
|
||||
}
|
||||
|
||||
//插入历史表
|
||||
//结束任务
|
||||
mydoJob.setStatus("4");
|
||||
updateMydoJob(mydoJob);
|
||||
// 插入任务历史表 删除任务
|
||||
insertHistory(mydoJob.getJobId());
|
||||
return AjaxResult.success();
|
||||
|
||||
}else if ("5".equals(job.getInOrOut())){
|
||||
//料箱盘点入库
|
||||
MydoJobDetail param = new MydoJobDetail();
|
||||
param.setJobId(jobId);
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
|
||||
if (CollUtil.isNotEmpty(mydoJobDetails)) {
|
||||
List<BasStock> list = new ArrayList<>();
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||
list.add(getStockByInStockinDetail(mydoJobDetail, job,"2"));
|
||||
}
|
||||
basStockService.insertBasStockList(list);
|
||||
mydoJob.setStatus("4");
|
||||
updateMydoJob(mydoJob);
|
||||
//修改货位
|
||||
BasCargoSpace basCargoSpace = new BasCargoSpace();
|
||||
basCargoSpace.setStatus("8");
|
||||
basCargoSpace.setTrayCode(job.getTrayCode());
|
||||
basCargoSpace.setCargoSpaceId(job.getCargoSpaceId());
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
//插入历史表
|
||||
insertHistory(mydoJob.getJobId());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
//正常入库作业
|
||||
MydoJobDetail param = new MydoJobDetail();
|
||||
param.setJobId(jobId);
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
|
||||
if (CollUtil.isNotEmpty(mydoJobDetails)) {
|
||||
List<BasStock> list = new ArrayList<>();
|
||||
//修改货位
|
||||
if ("7".equals(basCargoSpace.getStatus())){
|
||||
//异常待盘点
|
||||
basCargoSpace.setStatus("7");
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||
//修改库存状态为异常
|
||||
list.add(getStockByInStockinDetail(mydoJobDetail, job,"3"));
|
||||
}
|
||||
}else if ("3".equals(basCargoSpace.getStatus())){
|
||||
//正常入库
|
||||
basCargoSpace.setStatus("2");
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||
//修改库存状态为正常
|
||||
list.add(getStockByInStockinDetail(mydoJobDetail, job,"1"));
|
||||
}
|
||||
}
|
||||
basCargoSpace.setTrayCode(job.getTrayCode());
|
||||
basCargoSpace.setCargoSpaceId(job.getCargoSpaceId());
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
|
||||
basStockService.insertBasStockList(list);
|
||||
mydoJob.setStatus("4");
|
||||
updateMydoJob(mydoJob);
|
||||
//插入历史表
|
||||
insertHistory(mydoJob.getJobId());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
} else {
|
||||
return AjaxResult.warn("子任务不存在");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.out.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
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.out.domain.OutExceptionRecord;
|
||||
import com.ruoyi.out.service.IOutExceptionRecordService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 出库异常Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/out/exception")
|
||||
public class OutExceptionRecordController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IOutExceptionRecordService outExceptionRecordService;
|
||||
|
||||
/**
|
||||
* 查询出库异常列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:exception:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OutExceptionRecord outExceptionRecord)
|
||||
{
|
||||
startPage();
|
||||
List<OutExceptionRecord> list = outExceptionRecordService.selectOutExceptionRecordList(outExceptionRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库异常列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:exception:export')")
|
||||
@Log(title = "出库异常", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, OutExceptionRecord outExceptionRecord)
|
||||
{
|
||||
List<OutExceptionRecord> list = outExceptionRecordService.selectOutExceptionRecordList(outExceptionRecord);
|
||||
ExcelUtil<OutExceptionRecord> util = new ExcelUtil<OutExceptionRecord>(OutExceptionRecord.class);
|
||||
util.exportExcel(response, list, "出库异常数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出库异常详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:exception:query')")
|
||||
@GetMapping(value = "/{outGuid}")
|
||||
public AjaxResult getInfo(@PathVariable("outGuid") Long outGuid)
|
||||
{
|
||||
return success(outExceptionRecordService.selectOutExceptionRecordByOutGuid(outGuid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库异常
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:exception:add')")
|
||||
@Log(title = "出库异常", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody OutExceptionRecord outExceptionRecord)
|
||||
{
|
||||
return toAjax(outExceptionRecordService.insertOutExceptionRecord(outExceptionRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库异常
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:exception:edit')")
|
||||
@Log(title = "出库异常", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody OutExceptionRecord outExceptionRecord)
|
||||
{
|
||||
return toAjax(outExceptionRecordService.updateOutExceptionRecord(outExceptionRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库异常
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('out:exception:remove')")
|
||||
@Log(title = "出库异常", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{outGuids}")
|
||||
public AjaxResult remove(@PathVariable Long[] outGuids)
|
||||
{
|
||||
return toAjax(outExceptionRecordService.deleteOutExceptionRecordByOutGuids(outGuids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.ruoyi.out.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 出库异常对象 out_exception_record
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-01
|
||||
*/
|
||||
public class OutExceptionRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 出库异常id */
|
||||
private Long outGuid;
|
||||
|
||||
/** 仓库id */
|
||||
@Excel(name = "仓库id")
|
||||
private String warehouseId;
|
||||
|
||||
/** 库存id */
|
||||
@Excel(name = "库存id")
|
||||
private String stockId;
|
||||
|
||||
/** 托盘 */
|
||||
@Excel(name = "托盘")
|
||||
private String trayCode;
|
||||
|
||||
/** 物料id */
|
||||
@Excel(name = "物料id")
|
||||
private String productId;
|
||||
|
||||
/** 备用1 */
|
||||
@Excel(name = "备用1")
|
||||
private String spare1;
|
||||
|
||||
/** 备用2 */
|
||||
@Excel(name = "备用2")
|
||||
private String spare2;
|
||||
|
||||
/** 备用3 */
|
||||
@Excel(name = "备用3")
|
||||
private String spare3;
|
||||
|
||||
public void setOutGuid(Long outGuid)
|
||||
{
|
||||
this.outGuid = outGuid;
|
||||
}
|
||||
|
||||
public Long getOutGuid()
|
||||
{
|
||||
return outGuid;
|
||||
}
|
||||
|
||||
public void setWarehouseId(String warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setStockId(String stockId)
|
||||
{
|
||||
this.stockId = stockId;
|
||||
}
|
||||
|
||||
public String getStockId()
|
||||
{
|
||||
return stockId;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setProductId(String productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("outGuid", getOutGuid())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("stockId", getStockId())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("productId", getProductId())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.out.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.out.domain.OutExceptionRecord;
|
||||
|
||||
/**
|
||||
* 出库异常Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-01
|
||||
*/
|
||||
public interface OutExceptionRecordMapper
|
||||
{
|
||||
/**
|
||||
* 查询出库异常
|
||||
*
|
||||
* @param outGuid 出库异常主键
|
||||
* @return 出库异常
|
||||
*/
|
||||
public OutExceptionRecord selectOutExceptionRecordByOutGuid(Long outGuid);
|
||||
|
||||
/**
|
||||
* 查询出库异常列表
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 出库异常集合
|
||||
*/
|
||||
public List<OutExceptionRecord> selectOutExceptionRecordList(OutExceptionRecord outExceptionRecord);
|
||||
|
||||
/**
|
||||
* 新增出库异常
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOutExceptionRecord(OutExceptionRecord outExceptionRecord);
|
||||
|
||||
/**
|
||||
* 修改出库异常
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOutExceptionRecord(OutExceptionRecord outExceptionRecord);
|
||||
|
||||
/**
|
||||
* 删除出库异常
|
||||
*
|
||||
* @param outGuid 出库异常主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOutExceptionRecordByOutGuid(Long outGuid);
|
||||
|
||||
/**
|
||||
* 批量删除出库异常
|
||||
*
|
||||
* @param outGuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOutExceptionRecordByOutGuids(Long[] outGuids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.out.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.out.domain.OutExceptionRecord;
|
||||
|
||||
/**
|
||||
* 出库异常Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-01
|
||||
*/
|
||||
public interface IOutExceptionRecordService
|
||||
{
|
||||
/**
|
||||
* 查询出库异常
|
||||
*
|
||||
* @param outGuid 出库异常主键
|
||||
* @return 出库异常
|
||||
*/
|
||||
public OutExceptionRecord selectOutExceptionRecordByOutGuid(Long outGuid);
|
||||
|
||||
/**
|
||||
* 查询出库异常列表
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 出库异常集合
|
||||
*/
|
||||
public List<OutExceptionRecord> selectOutExceptionRecordList(OutExceptionRecord outExceptionRecord);
|
||||
|
||||
/**
|
||||
* 新增出库异常
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOutExceptionRecord(OutExceptionRecord outExceptionRecord);
|
||||
|
||||
/**
|
||||
* 修改出库异常
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOutExceptionRecord(OutExceptionRecord outExceptionRecord);
|
||||
|
||||
/**
|
||||
* 批量删除出库异常
|
||||
*
|
||||
* @param outGuids 需要删除的出库异常主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOutExceptionRecordByOutGuids(Long[] outGuids);
|
||||
|
||||
/**
|
||||
* 删除出库异常信息
|
||||
*
|
||||
* @param outGuid 出库异常主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOutExceptionRecordByOutGuid(Long outGuid);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.out.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.out.mapper.OutExceptionRecordMapper;
|
||||
import com.ruoyi.out.domain.OutExceptionRecord;
|
||||
import com.ruoyi.out.service.IOutExceptionRecordService;
|
||||
|
||||
/**
|
||||
* 出库异常Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-01
|
||||
*/
|
||||
@Service
|
||||
public class OutExceptionRecordServiceImpl implements IOutExceptionRecordService
|
||||
{
|
||||
@Autowired
|
||||
private OutExceptionRecordMapper outExceptionRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询出库异常
|
||||
*
|
||||
* @param outGuid 出库异常主键
|
||||
* @return 出库异常
|
||||
*/
|
||||
@Override
|
||||
public OutExceptionRecord selectOutExceptionRecordByOutGuid(Long outGuid)
|
||||
{
|
||||
return outExceptionRecordMapper.selectOutExceptionRecordByOutGuid(outGuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库异常列表
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 出库异常
|
||||
*/
|
||||
@Override
|
||||
public List<OutExceptionRecord> selectOutExceptionRecordList(OutExceptionRecord outExceptionRecord)
|
||||
{
|
||||
return outExceptionRecordMapper.selectOutExceptionRecordList(outExceptionRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库异常
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertOutExceptionRecord(OutExceptionRecord outExceptionRecord)
|
||||
{
|
||||
return outExceptionRecordMapper.insertOutExceptionRecord(outExceptionRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库异常
|
||||
*
|
||||
* @param outExceptionRecord 出库异常
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateOutExceptionRecord(OutExceptionRecord outExceptionRecord)
|
||||
{
|
||||
return outExceptionRecordMapper.updateOutExceptionRecord(outExceptionRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除出库异常
|
||||
*
|
||||
* @param outGuids 需要删除的出库异常主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOutExceptionRecordByOutGuids(Long[] outGuids)
|
||||
{
|
||||
return outExceptionRecordMapper.deleteOutExceptionRecordByOutGuids(outGuids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库异常信息
|
||||
*
|
||||
* @param outGuid 出库异常主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOutExceptionRecordByOutGuid(Long outGuid)
|
||||
{
|
||||
return outExceptionRecordMapper.deleteOutExceptionRecordByOutGuid(outGuid);
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,6 @@ public interface PdaMapper {
|
||||
void outMakeSure(HashMap<String, Object> map);
|
||||
|
||||
void checkMakeSure(HashMap<String, Object> map);
|
||||
|
||||
void outMakeSureException(HashMap<String, Object> map);
|
||||
}
|
||||
|
||||
@@ -311,6 +311,12 @@ public class PdaServiceImp implements PdaService {
|
||||
newBasContainerDetails.setQuantity(Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.insertBasContainerDetails(newBasContainerDetails);
|
||||
}
|
||||
|
||||
//修改单据实际数量
|
||||
String inOrOutDId = mydoJobDetailOld.getInOrOutDId();
|
||||
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(inOrOutDId);
|
||||
outStockoutDetail.setAssignNum(outStockoutDetail.getAssignNum().add(Convert.toBigDecimal(mydoJobDetail.getPickQuantity())));
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
|
||||
//判断拣选数量是否等于出库数量
|
||||
@@ -391,11 +397,11 @@ public class PdaServiceImp implements PdaService {
|
||||
stockOutId = outStockoutDetail.getStockoutId();
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
//生成回流任务,返回原库位,标记货位为异常待盘点状态
|
||||
//生成回流任务,标记productStatus为异常状态
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
map.put("v_type", "2");
|
||||
pdaMapper.outMakeSure(map);
|
||||
map.put("v_type", "1");
|
||||
pdaMapper.outMakeSureException(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
//自动分配
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.out.mapper.OutExceptionRecordMapper">
|
||||
|
||||
<resultMap type="OutExceptionRecord" id="OutExceptionRecordResult">
|
||||
<result property="outGuid" column="out_guid" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="stockId" column="stock_id" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOutExceptionRecordVo">
|
||||
select out_guid, warehouse_id, stock_id, tray_code, product_id, spare1, spare2, spare3 from out_exception_record
|
||||
</sql>
|
||||
|
||||
<select id="selectOutExceptionRecordList" parameterType="OutExceptionRecord" resultMap="OutExceptionRecordResult">
|
||||
<include refid="selectOutExceptionRecordVo"/>
|
||||
<where>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOutExceptionRecordByOutGuid" parameterType="Long" resultMap="OutExceptionRecordResult">
|
||||
<include refid="selectOutExceptionRecordVo"/>
|
||||
where out_guid = #{outGuid}
|
||||
</select>
|
||||
|
||||
<insert id="insertOutExceptionRecord" parameterType="OutExceptionRecord" useGeneratedKeys="true" keyProperty="outGuid">
|
||||
insert into out_exception_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="stockId != null">stock_id,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="stockId != null">#{stockId},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateOutExceptionRecord" parameterType="OutExceptionRecord">
|
||||
update out_exception_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="stockId != null">stock_id = #{stockId},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
</trim>
|
||||
where out_guid = #{outGuid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteOutExceptionRecordByOutGuid" parameterType="Long">
|
||||
delete from out_exception_record where out_guid = #{outGuid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOutExceptionRecordByOutGuids" parameterType="String">
|
||||
delete from out_exception_record where out_guid in
|
||||
<foreach item="outGuid" collection="array" open="(" separator="," close=")">
|
||||
#{outGuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -75,4 +75,11 @@
|
||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||
)}
|
||||
</select>
|
||||
<select id="outMakeSureException" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_check_masksure_exception(
|
||||
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||
)}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user