|
@@ -0,0 +1,60 @@
|
|
|
+package com.bizmatics.service.impl;
|
|
|
+
|
|
|
+import com.bizmatics.model.PatrolInspectionDevice;
|
|
|
+import com.bizmatics.model.system.SysUser;
|
|
|
+import com.bizmatics.model.vo.PatrolInspectionDeviceVo;
|
|
|
+import com.bizmatics.persistence.mapper.PatrolInspectionDeviceMapper;
|
|
|
+import com.bizmatics.service.PatrolInspectionDeviceService;
|
|
|
+import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
|
+import com.bizmatics.service.util.SecurityUtils;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.UUID;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author ya
|
|
|
+ * @since 2021-10-15
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class PatrolInspectionDeviceServiceImpl extends AbstractCrudService<PatrolInspectionDeviceMapper, PatrolInspectionDevice> implements PatrolInspectionDeviceService {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void patrolInspectionDeviceAdd(String inspectionDeviceName,Integer siteId,Integer deviceTypeId){
|
|
|
+ SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
+ PatrolInspectionDevice patrolInspectionDevice = new PatrolInspectionDevice();
|
|
|
+ patrolInspectionDevice.setInspectionDeviceName(inspectionDeviceName);
|
|
|
+ patrolInspectionDevice.setSiteId(siteId);
|
|
|
+ patrolInspectionDevice.setDeviceTypeId(deviceTypeId);
|
|
|
+ patrolInspectionDevice.setCreator(user.getUserName());
|
|
|
+ patrolInspectionDevice.setCreateTime(new Date());
|
|
|
+ patrolInspectionDevice.setStatus(1);
|
|
|
+ patrolInspectionDevice.setQrCodeAddress(UUID.randomUUID().toString());
|
|
|
+ this.save(patrolInspectionDevice);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void patrolInspectionDeviceUpdate(PatrolInspectionDevice patrolInspectionDevice){
|
|
|
+ this.updateById(patrolInspectionDevice);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void patrolInspectionDeviceDel(Integer id){
|
|
|
+ PatrolInspectionDevice patrolInspectionDevice = new PatrolInspectionDevice();
|
|
|
+ patrolInspectionDevice.setId(id);
|
|
|
+ patrolInspectionDevice.setStatus(0);
|
|
|
+ this.updateById(patrolInspectionDevice);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<PatrolInspectionDeviceVo> patrolInspectionDeviceList(String inspectionDeviceName,Integer siteId,Integer id){
|
|
|
+ List<PatrolInspectionDeviceVo> patrolInspectionDeviceList = baseMapper.patrolInspectionDeviceList(inspectionDeviceName,siteId,id);
|
|
|
+ return patrolInspectionDeviceList;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|