|
|
|
@ -1,6 +1,8 @@ |
|
|
|
package org.springblade.wms.service.impl; |
|
|
|
package org.springblade.wms.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
@ -16,6 +18,7 @@ import org.springblade.wms.excel.StGlassCakeOutExcel; |
|
|
|
import org.springblade.wms.mapper.StGlassCakeOutMapper; |
|
|
|
import org.springblade.wms.mapper.StGlassCakeOutMapper; |
|
|
|
import org.springblade.wms.mapper.StOtherReceiptRecordMapper; |
|
|
|
import org.springblade.wms.mapper.StOtherReceiptRecordMapper; |
|
|
|
import org.springblade.wms.mapper.StRealtimeStockMapper; |
|
|
|
import org.springblade.wms.mapper.StRealtimeStockMapper; |
|
|
|
|
|
|
|
import org.springblade.wms.mapper.StStockInoutRecordMapper; |
|
|
|
import org.springblade.wms.pojo.dto.StGlassCakeOutDTO; |
|
|
|
import org.springblade.wms.pojo.dto.StGlassCakeOutDTO; |
|
|
|
import org.springblade.wms.pojo.entity.*; |
|
|
|
import org.springblade.wms.pojo.entity.*; |
|
|
|
import org.springblade.wms.pojo.vo.StGlassCakeOutVO; |
|
|
|
import org.springblade.wms.pojo.vo.StGlassCakeOutVO; |
|
|
|
@ -43,6 +46,8 @@ public class StGlassCakeOutServiceImpl extends BaseServiceImpl<StGlassCakeOutMap |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
IStStockInoutRecordService stStockInoutRecordService; |
|
|
|
IStStockInoutRecordService stStockInoutRecordService; |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
|
|
|
|
StStockInoutRecordMapper stStockInoutRecordMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
IStRealtimeStockService stRealtimeStockService; |
|
|
|
IStRealtimeStockService stRealtimeStockService; |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
IStGoodsService stGoodsService; |
|
|
|
IStGoodsService stGoodsService; |
|
|
|
@ -155,6 +160,15 @@ public class StGlassCakeOutServiceImpl extends BaseServiceImpl<StGlassCakeOutMap |
|
|
|
// 3. 初始化预出库列表(收集所有库存充足的预出库实体)
|
|
|
|
// 3. 初始化预出库列表(收集所有库存充足的预出库实体)
|
|
|
|
List<StGlassCakeOut> preOutStockList = new ArrayList<>(); |
|
|
|
List<StGlassCakeOut> preOutStockList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String datePrefix = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
|
|
|
|
// 2. 当天最大序号
|
|
|
|
|
|
|
|
String maxCode = stStockInoutRecordMapper.getMaxCheckCode(datePrefix); |
|
|
|
|
|
|
|
int lastNum = 0; |
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(maxCode)) { |
|
|
|
|
|
|
|
String number = maxCode.substring(datePrefix.length()); |
|
|
|
|
|
|
|
lastNum = Integer.parseInt(number); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 4. 遍历每个玻璃饼,单独匹配库存+判断是否生成预出库
|
|
|
|
// 4. 遍历每个玻璃饼,单独匹配库存+判断是否生成预出库
|
|
|
|
if (!CollectionUtils.isEmpty(glassCakePartList)) { |
|
|
|
if (!CollectionUtils.isEmpty(glassCakePartList)) { |
|
|
|
for (DsPartEntity glassCake : glassCakePartList) { |
|
|
|
for (DsPartEntity glassCake : glassCakePartList) { |
|
|
|
@ -269,7 +283,9 @@ public class StGlassCakeOutServiceImpl extends BaseServiceImpl<StGlassCakeOutMap |
|
|
|
preOutStock.setPartCode(faYieldOrder.getPartCode()); |
|
|
|
preOutStock.setPartCode(faYieldOrder.getPartCode()); |
|
|
|
preOutStock.setPartName(faYieldOrder.getPartName()); |
|
|
|
preOutStock.setPartName(faYieldOrder.getPartName()); |
|
|
|
|
|
|
|
|
|
|
|
preOutStock.setOutCode(stStockInoutRecordService.generateCode()); |
|
|
|
String sirCode = datePrefix + StrUtil.padPre(String.valueOf(lastNum), 4, '0'); |
|
|
|
|
|
|
|
preOutStock.setOutCode(sirCode); |
|
|
|
|
|
|
|
// preOutStock.setOutCode(stStockInoutRecordService.generateCode());
|
|
|
|
preOutStock.setRequireQty(requireQty); |
|
|
|
preOutStock.setRequireQty(requireQty); |
|
|
|
preOutStock.setGoodsId(maxStock.getGoodsId()); |
|
|
|
preOutStock.setGoodsId(maxStock.getGoodsId()); |
|
|
|
StGoods stGoods = stGoodsService.getById(maxStock.getGoodsId()); |
|
|
|
StGoods stGoods = stGoodsService.getById(maxStock.getGoodsId()); |
|
|
|
|