|
@ -1,4 +1,4 @@ |
|
|
package com.yxt.storage.biz.wmsshelfbill; |
|
|
package com.yxt.storage.biz.storageshelfbill; |
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.date.DateUtil; |
|
@ -10,17 +10,17 @@ import com.yxt.common.base.utils.StringUtils; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
import com.yxt.storage.biz.wmsinventory.WmsInventorySaveDto; |
|
|
import com.yxt.storage.biz.storageinventory.StorageInventorySaveDto; |
|
|
import com.yxt.storage.biz.wmsinventory.WmsInventoryService; |
|
|
import com.yxt.storage.biz.storageinventory.StorageInventoryService; |
|
|
import com.yxt.storage.biz.wmsinventoryrecord.WmsInventoryRecordDto; |
|
|
import com.yxt.storage.biz.storageinventoryrecord.StorageInventoryRecordDto; |
|
|
import com.yxt.storage.biz.wmsinventoryrecord.WmsInventoryRecordService; |
|
|
import com.yxt.storage.biz.storageinventoryrecord.StorageInventoryRecordService; |
|
|
import com.yxt.storage.biz.wmsreceiptbill.WmsReceiptBill; |
|
|
import com.yxt.storage.biz.storagereceiptbill.StorageReceiptBill; |
|
|
import com.yxt.storage.biz.wmsreceiptbill.WmsReceiptBillService; |
|
|
import com.yxt.storage.biz.storagereceiptbill.StorageReceiptBillService; |
|
|
import com.yxt.storage.biz.wmsreceiptbilldetail.WmsReceiptBillDetail; |
|
|
import com.yxt.storage.biz.storagereceiptbilldetail.StorageReceiptBillDetail; |
|
|
import com.yxt.storage.biz.wmsreceiptbilldetail.WmsReceiptBillDetailService; |
|
|
import com.yxt.storage.biz.storagereceiptbilldetail.StorageReceiptBillDetailService; |
|
|
import com.yxt.storage.biz.wmsreceiptbilldetailbatch.WmsReceiptBillDetailBatch; |
|
|
import com.yxt.storage.biz.storagereceiptbilldetailbatch.StorageReceiptBillDetailBatch; |
|
|
import com.yxt.storage.biz.wmsreceiptbilldetailbatch.WmsReceiptBillDetailBatchService; |
|
|
import com.yxt.storage.biz.storagereceiptbilldetailbatch.StorageReceiptBillDetailBatchService; |
|
|
import com.yxt.storage.biz.wmsshelfbilldetail.*; |
|
|
import com.yxt.storage.biz.storageshelfbilldetail.*; |
|
|
import com.yxt.storage.feign.goods.basegoodssku.BaseGoodsSkuDetailsVo; |
|
|
import com.yxt.storage.feign.goods.basegoodssku.BaseGoodsSkuDetailsVo; |
|
|
import com.yxt.storage.feign.goods.basegoodssku.BaseGoodsSkuFeign; |
|
|
import com.yxt.storage.feign.goods.basegoodssku.BaseGoodsSkuFeign; |
|
|
import com.yxt.storage.utils.Rule; |
|
|
import com.yxt.storage.utils.Rule; |
|
@ -40,29 +40,29 @@ import java.util.List; |
|
|
* @date: 2024/4/11 |
|
|
* @date: 2024/4/11 |
|
|
**/ |
|
|
**/ |
|
|
@Service |
|
|
@Service |
|
|
public class WmsShelfBillService extends MybatisBaseService<WmsShelfBillMapper, WmsShelfBill> { |
|
|
public class StorageShelfBillService extends MybatisBaseService<StorageShelfBillMapper, StorageShelfBill> { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WmsShelfBillDetailService wmsShelfBillDetailService; |
|
|
private StorageShelfBillDetailService wmsShelfBillDetailService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WmsShelfBillDetailMapper wmsShelfBillDetailMapper; |
|
|
private StorageShelfBillDetailMapper wmsShelfBillDetailMapper; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private WmsInventoryService wmsInventoryService; |
|
|
private StorageInventoryService wmsInventoryService; |
|
|
@Resource |
|
|
@Resource |
|
|
private BaseGoodsSkuFeign baseGoodsSkuFeign; |
|
|
private BaseGoodsSkuFeign baseGoodsSkuFeign; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private WmsInventoryRecordService wmsInventoryRecordService; |
|
|
private StorageInventoryRecordService wmsInventoryRecordService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WmsReceiptBillService wmsReceiptBillService; |
|
|
private StorageReceiptBillService wmsReceiptBillService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WmsReceiptBillDetailService wmsReceiptBillDetailService; |
|
|
private StorageReceiptBillDetailService wmsReceiptBillDetailService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WmsReceiptBillDetailBatchService wmsReceiptBillDetailBatchService; |
|
|
private StorageReceiptBillDetailBatchService wmsReceiptBillDetailBatchService; |
|
|
|
|
|
|
|
|
public PagerVo<WmsShelfBillVo> listPage(PagerQuery<WmsShelfBillQuery> pq) { |
|
|
public PagerVo<StorageShelfBillVo> listPage(PagerQuery<StorageShelfBillQuery> pq) { |
|
|
WmsShelfBillQuery query = pq.getParams(); |
|
|
StorageShelfBillQuery query = pq.getParams(); |
|
|
QueryWrapper<WmsShelfBill> qw = new QueryWrapper<>(); |
|
|
QueryWrapper<StorageShelfBill> qw = new QueryWrapper<>(); |
|
|
//ToDo:添加查询条件
|
|
|
//ToDo:添加查询条件
|
|
|
if (StringUtils.isNotBlank(query.getBillNo())) { |
|
|
if (StringUtils.isNotBlank(query.getBillNo())) { |
|
|
qw.like("wsb.billNo", query.getBillNo()); |
|
|
qw.like("wsb.billNo", query.getBillNo()); |
|
@ -75,19 +75,19 @@ public class WmsShelfBillService extends MybatisBaseService<WmsShelfBillMapper, |
|
|
if (StringUtils.isNotBlank(query.getBillState())) { |
|
|
if (StringUtils.isNotBlank(query.getBillState())) { |
|
|
qw.like("wsb.billState", query.getBillState()); |
|
|
qw.like("wsb.billState", query.getBillState()); |
|
|
} |
|
|
} |
|
|
IPage<WmsShelfBill> page = PagerUtil.queryToPage(pq); |
|
|
IPage<StorageShelfBill> page = PagerUtil.queryToPage(pq); |
|
|
IPage<WmsShelfBillVo> pagging = baseMapper.listPage(page, qw); |
|
|
IPage<StorageShelfBillVo> pagging = baseMapper.listPage(page, qw); |
|
|
PagerVo<WmsShelfBillVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
PagerVo<StorageShelfBillVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
return p; |
|
|
return p; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ResultBean saveOrUpdateShelf(WmsShelfBillDto dto) { |
|
|
public ResultBean saveOrUpdateShelf(StorageShelfBillDto dto) { |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
String sid = dto.getSid(); |
|
|
String sid = dto.getSid(); |
|
|
if (StringUtils.isBlank(sid)) { |
|
|
if (StringUtils.isBlank(sid)) { |
|
|
WmsShelfBill wmsShelfBill = new WmsShelfBill(); |
|
|
StorageShelfBill wmsShelfBill = new StorageShelfBill(); |
|
|
BeanUtil.copyProperties(dto, wmsShelfBill, "sid"); |
|
|
BeanUtil.copyProperties(dto, wmsShelfBill, "sid"); |
|
|
List<WmsShelfBillDetailDto> list = dto.getList(); |
|
|
List<StorageShelfBillDetailDto> list = dto.getList(); |
|
|
list.removeAll(Collections.singleton(null)); |
|
|
list.removeAll(Collections.singleton(null)); |
|
|
sid = wmsShelfBill.getSid(); |
|
|
sid = wmsShelfBill.getSid(); |
|
|
if (!list.isEmpty()) { |
|
|
if (!list.isEmpty()) { |
|
@ -95,12 +95,12 @@ public class WmsShelfBillService extends MybatisBaseService<WmsShelfBillMapper, |
|
|
} |
|
|
} |
|
|
baseMapper.insert(wmsShelfBill); |
|
|
baseMapper.insert(wmsShelfBill); |
|
|
} else { |
|
|
} else { |
|
|
WmsShelfBill wmsShelfBill = fetchBySid(sid); |
|
|
StorageShelfBill wmsShelfBill = fetchBySid(sid); |
|
|
if (wmsShelfBill == null) { |
|
|
if (wmsShelfBill == null) { |
|
|
return rb.setMsg("该单据不存在"); |
|
|
return rb.setMsg("该单据不存在"); |
|
|
} |
|
|
} |
|
|
BeanUtil.copyProperties(dto, wmsShelfBill, "sid"); |
|
|
BeanUtil.copyProperties(dto, wmsShelfBill, "sid"); |
|
|
List<WmsShelfBillDetailDto> list = dto.getList(); |
|
|
List<StorageShelfBillDetailDto> list = dto.getList(); |
|
|
list.removeAll(Collections.singleton(null)); |
|
|
list.removeAll(Collections.singleton(null)); |
|
|
sid = wmsShelfBill.getSid(); |
|
|
sid = wmsShelfBill.getSid(); |
|
|
if (!list.isEmpty()) { |
|
|
if (!list.isEmpty()) { |
|
@ -116,13 +116,13 @@ public class WmsShelfBillService extends MybatisBaseService<WmsShelfBillMapper, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void saveWmsInventory(String sid) { |
|
|
public void saveWmsInventory(String sid) { |
|
|
WmsShelfBill wmsShelfBill = fetchBySid(sid); |
|
|
StorageShelfBill wmsShelfBill = fetchBySid(sid); |
|
|
List<WmsShelfBillDetailVos> detailList = wmsShelfBillDetailService.selectByBillSid(sid); |
|
|
List<StorageShelfBillDetailVos> detailList = wmsShelfBillDetailService.selectByBillSid(sid); |
|
|
detailList.removeAll(Collections.singleton(null)); |
|
|
detailList.removeAll(Collections.singleton(null)); |
|
|
if (!detailList.isEmpty()) { |
|
|
if (!detailList.isEmpty()) { |
|
|
for (int i = 0; i < detailList.size(); i++) { |
|
|
for (int i = 0; i < detailList.size(); i++) { |
|
|
WmsShelfBillDetailVos s = detailList.get(i); |
|
|
StorageShelfBillDetailVos s = detailList.get(i); |
|
|
WmsInventorySaveDto dto = new WmsInventorySaveDto(); |
|
|
StorageInventorySaveDto dto = new StorageInventorySaveDto(); |
|
|
dto.setCreateBySid(wmsShelfBill.getCreateBySid()); |
|
|
dto.setCreateBySid(wmsShelfBill.getCreateBySid()); |
|
|
dto.setBatchNumber(s.getBatchNumber()); |
|
|
dto.setBatchNumber(s.getBatchNumber()); |
|
|
dto.setGoodsID(getGoodsId(s.getGoodsSkuSid())); |
|
|
dto.setGoodsID(getGoodsId(s.getGoodsSkuSid())); |
|
@ -143,10 +143,10 @@ public class WmsShelfBillService extends MybatisBaseService<WmsShelfBillMapper, |
|
|
dto.setUseOrgSid(wmsShelfBill.getUseOrgSid()); |
|
|
dto.setUseOrgSid(wmsShelfBill.getUseOrgSid()); |
|
|
dto.setSid(s.getInventorySid()); |
|
|
dto.setSid(s.getInventorySid()); |
|
|
String inventorySid = wmsInventoryService.saveWmsInventory(dto).getData(); |
|
|
String inventorySid = wmsInventoryService.saveWmsInventory(dto).getData(); |
|
|
WmsShelfBillDetail wmsShelfBillDetail = wmsShelfBillDetailService.fetchBySid(s.getDetailsSid()); |
|
|
StorageShelfBillDetail wmsShelfBillDetail = wmsShelfBillDetailService.fetchBySid(s.getDetailsSid()); |
|
|
wmsShelfBillDetail.setInventorySid(inventorySid); |
|
|
wmsShelfBillDetail.setInventorySid(inventorySid); |
|
|
wmsShelfBillDetailService.updateById(wmsShelfBillDetail); |
|
|
wmsShelfBillDetailService.updateById(wmsShelfBillDetail); |
|
|
WmsInventoryRecordDto wmsInventoryRecordDto = new WmsInventoryRecordDto(); |
|
|
StorageInventoryRecordDto wmsInventoryRecordDto = new StorageInventoryRecordDto(); |
|
|
wmsInventoryRecordDto.setInventorySid(inventorySid); |
|
|
wmsInventoryRecordDto.setInventorySid(inventorySid); |
|
|
wmsInventoryRecordDto.setGoodsID(dto.getGoodsID()); |
|
|
wmsInventoryRecordDto.setGoodsID(dto.getGoodsID()); |
|
|
wmsInventoryRecordDto.setSourceBillSid(wmsShelfBill.getSourceBillSid()); |
|
|
wmsInventoryRecordDto.setSourceBillSid(wmsShelfBill.getSourceBillSid()); |
|
@ -224,19 +224,19 @@ public class WmsShelfBillService extends MybatisBaseService<WmsShelfBillMapper, |
|
|
List<String> stringList = wmsShelfBillDetailService.selectReceiptSidList(); |
|
|
List<String> stringList = wmsShelfBillDetailService.selectReceiptSidList(); |
|
|
stringList.removeAll(Collections.singleton(null)); |
|
|
stringList.removeAll(Collections.singleton(null)); |
|
|
//获取收货单据
|
|
|
//获取收货单据
|
|
|
WmsReceiptBill wmsReceiptBill = wmsReceiptBillService.fetchBySid(sid); |
|
|
StorageReceiptBill wmsReceiptBill = wmsReceiptBillService.fetchBySid(sid); |
|
|
shelfInitVo.setCreateTime(DateUtil.today());//单据日期
|
|
|
shelfInitVo.setCreateTime(DateUtil.today());//单据日期
|
|
|
shelfInitVo.setSourceBillNo(wmsReceiptBill.getBillNo());//来源单编号
|
|
|
shelfInitVo.setSourceBillNo(wmsReceiptBill.getBillNo());//来源单编号
|
|
|
shelfInitVo.setSourceBillSid(wmsReceiptBill.getSid());//来源单sid
|
|
|
shelfInitVo.setSourceBillSid(wmsReceiptBill.getSid());//来源单sid
|
|
|
shelfInitVo.setBillState(0); |
|
|
shelfInitVo.setBillState(0); |
|
|
List<ShelfInitListVo> list = new ArrayList<>(); |
|
|
List<ShelfInitListVo> list = new ArrayList<>(); |
|
|
//获取收货单据的明细
|
|
|
//获取收货单据的明细
|
|
|
List<WmsReceiptBillDetail> wmsReceiptBillDetailsList = wmsReceiptBillDetailService.selectByBillSid(sid, stringList); |
|
|
List<StorageReceiptBillDetail> wmsReceiptBillDetailsList = wmsReceiptBillDetailService.selectByBillSid(sid, stringList); |
|
|
wmsReceiptBillDetailsList.removeAll(Collections.singleton(null)); |
|
|
wmsReceiptBillDetailsList.removeAll(Collections.singleton(null)); |
|
|
if (!wmsReceiptBillDetailsList.isEmpty()) { |
|
|
if (!wmsReceiptBillDetailsList.isEmpty()) { |
|
|
for (int i = 0; i < wmsReceiptBillDetailsList.size(); i++) { |
|
|
for (int i = 0; i < wmsReceiptBillDetailsList.size(); i++) { |
|
|
WmsReceiptBillDetail v = wmsReceiptBillDetailsList.get(i); |
|
|
StorageReceiptBillDetail v = wmsReceiptBillDetailsList.get(i); |
|
|
WmsReceiptBillDetailBatch wmsReceiptBillDetailBatch = wmsReceiptBillDetailBatchService.selectByDetails(v.getSid()); |
|
|
StorageReceiptBillDetailBatch wmsReceiptBillDetailBatch = wmsReceiptBillDetailBatchService.selectByDetails(v.getSid()); |
|
|
ShelfInitListVo shelfInitListVo = new ShelfInitListVo(); |
|
|
ShelfInitListVo shelfInitListVo = new ShelfInitListVo(); |
|
|
BeanUtil.copyProperties(v, shelfInitListVo, "sid"); |
|
|
BeanUtil.copyProperties(v, shelfInitListVo, "sid"); |
|
|
shelfInitListVo.setBatchNumber(wmsReceiptBillDetailBatch.getBatchNumber()); |
|
|
shelfInitListVo.setBatchNumber(wmsReceiptBillDetailBatch.getBatchNumber()); |
|
@ -251,7 +251,7 @@ public class WmsShelfBillService extends MybatisBaseService<WmsShelfBillMapper, |
|
|
return rb.success().setData(shelfInitVo); |
|
|
return rb.success().setData(shelfInitVo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ResultBean<String> confirm(WmsShelfBillDto dto) { |
|
|
public ResultBean<String> confirm(StorageShelfBillDto dto) { |
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
dto.setBillState(1); |
|
|
dto.setBillState(1); |
|
|
ResultBean<String> resultBean = saveOrUpdateShelf(dto); |
|
|
ResultBean<String> resultBean = saveOrUpdateShelf(dto); |