|
@ -860,9 +860,10 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
// }
|
|
|
// }
|
|
|
}
|
|
|
//重算货道数
|
|
|
|
|
|
Mediicinedevice mediicinedevice = deviceDao.findOne(deviceID);
|
|
|
if (mediicinedevice != null) {
|
|
|
//重算货道数
|
|
|
String tempSql = "SELECT\n" +
|
|
|
"\tCOUNT(DISTINCT(t.id))\n" +
|
|
|
"FROM\n" +
|
|
@ -871,6 +872,23 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
"\tt.id_device = '"+deviceID+"'\n" +
|
|
|
"AND (t.state = '1' OR t.state = '21')";
|
|
|
mediicinedevice.setAisles(String.valueOf(jdbcTemplate.queryForObject(tempSql, Integer.class)));
|
|
|
//重算货道容量
|
|
|
tempSql = "SELECT\n" +
|
|
|
"\tifnull(sum(t.cargo_capacity), 0) as cargoCapacity\n" +
|
|
|
"FROM\n" +
|
|
|
"\tt_mediicinecabinet_inventory t\n" +
|
|
|
"WHERE\n" +
|
|
|
"\tt.id_device = '"+deviceID+"'\n" +
|
|
|
"AND (t.state = '1' OR t.state = '21')";
|
|
|
|
|
|
Map<String,Object> totalMap = jdbcTemplate.queryForMap(tempSql);
|
|
|
Integer noOnlineTotal1 = 0;
|
|
|
if (totalMap!=null){
|
|
|
if (totalMap.get("cargoCapacity") != null) {
|
|
|
noOnlineTotal1 = (int) Double.parseDouble(totalMap.get("cargoCapacity").toString()) + Integer.parseInt(qty);
|
|
|
}
|
|
|
}
|
|
|
mediicinedevice.setCapacity(String.valueOf(noOnlineTotal1));
|
|
|
deviceDao.save(mediicinedevice);
|
|
|
}
|
|
|
result.put("response",ConstantUtils.SUCCESS);
|
|
@ -4358,8 +4376,9 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
"\tt_mediicinecabinet_inventory t\n" +
|
|
|
"WHERE\n" +
|
|
|
"\tt.id_device = '"+inventory.getIdDevice()+"'\n" +
|
|
|
"AND t.id != '"+inventory.getId()+"'\n" +
|
|
|
"AND (t.state = '1' OR t.state = '21')";
|
|
|
mediicinedevice.setCapacity(String.valueOf(jdbcTemplate.queryForObject(tempSql, Integer.class)));
|
|
|
mediicinedevice.setCapacity(String.valueOf(jdbcTemplate.queryForObject(tempSql, Integer.class) + Integer.parseInt(qty)));
|
|
|
deviceDao.save(mediicinedevice);
|
|
|
}
|
|
|
|
|
@ -4479,8 +4498,7 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
|
|
|
/**
|
|
|
* 更新设备缺货信息,没有货道信息,单纯更新设备的缺货信息
|
|
|
* @param cargoId
|
|
|
* @param inventoryDO
|
|
|
* @param equNum
|
|
|
*/
|
|
|
public void updateDeviceStateWithoutCargo(String equNum) {
|
|
|
//所有药品及药品数量
|
|
@ -4699,13 +4717,14 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
"\tt_mediicinecabinet_inventory t\n" +
|
|
|
"WHERE\n" +
|
|
|
"\tt.id_device = '"+inventory.getIdDevice()+"'\n" +
|
|
|
"AND t.id != '"+inventory.getId()+"'\n" +
|
|
|
"AND (t.state = '1' OR t.state = '21')";
|
|
|
|
|
|
Map<String,Object> totalMap = jdbcTemplate.queryForMap(tempSql);
|
|
|
Integer noOnlineTotal1 = 0;
|
|
|
if (totalMap!=null){
|
|
|
if (totalMap.get("cargoCapacity") != null) {
|
|
|
noOnlineTotal1 = (int) Double.parseDouble(totalMap.get("cargoCapacity").toString());
|
|
|
noOnlineTotal1 = (int) Double.parseDouble(totalMap.get("cargoCapacity").toString() + Integer.parseInt(qty));
|
|
|
}
|
|
|
}
|
|
|
mediicinedevice.setCapacity(String.valueOf(noOnlineTotal1));
|
|
@ -4838,13 +4857,14 @@ public class MedicinedeviceService extends BaseJpaService<Mediicinedevice, Medi
|
|
|
"\tt_mediicinecabinet_inventory t\n" +
|
|
|
"WHERE\n" +
|
|
|
"\tt.id_device = '"+inventory.getIdDevice()+"'\n" +
|
|
|
"AND t.id != '"+inventory.getId()+"'\n" +
|
|
|
"AND (t.state = '1' OR t.state = '21')";
|
|
|
|
|
|
Map<String,Object> totalMap = jdbcTemplate.queryForMap(tempSql);
|
|
|
Integer noOnlineTotal1 = 0;
|
|
|
if (totalMap!=null){
|
|
|
if (totalMap.get("cargoCapacity") != null) {
|
|
|
noOnlineTotal1 = (int) Double.parseDouble(totalMap.get("cargoCapacity").toString());
|
|
|
noOnlineTotal1 = (int) Double.parseDouble(totalMap.get("cargoCapacity").toString()) + Integer.parseInt(qty);
|
|
|
}
|
|
|
}
|
|
|
mediicinedevice.setCapacity(String.valueOf(noOnlineTotal1));
|