现场运行调整优化和页面移除绑定信息功能
This commit is contained in:
@@ -9,14 +9,7 @@ import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import jakarta.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 org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
package com.ruoyi.in.bind.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.common.ProductType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.in.bind.mapper.InTrayMsgMapper;
|
||||
@@ -14,12 +22,16 @@ import com.ruoyi.in.bind.service.IInTrayMsgService;
|
||||
* @author ruoyi
|
||||
* @date 2026-05-14
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class InTrayMsgServiceImpl implements IInTrayMsgService
|
||||
{
|
||||
@Autowired
|
||||
private InTrayMsgMapper inTrayMsgMapper;
|
||||
|
||||
@Autowired
|
||||
IInStockinDetailService instockinDetailService;
|
||||
|
||||
/**
|
||||
* 查询入库信息
|
||||
*
|
||||
@@ -89,6 +101,25 @@ public class InTrayMsgServiceImpl implements IInTrayMsgService
|
||||
@Override
|
||||
public int deleteInTrayMsgByIds(Long[] ids)
|
||||
{
|
||||
for (Long id : ids){
|
||||
InTrayMsg msg = inTrayMsgMapper.selectInTrayMsgById(id);
|
||||
|
||||
//检查该版辊信息是否存在
|
||||
if (ObjUtil.isNull(msg)) continue;
|
||||
|
||||
//检查该版辊信息是否为空托 - 非空托盘则查找入库明细更新【扫码数量】为【0】
|
||||
if (!msg.getProductId().equals(ProductType.EMPTY_TRAY)) continue;
|
||||
|
||||
InStockinDetail detail = instockinDetailService.selectInStockinDetailByProductId(msg.getProductId());
|
||||
//入库明细中有该版辊信息则还原【扫码数量】为【0】
|
||||
if (ObjUtil.isNull(detail)) continue;
|
||||
|
||||
detail.setScanNum(BigDecimal.ZERO);
|
||||
instockinDetailService.updateInStockinDetail(detail);
|
||||
|
||||
log.info("【移除绑定】操作成功,移除的绑定信息[条码:{},物料编号:{},物料名称:{}]", msg.getTrayCode(), msg.getProductId(), msg.getProductName());
|
||||
|
||||
}
|
||||
return inTrayMsgMapper.deleteInTrayMsgByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
@@ -536,11 +536,11 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
}
|
||||
|
||||
//--------------------更新货位状态--------------------
|
||||
BasCargoSpace cargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basCargoSpaceService.updateBasCargoSpaceStatus(cargoSpace.getCargoSpaceId(), "", CargoSpaceCode.CARGOSPACE_STATUS_AVAILABLE);
|
||||
// BasCargoSpace cargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basCargoSpaceService.updateBasCargoSpaceStatus(mydoJob.getCargoSpaceId(), "", CargoSpaceCode.CARGOSPACE_STATUS_AVAILABLE);
|
||||
basCargoSpaceService.updateBasCargoSpaceStatus(mydoJob.getTargetCargoSpaceId(), mydoJob.getTrayCode(), CargoSpaceCode.CARGOSPACE_STATUS_OCCUPIED);
|
||||
|
||||
log.info("【账务处理】更新<移库完成>货位状态,作业号:{},货位:{},托盘号:{}", jobId, cargoSpace.getCargoSpaceId(), mydoJob.getTrayCode());
|
||||
log.info("【账务处理】更新<移库完成>货位状态,作业号:{},源货位:{},目标货位:{},托盘号:{}", jobId, mydoJob.getCargoSpaceId(),mydoJob.getTargetCargoSpaceId(), mydoJob.getTrayCode());
|
||||
|
||||
//--------------------处理任务表和子任务表--------------------
|
||||
//1.更新任务主表状态并移除作业
|
||||
|
||||
@@ -547,6 +547,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
|
||||
|
||||
//2.生成辊号库存对应托盘的出库作业
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTrayCode(stock.getTrayCode());
|
||||
mydoJob.setCargoSpaceId(stock.getCargoSpaceId());
|
||||
|
||||
if (ObjUtil.isNull(mydoJob)){
|
||||
|
||||
|
||||
@@ -247,6 +247,14 @@ public class PdaServiceImpl implements IPdaService {
|
||||
return AjaxResult.error("【入库绑定失败】当前条码有未结束的任务,无法执行绑定操作,请检查该托盘的任务状态,当前条码:" + trayCode);
|
||||
}
|
||||
|
||||
List<BasCargoSpace> cargoExist = basCargoSpaceService.selectBasCargoSpaceList(
|
||||
new BasCargoSpace().builder().trayCode(trayCode).build()
|
||||
);
|
||||
if (!cargoExist.isEmpty()){
|
||||
log.warn("【入库绑定失败】存在当前条码的货位信息,无法执行绑定操作,请检查该托盘的任务状态,条码:{}", trayCode);
|
||||
return AjaxResult.error("【入库绑定失败】存在当前条码的货位信息,无法执行绑定操作,请检查该托盘的任务状态,当前条码:" + trayCode);
|
||||
}
|
||||
|
||||
//获取绑定状态,【新建绑定】或【原有库存】
|
||||
int trayMsgStatus =
|
||||
ObjUtil.isNull(basStockInfoService.selectBasStockInfoByTrayCode(trayCode)) ? InTrayMsgCode.STATUS_NEW :InTrayMsgCode.STATUS_EXIST;
|
||||
|
||||
@@ -360,6 +360,12 @@ public class MydoJobHandler {
|
||||
mydoJobDetailService.deleteMydoJobDetailsByJobId(mydoJob.getJobId());
|
||||
log.info("【手动作废任务】移除<移库>任务明细,作业号:{}", mydoJob.getJobId());
|
||||
}
|
||||
//库存主表
|
||||
BasStockInfo stockInfo = basStockInfoService.selectBasStockInfoByTrayCode(mydoJob.getTrayCode());
|
||||
if (ObjUtil.isNotNull(stockInfo)){
|
||||
stockInfo.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basStockInfoService.updateBasStockInfo(stockInfo);
|
||||
}
|
||||
//库存子表
|
||||
List<BasStock> stocks = basStockService.selectBasStockListByTrayCode(mydoJob.getTrayCode());
|
||||
if (!stocks.isEmpty()){
|
||||
@@ -375,11 +381,7 @@ public class MydoJobHandler {
|
||||
basCargoSpaceService.updateBasCargoSpaceStatus(mydoJob.getCargoSpaceId(), mydoJob.getTrayCode(), CargoSpaceCode.CARGOSPACE_STATUS_OCCUPIED);
|
||||
//目标位置
|
||||
basCargoSpaceService.updateBasCargoSpaceStatus(mydoJob.getTargetCargoSpaceId(), "", CargoSpaceCode.CARGOSPACE_STATUS_AVAILABLE);
|
||||
BasStockInfo stockInfo = basStockInfoService.selectBasStockInfoByTrayCode(mydoJob.getTrayCode());
|
||||
if (ObjUtil.isNotNull(stockInfo)){
|
||||
stockInfo.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basStockInfoService.updateBasStockInfo(stockInfo);
|
||||
}
|
||||
|
||||
log.info(
|
||||
"【账务处理-移库】任务作废,更新库存和货位信息,托盘号:{},源位置:{},目标位置:{}", mydoJob.getTrayCode(), mydoJob.getCargoSpaceId(), mydoJob.getTargetCargoSpaceId()
|
||||
);
|
||||
@@ -839,6 +841,13 @@ public class MydoJobHandler {
|
||||
mydoJobDetailService.deleteMydoJobDetailsByJobId(mydoJob.getJobId());
|
||||
log.info("【手动完成任务】移除<移库>任务明细,作业号:{}", mydoJob.getJobId());
|
||||
}
|
||||
//库存主表
|
||||
BasStockInfo stockInfo = basStockInfoService.selectBasStockInfoByTrayCode(mydoJob.getTrayCode());
|
||||
if (ObjUtil.isNotNull(stockInfo)){
|
||||
stockInfo.setCargoSpaceId(mydoJob.getTargetCargoSpaceId());
|
||||
basStockInfoService.updateBasStockInfo(stockInfo);
|
||||
}
|
||||
|
||||
//库存子表
|
||||
List<BasStock> stocks = basStockService.selectBasStockListByTrayCode(mydoJob.getTrayCode());
|
||||
if (!stocks.isEmpty()){
|
||||
@@ -856,11 +865,7 @@ public class MydoJobHandler {
|
||||
"【账务处理-移库】更新库存和货位信息,托盘号:{},源位置:{},目标位置:{}", mydoJob.getTrayCode(), mydoJob.getCargoSpaceId(), mydoJob.getTargetCargoSpaceId()
|
||||
);
|
||||
|
||||
BasStockInfo stockInfo = basStockInfoService.selectBasStockInfoByTrayCode(mydoJob.getTrayCode());
|
||||
if (ObjUtil.isNotNull(stockInfo)){
|
||||
stockInfo.setCargoSpaceId(mydoJob.getTargetCargoSpaceId());
|
||||
basStockInfoService.updateBasStockInfo(stockInfo);
|
||||
}
|
||||
|
||||
|
||||
mydoJobService.insertMydoJobFinish(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
|
||||
@@ -168,7 +168,7 @@ public class RequestWcsHandler {
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
||||
paramMap.put("trayCode", mydoJob.getTrayCode());//容器编号
|
||||
paramMap.put("taskNo", mydoJob.getTaskNo());//容器编号
|
||||
paramMap.put("taskNo", mydoJob.getTaskNo());
|
||||
paramMap.put("jobId", mydoJob.getJobId());
|
||||
paramMap.put("inOrOut", mydoJob.getInOrOut());
|
||||
paramMap.put("cargoSpaceId", mydoJob.getCargoSpaceId());
|
||||
|
||||
@@ -55,7 +55,7 @@ export function delBindTrayMsg(id) {
|
||||
// 删除入库信息
|
||||
export function delBindTrayMsgByRollerNumber(rollerNumbers) {
|
||||
return request({
|
||||
url: '/in/bindMsg/delete/' + rollerNumbers,
|
||||
method: 'delete'
|
||||
url: '/in/bindMsg/delete/' + rollerNumbers.join(','),
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@@ -123,7 +123,7 @@
|
||||
@click="handleAdd('emptyTray')"
|
||||
v-hasPermi="['in:bindMsg:add']"
|
||||
>新增空托盘绑定</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
@@ -135,17 +135,17 @@
|
||||
v-hasPermi="['in:bindTrayMsg:edit']"
|
||||
>修改</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['in:bindMsg:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
@@ -255,7 +255,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listBindTrayMsg, getBindTrayMsg, delBindTrayMsgByRollerNumber, addBindTrayMsg, addBindEmptyTrayMsg } from "@/api/in/bindTrayMsg"
|
||||
import { listBindTrayMsg, getBindTrayMsg, delBindTrayMsg, addBindTrayMsg, addBindEmptyTrayMsg } from "@/api/in/bindTrayMsg"
|
||||
import { data } from "vue-barcode";
|
||||
|
||||
export default {
|
||||
@@ -462,31 +462,31 @@ export default {
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
// handleDelete(row) {
|
||||
// // 统一将单条数据转为数组,方便后端 String[] 接收
|
||||
// const ids = row.id || row.ids;
|
||||
|
||||
// this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function() {
|
||||
// return delBindTrayMsg(ids)
|
||||
// }).then(() => {
|
||||
// this.getList()
|
||||
// this.$modal.msgSuccess("删除成功")
|
||||
// }).catch(() => {})
|
||||
// },
|
||||
handleDelete(row) {
|
||||
// 统一将单条数据转为数组,方便后端 String[] 接收
|
||||
const rollerNumbers = row.rollerNumber ? [row.rollerNumber] : this.rollerNumbers;
|
||||
console.log(row)
|
||||
console.log(rollerNumbers)
|
||||
this.$modal.confirm('是否确认删除版辊编号为"' + rollerNumbers.join(",") + '"的数据项?').then(() => {
|
||||
return delBindTrayMsgByRollerNumber(rollerNumbers)
|
||||
const ids = row.id || row.ids;
|
||||
|
||||
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delBindTrayMsg(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {
|
||||
this.getList()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
// handleDelete(row) {
|
||||
// // 统一将单条数据转为数组,方便后端 String[] 接收
|
||||
// const rollerNumbers = row ? [row.productId] : this.productIds;
|
||||
// console.log(row)
|
||||
// console.log(rollerNumbers)
|
||||
// this.$modal.confirm('是否确认删除版辊编号为"' + rollerNumbers.join(",") + '"的数据项?').then(() => {
|
||||
// return delBindTrayMsgByRollerNumber(rollerNumbers)
|
||||
// }).then(() => {
|
||||
// this.getList()
|
||||
// this.$modal.msgSuccess("删除成功")
|
||||
// }).catch(() => {
|
||||
// this.getList()
|
||||
// })
|
||||
// },
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
||||
Reference in New Issue
Block a user