Forráskód Böngészése

视频平台对接

root 3 éve
szülő
commit
1fdb86bd0e

+ 135 - 67
src/main/java/com/zhiqiyun/open/config/WebMvcConfig.java

@@ -1,6 +1,11 @@
 package com.zhiqiyun.open.config;
 
 
+import com.alibaba.fastjson.serializer.SerializeConfig;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
+import com.alibaba.fastjson.support.config.FastJsonConfig;
+import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
 import com.fasterxml.jackson.core.JsonGenerator;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.JsonSerializer;
@@ -12,8 +17,11 @@ import com.zhiqiyun.open.utils.ServletContext;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
 import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
 import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
 import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
 import org.springframework.lang.NonNull;
@@ -26,7 +34,10 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.TimeZone;
 
 /**
  * 系统启动配置
@@ -37,72 +48,129 @@ import java.util.List;
 @Configuration
 public class WebMvcConfig extends DelegatingWebMvcConfiguration {
 
-	@Value("${uploader.save-path}")
-	private String uploaderSavePath;
-
-	@Autowired
-	private OauthInterceptor oauthInterceptor;
-
-	@Override
-	protected void addResourceHandlers(ResourceHandlerRegistry registry) {
-		registry.addResourceHandler("/**").addResourceLocations("classpath:/public/");
-		registry.addResourceHandler("/src/**").addResourceLocations(String.format("file:%s/", this.uploaderSavePath));
-		super.addResourceHandlers(registry);
-	}
-
-	@Override
-	public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
-		converters.removeIf(converter -> converter instanceof MappingJackson2HttpMessageConverter);
-		ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().build();
-
-		objectMapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
-
-		SimpleModule module = new SimpleModule();
-		module.addSerializer(IBaseEnum.class, new JsonSerializer<IBaseEnum>() {
-			@Override
-			public void serialize(IBaseEnum value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
-				gen.writeStartObject();
-				gen.writeObjectField("value", value.getValue());
-				gen.writeStringField("text", value.getText());
-				gen.writeStringField("name", value.getName());
-				gen.writeEndObject();
-			}
-		});
-		objectMapper.registerModule(module);
-
-		MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(objectMapper);
-		converters.add(converter);
-		log.info("{}", converters.size());
-		super.configureMessageConverters(converters);
-	}
-
-
-	@Override
-	public void addInterceptors(InterceptorRegistry registry) {
-		registry.addInterceptor(new HandlerInterceptor() {
-			@Override
-			public boolean preHandle(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler) {
-				ServletContext.init(request, response);
-				return true;
-			}
-
-			@Override
-			public void afterCompletion(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler, Exception ex) {
-				ServletContext.clean();
-			}
-		}).addPathPatterns("/**").excludePathPatterns("/src/**", "/index.html");
-		registry.addInterceptor(this.oauthInterceptor).addPathPatterns("/**").excludePathPatterns("/src/**", "/index.html");
-		super.addInterceptors(registry);
-	}
-
-	@Override
-	public void addCorsMappings(CorsRegistry registry) {
-		registry.addMapping("/**")
-				.allowedOriginPatterns("*")
-				.allowCredentials(true)
-				.allowedMethods("GET", "POST", "DELETE", "PUT", "PATCH")
-				.maxAge(3600);
-		super.addCorsMappings(registry);
-	}
+    @Value("${uploader.save-path}")
+    private String uploaderSavePath;
+
+    @Autowired
+    private OauthInterceptor oauthInterceptor;
+
+    @Override
+    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("/**").addResourceLocations("classpath:/public/");
+        registry.addResourceHandler("/src/**").addResourceLocations(String.format("file:%s/", this.uploaderSavePath));
+        super.addResourceHandlers(registry);
+    }
+
+    @Override
+    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
+        converters.removeIf(converter -> converter instanceof MappingJackson2HttpMessageConverter);
+        ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().build();
+
+        objectMapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
+
+        SimpleModule module = new SimpleModule();
+        module.addSerializer(IBaseEnum.class, new JsonSerializer<IBaseEnum>() {
+            @Override
+            public void serialize(IBaseEnum value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
+                gen.writeStartObject();
+                gen.writeObjectField("value", value.getValue());
+                gen.writeStringField("text", value.getText());
+                gen.writeStringField("name", value.getName());
+                gen.writeEndObject();
+            }
+        });
+        objectMapper.registerModule(module);
+
+        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(objectMapper);
+        converters.add(converter);
+        log.info("{}", converters.size());
+        super.configureMessageConverters(converters);
+    }
+
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(new HandlerInterceptor() {
+            @Override
+            public boolean preHandle(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler) {
+                ServletContext.init(request, response);
+                return true;
+            }
+
+            @Override
+            public void afterCompletion(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler, Exception ex) {
+                ServletContext.clean();
+            }
+        }).addPathPatterns("/**").excludePathPatterns("/src/**", "/index.html");
+        registry.addInterceptor(this.oauthInterceptor).addPathPatterns("/**").excludePathPatterns("/src/**", "/index.html");
+        super.addInterceptors(registry);
+    }
+
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**")
+                .allowedOriginPatterns("*")
+                .allowCredentials(true)
+                .allowedMethods("GET", "POST", "DELETE", "PUT", "PATCH")
+                .maxAge(3600);
+        super.addCorsMappings(registry);
+    }
+
+    @Override
+    public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
+        for (int i = converters.size() - 1; i >= 0; i--) {
+            if (converters.get(i) instanceof MappingJackson2HttpMessageConverter) {
+                converters.remove(i);
+            }
+        }
+        //自定义fastjson配置
+        FastJsonConfig config = new FastJsonConfig();
+        config.setSerializerFeatures(
+                // 是否输出值为null的字段,默认为false,我们将它打开
+                SerializerFeature.WriteMapNullValue,
+                // 将Collection类型字段的字段空值输出为[]
+                SerializerFeature.WriteNullListAsEmpty,
+                // 将字符串类型字段的空值输出为空字符串
+                SerializerFeature.WriteNullStringAsEmpty,
+//                // 将数值类型字段的空值输出为0
+//                SerializerFeature.WriteNullNumberAsZero,
+                SerializerFeature.WriteDateUseDateFormat,
+                // 禁用循环引用
+                SerializerFeature.DisableCircularReferenceDetect
+        );
+
+        //FastJson 配置Long转String类型 , 解决前后端交互, id过长,失去精度的问题
+        SerializeConfig serializeConfig = SerializeConfig.globalInstance;
+        serializeConfig.put(Long.class, com.alibaba.fastjson.serializer.ToStringSerializer.instance);
+        serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
+        config.setSerializeConfig(serializeConfig);
+
+        // 添加支持的MediaTypes;不添加时默认为*/*,也就是默认支持全部
+        // 但是MappingJackson2HttpMessageConverter里面支持的MediaTypes为application/json
+        List<MediaType> fastMediaTypes = new ArrayList<>();
+        fastMediaTypes.add(MediaType.APPLICATION_JSON);
+        fastMediaTypes.add(MediaType.APPLICATION_ATOM_XML);
+        fastMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);
+        fastMediaTypes.add(MediaType.APPLICATION_OCTET_STREAM);
+        fastMediaTypes.add(MediaType.APPLICATION_PDF);
+        fastMediaTypes.add(MediaType.APPLICATION_RSS_XML);
+        fastMediaTypes.add(MediaType.APPLICATION_XHTML_XML);
+        fastMediaTypes.add(MediaType.APPLICATION_XML);
+        fastMediaTypes.add(MediaType.IMAGE_GIF);
+        fastMediaTypes.add(MediaType.IMAGE_JPEG);
+        fastMediaTypes.add(MediaType.IMAGE_PNG);
+        fastMediaTypes.add(MediaType.TEXT_EVENT_STREAM);
+        fastMediaTypes.add(MediaType.TEXT_HTML);
+        fastMediaTypes.add(MediaType.TEXT_MARKDOWN);
+        fastMediaTypes.add(MediaType.TEXT_PLAIN);
+        fastMediaTypes.add(MediaType.TEXT_XML);
+
+        FastJsonHttpMessageConverter fastJsonHttpMessageConverter = new FastJsonHttpMessageConverter();
+        fastJsonHttpMessageConverter.setFastJsonConfig(config);
+        fastJsonHttpMessageConverter.setSupportedMediaTypes(fastMediaTypes);
+        converters.add(fastJsonHttpMessageConverter);
+        //支持XML格式的请求
+        converters.add(new StringHttpMessageConverter());
+    }
 }
 

