Ver Fonte

1.完成上传日志。
2.完成下发命令及上传结果。
3.乘客打卡增加上传人脸库编号。

zhengqiang há 4 anos atrás
pai
commit
1fad258f17

+ 20 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dao/DeviceCmdInfoDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.bus.modules.bus.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.bus.modules.bus.entity.DeviceCmdInfo;
+import java.util.Map;
+import com.jpsoft.bus.modules.common.dto.Sort;
+
+@Repository
+public interface DeviceCmdInfoDAO {
+	int insert(DeviceCmdInfo entity);
+	int update(DeviceCmdInfo entity);
+	int exist(String id);
+	DeviceCmdInfo get(String id);
+	int delete(String id);
+	List<DeviceCmdInfo> list();
+	List<DeviceCmdInfo> search(Map<String,Object> searchParams,List<Sort> sortList);
+
+    List<DeviceCmdInfo> findByLicensePlateNumber(String licensePlateNumber, int limit);
+}

+ 18 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/dao/DeviceLogInfoDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.bus.modules.bus.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.bus.modules.bus.entity.DeviceLogInfo;
+import java.util.Map;
+import com.jpsoft.bus.modules.common.dto.Sort;
+
+@Repository
+public interface DeviceLogInfoDAO {
+	int insert(DeviceLogInfo entity);
+	int update(DeviceLogInfo entity);
+	int exist(String id);
+	DeviceLogInfo get(String id);
+	int delete(String id);
+	List<DeviceLogInfo> list();
+	List<DeviceLogInfo> search(Map<String,Object> searchParams,List<Sort> sortList);
+}

+ 94 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/entity/DeviceCmdInfo.java

@@ -0,0 +1,94 @@
+package com.jpsoft.bus.modules.bus.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ * 描述:bus_device_cmd_info的实体类
+ */
+@Data
+@ApiModel(value = "bus_device_cmd_info的实体类")
+public class DeviceCmdInfo {
+    /**
+     *
+     */
+    @ApiModelProperty(value = "")
+    private String id;
+    /**
+     * 车牌号
+     */
+    @ApiModelProperty(value = "车牌号")
+    private String licensePlateNumber;
+    /**
+     * 设备IP
+     */
+    @ApiModelProperty(value = "设备IP")
+    private String deviceIP;
+    /**
+     * 下发地址
+     */
+    @ApiModelProperty(value = "下发地址")
+    private String url;
+    /**
+     * http方法
+     */
+    @ApiModelProperty(value = "http方法")
+    private String method;
+    /**
+     * 下发到设备的命令
+     */
+    @ApiModelProperty(value = "下发到设备的命令")
+    private String requestBody;
+    /**
+     * 返回结果
+     */
+    @ApiModelProperty(value = "返回结果")
+    private String responseText;
+    /**
+     * 状态码
+     */
+    @ApiModelProperty(value = "状态码")
+    private Integer responseCode;
+    /**
+     * 0-未执行,1-已执行
+     */
+    @ApiModelProperty(value = "0-未执行,1-已执行")
+    private Integer status;
+    /**
+     * 创建时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 更新时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 是否删除
+     */
+    @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+}

+ 77 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/entity/DeviceLogInfo.java

@@ -0,0 +1,77 @@
+package com.jpsoft.bus.modules.bus.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ * 描述:bus_device_log_info的实体类
+ */
+@Data
+@ApiModel(value = "bus_device_log_info的实体类")
+public class DeviceLogInfo {
+    /**
+     * 主键
+     */
+    @ApiModelProperty(value = "主键")
+    private String id;
+    /**
+     * 车牌号
+     */
+    @ApiModelProperty(value = "车牌号")
+    private String licensePlateNumber;
+    /**
+     * 设备IP
+     */
+    @ApiModelProperty(value = "设备IP")
+    private String deviceIP;
+    /**
+     * 标记
+     */
+    @ApiModelProperty(value = "标记")
+    private String tag;
+    /**
+     * 日志内容
+     */
+    @ApiModelProperty(value = "日志内容")
+    private String content;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 更新时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+    /**
+     * 是否删除
+     */
+    @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+
+    @ApiModelProperty(value = "记录时间")
+    private Date recordTime;
+}

