rev:原材料出入库修改
This commit is contained in:
@@ -16,6 +16,8 @@ import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.pcs_manage.service.purchase.IPcsIfPurchaseorderService;
|
||||
@@ -74,6 +76,9 @@ public class StIvtIostorinvOutYlServiceImpl extends ServiceImpl<StIvtIostorinvYl
|
||||
@Autowired
|
||||
private IPcsIfPurchaseorderService purchaseorderService;
|
||||
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService materialbaseService;
|
||||
|
||||
|
||||
@Override
|
||||
public Object pageQuery(YlIostorInvQuery query, PageQuery pageQuery) {
|
||||
@@ -149,7 +154,38 @@ public class StIvtIostorinvOutYlServiceImpl extends ServiceImpl<StIvtIostorinvYl
|
||||
throw new BadRequestException("单据不存在");
|
||||
}
|
||||
|
||||
dtl_list.forEach(dtl -> {
|
||||
double need_qty = dtl.getPlan_qty().doubleValue();
|
||||
|
||||
List<StIvtStructivtYl> list = structivtYlService.list(new QueryWrapper<StIvtStructivtYl>()
|
||||
.eq("material_id", dtl.getMaterial_id())
|
||||
.eq("stor_id", mst.getStor_id())
|
||||
.eq("workshop_id", mst.getWorkshop_id()));
|
||||
|
||||
MdMeMaterialbase mater = materialbaseService.getOne(new QueryWrapper<MdMeMaterialbase>().eq("material_id", dtl.getMaterial_id()));
|
||||
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
throw new BadRequestException("当前仓库内不存在物料:" + mater.getMaterial_name());
|
||||
}
|
||||
|
||||
for (StIvtStructivtYl ivt : list) {
|
||||
//判断是否需要继续分配库存,不大于0时跳出循环
|
||||
if (need_qty > 0){
|
||||
double canuse_qty = ivt.getCanuse_qty().doubleValue();
|
||||
if (canuse_qty >= need_qty){
|
||||
//插入分配表
|
||||
|
||||
|
||||
//维护库存
|
||||
}
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (need_qty > 0){
|
||||
throw new BadRequestException("物料:"+mater.getMaterial_name()+"库存不足,缺少:"+need_qty+"KG");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.storage_manage.rawmanage.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -74,7 +75,6 @@ public class StIvtIostorinvYlServiceImpl extends ServiceImpl<StIvtIostorinvYlMap
|
||||
@Autowired
|
||||
private IPcsIfPurchaseorderService purchaseorderService;
|
||||
|
||||
|
||||
@Override
|
||||
public Object pageQuery(YlIostorInvQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
@@ -156,7 +156,36 @@ public class StIvtIostorinvYlServiceImpl extends ServiceImpl<StIvtIostorinvYlMap
|
||||
dis.setWork_status(IOSEnum.WORK_STATUS.code("完成"));
|
||||
iostorinvdisYlService.updateById(dis);
|
||||
|
||||
//修改库存和插入库存变动记录表
|
||||
//修改库存
|
||||
|
||||
//判断该货位和物料上是否存在
|
||||
StIvtStructivtYl structivtYl = structivtYlService.getOne(new QueryWrapper<StIvtStructivtYl>().eq("struct_code", dis.getSect_code()).eq("material_id", dis.getMaterial_id()));
|
||||
if (ObjectUtil.isNotEmpty(structivtYl)) {
|
||||
structivtYl.setCanuse_qty(NumberUtil.add(structivtYl.getCanuse_qty(), dis.getPlan_qty()));
|
||||
structivtYl.setIvt_qty(structivtYl.getCanuse_qty());
|
||||
structivtYlService.updateById(structivtYl);
|
||||
} else {
|
||||
structivtYlService.save(StIvtStructivtYl.builder()
|
||||
.stockrecord_id(IdUtil.getStringId())
|
||||
.struct_id(dis.getStruct_id())
|
||||
.struct_code(dis.getStruct_code())
|
||||
.struct_name(dis.getStruct_name())
|
||||
.material_id(dis.getMaterial_id())
|
||||
.quality_scode(dis.getQuality_scode())
|
||||
.pcsn(dis.getPcsn())
|
||||
.ivt_level(dis.getIvt_level())
|
||||
.is_active(dis.getIs_active())
|
||||
.canuse_qty(dis.getReal_qty())
|
||||
.ivt_qty(dis.getReal_qty())
|
||||
.qty_unit_id(dis.getQty_unit_id())
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.workshop_id(mst.getWorkshop_id())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
/*//插入库存变动记录表
|
||||
structivtflowService.recordStructivtFlow(
|
||||
StIvtStructivtflowDto.builder()
|
||||
.bill_code(mst.getBill_code()).change_type_scode(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_CONFIRM).bill_table("st_ivt_iostorinv_bcp")
|
||||
@@ -165,7 +194,7 @@ public class StIvtIostorinvYlServiceImpl extends ServiceImpl<StIvtIostorinvYlMap
|
||||
.task_id(dis.getTask_id())
|
||||
.storagevehicle_code(dis.getStoragevehicle_code())
|
||||
.build()
|
||||
);
|
||||
);*/
|
||||
});
|
||||
|
||||
//修改明细状态
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package org.nl.wms.storage_manage.rawmanage.service.structIvt.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -18,6 +23,7 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_structivt_yl")
|
||||
@Builder
|
||||
public class StIvtStructivtYl implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -25,6 +31,7 @@ public class StIvtStructivtYl implements Serializable {
|
||||
/**
|
||||
* 库存记录标识
|
||||
*/
|
||||
@TableId(value = "stockrecord_id")
|
||||
private String stockrecord_id;
|
||||
|
||||
/**
|
||||
@@ -95,7 +102,7 @@ public class StIvtStructivtYl implements Serializable {
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private Date instorage_time;
|
||||
private String instorage_time;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
@@ -105,7 +112,7 @@ public class StIvtStructivtYl implements Serializable {
|
||||
/**
|
||||
* 车间标识
|
||||
*/
|
||||
private String product_area;
|
||||
private String workshop_id;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -568,8 +568,7 @@ export default {
|
||||
}
|
||||
orderExt.getExtList(this.currentRow).then(res => {
|
||||
debugger
|
||||
const item = res[0]
|
||||
// res.forEach((item) => {
|
||||
res.forEach((item) => {
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
@@ -582,10 +581,10 @@ export default {
|
||||
LODOP.ADD_PRINT_TEXT('42mm', '25mm', '40mm', '20mm', item.bar_code.substring(9, 16))
|
||||
console.log(item.barcode)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
|
||||
// LODOP.PRINT()// 打印
|
||||
LODOP.PRINT()// 打印
|
||||
// LODOP.PREVIEW()
|
||||
})
|
||||
// })
|
||||
})
|
||||
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
},
|
||||
|
||||
@@ -216,7 +216,7 @@ import AddDialog from '@/views/wms/storage_manage/rawproduct/rawProductIn/AddDia
|
||||
import DivDialog from '@/views/wms/storage_manage/rawproduct/rawProductIn/DivDialog'
|
||||
import ViewDialog from '@/views/wms/storage_manage/rawproduct/rawProductIn/ViewDialog'
|
||||
import {mapGetters} from 'vuex'
|
||||
import crudStorattr from "@/api/wms/basedata/st/storattr";
|
||||
import crudStorattr from "@/views/wms/storage_manage/basedata/basedata";
|
||||
|
||||
export default {
|
||||
name: 'RawProductIn',
|
||||
@@ -262,7 +262,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.queryStor({"stor_type": "3"}).then(res => {
|
||||
crudStorattr.getStor({"stor_type": "3"}).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
|
||||
@@ -223,10 +223,10 @@
|
||||
import CRUD, {crud, form} from '@crud/crud'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import BillDtl from '@/views/wms/storage_manage/rawproduct/rawProductIn/AddDtl'
|
||||
import crudStorattr from "@/api/wms/basedata/st/storattr";
|
||||
import crudProductOut from '@/views/wms/storage_manage/rawproduct/rawProductOut/rawproductout'
|
||||
import crudStructattr from "@/api/wms/basedata/st/structattr";
|
||||
import StructIvt from "@/views/wms/storage_manage/rawproduct/rawProductOut/StructIvt";
|
||||
import crudStorattr from "@/views/wms/storage_manage/basedata/basedata";
|
||||
|
||||
const defaultForm = {
|
||||
bill_code: '',
|
||||
@@ -293,7 +293,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudStorattr.queryStor({"stor_type": "3"}).then(res => {
|
||||
crudStorattr.getStor({"stor_type": "3"}).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
|
||||
@@ -216,7 +216,7 @@ import AddDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/AddDi
|
||||
import DivDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/DivDialog'
|
||||
import ViewDialog from '@/views/wms/storage_manage/rawproduct/rawProductOut/ViewDialog'
|
||||
import {mapGetters} from 'vuex'
|
||||
import crudStorattr from "@/api/wms/basedata/st/storattr";
|
||||
import crudStorattr from "@/views/wms/storage_manage/basedata/basedata";
|
||||
|
||||
export default {
|
||||
name: 'RawProductOut',
|
||||
@@ -262,7 +262,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.queryStor({"stor_type": "3"}).then(res => {
|
||||
crudStorattr.getStor({"stor_type": "3"}).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user