@ -37,6 +37,10 @@ import org.nl.wms.basedata.st.structattr.service.dao.mapper.StructattrMapper;
import org.nl.wms.pda.mps.eum.RegionTypeEnum ;
import org.nl.wms.st.inbill.service.StorPublicService ;
import org.nl.wms.st.instor.movestor.service.HandMoveStorService ;
import org.nl.wms.st.instor.movestor.service.dao.MoveStor ;
import org.nl.wms.st.instor.movestor.service.dao.MoveStorDtl ;
import org.nl.wms.st.instor.movestor.service.dao.mapper.MoveStorDtlMapper ;
import org.nl.wms.st.instor.movestor.service.dao.mapper.MoveStorMapper ;
import org.nl.wms.st.instor.task.HandMoveStorAcsTask ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.stereotype.Service ;
@ -71,6 +75,10 @@ public class OutBussManageServiceImpl implements OutBussManageService {
private StructattrMapper structattrMapper ;
@Autowired
private StructattrService structattrService ;
@Autowired
private MoveStorMapper moveStorMapper ;
@Autowired
private MoveStorDtlMapper moveStorDtlMapper ;
/ * *
* 出入库明细服务
* /
@ -794,10 +802,6 @@ public class OutBussManageServiceImpl implements OutBussManageService {
* 3 . 更新单据相关数据
* 4 . 更新任务终点
* /
// 移库单明细
WQLObject moveDtlTab = WQLObject . getWQLObject ( "st_ivt_moveinvdtl" ) ;
// 移库单主表
WQLObject moveMstTab = WQLObject . getWQLObject ( "st_ivt_moveinv" ) ;
// 子卷包装关系
WQLObject subTab = WQLObject . getWQLObject ( "pdm_bi_subpackagerelation" ) ;
// 物料信息
@ -810,9 +814,16 @@ public class OutBussManageServiceImpl implements OutBussManageService {
) ;
// 查询对应单据
JSONObject jsonMoveDtl = moveDtlTab . query ( "task_id = '" + taskDao . getTask_id ( ) + "'" ) . uniqueResult ( 0 ) ;
JSONObject jsonMoveMst = moveMstTab . query ( "moveinv_id = '" + jsonMoveDtl . getString ( "moveinv_id" ) + "' AND bill_status <> '99'" )
. uniqueResult ( 0 ) ;
List < MoveStorDtl > ja = moveStorDtlMapper . selectList ( new LambdaQueryWrapper < MoveStorDtl > ( )
. eq ( MoveStorDtl : : getTask_id , taskDao . getTask_id ( ) ) ) ;
if ( ja . size ( ) = = 0 ) {
throw new BadRequestException ( "未找到任务号为【" + taskDao . getTask_code ( ) + "】的移库单明细,请检查数据!" ) ;
}
MoveStorDtl jsonMoveDtl = ja . get ( 0 ) ;
MoveStor jsonMoveMst = moveStorMapper . selectOne ( new LambdaQueryWrapper < MoveStor > ( )
. eq ( MoveStor : : getMoveinv_id , jsonMoveDtl . getMoveinv_id ( ) )
. eq ( MoveStor : : getIs_delete , "0" )
. ne ( MoveStor : : getBill_status , "99" ) ) ;
if ( ObjectUtil . isEmpty ( jsonMoveMst ) ) {
throw new BadRequestException ( "未找到任务号为【" + taskDao . getTask_code ( ) + "】的移库单,请检查数据!" ) ;
}
@ -832,11 +843,11 @@ public class OutBussManageServiceImpl implements OutBussManageService {
JSONObject jsonParam = new JSONObject ( ) ;
jsonParam . put ( "struct_id" , jsonAttr . getStruct_id ( ) ) ;
jsonParam . put ( "material_id" , jsonMater . getString ( "material_id" ) ) ;
jsonParam . put ( "pcsn" , jsonMoveDtl . getString ( "pcsn" ) ) ;
jsonParam . put ( "change_qty" , jsonMoveDtl . getString ( "qty" ) ) ;
jsonParam . put ( "inv_id" , jsonMoveMst . getString ( "moveinv_id" ) ) ;
jsonParam . put ( "bill_code" , jsonMoveMst . getString ( "bill_code" ) ) ;
jsonParam . put ( "quality_scode" , jsonMoveDtl . getString ( "quality_scode" ) ) ;
jsonParam . put ( "pcsn" , jsonMoveDtl . getPcsn ( ) ) ;
jsonParam . put ( "change_qty" , jsonMoveDtl . getQty ( ) ) ;
jsonParam . put ( "inv_id" , jsonMoveMst . getMoveinv_id ( ) ) ;
jsonParam . put ( "bill_code" , jsonMoveMst . getBill_code ( ) ) ;
jsonParam . put ( "quality_scode" , jsonMoveDtl . getQuality_scode ( ) ) ;
storPublicService . IOStor ( jsonParam , IOSEnum . IVT_CHANGE . code ( "减待入" ) ) ;
jsonAttr . setLock_type ( IOSEnum . LOCK_TYPE . code ( "货位异常锁" ) ) ;
@ -850,7 +861,7 @@ public class OutBussManageServiceImpl implements OutBussManageService {
// 2.重新分配货位
// 组织查询移入仓位数据
JSONObject moveParam = new JSONObject ( ) ;
moveParam . put ( "stor_id" , jsonMoveMst . getString ( "stor_id" ) ) ;
moveParam . put ( "stor_id" , jsonMoveMst . getStor_id ( ) ) ;
moveParam . put ( "sect_id" , RegionTypeEnum . TWO_BZC01 . getId ( ) ) ;
moveParam . put ( "box_no" , taskDao . getVehicle_code ( ) ) ;
moveParam . put ( "material_id" , jsonMater . getString ( "material_id" ) ) ;
@ -891,23 +902,23 @@ public class OutBussManageServiceImpl implements OutBussManageService {
JSONObject jsonParam2 = new JSONObject ( ) ;
jsonParam2 . put ( "struct_id" , jsonMove . getStruct_id ( ) ) ;
jsonParam2 . put ( "material_id" , jsonMater . getString ( "material_id" ) ) ;
jsonParam2 . put ( "pcsn" , jsonMoveDtl . getString ( "pcsn" ) ) ;
jsonParam2 . put ( "change_qty" , jsonMoveDtl . getString ( "qty" ) ) ;
jsonParam2 . put ( "quality_scode" , jsonMoveDtl . getString ( "quality_scode" ) ) ;
jsonParam2 . put ( "inv_id" , jsonMoveMst . getString ( "moveinv_id" ) ) ;
jsonParam2 . put ( "bill_code" , jsonMoveMst . getString ( "bill_code" ) ) ;
jsonParam2 . put ( "bill_type_scode" , jsonMoveMst . getString ( "bill_code" ) ) ;
jsonParam2 . put ( "qty_unit_id" , jsonMoveDtl . getString ( "qty_unit_id" ) ) ;
jsonParam2 . put ( "pcsn" , jsonMoveDtl . getPcsn ( ) ) ;
jsonParam2 . put ( "change_qty" , jsonMoveDtl . getQty ( ) ) ;
jsonParam2 . put ( "quality_scode" , jsonMoveDtl . getQuality_scode ( ) ) ;
jsonParam2 . put ( "inv_id" , jsonMoveMst . getMoveinv_id ( ) ) ;
jsonParam2 . put ( "bill_code" , jsonMoveMst . getBill_code ( ) ) ;
jsonParam2 . put ( "bill_type_scode" , jsonMoveMst . getBill_type ( ) ) ;
jsonParam2 . put ( "qty_unit_id" , jsonMoveDtl . getQty_unit_id ( ) ) ;
storPublicService . IOStor ( jsonParam2 , IOSEnum . IVT_CHANGE . code ( "加待入" ) ) ;
jsonMove . setLock_type ( IOSEnum . LOCK_TYPE . code ( "移入锁" ) ) ;
structattrMapper . updateById ( jsonMove ) ;
// 3.更新单据相关数据
jsonMoveDtl . put ( "turnin_struct_id" , jsonMove . getStruct_id ( ) ) ;
jsonMoveDtl . put ( "turnin_struct_code" , jsonMove . getStruct_code ( ) ) ;
jsonMoveDtl . put ( "turnin_struct_name" , jsonMove . getStruct_name ( ) ) ;
moveDtlTab . update ( jsonMoveDtl ) ;
jsonMoveDtl . setTurnin_struct_id ( String . valueOf ( jsonMove . getStruct_id ( ) ) ) ;
jsonMoveDtl . setTurnin_struct_code ( jsonMove . getStruct_code ( ) ) ;
jsonMoveDtl . setTurnin_struct_name ( jsonMove . getStruct_name ( ) ) ;
moveStorDtlMapper . updateById ( jsonMoveDtl ) ;
// 4.更新任务终点
taskDao . setPoint_code2 ( jsonMove . getStruct_code ( ) ) ;