|
@ -650,6 +650,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
result.put("response", ConstantUtils.FAIL);
|
|
|
return result.toJSONString();
|
|
|
}
|
|
|
String deviceID = "";
|
|
|
if (isMerge) {
|
|
|
Boolean isFirst = true;
|
|
|
String wayerNos = "";
|
|
@ -666,8 +667,10 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
MediicinecabinetInventory copyInventory = new MediicinecabinetInventory();
|
|
|
for (String deviceId : cargoIds.split(",")) {
|
|
|
if(!StringUtils.isEmpty(deviceId)){
|
|
|
|
|
|
if (isFirst) {
|
|
|
MediicinecabinetInventory inventory = inventoryDao.findOne(deviceId);
|
|
|
deviceID = inventory.getIdDevice();
|
|
|
copyInventory = inventory;
|
|
|
inventory.setMerge(wayerNos);
|
|
|
inventory.setState("21");
|
|
@ -675,6 +678,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
isFirst = false;
|
|
|
} else {
|
|
|
MediicinecabinetInventory inventory = inventoryDao.findOne(deviceId);
|
|
|
deviceID = inventory.getIdDevice();
|
|
|
inventory.setMerge(wayerNos);
|
|
|
// inventory.setCargoCapacity(copyInventory.getCargoCapacity());
|
|
|
// inventory.setState(copyInventory.getState());
|
|
@ -689,12 +693,25 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
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) {
|
|
|
String tempSql = "SELECT\n" +
|
|
|
"\tCOUNT(DISTINCT(t.id))\n" +
|
|
|
"FROM\n" +
|
|
|
"\tt_mediicinecabinet_inventory t\n" +
|
|
|
"WHERE\n" +
|
|
|
"\tt.id_device = '"+deviceID+"'\n" +
|
|
|
"AND (t.state = '1' OR t.state = '21')";
|
|
|
mediicinedevice.setAisles(String.valueOf(jdbcTemplate.queryForObject(tempSql, Integer.class)));
|
|
|
deviceDao.save(mediicinedevice);
|
|
|
}
|
|
|
result.put("response",ConstantUtils.SUCCESS);
|
|
|
return result.toJSONString();
|
|
|
}
|