Merge branch 'master' into dev_Tuzki_gitee

dev
Tuzki 2 years ago
commit 1c56eddec6
  1. 22
      cjy-mini-project/src/main/java/com/cjy/app/controller/EmergencyResourcesController.java
  2. 23
      cjy-project/src/main/java/com/cjy/devicedocking/controller/UdpController.java
  3. 205
      cjy-project/src/main/java/com/cjy/devicedocking/utils/UDPUtil.java
  4. 9
      cjy-project/src/main/java/com/cjy/emergencycommand/controller/ManageAlarmController.java
  5. 4
      cjy-project/src/main/java/com/cjy/emergencycommand/service/ManageAlarmService.java
  6. 14
      cjy-project/src/main/java/com/cjy/emergencycommand/service/impl/ManageAlarmServiceImpl.java
  7. 49
      cjy-project/src/main/java/com/cjy/flowdata/domain/FlowData.java
  8. 26
      cjy-project/src/main/java/com/cjy/marketingdata/service/impl/MarketingWechatMicroblogInfoServiceImpl.java
  9. 53
      cjy-project/src/main/java/com/cjy/vehicledata/domain/VehicleData.java
  10. 7
      cjy-project/src/main/resources/mapper/emergencyInfo/EmergencyInfoMapper.xml
  11. 17
      cjy-project/src/main/resources/mapper/enterprise/EnterpriseResourceTypeMapper.xml
  12. 18
      cjy-project/src/main/resources/mapper/marketingdata/MarketingWechatMicroblogInfoMapper.xml
  13. 3
      ruoyi-admin/src/main/resources/application.yml
  14. 10
      ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java

@ -1,5 +1,6 @@
package com.cjy.app.controller;
import com.alibaba.fastjson2.JSON;
import com.cjy.emergencycommand.domain.ClassificationConfig;
import com.cjy.emergencycommand.domain.dto.PlanEmergencyDTO;
import com.cjy.emergencycommand.domain.vo.ClassificationConfigVO;
@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @author liangjiawei
@ -55,6 +57,17 @@ public class EmergencyResourcesController extends BaseController {
return getDataTable(list);
}
/**
* 应急资源详情
* @param id
* @return
*/
@GetMapping("/getPlanEmergencyDetails/{id}")
public AjaxResult getPlanEmergencyDetails(@PathVariable("id") Long id) {
Map<String, Object> planEmergencyDetails = manageAlarmService.getPlanEmergencyDetails(id);
return success(planEmergencyDetails);
}
/**
* 应急资源查询清单
*/
@ -62,8 +75,13 @@ public class EmergencyResourcesController extends BaseController {
public TableDataInfo getMaterialsList(PlanEmergencyDTO planEmergencyDTO) {
startPage();
planEmergencyDTO.setOrganCode(getUserOrganCode());
List<MaterialsVO> list = manageAlarmService.getMaterialsList(planEmergencyDTO);
return getDataTable(list);
Map<String,Object> map = manageAlarmService.getMaterialsList(planEmergencyDTO);
String json = JSON.toJSONString(map.get("list"));
List<MaterialsVO> list = JSON.parseArray(json, MaterialsVO.class);
return getDataTable(list, Integer.parseInt(map.get("count").toString()));
}
}

