Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 盘点差异Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-28
|
||||
*/
|
||||
@@ -77,7 +77,7 @@ public class CheckDifferenceRecordController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CheckDifferenceRecord checkDifferenceRecord)
|
||||
{
|
||||
return toAjax(checkDifferenceRecordService.insertCheckDifferenceRecord(checkDifferenceRecord));
|
||||
return checkDifferenceRecordService.insertCheckDifferenceRecord(checkDifferenceRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 盘点差异对象 check_difference_record
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-28
|
||||
*/
|
||||
@@ -66,132 +66,142 @@ public class CheckDifferenceRecord extends BaseEntity
|
||||
@Excel(name = "物料guid")
|
||||
private String productGuid;
|
||||
|
||||
public void setCheckGuid(String checkGuid)
|
||||
private String status;
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setCheckGuid(String checkGuid)
|
||||
{
|
||||
this.checkGuid = checkGuid;
|
||||
}
|
||||
|
||||
public String getCheckGuid()
|
||||
public String getCheckGuid()
|
||||
{
|
||||
return checkGuid;
|
||||
}
|
||||
|
||||
public void setCheckStockDetailId(String checkStockDetailId)
|
||||
public void setCheckStockDetailId(String checkStockDetailId)
|
||||
{
|
||||
this.checkStockDetailId = checkStockDetailId;
|
||||
}
|
||||
|
||||
public String getCheckStockDetailId()
|
||||
public String getCheckStockDetailId()
|
||||
{
|
||||
return checkStockDetailId;
|
||||
}
|
||||
|
||||
public void setStockId(String stockId)
|
||||
public void setStockId(String stockId)
|
||||
{
|
||||
this.stockId = stockId;
|
||||
}
|
||||
|
||||
public String getStockId()
|
||||
public String getStockId()
|
||||
{
|
||||
return stockId;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setCargoSpaceId(String cargoSpaceId)
|
||||
public void setCargoSpaceId(String cargoSpaceId)
|
||||
{
|
||||
this.cargoSpaceId = cargoSpaceId;
|
||||
}
|
||||
|
||||
public String getCargoSpaceId()
|
||||
public String getCargoSpaceId()
|
||||
{
|
||||
return cargoSpaceId;
|
||||
}
|
||||
|
||||
public void setProductId(String productId)
|
||||
public void setProductId(String productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductId()
|
||||
public String getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setLotNo(String lotNo)
|
||||
public void setLotNo(String lotNo)
|
||||
{
|
||||
this.lotNo = lotNo;
|
||||
}
|
||||
|
||||
public String getLotNo()
|
||||
public String getLotNo()
|
||||
{
|
||||
return lotNo;
|
||||
}
|
||||
|
||||
public void setSupplier(String supplier)
|
||||
public void setSupplier(String supplier)
|
||||
{
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public String getSupplier()
|
||||
public String getSupplier()
|
||||
{
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setCustomer(String customer)
|
||||
public void setCustomer(String customer)
|
||||
{
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public String getCustomer()
|
||||
public String getCustomer()
|
||||
{
|
||||
return customer;
|
||||
}
|
||||
|
||||
public void setOldQuantity(String oldQuantity)
|
||||
public void setOldQuantity(String oldQuantity)
|
||||
{
|
||||
this.oldQuantity = oldQuantity;
|
||||
}
|
||||
|
||||
public String getOldQuantity()
|
||||
public String getOldQuantity()
|
||||
{
|
||||
return oldQuantity;
|
||||
}
|
||||
|
||||
public void setNewQuantity(String newQuantity)
|
||||
public void setNewQuantity(String newQuantity)
|
||||
{
|
||||
this.newQuantity = newQuantity;
|
||||
}
|
||||
|
||||
public String getNewQuantity()
|
||||
public String getNewQuantity()
|
||||
{
|
||||
return newQuantity;
|
||||
}
|
||||
|
||||
public void setRecordType(Long recordType)
|
||||
public void setRecordType(Long recordType)
|
||||
{
|
||||
this.recordType = recordType;
|
||||
}
|
||||
|
||||
public Long getRecordType()
|
||||
public Long getRecordType()
|
||||
{
|
||||
return recordType;
|
||||
}
|
||||
|
||||
public void setProductGuid(String productGuid)
|
||||
public void setProductGuid(String productGuid)
|
||||
{
|
||||
this.productGuid = productGuid;
|
||||
}
|
||||
|
||||
public String getProductGuid()
|
||||
public String getProductGuid()
|
||||
{
|
||||
return productGuid;
|
||||
}
|
||||
|
||||
@@ -2,18 +2,19 @@ package com.ruoyi.check.difference.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.check.difference.domain.CheckDifferenceRecord;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 盘点差异Service接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-28
|
||||
*/
|
||||
public interface ICheckDifferenceRecordService
|
||||
public interface ICheckDifferenceRecordService
|
||||
{
|
||||
/**
|
||||
* 查询盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkGuid 盘点差异主键
|
||||
* @return 盘点差异
|
||||
*/
|
||||
@@ -21,7 +22,7 @@ public interface ICheckDifferenceRecordService
|
||||
|
||||
/**
|
||||
* 查询盘点差异列表
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 盘点差异集合
|
||||
*/
|
||||
@@ -29,15 +30,15 @@ public interface ICheckDifferenceRecordService
|
||||
|
||||
/**
|
||||
* 新增盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCheckDifferenceRecord(CheckDifferenceRecord checkDifferenceRecord);
|
||||
public AjaxResult insertCheckDifferenceRecord(CheckDifferenceRecord checkDifferenceRecord);
|
||||
|
||||
/**
|
||||
* 修改盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -45,7 +46,7 @@ public interface ICheckDifferenceRecordService
|
||||
|
||||
/**
|
||||
* 批量删除盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkGuids 需要删除的盘点差异主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -53,7 +54,7 @@ public interface ICheckDifferenceRecordService
|
||||
|
||||
/**
|
||||
* 删除盘点差异信息
|
||||
*
|
||||
*
|
||||
* @param checkGuid 盘点差异主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.ruoyi.check.difference.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.check.difference.mapper.CheckDifferenceRecordMapper;
|
||||
@@ -10,19 +16,22 @@ import com.ruoyi.check.difference.service.ICheckDifferenceRecordService;
|
||||
|
||||
/**
|
||||
* 盘点差异Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-28
|
||||
*/
|
||||
@Service
|
||||
public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordService
|
||||
public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordService
|
||||
{
|
||||
@Autowired
|
||||
private CheckDifferenceRecordMapper checkDifferenceRecordMapper;
|
||||
@Autowired
|
||||
private IBasStockService basStockService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkGuid 盘点差异主键
|
||||
* @return 盘点差异
|
||||
*/
|
||||
@@ -34,7 +43,7 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
|
||||
/**
|
||||
* 查询盘点差异列表
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 盘点差异
|
||||
*/
|
||||
@@ -46,20 +55,43 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
|
||||
/**
|
||||
* 新增盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCheckDifferenceRecord(CheckDifferenceRecord checkDifferenceRecord)
|
||||
public AjaxResult insertCheckDifferenceRecord(CheckDifferenceRecord checkDifferenceRecord)
|
||||
{
|
||||
checkDifferenceRecord.setCreateTime(DateUtils.getNowDate());
|
||||
return checkDifferenceRecordMapper.insertCheckDifferenceRecord(checkDifferenceRecord);
|
||||
if (checkDifferenceRecord.getRecordType()==1){
|
||||
String stockId = checkDifferenceRecord.getStockId();
|
||||
BasStock basStock = basStockService.selectBasStockByStockId(stockId);
|
||||
if (!"1".equals(basStock.getProductStatus())){
|
||||
return AjaxResult.warn("库存非正常状态");
|
||||
}
|
||||
basStock.setProductStatus("2");
|
||||
basStockService.updateBasStock(basStock);
|
||||
checkDifferenceRecord.setOldQuantity(basStock.getQuantity());
|
||||
}else if (checkDifferenceRecord.getRecordType()==2){
|
||||
checkDifferenceRecord.setOldQuantity("0");
|
||||
}else if (checkDifferenceRecord.getRecordType()==3){
|
||||
BasStock basStock = basStockService.selectBasStockByStockId(checkDifferenceRecord.getStockId());
|
||||
if (!"1".equals(basStock.getProductStatus())){
|
||||
return AjaxResult.warn("库存非正常状态");
|
||||
}
|
||||
basStock.setProductStatus("2");
|
||||
basStockService.updateBasStock(basStock);
|
||||
checkDifferenceRecord.setNewQuantity("0");
|
||||
}
|
||||
checkDifferenceRecord.setCreateTime(new Date());
|
||||
checkDifferenceRecord.setCheckGuid(IdUtil.fastSimpleUUID());
|
||||
checkDifferenceRecord.setStatus("0");
|
||||
checkDifferenceRecordMapper.insertCheckDifferenceRecord(checkDifferenceRecord);
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkDifferenceRecord 盘点差异
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -71,7 +103,7 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
|
||||
/**
|
||||
* 批量删除盘点差异
|
||||
*
|
||||
*
|
||||
* @param checkGuids 需要删除的盘点差异主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -83,7 +115,7 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
|
||||
/**
|
||||
* 删除盘点差异信息
|
||||
*
|
||||
*
|
||||
* @param checkGuid 盘点差异主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -176,28 +176,60 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult manualCompleted(MydoJob mydoJob) {
|
||||
//插入库存
|
||||
|
||||
String jobId = mydoJob.getJobId();
|
||||
MydoJob job = selectMydoJobByJobId(jobId);
|
||||
if (job == null) {
|
||||
return AjaxResult.warn("任务不存在");
|
||||
}
|
||||
if (job.getInOrOut().equals("5")){
|
||||
//料箱盘点入库作业
|
||||
if ("6".equals(job.getInOrOut())){
|
||||
//托盘盘点入库,放入原货位,直接修改货位状态,库存状态
|
||||
|
||||
//修改货位
|
||||
BasCargoSpace basCargoSpace = new BasCargoSpace();
|
||||
basCargoSpace.setStatus("5");
|
||||
basCargoSpace.setStatus("8");
|
||||
basCargoSpace.setTrayCode(job.getTrayCode());
|
||||
basCargoSpace.setCargoSpaceId(job.getCargoSpaceId());
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
|
||||
|
||||
//修改物料状态
|
||||
BasStock basStockParam = new BasStock();
|
||||
basStockParam.setTrayCode(job.getTrayCode());
|
||||
List<BasStock> basStocks = basStockService.selectBasStockList(basStockParam);
|
||||
for (BasStock basStock : basStocks) {
|
||||
basStock.setProductStatus("2");
|
||||
basStockService.updateBasStock(basStock);
|
||||
}
|
||||
|
||||
//插入历史表
|
||||
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));
|
||||
}
|
||||
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);
|
||||
@@ -228,7 +260,11 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
stock.setStockId(basJobIdService.getJobId("KC"));
|
||||
stock.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
stock.setStockStatus("1");
|
||||
stock.setProductStatus("1");
|
||||
if ("5".equals(mydoJob.getInOrOut())){
|
||||
stock.setProductStatus("2");
|
||||
}else {
|
||||
stock.setProductStatus("1");
|
||||
}
|
||||
stock.setLotNo(mydoJobDetail.getLotNo());
|
||||
stock.setInDate(DateUtils.getTime());
|
||||
stock.setProductGuid(mydoJobDetail.getProductGuid());
|
||||
|
||||
@@ -161,10 +161,12 @@ public class OutStockoutServiceImpl implements IOutStockoutService
|
||||
outStockoutDetail.setStockoutId(stockoutId);
|
||||
List<OutStockoutDetail> outStockoutDetails = outStockoutDetailService.selectOutStockoutDetailList(outStockoutDetail);
|
||||
for (OutStockoutDetail detail : outStockoutDetails) {
|
||||
map.put("v_stockout_detail_id", detail.getStockoutDetailId());
|
||||
outStockoutMapper.autoAllot(map);
|
||||
if (!"10".equals(map.get("v_result"))){
|
||||
stringBuilder.append(",").append(map.get("v_resultString"));
|
||||
if (detail.getAllotQuantity().compareTo(detail.getQuantity()) < 0){
|
||||
map.put("v_stockout_detail_id", detail.getStockoutDetailId());
|
||||
outStockoutMapper.autoAllot(map);
|
||||
if (!"10".equals(map.get("v_result"))){
|
||||
stringBuilder.append(",").append(map.get("v_resultString"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (stringBuilder.length()>0){
|
||||
|
||||
@@ -244,6 +244,19 @@ public class PdaController extends BaseController {
|
||||
return pdaService.outMakeSure(trayCodeMakeSure);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出货异常流程
|
||||
* @param trayCodeMakeSure
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:out:exception')")
|
||||
@PostMapping("/outException")
|
||||
@ResponseBody
|
||||
public AjaxResult outException(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
|
||||
return pdaService.outException(trayCodeMakeSure);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 盘点出库确认
|
||||
* @param trayCodeMakeSure 托盘信息
|
||||
|
||||
@@ -26,4 +26,6 @@ public interface PdaService {
|
||||
AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure);
|
||||
|
||||
AjaxResult checkMakeSure(TrayCodeMakeSure trayCodeMakeSure);
|
||||
|
||||
AjaxResult outException(TrayCodeMakeSure trayCodeMakeSure);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.in.stockin.service.IInStockinService;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.out.outStockout.domain.OutStockout;
|
||||
import com.ruoyi.out.outStockout.service.IOutStockoutService;
|
||||
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
|
||||
import com.ruoyi.out.outStockoutDetail.service.IOutStockoutDetailService;
|
||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||
import com.ruoyi.pda.domain.TrayCodeMsg;
|
||||
import com.ruoyi.pda.mapper.PdaMapper;
|
||||
@@ -34,6 +38,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PdaServiceImp implements PdaService {
|
||||
@@ -58,6 +63,10 @@ public class PdaServiceImp implements PdaService {
|
||||
private IBasContainerDetailsService basContainerDetailsService;
|
||||
@Autowired
|
||||
private ICheckCommitRecordService checkCommitRecordService;
|
||||
@Autowired
|
||||
private IOutStockoutService outStockoutService;
|
||||
@Autowired
|
||||
private IOutStockoutDetailService outStockoutDetailService;
|
||||
|
||||
/**
|
||||
* 空托盘入库
|
||||
@@ -188,35 +197,12 @@ public class PdaServiceImp implements PdaService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
//修改拣选数量
|
||||
|
||||
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
|
||||
if(CollUtil.isNotEmpty(mydoJobDetailList)){
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
|
||||
MydoJobDetail mydoJobDetailOld = mydoJobDetailService.selectMydoJobDetailByJobDetailId(mydoJobDetail.getJobDetailId());
|
||||
BigDecimal oldPickQuantity = Convert.toBigDecimal(mydoJobDetailOld.getPickQuantity());
|
||||
BigDecimal newPickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
mydoJobDetailOld.setPickQuantity(oldPickQuantity.add(newPickQuantity).toString());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetailOld);
|
||||
|
||||
BasContainerDetails basContainerDetailsParam = new BasContainerDetails();
|
||||
basContainerDetailsParam.setContainerId(trayCodeMakeSure.getContainerCode());
|
||||
basContainerDetailsParam.setProductId(mydoJobDetailOld.getProductId());
|
||||
List<BasContainerDetails> basContainerDetails = basContainerDetailsService.selectBasContainerDetailsList(basContainerDetailsParam);
|
||||
if (CollUtil.isNotEmpty(basContainerDetails)){
|
||||
BasContainerDetails oldBasContainerDetails = basContainerDetails.get(0);
|
||||
oldBasContainerDetails.setQuantity(oldBasContainerDetails.getQuantity()+Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.updateBasContainerDetails(oldBasContainerDetails);
|
||||
}else {
|
||||
BasContainerDetails newBasContainerDetails = new BasContainerDetails();
|
||||
newBasContainerDetails.setContainerId(trayCodeMakeSure.getContainerCode());
|
||||
newBasContainerDetails.setProductId(mydoJobDetail.getProductId());
|
||||
newBasContainerDetails.setQuantity(Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.insertBasContainerDetails(newBasContainerDetails);
|
||||
}
|
||||
}
|
||||
|
||||
if(CollUtil.isEmpty(mydoJobDetailList)){
|
||||
return AjaxResult.warn("拣选的物料不能为空");
|
||||
}
|
||||
//查询当前任务是否已经全部拣选完成
|
||||
//判断任务是否存在
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTrayCode(trayCodeMakeSure.getTrayCode());
|
||||
List<MydoJob> mydoJobList = mydoJobService.selectMydoJobList(mydoJobParam);
|
||||
@@ -231,7 +217,106 @@ public class PdaServiceImp implements PdaService {
|
||||
return AjaxResult.warn("子任务不存在");
|
||||
}
|
||||
|
||||
boolean flag = mydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
|
||||
//获取单据类型
|
||||
OutStockout outStockoutParam = new OutStockout();
|
||||
outStockoutParam.setStockoutId(mydoJobDetails.get(0).getInOrOutId());
|
||||
List<OutStockout> outStockouts = outStockoutService.selectOutStockoutList(outStockoutParam);
|
||||
if (CollUtil.isEmpty(outStockouts)) {
|
||||
return AjaxResult.warn("单据不存在");
|
||||
}
|
||||
String billType = outStockouts.get(0).getOutType();
|
||||
|
||||
switch (billType) {
|
||||
case "1":
|
||||
//销售单据
|
||||
return handleOutType1(trayCodeMakeSure,mydoJobDetailList,mydoJobList.get(0));
|
||||
case "2":
|
||||
//退货单据 不绑定容器
|
||||
return handleOutType2(trayCodeMakeSure,mydoJobDetailList,mydoJobList.get(0));
|
||||
default:
|
||||
return AjaxResult.warn("单据类型错误");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理退货出库
|
||||
* @param trayCodeMakeSure
|
||||
* @param mydoJobDetailList
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
|
||||
private AjaxResult handleOutType2(TrayCodeMakeSure trayCodeMakeSure,List<MydoJobDetail> mydoJobDetailList,MydoJob mydoJob) {
|
||||
//修改拣选数量
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
|
||||
MydoJobDetail mydoJobDetailOld = mydoJobDetailService.selectMydoJobDetailByJobDetailId(mydoJobDetail.getJobDetailId());
|
||||
BigDecimal oldPickQuantity = Convert.toBigDecimal(mydoJobDetailOld.getPickQuantity());
|
||||
BigDecimal newPickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
mydoJobDetailOld.setPickQuantity(oldPickQuantity.add(newPickQuantity).toString());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetailOld);
|
||||
}
|
||||
//判断拣选数量是否等于出库数量
|
||||
MydoJobDetail mydoJobDetailParam = new MydoJobDetail();
|
||||
mydoJobDetailParam.setJobId(mydoJob.getJobId());
|
||||
List<MydoJobDetail> currentMydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
|
||||
boolean flag = currentMydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
|
||||
if (flag) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
pdaMapper.outMakeSure(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
} else {
|
||||
return AjaxResult.warn(map.get("v_resultmsg").toString());
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.warn("拣选完成");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理正常出库
|
||||
* @param trayCodeMakeSure
|
||||
* @param mydoJobDetailList
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
private AjaxResult handleOutType1(TrayCodeMakeSure trayCodeMakeSure,List<MydoJobDetail> mydoJobDetailList,MydoJob mydoJob) {
|
||||
|
||||
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
|
||||
|
||||
//修改拣选数量
|
||||
MydoJobDetail mydoJobDetailOld = mydoJobDetailService.selectMydoJobDetailByJobDetailId(mydoJobDetail.getJobDetailId());
|
||||
BigDecimal oldPickQuantity = Convert.toBigDecimal(mydoJobDetailOld.getPickQuantity());
|
||||
BigDecimal newPickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
mydoJobDetailOld.setPickQuantity(oldPickQuantity.add(newPickQuantity).toString());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetailOld);
|
||||
|
||||
//绑定容器
|
||||
BasContainerDetails basContainerDetailsParam = new BasContainerDetails();
|
||||
basContainerDetailsParam.setContainerId(trayCodeMakeSure.getContainerCode());
|
||||
basContainerDetailsParam.setProductId(mydoJobDetailOld.getProductId());
|
||||
List<BasContainerDetails> basContainerDetails = basContainerDetailsService.selectBasContainerDetailsList(basContainerDetailsParam);
|
||||
if (CollUtil.isNotEmpty(basContainerDetails)){
|
||||
BasContainerDetails oldBasContainerDetails = basContainerDetails.get(0);
|
||||
oldBasContainerDetails.setQuantity(oldBasContainerDetails.getQuantity()+Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.updateBasContainerDetails(oldBasContainerDetails);
|
||||
}else {
|
||||
BasContainerDetails newBasContainerDetails = new BasContainerDetails();
|
||||
newBasContainerDetails.setContainerId(trayCodeMakeSure.getContainerCode());
|
||||
newBasContainerDetails.setProductId(mydoJobDetail.getProductId());
|
||||
newBasContainerDetails.setQuantity(Convert.toLong(mydoJobDetail.getPickQuantity()));
|
||||
basContainerDetailsService.insertBasContainerDetails(newBasContainerDetails);
|
||||
}
|
||||
}
|
||||
|
||||
//判断拣选数量是否等于出库数量
|
||||
MydoJobDetail mydoJobDetailParam = new MydoJobDetail();
|
||||
mydoJobDetailParam.setJobId(mydoJob.getJobId());
|
||||
List<MydoJobDetail> currentMydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
|
||||
boolean flag = currentMydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
|
||||
if (flag) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
@@ -276,4 +361,45 @@ public class PdaServiceImp implements PdaService {
|
||||
return AjaxResult.warn(map.get("v_resultmsg").toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult outException(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
//判断任务是否存在
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTrayCode(trayCodeMakeSure.getTrayCode());
|
||||
List<MydoJob> mydoJobList = mydoJobService.selectMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isEmpty(mydoJobList)) {
|
||||
return AjaxResult.warn("任务不存在");
|
||||
}
|
||||
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
|
||||
//判断拣选数量
|
||||
MydoJobDetail param = new MydoJobDetail();
|
||||
param.setJobId(mydoJob.getJobId());
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
|
||||
|
||||
String stockOutId = "";
|
||||
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||
//修改单据实际分配数量
|
||||
BigDecimal pickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(mydoJobDetail.getInOrOutDId());
|
||||
outStockoutDetail.setAllotQuantity(outStockoutDetail.getAllotQuantity().subtract(pickQuantity));
|
||||
stockOutId = outStockoutDetail.getStockoutId();
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
//生成回流任务,返回原库位,标记货位为异常待盘点状态
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
pdaMapper.outMakeSure(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
//自动分配
|
||||
outStockoutService.autoAllot(stockOutId);
|
||||
return AjaxResult.success("操作成功");
|
||||
} else {
|
||||
throw new RuntimeException(map.get("v_resultmsg").toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存信息对象 bas_stock
|
||||
*
|
||||
@@ -125,6 +127,16 @@ public class BasStock extends BaseEntity
|
||||
|
||||
private String productId;
|
||||
|
||||
private List<String> typeData;
|
||||
|
||||
public List<String> getTypeData() {
|
||||
return typeData;
|
||||
}
|
||||
|
||||
public void setTypeData(List<String> typeData) {
|
||||
this.typeData = typeData;
|
||||
}
|
||||
|
||||
public String getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
@@ -2,18 +2,19 @@ package com.ruoyi.stock.stock.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 库存信息Mapper接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-24
|
||||
*/
|
||||
public interface BasStockMapper
|
||||
public interface BasStockMapper
|
||||
{
|
||||
/**
|
||||
* 查询库存信息
|
||||
*
|
||||
*
|
||||
* @param stockId 库存信息主键
|
||||
* @return 库存信息
|
||||
*/
|
||||
@@ -21,7 +22,7 @@ public interface BasStockMapper
|
||||
|
||||
/**
|
||||
* 查询库存信息列表
|
||||
*
|
||||
*
|
||||
* @param basStock 库存信息
|
||||
* @return 库存信息集合
|
||||
*/
|
||||
@@ -29,7 +30,7 @@ public interface BasStockMapper
|
||||
|
||||
/**
|
||||
* 新增库存信息
|
||||
*
|
||||
*
|
||||
* @param basStock 库存信息
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -37,7 +38,7 @@ public interface BasStockMapper
|
||||
|
||||
/**
|
||||
* 修改库存信息
|
||||
*
|
||||
*
|
||||
* @param basStock 库存信息
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -45,7 +46,7 @@ public interface BasStockMapper
|
||||
|
||||
/**
|
||||
* 删除库存信息
|
||||
*
|
||||
*
|
||||
* @param stockId 库存信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -53,7 +54,7 @@ public interface BasStockMapper
|
||||
|
||||
/**
|
||||
* 批量删除库存信息
|
||||
*
|
||||
*
|
||||
* @param stockIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -62,4 +63,6 @@ public interface BasStockMapper
|
||||
void insertBasStockList(List<BasStock> list);
|
||||
|
||||
List<BasStock> selectKtpStock(BasStock basStock);
|
||||
|
||||
int updateStockStatusByTrayCode(@Param("stockStatus") String stockStatus,@Param("trayCode") String trayCode);
|
||||
}
|
||||
|
||||
@@ -111,31 +111,27 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
{
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(basStock.getStockId());
|
||||
insertMaintainRecord(oldBasStock,basStock,"2");
|
||||
BasCargoSpace oldBasCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(basStock.getCargoSpaceId());
|
||||
insertFreezeRecord(oldBasCargoSpace,basStock);
|
||||
insertFreezeRecord(oldBasStock,basStock);
|
||||
return basStockMapper.updateBasStock(basStock);
|
||||
}
|
||||
|
||||
private void insertFreezeRecord(BasCargoSpace oldBasCargoSpace, BasStock basStock) {
|
||||
if (!oldBasCargoSpace.getLocked().equals(basStock.getCargoSpaceStatus())){
|
||||
private void insertFreezeRecord(BasStock oldBasStock, BasStock basStock) {
|
||||
if (!oldBasStock.getStockStatus().equals(basStock.getStockStatus())){
|
||||
BasStockFreezeRecord basStockFreezeRecord = new BasStockFreezeRecord();
|
||||
basStockFreezeRecord.setWhGuid(IdUtil.fastSimpleUUID());
|
||||
basStockFreezeRecord.setCargoSpaceId(basStock.getCargoSpaceId());
|
||||
basStockFreezeRecord.setTrayCode(basStock.getTrayCode());
|
||||
basStockFreezeRecord.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
basStockFreezeRecord.setCreateTime(new Date());
|
||||
basStockFreezeRecord.setOldStatus(oldBasCargoSpace.getLocked());
|
||||
basStockFreezeRecord.setCurrStatus(basStock.getCargoSpaceStatus());
|
||||
basStockFreezeRecord.setOldStatus(oldBasStock.getStockStatus());
|
||||
basStockFreezeRecord.setCurrStatus(basStock.getStockStatus());
|
||||
basStockFreezeRecord.setWarehouseId(basStock.getWarehouseId());
|
||||
if ("N".equals(basStock.getCargoSpaceStatus())){
|
||||
basStockFreezeRecord.setMethod("解锁");
|
||||
if ("1".equals(basStock.getStockStatus())){
|
||||
basStockFreezeRecord.setMethod("解冻");
|
||||
}else {
|
||||
basStockFreezeRecord.setMethod("锁定");
|
||||
basStockFreezeRecord.setMethod("冻结");
|
||||
}
|
||||
BasCargoSpace basCargoSpace = new BasCargoSpace();
|
||||
basCargoSpace.setCargoSpaceId(basStock.getCargoSpaceId());
|
||||
basCargoSpace.setLocked(basStock.getCargoSpaceStatus());
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
basStockMapper.updateStockStatusByTrayCode(basStock.getStockStatus(),oldBasStock.getTrayCode());
|
||||
basStockFreezeRecordService.insertBasStockFreezeRecord(basStockFreezeRecord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.check.difference.mapper.CheckDifferenceRecordMapper">
|
||||
|
||||
|
||||
<resultMap type="CheckDifferenceRecord" id="CheckDifferenceRecordResult">
|
||||
<result property="checkGuid" column="check_guid" />
|
||||
<result property="checkStockDetailId" column="check_stock_detail_id" />
|
||||
@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectCheckDifferenceRecordList" parameterType="CheckDifferenceRecord" resultMap="CheckDifferenceRecordResult">
|
||||
<include refid="selectCheckDifferenceRecordVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="checkStockDetailId != null and checkStockDetailId != ''"> and check_stock_detail_id = #{checkStockDetailId}</if>
|
||||
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
@@ -41,8 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="recordType != null "> and record_type = #{recordType}</if>
|
||||
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCheckDifferenceRecordByCheckGuid" parameterType="String" resultMap="CheckDifferenceRecordResult">
|
||||
<include refid="selectCheckDifferenceRecordVo"/>
|
||||
where check_guid = #{checkGuid}
|
||||
@@ -65,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="recordType != null">record_type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="productGuid != null">product_guid,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="checkGuid != null">#{checkGuid},</if>
|
||||
@@ -81,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="recordType != null">#{recordType},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="productGuid != null">#{productGuid},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -109,9 +112,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCheckDifferenceRecordByCheckGuids" parameterType="String">
|
||||
delete from check_difference_record where check_guid in
|
||||
delete from check_difference_record where check_guid in
|
||||
<foreach item="checkGuid" collection="array" open="(" separator="," close=")">
|
||||
#{checkGuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -54,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="barCodeQuantity != null and barCodeQuantity != ''"> and bar_code_quantity = #{barCodeQuantity}</if>
|
||||
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectBasStockFreezeRecordByWhGuid" parameterType="String" resultMap="BasStockFreezeRecordResult">
|
||||
|
||||
@@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="barCodeOldQuantity != null and barCodeOldQuantity != ''"> and bar_code_old_quantity = #{barCodeOldQuantity}</if>
|
||||
<if test="barCodeQuantity != null and barCodeQuantity != ''"> and bar_code_quantity = #{barCodeQuantity}</if>
|
||||
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
|
||||
order by create_time desc
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -87,6 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare5 != null and spare5 != ''"> and bs.spare5 = #{spare5}</if>
|
||||
<if test="spare6 != null and spare6 != ''"> and bs.spare6 = #{spare6}</if>
|
||||
<if test="cargoSpaceStockStatus != null and cargoSpaceStockStatus != ''"> and bcs.status = #{cargoSpaceStockStatus}</if>
|
||||
<if test="typeData != null and typeData.size()>0">
|
||||
and bw.warehouse_type in
|
||||
<foreach item="item" index="index" collection="typeData" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -240,6 +246,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
where stock_id = #{stockId}
|
||||
</update>
|
||||
<update id="updateStockStatusByTrayCode">
|
||||
update bas_stock set stock_status = #{stockStatus} where tray_code = #{trayCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasStockByStockId" parameterType="String">
|
||||
delete from bas_stock where stock_id = #{stockId}
|
||||
|
||||
Reference in New Issue
Block a user