qa-prevention-gwj/src/main/java/com/zcloud/service/alarm/impl/AlarmDictServiceImpl.java

126 lines
2.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.zcloud.service.alarm.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.alarm.AlarmDictMapper;
import com.zcloud.service.alarm.AlarmDictService;
import com.zcloud.util.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 说明:门口门禁区域闸机
* 作者zhaoyu
* 时间2024-01-16
* 官网www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class AlarmDictServiceImpl implements AlarmDictService {
@Autowired
private AlarmDictMapper alarmDictMapper;
/**新增
* @param pd
* @throws Exception
*/
public Object save(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
pd.put("ALARM_DICT_ID", UuidUtil.get32UUID());
alarmDictMapper.save(pd);
map.put("result", errInfo);
map.put("msg", "保存成功");
return map;
}
/**删除
* @param pd
* @throws Exception
*/
public Object delete(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
alarmDictMapper.delete(pd);
map.put("result", errInfo);
map.put("msg", "删除成功");
return map;
}
/**修改
* @param pd
* @throws Exception
*/
public Object edit(PageData pd)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
alarmDictMapper.edit(pd);
map.put("result", errInfo);
map.put("msg", "编辑成功");
return map;
}
/**列表
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return alarmDictMapper.datalistPage(page);
}
/**列表
* @param page
* @throws Exception
*/
public List<PageData> listByType(PageData pd)throws Exception{
return alarmDictMapper.listByType(pd);
}
/**列表(全部)
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return alarmDictMapper.listAll(pd);
}
/**通过id获取数据
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return alarmDictMapper.findById(pd);
}
/**批量删除
* @param ArrayDATA_IDS
* @throws Exception
*/
public Object deleteAll(String[] ArrayDATA_IDS)throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
alarmDictMapper.deleteAll(ArrayDATA_IDS);
map.put("result", errInfo);
map.put("msg", "删除成功");
return map;
}
@Override
public Object savePosition(PageData pd) {
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
alarmDictMapper.savePosition(pd);
map.put("result", errInfo);
map.put("msg", "定位成功");
return map;
}
}