|
|
@ -641,13 +641,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 将物料入库到库位 |
|
|
* 将物料入库到库位 |
|
|
* |
|
|
* @param isApprovalPass 判断是否为审批完成时调用,true为审批通过后调用,false为正常调用 |
|
|
* @param map |
|
|
* @param map |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Integer applicationInPlace(Map<String, Object> map) { |
|
|
public Integer applicationInPlace(Map<String, Object> map,boolean isApprovalPass) { |
|
|
Integer placeId = ObjectFormatUtil.toInteger(map.get("placeId")); |
|
|
Integer placeId = ObjectFormatUtil.toInteger(map.get("placeId")); |
|
|
if (placeId == null) { |
|
|
if (placeId == null) { |
|
|
placeId = 0; |
|
|
placeId = 0; |
|
|
@ -668,6 +668,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
if (depositoryListForIn.size() > 0) { |
|
|
if (depositoryListForIn.size() > 0) { |
|
|
flagForApproval = true; |
|
|
flagForApproval = true; |
|
|
} |
|
|
} |
|
|
|
|
|
if(isApprovalPass){ |
|
|
|
|
|
if(flagForApproval){ |
|
|
|
|
|
flagForApproval = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
map.put("flagForApproval", flagForApproval); |
|
|
map.put("flagForApproval", flagForApproval); |
|
|
|
|
|
|
|
|
if (placeById.getMax() - placeById.getQuantity() > quantity) { |
|
|
if (placeById.getMax() - placeById.getQuantity() > quantity) { |
|
|
@ -1675,9 +1680,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
managerSplit = new String[0]; |
|
|
managerSplit = new String[0]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
for (int i = 0; i < managerSplit.length; i++) { |
|
|
for (String item : managerSplit) { |
|
|
// 删除其他管理员的订单记录
|
|
|
// 删除其他管理员的订单记录
|
|
|
String otherManager = "user:" + managerSplit[i]; |
|
|
String otherManager = "user:" + item; |
|
|
String minRecord = (String) redisTemplate.opsForHash().get(otherManager, "minRecord"); |
|
|
String minRecord = (String) redisTemplate.opsForHash().get(otherManager, "minRecord"); |
|
|
// 删除其他管理员中当前已完成的订单
|
|
|
// 删除其他管理员中当前已完成的订单
|
|
|
if (minRecord == null) { |
|
|
if (minRecord == null) { |
|
|
@ -2052,6 +2057,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
* @param spStatus 审批状态 |
|
|
* @param spStatus 审批状态 |
|
|
* @param spNo 审批订单号 |
|
|
* @param spNo 审批订单号 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Override |
|
|
@Override |
|
|
public void reviewByQyWxApprovalIn(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent, String spStatus, String spNo) { |
|
|
public void reviewByQyWxApprovalIn(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent, String spStatus, String spNo) { |
|
|
// 获取当前入库订单id
|
|
|
// 获取当前入库订单id
|
|
|
@ -2068,20 +2074,31 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
map.put("approverTime", System.currentTimeMillis()); |
|
|
map.put("approverTime", System.currentTimeMillis()); |
|
|
|
|
|
|
|
|
// 如果同意
|
|
|
// 如果同意
|
|
|
for (String sid : split |
|
|
for (String sid : split) |
|
|
) { |
|
|
{ |
|
|
if ("2".equals(spStatus)) { |
|
|
if ("2".equals(spStatus)) { |
|
|
map.put("approverPass", 1); |
|
|
map.put("approverPass", 1); |
|
|
|
|
|
map.put("state","已入库"); |
|
|
} else { |
|
|
} else { |
|
|
// 如果驳回
|
|
|
// 如果驳回
|
|
|
|
|
|
map.put("state","驳回"); |
|
|
map.put("approverPass", 2); |
|
|
map.put("approverPass", 2); |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!"".equals(sid)) { |
|
|
if (!"".equals(sid)) { |
|
|
Integer id = ObjectFormatUtil.toInteger(sid); |
|
|
Integer id = ObjectFormatUtil.toInteger(sid.trim()); |
|
|
// 获取具体入库订单
|
|
|
// 获取具体入库订单
|
|
|
ApplicationInRecordP recordP = depositoryRecordMapper.findApplicationInRecordPById(id); |
|
|
ApplicationInRecordP recordP = depositoryRecordMapper.findApplicationInRecordPById(id); |
|
|
// 获取当前入库对应的物料
|
|
|
// 获取当前入库对应的物料
|
|
|
Material materialById = materialMapper.findMaterialById(recordP.getMid()); |
|
|
Material materialById = materialMapper.findMaterialById(recordP.getMid()); |
|
|
|
|
|
|
|
|
|
|
|
// 用于调用入库方法而创建的
|
|
|
|
|
|
Map<String, Object> paramForUpdateInventory = new HashMap<>(); |
|
|
|
|
|
paramForUpdateInventory.put("mid", recordP.getMid()); |
|
|
|
|
|
paramForUpdateInventory.put("quantity", recordP.getQuantity()); |
|
|
|
|
|
paramForUpdateInventory.put("depositoryId", recordP.getDepositoryId()); |
|
|
|
|
|
paramForUpdateInventory.put("placeId", recordP.getPlaceId()); |
|
|
if (materialById.getUnit().equals(recordP.getAirUnit())) { |
|
|
if (materialById.getUnit().equals(recordP.getAirUnit())) { |
|
|
// 如果是基础单位
|
|
|
// 如果是基础单位
|
|
|
|
|
|
|
|
|
@ -2092,11 +2109,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 判断该仓库中有无该物物料
|
|
|
// 判断该仓库中有无该物物料
|
|
|
List<Inventory> materialByCondition = materialMapper.findInventory(param); |
|
|
List<Inventory> materialByCondition = materialMapper.findInventory(param); |
|
|
|
|
|
|
|
|
// 用于调用入库方法而创建的
|
|
|
|
|
|
Map<String, Object> paramForUpdateInventory = new HashMap<>(); |
|
|
|
|
|
paramForUpdateInventory.put("mid", recordP.getMid()); |
|
|
|
|
|
paramForUpdateInventory.put("quantity", recordP.getQuantity()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 修改仓库库存
|
|
|
// 修改仓库库存
|
|
|
Long mproducedDate = recordP.getMproducedDate(); |
|
|
Long mproducedDate = recordP.getMproducedDate(); |
|
|
@ -2108,7 +2120,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
paramForUpdateInventory.put("newInMid", newMid); |
|
|
paramForUpdateInventory.put("newInMid", newMid); |
|
|
paramForUpdateInventory.put("id", recordP.getId()); |
|
|
paramForUpdateInventory.put("id", recordP.getId()); |
|
|
paramForUpdateInventory.put("producedDate", recordP.getMproducedDate()); |
|
|
paramForUpdateInventory.put("producedDate", recordP.getMproducedDate()); |
|
|
paramForUpdateInventory.put("depositoryId", recordP.getDepositoryId()); |
|
|
|
|
|
Place placeById = placeMapper.findPlaceById(recordP.getPlaceId()); |
|
|
Place placeById = placeMapper.findPlaceById(recordP.getPlaceId()); |
|
|
updateInventoryInfoForApproval(paramForUpdateInventory, recordP.getQuantity(), materialById, placeById); |
|
|
updateInventoryInfoForApproval(paramForUpdateInventory, recordP.getQuantity(), materialById, placeById); |
|
|
} else { |
|
|
} else { |
|
|
@ -2131,6 +2142,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
MaterialAndPlace placeAndMaterialByMidAndPid = null; |
|
|
MaterialAndPlace placeAndMaterialByMidAndPid = null; |
|
|
// 用于存储拆单库存处理操作的数据
|
|
|
// 用于存储拆单库存处理操作的数据
|
|
|
Map<String, Object> paramForInsertSplitInventory = new HashMap<>(); |
|
|
Map<String, Object> paramForInsertSplitInventory = new HashMap<>(); |
|
|
|
|
|
paramForInsertSplitInventory.put("sid",splitInfoForUnit.getId()); |
|
|
|
|
|
|
|
|
Map<String, Object> paramForInventory = new HashMap<>(); |
|
|
Map<String, Object> paramForInventory = new HashMap<>(); |
|
|
paramForInventory.put("depositoryId", recordP.getDepositoryId()); |
|
|
paramForInventory.put("depositoryId", recordP.getDepositoryId()); |
|
|
@ -2154,9 +2166,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
splitInventory = splitUnitMapper.findSplitInventoryByIidAndSid(paramForInsertSplitInventory); |
|
|
splitInventory = splitUnitMapper.findSplitInventoryByIidAndSid(paramForInsertSplitInventory); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
splitUnitService.realInInventoryToDepository((double) recordP.getQuantity(), splitInventory, paramForUpdateInventory, splitInfoForUnit, placeAndMaterialByMidAndPid,true); |
|
|
splitUnitService.realInInventoryToDepository((double) recordP.getQuantity(), splitInventory, map, splitInfoForUnit, placeAndMaterialByMidAndPid); |
|
|
if(paramForUpdateInventory.containsKey("applicationInId")){ |
|
|
|
|
|
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(paramForUpdateInventory.get("applicationInId"))); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -2758,7 +2771,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 进行入库操作
|
|
|
// 进行入库操作
|
|
|
applicationInPlace(map); |
|
|
applicationInPlace(map,false); |
|
|
} else { |
|
|
} else { |
|
|
// 如果不在该仓库,插入一条新记录
|
|
|
// 如果不在该仓库,插入一条新记录
|
|
|
Map<String, Object> insert = new HashMap<>(); |
|
|
Map<String, Object> insert = new HashMap<>(); |
|
|
@ -2906,7 +2919,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); |
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); |
|
|
splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterial.getId(), map, quantity, splitInfo); |
|
|
splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterial.getId(), map, quantity, splitInfo); |
|
|
} else { |
|
|
} else { |
|
|
applicationInPlace(map); |
|
|
applicationInPlace(map,false); |
|
|
map.put("applicationInId", map.get("id")); |
|
|
map.put("applicationInId", map.get("id")); |
|
|
map.remove("id"); |
|
|
map.remove("id"); |
|
|
} |
|
|
} |
|
|
@ -2984,7 +2997,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); |
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); |
|
|
splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterial.getId(), map, quantity, splitInfo); |
|
|
splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, placeAndMaterial.getId(), map, quantity, splitInfo); |
|
|
} else { |
|
|
} else { |
|
|
applicationInPlace(map); |
|
|
applicationInPlace(map,false); |
|
|
map.put("applicationInId", map.get("id")); |
|
|
map.put("applicationInId", map.get("id")); |
|
|
map.remove("id"); |
|
|
map.remove("id"); |
|
|
} |
|
|
} |
|
|
@ -3143,7 +3156,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); |
|
|
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfo.getParentId()); |
|
|
splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, ObjectFormatUtil.toInteger(insertForMaterialAndPlace.get("id")), map, quantity, splitInfo); |
|
|
splitUnitService.updateSplitInfoSaveQuantity(parentSplitInfo, disposeQuantity, ObjectFormatUtil.toInteger(insertForMaterialAndPlace.get("id")), map, quantity, splitInfo); |
|
|
} else { |
|
|
} else { |
|
|
applicationInPlace(map); |
|
|
applicationInPlace(map,false); |
|
|
map.put("applicationInId", map.get("id")); |
|
|
map.put("applicationInId", map.get("id")); |
|
|
map.remove("id"); |
|
|
map.remove("id"); |
|
|
} |
|
|
} |
|
|
|