|
|
|
@ -6,15 +6,13 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.dreamchaser.depository_manage.entity.*; |
|
|
|
import com.dreamchaser.depository_manage.mapper.*; |
|
|
|
import com.dreamchaser.depository_manage.pojo.InventoryP; |
|
|
|
import com.dreamchaser.depository_manage.pojo.MaterialAndPlaceForView; |
|
|
|
import com.dreamchaser.depository_manage.pojo.MaterialAndPlaceForViewP; |
|
|
|
import com.dreamchaser.depository_manage.pojo.MaterialP; |
|
|
|
import com.dreamchaser.depository_manage.pojo.PlaceP; |
|
|
|
import com.dreamchaser.depository_manage.service.*; |
|
|
|
import com.dreamchaser.depository_manage.utils.DateUtil; |
|
|
|
import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; |
|
|
|
import lombok.Data; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.data.redis.core.RedisOperations; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@ -537,8 +535,8 @@ public class MaterialServiceImpl implements MaterialService { |
|
|
|
|
|
|
|
double quantity = 0; |
|
|
|
// 获取该物料在该仓库下的映射关系
|
|
|
|
List<MaterialAndPlaceForView> placeAndMaterialByDidAndMid = placeService.findPlaceAndMaterialByDidAndMid(depositoryId, groupInfo.getMid()); |
|
|
|
for (MaterialAndPlaceForView materialAndPlaceForView : placeAndMaterialByDidAndMid) { |
|
|
|
List<MaterialAndPlaceForViewP> placeAndMaterialByDidAndMid = placeService.findPlaceAndMaterialByDidAndMid(depositoryId, groupInfo.getMid()); |
|
|
|
for (MaterialAndPlaceForViewP materialAndPlaceForView : placeAndMaterialByDidAndMid) { |
|
|
|
paramForSplitInventory.put("iid", materialAndPlaceForView.getId()); |
|
|
|
MaterialAndPlace materialAndPlace = new MaterialAndPlace(); |
|
|
|
materialAndPlace.setQuantity((int)(materialAndPlaceForView.getInventory() / 100)); |
|
|
|
@ -563,15 +561,18 @@ public class MaterialServiceImpl implements MaterialService { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<MaterialAndPlaceForView> findInventoryByMidAndDepository(Map<String, Object> map, List<Integer> depositoryList) { |
|
|
|
public List<MaterialAndPlaceForViewP> findInventoryByMidAndDepository(Map<String, Object> map, List<Integer> depositoryList) { |
|
|
|
Integer mid = ObjectFormatUtil.toInteger(map.get("mid")); |
|
|
|
// 获取当前物料的所有拆单记录
|
|
|
|
List<SplitInfo> splitInfoList = splitUnitMapper.findSplitInfoByMid(mid); |
|
|
|
// 定义参数用于获取当前物料在仓库下的各库位记录
|
|
|
|
List<MaterialAndPlaceForView> placeAndMaterialByDidsAndMid = placeService.findPlaceAndMaterialByDidsAndMid(depositoryList, map); |
|
|
|
List<MaterialAndPlaceForViewP> placeAndMaterialByDidsAndMid = placeService.findPlaceAndMaterialByDidsAndMid(depositoryList, map); |
|
|
|
if (placeAndMaterialByDidsAndMid.size() > 0) { |
|
|
|
// 如果存在库存记录
|
|
|
|
|
|
|
|
for (MaterialAndPlaceForViewP materialByDidsAndMid:placeAndMaterialByDidsAndMid |
|
|
|
) { |
|
|
|
materialByDidsAndMid.setInventory(materialByDidsAndMid.getInventory() / 100); |
|
|
|
} |
|
|
|
return packMpvList(placeAndMaterialByDidsAndMid, map); |
|
|
|
} |
|
|
|
|
|
|
|
@ -2606,7 +2607,7 @@ public class MaterialServiceImpl implements MaterialService { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<MaterialAndPlaceForView> findInventoryForStockTaking(Map<String, Object> map) { |
|
|
|
public List<MaterialAndPlaceForViewP> findInventoryForStockTaking(Map<String, Object> map) { |
|
|
|
Integer size = 10, page = 1; |
|
|
|
if (map.containsKey("size")) { |
|
|
|
size = ObjectFormatUtil.toInteger(map.get("size")); |
|
|
|
@ -2620,13 +2621,17 @@ public class MaterialServiceImpl implements MaterialService { |
|
|
|
if (Integer.compare(placeId, 0) == 0) { |
|
|
|
map.remove("placeId"); |
|
|
|
} |
|
|
|
List<MaterialAndPlaceForView> placeAndMaterialByCondition = placeService.findPlaceAndMaterialByCondition(map); |
|
|
|
List<MaterialAndPlaceForViewP> placeAndMaterialByCondition = placeService.findPlaceAndMaterialByCondition(map); |
|
|
|
for (MaterialAndPlaceForViewP placeAndPlaceForViewP:placeAndMaterialByCondition |
|
|
|
) { |
|
|
|
placeAndPlaceForViewP.setInventory(placeAndPlaceForViewP.getInventory() / 100); |
|
|
|
} |
|
|
|
return packMpvList(placeAndMaterialByCondition, map); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<MaterialAndPlaceForView> packMpvList(List<MaterialAndPlaceForView> materialAndPlaceForViewList, Map<String, Object> map) { |
|
|
|
for (MaterialAndPlaceForView mpv : materialAndPlaceForViewList |
|
|
|
List<MaterialAndPlaceForViewP> packMpvList(List<MaterialAndPlaceForViewP> materialAndPlaceForViewList, Map<String, Object> map) { |
|
|
|
for (MaterialAndPlaceForViewP mpv : materialAndPlaceForViewList |
|
|
|
) { |
|
|
|
// 获取其对应的拆单记录
|
|
|
|
List<SplitInfo> list = splitUnitMapper.findSplitInfoByMid(mpv.getMid()); |
|
|
|
|