WMS:
PDA接口——盘库逻辑修改
master
xs 2 months ago
parent 34ecfd7eb6
commit ace15a130a

@ -33,9 +33,11 @@ public class WmsInventoryCheckDetail extends BaseEntity
@Excel(name = "库位编码") @Excel(name = "库位编码")
private String locationCode; private String locationCode;
/** 物料批次号 */ /**物料条码*/
@Excel(name = "物料批次号") private String materialBarcode;
private String materialBatch;
/** 库存类型(1原材料2半成品3成品) */ /** 库存类型(1原材料2半成品3成品) */
@Excel(name = "库存类型(1原材料2半成品3成品)") @Excel(name = "库存类型(1原材料2半成品3成品)")
@ -83,6 +85,15 @@ public class WmsInventoryCheckDetail extends BaseEntity
private String materialName; private String materialName;
private String materialSpec;
private String poNo;
private String saleorderCode;
private String materialBatch;
/** 盘点状态(0待盘点,1盘点中,2盘点完成); 多个以,隔开 */ /** 盘点状态(0待盘点,1盘点中,2盘点完成); 多个以,隔开 */
private String checkStatusStr; private String checkStatusStr;
@ -122,15 +133,15 @@ public class WmsInventoryCheckDetail extends BaseEntity
{ {
return locationCode; return locationCode;
} }
public void setMaterialBatch(String materialBatch)
{ public String getMaterialBarcode() {
this.materialBatch = materialBatch; return materialBarcode;
} }
public String getMaterialBatch() public void setMaterialBarcode(String materialBarcode) {
{ this.materialBarcode = materialBarcode;
return materialBatch;
} }
public void setStockType(String stockType) public void setStockType(String stockType)
{ {
this.stockType = stockType; this.stockType = stockType;
@ -239,6 +250,38 @@ public class WmsInventoryCheckDetail extends BaseEntity
this.materialName = materialName; this.materialName = materialName;
} }
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public String getPoNo() {
return poNo;
}
public void setPoNo(String poNo) {
this.poNo = poNo;
}
public String getSaleorderCode() {
return saleorderCode;
}
public void setSaleorderCode(String saleorderCode) {
this.saleorderCode = saleorderCode;
}
public String getMaterialBatch() {
return materialBatch;
}
public void setMaterialBatch(String materialBatch) {
this.materialBatch = materialBatch;
}
public String getCheckStatusStr() { public String getCheckStatusStr() {
return checkStatusStr; return checkStatusStr;
} }

