优化库存批次台账
This commit is contained in:
parent
ff2924591b
commit
816085fedc
@ -192,14 +192,9 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
|
|||||||
entityQuery.setPlanDetailsId(inTask.getDetailInId());
|
entityQuery.setPlanDetailsId(inTask.getDetailInId());
|
||||||
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(entityQuery);
|
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(entityQuery);
|
||||||
wmsInPlanDetailEntityList.forEach(inPlanDetailEntity -> {
|
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()));
|
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("mdItemUnit", mdItem.getUnitName()); // 物料单位
|
||||||
hashMap.put("mdItemKnifeWarn", mdItem.getAttr2()); // 物料名称
|
hashMap.put("mdItemKnifeWarn", mdItem.getAttr2()); // 物料名称
|
||||||
/* 来自出入库计划类型 */
|
/* 来自出入库计划类型 */
|
||||||
hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 出库类型ID
|
hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 入库类型ID
|
||||||
hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 出库类型编码
|
hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 入库类型编码
|
||||||
hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称
|
hashMap.put("planTypeName", wmsBusinessType.getName()); // 入库类型名称
|
||||||
/* 来自计划明细 */
|
/* 来自计划明细 */
|
||||||
hashMap.put("detailBatchNum", wmsInPlanDetails.getBatch()); // 明细批次
|
hashMap.put("detailBatchNum", inTask.getBatch()); // 明细批次
|
||||||
hashMap.put("wmStorageAreaId", wmsInPlanDetails.getCellId()); // 库位ID
|
hashMap.put("wmStorageAreaId", inTask.getCellTgt()); // 库位ID
|
||||||
hashMap.put("wmStorageAreaName", inTask.getCellName()); // 库位名称
|
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());
|
WmStorageLocation wmStorageLocation = wmStorageLocationMapper.selectWmStorageLocationByLocationId(wmStorageArea.getLocationId());
|
||||||
// 查询库房信息
|
// 查询库房信息
|
||||||
WmWarehouse wmWarehouse = wmWarehouseMapper.selectWmWarehouseByWarehouseId(wmStorageLocation.getWarehouseId());
|
WmWarehouse wmWarehouse = wmWarehouseMapper.selectWmWarehouseByWarehouseId(wmStorageLocation.getWarehouseId());
|
||||||
hashMap.put("wmWarehouseName", wmWarehouse.getWarehouseName()); // 库位名称
|
hashMap.put("wmWarehouseName", wmWarehouse.getWarehouseName()); // 库位名称
|
||||||
/* 实体 */
|
/* 实体 */
|
||||||
String outTime = null;
|
String outTime = null;
|
||||||
if (wmsInPlanDetails.getCreateTime() != null)
|
if (inPlanDetailEntity.getCreateTime() != null)
|
||||||
outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(wmsInPlanDetails.getCreateTime());
|
outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(inPlanDetailEntity.getCreateTime());
|
||||||
hashMap.put("dateTime", outTime); // 出库时间
|
hashMap.put("dateTime", outTime); // 出库时间
|
||||||
hashMap.put("baseKnifeId", inPlanDetailEntity.getKnifeId());
|
hashMap.put("baseKnifeId", inPlanDetailEntity.getKnifeId());
|
||||||
hashMap.put("planCode", inTask.getPlanInCode());
|
hashMap.put("planCode", inTask.getPlanInCode());
|
||||||
@ -240,6 +235,7 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
|
|||||||
hashMapList.add(hashMap);
|
hashMapList.add(hashMap);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
inventoryBatchIn.setInfoList(hashMapList);
|
||||||
result.add(inventoryBatchIn);
|
result.add(inventoryBatchIn);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -441,6 +441,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
|
|||||||
wmsInTask.setMaterialId(zdTask.getmProductId().toString());
|
wmsInTask.setMaterialId(zdTask.getmProductId().toString());
|
||||||
wmsInTask.setPlanTypeId("9");
|
wmsInTask.setPlanTypeId("9");
|
||||||
wmsInTask.setPlanInStatus("1");
|
wmsInTask.setPlanInStatus("1");
|
||||||
|
wmsInTask.setDetailInId(wmsInPlan.getWmsInPlanDetailsList().get(0).getDetailsId());
|
||||||
wmsInTask.setCreateBy(getUsername());
|
wmsInTask.setCreateBy(getUsername());
|
||||||
wmsInTask.setCreateTime(DateUtils.getNowDate());
|
wmsInTask.setCreateTime(DateUtils.getNowDate());
|
||||||
wmsInTaskMapper.insertWmsInTask(wmsInTask);
|
wmsInTaskMapper.insertWmsInTask(wmsInTask);
|
||||||
|
@ -58,6 +58,24 @@
|
|||||||
<result property="isDelete" column="sub_IS_DELETE"/>
|
<result property="isDelete" column="sub_IS_DELETE"/>
|
||||||
</resultMap>
|
</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">
|
<sql id="selectWmsInPlanVo">
|
||||||
select PLAN_ID,
|
select PLAN_ID,
|
||||||
STATE,
|
STATE,
|
||||||
@ -362,9 +380,9 @@
|
|||||||
WHERE PLAN_CODE = #{value}
|
WHERE PLAN_CODE = #{value}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectWmsInPlanDetailById" resultMap="WmsInPlanDetailsResult">
|
<select id="selectWmsInPlanDetailById" resultMap="BizWmsInPlanDetailsResult">
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM WMS_IN_PLAN_DETAILS
|
FROM WMS_IN_PLAN_DETAILS
|
||||||
WHERE DETAILS_ID = #{wmsInPlanDetailId};
|
WHERE DETAILS_ID = #{planDetailsId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue
Block a user