优化库存批次台账

This commit is contained in:
Stang 2024-11-22 08:43:34 +08:00
parent ff2924591b
commit 816085fedc
3 changed files with 32 additions and 17 deletions

View File

@ -192,14 +192,9 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
entityQuery.setPlanDetailsId(inTask.getDetailInId());
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(entityQuery);
wmsInPlanDetailEntityList.forEach(inPlanDetailEntity -> {
// 根据出库实例对象获取出库计划明细
WmsInPlanDetails wmsInPlanDetails = this.wmsInPlanMapper.selectWmsInPlanDetailById(inPlanDetailEntity.getPlanDetailsId());
// 根据计划明细获得出库计划
WmsInPlan wmsInPlan = this.wmsInPlanMapper.selectWmsInPlanByPlanId(wmsInPlanDetails.getPlanId().toString());
// 根据出库计划获得出库类型
WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsInPlan.getBusinessTypeId());
WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(inTask.getPlanTypeId());
// 获得物料
MdItem mdItem = this.mdItemMapper.selectMdItemById(Long.parseLong(inTask.getMaterialId()));
@ -213,25 +208,25 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
hashMap.put("mdItemUnit", mdItem.getUnitName()); // 物料单位
hashMap.put("mdItemKnifeWarn", mdItem.getAttr2()); // 物料名称
/* 来自出入库计划类型 */
hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 库类型ID
hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 库类型编码
hashMap.put("planTypeName", wmsBusinessType.getName()); // 库类型名称
hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 库类型ID
hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 库类型编码
hashMap.put("planTypeName", wmsBusinessType.getName()); // 库类型名称
/* 来自计划明细 */
hashMap.put("detailBatchNum", wmsInPlanDetails.getBatch()); // 明细批次
hashMap.put("wmStorageAreaId", wmsInPlanDetails.getCellId()); // 库位ID
hashMap.put("detailBatchNum", inTask.getBatch()); // 明细批次
hashMap.put("wmStorageAreaId", inTask.getCellTgt()); // 库位ID
hashMap.put("wmStorageAreaName", inTask.getCellName()); // 库位名称
hashMap.put("detailStatus", wmsInPlanDetails.getPlanInStatus()); // 明细状态
hashMap.put("detailStatus", inTask.getPlanInStatus()); // 明细状态
// 查询库区信息
WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaId(wmsInPlanDetails.getCellId());
WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaId(inTask.getCellTgt());
WmStorageLocation wmStorageLocation = wmStorageLocationMapper.selectWmStorageLocationByLocationId(wmStorageArea.getLocationId());
// 查询库房信息
WmWarehouse wmWarehouse = wmWarehouseMapper.selectWmWarehouseByWarehouseId(wmStorageLocation.getWarehouseId());
hashMap.put("wmWarehouseName", wmWarehouse.getWarehouseName()); // 库位名称
/* 实体 */
String outTime = null;
if (wmsInPlanDetails.getCreateTime() != null)
outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(wmsInPlanDetails.getCreateTime());
if (inPlanDetailEntity.getCreateTime() != null)
outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(inPlanDetailEntity.getCreateTime());
hashMap.put("dateTime", outTime); // 出库时间
hashMap.put("baseKnifeId", inPlanDetailEntity.getKnifeId());
hashMap.put("planCode", inTask.getPlanInCode());
@ -240,6 +235,7 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
hashMapList.add(hashMap);
});
inventoryBatchIn.setInfoList(hashMapList);
result.add(inventoryBatchIn);
});

View File

@ -441,6 +441,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
wmsInTask.setMaterialId(zdTask.getmProductId().toString());
wmsInTask.setPlanTypeId("9");
wmsInTask.setPlanInStatus("1");
wmsInTask.setDetailInId(wmsInPlan.getWmsInPlanDetailsList().get(0).getDetailsId());
wmsInTask.setCreateBy(getUsername());
wmsInTask.setCreateTime(DateUtils.getNowDate());
wmsInTaskMapper.insertWmsInTask(wmsInTask);

View File

@ -58,6 +58,24 @@
<result property="isDelete" column="sub_IS_DELETE"/>
</resultMap>
<resultMap type="WmsInPlanDetails" id="BizWmsInPlanDetailsResult">
<result property="detailsId" column="sub_DETAILS_ID"/>
<result property="planId" column="sub_PLAN_ID"/>
<result property="materialId" column="sub_MATERIAL_ID"/>
<result property="batch" column="sub_BATCH"/>
<result property="cellId" column="sub_CELL_ID"/>
<result property="quantity" column="sub_QUANTITY"/>
<result property="quantityIn" column="sub_QUANTITY_IN"/>
<result property="planInStatus" column="sub_PLAN_IN_STATUS"/>
<result property="remark" column="sub_REMARK"/>
<result property="createBy" column="sub_CREATE_BY"/>
<result property="createTime" column="sub_CREATE_TIME"/>
<result property="updateBy" column="sub_UPDATE_BY"/>
<result property="updateTime" column="sub_UPDATE_TIME"/>
<result property="isActivy" column="sub_IS_ACTIVY"/>
<result property="isDelete" column="sub_IS_DELETE"/>
</resultMap>
<sql id="selectWmsInPlanVo">
select PLAN_ID,
STATE,
@ -362,9 +380,9 @@
WHERE PLAN_CODE = #{value}
</select>
<select id="selectWmsInPlanDetailById" resultMap="WmsInPlanDetailsResult">
<select id="selectWmsInPlanDetailById" resultMap="BizWmsInPlanDetailsResult">
SELECT *
FROM WMS_IN_PLAN_DETAILS
WHERE DETAILS_ID = #{wmsInPlanDetailId};
WHERE DETAILS_ID = #{planDetailsId}
</select>
</mapper>