|
|
|
@ -2,6 +2,7 @@ package com.dreamchaser.depository_manage.service.impl; |
|
|
|
|
|
|
|
import com.dreamchaser.depository_manage.entity.*; |
|
|
|
import com.dreamchaser.depository_manage.mapper.*; |
|
|
|
import com.dreamchaser.depository_manage.pojo.RoleAndDepository; |
|
|
|
import com.dreamchaser.depository_manage.pojo.SplitInfoP; |
|
|
|
import com.dreamchaser.depository_manage.service.DepositoryRecordService; |
|
|
|
import com.dreamchaser.depository_manage.service.SplitUnitService; |
|
|
|
@ -39,6 +40,10 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
DepositoryRecordMapper depositoryRecordMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
RoleMapper roleMapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 用于添加一条拆单记录 |
|
|
|
* |
|
|
|
@ -83,6 +88,15 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
SplitInfo splitInfoForUnit = splitUnitMapper.findSplitInfoByMidAndUnit(paramForSplitInfo); |
|
|
|
|
|
|
|
|
|
|
|
// 获取当前仓库是否有用户进行管理入库审批
|
|
|
|
List<RoleAndDepository> roleAndDepositoryByCondition = roleMapper.findRoleAndDepositoryByDepositoryIdForIn(ObjectFormatUtil.toInteger(map.get("depositoryId"))); |
|
|
|
// 用于标志该仓库是否需要进行审批
|
|
|
|
boolean flagForApproval = false; // 默认不需要
|
|
|
|
if (roleAndDepositoryByCondition.size() > 0) { |
|
|
|
flagForApproval = true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 用于存储最终计算结果
|
|
|
|
Integer result = 0; |
|
|
|
|
|
|
|
@ -148,167 +162,187 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
|
|
|
|
// 获取要操作的数量
|
|
|
|
Double quantity = ObjectFormatUtil.toDouble(map.get("quantity")); |
|
|
|
if ("in".equals(type)) { |
|
|
|
// 如果是入库操作
|
|
|
|
if ("in".equals(type) && !flagForApproval) { |
|
|
|
// 如果是入库并且不需要审批
|
|
|
|
result = realInInventoryToDepository(quantity, splitInventory, map, splitInfoForUnit, placeAndMaterialByMidAndPid); |
|
|
|
map.remove("applicationInId"); |
|
|
|
}else if("in".equals(type)){ |
|
|
|
// 如果是入库且需要审批
|
|
|
|
result = depositoryRecordService.applicationIn(map); |
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
|
|
|
|
// 计算处理数量(下取整)
|
|
|
|
int disposeQuantity = (int) Math.round(Math.floor(quantity / scale)); |
|
|
|
} |
|
|
|
|
|
|
|
// 最终存储到拆单处理的数量
|
|
|
|
double saveQuantity = quantity - disposeQuantity * scale; |
|
|
|
} |
|
|
|
|
|
|
|
if (splitInventory != null) { |
|
|
|
// 如果有过记录
|
|
|
|
return result; |
|
|
|
|
|
|
|
// 最终存储数量
|
|
|
|
int realQuantity = (int) Math.round(saveQuantity) + splitInventory.getSaveQuantity(); |
|
|
|
if (realQuantity >= scale) { |
|
|
|
// 如果当前入库的数量大于拆单规定的进制数量
|
|
|
|
} |
|
|
|
|
|
|
|
// 计算要进的数目
|
|
|
|
int quantity_in = (realQuantity / scale); |
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
// 拆单库存实际入库的数量
|
|
|
|
realQuantity = realQuantity - quantity_in * scale; |
|
|
|
} |
|
|
|
// 设置当前计量单位的库存
|
|
|
|
splitInventory.setSaveQuantity(realQuantity); |
|
|
|
// 设置当前计量单位的入库数目
|
|
|
|
if (splitInventory.getInQuantity() != null) { |
|
|
|
// 如果当前库存不为空
|
|
|
|
splitInventory.setInQuantity((int) Math.round(splitInventory.getInQuantity() + quantity)); |
|
|
|
} else { |
|
|
|
splitInventory.setInQuantity((int) Math.round(quantity)); |
|
|
|
|
|
|
|
} |
|
|
|
result += splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
|
Integer realInInventoryToDepository(Double quantity, SplitInventory splitInventory, Map<String, Object> map, SplitInfo splitInfoForUnit, MaterialAndPlace placeAndMaterialByMidAndPid) { |
|
|
|
Integer result = 0; |
|
|
|
|
|
|
|
if (disposeQuantity != 0) { |
|
|
|
// 用于更改库存的数量
|
|
|
|
map.put("quantity", String.valueOf(disposeQuantity)); |
|
|
|
// 获取当前进制
|
|
|
|
Integer scale = splitInfoForUnit.getQuantity(); |
|
|
|
|
|
|
|
} else { |
|
|
|
map.put("quantity", "0"); |
|
|
|
} |
|
|
|
// 实际入库数量
|
|
|
|
map.put("realQuantity", quantity.toString()); |
|
|
|
if (splitInfoForUnit.getParentId() != null) { |
|
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfoForUnit.getParentId()); |
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); |
|
|
|
// 用于存储拆单库存处理操作的数据
|
|
|
|
Map<String, Object> paramForInsertSplitInventory = new HashMap<>(); |
|
|
|
paramForInsertSplitInventory.put("sid", splitInfoForUnit.getId()); |
|
|
|
|
|
|
|
// 如果是入库操作
|
|
|
|
|
|
|
|
// 计算处理数量(下取整)
|
|
|
|
int disposeQuantity = (int) Math.round(Math.floor(quantity / scale)); |
|
|
|
|
|
|
|
// 最终存储到拆单处理的数量
|
|
|
|
double saveQuantity = quantity - disposeQuantity * scale; |
|
|
|
|
|
|
|
if (splitInventory != null) { |
|
|
|
// 如果有过记录
|
|
|
|
|
|
|
|
// 最终存储数量
|
|
|
|
int realQuantity = (int) Math.round(saveQuantity) + splitInventory.getSaveQuantity(); |
|
|
|
if (realQuantity >= scale) { |
|
|
|
// 如果当前入库的数量大于拆单规定的进制数量
|
|
|
|
|
|
|
|
// 计算要进的数目
|
|
|
|
int quantity_in = (realQuantity / scale); |
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
// 拆单库存实际入库的数量
|
|
|
|
realQuantity = realQuantity - quantity_in * scale; |
|
|
|
} |
|
|
|
// 设置当前计量单位的库存
|
|
|
|
splitInventory.setSaveQuantity(realQuantity); |
|
|
|
// 设置当前计量单位的入库数目
|
|
|
|
if (splitInventory.getInQuantity() != null) { |
|
|
|
// 如果当前库存不为空
|
|
|
|
splitInventory.setInQuantity((int) Math.round(splitInventory.getInQuantity() + quantity)); |
|
|
|
} else { |
|
|
|
splitInventory.setInQuantity((int) Math.round(quantity)); |
|
|
|
|
|
|
|
} |
|
|
|
result += splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
|
|
|
|
|
if (disposeQuantity != 0) { |
|
|
|
// 用于更改库存的数量
|
|
|
|
map.put("quantity", String.valueOf(disposeQuantity)); |
|
|
|
|
|
|
|
} else { |
|
|
|
map.put("quantity", "0"); |
|
|
|
} |
|
|
|
// 实际入库数量
|
|
|
|
map.put("realQuantity", quantity.toString()); |
|
|
|
if (splitInfoForUnit.getParentId() != null) { |
|
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfoForUnit.getParentId()); |
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); |
|
|
|
} else { |
|
|
|
map.put("price", Double.toString(0)); |
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
// 如果没有记录
|
|
|
|
|
|
|
|
// 获取当前拆单记录的父级
|
|
|
|
Integer parentId = splitInfoForUnit.getParentId(); |
|
|
|
|
|
|
|
if (disposeQuantity != 0) { |
|
|
|
// 用于更改库存的数量
|
|
|
|
map.put("quantity", String.valueOf(disposeQuantity)); |
|
|
|
} else { |
|
|
|
map.put("quantity", "0"); |
|
|
|
} |
|
|
|
|
|
|
|
// 实际入库数量
|
|
|
|
map.put("realQuantity", quantity.toString()); |
|
|
|
|
|
|
|
if (disposeQuantity > splitInfoForUnit.getQuantity()) { |
|
|
|
//如果当前处理数量大于设置的进制数量
|
|
|
|
|
|
|
|
|
|
|
|
if (parentId != null) { |
|
|
|
// 如果该记录有父级拆单
|
|
|
|
|
|
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(parentId); |
|
|
|
if (placeAndMaterialByMidAndPid != null) { |
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, ObjectFormatUtil.toInteger(String.valueOf(saveQuantity)), placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); |
|
|
|
} else { |
|
|
|
map.put("price", Double.toString(0)); |
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
result += depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
Map<String, Object> paramForInventoryToPlace = new HashMap<>(); |
|
|
|
paramForInventoryToPlace.put("mid", map.get("newInMid")); |
|
|
|
paramForInventoryToPlace.put("pid", map.get("placeId")); |
|
|
|
placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(paramForInventoryToPlace); |
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, ObjectFormatUtil.toInteger(String.valueOf(saveQuantity)), placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("price", Double.toString(0)); |
|
|
|
result += depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 如果不大于设置的进制数量
|
|
|
|
|
|
|
|
paramForInsertSplitInventory.put("inQuantity", quantity); |
|
|
|
paramForInsertSplitInventory.put("outQuantity", 0); |
|
|
|
paramForInsertSplitInventory.put("saveQuantity", saveQuantity); |
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
// 如果没有记录
|
|
|
|
if (placeAndMaterialByMidAndPid != null) { |
|
|
|
// 如果有库存记录
|
|
|
|
paramForInsertSplitInventory.put("iid", placeAndMaterialByMidAndPid.getId()); |
|
|
|
} else { |
|
|
|
// 如果没有库存记录
|
|
|
|
|
|
|
|
// 获取当前拆单记录的父级
|
|
|
|
Integer parentId = splitInfoForUnit.getParentId(); |
|
|
|
// 插入一条库存记录
|
|
|
|
map.put("price", Double.toString(0)); |
|
|
|
|
|
|
|
if (disposeQuantity != 0) { |
|
|
|
// 用于更改库存的数量
|
|
|
|
map.put("quantity", String.valueOf(disposeQuantity)); |
|
|
|
} else { |
|
|
|
|
|
|
|
if (parentId != null) { |
|
|
|
// 如果有父级
|
|
|
|
|
|
|
|
// 先插入一条库存记录用于后续操作
|
|
|
|
map.put("quantity", "0"); |
|
|
|
} |
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); |
|
|
|
map.remove("id"); |
|
|
|
|
|
|
|
// 实际入库数量
|
|
|
|
map.put("realQuantity", quantity.toString()); |
|
|
|
|
|
|
|
if (disposeQuantity > splitInfoForUnit.getQuantity()) { |
|
|
|
//如果当前处理数量大于设置的进制数量
|
|
|
|
|
|
|
|
|
|
|
|
if (parentId != null) { |
|
|
|
// 如果该记录有父级拆单
|
|
|
|
|
|
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(parentId); |
|
|
|
if (placeAndMaterialByMidAndPid != null) { |
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, ObjectFormatUtil.toInteger(String.valueOf(saveQuantity)), placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); |
|
|
|
} else { |
|
|
|
map.put("price", Double.toString(0)); |
|
|
|
result += depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
Map<String, Object> paramForInventoryToPlace = new HashMap<>(); |
|
|
|
paramForInventoryToPlace.put("mid", map.get("newInMid")); |
|
|
|
paramForInventoryToPlace.put("pid", map.get("placeId")); |
|
|
|
placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(paramForInventoryToPlace); |
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, ObjectFormatUtil.toInteger(String.valueOf(saveQuantity)), placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); |
|
|
|
} |
|
|
|
} else { |
|
|
|
map.put("price", Double.toString(0)); |
|
|
|
result += depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
// 如果不大于设置的进制数量
|
|
|
|
|
|
|
|
paramForInsertSplitInventory.put("inQuantity", quantity); |
|
|
|
paramForInsertSplitInventory.put("outQuantity", 0); |
|
|
|
paramForInsertSplitInventory.put("saveQuantity", saveQuantity); |
|
|
|
|
|
|
|
if (placeAndMaterialByMidAndPid != null) { |
|
|
|
// 如果有库存记录
|
|
|
|
paramForInsertSplitInventory.put("iid", placeAndMaterialByMidAndPid.getId()); |
|
|
|
} else { |
|
|
|
// 如果没有库存记录
|
|
|
|
|
|
|
|
// 插入一条库存记录
|
|
|
|
map.put("price", Double.toString(0)); |
|
|
|
|
|
|
|
|
|
|
|
if (parentId != null) { |
|
|
|
// 如果有父级
|
|
|
|
|
|
|
|
// 先插入一条库存记录用于后续操作
|
|
|
|
map.put("quantity", "0"); |
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id"))); |
|
|
|
map.remove("id"); |
|
|
|
|
|
|
|
} else { |
|
|
|
// 如果没有父级
|
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
} |
|
|
|
Map<String, Object> paramForInventoryToPlace = new HashMap<>(); |
|
|
|
paramForInventoryToPlace.put("mid", map.get("newInMid")); |
|
|
|
paramForInventoryToPlace.put("pid", map.get("placeId")); |
|
|
|
placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(paramForInventoryToPlace); |
|
|
|
paramForInsertSplitInventory.put("iid", placeAndMaterialByMidAndPid.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
result += splitUnitMapper.addSplitInventory(paramForInsertSplitInventory); |
|
|
|
if (parentId != null) { |
|
|
|
// 获取父级
|
|
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfoForUnit.getParentId()); |
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 如果没有父级
|
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
} |
|
|
|
Map<String, Object> paramForInventoryToPlace = new HashMap<>(); |
|
|
|
paramForInventoryToPlace.put("mid", map.get("newInMid")); |
|
|
|
paramForInventoryToPlace.put("pid", map.get("placeId")); |
|
|
|
placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(paramForInventoryToPlace); |
|
|
|
paramForInsertSplitInventory.put("iid", placeAndMaterialByMidAndPid.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result += splitUnitMapper.addSplitInventory(paramForInsertSplitInventory); |
|
|
|
if (parentId != null) { |
|
|
|
// 获取父级
|
|
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfoForUnit.getParentId()); |
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterialByMidAndPid.getId(), map, quantity.intValue(), splitInfoForUnit); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 用于计算当前拆单单位与目标拆单单位之间的进率 |
|
|
|
* |
|
|
|
@ -344,14 +378,14 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
/** |
|
|
|
* 获取当前拆单与基础拆单之间的库存总额(当前拆单记录为-1是全部库存是使用) |
|
|
|
* |
|
|
|
* @param splitInfoId 当前拆单记录Id |
|
|
|
* @param materialAndPlace 库存记录 |
|
|
|
* @param baseSplitInfoId 基础拆单记录Id |
|
|
|
* @param saveQuantity 最终返回值 |
|
|
|
* @param allQuantityFlag 用于标志是否获取全部库存 |
|
|
|
* @param splitInfoId 当前拆单记录Id |
|
|
|
* @param materialAndPlace 库存记录 |
|
|
|
* @param baseSplitInfoId 基础拆单记录Id |
|
|
|
* @param saveQuantity 最终返回值 |
|
|
|
* @param allQuantityFlag 用于标志是否获取全部库存 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public int findAllInventoryForSplitInfo(Integer splitInfoId, MaterialAndPlace materialAndPlace, Integer baseSplitInfoId, int saveQuantity, boolean allQuantityFlag) { |
|
|
|
public int findAllInventoryForSplitInfo(Integer splitInfoId, MaterialAndPlace materialAndPlace, Integer baseSplitInfoId, int saveQuantity, boolean allQuantityFlag) { |
|
|
|
if (allQuantityFlag) { |
|
|
|
|
|
|
|
// 用于标志是否第一次计算
|
|
|
|
@ -417,8 +451,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果不是获取所有库存
|
|
|
|
// 获取当前基础单位
|
|
|
|
SplitInfo baseSplitInfo = splitUnitMapper.findSplitInfoById(baseSplitInfoId); |
|
|
|
@ -487,6 +520,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 用于查找当前拆单是否正在使用 |
|
|
|
* |
|
|
|
* @param sid 待查询id |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@ -507,10 +541,10 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
/** |
|
|
|
* 用于拆单库存处理记录的修改 |
|
|
|
* |
|
|
|
* @param splitInfo 对应拆单记录 |
|
|
|
* @param quantity 修改数目 |
|
|
|
* @param map 入库条件 |
|
|
|
* @param inQuantity 最终入库数量 |
|
|
|
* @param splitInfo 对应拆单记录 |
|
|
|
* @param quantity 修改数目 |
|
|
|
* @param map 入库条件 |
|
|
|
* @param inQuantity 最终入库数量 |
|
|
|
* @param baseSplitInfo 基础拆单记录 |
|
|
|
*/ |
|
|
|
public void updateSplitInfoSaveQuantity(SplitInfo splitInfo, int quantity, int iid, Map<String, Object> map, int inQuantity, SplitInfo baseSplitInfo) { |
|
|
|
@ -570,11 +604,10 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
// 删除入库订单
|
|
|
|
// depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
|
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 当前库存拆单记录与新入库的数目不大于预设的进制
|
|
|
|
splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() + (int) saveQuantity); |
|
|
|
splitInventory.setInQuantity(splitInventory.getInQuantity() + (int) saveQuantity); |
|
|
|
@ -587,11 +620,10 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
// 删除入库订单
|
|
|
|
// depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
|
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
|
|
|
|
// 如果为空
|
|
|
|
Map<String, Object> paramForInsertSplitInventory = new HashMap<>(); |
|
|
|
@ -617,15 +649,14 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(parentId); |
|
|
|
|
|
|
|
updateSplitInfoSaveQuantity(parentSplitInfo, quantity_scale, iid, map, inQuantity, baseSplitInfo); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
map.put("price", Double.toString(0)); |
|
|
|
map.put("quantity", String.valueOf(quantity_scale)); |
|
|
|
map.put("realQuantity", String.valueOf(inQuantity)); |
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
// 删除入库订单
|
|
|
|
// depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
|
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
@ -638,7 +669,7 @@ public class SplitUnitServiceImpl implements SplitUnitService { |
|
|
|
depositoryRecordService.applicationInPlace(map); |
|
|
|
// 删除入库订单
|
|
|
|
// depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(map.get("id")));
|
|
|
|
map.put("applicationInId",map.get("id")); |
|
|
|
map.put("applicationInId", map.get("id")); |
|
|
|
map.remove("id"); |
|
|
|
|
|
|
|
} |
|
|
|
|