From 9997af8b3f2698a2b13fb98b5f8bc42b0a3fabdc Mon Sep 17 00:00:00 2001 From: insanity Date: Wed, 15 Nov 2017 10:47:22 +0900 Subject: [PATCH] ing --- .../overflow/module/sensor/service/SensorItemService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemService.java b/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemService.java index 9211142..1334652 100644 --- a/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemService.java +++ b/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemService.java @@ -26,7 +26,7 @@ public class SensorItemService { @Transactional public SensorItem regist(SensorItem sensorItem) { - Sensor s = sensorItem.getSensor(); + Sensor s = sensorDAO.findOne(sensorItem.getSensor().getId()); s.setItemCount((short)(s.getItemCount() + 1)); this.sensorDAO.save(s); return this.sensorItemDAO.save(sensorItem); @@ -34,8 +34,8 @@ public class SensorItemService { @Transactional public boolean registAll(List sensorItemList) { - Sensor s = sensorItemList.get(0).getSensor(); - s.setItemCount((short)(s.getItemCount() + 1)); + Sensor s = sensorDAO.findOne(sensorItemList.get(0).getSensor().getId()); + s.setItemCount((short)sensorItemList.size()); this.sensorDAO.save(s); this.sensorItemDAO.save(sensorItemList); return true;