@ -149,15 +149,17 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectWmsRawStockInList(queryRawStock); List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectWmsRawStockInList(queryRawStock);
if (wmsRawStocks != null && !wmsRawStocks.isEmpty()) { if (wmsRawStocks != null && !wmsRawStocks.isEmpty()) {
//需要根据materialid过滤聚合盘点是盘点某个物料不能按物料条码进行盘点 //需要根据materialid过滤聚合盘点是盘点某个物料不能按物料条码进行盘点
Map<Long, List<WmsRawStock>> wmsRawStockMap = wmsRawStocks.stream() // Map<Long, List<WmsRawStock>> wmsRawStockMap = wmsRawStocks.stream()
.collect(Collectors.groupingBy(WmsRawStock::getMaterialId)); // .collect(Collectors.groupingBy(WmsRawStock::getMaterialId));
for (Long materialId : wmsRawStockMap.keySet()) {
for (WmsRawStock wmsRawStock : wmsRawStocks) {
WmsInventoryCheckDetail wmsInventoryCheckDetail = new WmsInventoryCheckDetail(); WmsInventoryCheckDetail wmsInventoryCheckDetail = new WmsInventoryCheckDetail();
wmsInventoryCheckDetail.setMaterialId(materialId); wmsInventoryCheckDetail.setMaterialId(wmsRawStock.getMaterialId());
wmsInventoryCheckDetail.setMaterialBarcode(wmsRawStock.getInstockBatch());
wmsInventoryCheckDetail.setInventoryTime(0L); wmsInventoryCheckDetail.setInventoryTime(0L);
wmsInventoryCheckDetail.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW); wmsInventoryCheckDetail.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW);
// wmsInventoryCheckDetail.setStockId(wmsRawStock.getRawStockId()); wmsInventoryCheckDetail.setStockId(wmsRawStock.getRawStockId());
wmsInventoryCheckDetail.setLocationCode(locationCode); wmsInventoryCheckDetail.setLocationCode(locationCode);
wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_INVENTORYING); wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_INVENTORYING);
wmsInventoryCheckDetail.setCreateDate(currentDate); wmsInventoryCheckDetail.setCreateDate(currentDate);
@ -183,16 +185,16 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService {
List<WmsProductStock> wmsProductStocks = wmsProductStockMapper.selectWmsProductStockInList(queryProductStock); List<WmsProductStock> wmsProductStocks = wmsProductStockMapper.selectWmsProductStockInList(queryProductStock);
if (wmsProductStocks != null && !wmsProductStocks.isEmpty()) { if (wmsProductStocks != null && !wmsProductStocks.isEmpty()) {
//需要根据materialid过滤聚合盘点是盘点某个物料不能按物料条码进行盘点 //需要根据materialid过滤聚合盘点是盘点某个物料不能按物料条码进行盘点
Map<Long, List<WmsProductStock>> wmsProductStockMap = wmsProductStocks.stream() // Map<Long, List<WmsProductStock>> wmsProductStockMap = wmsProductStocks.stream()
.collect(Collectors.groupingBy(WmsProductStock::getProductId)); // .collect(Collectors.groupingBy(WmsProductStock::getProductId));
for (Long productId : wmsProductStockMap.keySet()) { for (WmsProductStock wmsProductStock : wmsProductStocks) {
List<WmsProductStock> wmsProductStockList = wmsProductStockMap.get(productId); // List<WmsProductStock> wmsProductStockList = wmsProductStockMap.get(productId);
WmsProductStock wmsProductStock = wmsProductStockList.get(0); // WmsProductStock wmsProductStock = wmsProductStockList.get(0);
WmsInventoryCheckDetail wmsInventoryCheckDetail = new WmsInventoryCheckDetail(); WmsInventoryCheckDetail wmsInventoryCheckDetail = new WmsInventoryCheckDetail();
wmsInventoryCheckDetail.setMaterialId(productId); wmsInventoryCheckDetail.setMaterialId(wmsProductStock.getProductId());
// wmsInventoryCheckDetail.setMaterialBatch(wmsProductStock.getProductBatch()); wmsInventoryCheckDetail.setMaterialBarcode(wmsProductStock.getProductBatch());
wmsInventoryCheckDetail.setStockType(wmsProductStock.getStockType()); wmsInventoryCheckDetail.setStockType(wmsProductStock.getStockType());
// wmsInventoryCheckDetail.setStockId(wmsProductStock.getProductStockId()); wmsInventoryCheckDetail.setStockId(wmsProductStock.getProductStockId());
wmsInventoryCheckDetail.setInventoryTime(0L); wmsInventoryCheckDetail.setInventoryTime(0L);
wmsInventoryCheckDetail.setLocationCode(locationCode); wmsInventoryCheckDetail.setLocationCode(locationCode);
wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_INVENTORYING); wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_INVENTORYING);

@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inventoryCheckId" column="inventory_check_id" /> <result property="inventoryCheckId" column="inventory_check_id" />
<result property="materialId" column="material_id" /> <result property="materialId" column="material_id" />
<result property="locationCode" column="location_code" /> <result property="locationCode" column="location_code" />
<result property="materialBatch" column="material_batch" /> <result property="materialBarcode" column="material_barcode" />
<result property="stockType" column="stock_type" /> <result property="stockType" column="stock_type" />
<result property="stockId" column="stock_id" /> <result property="stockId" column="stock_id" />
<result property="stockAmount" column="stock_amount" /> <result property="stockAmount" column="stock_amount" />
@ -26,10 +26,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="materialSpec" column="material_spec" />
<result property="poNo" column="po_no" />
<result property="saleorderCode" column="saleorder_code" />
<result property="materialBatch" column="material_batch" />
</resultMap> </resultMap>
<sql id="selectWmsInventoryCheckDetailVo"> <sql id="selectWmsInventoryCheckDetailVo">
select inventory_check_detail_id, inventory_check_id, material_id, location_code, material_batch, stock_type, stock_id, stock_amount, real_amount, check_status, inventory_time, erp_status, erp_amount, remark, create_by, create_date, update_by, update_date from wms_inventory_check_detail select inventory_check_detail_id, inventory_check_id, material_id, location_code, material_barcode, stock_type, stock_id, stock_amount, real_amount, check_status, inventory_time, erp_status, erp_amount, remark, create_by, create_date, update_by, update_date from wms_inventory_check_detail
</sql> </sql>
<select id="selectWmsInventoryCheckDetailList" parameterType="WmsInventoryCheckDetail" resultMap="WmsInventoryCheckDetailResult"> <select id="selectWmsInventoryCheckDetailList" parameterType="WmsInventoryCheckDetail" resultMap="WmsInventoryCheckDetailResult">
@ -38,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryCheckId != null "> and inventory_check_id = #{inventoryCheckId}</if> <if test="inventoryCheckId != null "> and inventory_check_id = #{inventoryCheckId}</if>
<if test="materialId != null "> and material_id = #{materialId}</if> <if test="materialId != null "> and material_id = #{materialId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if> <if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="materialBatch != null and materialBatch != ''"> and material_batch = #{materialBatch}</if> <if test="materialBarcode != null and materialBarcode != ''"> and material_barcode = #{materialBarcode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if> <if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="stockAmount != null "> and stock_amount = #{stockAmount}</if> <if test="stockAmount != null "> and stock_amount = #{stockAmount}</if>
<if test="realAmount != null "> and real_amount = #{realAmount}</if> <if test="realAmount != null "> and real_amount = #{realAmount}</if>
@ -61,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryCheckId != null">inventory_check_id,</if> <if test="inventoryCheckId != null">inventory_check_id,</if>
<if test="materialId != null">material_id,</if> <if test="materialId != null">material_id,</if>
<if test="locationCode != null and locationCode != ''">location_code,</if> <if test="locationCode != null and locationCode != ''">location_code,</if>
<if test="materialBatch != null and materialBatch != ''">material_batch,</if> <if test="materialBarcode != null and materialBarcode != ''">material_barcode,</if>
<if test="stockType != null">stock_type,</if> <if test="stockType != null">stock_type,</if>
<if test="stockId != null">stock_id,</if> <if test="stockId != null">stock_id,</if>
<if test="stockAmount != null">stock_amount,</if> <if test="stockAmount != null">stock_amount,</if>
@ -80,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryCheckId != null">#{inventoryCheckId},</if> <if test="inventoryCheckId != null">#{inventoryCheckId},</if>
<if test="materialId != null">#{materialId},</if> <if test="materialId != null">#{materialId},</if>
<if test="locationCode != null and locationCode != ''">#{locationCode},</if> <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
<if test="materialBatch != null and materialBatch != ''">#{materialBatch},</if> <if test="materialBarcode != null and materialBarcode != ''">#{materialBarcode},</if>
<if test="stockType != null">#{stockType},</if> <if test="stockType != null">#{stockType},</if>
<if test="stockId != null">#{stockId},</if> <if test="stockId != null">#{stockId},</if>
<if test="stockAmount != null">#{stockAmount},</if> <if test="stockAmount != null">#{stockAmount},</if>
@ -103,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryCheckId != null">inventory_check_id = #{inventoryCheckId},</if> <if test="inventoryCheckId != null">inventory_check_id = #{inventoryCheckId},</if>
<if test="materialId != null">material_id = #{materialId},</if> <if test="materialId != null">material_id = #{materialId},</if>
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if> <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="materialBatch != null and materialBatch != ''">material_batch = #{materialBatch},</if> <if test="materialBarcode != null and materialBarcode != ''">material_barcode = #{materialBarcode},</if>
<if test="stockType != null">stock_type = #{stockType},</if> <if test="stockType != null">stock_type = #{stockType},</if>
<if test="stockId != null">stock_id = #{stockId},</if> <if test="stockId != null">stock_id = #{stockId},</if>
<if test="stockAmount != null">stock_amount = #{stockAmount},</if> <if test="stockAmount != null">stock_amount = #{stockAmount},</if>
@ -145,10 +149,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectWmsInventoryCheckDetailJoinVo"> <sql id="selectWmsInventoryCheckDetailJoinVo">
select wicd.inventory_check_detail_id, wicd.inventory_check_id, wicd.material_id, wicd.material_batch, select wicd.inventory_check_detail_id, wicd.inventory_check_id, wicd.material_id, wicd.material_barcode,
wicd.stock_type, wicd.stock_id, wicd.stock_amount, wicd.real_amount, wicd.check_status, wicd.inventory_time, wicd.location_code, wicd.stock_type, wicd.stock_id, wicd.stock_amount, wicd.real_amount, wicd.check_status, wicd.inventory_time, wicd.location_code,
mbmi.material_code,mbmi.material_name mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbbi.po_no,mbbi.saleorder_code,mbbi.batch_code as material_batch
from wms_inventory_check_detail wicd left join mes_base_material_info mbmi on wicd.material_id = mbmi.material_id from wms_inventory_check_detail wicd left join mes_base_material_info mbmi on wicd.material_id = mbmi.material_id
left join mes_base_barcode_info mbbi on wicd.material_barcode = mbbi.barcode_info
</sql> </sql>
<select id="selectWmsInventoryCheckDetailJoinList" parameterType="WmsInventoryCheckDetail" resultMap="WmsInventoryCheckDetailResult"> <select id="selectWmsInventoryCheckDetailJoinList" parameterType="WmsInventoryCheckDetail" resultMap="WmsInventoryCheckDetailResult">
@ -157,7 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inventoryCheckId != null "> and wicd.inventory_check_id = #{inventoryCheckId}</if> <if test="inventoryCheckId != null "> and wicd.inventory_check_id = #{inventoryCheckId}</if>
<if test="materialId != null "> and wicd.material_id = #{materialId}</if> <if test="materialId != null "> and wicd.material_id = #{materialId}</if>
<if test="locationCode != null and locationCode != ''"> and wicd.location_code = #{locationCode}</if> <if test="locationCode != null and locationCode != ''"> and wicd.location_code = #{locationCode}</if>
<if test="materialBatch != null and materialBatch != ''"> and wicd.material_batch = #{materialBatch}</if> <if test="materialBarcode != null and materialBarcode != ''"> and wicd.material_barcode = #{materialBarcode}</if>
<if test="stockType != null and stockType != ''"> and wicd.stock_type = #{stockType}</if> <if test="stockType != null and stockType != ''"> and wicd.stock_type = #{stockType}</if>
<if test="checkStatus != null and checkStatus != ''"> and wicd.check_status = #{checkStatus}</if> <if test="checkStatus != null and checkStatus != ''"> and wicd.check_status = #{checkStatus}</if>
<if test="checkStatusStr != null and checkStatusStr!= ''"> and wicd.check_status in (${checkStatusStr})</if> <if test="checkStatusStr != null and checkStatusStr!= ''"> and wicd.check_status in (${checkStatusStr})</if>

@ -32,7 +32,7 @@
<result property="inventoryCheckId" column="sub_inventory_check_id" /> <result property="inventoryCheckId" column="sub_inventory_check_id" />
<result property="materialId" column="sub_material_id" /> <result property="materialId" column="sub_material_id" />
<result property="locationCode" column="sub_location_code" /> <result property="locationCode" column="sub_location_code" />
<result property="materialBatch" column="sub_material_batch" /> <result property="materialBarcode" column="sub_material_barcode" />
<result property="stockType" column="sub_stock_type" /> <result property="stockType" column="sub_stock_type" />
<result property="stockId" column="sub_stock_id" /> <result property="stockId" column="sub_stock_id" />
<result property="stockAmount" column="sub_stock_amount" /> <result property="stockAmount" column="sub_stock_amount" />
@ -70,7 +70,7 @@
<select id="selectWmsInventoryCheckByInventoryCheckId" parameterType="Long" resultMap="WmsInventoryCheckWmsInventoryCheckDetailResult"> <select id="selectWmsInventoryCheckByInventoryCheckId" parameterType="Long" resultMap="WmsInventoryCheckWmsInventoryCheckDetailResult">
select a.inventory_check_id, a.inventory_check_code, a.warehouse_id, a.check_status, a.begin_time, a.end_time, a.location_amount, a.inventorying_amount, a.inventoried_amount, a.remark, a.create_by, a.create_date, a.update_by, a.update_date, select a.inventory_check_id, a.inventory_check_code, a.warehouse_id, a.check_status, a.begin_time, a.end_time, a.location_amount, a.inventorying_amount, a.inventoried_amount, a.remark, a.create_by, a.create_date, a.update_by, a.update_date,
b.inventory_check_detail_id as sub_inventory_check_detail_id, b.inventory_check_id as sub_inventory_check_id, b.material_id as sub_material_id, b.location_code as sub_location_code, b.material_batch as sub_material_batch, b.stock_type as sub_stock_type, b.stock_id as sub_stock_id, b.stock_amount as sub_stock_amount, b.real_amount as sub_real_amount, b.check_status as sub_check_status, b.inventory_time as sub_inventory_time, b.erp_status as sub_erp_status, b.erp_amount as sub_erp_amount, b.remark as sub_remark, b.create_by as sub_create_by, b.create_date as sub_create_date, b.update_by as sub_update_by, b.update_date as sub_update_date, b.inventory_check_detail_id as sub_inventory_check_detail_id, b.inventory_check_id as sub_inventory_check_id, b.material_id as sub_material_id, b.location_code as sub_location_code, b.material_barcode as sub_material_barcode, b.stock_type as sub_stock_type, b.stock_id as sub_stock_id, b.stock_amount as sub_stock_amount, b.real_amount as sub_real_amount, b.check_status as sub_check_status, b.inventory_time as sub_inventory_time, b.erp_status as sub_erp_status, b.erp_amount as sub_erp_amount, b.remark as sub_remark, b.create_by as sub_create_by, b.create_date as sub_create_date, b.update_by as sub_update_by, b.update_date as sub_update_date,
mbmi.material_code as sub_material_code,mbmi.material_name as sub_material_name mbmi.material_code as sub_material_code,mbmi.material_name as sub_material_name
from wms_inventory_check a from wms_inventory_check a
left join wms_inventory_check_detail b on b.inventory_check_id = a.inventory_check_id left join wms_inventory_check_detail b on b.inventory_check_id = a.inventory_check_id
@ -155,9 +155,9 @@
</delete> </delete>
<insert id="batchWmsInventoryCheckDetail"> <insert id="batchWmsInventoryCheckDetail">
insert into wms_inventory_check_detail( inventory_check_detail_id, inventory_check_id, material_id, location_code, material_batch, stock_type, stock_id, stock_amount, real_amount, check_status, inventory_time, erp_status, erp_amount, remark, create_by, create_date, update_by, update_date) values insert into wms_inventory_check_detail( inventory_check_detail_id, inventory_check_id, material_id, location_code, material_barcode, stock_type, stock_id, stock_amount, real_amount, check_status, inventory_time, erp_status, erp_amount, remark, create_by, create_date, update_by, update_date) values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( #{item.inventoryCheckDetailId}, #{item.inventoryCheckId}, #{item.materialId}, #{item.locationCode}, #{item.materialBatch}, #{item.stockType}, #{item.stockId}, #{item.stockAmount}, #{item.realAmount}, #{item.checkStatus}, #{item.inventoryTime}, #{item.erpStatus}, #{item.erpAmount}, #{item.remark}, #{item.createBy}, #{item.createDate}, #{item.updateBy}, #{item.updateDate}) ( #{item.inventoryCheckDetailId}, #{item.inventoryCheckId}, #{item.materialId}, #{item.locationCode}, #{item.materialBarcode}, #{item.stockType}, #{item.stockId}, #{item.stockAmount}, #{item.realAmount}, #{item.checkStatus}, #{item.inventoryTime}, #{item.erpStatus}, #{item.erpAmount}, #{item.remark}, #{item.createBy}, #{item.createDate}, #{item.updateBy}, #{item.updateDate})
</foreach> </foreach>
</insert> </insert>

Loading…
Cancel
Save