Merge remote-tracking branch 'origin/master'
| | |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式 |
| | | String time = df.format(new Date());// new Date()为获取当前系统时间 |
| | | ArrayList<String> strings = pastDay(time); |
| | | String[] str={"医疗求助","火警","紧急求救","盗警","普通报警","交通","中心调度","系统测试","未知"}; |
| | | String[] str={"医疗求助","火警","紧急求救","盗警","普通报警","交通","中心调度","系统测试","电话报警"}; |
| | | Map<String, Object> maps = new HashMap<String, Object>(); |
| | | for (int j=0;j<strings.size();j++){ |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | |
| | | case "中心调度" : |
| | | map.put("中心调度",list.get(i).get("cou")); |
| | | break; |
| | | case "系统测试" : |
| | | map.put("系统测试",list.get(i).get("cou")); |
| | | case "电话报警" : |
| | | map.put("电话报警",list.get(i).get("cou")); |
| | | break; |
| | | default : |
| | | map.put("未知",list.get(i).get("cou")); |
| | |
| | | |
| | | List<Map<String, Object>> selectScount(String time); |
| | | |
| | | /** |
| | | * 查询警情总数 |
| | | * @return |
| | | */ |
| | | Integer selectAlarmCount(); |
| | | } |
| | |
| | | |
| | | |
| | | <update id="updateJtype"> |
| | | update sys_alarm SET jtype=1,czTime=#{czTime},bz=#{bz} where id=#{id} |
| | | </update> |
| | | update sys_alarm SET jtype=1,czTime=#{czTime},bz=#{bz} where id=#{id} |
| | | </update> |
| | | |
| | | <!--查询当天警情总数--> |
| | | <select id="selectAlarmCount" resultType="java.lang.Integer"> |
| | | SELECT count(*) FROM `sys_alarm` |
| | | where |
| | | waringType != '系统测试' |
| | | and |
| | | waringType!='主机重新上电' |
| | | and |
| | | to_days(alarmTime) = to_days(curdate()) |
| | | </select> |
| | | </mapper> |
| | |
| | | List<Map<String, Object>> selectScount(String time); |
| | | List<AlarmVO> selectListSe(String beginTime, String endTime); |
| | | void updateJtype(String id, String czTime, String bz); |
| | | |
| | | /** |
| | | * 查询警情总数 |
| | | * @param status 0:本日 1:本周 2:本月 |
| | | * @return |
| | | */ |
| | | Integer selectAlarmCount(Integer status); |
| | | } |
| | |
| | | package org.springblade.jfpt.alarm.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.jfpt.alarm.entity.Alarm; |
| | |
| | | import org.springblade.jfpt.alarm.vo.AlarmVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | baseMapper.updateJtype(id,czTime,bz); |
| | | } |
| | | |
| | | /** |
| | | * 查询警情总数 |
| | | * @param status 0:本日 1:本周 2:本月 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer selectAlarmCount(Integer status) { |
| | | return baseMapper.selectAlarmCount(); |
| | | } |
| | | } |
| | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.jfpt.alarm.service.IAlarmService; |
| | | import org.springblade.jfpt.catalog.entitly.catalog; |
| | | import org.springblade.jfpt.catalog.service.catalogService; |
| | | import org.springblade.jfpt.catalog.vo.catalogVO; |
| | | import org.springblade.jfpt.equipment.service.IEquipmentService; |
| | | import org.springblade.jfpt.parcel.service.ParcelService; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | import org.springblade.system.vo.DeptVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springblade.jfpt.catalog.wrapper.catalogWrapper; |
| | |
| | | public class catalogController extends BladeController { |
| | | |
| | | private final org.springblade.jfpt.catalog.service.catalogService catalogService; |
| | | |
| | | private final IAlarmService iAlarmService; |
| | | |
| | | private final ParcelService parcelService; |
| | | |
| | | private final IEquipmentService iEquipmentService; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | mapa.put("backgroundColor","#F56C6C"); |
| | | mapa.put("prefixText","警情总数"); |
| | | mapa.put("suffixText","条"); |
| | | |
| | | mape.put("value",list1.get(1).get("counta")); |
| | | mape.put("backgroundColor","#67C23A"); |
| | | mape.put("prefixText","设备总数"); |
| | |
| | | |
| | | |
| | | /** |
| | | * 系统首页展示条各个总数 |
| | | * @time 2021-03-12 arsn新增 |
| | | * @param response |
| | | * @param conditionVo 条件 status 0:本日 1:本周 2:本月 |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectIndexCount") |
| | | public R selectIndexCount(HttpServletResponse response, ConditionVo conditionVo) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | if (conditionVo.getStatus()!=null){ |
| | | //数据返回 |
| | | return R.data(getIndexCountData(conditionVo)); |
| | | } |
| | | //数据返回 |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 按时间条件查询统计数据 |
| | | * @param conditionVo 条件 status 0:本日 1:本周 2:本月 |
| | | * @return |
| | | */ |
| | | private List<Map<String, Object>> getIndexCountData(ConditionVo conditionVo) { |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | Map<String, Object> mapa = new HashMap<String, Object>(); |
| | | Map<String, Object> mape = new HashMap<String, Object>(); |
| | | Map<String, Object> maps = new HashMap<String, Object>(); |
| | | Map<String, Object> mapse = new HashMap<String, Object>(); |
| | | Integer alarmCount = null; |
| | | List<Integer> parcelCount = new ArrayList<>(); |
| | | Integer contrabandCount = null; |
| | | Integer equipmentCount = null; |
| | | Integer status = conditionVo.getStatus(); |
| | | if (conditionVo.getStatus()==0){ |
| | | //1.查询警情总数 |
| | | alarmCount = iAlarmService.selectAlarmCount(status); |
| | | //2.查询包裹总数,违禁品总数 |
| | | parcelCount = parcelService.selectParcelCount(status); |
| | | //3.查询在线设备总数 |
| | | equipmentCount = iEquipmentService.selectEquipmentCount(status); |
| | | |
| | | } |
| | | //1.警情总数 |
| | | mapa.put("value",alarmCount); |
| | | mapa.put("backgroundColor","#F56C6C"); |
| | | mapa.put("prefixText","今日警情总数"); |
| | | mapa.put("suffixText","条"); |
| | | |
| | | //2.包裹总数 |
| | | mape.put("value",parcelCount.get(0)); |
| | | mape.put("backgroundColor","#67C23A"); |
| | | mape.put("prefixText","今日违禁包裹总数"); |
| | | mape.put("suffixText","个"); |
| | | |
| | | //3.违禁品总数 |
| | | maps.put("value",parcelCount.get(1)); |
| | | maps.put("backgroundColor","#E6A23C"); |
| | | maps.put("prefixText","今日违禁物品总数"); |
| | | maps.put("suffixText","个"); |
| | | |
| | | //4.在线设备总数 |
| | | mapse.put("value",equipmentCount); |
| | | mapse.put("backgroundColor","#409EFF"); |
| | | mapse.put("prefixText","在线设备总数"); |
| | | mapse.put("suffixText","个"); |
| | | //数据存入集合 |
| | | lists.add(mapa); |
| | | lists.add(mape); |
| | | lists.add(maps); |
| | | lists.add(mapse); |
| | | return lists; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 按行政区统计用户数量 |
| | | * @param response |
| | | * @return |
| | |
| | | */ |
| | | List<EquipmentVOS> selectList(String deviceType); |
| | | void updateChannel(String heartbeat, String deviceNumber); |
| | | |
| | | /** |
| | | * 查询在线设备总数 |
| | | * @param status 状态码 0:本日 1:本周 2:本月 |
| | | * @return |
| | | */ |
| | | Integer selectEquipmentCount(Integer status); |
| | | } |
| | |
| | | import org.springblade.jfpt.equipment.service.IEquipmentService; |
| | | import org.springblade.jfpt.equipment.vo.EquipmentVO; |
| | | import org.springblade.jfpt.equipment.vo.EquipmentVOS; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Service |
| | | public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment> implements IEquipmentService { |
| | | private static final String PARENT_ID = "parentId"; |
| | | |
| | | //时间差 |
| | | private long TIME_DIFFERENCE = 24*3600*1000; |
| | | |
| | | @Override |
| | | public IPage<EquipmentVO> selectEquipmentPage(IPage<EquipmentVO> page, EquipmentVO equipment,List childList) { |
| | |
| | | baseMapper.updateChannel(heartbeat, deviceNumber); |
| | | } |
| | | |
| | | /** |
| | | * 查询在线设备总数 |
| | | * @param status 状态码 0:本日 1:本周 2:本月 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer selectEquipmentCount(Integer status) { |
| | | //先查询所有的设备 |
| | | List<EquipmentVO> equipmentVOS = baseMapper.listAll(); |
| | | long time = new Date().getTime(); |
| | | int equipmentCount = 0; |
| | | long hearbeat = 0; |
| | | //遍历集合数据,对比心跳时间,得出在线的设备数量 |
| | | if (status==0){ |
| | | for (EquipmentVO e:equipmentVOS) { |
| | | try { |
| | | hearbeat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(e.getHeartbeat()).getTime(); |
| | | } catch (ParseException parseException) { |
| | | parseException.printStackTrace(); |
| | | } |
| | | //对比心跳时间 |
| | | if (time-hearbeat<TIME_DIFFERENCE){ |
| | | equipmentCount+=1; |
| | | } |
| | | } |
| | | } |
| | | //返回数据 |
| | | return equipmentCount; |
| | | } |
| | | } |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | |
| | | return R.success("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * APP警情反馈信息 |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectFeedEdit") |
| | | public R selectFeedEdit(HttpServletResponse response,String jid) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | List<FeedbackVO> feedbackVOS = feedbackService.selectFeedEdit(jid); |
| | | return R.data(feedbackVOS); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | List<FeedbackVO> selectFeedbackPage(IPage page, FeedbackVO feedback); |
| | | List<FeedbackVO> selectFeedList(); |
| | | List<FeedbackVO> selectFeedEdit(String jid); |
| | | void insertfeed(String jid, String snumber, String sname, String addvcd, String place, String result, String describe, String type, String devicenumber, String galarmpeople, String phone, String stime, |
| | | String ctime, String feedbackaudio, String feedbackvideo, String feedbackphoto, String jd, String wd, String tname); |
| | | } |
| | |
| | | <select id="selectFeedList" resultMap="feedbackResultMaps"> |
| | | select f.*,d.addvnm from sys_feedback f left join sys_district d on d.addvcd=f.addvcd |
| | | </select> |
| | | |
| | | <!--App警情反馈信息--> |
| | | <select id="selectFeedEdit" resultMap="feedbackResultMaps"> |
| | | SELECT |
| | | f.*, |
| | | w.address |
| | | FROM |
| | | sys_feedback f |
| | | LEFT JOIN sys_wj w ON w.jid = f.jid WHERE f.jid=#{jid} |
| | | </select> |
| | | </mapper> |
| | |
| | | void insertfeed(String jid, String snumber, String sname, String addvcd, String place, String result, String describe, String type, String devicenumber, String galarmpeople, String phone, String stime, |
| | | String ctime, String feedbackaudio, String feedbackvideo, String feedbackphoto, String jd, String wd, String tname); |
| | | List<FeedbackVO> selectFeedList(); |
| | | List<FeedbackVO> selectFeedEdit(String jid); |
| | | } |
| | |
| | | return baseMapper.selectFeedList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<FeedbackVO> selectFeedEdit(String jid) { |
| | | return baseMapper.selectFeedEdit(jid); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String addvnm; |
| | | private String address; |
| | | |
| | | } |
| | |
| | | @ApiOperation(value = "新增或修改", notes = "传入jingdan") |
| | | public R submit(@Valid @RequestBody Jingdan jingdan) { |
| | | //return R.status(jingdanService.saveOrUpdate(jingdan)); |
| | | |
| | | if ("".equals(jingdan.getType())){ |
| | | jingdan.setType("0"); |
| | | } |
| | | if (jingdan.getCzTime() != null && jingdan.getCzTime().equals("")){ |
| | | jingdan.setCzTime(null); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Object getParcelStatis(ConditionVo conditionVo); |
| | | |
| | | /** |
| | | * 查询包裹总数,违禁品总数 |
| | | * @param status 状态码 0:本天 1:本周 2:本月 |
| | | * @return |
| | | */ |
| | | List<Integer> selectParcelCount(Integer status); |
| | | |
| | | } |
| | |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import static org.springblade.core.tool.utils.DateUtil.now; |
| | | |
| | | /** |
| | | * 包裹服务实现层 |
| | |
| | | List<String> listTime = new ArrayList<>(); |
| | | List<Map<String,Object>> parcelList = new ArrayList<>(); |
| | | if (conditionVo.getStatus() == 1) { |
| | | //3.获取本周开始时间和结束时间的每一天数组 |
| | | listTime = DateUtils.pastDay(DateUtils.getWeekEnd()); |
| | | //3.获取今天之前的每一天数组 2021-3-12 arsn修改 |
| | | listTime = DateUtils.pastDay(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); |
| | | List<String> percelTimeList = new ArrayList<>(); |
| | | for (Object object:objectList) { |
| | | //4.取出list里面的值转为map |
| | |
| | | startDate = DateUtils.getToday(); |
| | | endDate = DateUtils.getToday(); |
| | | } |
| | | //2.2查询本周内每天的数据 |
| | | //2.2查询过去6天及当天的的数据 |
| | | if (conditionVo.getStatus() == 1) { |
| | | //3.获取本周开始时间和结束时间 |
| | | startDate = DateUtils.getWeekStart(); |
| | | endDate = DateUtils.getWeekEnd(); |
| | | //3.获取过去6天及当天开始时间和结束时间 |
| | | startDate = DateUtils.getPastDate(6,now()); |
| | | endDate = DateUtils.getToday(); |
| | | } |
| | | //2.2查询本月的数据 |
| | | if (conditionVo.getStatus() == 2) { |
| | |
| | | Map<String, Object> data = (Map<String, Object>) JSONObject.parse(params); |
| | | return JSON.parseArray(data.get("result").toString()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询包裹,违禁品总数 |
| | | * @param status 状态码 0:本天 1:本周 2:本月 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Integer> selectParcelCount(Integer status) { |
| | | List<Integer> list = new ArrayList<>(); |
| | | ConditionVo conditionVo = new ConditionVo(); |
| | | conditionVo.setStatus(status); |
| | | //获取包裹数据 |
| | | List<Object> parcelData = getParcelData(conditionVo, PARCEL_URL, PARCEL_KEY, PARCEL_SECRET); |
| | | //查询当天的包裹总数 |
| | | Integer dangerCount = null; |
| | | Integer contrabandCount = null; |
| | | if (status == 0) { |
| | | for (Object object : parcelData) { |
| | | //取出list里面的值转为map |
| | | Map<String, Object> objectMap = (Map<String, Object>) object; |
| | | dangerCount = Integer.parseInt(objectMap.get("dangerCount").toString()); //违禁包裹数量 |
| | | contrabandCount = Integer.parseInt(objectMap.get("contrabandCount").toString()); //违禁物品数量 |
| | | } |
| | | } |
| | | //封装数据 |
| | | list.add(dangerCount); |
| | | list.add(contrabandCount); |
| | | //返回数据 |
| | | return list; |
| | | } |
| | | } |
| | |
| | | |
| | | #°ü¹ü½Ó¿ÚÃØÔ¿³£Á¿²ÎÊý |
| | | PARCEL_KEY=X-AISP-T |
| | | PARCEL_SECRET=A3_2f718467f64b82e7a3cb38bf77702c2a1615339643687 |
| | | #PARCEL_SECRET=A3_2f718467f64b82e7a3cb38bf77702c2a1615339643687 |
| | | PARCEL_SECRET=A3_a10f15e56deefe37913884d98d3e9df31615529561666 |
| | | |
| | | #²éѯijÆÚ¼äµÄÎ¥½ûÎïÆ·Í³¼Æ URL |
| | | PARCEL_CONTRABAND_URL=http://113.105.119.25:90/backstage-temporary-api/machineStat/queryMachineDayContrabandStat |
| | | |
| | | #PARCEL_CONTRABAND_URL=http://113.105.119.25:90/backstage-temporary-api/machineStat/queryMachineDayContrabandStat |
| | | PARCEL_CONTRABAND_URL=http://fengkong.sf-express.com/backstage-temporary-api/machineStat/queryMachineDayContrabandStat |
| | | #²éѯijÆÚ¼äµÄ°ü¹üͳ¼Æ URL |
| | | PARCEL_URL=http://113.105.119.25:90/backstage-temporary-api/machineStat/queryMachineDayStat |
| | | #PARCEL_URL=http://113.105.119.25:90/backstage-temporary-api/machineStat/queryMachineDayStat |
| | | PARCEL_URL=http://fengkong.sf-express.com/backstage-temporary-api/machineStat/queryMachineDayStat |