@ -25,7 +25,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
package com.yxt.anrui.terminal.biz.wms.inventorycheckbill ;
import com.yxt.anrui.fin.api.finbillapplication.PcSelBillVinNoPageVo ;
import com.yxt.anrui.terminal.api.wms.inventorycheckbill.* ;
import com.yxt.anrui.terminal.fegin.basegoodssku.BaseGoodsSkuFeign ;
import com.yxt.anrui.terminal.fegin.basegoodssku.GoodsDeptVo ;
import com.yxt.anrui.terminal.fegin.basesupplierinfo.BaseSupplierInfoChoice ;
import com.yxt.anrui.terminal.fegin.basesupplierinfo.BaseSupplierInfoFeign ;
import com.yxt.anrui.terminal.fegin.wmsInventoryCheckbill.WmsInventoryCheckbillDetailFile ;
import com.yxt.anrui.terminal.fegin.wmsInventoryCheckbill.WmsInventoryCheckbillDetailRackGoodPageListQuery ;
import com.yxt.anrui.terminal.fegin.wmsInventoryCheckbill.WmsInventoryCheckbillDetailRackGoodPageListVo ;
@ -33,10 +38,12 @@ import com.yxt.anrui.terminal.fegin.wmsInventoryCheckbill.WmsInventoryCheckbillF
import com.yxt.common.core.query.PagerQuery ;
import com.yxt.common.core.result.ResultBean ;
import com.yxt.common.core.vo.PagerVo ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.stereotype.Service ;
import javax.annotation.Resource ;
import java.util.ArrayList ;
import java.util.Iterator ;
import java.util.List ;
@Service
@ -44,6 +51,10 @@ public class WmsInventoryCheckbillService {
@Resource
private WmsInventoryCheckbillFeign wmsInventoryCheckbillFeign ;
@Autowired
private BaseSupplierInfoFeign baseSupplierInfoFeign ;
@Autowired
private BaseGoodsSkuFeign baseGoodsSkuFeign ;
public ResultBean < PagerVo < WmsInventoryCheckbillPageVo > > pdlist ( PagerQuery < WmsInventoryCheckbillPageQuery > pagerQuery ) {
return wmsInventoryCheckbillFeign . appDetailRackPageList ( pagerQuery ) ;
@ -56,18 +67,33 @@ public class WmsInventoryCheckbillService {
WmsInventoryCheckbillGoodsPageQuery params = pagerQuery . getParams ( ) ;
wmsInventoryCheckbillDetailRackGoodPageListQuery . setBillSid ( params . getSid ( ) ) ;
wmsInventoryCheckbillDetailRackGoodPageListQuery . setWarehouseRackSid ( params . getHouseSid ( ) ) ;
wmsInventoryCheckbillDetailRackGoodPageListQuery . setNames ( params . getNames ( ) ) ;
wmsInventoryCheckbillDetailRackGoodPageListQuery . setName ( params . getName ( ) ) ;
query . setParams ( wmsInventoryCheckbillDetailRackGoodPageListQuery ) ;
PagerVo < WmsInventoryCheckbillDetailRackGoodPageListVo > data = wmsInventoryCheckbillFeign . detailRackGoodPageList ( query ) . getData ( ) ;
Iterator < WmsInventoryCheckbillDetailRackGoodPageListVo > iterator = data . getRecords ( ) . iterator ( ) ;
PagerVo < WmsInventoryCheckbillGoodsPageVo > wmsInventoryCheckbillGoodsPageVoPagerVo = new PagerVo < > ( ) ;
for ( WmsInventoryCheckbillDetailRackGoodPageListVo record : data . getRecords ( ) ) {
List < WmsInventoryCheckbillGoodsPageVo > records = new ArrayList < > ( ) ;
while ( iterator . hasNext ( ) ) {
WmsInventoryCheckbillDetailRackGoodPageListVo record = iterator . next ( ) ;
if ( record . getRealCount ( ) ! = null ) {
if ( record . getBookCount ( ) . compareTo ( record . getRealCount ( ) ) = = 0 ) {
iterator . remove ( ) ;
continue ;
}
}
WmsInventoryCheckbillGoodsPageVo wmsInventoryCheckbillGoodsPageVo = new WmsInventoryCheckbillGoodsPageVo ( ) ;
wmsInventoryCheckbillGoodsPageVo . setKuCun ( record . getBookCount ( ) . toString ( ) ) ;
wmsInventoryCheckbillGoodsPageVo . setShiPan ( record . getRealCount ( ) . toString ( ) ) ;
wmsInventoryCheckbillGoodsPageVo . setYingKui ( record . getProfitAndLoseCount ( ) . toString ( ) ) ;
wmsInventoryCheckbillGoodsPageVo . setPanSun ( record . getLossCount ( ) . toString ( ) ) ;
HandleBean handleBean = new HandleBean ( ) ;
handleBean . setBadNum ( record . getLossCount ( ) . toString ( ) ) ;
wmsInventoryCheckbillGoodsPageVo . setKuCun ( record . getBookCount ( ) . toString ( ) ) ;
if ( record . getRealCount ( ) ! = null ) {
wmsInventoryCheckbillGoodsPageVo . setShiPan ( record . getRealCount ( ) . toString ( ) ) ;
}
if ( record . getProfitAndLoseCount ( ) ! = null ) {
wmsInventoryCheckbillGoodsPageVo . setYingKui ( record . getProfitAndLoseCount ( ) . toString ( ) ) ;
}
if ( record . getLossCount ( ) ! = null ) {
wmsInventoryCheckbillGoodsPageVo . setPanSun ( record . getLossCount ( ) . toString ( ) ) ;
handleBean . setBadNum ( record . getLossCount ( ) . toString ( ) ) ;
}
List < WmsInventoryCheckbillDetailFile > fileList = record . getFileList ( ) ;
List < String > files = new ArrayList < > ( ) ;
for ( WmsInventoryCheckbillDetailFile wmsInventoryCheckbillDetailFile : fileList ) {
@ -83,8 +109,9 @@ public class WmsInventoryCheckbillService {
handleBean . setSid ( record . getSid ( ) ) ;
handleBean . setUnit ( record . getUnit ( ) ) ;
wmsInventoryCheckbillGoodsPageVo . setHandleBean ( handleBean ) ;
wmsInvento ryCheckbillGoodsPageVoPagerVo . getR ecords( ) . add ( wmsInventoryCheckbillGoodsPageVo ) ;
records . add ( wmsInventoryCheckbillGoodsPageVo ) ;
}
wmsInventoryCheckbillGoodsPageVoPagerVo . setRecords ( records ) ;
return rb . success ( ) . setData ( wmsInventoryCheckbillGoodsPageVoPagerVo ) ;
}
@ -95,4 +122,37 @@ public class WmsInventoryCheckbillService {
public ResultBean < HandleBean > scan ( String sid , String content , String houseSid ) {
return wmsInventoryCheckbillFeign . scan ( sid , content , houseSid ) ;
}
public ResultBean saveInventoryInfo2 ( WmsInventoryCheckbillGoodsPyDto dto ) {
return wmsInventoryCheckbillFeign . saveInventoryInfo2 ( dto ) ;
}
public ResultBean < List < AppInventoryCheckbill > > selectGoods ( String name , String orgPath ) {
ResultBean rb = ResultBean . fireFail ( ) ;
List < AppInventoryCheckbill > appInventoryCheckbills = new ArrayList < > ( ) ;
List < GoodsDeptVo > goodsDeptVos = baseGoodsSkuFeign . selectGoods ( name , orgPath ) . getData ( ) ;
for ( GoodsDeptVo goodsDeptVo : goodsDeptVos ) {
AppInventoryCheckbill appInventoryCheckbill = new AppInventoryCheckbill ( ) ;
appInventoryCheckbill . setDictValue ( goodsDeptVo . getGoodsName ( ) ) ;
Extra extra = new Extra ( ) ;
extra . setGoodsSkuCode ( goodsDeptVo . getGoodsSkuCode ( ) ) ;
extra . setUnit ( goodsDeptVo . getUnit ( ) ) ;
appInventoryCheckbill . setExtra ( extra ) ;
appInventoryCheckbills . add ( appInventoryCheckbill ) ;
}
return rb . success ( ) . setData ( appInventoryCheckbills ) ;
}
public ResultBean < List < AppInventoryCheckbill > > selectProvider ( String name , String orgPath ) {
ResultBean rb = ResultBean . fireFail ( ) ;
List < AppInventoryCheckbill > appInventoryCheckbills = new ArrayList < > ( ) ;
List < BaseSupplierInfoChoice > baseSupplierInfoChoices = baseSupplierInfoFeign . selectProvider ( name , orgPath ) . getData ( ) ;
for ( BaseSupplierInfoChoice baseSupplierInfoChoice : baseSupplierInfoChoices ) {
AppInventoryCheckbill appInventoryCheckbill = new AppInventoryCheckbill ( ) ;
appInventoryCheckbill . setId ( baseSupplierInfoChoice . getSid ( ) ) ;
appInventoryCheckbill . setDictValue ( baseSupplierInfoChoice . getSupplierName ( ) ) ;
appInventoryCheckbills . add ( appInventoryCheckbill ) ;
}
return rb . success ( ) . setData ( appInventoryCheckbills ) ;
}
}