|
@ -693,15 +693,26 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
for (String deviceId : cargoIds.split(",")) {
|
|
|
if(!StringUtils.isEmpty(deviceId)){
|
|
|
MediicinecabinetInventory inventory = inventoryDao.findOne(deviceId);
|
|
|
deviceID = inventory.getIdDevice();
|
|
|
inventory.setMerge(inventory.getWayerNo());
|
|
|
inventory.setState("1");
|
|
|
inventoryDao.save(inventory);
|
|
|
}
|
|
|
}
|
|
|
//因为拆分,前台就传了主货道的, so就查,主货道id吧,
|
|
|
MediicinecabinetInventory inventory = inventoryDao.findOne(cargoIds);
|
|
|
List<MediicinecabinetInventory> list = inventoryDao.findMediicinecabinetInventoriesByLayerNoAndMerge(inventory.getLayerNo(), inventory.getMerge());
|
|
|
inventory.setMerge(inventory.getWayerNo());
|
|
|
inventory.setState("1");
|
|
|
inventoryDao.save(inventory);
|
|
|
for (MediicinecabinetInventory mediicinecabinetInventory : list) {
|
|
|
mediicinecabinetInventory.setMerge(mediicinecabinetInventory.getWayerNo());
|
|
|
mediicinecabinetInventory.setState("1");
|
|
|
inventoryDao.save(mediicinecabinetInventory);
|
|
|
}
|
|
|
// for (String deviceId : cargoIds.split(",")) {
|
|
|
// if(!StringUtils.isEmpty(deviceId)){
|
|
|
// MediicinecabinetInventory inventory = inventoryDao.findOne(deviceId);
|
|
|
// deviceID = inventory.getIdDevice();
|
|
|
// inventory.setMerge(inventory.getWayerNo());
|
|
|
// inventory.setState("1");
|
|
|
// inventoryDao.save(inventory);
|
|
|
// }
|
|
|
// }
|
|
|
}
|
|
|
Mediicinedevice mediicinedevice = deviceDao.findOne(deviceID);
|
|
|
if (mediicinedevice != null) {
|
|
@ -2127,6 +2138,23 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
stringObjectMap.put("cardStatusName", "未知");
|
|
|
}
|
|
|
}
|
|
|
String tempSql = "SELECT\n" +
|
|
|
"\tIFNULL(\n" +
|
|
|
"\t\t(\n" +
|
|
|
"\t\t\tSELECT\n" +
|
|
|
"\t\t\t\tsum(t.qty)\n" +
|
|
|
"\t\t\tFROM\n" +
|
|
|
"\t\t\t\tt_mediicinecabinet_inventory t\n" +
|
|
|
"\t\t\tWHERE\n" +
|
|
|
"\t\t\t\tt.id_device = '"+stringObjectMap.get("id").toString()+"'\n" +
|
|
|
"\t\t\tAND (t.state = '1' OR t.state = '21')\n" +
|
|
|
"\t\t\tAND t.shelf_status = '1'\n" +
|
|
|
"\t\t),\n" +
|
|
|
"\t\t0\n" +
|
|
|
"\t)";
|
|
|
int inStock = jdbcTemplate.queryForObject(tempSql, Integer.class);
|
|
|
//在架库存数
|
|
|
stringObjectMap.put("shangPinKuCun", inStock);
|
|
|
}
|
|
|
String countSql = " select " +
|
|
|
" COUNT(DISTINCT (t.id)) as count " +
|
|
@ -2324,6 +2352,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
inventoryRecordDao.findMedicineDrugInventoryRecordsByDeviceIdAndEquNumAndType(
|
|
|
stringObjectMap.get("id").toString(),
|
|
|
stringObjectMap.get("equNum").toString(), type));
|
|
|
|
|
|
}
|
|
|
String countSql = " select " +
|
|
|
" COUNT(DISTINCT (t.id)) as count " +
|