+ 18 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/DeviceCmdInfoService.java

@@ -0,0 +1,18 @@
+package com.jpsoft.bus.modules.bus.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.bus.modules.bus.entity.DeviceCmdInfo;
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+
+public interface DeviceCmdInfoService {
+	DeviceCmdInfo get(String id);
+	boolean exist(String id);
+	int insert(DeviceCmdInfo model);
+	int update(DeviceCmdInfo model);
+	int delete(String id);
+	List<DeviceCmdInfo> list();
+	Page<DeviceCmdInfo> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+    List<DeviceCmdInfo> findByLicensePlateNumber(String licensePlateNumber, int limit);
+}

+ 17 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/DeviceLogInfoService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.bus.modules.bus.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.bus.modules.bus.entity.DeviceLogInfo;
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+
+public interface DeviceLogInfoService {
+	DeviceLogInfo get(String id);
+	boolean exist(String id);
+	int insert(DeviceLogInfo model);
+	int update(DeviceLogInfo model);
+	int delete(String id);
+	List<DeviceLogInfo> list();
+	Page<DeviceLogInfo> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+}

+ 75 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/DeviceCmdInfoServiceImpl.java

@@ -0,0 +1,75 @@
+package com.jpsoft.bus.modules.bus.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.bus.modules.bus.dao.DeviceCmdInfoDAO;
+import com.jpsoft.bus.modules.bus.entity.DeviceCmdInfo;
+import com.jpsoft.bus.modules.bus.service.DeviceCmdInfoService;
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="deviceCmdInfoService")
+public class DeviceCmdInfoServiceImpl implements DeviceCmdInfoService {
+	@Resource(name="deviceCmdInfoDAO")
+	private DeviceCmdInfoDAO deviceCmdInfoDAO;
+
+	@Override
+	public DeviceCmdInfo get(String id) {
+		// TODO Auto-generated method stub
+		return deviceCmdInfoDAO.get(id);
+	}
+
+	@Override
+	public int insert(DeviceCmdInfo model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return deviceCmdInfoDAO.insert(model);
+	}
+
+	@Override
+	public int update(DeviceCmdInfo model) {
+		// TODO Auto-generated method stub
+		return deviceCmdInfoDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return deviceCmdInfoDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = deviceCmdInfoDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<DeviceCmdInfo> list() {
+		// TODO Auto-generated method stub
+		return deviceCmdInfoDAO.list();
+	}
+		
+	@Override
+	public Page<DeviceCmdInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<DeviceCmdInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            deviceCmdInfoDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public List<DeviceCmdInfo> findByLicensePlateNumber(String licensePlateNumber, int limit) {
+		return deviceCmdInfoDAO.findByLicensePlateNumber(licensePlateNumber,limit);
+	}
+}

+ 70 - 0
common/src/main/java/com/jpsoft/bus/modules/bus/service/impl/DeviceLogInfoServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.bus.modules.bus.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.bus.modules.bus.dao.DeviceLogInfoDAO;
+import com.jpsoft.bus.modules.bus.entity.DeviceLogInfo;
+import com.jpsoft.bus.modules.bus.service.DeviceLogInfoService;
+import com.github.pagehelper.Page;
+import com.jpsoft.bus.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="deviceLogInfoService")
+public class DeviceLogInfoServiceImpl implements DeviceLogInfoService {
+	@Resource(name="deviceLogInfoDAO")
+	private DeviceLogInfoDAO deviceLogInfoDAO;
+
+	@Override
+	public DeviceLogInfo get(String id) {
+		// TODO Auto-generated method stub
+		return deviceLogInfoDAO.get(id);
+	}
+
+	@Override
+	public int insert(DeviceLogInfo model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return deviceLogInfoDAO.insert(model);
+	}
+
+	@Override
+	public int update(DeviceLogInfo model) {
+		// TODO Auto-generated method stub
+		return deviceLogInfoDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return deviceLogInfoDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = deviceLogInfoDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<DeviceLogInfo> list() {
+		// TODO Auto-generated method stub
+		return deviceLogInfoDAO.list();
+	}
+		
+	@Override
+	public Page<DeviceLogInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<DeviceLogInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            deviceLogInfoDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}