Explorar o código

相机台账新增字段

gao.qiang hai 1 ano
pai
achega
2ffaaaa424

+ 13 - 0
business-service/src/main/java/com/ozs/entity/BaseCameraManagement.java

@@ -147,6 +147,17 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
     @Excel(name = "线路名称")
     private String railwayName;
 
+    /**
+     * 监视方向(1上行2下行3双线)
+     */
+    private Integer monitoringDirection;
+
+    /**
+     * 监视方向名称(1上行2下行3双线)
+     */
+    @Excel(name = "监视方向")
+    private Integer monitoringDirectionName;
+
     /**
      * 所属工务段名称
      */
@@ -197,4 +208,6 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
     private String enableOrNotName;
 
     private String rtspUrl;
+    
+    
 }

+ 3 - 0
business-service/src/main/java/com/ozs/entity/vo/BaseCameraManagementVos.java

@@ -86,4 +86,7 @@ public class BaseCameraManagementVos implements Serializable {
 
     @Excel(name = "测点名称")
     private  String  stationName;
+
+    @Excel(name = "监视方向")
+    private String monitoringDirectionName;
 }

+ 20 - 0
business-service/src/main/java/com/ozs/service/impl/BaseCameraManagementServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.generator.config.IFileCreate;
 import com.github.pagehelper.PageHelper;
 import com.ozs.common.core.domain.AjaxResult;
+import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.exception.ServiceException;
 import com.ozs.common.utils.AppendUtils;
 import com.ozs.common.utils.StringUtils;
@@ -21,6 +22,7 @@ import com.ozs.mapper.*;
 import com.ozs.service.BaseCameraManagementService;
 import com.ozs.service.BaseRailwayManagementService;
 import com.ozs.service.BaseUserService;
+import com.ozs.system.service.ISysDictTypeService;
 import com.ozs.utils.CameraUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -63,6 +65,8 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
     private SkynetHeartbeatLogMapper skynetHeartbeatLogMapper;
     @Autowired
     private BaseRailwayManagementMapper baseRailwayManagementMapper;
+    @Autowired
+    private ISysDictTypeService dictTypeService;
 
     /**
      * 相机台账管理表导入
@@ -153,6 +157,14 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
 //                                accountManagement.setEndMile(accountManagement.getEndMile() * 1000);
 //                                accountManagement.setBeginMile(accountManagement.getBeginMile() * 1000);
                             if (accountManagement.getBeginMile() < accountManagement.getEndMile()) {
+                                if (!StringUtils.isEmpty(cameraManagementVos.getMonitoringDirectionName())) {
+                                    List<SysDictData> data = dictTypeService.selectDictDataByType("monitoring_direction");
+                                    for (SysDictData datum : data) {
+                                        if (datum.getDictLabel().equals(cameraManagementVos.getMonitoringDirectionName())) {
+                                            accountManagement.setMonitoringDirection(Integer.valueOf(datum.getDictValue()));
+                                        }
+                                    }
+                                }
                                 baseCameraManagementMapper.insert(accountManagement);
                                 BaseDeviceDynamicManagement baseDeviceDynamicManagement = new BaseDeviceDynamicManagement();
                                 baseDeviceDynamicManagement.setCameraCode(accountManagement.getCameraCode());
@@ -185,6 +197,14 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
                     log.debug(accountManagement.getDeptName() + "主键id:" + deptId);
 //                    if (!ObjectUtils.isEmpty(deptId)) {
                     accountManagement.setDeptId(deptId);
+                    if (!StringUtils.isEmpty(cameraManagementVos.getMonitoringDirectionName())) {
+                        List<SysDictData> data = dictTypeService.selectDictDataByType("monitoring_direction");
+                        for (SysDictData datum : data) {
+                            if (datum.getDictLabel().equals(cameraManagementVos.getMonitoringDirectionName())) {
+                                accountManagement.setMonitoringDirection(Integer.valueOf(datum.getDictValue()));
+                            }
+                        }
+                    }
                     baseCameraManagementMapper.update(accountManagement, lw);
                     LambdaQueryWrapper<BaseDeviceDynamicManagement> wrapper = new LambdaQueryWrapper<BaseDeviceDynamicManagement>();
                     if (!StringUtils.isEmptySunhh(baseAccountManagement.getCameraCode())) {

+ 12 - 0
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -10,6 +10,7 @@ import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.R;
 import com.ozs.common.core.domain.entity.SysDept;
+import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.exception.base.BaseException;
 import com.ozs.common.utils.AppendUtils;
@@ -25,6 +26,7 @@ import com.ozs.framework.config.ServerConfig;
 import com.ozs.service.*;
 import com.ozs.system.service.DataScoreUtil;
 import com.ozs.system.service.ISysDeptService;
+import com.ozs.system.service.ISysDictTypeService;
 import com.ozs.utils.CameraUtil;
 import com.ozs.utils.CaneraConfig;
 import com.ozs.utils.RtspToMP4;
@@ -83,6 +85,8 @@ public class BaseCameraManagementController extends BaseController {
 
     @Autowired
     private CameraUtil cameraUtil;
+    @Autowired
+    private ISysDictTypeService dictTypeService;
 
 
     /**
@@ -634,6 +638,14 @@ public class BaseCameraManagementController extends BaseController {
                 begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
                 baseCameraManagement.setBeginMiles(begin);
             }
+            if (!StringUtils.isEmpty(baseCameraManagement.getMonitoringDirection())) {
+                List<SysDictData> data = dictTypeService.selectDictDataByType("monitoring_direction");
+                for (SysDictData datum : data) {
+                    if (datum.getDictValue().equals(baseCameraManagement.getMonitoringDirection().toString())) {
+                        baseCameraManagement.setMonitoringDirectionName(Integer.valueOf(datum.getDictLabel()));
+                    }
+                }
+            }
         }
         ExcelUtil<BaseCameraManagement> util = new ExcelUtil<>(BaseCameraManagement.class);
         util.exportExcel(response, baseCameraManagementList, "台账管理相机数据");

BIN=BIN
vehicle-admin/src/main/resources/template/baseCameraManagement.xlsx