+ 21 - 0
src/main/java/com/zhiqiyun/open/core/mapper/equipment/EquipmentPassengerMapper.java

@@ -1,9 +1,30 @@
 package com.zhiqiyun.open.core.mapper.equipment;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zhiqiyun.open.core.models.EchartsModel;
 import com.zhiqiyun.open.core.models.equipment.EquipmentPassenger;
+import com.zhiqiyun.open.mvc.params.equipment.QueryEquipmentPassengerParams;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
 
 @Mapper
 public interface EquipmentPassengerMapper extends BaseMapper<EquipmentPassenger> {
+
+    @Select("SELECT sr.id, sr.`name` AS brief,sr.pic AS litpic,sr.org_id AS placeBaseInfoId FROM liucheng_smart.supplier sr ${ew.customSqlSegment} order by sr.create_date desc")
+    Page<EquipmentPassenger> pageList(Page<EquipmentPassenger> page, @Param("ew") QueryWrapper<EquipmentPassenger> queryWrapper);
+
+    @Select("SELECT sfv.field_value FROM liucheng_smart.sys_field_value sfv where sfv.is_deleted = 0 and sfv.bind_id = #{id} and sfv.type = 2 and sfv.field_type = 8")
+    String loadLatLng(Long id);
+
+    @Select("select h.festival as `label`,sfv.field_value as `value` FROM liucheng_smart.industry_institution_manage im, liucheng_smart.hy_product_reporting h left join liucheng_smart.sys_field_value sfv on sfv.bind_id = h.id and sfv.type = 4 and sfv.field_key = 'passengers_num' where h.is_deleted = 0 and h.type = 3 and h.parent_id = im.id and im.org_id = #{orgId}")
+    List<EchartsModel> numberOfHolidayVisitors(Long orgId);
+
+    @Select("")
+    Map<String, Object> realTimeSurvey(Long orgId);
 }

+ 12 - 0
src/main/java/com/zhiqiyun/open/core/mapper/statistics/ComplaintInfoMapper.java

@@ -1,9 +1,21 @@
 package com.zhiqiyun.open.core.mapper.statistics;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.zhiqiyun.open.core.models.statistics.ComplaintInfo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.Map;
 
 @Mapper
 public interface ComplaintInfoMapper extends BaseMapper<ComplaintInfo> {
+
+    @Select("select a.*,b.nick_name,b.avatar,c.login_account,ubi.nick_name restoreNickName from liucheng_smart.complaint a" +
+            " LEFT JOIN liucheng_smart.user_base_info b on a.uid=b.id" +
+            " LEFT JOIN liucheng_smart.user_base_info ubi on a.restore_uid=ubi.id" +
+            " LEFT JOIN liucheng_smart.user_login_account c on c.uid=b.id and c.account_type = 1 ${ew.customSqlSegment}")
+    Page<Map<String,Object>> pageList(Page<ComplaintInfo> page, @Param("ew") QueryWrapper<ComplaintInfo> queryWrapper);
 }

+ 20 - 0
src/main/java/com/zhiqiyun/open/core/models/EchartsModel.java

@@ -0,0 +1,20 @@
+package com.zhiqiyun.open.core.models;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author xin yang
+ * @date 2022/8/19
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class EchartsModel implements Serializable {
+
+    private String label;
+
+    private BigDecimal value;
+}

+ 6 - 0
src/main/java/com/zhiqiyun/open/core/service/ComplaintInfoService.java

@@ -1,7 +1,13 @@
 package com.zhiqiyun.open.core.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhiqiyun.open.core.models.statistics.ComplaintInfo;
 
