仓库管理修改

liweidong
wusiyu 2 days ago
parent 7e4a8e3186
commit 81bc93a329
  1. 4
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StOtherReceiptRecordMapper.java
  2. 12
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StOtherReceiptRecordMapper.xml
  3. 18
      blade-service/blade-wms/src/main/java/org/springblade/wms/service/impl/StGlassCakeOutServiceImpl.java
  4. 17
      blade-service/blade-wms/src/main/java/org/springblade/wms/service/impl/StGraphiteMoldOutServiceImpl.java
  5. 7
      blade-service/blade-wms/src/main/java/org/springblade/wms/service/impl/StOtherReceiptRecordServiceImpl.java

@ -46,5 +46,9 @@ public interface StOtherReceiptRecordMapper extends BaseMapper<StOtherReceiptRec
WorkOrder getByWoCode(String woCode); WorkOrder getByWoCode(String woCode);
YieldOrder getByYoId(Long yoId); YieldOrder getByYoId(Long yoId);
void updateByWoId(Long id, String batchNo);
void updateByYoId(Long id, String batchNo);
} }

@ -123,4 +123,16 @@
FROM MES_YIELD_ORDER FROM MES_YIELD_ORDER
WHERE ID = #{yoId} WHERE ID = #{yoId}
</select> </select>
<update id="updateByWoId">
UPDATE MES_WORK_ORDER
SET batch_no = #{batchNo}
WHERE ID = #{id}
</update>
<update id="updateByYoId">
UPDATE MES_YIELD_ORDER
SET batch_no = #{batchNo}
WHERE ID = #{id}
</update>
</mapper> </mapper>

@ -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());

@ -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;
@ -13,6 +15,7 @@ import org.springblade.desk.order.pojo.entity.YieldOrder;
import org.springblade.wms.excel.StGraphiteMoldOutExcel; import org.springblade.wms.excel.StGraphiteMoldOutExcel;
import org.springblade.wms.mapper.StGraphiteMoldOutMapper; import org.springblade.wms.mapper.StGraphiteMoldOutMapper;
import org.springblade.wms.mapper.StRealtimeStockMapper; import org.springblade.wms.mapper.StRealtimeStockMapper;
import org.springblade.wms.mapper.StStockInoutRecordMapper;
import org.springblade.wms.pojo.dto.StGraphiteMoldOutDTO; import org.springblade.wms.pojo.dto.StGraphiteMoldOutDTO;
import org.springblade.wms.pojo.entity.*; import org.springblade.wms.pojo.entity.*;
import org.springblade.wms.pojo.vo.StGraphiteMoldOutVO; import org.springblade.wms.pojo.vo.StGraphiteMoldOutVO;
@ -40,6 +43,8 @@ public class StGraphiteMoldOutServiceImpl extends BaseServiceImpl<StGraphiteMold
@Resource @Resource
IStStockInoutRecordService stStockInoutRecordService; IStStockInoutRecordService stStockInoutRecordService;
@Resource @Resource
StStockInoutRecordMapper stStockInoutRecordMapper;
@Resource
IStRealtimeStockService stRealtimeStockService; IStRealtimeStockService stRealtimeStockService;
@Resource @Resource
IStGoodsService stGoodsService; IStGoodsService stGoodsService;
@ -104,6 +109,14 @@ public class StGraphiteMoldOutServiceImpl extends BaseServiceImpl<StGraphiteMold
} }
double remainingQty = requireQty; double remainingQty = requireQty;
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);
}
for (StRealtimeStock maxStock : candidateStockList) { for (StRealtimeStock maxStock : candidateStockList) {
if (remainingQty <= 0.001) { if (remainingQty <= 0.001) {
break; break;
@ -117,7 +130,9 @@ public class StGraphiteMoldOutServiceImpl extends BaseServiceImpl<StGraphiteMold
preOutStock.setYoCode(faYieldOrder.getYoCode()); preOutStock.setYoCode(faYieldOrder.getYoCode());
preOutStock.setCardNo(dto.getCardNo()); preOutStock.setCardNo(dto.getCardNo());
preOutStock.setOutCode(stStockInoutRecordService.generateCode()); String sirCode = datePrefix + StrUtil.padPre(String.valueOf(lastNum), 4, '0');
preOutStock.setOutCode(sirCode);
// preOutStock.setOutCode(stStockInoutRecordService.generateCode());
preOutStock.setNeedQuantity(requireQty); preOutStock.setNeedQuantity(requireQty);
preOutStock.setGoodsId(maxStock.getGoodsId()); preOutStock.setGoodsId(maxStock.getGoodsId());
StGoods stGoods = stGoodsService.getById(maxStock.getGoodsId()); StGoods stGoods = stGoodsService.getById(maxStock.getGoodsId());

@ -381,6 +381,13 @@ public class StOtherReceiptRecordServiceImpl extends BaseServiceImpl<StOtherRece
otherReceiptRecord.setInoutList(inoutList); otherReceiptRecord.setInoutList(inoutList);
this.otherWarehousing(otherReceiptRecord, user); this.otherWarehousing(otherReceiptRecord, user);
WorkOrder workOrder = baseMapper.getByWoCode(woCode);
workOrder.setBatchNo(batchNo);
baseMapper.updateByWoId(workOrder.getId(), batchNo);
YieldOrder yieldOrder = baseMapper.getByYoId(workOrder.getYoId());
baseMapper.updateByYoId(yieldOrder.getId(), batchNo);
} }
@Override @Override

Loading…
Cancel
Save