From be1b426b7d765a546f4a26b60e80aa49a57079b9 Mon Sep 17 00:00:00 2001
From: xiaogang <905166056@qq.com>
Date: 星期六, 13 一月 2024 16:25:11 +0800
Subject: [PATCH] 1、优化采购模块数量不能为小数点问题2、新增客服巡查巡楼记录功能模块3、新增页面导出功能4、优化记录查询条件新增时间段查询条件5、其他界面性调整
---
service-store/src/main/java/com/java110/store/bmo/allocation/impl/AllocationBMOImpl.java | 47 ++++++++++-------------------------------------
1 files changed, 10 insertions(+), 37 deletions(-)
diff --git a/service-store/src/main/java/com/java110/store/bmo/allocation/impl/AllocationBMOImpl.java b/service-store/src/main/java/com/java110/store/bmo/allocation/impl/AllocationBMOImpl.java
index c97730f..97b237b 100644
--- a/service-store/src/main/java/com/java110/store/bmo/allocation/impl/AllocationBMOImpl.java
+++ b/service-store/src/main/java/com/java110/store/bmo/allocation/impl/AllocationBMOImpl.java
@@ -5,7 +5,6 @@
import com.java110.dto.resource.ResourceStoreDto;
import com.java110.dto.resource.ResourceStoreTimesDto;
import com.java110.dto.store.StorehouseDto;
-import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
import com.java110.intf.store.*;
import com.java110.po.purchase.ResourceStorePo;
import com.java110.po.resource.ResourceStoreTimesPo;
@@ -15,13 +14,11 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.math.BigDecimal;
import java.util.List;
@Service
public class AllocationBMOImpl implements IAllocationBMO {
-
- @Autowired
- private IAllocationStorehouseApplyInnerServiceSMO allocationStorehouseApplyInnerServiceSMOImpl;
@Autowired
private IStorehouseInnerServiceSMO storehouseInnerServiceSMOImpl;
@@ -33,30 +30,16 @@
private IResourceStoreInnerServiceSMO resourceStoreInnerServiceSMOImpl;
@Autowired
- private IAllocationStorehouseUserInnerServiceSMO allocationStorehouseUserInnerServiceSMOImpl;
-
- @Autowired
- private IUserStorehouseInnerServiceSMO userStorehouseInnerServiceSMOImpl;
-
- @Autowired
- private IAllocationStorehouseApplyV1InnerServiceSMO allocationStorehouseApplyV1InnerServiceSMOImpl;
-
- @Autowired
- private IAllocationStorehouseV1InnerServiceSMO allocationStorehouseV1InnerServiceSMOImpl;
-
- @Autowired
private IResourceStoreV1InnerServiceSMO resourceStoreV1InnerServiceSMOImpl;
@Override
- public void doToAllocationStorehouse(AllocationStorehouseDto tmpAllocationStorehouseDto, int allocationStock) {
-
-
+ public void doToAllocationStorehouse(AllocationStorehouseDto tmpAllocationStorehouseDto, double allocationStock) {
//鏌ヨz 浠撳簱
StorehouseDto storehouseDto = new StorehouseDto();
storehouseDto.setShId(tmpAllocationStorehouseDto.getShIdz());
List<StorehouseDto> targetStorehouseDtos = storehouseInnerServiceSMOImpl.queryStorehouses(storehouseDto);
+ Assert.listOnlyOne(targetStorehouseDtos, "鐩爣浠撳簱涓嶅瓨鍦�");
- Assert.listOnlyOne(targetStorehouseDtos,"鐩爣浠撳簱涓嶅瓨鍦�");
// todo -------------------------------------------------鍘熶粨搴撲腑鍋氭墸闄� (start)-----------------------------------------------------//
// todo 鍘熶粨搴撲腑鎵i櫎 鏁伴噺
ResourceStoreDto resourceStoreDto = new ResourceStoreDto();
@@ -67,7 +50,6 @@
if (resourceStoreDtoAs == null || resourceStoreDtoAs.size() < 1) {
return;
}
-
ResourceStoreTimesDto resourceStoreTimesDto = new ResourceStoreTimesDto();
resourceStoreTimesDto.setTimesId(tmpAllocationStorehouseDto.getTimesId());
resourceStoreTimesDto.setShId(tmpAllocationStorehouseDto.getShIda());
@@ -76,9 +58,7 @@
if (resourceStoreTimesDtoAs == null || resourceStoreTimesDtoAs.size() < 1) {
return;
}
-
- int stockA = Integer.parseInt(resourceStoreDtoAs.get(0).getStock());
-
+ double stockA = Double.parseDouble(resourceStoreDtoAs.get(0).getStock());
//todo 搴撳瓨涓嶅鏃讹紝鍙兘璋冩嫧 搴撳瓨锛岃繖绉嶅満鏅簲璇ユ墽琛屼笉鍒� 鍓嶆枃鍋氫簡鏍¢獙
if (stockA < allocationStock) {
allocationStock = stockA;
@@ -88,14 +68,11 @@
resourceStorePo.setStoreId(resourceStoreDtoAs.get(0).getStoreId());
resourceStorePo.setStock(allocationStock * -1 + "");// 杩欓噷鍘绘墸鍑�
resourceStoreInnerServiceSMOImpl.updateResourceStore(resourceStorePo);
-
- stockA = Integer.parseInt(resourceStoreTimesDtoAs.get(0).getStock());
-
+ stockA = Double.parseDouble(resourceStoreTimesDtoAs.get(0).getStock());
//todo 搴撳瓨涓嶅鏃讹紝鍙兘璋冩嫧 搴撳瓨锛岃繖绉嶅満鏅簲璇ユ墽琛屼笉鍒� 鍓嶆枃鍋氫簡鏍¢獙
if (stockA < allocationStock) {
allocationStock = stockA;
}
-
ResourceStoreTimesPo resourceStoreTimesPo = new ResourceStoreTimesPo();
resourceStoreTimesPo.setPrice(resourceStoreTimesDtoAs.get(0).getPrice());
resourceStoreTimesPo.setShId(resourceStoreTimesDtoAs.get(0).getShId());
@@ -106,7 +83,6 @@
// todo -------------------------------------------------鍘熶粨搴撲腑鍋氭墸闄� (end)-----------------------------------------------------//
// todo -------------------------------------------------鐩爣浠撳簱涓仛澧炲姞 (start)-----------------------------------------------------//
-
//todo 鏌ヨ鐩爣浠撳簱涓� 搴撳瓨
resourceStoreDto = new ResourceStoreDto();
resourceStoreDto.setResCode(resourceStoreDtoAs.get(0).getResCode());
@@ -120,26 +96,25 @@
tmpResourceStorePo.setStock(allocationStock + "");
tmpResourceStorePo.setShId(tmpAllocationStorehouseDto.getShIdz());
tmpResourceStorePo.setCommunityId(targetStorehouseDtos.get(0).getCommunityId());
+ BigDecimal miniUnitStock = new BigDecimal(resourceStoreDtoAs.get(0).getMiniUnitStock()); //鑾峰彇鏈�灏忚閲忓崟浣嶆暟閲�
+ BigDecimal stock = new BigDecimal(tmpResourceStorePo.getStock()); //鑾峰彇鐗╁搧搴撳瓨
+ BigDecimal miniStock = miniUnitStock.multiply(stock); //璁$畻鏈�灏忚閲忓崟浣嶆�绘暟
+ tmpResourceStorePo.setMiniStock(String.valueOf(miniStock));
resourceStoreV1InnerServiceSMOImpl.saveResourceStore(tmpResourceStorePo);
-
// todo 娣诲姞 times
ResourceStoreTimesPo tmpResourceStoreTimesPo = BeanConvertUtil.covertBean(resourceStoreTimesDtoAs.get(0), ResourceStoreTimesPo.class);
tmpResourceStoreTimesPo.setTimesId(GenerateCodeFactory.getGeneratorId("11"));
tmpResourceStoreTimesPo.setStock(allocationStock + "");
tmpResourceStoreTimesPo.setShId(tmpAllocationStorehouseDto.getShIdz());
tmpResourceStoreTimesPo.setCommunityId(targetStorehouseDtos.get(0).getCommunityId());
-
resourceStoreTimesV1InnerServiceSMOImpl.saveResourceStoreTimes(tmpResourceStoreTimesPo);
return;
}
-
resourceStorePo = new ResourceStorePo();
resourceStorePo.setResId(resourceStoreDtoZs.get(0).getResId());
resourceStorePo.setStoreId(resourceStoreDtoZs.get(0).getStoreId());
- resourceStorePo.setStock(allocationStock + "");// 杩欓噷鍘绘墸鍑�
+ resourceStorePo.setStock(allocationStock + "");// 杩欓噷鍘绘坊鍔犲埌鐩爣浠撳簱
resourceStoreInnerServiceSMOImpl.updateResourceStore(resourceStorePo);
-
-
resourceStoreTimesPo = new ResourceStoreTimesPo();
resourceStoreTimesPo.setPrice(resourceStoreTimesDtoAs.get(0).getPrice());
resourceStoreTimesPo.setShId(resourceStoreDtoZs.get(0).getShId());
@@ -150,7 +125,5 @@
resourceStoreTimesPo.setApplyOrderId(tmpAllocationStorehouseDto.getApplyId());
resourceStoreTimesV1InnerServiceSMOImpl.saveOrUpdateResourceStoreTimes(resourceStoreTimesPo);
// todo -------------------------------------------------鐩爣浠撳簱涓仛澧炲姞 (end)-----------------------------------------------------//
-
-
}
}
--
Gitblit v1.8.0