+import java.util.Map;
+
 public interface ComplaintInfoService extends IService<ComplaintInfo> {
+
+    Page<Map<String,Object>> pageList(Page<ComplaintInfo> page, QueryWrapper<ComplaintInfo> queryWrapper);
 }

+ 36 - 0
src/main/java/com/zhiqiyun/open/core/service/EquipmentPassengerService.java

@@ -1,7 +1,43 @@
 package com.zhiqiyun.open.core.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhiqiyun.open.core.models.EchartsModel;
 import com.zhiqiyun.open.core.models.equipment.EquipmentPassenger;
 
+import java.util.List;
+import java.util.Map;
+
 public interface EquipmentPassengerService extends IService<EquipmentPassenger> {
+
+    /**
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    Page<EquipmentPassenger> pageList(Page<EquipmentPassenger> page, QueryWrapper<EquipmentPassenger> queryWrapper);
+
+    /**
+     * 获取景区坐标
+     *
+     * @param id id
+     * @return
+     */
+    String loadLatLng(Long id);
+
+    /**
+     * 景区节假日
+     *
+     * @return List<EchartsModel>
+     */
+    List<EchartsModel> numberOfHolidayVisitors(Long orgId);
+
+    /**
+     * 实时概况
+     *
+     * @param orgId orgId
+     * @return
+     */
+    Map<String, Object> realTimeSurvey(Long orgId);
 }

+ 8 - 0
src/main/java/com/zhiqiyun/open/core/service/impl/ComplaintInfoServiceImpl.java

@@ -1,11 +1,19 @@
 package com.zhiqiyun.open.core.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zhiqiyun.open.core.mapper.statistics.ComplaintInfoMapper;
 import com.zhiqiyun.open.core.models.statistics.ComplaintInfo;
 import com.zhiqiyun.open.core.service.ComplaintInfoService;
 import org.springframework.stereotype.Service;
 
+import java.util.Map;
+
 @Service
 public class ComplaintInfoServiceImpl extends ServiceImpl<ComplaintInfoMapper, ComplaintInfo> implements ComplaintInfoService {
+    @Override
+    public Page<Map<String,Object>> pageList(Page<ComplaintInfo> page, QueryWrapper<ComplaintInfo> queryWrapper) {
+        return baseMapper.pageList(page, queryWrapper);
+    }
 }

+ 25 - 0
src/main/java/com/zhiqiyun/open/core/service/impl/EquipmentPassengerServiceImpl.java

@@ -1,17 +1,22 @@
 package com.zhiqiyun.open.core.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zhiqiyun.open.core.mapper.equipment.EquipmentPassengerMapper;
 import com.zhiqiyun.open.core.mapper.equipment.EquipmentPassengerPeopleMapper;
+import com.zhiqiyun.open.core.models.EchartsModel;
 import com.zhiqiyun.open.core.models.equipment.EquipmentPassenger;
 import com.zhiqiyun.open.core.models.equipment.EquipmentPassengerPeople;
 import com.zhiqiyun.open.core.service.EquipmentPassengerService;
+import com.zhiqiyun.open.mvc.params.equipment.QueryEquipmentPassengerParams;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Collection;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @author jtoms
@@ -29,4 +34,24 @@ public class EquipmentPassengerServiceImpl extends ServiceImpl<EquipmentPassenge
         this.equipmentPassengerPeopleMapper.delete(wrapper);
         return super.removeByIds(list);
     }
+
+    @Override
+    public Page<EquipmentPassenger> pageList(Page<EquipmentPassenger> page, QueryWrapper<EquipmentPassenger> queryWrapper) {
+        return this.baseMapper.pageList(page, queryWrapper);
+    }
+
+    @Override
+    public String loadLatLng(Long id) {
+        return this.baseMapper.loadLatLng(id);
+    }
+
+    @Override
+    public List<EchartsModel> numberOfHolidayVisitors(Long orgId) {
+        return baseMapper.numberOfHolidayVisitors(orgId);
+    }
+
+    @Override
+    public Map<String, Object> realTimeSurvey(Long orgId) {
+        return null;
+    }
 }

+ 11 - 24
src/main/java/com/zhiqiyun/open/mvc/controller/ComplaintController.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.zhiqiyun.open.annotation.Permission;
-import com.zhiqiyun.open.core.enmus.ComplaintState;
 import com.zhiqiyun.open.core.models.statistics.ComplaintInfo;
 import com.zhiqiyun.open.core.service.ComplaintInfoService;
 import com.zhiqiyun.open.core.service.SequenceService;
@@ -12,7 +11,6 @@ import com.zhiqiyun.open.mvc.Result;
 import com.zhiqiyun.open.mvc.params.statistics.QueryComplaintInfoParams;
 import com.zhiqiyun.open.mvc.params.statistics.SaveComplaintInfoParams;
 import com.zhiqiyun.open.utils.DateUtil;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -22,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
 import java.util.List;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/statistics/complaint")
