|
@ -761,6 +761,24 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
String deviceID = "";
|
|
String deviceID = "";
|
|
|
|
|
|
//true,标识当前操作为合并货道操作
|
|
//true,标识当前操作为合并货道操作
|
|
|
|
|
|
|
|
MedicineDrugInventoryRecord inventoryModifyRecord = null;
|
|
|
|
boolean modifyRecordFlag = false;
|
|
|
|
List<String> mergeCargoS = new ArrayList<>();
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(cargoIds)){
|
|
|
|
modifyRecordFlag = true;
|
|
|
|
inventoryModifyRecord = new MedicineDrugInventoryRecord();
|
|
|
|
inventoryModifyRecord.setOldDrugId(null);
|
|
|
|
inventoryModifyRecord.setDrugId(null);
|
|
|
|
inventoryModifyRecord.setMergeState(isMerge?"2":"1");
|
|
|
|
inventoryModifyRecord.setOldQuantity(null);
|
|
|
|
inventoryModifyRecord.setQuantity(null);
|
|
|
|
inventoryModifyRecord.setCreateUser(userId);
|
|
|
|
inventoryModifyRecord.setCreateTime(new Date());
|
|
|
|
inventoryModifyRecord.setType("5");
|
|
|
|
}
|
|
|
|
/**货到状态操作日志**/
|
|
|
|
|
|
if (isMerge) {
|
|
if (isMerge) {
|
|
String[] cargoIdArray = cargoIds.split(",");
|
|
String[] cargoIdArray = cargoIds.split(",");
|
|
changedCargoNumber = cargoIdArray.length - 1;
|
|
changedCargoNumber = cargoIdArray.length - 1;
|
|
@ -780,6 +798,14 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
for (String cargoId : cargoIdArray) {
|
|
for (String cargoId : cargoIdArray) {
|
|
if(!StringUtils.isEmpty(cargoId)){
|
|
if(!StringUtils.isEmpty(cargoId)){
|
|
MediicinecabinetInventory inventory = inventoryDao.findOne(cargoId);
|
|
MediicinecabinetInventory inventory = inventoryDao.findOne(cargoId);
|
|
|
|
mergeCargoS.add(inventory.getWayerNo());
|
|
|
|
if (modifyRecordFlag){
|
|
|
|
inventoryModifyRecord.setDeviceId(inventory.getIdDevice());
|
|
|
|
inventoryModifyRecord.setEquNum(inventory.getEquNum());
|
|
|
|
inventoryModifyRecord.setLayerNo(inventory.getLayerNo());
|
|
|
|
inventoryModifyRecord.setWayerNo(inventory.getWayerNo());
|
|
|
|
}
|
|
|
|
|
|
//有药品记录下架操作
|
|
//有药品记录下架操作
|
|
if (inventory.getOrgCode() != null && inventory.getDrugCode() != null) {
|
|
if (inventory.getOrgCode() != null && inventory.getDrugCode() != null) {
|
|
MedicineDrugInventoryRecord inventoryRecord = new MedicineDrugInventoryRecord();
|
|
MedicineDrugInventoryRecord inventoryRecord = new MedicineDrugInventoryRecord();
|
|
@ -827,6 +853,14 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
MediicinecabinetInventory inventory = inventoryDao.findOne(cargoIds);
|
|
MediicinecabinetInventory inventory = inventoryDao.findOne(cargoIds);
|
|
|
|
mergeCargoS.add(inventory.getWayerNo());
|
|
|
|
if (modifyRecordFlag){
|
|
|
|
inventoryModifyRecord.setDeviceId(inventory.getIdDevice());
|
|
|
|
inventoryModifyRecord.setEquNum(inventory.getEquNum());
|
|
|
|
inventoryModifyRecord.setLayerNo(inventory.getLayerNo());
|
|
|
|
inventoryModifyRecord.setWayerNo(inventory.getWayerNo());
|
|
|
|
}
|
|
|
|
|
|
//所有有关分解的货道列表
|
|
//所有有关分解的货道列表
|
|
List<MediicinecabinetInventory> list = inventoryDao.findMediicinecabinetInventoriesByLayerNoAndMerge(inventory.getLayerNo(), inventory.getMerge());
|
|
List<MediicinecabinetInventory> list = inventoryDao.findMediicinecabinetInventoriesByLayerNoAndMerge(inventory.getLayerNo(), inventory.getMerge());
|
|
|
|
|
|
@ -888,7 +922,10 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
}
|
|
}
|
|
deviceDao.save(mediicinedevice);
|
|
deviceDao.save(mediicinedevice);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (null!=inventoryModifyRecord){
|
|
|
|
inventoryModifyRecord.setMergeCargo(mergeCargoS.stream().map(String::valueOf).collect(Collectors.joining(",")));
|
|
|
|
inventoryRecordDao.save(inventoryModifyRecord);
|
|
|
|
}
|
|
result.put("response",ConstantUtils.SUCCESS);
|
|
result.put("response",ConstantUtils.SUCCESS);
|
|
return result.toJSONString();
|
|
return result.toJSONString();
|
|
}
|
|
}
|