ing
This commit is contained in:
parent
65437d6183
commit
9997af8b3f
|
@ -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<SensorItem> 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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user