@ -4,12 +4,12 @@ package com.cjy.devicedocking.controller;
import com.cjy.devicedocking.utils.UDPUtil;
import com.cjy.iot.service.IIotInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
/**
@ -19,6 +19,9 @@ import java.util.List;
@RestController
@RequestMapping("/device")
public class UdpController {
@Value("${udp.virtualDeviceId}")
private String virtualDeviceId;
@Autowired
private UDPUtil udpUtil;
@Autowired
@ -135,16 +138,17 @@ public class UdpController {
* @throws Exception
*/
@GetMapping("/getDeviceState")
public String getDeviceState(String virtualDeviceId) throws Exception {
String response = udpUtil.getDeviceState(virtualDeviceId);
public String getDeviceState(String virtualDeviceId,String para) throws Exception {
String response = udpUtil.getDeviceState(virtualDeviceId,para);
return "UDP response received: " + response;
}
int i=0;
@GetMapping("/getSendNextData")
public String getSendNextData(String virtualDeviceId) throws Exception {
// @GetMapping("/getSendNextData")
// public String getSendNextData(String virtualDeviceId) throws Exception {
// String response = udpUtil.getSendNextData(virtualDeviceId);
// return "UDP response received: " + response;
// }
String response = udpUtil.getSendNextData(virtualDeviceId,i++);
return "UDP response received: " + response;
}
/**
* 定时获取所有任务状态
@ -157,8 +161,7 @@ public class UdpController {
// @Scheduled(cron = "0 0/30 * * * ?")
// @Scheduled(cron = "0 0/2 * * * ?")
public void getDeviceStateTask() throws Exception {
String virtualDeviceId = "00001115";
String response = udpUtil.getDeviceState(virtualDeviceId);
String response = udpUtil.getDeviceState(virtualDeviceId,"01");
//如果 第28-30位 返回的是00则表示 中间件接受到信息
if (response.substring(28, 30).equals("00")) {
//因为 中间件 最多支持1024个设备每页最多返回32条 所有 固定循环32次

@ -1,5 +1,6 @@
package com.cjy.devicedocking.utils;
import com.cjy.devicedocking.controller.UdpController;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@ -55,6 +56,7 @@ public class UDPUtil {
private String uploudUrl;
private static DatagramSocket socket;
private static int j = 1;
/**
* 中间件测试命令 message固定
@ -67,46 +69,6 @@ public class UDPUtil {
return sendAndReceive(message);
}
/**
* @param virtualDeviceId 中间件id
* @param terminalEquipmentId 终端设备id
* @param volume 音量取值范围 0127
* @return
* @throws Exception
*/
public String updateDeviceVolume(String virtualDeviceId, String terminalEquipmentId, int volume) throws Exception {
String message = requestHeader + deviceIdConvert(virtualDeviceId) + "00000800" + "0C" + "0000";
//十六进制字符串到字节数组
byte[] buffer = hexStringToByteArray(message);
//计算 ChkSum 即前15位的和
message += sumChkSum(buffer);
message += deviceIdConvert(terminalEquipmentId) + convert(volume) + "000000";
return sendAndReceive(message);
}
/**
* @param virtualDeviceId 中间件id
* @param fileName 文件名称
* @return
* @throws Exception
*/
public String uploadFile(String virtualDeviceId, String fileName) throws Exception {
int i = (uploudUrl + fileName).length() + 3;
String file = digestConversion(uploudUrl.replace("\\", "/") + fileName) + "00";
String message = requestHeader + deviceIdConvert(virtualDeviceId) + "0000" + convert(i) + "000F" + "0000";
//十六进制字符串到字节数组
byte[] buffer = hexStringToByteArray(message);
//计算 ChkSum 即前15位的和
message += sumChkSum(buffer);
message +="0000" + file;
// return sendAndReceive(message);
return message;
}
/**
* Cmd=0x01 / Cmd=0x11
* Len=52
@ -120,8 +82,8 @@ public class UDPUtil {
public String initializationDevice(String virtualDeviceId, String describe) throws Exception {
//参数拼接顺序为 //|--Header ---|------DID -----|--SN=0--|--Len=52--|--Cmd=0--|---------------| ChkSum |DID|管理码|设备描述|服务器的IP地址|服务器连接端口|服务器控制端口|服务器采播端口|保留
String message = requestHeader + "000000000000340001000044" + deviceIdConvert(virtualDeviceId) + deviceIdConvert(managementCode) + digestConversion(describe) + ipToHexadecimal(ipAddress) + severConnectPort + serverControlPort + serverCapturePort + "0000";
// return sendAndReceive(message);
return message;
return sendAndReceive(message);
// return message;
}
/**
@ -138,8 +100,8 @@ public class UDPUtil {
byte[] buffer = hexStringToByteArray(message);
//计算 ChkSum 即前15位的和
message += sumChkSum(buffer);
// return sendAndReceive(message);
return message;
return sendAndReceive(message);
// return message;
}
/**
@ -159,7 +121,7 @@ public class UDPUtil {
//计算 ChkSum 即前15位的和
message += sumChkSum(buffer);
return sendAndReceive(message);
// return message;
// return message;
}
/**
@ -185,56 +147,57 @@ public class UDPUtil {
/**
* 可编辑任务
*
* @param virtualDeviceId 中间件id
* @param fileId 文件id或者播放列表 文件是4为0001 列表是 1 2
* @param playMethod 播放方式
* @param deviceCode 终端设备id或者终端设备分组id
* @param taskName 任务名称
* @param fileId 文件id或者播放列表 文件是4为0001 列表是 1
* @param playMethod 播放方式
* @param deviceCode 终端设备id或者终端设备分组id
* @param taskName 任务名称
* @return
* @throws Exception
*/
public String editableTasks(String virtualDeviceId, List<String> fileId, Integer playMethod, List<String> deviceCode, String taskName) throws Exception {
// fe e0 a7 8a/ 15 11 00 00 /00 00 40 00/ 07 00 00 7c/ 00 00 00 20 /00 01 01 00 00 00/ 00 01 01 00 00 00 /00 02/ 02 01 /03 00 00 00 /08 54 41 53 4b 36 37 38 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00/ 01 00 00 00/ bc 1a 00 00
//(从第16个开始的)任务编号/保留/类型/定时类型、定时模式/起始时间,年月日时分秒,这里无效,但必须是合法值/结束时间,年月日时分秒,这里无效,但必须是合法值/播放内容数量F=2(奇数个文件加1改为偶数),播放终端数量D=1/音量/任务名称/文件名称/设备名称
String newFileId="";
String newDeviceCode="";
for (int i=0;i<fileId.size();i++) {
if(fileId.get(i).length()==4){
if(i==fileId.size()-1 && fileId.size()%2==1){
newFileId+=deviceIdConvert(fileId.get(i))+"0000";
}else {
newFileId+=deviceIdConvert(fileId.get(i));
public String editableTasks(String virtualDeviceId, List<String> fileId, Integer playMethod, List<String> deviceCode, String taskName) throws Exception {
//(从第16个开始的)任务编号/保留/类型/定时类型、定时模式/起始时间,年月日时分秒,这里无效,但必须是合法值/结束时间,年月日时分秒,这里无效,但必须是合法值/播放内容数量F=2(奇数个文件加1改为偶数),播放终端数量D=1/音量/任务名称/文件名称/设备名称
String newFileId = "";
String newDeviceCode = "";
for (int i = 0; i < fileId.size(); i++) {
if (fileId.get(i).length() == 4) {
if (i == fileId.size() - 1 && fileId.size() % 2 == 1) {
newFileId += deviceIdConvert(fileId.get(i)) + "0000";
} else {
newFileId += deviceIdConvert(fileId.get(i));
}
}else {
if(i==fileId.size()-1 && fileId.size()%2==1){
newFileId+=convertTheListId(Integer.parseInt(fileId.get(i)));
}else {
newFileId+=convertTheListIdeven(Integer.parseInt(fileId.get(i)));
} else {
if (i == fileId.size() - 1 && fileId.size() % 2 == 1) {
newFileId += convertTheListId(Integer.parseInt(fileId.get(i)));
} else {
newFileId += convertTheListIdeven(Integer.parseInt(fileId.get(i)));
}
}
}
for (String deviceCodeItem:deviceCode) {
if(deviceCodeItem.length()>3){
newDeviceCode+=deviceIdConvert(deviceCodeItem);
}else {
newDeviceCode+=convertGroupId(Integer.parseInt(deviceCodeItem));
for (String deviceCodeItem : deviceCode) {
if (deviceCodeItem.length() > 3) {
newDeviceCode += deviceIdConvert(deviceCodeItem);
} else {
newDeviceCode += convertGroupId(Integer.parseInt(deviceCodeItem));
}
}
String dataInfo="00"+"00"+"00"+"20"+"000101000000"+"000101000000"+"00"+convert(playMethod)+"0201"+"03000000"+digestConversion(taskName)+newFileId+newDeviceCode;
String dataInfo = "00" + "00" + "00" + "20" + "000101000000" + "000101000000" + "00" + convert(playMethod) + "0201" + "03000000" + digestConversion(taskName) + newFileId + newDeviceCode;
//这个值 应该是 64=56+F*2+D*4 (注:F是文件数量 D是设备个数)
int len= 56+((fileId.size()%2 ==1?(fileId.size()+1):fileId.size())*2)+(deviceCode.size()*4);
int len = 56 + ((fileId.size() % 2 == 1 ? (fileId.size() + 1) : fileId.size()) * 2) + (deviceCode.size() * 4);
// 20暂时不动
String message = requestHeader + deviceIdConvert(virtualDeviceId) + "0000"+ convert(len) + "0007" + "0000";
String message = requestHeader + deviceIdConvert(virtualDeviceId) + "0000" + convert(len) + "0007" + "0000";
byte[] buffer = hexStringToByteArray(message);
message+=sumChkSum(buffer);
message+=dataInfo;
// return sendAndReceive(message);
return message;
message += sumChkSum(buffer);
message += dataInfo;
return sendAndReceive(message);
// return message;
}
//FE E0 A7 8A 16 11 00 00 00 00 00 00 05 01 00 3c
/**
* 通过中间件获取设备状态信息
*
@ -242,17 +205,17 @@ public class UDPUtil {
* @return
* @throws Exception
*/
public String getDeviceState(String virtualDeviceId) throws Exception {
public String getDeviceState(String virtualDeviceId, String para) throws Exception {
// |固定请求头|虚拟设备id(中间件id)| |Cmd| |
// String message = requestHeader + deviceIdConvert(virtualDeviceId) + "00000000" + "01" + "0400";
String message = requestHeader + deviceIdConvert(virtualDeviceId) + "00000000" + "05" + "0400";
// String message = requestHeader + deviceIdConvert(virtualDeviceId) + "00000000" + "05" + para+"00";
String message = requestHeader + deviceIdConvert(virtualDeviceId) + "00000000" + "05" + para + "00";
//十六进制字符串到字节数组
byte[] buffer = hexStringToByteArray(message);
//计算 ChkSum 即前15位的和
message += sumChkSum(buffer);
System.out.println(message);
// return sendAndReceive(message);
return message;
return sendAndReceive(message);
// return message;
}
public String getSendNextData(String virtualDeviceId, Integer sn) throws Exception {
@ -273,6 +236,7 @@ public class UDPUtil {
message += sumChkSum(buffer);
System.out.println(message);
return sendAndReceive(message);
// return message;
}
/**
@ -306,6 +270,62 @@ public class UDPUtil {
return hexString;
}
/**
* @param virtualDeviceId 中间件id
* @param terminalEquipmentId 终端设备id
* @param volume 音量取值范围 0127
* @return
* @throws Exception
*/
public String updateDeviceVolume(String virtualDeviceId, String terminalEquipmentId, int volume) throws Exception {
String message = requestHeader + deviceIdConvert(virtualDeviceId) + "00000800" + "0C" + "0000";
//十六进制字符串到字节数组
byte[] buffer = hexStringToByteArray(message);
//计算 ChkSum 即前15位的和
message += sumChkSum(buffer);
message += deviceIdConvert(terminalEquipmentId) + convert(volume) + "000000";
return sendAndReceive(message);
}
/**
* @param virtualDeviceId 中间件id
* @param fileName 文件名称
* @return
* @throws Exception
*/
public String uploadFile(String virtualDeviceId, String fileName) throws Exception {
int i = (uploudUrl + fileName).length() + 3;
String file = digestConversion(uploudUrl.replace("\\", "/") + fileName) + "00";
String message = requestHeader + deviceIdConvert(virtualDeviceId) + "0000" + convert(i) + "000F" + "0000";
//十六进制字符串到字节数组
byte[] buffer = hexStringToByteArray(message);
//计算 ChkSum 即前15位的和
message += sumChkSum(buffer);
message += "0000" + file;
String returnString = sendAndReceive(message);
//下载最好调用一下
// String response = this.getDeviceState(virtualDeviceId,"04");
// Boolean iscycle = true;
// String responseData = "";
// if (response.substring(28, 30).equals("00")) {
// while (iscycle) {
// responseData = this.getSendNextData(virtualDeviceId, j++);
// //16-20是01的话 表示已经是最后页了
//
// if ("80".equals(responseData.substring(18, 20))) {
// //如果是01表示最后一页结束循环
// iscycle = false;
// String lastDataString =responseData.substring(responseData.length()-272,responseData.length());
// System.out.println(responseData);
// }
// }
//
// }
return returnString;
// return message;
}
//字符串转byte
public static byte[] hexToByteArray(String hexString) {
int len = hexString.length();
@ -368,7 +388,6 @@ public class UDPUtil {
}
//这个是 备注转换的逻辑
public static String digestConversion(String str) {
byte[] bytes = str.getBytes(Charset.forName("GBK"));
@ -437,17 +456,24 @@ public class UDPUtil {
// System.out.println(convertGroupId(1));
// System.out.println(convertTheListId(1));
System.out.println(deviceIdConvert("0002"));
System.out.println(convertTheListId(256));
// System.out.println(deviceIdConvert("0002"));
// System.out.println(convertTheListId(256));
// String responseData = "FEE0A78B151100000280D8008D040021";
// System.out.println(responseData.substring(18, 20));
String responseData="FEE0A78B151100000280D8008D0400210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000150000FF100100000631382E6D703300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
String lastDataString =responseData.substring(responseData.length()-272,responseData.length());
System.out.println(lastDataString);
}
public static String convertGroupId (int decimal){
public static String convertGroupId(int decimal) {
String output = String.format("%02XFFFFFF", decimal);
return output;
}
public static String convertTheListId(int decimal){
public static String convertTheListId(int decimal) {
String output;
if (decimal < 256) {
output = String.format("%02Xff0000", decimal);
@ -458,8 +484,9 @@ public class UDPUtil {
}
return output;
}
//偶数的时候
public static String convertTheListIdeven(int decimal){
public static String convertTheListIdeven(int decimal) {
String output;
if (decimal < 256) {
output = String.format("%02Xff", decimal);

@ -1,5 +1,6 @@
package com.cjy.emergencycommand.controller;
import com.alibaba.fastjson2.JSON;
import com.cjy.emergencycommand.domain.AlarmInfo;
import com.cjy.emergencycommand.domain.dto.*;
import com.cjy.emergencycommand.domain.vo.AlarmOrderListVO;
@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 应急演练附件Controller
@ -151,7 +153,12 @@ public class ManageAlarmController extends BaseController {
@GetMapping("/getMaterialsList")
public AjaxResult getMaterialsList(PlanEmergencyDTO planEmergencyDTO) {
planEmergencyDTO.setOrganCode(getUserOrganCode());
List<MaterialsVO> list = manageAlarmService.getMaterialsList(planEmergencyDTO);
Map<String,Object> map = manageAlarmService.getMaterialsList(planEmergencyDTO);
String json = JSON.toJSONString(map.get("list"));
List<MaterialsVO> list = JSON.parseArray(json, MaterialsVO.class);
return success(list);
}

@ -6,6 +6,7 @@ import com.cjy.emergencycommand.domain.vo.*;
import com.cjy.parkinglotdataanalysis.vo.ReturnVO;
import java.util.List;
import java.util.Map;
/**
* 告警信息Service接口
@ -132,6 +133,7 @@ public interface ManageAlarmService {
* @return
*/
public List<PlanEmergencyVO> getPlanEmergencyApplets(PlanEmergencyDTO planEmergencyDTO);
public Map<String, Object> getPlanEmergencyDetails(Long id);
/**
* 获取物资清单
@ -139,7 +141,7 @@ public interface ManageAlarmService {
* @param planEmergencyDTO
* @return
*/
public List<MaterialsVO> getMaterialsList(PlanEmergencyDTO planEmergencyDTO);
public Map<String,Object> getMaterialsList(PlanEmergencyDTO planEmergencyDTO);
/**
* 查询视频监控列表

@ -13,6 +13,7 @@ import com.cjy.emergencycommand.service.*;
import com.cjy.iot.domain.IotInfo;
import com.cjy.iot.service.IIotInfoService;
import com.cjy.parkinglotdataanalysis.vo.ReturnVO;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
@ -379,11 +380,17 @@ public class ManageAlarmServiceImpl implements ManageAlarmService {
}
@Override
public List<MaterialsVO> getMaterialsList(PlanEmergencyDTO planEmergencyDTO) {
public Map<String, Object> getPlanEmergencyDetails(Long id) {
return emergencyInfoService.getAppletsEmergencyPlaceInfo(id);
}
@Override
public Map<String,Object> getMaterialsList(PlanEmergencyDTO planEmergencyDTO) {
CommodityInfo commodityInfo = new CommodityInfo();
commodityInfo.setResourceCode(planEmergencyDTO.getCode());
commodityInfo.setStatus(USE.getValue());
List<CommodityInfo> infoList = commodityInfoService.selectCommodityInfoList(commodityInfo);
List<MaterialsVO> list = new ArrayList<>();
infoList.stream().forEach(r -> {
MaterialsVO materialsVO = new MaterialsVO();
@ -392,7 +399,10 @@ public class ManageAlarmServiceImpl implements ManageAlarmService {
materialsVO.setCount(r.getNum());
list.add(materialsVO);
});
return list;
Map<String,Object> returnDate=new HashMap<>();
returnDate.put("list",list);
returnDate.put("count",new PageInfo(infoList).getTotal());
return returnDate;
}
@Override

@ -1,16 +1,17 @@
package com.cjy.flowdata.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 客流监测数据 对象 d_flow_data
*
*
* @author ruoyi
* @date 2023-03-08
*/
@ -23,8 +24,8 @@ public class FlowData extends BaseEntity
private Long id;
/** 统计时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "统计时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "统计时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date statisticsTime;
/** 资源编码 */
@ -54,84 +55,84 @@ public class FlowData extends BaseEntity
@Excel(name = "企业标识码 数据隔离使用的企业唯一标识")
private Long organCode;
public void setId(Long id)
public void setId(Long id)
{
this.id = id;
}
public Long getId()
public Long getId()
{
return id;
}
public void setStatisticsTime(Date statisticsTime)
public void setStatisticsTime(Date statisticsTime)
{
this.statisticsTime = statisticsTime;
}
public Date getStatisticsTime()
public Date getStatisticsTime()
{
return statisticsTime;
}
public void setResourceCode(Long resourceCode)
public void setResourceCode(Long resourceCode)
{
this.resourceCode = resourceCode;
}
public Long getResourceCode()
public Long getResourceCode()
{
return resourceCode;
}
public void setInPersonNum(Long inPersonNum)
public void setInPersonNum(Long inPersonNum)
{
this.inPersonNum = inPersonNum;
}
public Long getInPersonNum()
public Long getInPersonNum()
{
return inPersonNum;
}
public void setOutPersonNum(Long outPersonNum)
public void setOutPersonNum(Long outPersonNum)
{
this.outPersonNum = outPersonNum;
}
public Long getOutPersonNum()
public Long getOutPersonNum()
{
return outPersonNum;
}
public void setRemarks(String remarks)
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
public String getRemarks()
{
return remarks;
}
public void setDelFlag(String delFlag)
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
public String getDelFlag()
{
return delFlag;
}
public void setDataSource(String dataSource)
public void setDataSource(String dataSource)
{
this.dataSource = dataSource;
}
public String getDataSource()
public String getDataSource()
{
return dataSource;
}
public void setOrganCode(Long organCode)
public void setOrganCode(Long organCode)
{
this.organCode = organCode;
}
public Long getOrganCode()
public Long getOrganCode()
{
return organCode;
}

@ -121,7 +121,7 @@ public class MarketingWechatMicroblogInfoServiceImpl implements IMarketingWechat
@Override
public OperationStatisticsVO operationStatistics(MarketingWechatMicroblogInfo marketingWechatMicroblogInfo) {
OperationStatisticsVO operationStatisticsVO = marketingWechatMicroblogInfoMapper.operationStatistics(marketingWechatMicroblogInfo.getOrganCode(), 0L, marketingWechatMicroblogInfo.getType());
if (operationStatisticsVO.getFansNumber() == 0) {
if (operationStatisticsVO == null || operationStatisticsVO.getFansNumber() == 0) {
operationStatisticsVO = marketingWechatMicroblogInfoMapper.operationStatistics(marketingWechatMicroblogInfo.getOrganCode(), 1L, marketingWechatMicroblogInfo.getType());
}
return operationStatisticsVO;
@ -132,9 +132,9 @@ public class MarketingWechatMicroblogInfoServiceImpl implements IMarketingWechat
List<MarketingWechatMicroblogInfo> infoList = marketingWechatMicroblogInfoMapper.readStatistics(marketingWechatMicroblogInfo.getOrganCode(), marketingWechatMicroblogInfo.getType());
ReturnVO returnVO = new ReturnVO();
if (!CollectionUtils.isEmpty(infoList)) {
String name = "微内容阅读量分析";
if(marketingWechatMicroblogInfo.getType().equals("1")){
name = "微内容阅读量分析";
String name = "微内容阅读量分析";
if (marketingWechatMicroblogInfo.getType().equals("1")) {
name = "微内容阅读量分析";
}
List<LineVO> list = new ArrayList<>();
returnVO.setName(name);
@ -150,20 +150,20 @@ public class MarketingWechatMicroblogInfoServiceImpl implements IMarketingWechat
@Override
public OperationStatisticsVO operationStatisticsByCode(MarketingWechatMicroblogInfo marketingWechatMicroblogInfo) {
OperationStatisticsVO operationStatisticsVO = marketingWechatMicroblogInfoMapper.operationStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), 0L, marketingWechatMicroblogInfo.getType(),marketingWechatMicroblogInfo.getResourceCode());
if (operationStatisticsVO==null||operationStatisticsVO.getFansNumber() == 0) {
operationStatisticsVO = marketingWechatMicroblogInfoMapper.operationStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), 1L, marketingWechatMicroblogInfo.getType(),marketingWechatMicroblogInfo.getResourceCode());
OperationStatisticsVO operationStatisticsVO = marketingWechatMicroblogInfoMapper.operationStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), 0L, marketingWechatMicroblogInfo.getType(), marketingWechatMicroblogInfo.getResourceCode());
if (operationStatisticsVO == null || operationStatisticsVO.getFansNumber() == 0) {
operationStatisticsVO = marketingWechatMicroblogInfoMapper.operationStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), 1L, marketingWechatMicroblogInfo.getType(), marketingWechatMicroblogInfo.getResourceCode());
}
return operationStatisticsVO;
}
@Override
public ReturnVO readStatisticsByCode(MarketingWechatMicroblogInfo marketingWechatMicroblogInfo) {
List<MarketingWechatMicroblogInfo> infoList = marketingWechatMicroblogInfoMapper.readStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), marketingWechatMicroblogInfo.getType(),marketingWechatMicroblogInfo.getResourceCode());
List<MarketingWechatMicroblogInfo> infoList = marketingWechatMicroblogInfoMapper.readStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), marketingWechatMicroblogInfo.getType(), marketingWechatMicroblogInfo.getResourceCode());
ReturnVO returnVO = new ReturnVO();
if (!CollectionUtils.isEmpty(infoList)) {
String name = "微信内容阅读量分析";
if(marketingWechatMicroblogInfo.getType().equals("1")){
if (marketingWechatMicroblogInfo.getType().equals("1")) {
name = "微博内容阅读量分析";
}
List<LineVO> list = new ArrayList<>();
@ -180,11 +180,11 @@ public class MarketingWechatMicroblogInfoServiceImpl implements IMarketingWechat
@Override
public ReturnVO attentionStatisticsByCode(MarketingWechatMicroblogInfo marketingWechatMicroblogInfo) {
List<MarketingWechatMicroblogInfo> infoList = marketingWechatMicroblogInfoMapper.attentionStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), marketingWechatMicroblogInfo.getType(),marketingWechatMicroblogInfo.getResourceCode());
List<MarketingWechatMicroblogInfo> infoList = marketingWechatMicroblogInfoMapper.attentionStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), marketingWechatMicroblogInfo.getType(), marketingWechatMicroblogInfo.getResourceCode());
ReturnVO returnVO = new ReturnVO();
if (!CollectionUtils.isEmpty(infoList)) {
String name = "微信关注度分析";
if(marketingWechatMicroblogInfo.getType().equals("1")){
if (marketingWechatMicroblogInfo.getType().equals("1")) {
name = "微博关注度分析";
}
List<LineVO> list = new ArrayList<>();
@ -205,11 +205,11 @@ public class MarketingWechatMicroblogInfoServiceImpl implements IMarketingWechat
@Override
public ReturnVO transStatisticsByCode(MarketingWechatMicroblogInfo marketingWechatMicroblogInfo) {
List<MarketingWechatMicroblogInfo> infoList = marketingWechatMicroblogInfoMapper.transStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), marketingWechatMicroblogInfo.getType(),marketingWechatMicroblogInfo.getResourceCode());
List<MarketingWechatMicroblogInfo> infoList = marketingWechatMicroblogInfoMapper.transStatisticsByCode(marketingWechatMicroblogInfo.getOrganCode(), marketingWechatMicroblogInfo.getType(), marketingWechatMicroblogInfo.getResourceCode());
ReturnVO returnVO = new ReturnVO();
if (!CollectionUtils.isEmpty(infoList)) {
String name = "微信传播分析";
if(marketingWechatMicroblogInfo.getType().equals("1")){
if (marketingWechatMicroblogInfo.getType().equals("1")) {
name = "微博传播分析";
}
List<LineVO> list = new ArrayList<>();

@ -1,16 +1,17 @@
package com.cjy.vehicledata.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 交通车辆数据 对象 d_vehicle_data
*
*
* @author ruoyi
* @date 2023-03-08
*/
@ -23,8 +24,8 @@ public class VehicleData extends BaseEntity
private Long id;
/** 统计时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "统计时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "统计时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date statisticsTime;
/** 资源编码 */
@ -58,93 +59,93 @@ public class VehicleData extends BaseEntity
@Excel(name = "企业标识码 数据隔离使用的企业唯一标识")
private Long organCode;
public void setId(Long id)
public void setId(Long id)
{
this.id = id;
}
public Long getId()
public Long getId()
{
return id;
}
public void setStatisticsTime(Date statisticsTime)
public void setStatisticsTime(Date statisticsTime)
{
this.statisticsTime = statisticsTime;
}
public Date getStatisticsTime()
public Date getStatisticsTime()
{
return statisticsTime;
}
public void setResourceCode(Long resourceCode)
public void setResourceCode(Long resourceCode)
{
this.resourceCode = resourceCode;
}
public Long getResourceCode()
public Long getResourceCode()
{
return resourceCode;
}
public void setVehicleSpeed(Long vehicleSpeed)
public void setVehicleSpeed(Long vehicleSpeed)
{
this.vehicleSpeed = vehicleSpeed;
}
public Long getVehicleSpeed()
public Long getVehicleSpeed()
{
return vehicleSpeed;
}
public void setSpeedingNum(Long speedingNum)
public void setSpeedingNum(Long speedingNum)
{
this.speedingNum = speedingNum;
}
public Long getSpeedingNum()
public Long getSpeedingNum()
{
return speedingNum;
}
public void setSpeedingMileage(Long speedingMileage)
public void setSpeedingMileage(Long speedingMileage)
{
this.speedingMileage = speedingMileage;
}
public Long getSpeedingMileage()
public Long getSpeedingMileage()
{
return speedingMileage;
}
public void setRemarks(String remarks)
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
public String getRemarks()
{
return remarks;
}
public void setDelFlag(String delFlag)
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
public String getDelFlag()
{
return delFlag;
}
public void setDataSource(String dataSource)
public void setDataSource(String dataSource)
{
this.dataSource = dataSource;
}
public String getDataSource()
public String getDataSource()
{
return dataSource;
}
public void setOrganCode(Long organCode)
public void setOrganCode(Long organCode)
{
this.organCode = organCode;
}
public Long getOrganCode()
public Long getOrganCode()
{
return organCode;
}

@ -195,11 +195,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.credit_code AS creditCode,
t1.service_phone AS servicePhone,
t3.cover_img AS coverImg,
t3.introduction
t3.introduction,
t2.address,
t4.name as typeName
FROM
b_emergency_info AS t1
LEFT JOIN b_geography_info AS t2 ON t1.resource_code = t2.resource_code
LEFT JOIN b_graphic_info AS t3 ON t1.resource_code = t3.resource_code
LEFT join ti_resource_type as t4 on t1.type=t4.data_type
where t1.id = #{id} and t1.del_flag != '2'
</select>
<select id="selectEmergencyInfoByType" parameterType="EmergencyInfo" resultType="PlanEmergencyVO">
@ -209,7 +212,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectEmergencyInfoByTypeApplets" parameterType="EmergencyInfo" resultType="PlanEmergencyVO">
select t1.resource_code as code,t1.resource_name as name,t2.address as address
select t1.resource_code as code,t1.resource_name as name,t2.address as address,t1.id
from b_emergency_info as t1
left join b_geography_info as t2 on t1.resource_code = t2.resource_code

@ -95,25 +95,24 @@
ti_enterprise_resource_type t1
LEFT JOIN ti_resource_type t2 ON t1.resource_type_id = t2.id
<if test="dictValue == 'A01'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_tour_info GROUP BY type ) t3 ON t3.type = t2.data_type
LEFT JOIN ( SELECT type, count( * ) count FROM b_tour_info where del_flag !=2 GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A05'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_venue_info GROUP BY type ) t3 ON t3.type = t2.data_type
LEFT JOIN ( SELECT type, count( * ) count FROM b_venue_info where del_flag !=2 GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A10'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_public_service_info GROUP BY type ) t3 ON t3.type = t2.data_type
LEFT JOIN ( SELECT type, count( * ) count FROM b_public_service_info where del_flag !=2 GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A15'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_iot_info GROUP BY type ) t3 ON t3.type = t2.data_type
LEFT JOIN ( SELECT type, count( * ) count FROM b_iot_info where del_flag !=2 GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A20'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_emergency_info GROUP BY type ) t3 ON t3.type = t2.data_type
LEFT JOIN ( SELECT type, count( * ) count FROM b_emergency_info where del_flag !=2 GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
<if test="dictValue == 'A25'">
LEFT JOIN ( SELECT type, count( * ) count FROM b_tourist_info GROUP BY type UNION ALL SELECT type, count( * ) count FROM b_vehicle_info GROUP BY type UNION ALL SELECT 'guide' as type, count( * ) count FROM b_guide_info GROUP BY type ) t3 ON t3.type = t2.data_type
LEFT JOIN ( SELECT type, count( * ) count FROM b_tourist_info where del_flag !=2 GROUP BY type UNION ALL SELECT type, count( * ) count FROM b_vehicle_info where del_flag !=2 GROUP BY type UNION ALL SELECT 'guide' as type, count( * ) count FROM b_guide_info where del_flag !=2 GROUP BY type ) t3 ON t3.type = t2.data_type
</if>
WHERE
enterprise_id = #{organCode}
WHERE enterprise_id = #{organCode}
AND t2.dict_value = #{dictValue}
ORDER BY
t2.sort ASC
@ -125,4 +124,4 @@
ti_enterprise_resource_type t2 on t1.id = t2.resource_type_id
where t2.enterprise_id = #{organCode} and type_code in('A01','A02','A03','B01','B02','B03','B04','B05','B06','B07')
</select>
</mapper>
</mapper>

@ -185,13 +185,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="operationStatistics" resultType="com.cjy.marketingdata.domain.vo.OperationStatisticsVO">
SELECT t1.fans_number as fansNumber,IFNULL(t1.content_published_number,1) as contentPublishedNumber,
ROUND(IFNULL(t1.read_number,0)/IFNULL(t1.content_published_number,1),0) as avgReadNumber,
ROUND(IFNULL(t1.transpond_number,0)/IFNULL(t1.content_published_number,1),0) as avgTranspondNumber
SELECT SUM(t1.fans_number) as fansNumber,IFNULL(SUM(t1.content_published_number),1) as contentPublishedNumber,
ROUND(SUM(IFNULL(t1.read_number,0))/IFNULL(SUM(t1.content_published_number),1),0) as avgReadNumber,
ROUND(SUM(IFNULL(t1.transpond_number,0))/IFNULL(SUM(t1.content_published_number),1),0) as avgTranspondNumber
FROM md_marketing_wechat_microblog_info t1
WHERE t1.statistics_time >= DATE_ADD(CURRENT_DATE,INTERVAL -#{days} DAY)
AND t1.type = #{type}
AND t1.organ_code = #{organCode}
GROUP BY t1.statistics_time
</select>
<select id="readStatistics" resultType="com.cjy.marketingdata.domain.MarketingWechatMicroblogInfo">
SELECT DATE_FORMAT(t1.statistics_time,'%Y-%m-%d') as time,
@ -203,15 +204,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by t1.statistics_time asc
</select>
<select id="operationStatisticsByCode" resultType="com.cjy.marketingdata.domain.vo.OperationStatisticsVO">
SELECT IFNULL(SUM(t1.fans_number),0) as fansNumber,IFNULL(SUM(t1.content_published_number),0) as contentPublishedNumber,
ROUND(IFNULL(SUM(t1.read_number),0)/IFNULL(SUM(t1.content_published_number),1),0) as avgReadNumber,
ROUND(IFNULL(SUM(t1.transpond_number),0)/IFNULL(SUM(t1.content_published_number),1),0) as avgTranspondNumber
SELECT SUM(IFNULL(t1.fans_number,0)) as fansNumber,IFNULL(SUM(t1.content_published_number),1) as contentPublishedNumber,
ROUND(SUM(IFNULL(t1.read_number,0))/IFNULL(SUM(t1.content_published_number),1),0) as avgReadNumber,
ROUND(SUM(IFNULL(t1.transpond_number,0))/IFNULL(SUM(t1.content_published_number),1),0) as avgTranspondNumber
FROM md_marketing_wechat_microblog_info t1
LEFT JOIN md_marketing_media_config t2 ON t1.media_id =t2.id
WHERE t1.statistics_time >= DATE_ADD(CURRENT_DATE,INTERVAL -#{days} DAY)
AND t1.type = #{type}
<if test="type != null and type != ''"> AND t1.type = #{type} </if>
<if test="resourceCode != null and resourceCode != ''"> and t2.resource_code = #{resourceCode} </if>
AND t1.organ_code = #{organCode}
and t2.resource_code = #{resourceCode}
GROUP BY t1.statistics_time
</select>
<select id="readStatisticsByCode" resultType="com.cjy.marketingdata.domain.MarketingWechatMicroblogInfo">
SELECT DATE_FORMAT(t1.statistics_time,'%Y-%m-%d') as time,

@ -152,4 +152,5 @@ udp:
# 服务器采播端口8201
serverCapturePort: '0920'
# 上传文件所在位置
uploudUrl: F:\1303\uploadFile\
uploudUrl: F:\1303\uploadFile\
virtualDeviceId: '00001115'

@ -90,7 +90,15 @@ public class BaseController
rspData.setTotal(new PageInfo(list).getTotal());
return rspData;
}
protected TableDataInfo getDataTable(List<?> list,Integer count)
{
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(list);
rspData.setTotal(count);
return rspData;
}
/**
* 返回成功
*/

Loading…
Cancel
Save