@@ -38,31 +37,19 @@ public class ComplaintController {
     public Result findPage(@RequestBody QueryComplaintInfoParams params) {
 
         QueryWrapper<ComplaintInfo> wrapper = new QueryWrapper<>();
-
-        if (StringUtils.isNotBlank(params.getTitle())) {
-            wrapper.like("contact", params.getTitle());
-        }
-//        if (StringUtils.isNotBlank(params.getCategory())) {
-//            wrapper.like("category", params.getCategory());
-//        }
-//        if (StringUtils.isNotBlank(params.getChannel())) {
-//            wrapper.like("channel", params.getChannel());
-//        }
-        if (params.getState() != null) {
-            wrapper.eq("state", params.getState());
-        }
+        wrapper.orderByDesc("a.create_date");
+        wrapper.eq("a.is_deleted", 0);
+        wrapper.eq("a.big_type", 3);
         if (params.getCreatedTime() != null) {
-            wrapper.between("complaint_date", params.getCreatedTime().getStatDate(), params.getCreatedTime().getEndDate());
-        }
-        if (params.getProcessedTime() != null) {
-            wrapper.between("acceptance_time", params.getProcessedTime().getStatDate(), params.getProcessedTime().getEndDate());
+            if (params.getCreatedTime().getStatDate() != null) {
+                wrapper.ge("a.create_date", params.getCreatedTime().getStatDate());
+            }
+            if (params.getCreatedTime().getEndDate() != null) {
+                wrapper.lt("a.create_date", params.getCreatedTime().getEndDate());
+            }
         }
-
         Page<ComplaintInfo> page = params.getPage();
-        page.addOrder(OrderItem.desc("id"));
-
-        Page<ComplaintInfo> resultData = this.complaintInfoService.page(page, wrapper);
-
+        Page<Map<String, Object>> resultData = this.complaintInfoService.pageList(page, wrapper);
         return Result.instance(Result.Code.SUCCESS).setData(resultData);
     }
 

+ 164 - 152
src/main/java/com/zhiqiyun/open/mvc/controller/EquipmentPassengerController.java

@@ -39,174 +39,186 @@ import java.util.Map;
 @RequestMapping("/equipment/passenger")
 public class EquipmentPassengerController {
 
-	@Autowired
-	private EquipmentPassengerService equipmentPassengerService;
-
-	@Autowired
-	private EquipmentPassengerPeopleService equipmentPassengerPeopleService;
-
-	@Autowired
-	private SequenceService sequenceService;
-
-	@Autowired
-	private OauthService oauthService;
-
-	@Permission(value = "equipment.passenger.find", tags = "查询人流采集设备")
-	@PostMapping("/findPage")
-	public Result findPage(@RequestBody QueryEquipmentPassengerParams params) {
-
-		QueryWrapper<EquipmentPassenger> queryWrapper = new QueryWrapper<>();
-
-		if (StringUtils.isNotBlank(params.getBrief())) {
-			queryWrapper.like("brief", params.getBrief());
-		}
-		if (params.getPlaceBaseInfoId() != null) {
-			queryWrapper.eq("place_base_info_id", params.getPlaceBaseInfoId());
-		}
-
-		Page<EquipmentPassenger> page = params.getPage();
-		page.addOrder(OrderItem.desc("id"));
-
-		Page<EquipmentPassenger> resultData = this.equipmentPassengerService.page(page, queryWrapper);
-		QueryWrapper<EquipmentPassengerPeople> passengerWrapper;
-		for (EquipmentPassenger equipment : resultData.getRecords()) {
-			passengerWrapper = new QueryWrapper<>();
-			passengerWrapper.eq("equipment_id", equipment.getId());
-			passengerWrapper.eq("passenger_type", PassengerType.IN);
-			if (params.getRangeDate() != null) {
-				passengerWrapper.between("created_time", params.getRangeDate().getStatDate(), params.getRangeDate().getEndDate());
-			}
-			Long inPeopleCount = this.equipmentPassengerPeopleService.count(passengerWrapper);
-
-
-			passengerWrapper = new QueryWrapper<>();
-			passengerWrapper.eq("equipment_id", equipment.getId());
-			passengerWrapper.eq("passenger_type", PassengerType.OUT);
-			if (params.getRangeDate() != null) {
-				passengerWrapper.between("created_time", params.getRangeDate().getStatDate(), params.getRangeDate().getEndDate());
-			}
-			Long outPeopleCount = this.equipmentPassengerPeopleService.count(passengerWrapper);
-
-			equipment.setInPeopleCount(inPeopleCount);
-			equipment.setOutPeopleCount(outPeopleCount);
-		}
-
-		return Result.instance(Result.Code.SUCCESS).setData(resultData);
-	}
-
-	@Permission(value = "equipment.passenger.find", tags = "查询人流采集设备详情")
-	@PostMapping("/findDetail")
-	public Result findDetail(Long id) {
-
-		Date startTime = DateUtil.current();
-
-		Map<String, Object> dataMap = new HashMap<>();
-		QueryWrapper<EquipmentPassengerPeople> wrapper = new QueryWrapper<>();
-		wrapper.eq("equipment_id", id);
-		wrapper.eq("passenger_type", PassengerType.IN);
-		Long inCount = this.equipmentPassengerPeopleService.count(wrapper);
-
-		wrapper = new QueryWrapper<>();
-		wrapper.eq("equipment_id", id);
-		wrapper.eq("passenger_type", PassengerType.OUT);
-		Long outCount = this.equipmentPassengerPeopleService.count(wrapper);
-
-
-		wrapper = new QueryWrapper<>();
-		wrapper.select("gender", "count(id) value");
-		wrapper.eq("equipment_id", id);
-		wrapper.groupBy("gender");
-		List<Map<String, Object>> listGenders = this.equipmentPassengerPeopleService.listMaps(wrapper);
-		for (Map<String, Object> genderMap : listGenders) {
-			int genderValue = Integer.parseInt(genderMap.get("gender").toString());
-			Gender gender = Gender.valueOf(genderValue);
-			if (gender != null) {
-				genderMap.put("name", gender.getText());
-			}
-		}
-
-
-		wrapper = new QueryWrapper<>();
-		wrapper.select("from_source name", "count(id) value");
-		wrapper.eq("equipment_id", id);
-		wrapper.groupBy("from_source");
-		wrapper.orderByDesc("value");
-		wrapper.last("limit 8");
-		List<Map<String, Object>> listFromSource = this.equipmentPassengerPeopleService.listMaps(wrapper);
-
-
-		wrapper = new QueryWrapper<>();
-		wrapper.select("AVG(unix_timestamp(created_time)) t", "passenger_type");
-		wrapper.eq("equipment_id", id);
+    @Autowired
+    private EquipmentPassengerService equipmentPassengerService;
+
+    @Autowired
+    private EquipmentPassengerPeopleService equipmentPassengerPeopleService;
+
+    @Autowired
+    private SequenceService sequenceService;
+
+    @Autowired
+    private OauthService oauthService;
+
+    @Permission(value = "equipment.passenger.find", tags = "查询人流采集设备")
+    @PostMapping("/findPage")
+    public Result findPage(@RequestBody QueryEquipmentPassengerParams params) {
+
+        QueryWrapper<EquipmentPassenger> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", 0);
+        queryWrapper.eq("supplier_type", 1);
+        if (StringUtils.isNotBlank(params.getBrief())) {
+            queryWrapper.like("name", params.getBrief());
+        }
+        if (params.getPlaceBaseInfoId() != null) {
+            queryWrapper.eq("org_id", params.getPlaceBaseInfoId());
+        }
+        if (params.getRangeDate() != null) {
+            if (params.getRangeDate().getStatDate() != null) {
+                queryWrapper.ge("create_date", params.getRangeDate().getStatDate());
+            }
+            if (params.getRangeDate().getEndDate() != null) {
+                queryWrapper.lt("create_date", params.getRangeDate().getEndDate());
+            }
+        }
+
+        Page<EquipmentPassenger> page = params.getPage();
+        page.addOrder(OrderItem.desc("id"));
+
+        Page<EquipmentPassenger> resultData = this.equipmentPassengerService.pageList(page, queryWrapper);
+        QueryWrapper<EquipmentPassengerPeople> passengerWrapper;
+        for (EquipmentPassenger equipment : resultData.getRecords()) {
+            passengerWrapper = new QueryWrapper<>();
+            passengerWrapper.eq("equipment_id", equipment.getId());
+            passengerWrapper.eq("passenger_type", PassengerType.IN);
+            if (params.getRangeDate() != null) {
+                passengerWrapper.between("created_time", params.getRangeDate().getStatDate(), params.getRangeDate().getEndDate());
+            }
+            Long inPeopleCount = this.equipmentPassengerPeopleService.count(passengerWrapper);
+
+
+            passengerWrapper = new QueryWrapper<>();
+            passengerWrapper.eq("equipment_id", equipment.getId());
+            passengerWrapper.eq("passenger_type", PassengerType.OUT);
+            if (params.getRangeDate() != null) {
+                passengerWrapper.between("created_time", params.getRangeDate().getStatDate(), params.getRangeDate().getEndDate());
+            }
+            Long outPeopleCount = this.equipmentPassengerPeopleService.count(passengerWrapper);
+
+            equipment.setInPeopleCount(inPeopleCount);
+            equipment.setOutPeopleCount(outPeopleCount);
+        }
+
+        return Result.instance(Result.Code.SUCCESS).setData(resultData);
+    }
+
+    @Permission(value = "equipment.passenger.find", tags = "查询人流采集设备详情")
+    @PostMapping("/findDetail")
+    public Result findDetail(Long id, Long orgId) {
+        Date startTime = new Date();
+        Map<String, Object> dataMap = new HashMap<>();
+        dataMap.put("latLng", this.equipmentPassengerService.loadLatLng(id));
+        dataMap.put("visitorsList", this.equipmentPassengerService.numberOfHolidayVisitors(orgId));
+        //实时概况
+        dataMap.put("survey", this.equipmentPassengerService.realTimeSurvey(orgId));
+
+        QueryWrapper<EquipmentPassengerPeople> wrapper = new QueryWrapper<>();
+        wrapper.eq("equipment_id", id);
+        wrapper.eq("passenger_type", PassengerType.IN);
+        Long inCount = this.equipmentPassengerPeopleService.count(wrapper);
+
+        wrapper = new QueryWrapper<>();
+        wrapper.eq("equipment_id", id);
+        wrapper.eq("passenger_type", PassengerType.OUT);
+        Long outCount = this.equipmentPassengerPeopleService.count(wrapper);
+
+
+        wrapper = new QueryWrapper<>();
+        wrapper.select("gender", "count(id) value");
+        wrapper.eq("equipment_id", id);
+        wrapper.groupBy("gender");
+        List<Map<String, Object>> listGenders = this.equipmentPassengerPeopleService.listMaps(wrapper);
+        for (Map<String, Object> genderMap : listGenders) {
+            int genderValue = Integer.parseInt(genderMap.get("gender").toString());
+            Gender gender = Gender.valueOf(genderValue);
+            if (gender != null) {
+                genderMap.put("name", gender.getText());
+            }
+        }
+
+
+        wrapper = new QueryWrapper<>();
+        wrapper.select("from_source name", "count(id) value");
+        wrapper.eq("equipment_id", id);
+        wrapper.groupBy("from_source");
+        wrapper.orderByDesc("value");
+        wrapper.last("limit 8");
+        List<Map<String, Object>> listFromSource = this.equipmentPassengerPeopleService.listMaps(wrapper);
+
+
+        wrapper = new QueryWrapper<>();
+        wrapper.select("AVG(unix_timestamp(created_time)) t", "passenger_type");
+        wrapper.eq("equipment_id", id);
 //		wrapper.inSql("face_id", "select face_id from equipment_passenger_people GROUP BY face_id HAVING count(face_id)> 1");
-		wrapper.groupBy("passenger_type");
-		List<Map<String, Object>> listPassenger = this.equipmentPassengerPeopleService.listMaps(wrapper);
+        wrapper.groupBy("passenger_type");
+        List<Map<String, Object>> listPassenger = this.equipmentPassengerPeopleService.listMaps(wrapper);
 
-		int avgInTime = 0;
-		int avgOutTime = 0;
-		for (Map<String, Object> avgMap : listPassenger) {
-			int passengerTypeValue = Integer.parseInt(avgMap.get("passenger_type").toString());
-			BigDecimal t = new BigDecimal(avgMap.get("t").toString());
-			PassengerType passengerType = PassengerType.valueOf(passengerTypeValue);
-			if (PassengerType.IN.equals(passengerType)) {
-				avgInTime = t.intValue();
-			}
-			if (PassengerType.OUT.equals(passengerType)) {
-				avgOutTime = t.intValue();
-			}
-		}
+        int avgInTime = 0;
+        int avgOutTime = 0;
+        for (Map<String, Object> avgMap : listPassenger) {
+            int passengerTypeValue = Integer.parseInt(avgMap.get("passenger_type").toString());
+            BigDecimal t = new BigDecimal(avgMap.get("t").toString());
+            PassengerType passengerType = PassengerType.valueOf(passengerTypeValue);
+            if (PassengerType.IN.equals(passengerType)) {
+                avgInTime = t.intValue();
+            }
+            if (PassengerType.OUT.equals(passengerType)) {
+                avgOutTime = t.intValue();
+            }
+        }
 
-		Date endTime = DateUtil.current();
+        Date endTime = DateUtil.current();
 
-		dataMap.put("inCount", inCount);
-		dataMap.put("outCount", outCount);
-		dataMap.put("listGenders", listGenders);
-		dataMap.put("listFromSource", listFromSource);
-		dataMap.put("avgStayTime", avgOutTime - avgInTime);
-		dataMap.put("l", endTime.getTime() - startTime.getTime());
-		return Result.instance(Result.Code.SUCCESS).setData(dataMap);
-	}
+        dataMap.put("inCount", inCount);
+        dataMap.put("outCount", outCount);
+        dataMap.put("listGenders", listGenders);
+        dataMap.put("listFromSource", listFromSource);
+        dataMap.put("avgStayTime", avgOutTime - avgInTime);
+        dataMap.put("l", endTime.getTime() - startTime.getTime());
+        return Result.instance(Result.Code.SUCCESS).setData(dataMap);
+    }
 
-	@Permission(value = "equipment.passenger.add", tags = "保存人流采集设备")
-	@PostMapping("/save")
-	public Result save(@Valid @RequestBody SaveEquipmentPassengerParams params) {
+    @Permission(value = "equipment.passenger.add", tags = "保存人流采集设备")
+    @PostMapping("/save")
+    public Result save(@Valid @RequestBody SaveEquipmentPassengerParams params) {
 
-		this.equipmentPassengerService.save(this.buildEntity(this.sequenceService.nextId(), params));
+        this.equipmentPassengerService.save(this.buildEntity(this.sequenceService.nextId(), params));
 
-		return Result.instance(Result.Code.MESSAGE_SUCCESS);
-	}
+        return Result.instance(Result.Code.MESSAGE_SUCCESS);
+    }
 
-	@Permission(value = "equipment.passenger.edit", tags = "编辑人流采集设备")
-	@PostMapping("/updateById")
-	public Result updateById(Long id, @Valid @RequestBody SaveEquipmentPassengerParams params) {
+    @Permission(value = "equipment.passenger.edit", tags = "编辑人流采集设备")
+    @PostMapping("/updateById")
+    public Result updateById(Long id, @Valid @RequestBody SaveEquipmentPassengerParams params) {
 
-		this.equipmentPassengerService.updateById(this.buildEntity(id, params));
+        this.equipmentPassengerService.updateById(this.buildEntity(id, params));
 
-		return Result.instance(Result.Code.MESSAGE_SUCCESS);
-	}
+        return Result.instance(Result.Code.MESSAGE_SUCCESS);
+    }
 
 
-	private EquipmentPassenger buildEntity(Long id, @Valid SaveEquipmentPassengerParams params) {
+    private EquipmentPassenger buildEntity(Long id, @Valid SaveEquipmentPassengerParams params) {
 
-		EquipmentPassenger entity = new EquipmentPassenger();
+        EquipmentPassenger entity = new EquipmentPassenger();
 
-		BeanUtils.copyProperties(params, entity);
+        BeanUtils.copyProperties(params, entity);
 
-		OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
+        OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
 
-		entity.setCreatedTime(DateUtil.current());
-		entity.setUpdatedTime(DateUtil.current());
-		entity.setCreatedBy(oauthInfo.getId());
-		entity.setUpdatedBy(oauthInfo.getId());
+        entity.setCreatedTime(DateUtil.current());
+        entity.setUpdatedTime(DateUtil.current());
+        entity.setCreatedBy(oauthInfo.getId());
+        entity.setUpdatedBy(oauthInfo.getId());
 
-		entity.setId(id);
-		return entity;
-	}
+        entity.setId(id);
+        return entity;
+    }
 
-	@Permission(value = "equipment.passenger.delete", tags = "删除人流采集设备")
-	@PostMapping("/deleteByIds")
-	public Result deleteByIds(@RequestBody List<Long> ids) {
-		this.equipmentPassengerService.removeByIds(ids);
-		return Result.instance(Result.Code.MESSAGE_SUCCESS);
-	}
+    @Permission(value = "equipment.passenger.delete", tags = "删除人流采集设备")
+    @PostMapping("/deleteByIds")
+    public Result deleteByIds(@RequestBody List<Long> ids) {
+        this.equipmentPassengerService.removeByIds(ids);
+        return Result.instance(Result.Code.MESSAGE_SUCCESS);
+    }
 }

+ 228 - 0
src/main/java/com/zhiqiyun/open/mvc/controller/QweatherController.java

@@ -0,0 +1,228 @@
+package com.zhiqiyun.open.mvc.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
+import com.zhiqiyun.open.mvc.Result;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.digest.Md5Crypt;
+import org.apache.commons.lang3.StringUtils;
+import org.jsoup.Connection;
+import org.jsoup.Jsoup;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.BoundValueOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.text.MessageFormat;
+import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @ClassName QweatherController
+ * @Author hupan
+ * @Date 2022/2/22 0022 11:47
+ **/
+@Slf4j
+@RestController
+@RequestMapping("/qweather")
+public class QweatherController {
+
+    @Value("${qweather.api}")
+    private String apiURL;
+
+    @Value("${qweather.geoapi}")
+    private String geoapiURL;
+
+    @Value("${qweather.air}")
+    private String airURL;
+
+    @Value("${qweather.indices}")
+    private String indicesURL;
+
+    private final static String KEY = "bd25d060fa724998b4d4bf1ca6fc9d74";
+
+    private final static String WEATHER_LOCATION = "weather_location:{0}";
+
+    @Resource
+    private RedisTemplate<String, String> redisTemplate;
+
+
+    @GetMapping("/ambitusRoadConditions")
+    public Result ambitusRoadConditions(String lat, String lng) {
+        String center = lat + "," + lng;
+        try {
+            String uri = "https://api.map.baidu.com/traffic/v1/around?";
+            String ak = "7dgEVBV95f0wIenXnRIdE55OQuvyw597";
+            String url = uri + "ak=" + ak + "&center=" + center + "&radius=1000&coord_type_input=gcj02&coord_type_output=gcj02";
+            Connection connectionAccessToken = Jsoup.connect(url);
+            connectionAccessToken.method(Connection.Method.GET);
+            connectionAccessToken.header("Content-Type", "application/json; charset=utf-8");
+            connectionAccessToken.ignoreContentType(true);
+            String body = connectionAccessToken.execute().body();
+            JSONObject json = JSONObject.parseObject(body);
+            if ("0".equals(json.get("status") + "")) {
+                return Result.instance(Result.Code.SUCCESS).setData(json);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return Result.instance(Result.Code.SUCCESS);
+    }
+
+
+    @GetMapping("get")
+    public Result get(String lat, String lng, String province, String city, String country) {
+        lat = StringUtils.isNotBlank(lat) ? lat : "24.656601";
+        lng = StringUtils.isNotBlank(lng) ? lng : "109.251243";
+        province = "广西省";
+        city = "柳州市";
+        country = "中国";
+
+        String location = location(lat, lng, province, city, country);
+        if (StringUtils.isNotBlank(location)) {
+            String locationKey = MessageFormat.format(WEATHER_LOCATION, Md5Crypt.apr1Crypt(location));
+            BoundValueOperations<String, String> boundValueOperations = redisTemplate.boundValueOps(locationKey);
+            if (StringUtils.isNotBlank(boundValueOperations.get())) {
+                return Result.instance(Result.Code.SUCCESS).setData(JSONObject.parse(boundValueOperations.get()));
+            }
+            JSONObject jsonObject = loadWeather(location);
+            if (jsonObject != null) {
+                boundValueOperations.set(jsonObject.toJSONString(), 60 * 60, TimeUnit.SECONDS);
+                return Result.instance(Result.Code.SUCCESS).setData(jsonObject);
+            }
+        }
+        return Result.instance(Result.Code.SUCCESS);
+    }
+
+    private String location(String lat, String lng, String province, String city, String country) {
+        TreeMap<String, String> stringMap = getDataMap(lat, lng, province, city, country);
+        String locationKey = MessageFormat.format(WEATHER_LOCATION, Md5Crypt.apr1Crypt(JSONObject.toJSONString(stringMap)));
+        String location;
+        BoundValueOperations<String, String> boundValueOperations = redisTemplate.boundValueOps(locationKey);
+        if (StringUtils.isNotBlank(boundValueOperations.get())) {
+            location = boundValueOperations.get();
+        } else {
+            location = loadLocation(stringMap);
+            if (StringUtils.isNotBlank(location)) {
+                boundValueOperations.set(location);
+            }
+        }
+        return location;
+    }
+
+    @GetMapping("air")
+    public Result air(String lat, String lng, String province, String city, String country) {
+        lat = StringUtils.isNotBlank(lat) ? lat : "24.656601";
+        lng = StringUtils.isNotBlank(lng) ? lng : "109.251243";
+        province = "广西省";
+        city = "柳州市";
+        country = "中国";
+        TreeMap<String, String> stringMap = getDataMap(lat, lng, province, city, country);
+        String locationKey = MessageFormat.format(WEATHER_LOCATION, Md5Crypt.apr1Crypt(JSONObject.toJSONString(stringMap)));
+        String location;
+        BoundValueOperations<String, String> boundValueOperations = redisTemplate.boundValueOps(locationKey);
+        if (StringUtils.isNotBlank(boundValueOperations.get())) {
+            location = boundValueOperations.get();
+        } else {
+            location = loadLocation(stringMap);
+        }
+
+        if (StringUtils.isNotBlank(location)) {
+            boundValueOperations.set(location);
+            return Result.instance(Result.Code.SUCCESS).setData(loadAir(location));
+        }
+        return Result.instance(Result.Code.SUCCESS);
+    }
+
+
+    private String loadLocation(TreeMap<String, String> params) {
+        if (params == null || params.size() == 0) {
+            return null;
+        }
+        Connection connection = Jsoup.connect(geoapiURL).data("key", KEY)
+                .data("lang", "zh").data("range", "cn")
+                .data(params);
+        try {
+            String body = connection.ignoreContentType(true)
+                    .get().text();
+            JSONObject jsonObject = JSON.parseObject(body);
+            if (200 == jsonObject.getIntValue("code")) {
+                return jsonObject.getJSONArray("location")
+                        .getJSONObject(0).getString("id");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return null;
+    }
+
+    /**
+     * 获取天气
+     *
+     * @param LocationID
+     * @return
+     */
+    private JSONObject loadWeather(String LocationID) {
+        try {
+            String body = Jsoup.connect(apiURL)
+                    .data("key", KEY)
+                    .data("lang", "zh")
+                    .data("location", LocationID)
+                    .ignoreContentType(true)
+                    .get().text();
+            JSONObject jsonObject = JSON.parseObject(body);
+            if (200 == jsonObject.getIntValue("code")) {
+                return jsonObject;
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return null;
+    }
+
+    /**
+     * 空气质量
+     *
+     * @param LocationID
+     * @return
+     */
+    private JSONObject loadAir(String LocationID) {
+        try {
+            String body = Jsoup.connect(airURL)
+                    .data("key", KEY)
+                    .data("lang", "zh")
+                    .data("location", LocationID)
+                    .ignoreContentType(true)
+                    .get().text();
+            JSONObject jsonObject = JSON.parseObject(body);
+            if (200 == jsonObject.getIntValue("code")) {
+                return jsonObject;
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+        return null;
+    }
+
+    private TreeMap<String, String> getDataMap(String lat, String lng,
+                                               String province, String city, String country) {
+        TreeMap<String, String> map = Maps.newTreeMap();
+        if (StringUtils.isNotBlank(lat) && StringUtils.isNotBlank(lng)) {
+            map.put("location", lng + "," + lat);
+        } else if (StringUtils.isNotBlank(country)) {
+            map.put("location", country);
+            map.put("adm2", city);
+            map.put("adm1", province);
+        } else if (StringUtils.isNotBlank(city)) {
+            map.put("location", city);
+            map.put("adm", province);
+        } else {
+            map.put("location", province);
+        }
+        return map;
+    }
+}

+ 7 - 0
src/main/java/com/zhiqiyun/open/mvc/controller/UploaderController.java

@@ -57,6 +57,13 @@ public class UploaderController {
         if (params.getCreatedTime() != null) {
             wrapper.between("created_time", params.getCreatedTime().getStatDate(), params.getCreatedTime().getEndDate());
         }
+        if (params.getType() != null) {
+            if (params.getType().compareTo(2) == 0) {
+                wrapper.apply("(extension = 'mp4' or extension = 'mp3' or extension = 'mov')");
+            } else {
+                wrapper.apply("(extension = 'jpg' or extension = 'png' or extension = 'jpeg')");
+            }
+        }
 
         Page<UploadFileInfo> page = params.getPage();
         page.addOrder(OrderItem.desc("id"));

+ 2 - 0
src/main/java/com/zhiqiyun/open/mvc/params/statistics/QueryUploadFileInfoParams.java

@@ -15,6 +15,8 @@ public class QueryUploadFileInfoParams extends QueryPageParams {
 
     private RangeDate createdTime;
 
+    private Integer type;
+
 
     public void setCreatedTime(List<String> createdTime) {
         this.createdTime = RangeDate.build(createdTime);

+ 8 - 3
src/main/resources/application-alpha.properties

@@ -1,9 +1,9 @@
 logger.root.level=info
 logger.root.path=/data/logs/
 ####################### mysql ###############################
-spring.datasource.url=jdbc:mysql://rm-bp1e2451m5olnc4g6qo.mysql.rds.aliyuncs.com/liucheng_open?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&useSSL=false
-spring.datasource.username=liucheng
-spring.datasource.password=liucheng123@
+spring.datasource.url=jdbc:mysql://116.8.106.156:3306/data_center?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&useSSL=false
+spring.datasource.username=root
+spring.datasource.password=!@#931v3ODUQqakdyIQ
 #######################redis###############################
 spring.redis.host=39.99.217.107
 spring.redis.password=hnylredis@
@@ -16,3 +16,8 @@ uploader.allow-file-types=jpg,jpeg,png,gif
 uploader.save-path=/data/uploads
 ####################### spider config ###############################
 spider.phantomjs_executable_path_property=/data/phantomjs-2.1.1-linux-x86_64/bin/phantomjs
+####################### qweather config ###############################
+qweather.geoapi = https://geoapi.qweather.com/v2/city/lookup
+qweather.api = https://devapi.qweather.com/v7/weather/now
+qweather.air = https://devapi.qweather.com/v7/air/now
+qweather.indices = https://devapi.qweather.com/v7/indices/1d

+ 6 - 1
src/main/resources/application-prod.properties

@@ -2,7 +2,7 @@ logger.root.level=info
 logger.root.path=/data/data-center/logs/
 ####################### mysql ###############################
 spring.datasource.url=jdbc:mysql://192.168.0.27/liucheng_open?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
-spring.datasource.username=app
+spring.datasource.username=root
 spring.datasource.password=!@#931v3ODUQqakdyIQ
 #######################redis###############################
 spring.redis.host=192.168.0.27
@@ -16,3 +16,8 @@ uploader.allow-file-types=jpg,jpeg,png,gif
 uploader.save-path=/data/data-center/uploads
 ####################### spider config ###############################
 spider.phantomjs_executable_path_property=/data/data-center/phantomjs-2.1.1/bin/phantomjs
+####################### qweather config ###############################
+qweather.geoapi = https://geoapi.qweather.com/v2/city/lookup
+qweather.api = https://devapi.qweather.com/v7/weather/now
+qweather.air = https://devapi.qweather.com/v7/air/now
+qweather.indices = https://devapi.qweather.com/v7/indices/1d

+ 10 - 5
src/main/resources/application.properties

@@ -6,18 +6,18 @@ logger.root.level=DEBUG
 logger.root.path=/tmp/
 ####################### mysql ###############################
 spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
-spring.datasource.url=jdbc:mysql://116.8.106.156/data_center?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&useSSL=false
-spring.datasource.username=app
+spring.datasource.url=jdbc:mysql://116.8.106.156:3306/liucheng_open?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&useSSL=false
+spring.datasource.username=root
 spring.datasource.password=!@#931v3ODUQqakdyIQ
 #######################mybatis###############################
 mybatis-plus.config-location=classpath:mybatis/sqlMapConfig.xml
 mybatis-plus.mapper-locations=classpath:mybatis/mappers/*.xml
 mybatis-plus.type-enums-package=com.zhiqiyun.open.core.enmus
 #######################redis###############################
-spring.redis.host=192.168.0.200
-spring.redis.password=123456
+spring.redis.host=39.99.217.107
+spring.redis.password=hnylredis@
 spring.redis.port=6379
-spring.redis.database=1
+spring.redis.database=11
 ####################### oap config ###############################
 #spring.oap.security.file-upload-controller-class=com.dliyun.oap.framework.impl.DefaultFileUploadController
 spring.oap.security.app-secret-manager-class=com.zhiqiyun.open.router.config.DbBaseAppSecretManager
@@ -44,3 +44,8 @@ uploader.save-path=/tmp/uploads
 ####################### spider config ###############################
 spider.phantomjs_executable_path_property=/Users/jtoms/software/phantomjs-2.1.1/bin/phantomjs
 wlapi.server.host=https://wlapi-pro-smartcity.123cx.com
+####################### qweather config ###############################
+qweather.geoapi = https://geoapi.qweather.com/v2/city/lookup
+qweather.api = https://devapi.qweather.com/v7/weather/now
+qweather.air = https://devapi.qweather.com/v7/air/now
+qweather.indices = https://devapi.qweather.com/v7/indices/1d