From c0a718538ba8661f235d524ed335cbf7b1919962 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期四, 23 十月 2025 14:29:33 +0800
Subject: [PATCH] 出库导出excel
---
src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java | 38 ++++++++++++++++++++++++++++++--------
1 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
index c87188c..9eb8ebe 100644
--- a/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
+import com.core.common.DateUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.entity.Pla;
@@ -92,13 +93,15 @@
}
//閫�鍥�
+ @Transactional
public void returned(List<PlaQty> plaQties, User user) {
plaQties.forEach(plaQty -> {
PlaQty plaQtyOut = plaQtyService.selectById(plaQty.getId());
- if(Cools.isEmpty(plaQtyOut.getReturned())){
+ if(Cools.isEmpty(plaQtyOut.getReturned()) || plaQtyOut.getReturned() == 0){
plaQtyOut.setReturned(plaQty.getOrderWeight());
}else {
- plaQtyOut.setReturned(plaQty.getOrderWeight()+plaQtyOut.getReturned());
+ throw new CoolException("璇ュ寘鐗╂枡宸查��鍥�");
+ //plaQtyOut.setReturned(plaQty.getOrderWeight()+plaQtyOut.getReturned());
}
plaQtyService.updateById(plaQtyOut);
@@ -109,6 +112,7 @@
plaQtyReturned.setLocNo(plaQtyOut.getLocNo());
plaQtyReturned.setOrderNo(plaQtyOut.getOrderNo());
plaQtyReturned.setPakoutTime(Utils.getDateStr(new Date()));
+ plaQtyReturned.setBrand(plaQty.getBrand());
plaQtyReturned.setOrderWeight(plaQty.getOrderWeight());
plaQtyReturned.setTransfer("閫�鍥炲叆搴�");
plaQtyReturned.setHandlerBy(user.getUsername());
@@ -121,12 +125,19 @@
//pla.setStatus(GlobleParameter.PLA_STATUS_0);
pla.setModifyTime(new Date());
+ // 閫�璐т汉 modify_user锛岄��璐у娉� create_user锛岄��璐ф爣璇� transfer
+ pla.setModifyUser(user.getUsername());
+ pla.setCreateUser(plaQty.getMemo());
+ pla.setTransfer("閫�璐�");
+ pla.setStash(""); // 搴撳尯
+ pla.setLocNo(""); // 搴撲綅
+
pla.setWeightAnfme(pla.getWeightAnfme() + plaQty.getOrderWeight());
pla.setStatus(GlobleParameter.PLA_STATUS_1);
this.updateById(pla);
- SaasUtils.insertLog(0,pla.getLocNo(),pla.getBrand(),plaQty.getOrderWeight(),user.getUsername(),
- null,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop());
+ SaasUtils.insertLog(4,pla.getLocNo(),pla.getBrand(),plaQty.getOrderWeight(),user.getUsername(),
+ null,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop(),null);
});
}
@@ -154,11 +165,22 @@
public Page<Pla> getStockStatisAll(Page<Pla> page) {
List<Pla> plaList;
- if(Cools.isEmpty(page.getCondition().get("brand"))){
- plaList=baseMapper.getStockStatisAll();
- }else {
- plaList = baseMapper.getStockStatisAllByBrand(page.getCondition().get("brand").toString());
+ Date stime = null;
+ Date etime = null;
+ Object create_time = page.getCondition().get("create_time");
+ Object brand = page.getCondition().get("brand");
+ Object status = page.getCondition().get("status");
+ String type = (String) page.getCondition().get("type");
+ String workshop = (String) page.getCondition().get("workshop");
+ String transfer = (String) page.getCondition().get("transfer");
+
+ String createTime = create_time == null ? null : create_time.toString();
+ if(!Cools.isEmpty(createTime)){
+ String[] dates = createTime.split(" - ");
+ stime = DateUtils.convert(dates[0]);
+ etime = DateUtils.convert(dates[1]);
}
+ plaList=baseMapper.getStockStatisAll(brand == null ? null:brand.toString(), status == null ? null:status.toString(), stime,etime, type, workshop, transfer);
double weightSum = plaList.stream().mapToDouble(Pla::getWeight).sum();
--
Gitblit v1.9.1