mdf:入库兼容混料
This commit is contained in:
@@ -216,7 +216,7 @@
|
|||||||
|
|
||||||
<select id="queryAvailableInv" resultType="org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto">
|
<select id="queryAvailableInv" resultType="org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto">
|
||||||
SELECT
|
SELECT
|
||||||
ext.group_id as storagevehicleext_id,
|
ext.group_id,
|
||||||
ext.storagevehicle_code,
|
ext.storagevehicle_code,
|
||||||
ext.pcsn,
|
ext.pcsn,
|
||||||
ext.qty_unit_name,
|
ext.qty_unit_name,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.wms.basedata_manage.service.dto;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleext;
|
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleext;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ import java.math.BigDecimal;
|
|||||||
* 2025/6/5
|
* 2025/6/5
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class MdPbStoragevehicleextDto extends MdPbStoragevehicleext{
|
public class MdPbStoragevehicleextDto extends GroupPlate {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库区标识
|
* 库区标识
|
||||||
@@ -51,6 +52,7 @@ public class MdPbStoragevehicleextDto extends MdPbStoragevehicleext{
|
|||||||
* 物料名称
|
* 物料名称
|
||||||
*/
|
*/
|
||||||
private String material_name;
|
private String material_name;
|
||||||
|
private String material_code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数量
|
* 数量
|
||||||
|
|||||||
@@ -39,12 +39,15 @@
|
|||||||
mb.material_code,
|
mb.material_code,
|
||||||
mb.material_name,
|
mb.material_name,
|
||||||
task.task_code,
|
task.task_code,
|
||||||
ext.create_time as insert_time
|
ext.create_time as insert_time,
|
||||||
|
ext.qty
|
||||||
FROM
|
FROM
|
||||||
st_ivt_iostorinvdis dis
|
st_ivt_iostorinvdis dis
|
||||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
||||||
LEFT JOIN sch_base_task task ON task.task_id = dis.task_id
|
LEFT JOIN sch_base_task task ON task.task_id = dis.task_id
|
||||||
LEFT JOIN md_pb_groupplate ext ON ext.storagevehicle_code = dis.storagevehicle_code
|
LEFT JOIN md_pb_groupplate ext
|
||||||
|
ON ext.storagevehicle_code = dis.storagevehicle_code
|
||||||
|
and ext.material_id = dis.material_id and ext.pcsn = dis.pcsn
|
||||||
where
|
where
|
||||||
1=1
|
1=1
|
||||||
<if test="params.iostorinvdtl_id != null">
|
<if test="params.iostorinvdtl_id != null">
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getIODtl" resultType="org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDtlDto">
|
<select id="getIODtl" resultType="org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDtlDto">
|
||||||
SELECT DISTINCT
|
SELECT
|
||||||
dtl.*,
|
dtl.*,
|
||||||
mb.material_code,
|
mb.material_code,
|
||||||
mb.material_name,
|
mb.material_name,
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ public class IOStorInvDisDto extends IOStorInvDis {
|
|||||||
* 物料名称
|
* 物料名称
|
||||||
*/
|
*/
|
||||||
private String material_name;
|
private String material_name;
|
||||||
|
/**
|
||||||
|
* 物料总数量
|
||||||
|
*/
|
||||||
|
private String qty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务号
|
* 任务号
|
||||||
|
|||||||
@@ -475,10 +475,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
Set<String> dtlSet = new HashSet<>();
|
Set<String> dtlSet = new HashSet<>();
|
||||||
|
|
||||||
for (IOStorInvDis ioStorInvDis:ioStorInvDisList){
|
for (IOStorInvDis ioStorInvDis:ioStorInvDisList){
|
||||||
|
|
||||||
//添加需要更新的明细标识
|
//添加需要更新的明细标识
|
||||||
dtlSet.add(ioStorInvDis.getIostorinvdtl_id());
|
dtlSet.add(ioStorInvDis.getIostorinvdtl_id());
|
||||||
|
|
||||||
//更新库存 减冻结加可用
|
//更新库存 减冻结加可用
|
||||||
List<JSONObject> updateIvtList = new ArrayList<>();
|
List<JSONObject> updateIvtList = new ArrayList<>();
|
||||||
JSONObject jsonIvt = new JSONObject();
|
JSONObject jsonIvt = new JSONObject();
|
||||||
@@ -491,7 +489,6 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
jsonIvt.put("change_qty", ioStorInvDis.getPlan_qty());
|
||||||
updateIvtList.add(jsonIvt);
|
updateIvtList.add(jsonIvt);
|
||||||
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
iMdPbGroupPlateService.updateIvt(updateIvtList);
|
||||||
|
|
||||||
//解锁库位
|
//解锁库位
|
||||||
JSONObject unlock_map = new JSONObject();
|
JSONObject unlock_map = new JSONObject();
|
||||||
unlock_map.put("struct_code", ioStorInvDis.getStruct_code());
|
unlock_map.put("struct_code", ioStorInvDis.getStruct_code());
|
||||||
@@ -499,7 +496,6 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
unlock_map.put("inv_id", null);
|
unlock_map.put("inv_id", null);
|
||||||
unlock_map.put("inv_code", null);
|
unlock_map.put("inv_code", null);
|
||||||
iStructattrService.updateStatusByCode("2",unlock_map);
|
iStructattrService.updateStatusByCode("2",unlock_map);
|
||||||
|
|
||||||
//删除出入库单分配表
|
//删除出入库单分配表
|
||||||
ioStorInvDisMapper.deleteById(ioStorInvDis.getIostorinvdis_id());
|
ioStorInvDisMapper.deleteById(ioStorInvDis.getIostorinvdis_id());
|
||||||
|
|
||||||
@@ -559,6 +555,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
mater.setQty(unassign_qty);
|
mater.setQty(unassign_qty);
|
||||||
mater.setPcsn(pcsn);
|
mater.setPcsn(pcsn);
|
||||||
mater.setMaterial_code(material_code);
|
mater.setMaterial_code(material_code);
|
||||||
|
mater.setMaterial_id(dtl.getMaterial_id());
|
||||||
List<StrategyMater> list = new ArrayList<>();
|
List<StrategyMater> list = new ArrayList<>();
|
||||||
list.add(mater);
|
list.add(mater);
|
||||||
//调用分配规则获取分配的库位:如果库存不足则直接报错
|
//调用分配规则获取分配的库位:如果库存不足则直接报错
|
||||||
@@ -759,7 +756,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
double allocation_canuse_qty = 0;
|
double allocation_canuse_qty = 0;
|
||||||
for (int i = 0; i < rows.size(); i++){
|
for (int i = 0; i < rows.size(); i++){
|
||||||
JSONObject ivt = rows.getJSONObject(i);
|
JSONObject ivt = rows.getJSONObject(i);
|
||||||
double canuse_qty = ivt.getDoubleValue("canuse_qty");
|
double canuse_qty = ivt.getDoubleValue("qty");
|
||||||
//分配明细
|
//分配明细
|
||||||
IOStorInvDis ioStorInvDis = new IOStorInvDis();
|
IOStorInvDis ioStorInvDis = new IOStorInvDis();
|
||||||
ioStorInvDis.setIostorinvdis_id(IdUtil.getStringId());
|
ioStorInvDis.setIostorinvdis_id(IdUtil.getStringId());
|
||||||
@@ -769,6 +766,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
ioStorInvDis.setSect_id(ivt.getString("sect_id"));
|
ioStorInvDis.setSect_id(ivt.getString("sect_id"));
|
||||||
ioStorInvDis.setPcsn(ivt.getString("pcsn"));
|
ioStorInvDis.setPcsn(ivt.getString("pcsn"));
|
||||||
ioStorInvDis.setMaterial_id(dtl.getMaterial_id());
|
ioStorInvDis.setMaterial_id(dtl.getMaterial_id());
|
||||||
|
ioStorInvDis.setMaterial_code(dtl.getMaterial_code());
|
||||||
ioStorInvDis.setSect_name(ivt.getString("sect_name"));
|
ioStorInvDis.setSect_name(ivt.getString("sect_name"));
|
||||||
ioStorInvDis.setSect_code(ivt.getString("sect_code"));
|
ioStorInvDis.setSect_code(ivt.getString("sect_code"));
|
||||||
ioStorInvDis.setStruct_id(ivt.getString("struct_id"));
|
ioStorInvDis.setStruct_id(ivt.getString("struct_id"));
|
||||||
@@ -779,18 +777,6 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
|||||||
ioStorInvDis.setQty_unit_id(dtl.getQty_unit_id());
|
ioStorInvDis.setQty_unit_id(dtl.getQty_unit_id());
|
||||||
ioStorInvDis.setQty_unit_name(dtl.getQty_unit_name());
|
ioStorInvDis.setQty_unit_name(dtl.getQty_unit_name());
|
||||||
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("未生成"));
|
||||||
|
|
||||||
// 未分配数量 - 该库位上的可用数量 < 0 目前做整出
|
|
||||||
// double canuse_qty = outAllocation.getCanuse_qty().doubleValue();
|
|
||||||
// if (unassign_qty-canuse_qty>=0){
|
|
||||||
// ioStorInvDis.setPlan_qty(BigDecimal.valueOf(canuse_qty));
|
|
||||||
// }else {
|
|
||||||
// ioStorInvDis.setPlan_qty(BigDecimal.valueOf(unassign_qty));
|
|
||||||
// }
|
|
||||||
// unassign_qty = unassign_qty-canuse_qty;
|
|
||||||
// if (unassign_qty<0){
|
|
||||||
// unassign_qty=0;
|
|
||||||
// }
|
|
||||||
if (unassign_qty <= 0){
|
if (unassign_qty <= 0){
|
||||||
throw new BadRequestException("已全部分配完,未分配数量为0");
|
throw new BadRequestException("已全部分配完,未分配数量为0");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,20 +219,16 @@ public class UpdateIvtUtils {
|
|||||||
new QueryWrapper<GroupPlate>().lambda()
|
new QueryWrapper<GroupPlate>().lambda()
|
||||||
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
|
||||||
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
|
.eq(GroupPlate::getMaterial_id, where.getString("material_id"))
|
||||||
.eq(GroupPlate::getPcsn, where.getString("pcsn")).eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
|
||||||
|
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||||
);
|
);
|
||||||
if (ObjectUtil.isEmpty(extDao)) {
|
if (ObjectUtil.isEmpty(extDao)) {
|
||||||
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
|
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
|
||||||
}
|
}
|
||||||
// 减冻结
|
|
||||||
double qty = NumberUtil.sub(extDao.getQty(), extDao.getFrozen_qty()).doubleValue();
|
|
||||||
if (qty < 0) {
|
|
||||||
throw new BadRequestException("冻结数不能为负数,请检查变动数量!当前冻结数为【" + extDao.getFrozen_qty() + "】当前变动数为【" + where.getDoubleValue("change_qty") + "】");
|
|
||||||
}
|
|
||||||
// 加可用
|
// 加可用
|
||||||
// double canuse_qty = NumberUtil.add(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();
|
BigDecimal addQty = extDao.getQty().add(where.getBigDecimal("change_qty"));
|
||||||
extDao.setFrozen_qty(BigDecimal.ZERO);
|
extDao.setFrozen_qty(BigDecimal.ZERO);
|
||||||
extDao.setQty(BigDecimal.valueOf(qty));
|
extDao.setQty(addQty);
|
||||||
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
extDao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||||
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
extDao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||||
extDao.setUpdate_time(DateUtil.now());
|
extDao.setUpdate_time(DateUtil.now());
|
||||||
|
|||||||
@@ -211,6 +211,7 @@
|
|||||||
<el-table-column prop="material_name" label="物料名称" width="170px" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
<el-table-column prop="material_name" label="物料名称" width="170px" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||||
<el-table-column prop="storagevehicle_code" label="载具号" width="150px" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
<el-table-column prop="storagevehicle_code" label="载具号" width="150px" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||||
<el-table-column prop="pcsn" label="批次号" width="150px" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
<el-table-column prop="pcsn" label="批次号" width="150px" :min-width="flexWidth('pcsn',crud.data,'批次号')" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="qty" label="物料总数" :formatter="crud.formatNum3" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库重量" :formatter="crud.formatNum3" align="center" width="120px" :min-width="flexWidth('plan_qty',crud.data,'出库重量')">
|
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库重量" :formatter="crud.formatNum3" align="center" width="120px" :min-width="flexWidth('plan_qty',crud.data,'出库重量')">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<el-input-number v-show="mstrow.bill_type === '1011'" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 90px" />
|
<el-input-number v-show="mstrow.bill_type === '1011'" v-model="scope.row.plan_qty" :precision="3" :controls="false" :min="1" style="width: 90px" />
|
||||||
|
|||||||
@@ -93,7 +93,11 @@
|
|||||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘编码" align="center" width="250px" />
|
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘编码" align="center" width="250px" />
|
||||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||||
<el-table-column show-overflow-tooltip sortable prop="pcsn" label="批次号" align="center" width="150px" />
|
<el-table-column show-overflow-tooltip sortable prop="pcsn" label="批次号" align="center" width="150px" />
|
||||||
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
|
<el-table-column show-overflow-tooltip prop="qty" label="可出重量" :formatter="crud.formatNum3" align="center" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.qty" clearable style="width: 120px"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||||
@@ -200,15 +204,15 @@ export default {
|
|||||||
}
|
}
|
||||||
row.edit = !row.edit
|
row.edit = !row.edit
|
||||||
if (row.edit) {
|
if (row.edit) {
|
||||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty)
|
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.qty)
|
||||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty)
|
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.qty)
|
||||||
} else {
|
} else {
|
||||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
|
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.qty)
|
||||||
// 如果待分配重量等于0则 明细重量 - 已分配重量
|
// 如果待分配重量等于0则 明细重量 - 已分配重量
|
||||||
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
||||||
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
||||||
} else {
|
} else {
|
||||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
|
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.qty)
|
||||||
}
|
}
|
||||||
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
|
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
|
||||||
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
|
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
|
||||||
|
|||||||
Reference in New Issue
Block a user