</dependency> | </dependency> | ||||
<dependency> | |||||
<!-- <dependency> | |||||
<groupId>org.apache.poi</groupId> | <groupId>org.apache.poi</groupId> | ||||
<artifactId>poi</artifactId> | <artifactId>poi</artifactId> | ||||
<version>RELEASE</version> | <version>RELEASE</version> | ||||
</dependency> | |||||
</dependency>--> | |||||
<dependency> | <dependency> | ||||
<groupId>org.apache.poi</groupId> | <groupId>org.apache.poi</groupId> | ||||
<artifactId>poi-ooxml</artifactId> | <artifactId>poi-ooxml</artifactId> | ||||
<artifactId>spring-boot-starter-mail</artifactId> | <artifactId>spring-boot-starter-mail</artifactId> | ||||
</dependency> | </dependency> | ||||
<!--mongodb --> | |||||
<dependency> | |||||
<groupId>org.springframework.boot</groupId> | |||||
<artifactId>spring-boot-starter-data-mongodb</artifactId> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.jsoup</groupId> | |||||
<artifactId>jsoup</artifactId> | |||||
<version>1.12.1</version> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.springframework.boot</groupId> | |||||
<artifactId>spring-boot-starter-data-redis</artifactId> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.springframework.boot</groupId> | |||||
<artifactId>spring-boot-starter-data-redis-reactive</artifactId> | |||||
</dependency> | |||||
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> | |||||
<dependency> | |||||
<groupId>org.apache.poi</groupId> | |||||
<artifactId>poi</artifactId> | |||||
<version>3.9</version> | |||||
</dependency> | |||||
</dependencies> | </dependencies> |
package com.xdf.creative.base.params; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import org.springframework.data.annotation.Id; | |||||
import org.springframework.data.mongodb.core.mapping.Document; | |||||
@Data | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@Document(collection = "xdfWenChuHuiContent") | |||||
public class InfoContentHtmlEntity { | |||||
@Id | |||||
private String s_id; | |||||
private String infoContId; | |||||
/** | |||||
* 标题 | |||||
*/ | |||||
private String title; | |||||
/** | |||||
*内容文本 | |||||
*/ | |||||
private String contentText; | |||||
private String content; | |||||
} |
package com.xdf.creative.base.params.creative; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.xdf.creative.base.params.QueryParam; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 信息和关键字关联表 查询参数对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "InfContentKeywordQueryParam对象", description = "信息和关键字关联表查询参数") | |||||
public class InfoContentKeywordQueryParam extends QueryParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty(value = "信息id") | |||||
private Long contentId; | |||||
@ApiModelProperty(value = "关键词id") | |||||
private Long keywordId; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
} |
@ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除(收入回收站)") | @ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除(收入回收站)") | ||||
private Integer deleted; | private Integer deleted; | ||||
private String typeId; | |||||
} | } |
package com.xdf.creative.base.params.creative; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.xdf.creative.base.params.QueryParam; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import javax.validation.constraints.NotBlank; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 查询参数对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "InfoKeywordQueryParam对象", description = "信息关键字查询参数") | |||||
public class InfoKeywordAddParam extends QueryParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty(value = "关键词") | |||||
@NotBlank(message = "关键词不能为空!") | |||||
private String keyword; | |||||
@ApiModelProperty(value = "是否通用 0 否 1是") | |||||
private Integer isUse; | |||||
@ApiModelProperty(value = "描述") | |||||
private String detail; | |||||
@ApiModelProperty(value = "状态 0 不可用 1可用") | |||||
private Integer state; | |||||
@ApiModelProperty(value = "创建用户") | |||||
private Long createUser; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
} |
package com.xdf.creative.base.params.creative; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.xdf.creative.base.params.QueryParam; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 查询参数对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "InfoKeywordQueryParam对象", description = "信息关键字查询参数") | |||||
public class InfoKeywordQueryParam extends QueryParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty(value = "关键词") | |||||
private String keyword; | |||||
@ApiModelProperty(value = "是否通用 0 否 1是") | |||||
private Integer isUse; | |||||
@ApiModelProperty(value = "描述") | |||||
private String detail; | |||||
@ApiModelProperty(value = "状态 0 不可用 1可用") | |||||
private Integer state; | |||||
@ApiModelProperty(value = "创建用户") | |||||
private Long createUser; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
} |
package com.xdf.creative.base.params.creative; | |||||
import com.xdf.creative.base.params.QueryParam; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 查询参数对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "InfoKeywordQueryParam对象", description = "信息关键字查询参数") | |||||
public class InfoKeywordSaveCheckParam extends QueryParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
private long contentId; | |||||
@ApiModelProperty(value = "关键词id数组") | |||||
private List<Long> keyIds; | |||||
} |
@ApiModelProperty(value = "单位名称") | @ApiModelProperty(value = "单位名称") | ||||
private String name; | private String name; | ||||
@ApiModelProperty(value = "统一社会信用代码") | |||||
private String creditCode; | |||||
@ApiModelProperty(value = "单位logo") | @ApiModelProperty(value = "单位logo") | ||||
private String logo; | private String logo; | ||||
package com.xdf.creative.base.params.creative; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.xdf.creative.base.params.QueryParam; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 微信群二维码 查询参数对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2021-01-28 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "WxGroupQueryParam对象", description = "微信群二维码查询参数") | |||||
public class WxGroupQueryParam extends QueryParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
@NotNull(message = "主键id不能为空") | |||||
private Long id; | |||||
@ApiModelProperty(value = "产业名") | |||||
private String name; | |||||
@ApiModelProperty(value = "微信二维码") | |||||
private String code; | |||||
@ApiModelProperty(value = "状态,0:禁用,1:启用,2:锁定") | |||||
private Integer state; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
@ApiModelProperty(value = "更新时间") | |||||
private Date updateTime; | |||||
@ApiModelProperty(value = "创建者id") | |||||
private Long createUserId; | |||||
} |
package com.xdf.creative.base.vo.creative; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 信息和关键字关联表 查询结果对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@ApiModel(value = "InfContentKeywordQueryVo对象", description = "信息和关键字关联表查询参数") | |||||
public class InfoContentKeywordQueryVo implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
private Long id; | |||||
@ApiModelProperty(value = "信息id") | |||||
private Long contentId; | |||||
@ApiModelProperty(value = "关键词id") | |||||
private Long keywordId; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
} |
@ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除") | @ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除") | ||||
private Integer deleted; | private Integer deleted; | ||||
private String hyperlink; | |||||
} | } |
* url列表 | * url列表 | ||||
*/ | */ | ||||
private List<InfoUrl> urlList; | private List<InfoUrl> urlList; | ||||
private String keyWord; | |||||
private String upTitle; | |||||
private Long upInfoId; | |||||
private String upImageUrl; | |||||
private String upHyperlink; | |||||
private String downTitle; | |||||
private Long downInfoId; | |||||
private String downImageUrl; | |||||
private String downHyperlink; | |||||
} | } |
package com.xdf.creative.base.vo.creative; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 查询结果对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@ApiModel(value = "InfoKeywordQueryVo对象", description = "信息关键字查询参数") | |||||
public class InfoKeywordCheckListVo implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
private Long id; | |||||
@ApiModelProperty(value = "关键词") | |||||
private String keyword; | |||||
@ApiModelProperty(value = "是否通用 0 否 1是") | |||||
private Integer isUse; | |||||
@ApiModelProperty(value = "描述") | |||||
private String detail; | |||||
@ApiModelProperty(value = "状态 0 不可用 1可用") | |||||
private Integer state; | |||||
private String checked; | |||||
} |
package com.xdf.creative.base.vo.creative; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 查询结果对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@ApiModel(value = "InfoKeywordQueryVo对象", description = "信息关键字查询参数") | |||||
public class InfoKeywordQueryVo implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
private Long id; | |||||
@ApiModelProperty(value = "关键词") | |||||
private String keyword; | |||||
@ApiModelProperty(value = "是否通用 0 否 1是") | |||||
private Integer isUse; | |||||
@ApiModelProperty(value = "描述") | |||||
private String detail; | |||||
@ApiModelProperty(value = "状态 0 不可用 1可用") | |||||
private Integer state; | |||||
@ApiModelProperty(value = "创建用户") | |||||
private Long createUser; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
} |
package com.xdf.creative.base.vo.creative; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 文促会入会申请表 查询结果对象 | |||||
* </p> | |||||
* | |||||
* @author DeanYe | |||||
* @date 2019-10-30 | |||||
*/ | |||||
@Data | |||||
@ApiModel(value = "WebInitiationApplyQueryVo对象", description = "文促会入会申请表查询参数") | |||||
public class WebInitiationApplyExportVo { | |||||
@ApiModelProperty(value = "单位名称") | |||||
private String name; | |||||
@ApiModelProperty(value = "统一社会信用代码") | |||||
private String creditCode; | |||||
@ApiModelProperty(value = "机关类型 1、国营企业 2、事业单位 3、民营企业 4、社会组织") | |||||
private String unitTypeStr; | |||||
@ApiModelProperty(value = "注册地址省") | |||||
private String provinceStr; | |||||
@ApiModelProperty(value = "注册地址市") | |||||
private String cityStr; | |||||
@ApiModelProperty(value = "注册地址区") | |||||
private String countyStr; | |||||
@ApiModelProperty(value = "主要办公地址") | |||||
private String contactAddress; | |||||
@ApiModelProperty(value = "邮编") | |||||
private String post; | |||||
@ApiModelProperty(value = "公司网址") | |||||
private String website; | |||||
@ApiModelProperty(value = "法人姓名") | |||||
private String legalPerson; | |||||
@ApiModelProperty(value = "法人职务") | |||||
private String legalDuty; | |||||
@ApiModelProperty(value = "固定电话") | |||||
private String legalPhone; | |||||
@ApiModelProperty(value = "手机号") | |||||
private String legalMobile; | |||||
@ApiModelProperty(value = "日常联系人姓名") | |||||
private String linkMan; | |||||
@ApiModelProperty(value = "日常联系人职务") | |||||
private String linkDuty; | |||||
@ApiModelProperty(value = "日常联系人固定电话") | |||||
private String linkPhone; | |||||
@ApiModelProperty(value = "日常联系人手机号") | |||||
private String linkMobile; | |||||
@ApiModelProperty(value = "法人简介") | |||||
private String legalIntroduction; | |||||
@ApiModelProperty(value = "单位简介") | |||||
private String introduction; | |||||
@ApiModelProperty(value = "专列与荣誉") | |||||
private String honner; | |||||
@ApiModelProperty(value = "金融服务 1、股权 2、债权 3、担保 4、融资租赁 5、其他") | |||||
private String financeServiceStr; | |||||
@ApiModelProperty(value = "产业合作 1、对接上下游企业资源 2、展会参展 3、园区入驻") | |||||
private String industryStr; | |||||
@ApiModelProperty(value = "企业服务 1、扶持资金 2、信用评级 3、知识与版权交易 4、财务与法律资讯 5、投融资对接") | |||||
private String companyServiceStr; | |||||
@ApiModelProperty(value = "其他") | |||||
private String otherService; | |||||
@ApiModelProperty(value = "申报产业类别:1、媒体业 2、艺术业 3、工业设计 4、建筑设计业 5、时尚设计业 6、互联网相关服务业 7、软件与信息技术服务业8、咨询服务业9、广告及会展服务业 10、休闲娱乐业 11、文化装备制造业12、文化创意投资运营13、文化创意用品生产") | |||||
private String declareCategoryStr; | |||||
@ApiModelProperty(value = "希望成为哪一级会员 1、普通会员 2、理事会员 3、常务理事会员") | |||||
private String vipLevelStr; | |||||
private String logo; | |||||
private String attachment; | |||||
@ApiModelProperty(value = "申请附件") | |||||
private String applyAttachment; | |||||
} |
import lombok.Data; | import lombok.Data; | ||||
import lombok.experimental.Accessors; | import lombok.experimental.Accessors; | ||||
import javax.validation.constraints.NotBlank; | |||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.util.Date; | import java.util.Date; | ||||
@ApiModelProperty(value = "单位名称") | @ApiModelProperty(value = "单位名称") | ||||
private String name; | private String name; | ||||
@ApiModelProperty(value = "统一社会信用代码") | |||||
private String creditCode; | |||||
@ApiModelProperty(value = "单位logo") | @ApiModelProperty(value = "单位logo") | ||||
private String logo; | private String logo; | ||||
private String nickname; | private String nickname; | ||||
@ApiModelProperty(value = "申请附件") | |||||
private String applyAttachment; | |||||
} | } |
package com.xdf.creative.base.vo.creative; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 微信群二维码 查询结果对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2021-01-28 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@ApiModel(value = "WxGroupQueryVo对象", description = "微信群二维码查询参数") | |||||
public class WxGroupQueryVo implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
private Long id; | |||||
@ApiModelProperty(value = "产业名") | |||||
private String name; | |||||
@ApiModelProperty(value = "微信二维码") | |||||
private String code; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
@ApiModelProperty(value = "更新时间") | |||||
private Date updateTime; | |||||
@ApiModelProperty(value = "创建者id") | |||||
private Long createUserId; | |||||
@ApiModelProperty(value = "状态,0:禁用,1:启用,2:锁定") | |||||
private Integer state; | |||||
} |
private final static Logger log = LoggerFactory.getLogger(CorsFilterUser.class); | private final static Logger log = LoggerFactory.getLogger(CorsFilterUser.class); | ||||
private final static List<String> heardSList = Arrays.asList("Accept","Origin","X-Requested-With","Content-Type", "Last-Modified","*"); | |||||
private final static List<String> heardSList = Arrays.asList("School-Teacher-Token", "school-teacher-token", "x-access-token", "Referer", "Accept", "Origin", "X-Requested-With", "Content-Type", "Last-Modified", "token", "Authorization"); | |||||
private final CorsConfigurationSource configSource; | private final CorsConfigurationSource configSource; | ||||
private CorsProcessor processor = new DefaultCorsProcessor(); | private CorsProcessor processor = new DefaultCorsProcessor(); | ||||
package com.xdf.creative.config.redis; | |||||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
import com.fasterxml.jackson.databind.ObjectMapper; | |||||
import org.springframework.context.annotation.Bean; | |||||
import org.springframework.context.annotation.Configuration; | |||||
import org.springframework.data.redis.connection.RedisConnectionFactory; | |||||
import org.springframework.data.redis.core.RedisTemplate; | |||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; | |||||
import org.springframework.data.redis.serializer.StringRedisSerializer; | |||||
/** | |||||
* redis配置类 | |||||
* | |||||
* @author ZENG.XIAO.YAN | |||||
* @date 2018年6月6日 | |||||
*/ | |||||
@Configuration | |||||
public class RedisConfig { | |||||
@Bean | |||||
@SuppressWarnings("all") | |||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { | |||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); | |||||
redisTemplate.setConnectionFactory(redisConnectionFactory); | |||||
// 使用Jackson2JsonRedisSerialize 替换默认序列化 | |||||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); | |||||
ObjectMapper objectMapper = new ObjectMapper(); | |||||
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); | |||||
jackson2JsonRedisSerializer.setObjectMapper(objectMapper); | |||||
// 设置value的序列化规则和 key的序列化规则 | |||||
redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); | |||||
redisTemplate.setKeySerializer(new StringRedisSerializer()); | |||||
redisTemplate.setHashKeySerializer(jackson2JsonRedisSerializer); | |||||
redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer); | |||||
redisTemplate.setDefaultSerializer(jackson2JsonRedisSerializer); | |||||
redisTemplate.setEnableDefaultSerializer(true); | |||||
redisTemplate.afterPropertiesSet(); | |||||
return redisTemplate; | |||||
} | |||||
} |
throw new InfoFormException(StatusCode.FORM_INFO_CONTENT_FORDATE_VERIFY); | throw new InfoFormException(StatusCode.FORM_INFO_CONTENT_FORDATE_VERIFY); | ||||
} | } | ||||
} | } | ||||
str = str.replaceAll("%(?![0-9a-fA-F]{2})", "%25"); | |||||
return str; | return str; | ||||
} | } | ||||
} | } |
* | * | ||||
* @author Mark sunlightcs@gmail.com | * @author Mark sunlightcs@gmail.com | ||||
*/ | */ | ||||
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { | |||||
public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { | |||||
private static final Logger logger = LoggerFactory.getLogger(XssHttpServletRequestWrapper.class); | private static final Logger logger = LoggerFactory.getLogger(XssHttpServletRequestWrapper.class); | ||||
//没被包装过的HttpServletRequest(特殊场景,需要自己过滤) | //没被包装过的HttpServletRequest(特殊场景,需要自己过滤) | ||||
HttpServletRequest orgRequest; | HttpServletRequest orgRequest; |
*/ | */ | ||||
Integer DEFAULT_PAGE_SIZE = 10; | Integer DEFAULT_PAGE_SIZE = 10; | ||||
Integer KEY_WORD_MAX_SIZE = 4; | |||||
/** | /** | ||||
* 默认降序排序 | * 默认降序排序 | ||||
*/ | */ | ||||
String REGION_ROOT_CODE="310000"; | String REGION_ROOT_CODE="310000"; | ||||
String XDF_CULTURE_PARK_INFO_CONTENT_RECOMMEND_KEY = "parkContentInfoRecommend"; | |||||
String XDF_CULTURE_PARK_INFO_CONTENT_RECOMMEND = "xdf:wch:park:content:recommend:%s"; | |||||
String XDF_CULTURE_INFO_DETAIL_PARK_RECOMMEND_KEY = "contentInfoParkRecommend"; | |||||
String XDF_CULTURE_INFO_DETAIL_PARK_RECOMMEND = "xdf:wch:detail:park:recommend:%s"; | |||||
String XDF_CULTURE_INFO_DETAIL_RENT_RECOMMEND_KEY = "contentInfoRentRecommend"; | |||||
String XDF_CULTURE_INFO_DETAIL_RENT_RECOMMEND = "xdf:wch:detail:rent:recommend:%s"; | |||||
/** | /** | ||||
* JWT用户名 | * JWT用户名 | ||||
* base64前缀 | * base64前缀 | ||||
*/ | */ | ||||
String BASE64_PREFIX = "data:image/png;base64,"; | String BASE64_PREFIX = "data:image/png;base64,"; | ||||
String VERIFY_CODE_KEY ="f80b2eed0110a7ea5a3428b74862cceb697f8"; | |||||
/** | |||||
* 图片验证码 | |||||
*/ | |||||
String VERIFY_CODE_GET = "xdf_wch:verify.code:%s:%s"; | |||||
} | } |
SERVICE_FILE_DIR_PUBLIC_TRADE_DYNAMIC(106, "tradeDynamic"), | SERVICE_FILE_DIR_PUBLIC_TRADE_DYNAMIC(106, "tradeDynamic"), | ||||
SERVICE_FILE_DIR_PUBLIC_POLICY(108, "policy"), | SERVICE_FILE_DIR_PUBLIC_POLICY(108, "policy"), | ||||
SERVICE_FILE_DIR_PUBLIC_ACTIVITY(109, "activity"), | SERVICE_FILE_DIR_PUBLIC_ACTIVITY(109, "activity"), | ||||
SERVICE_FILE_DIR_PUBLIC_QR(110, "wxqr"), | |||||
SERVICE_FILE_DIR_PUBLIC_APPLY(113, "apply"), | |||||
//其他 | //其他 | ||||
SERVICE_FILE_DIR_OTHER(999, "other"); | SERVICE_FILE_DIR_OTHER(999, "other"); | ||||
import com.xdf.creative.constant.CommonConstant; | import com.xdf.creative.constant.CommonConstant; | ||||
import com.xdf.creative.module.service.IVerifyCodeGen; | import com.xdf.creative.module.service.IVerifyCodeGen; | ||||
import com.xdf.creative.module.service.impl.SimpleCharVerifyCodeGenImpl; | import com.xdf.creative.module.service.impl.SimpleCharVerifyCodeGenImpl; | ||||
import com.xdf.creative.util.PasswordUtil; | |||||
import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.data.redis.core.RedisTemplate; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
import java.util.Base64; | import java.util.Base64; | ||||
import java.util.HashMap; | import java.util.HashMap; | ||||
import java.util.Map; | import java.util.Map; | ||||
import java.util.concurrent.TimeUnit; | |||||
/** | /** | ||||
* @author : lgw | * @author : lgw | ||||
@RequestMapping("/auth") | @RequestMapping("/auth") | ||||
@Api("验证吗 API") | @Api("验证吗 API") | ||||
public class CodeController { | public class CodeController { | ||||
@Autowired | |||||
private RedisTemplate redisTemplate; | |||||
private Logger logger = LoggerFactory.getLogger(CodeController.class); | private Logger logger = LoggerFactory.getLogger(CodeController.class); | ||||
@ApiOperation(value = "验证码") | |||||
/*@ApiOperation(value = "验证码") | |||||
@RequestMapping("/code") | @RequestMapping("/code") | ||||
public ApiResult verifyCode(HttpServletRequest request, HttpServletResponse response) { | public ApiResult verifyCode(HttpServletRequest request, HttpServletResponse response) { | ||||
IVerifyCodeGen iVerifyCodeGen = new SimpleCharVerifyCodeGenImpl(); | IVerifyCodeGen iVerifyCodeGen = new SimpleCharVerifyCodeGenImpl(); | ||||
String code = verifyCode.getCode(); | String code = verifyCode.getCode(); | ||||
logger.info(code); | logger.info(code); | ||||
//将VerifyCode绑定session | //将VerifyCode绑定session | ||||
request.getSession().setAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY, code); | |||||
// request.getSession().setAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY, code); | |||||
//设置响应头 | //设置响应头 | ||||
response.setHeader("Pragma", "no-cache"); | response.setHeader("Pragma", "no-cache"); | ||||
//设置响应头 | //设置响应头 | ||||
map.put(CommonConstant.IMAGE, CommonConstant.BASE64_PREFIX + base64); | map.put(CommonConstant.IMAGE, CommonConstant.BASE64_PREFIX + base64); | ||||
return ApiResult.ok(map); | return ApiResult.ok(map); | ||||
} | |||||
*/ | |||||
@ApiOperation(value = "验证码") | |||||
@RequestMapping("/code") | |||||
public ApiResult verifyCode(HttpServletRequest request, HttpServletResponse response,String userName, Integer type) { | |||||
IVerifyCodeGen iVerifyCodeGen = new SimpleCharVerifyCodeGenImpl(); | |||||
//设置长宽 | |||||
VerifyCode verifyCode = null; | |||||
try { | |||||
verifyCode = iVerifyCodeGen.generate(100, 50); | |||||
} catch (IOException e) { | |||||
e.printStackTrace(); | |||||
} | |||||
String code = verifyCode.getCode(); | |||||
logger.info(code); | |||||
String encrypt = PasswordUtil.encrypt(userName+type, CommonConstant.VERIFY_CODE_KEY); | |||||
//将VerifyCode绑定session | |||||
//request.getSession().setAttribute(Constants.KAPTCHA_SESSION_KEY, code); | |||||
redisTemplate.opsForValue().set(String.format(CommonConstant.VERIFY_CODE_GET, userName, encrypt), code, 300, TimeUnit.SECONDS); | |||||
//将VerifyCode绑定session | |||||
// request.getSession().setAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY, code); | |||||
//设置响应头 | |||||
response.setHeader("Pragma", "no-cache"); | |||||
//设置响应头 | |||||
response.setHeader("Cache-Control", "no-cache"); | |||||
//在代理服务器端防止缓冲 | |||||
response.setDateHeader("Expires", 0); | |||||
//设置响应内容类型 | |||||
response.setContentType("image/jpeg"); | |||||
// response.getOutputStream().write(verifyCode.getImgBytes()); | |||||
String base64 = Base64.getEncoder().encodeToString(verifyCode.getImgBytes()); | |||||
Map<String, Object> map = new HashMap<>(2); | |||||
map.put(CommonConstant.IMAGE, CommonConstant.BASE64_PREFIX + base64); | |||||
return ApiResult.ok(map); | |||||
} | } | ||||
} | } |
import com.xdf.creative.module.service.FileClientService; | import com.xdf.creative.module.service.FileClientService; | ||||
import com.xdf.creative.util.StringUtil; | import com.xdf.creative.util.StringUtil; | ||||
import com.xdf.creative.util.UUIDUtil; | import com.xdf.creative.util.UUIDUtil; | ||||
import com.xdf.creative.util.excel.ExcelUtil; | |||||
import com.xdf.creative.util.file.ServerUploadDirUtil; | import com.xdf.creative.util.file.ServerUploadDirUtil; | ||||
import com.xdf.creative.util.file.UploadUtil; | import com.xdf.creative.util.file.UploadUtil; | ||||
import com.xdf.creative.util.image.FileToBase64; | import com.xdf.creative.util.image.FileToBase64; | ||||
} | } | ||||
} | } | ||||
@PostMapping("/doExcelFile") | |||||
@PostMapping("/doApplyFile") | |||||
@ApiOperation(value = "添加MultipartFile对象", notes = "添加文件上传", response = ApiResult.class) | |||||
public ApiResult<String> doApplyFile(MultipartFile file, @RequestParam Integer uploadPath) throws Exception { | |||||
String finalPath = ServerUploadDirUtil.getFileUploadDir(uploadPath); | |||||
ApiResult result = UploadUtil.upload(basePath + "/" + finalPath, file, ServiceFileUploadTypeEnum.SERVICE_FILE_UPLOAD_TYPE_FILE.getCode()); | |||||
if (result.getCode() == ApiCode.SUCCESS.getCode()) { | |||||
String saveName = result.getData().toString(); | |||||
return result.ok(finalPath + "/" + saveName); | |||||
} else { | |||||
return result; | |||||
} | |||||
} | |||||
/* @PostMapping("/doExcelFile") | |||||
@ApiOperation(value = "添加MultipartFile对象", notes = "添加文件上传", response = ApiResult.class) | @ApiOperation(value = "添加MultipartFile对象", notes = "添加文件上传", response = ApiResult.class) | ||||
public ApiResult<String> doExcelFile(MultipartFile file, @RequestParam Integer uploadPath) throws Exception { | public ApiResult<String> doExcelFile(MultipartFile file, @RequestParam Integer uploadPath) throws Exception { | ||||
} else { | } else { | ||||
return result; | return result; | ||||
} | } | ||||
} | |||||
}*/ | |||||
/** | /** | ||||
* 上传图片文件 | * 上传图片文件 |
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
import javax.validation.Valid; | import javax.validation.Valid; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
return ApiResult.ok(pageList); | return ApiResult.ok(pageList); | ||||
} | } | ||||
@GetMapping("/getSearchParkRecommendWebInfo") | |||||
@ApiOperation(value = "获取InfoContentWeb分页列表", notes = "信息内容分页列表", response = InfoContentWebSearchQueryVo.class) | |||||
public ApiResult<List<InfoContentWebSearchQueryVo>> getSearchParkRecommendWebInfo() throws Exception { | |||||
InfoContentWebSearchQueryParam infoContentWebSearchQueryParam = new InfoContentWebSearchQueryParam(); | |||||
infoContentWebSearchQueryParam.setTitle("文化"); | |||||
return ApiResult.ok(infoContentService.getSearchParkRecommendWebInfo(infoContentWebSearchQueryParam)); | |||||
} | |||||
@PostMapping("/getSearchWebsInfo") | @PostMapping("/getSearchWebsInfo") | ||||
@ApiOperation(value = "获取InfoContentWeb分页列表", notes = "信息内容分页列表", response = InfoContentWebSearchQueryVo.class) | @ApiOperation(value = "获取InfoContentWeb分页列表", notes = "信息内容分页列表", response = InfoContentWebSearchQueryVo.class) | ||||
public ApiResult<PageTool<InfoContentWebSearchQueryVo>> getSearchWebsInfo(@Valid @RequestBody InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception { | public ApiResult<PageTool<InfoContentWebSearchQueryVo>> getSearchWebsInfo(@Valid @RequestBody InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception { | ||||
return ApiResult.result(flag); | return ApiResult.result(flag); | ||||
} | } | ||||
@PostMapping("/getInfoHtml") | |||||
@ApiOperation(value = "删除InfoContent对象", notes = "删除信息内容", response = ApiResult.class) | |||||
public ApiResult getInfoHtml(@RequestBody IdParam idParam) throws Exception { | |||||
return infoContentService.getInfoHtml(idParam.getValue()); | |||||
} | |||||
/** | |||||
* @description: 初始化超链接新闻爬取 | |||||
* @param: | |||||
* @return: com.xdf.creative.util.page.ApiResult | |||||
* @author 一路心飞扬 lgw | |||||
* @date: 2020/12/25 14:08 | |||||
*/ | |||||
@GetMapping("/getHtmlByInfo") | |||||
@ApiOperation(value = "删除InfoContent对象", notes = "删除信息内容", response = ApiResult.class) | |||||
public ApiResult getHtmlByInfo() { | |||||
return infoContentService.getHtmlByInfo(); | |||||
} | |||||
/** | /** | ||||
* 信息内容分页列表 | * 信息内容分页列表 | ||||
*/ | */ |
package com.xdf.creative.module.controller; | |||||
import com.xdf.creative.base.controller.BaseController; | |||||
import com.xdf.creative.base.params.IdParam; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordAddParam; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordQueryParam; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordSaveCheckParam; | |||||
import com.xdf.creative.base.vo.creative.InfoKeywordQueryVo; | |||||
import com.xdf.creative.module.service.InfoKeywordService; | |||||
import com.xdf.creative.util.page.ApiResult; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.web.bind.annotation.PostMapping; | |||||
import org.springframework.web.bind.annotation.RequestBody; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.validation.Valid; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 前端控制器 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
@Slf4j | |||||
@RestController | |||||
@RequestMapping("/infoKeyword") | |||||
@Api("信息关键字 API") | |||||
public class InfoKeywordController extends BaseController { | |||||
@Autowired | |||||
private InfoKeywordService infoKeywordService; | |||||
/** | |||||
* 添加信息关键字 | |||||
*/ | |||||
@PostMapping("/add") | |||||
@ApiOperation(value = "添加InfoKeyword对象", notes = "添加信息关键字", response = ApiResult.class) | |||||
public ApiResult addInfoKeyword(@Valid @RequestBody InfoKeywordAddParam infoKeywordAddParam) throws Exception { | |||||
return infoKeywordService.add(infoKeywordAddParam); | |||||
} | |||||
/** | |||||
* 删除信息 | |||||
* @param idParam | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@PostMapping("/del") | |||||
@ApiOperation(value = "删除关键词", notes = "删除关键词", response = ApiResult.class) | |||||
public ApiResult del(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
return infoKeywordService.del(idParam.getId()); | |||||
} | |||||
/** | |||||
* 修改信息关键字 | |||||
*/ | |||||
@PostMapping("/edit") | |||||
@ApiOperation(value = "修改InfoKeyword对象", notes = "修改信息关键字", response = ApiResult.class) | |||||
public ApiResult edit(@Valid @RequestBody InfoKeywordAddParam infoKeywordAddParam) throws Exception { | |||||
return infoKeywordService.edit(infoKeywordAddParam); | |||||
} | |||||
/** | |||||
* 保存已选择的信息列表 | |||||
* @param infoKeywordSaveCheckParam | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@PostMapping("/saveCheckList") | |||||
@ApiOperation(value = "修改InfoKeyword对象", notes = "修改信息关键字", response = ApiResult.class) | |||||
public ApiResult saveCheckList(@Valid @RequestBody InfoKeywordSaveCheckParam infoKeywordSaveCheckParam) throws Exception { | |||||
return infoKeywordService.saveCheckList(infoKeywordSaveCheckParam); | |||||
} | |||||
/** | |||||
* 启用停用关键字 | |||||
* @param idParam | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@PostMapping("/enable") | |||||
@ApiOperation(value = "启用停用", notes = "删除信息关键字", response = ApiResult.class) | |||||
public ApiResult enable(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
return infoKeywordService.enable(idParam.getId()); | |||||
} | |||||
/** | |||||
* 获取已选择的关键字列表 | |||||
* @param idParam | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@PostMapping("/getCheckList") | |||||
@ApiOperation(value = "启用停用", notes = "删除信息关键字", response = ApiResult.class) | |||||
public ApiResult getCheckList(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
return infoKeywordService.getCheckList(idParam.getId()); | |||||
} | |||||
/** | |||||
* 删除信息关键字 | |||||
*/ | |||||
@PostMapping("/delete") | |||||
@ApiOperation(value = "删除InfoKeyword对象", notes = "删除信息关键字", response = ApiResult.class) | |||||
public ApiResult<Boolean> deleteInfoKeyword(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
boolean flag = infoKeywordService.removeById(idParam.getId()); | |||||
return ApiResult.result(flag); | |||||
} | |||||
/** | |||||
* 获取信息关键字 | |||||
*/ | |||||
@PostMapping("/info") | |||||
@ApiOperation(value = "获取InfoKeyword对象详情", notes = "查看信息关键字", response = InfoKeywordQueryVo.class) | |||||
public ApiResult<InfoKeywordQueryVo> getInfoKeyword(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
InfoKeywordQueryVo infoKeywordQueryVo = infoKeywordService.getInfoKeywordById(idParam.getId()); | |||||
return ApiResult.ok(infoKeywordQueryVo); | |||||
} | |||||
/** | |||||
* 信息关键字分页列表 | |||||
*/ | |||||
@PostMapping("/getPageList") | |||||
@ApiOperation(value = "获取InfoKeyword分页列表", notes = "信息关键字分页列表", response = InfoKeywordQueryVo.class) | |||||
public ApiResult<PageTool<InfoKeywordQueryVo>> getInfoKeywordPageList(@Valid @RequestBody InfoKeywordQueryParam infoKeywordQueryParam) throws Exception { | |||||
PageTool<InfoKeywordQueryVo> pageList = infoKeywordService.getInfoKeywordPageList(infoKeywordQueryParam); | |||||
return ApiResult.ok(pageList); | |||||
} | |||||
} | |||||
return ApiResult.ok(pageList); | return ApiResult.ok(pageList); | ||||
} | } | ||||
@PostMapping("/getExportPageList") | |||||
@ApiOperation(value = "获取WebInitiationApply分页列表", notes = "文促会入会申请终审人员查询", response = WebInitiationApplyQueryVo.class) | |||||
public ApiResult getExportPageList(@RequestBody WebInitiationApplyQueryParam webInitiationApplyQueryParam) throws Exception { | |||||
return webInitiationApplyService.getExportPageList(webInitiationApplyQueryParam,getRequest()); | |||||
} | |||||
} | } | ||||
package com.xdf.creative.module.controller; | |||||
import com.xdf.creative.base.controller.BaseController; | |||||
import com.xdf.creative.base.params.IdParam; | |||||
import com.xdf.creative.base.params.creative.WxGroupQueryParam; | |||||
import com.xdf.creative.base.vo.creative.WxGroupQueryVo; | |||||
import com.xdf.creative.enums.StateEnum; | |||||
import com.xdf.creative.module.entity.WxGroup; | |||||
import com.xdf.creative.module.service.WxGroupService; | |||||
import com.xdf.creative.util.page.ApiResult; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.web.bind.annotation.PostMapping; | |||||
import org.springframework.web.bind.annotation.RequestBody; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.validation.Valid; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 微信群二维码 前端控制器 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2021-01-28 | |||||
*/ | |||||
@Slf4j | |||||
@RestController | |||||
@RequestMapping("/wxGroup") | |||||
@Api("微信群二维码 API") | |||||
public class WxGroupController extends BaseController { | |||||
@Autowired | |||||
private WxGroupService wxGroupService; | |||||
/** | |||||
* 添加微信群二维码 | |||||
*/ | |||||
@PostMapping("/add") | |||||
@ApiOperation(value = "添加WxGroup对象", notes = "添加微信群二维码", response = ApiResult.class) | |||||
public ApiResult<Boolean> addWxGroup(@Valid @RequestBody WxGroup wxGroup) throws Exception { | |||||
boolean flag = wxGroupService.save(wxGroup); | |||||
return ApiResult.result(flag); | |||||
} | |||||
/** | |||||
* 修改微信群二维码 | |||||
*/ | |||||
@PostMapping("/update") | |||||
@ApiOperation(value = "修改WxGroup对象", notes = "修改微信群二维码", response = ApiResult.class) | |||||
public ApiResult<Boolean> updateWxGroup(@Valid @RequestBody WxGroup wxGroup) throws Exception { | |||||
wxGroup.setUpdateTime(new Date()); | |||||
boolean flag = wxGroupService.updateById(wxGroup); | |||||
return ApiResult.result(flag); | |||||
} | |||||
/** | |||||
* 删除微信群二维码 | |||||
*/ | |||||
@PostMapping("/delete") | |||||
@ApiOperation(value = "删除WxGroup对象", notes = "删除微信群二维码", response = ApiResult.class) | |||||
public ApiResult<Boolean> deleteWxGroup(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
boolean flag = wxGroupService.removeById(idParam.getId()); | |||||
return ApiResult.result(flag); | |||||
} | |||||
/** | |||||
* 获取微信群二维码 | |||||
*/ | |||||
@PostMapping("/info") | |||||
@ApiOperation(value = "获取WxGroup对象详情", notes = "查看微信群二维码", response = WxGroupQueryVo.class) | |||||
public ApiResult<WxGroupQueryVo> getWxGroup(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
WxGroupQueryVo wxGroupQueryVo = wxGroupService.getWxGroupById(idParam.getId()); | |||||
return ApiResult.ok(wxGroupQueryVo); | |||||
} | |||||
/** | |||||
* 微信群二维码分页列表 | |||||
*/ | |||||
@PostMapping("/getPageList") | |||||
@ApiOperation(value = "获取WxGroup分页列表", notes = "微信群二维码分页列表", response = WxGroupQueryVo.class) | |||||
public ApiResult<PageTool<WxGroupQueryVo>> getWxGroupPageList(@RequestBody WxGroupQueryParam wxGroupQueryParam) throws Exception { | |||||
PageTool<WxGroupQueryVo> pageList = wxGroupService.getWxGroupPageList(wxGroupQueryParam); | |||||
return ApiResult.ok(pageList); | |||||
} | |||||
@PostMapping("/getWebList") | |||||
@ApiOperation(value = "获取WxGroup分页列表", notes = "微信群二维码分页列表", response = WxGroupQueryVo.class) | |||||
public ApiResult<PageTool<WxGroupQueryVo>> getWebList() throws Exception { | |||||
WxGroupQueryParam wxGroupQueryParam =new WxGroupQueryParam(); | |||||
wxGroupQueryParam.setState(StateEnum.ENABLE.getKey()); | |||||
wxGroupQueryParam.setPageNum(1); | |||||
wxGroupQueryParam.setPageSize(30); | |||||
PageTool<WxGroupQueryVo> pageList = wxGroupService.getWxGroupPageList(wxGroupQueryParam); | |||||
return ApiResult.ok(pageList); | |||||
} | |||||
/** | |||||
* 启用停用关键字 | |||||
* @param idParam | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@PostMapping("/enable") | |||||
@ApiOperation(value = "启用停用", notes = "删除信息关键字", response = ApiResult.class) | |||||
public ApiResult enable(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
return wxGroupService.enable(idParam.getId()); | |||||
} | |||||
} | |||||
package com.xdf.creative.module.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.xdf.creative.base.entity.BaseEntity; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 信息和关键字关联表 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "InfContentKeyword对象", description = "信息和关键字关联表") | |||||
public class InfoContentKeyword extends BaseEntity { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty(value = "信息id") | |||||
private Long contentId; | |||||
@ApiModelProperty(value = "关键词id") | |||||
private Long keywordId; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
} |
package com.xdf.creative.module.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.xdf.creative.base.entity.BaseEntity; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "InfoKeyword对象", description = "信息关键字") | |||||
public class InfoKeyword extends BaseEntity { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty(value = "关键词") | |||||
private String keyword; | |||||
@ApiModelProperty(value = "是否通用 0 否 1是") | |||||
private Integer isUse; | |||||
@ApiModelProperty(value = "描述") | |||||
private String detail; | |||||
@ApiModelProperty(value = "状态 0 不可用 1可用") | |||||
private Integer state; | |||||
@ApiModelProperty(value = "创建用户") | |||||
private Long createUser; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
} |
@NotBlank(message = "单位名称不能为空") | @NotBlank(message = "单位名称不能为空") | ||||
private String name; | private String name; | ||||
@ApiModelProperty(value = "统一社会信用代码") | |||||
@NotBlank(message = "统一社会信用代码不能为空") | |||||
private String creditCode; | |||||
@ApiModelProperty(value = "单位logo") | @ApiModelProperty(value = "单位logo") | ||||
private String logo; | private String logo; | ||||
@ApiModelProperty(value = "其他") | @ApiModelProperty(value = "其他") | ||||
private String otherService; | private String otherService; | ||||
@ApiModelProperty(value = "申请附件") | |||||
private String applyAttachment; | |||||
@TableField(exist = false) | @TableField(exist = false) | ||||
@ApiModelProperty(value = "审核类型 1 初审 2 二审 ") | @ApiModelProperty(value = "审核类型 1 初审 2 二审 ") | ||||
protected Integer auditType; | protected Integer auditType; |
package com.xdf.creative.module.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.xdf.creative.base.entity.BaseEntity; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import javax.validation.constraints.NotBlank; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 微信群二维码 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2021-01-28 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "WxGroup对象", description = "微信群二维码") | |||||
public class WxGroup extends BaseEntity { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty(value = "产业名") | |||||
@NotBlank(message = "产业名不能为空") | |||||
private String name; | |||||
@ApiModelProperty(value = "状态,0:禁用,1:启用,2:锁定") | |||||
private Integer state; | |||||
@ApiModelProperty(value = "微信二维码") | |||||
@NotBlank(message = "二维码不能为空") | |||||
private String code; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
@ApiModelProperty(value = "更新时间") | |||||
private Date updateTime; | |||||
@ApiModelProperty(value = "创建者id") | |||||
private Long createUserId; | |||||
} |
package com.xdf.creative.module.listener; | |||||
import com.xdf.creative.module.entity.InfoContent; | |||||
import org.springframework.context.ApplicationEvent; | |||||
public class InfoContentHtmlListenEven extends ApplicationEvent { | |||||
public InfoContentHtmlListenEven(InfoContent infoContent) { | |||||
super(infoContent); | |||||
} | |||||
} |
package com.xdf.creative.module.listener; | |||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
import com.xdf.creative.base.params.InfoContentHtmlEntity; | |||||
import com.xdf.creative.module.entity.InfoContent; | |||||
import com.xdf.creative.module.entity.InfoDetail; | |||||
import com.xdf.creative.module.service.InfoDetailService; | |||||
import com.xdf.creative.util.StringUtil; | |||||
import com.xdf.creative.util.image.HtmlUtils; | |||||
import org.jsoup.nodes.Document; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.context.ApplicationListener; | |||||
import org.springframework.data.mongodb.core.MongoTemplate; | |||||
import org.springframework.scheduling.annotation.Async; | |||||
import org.springframework.stereotype.Component; | |||||
@Component | |||||
public class InfoContentHtmlListener implements ApplicationListener<InfoContentHtmlListenEven> { | |||||
@Autowired | |||||
private InfoDetailService infoDetailService; | |||||
@Autowired | |||||
private MongoTemplate mongoTemplate; | |||||
/** | |||||
* 异步抓取html | |||||
* | |||||
* @param infoContentHtmlListenEven | |||||
*/ | |||||
@Async | |||||
public void onApplicationEvent(InfoContentHtmlListenEven infoContentHtmlListenEven) { | |||||
Object source = infoContentHtmlListenEven.getSource(); | |||||
if (source instanceof InfoContent) { | |||||
//取出超链接 | |||||
InfoDetail infoDetail = infoDetailService.getOne(new QueryWrapper<InfoDetail>().eq("foreign_id",((InfoContent) source).getForeignId())); | |||||
if(null!=infoDetail){ | |||||
String html = HtmlUtils.sendGetTwo(infoDetail.getHyperlink()); | |||||
if(!StringUtil.isEmpty(html)){ | |||||
Document document = HtmlUtils.getDocument(html); | |||||
if(document.hasText()){ | |||||
InfoContentHtmlEntity infoContentHtmlEntity = new InfoContentHtmlEntity(); | |||||
String content =document.html(); | |||||
infoContentHtmlEntity.setContent(content.replaceAll("data-src=\"","src=\"http://img01.sogoucdn.com/net/a/04/link?appid=100520033&url=").replaceFirst("<head>","<head><meta name=\"referrer\" content=\"no-referrer\" />")); | |||||
// infoContentHtmlEntity.setContent(content); | |||||
infoContentHtmlEntity.setContentText(document.text()); | |||||
infoContentHtmlEntity.setInfoContId(((InfoContent) source).getId().toString()); | |||||
infoContentHtmlEntity.setTitle(((InfoContent) source).getTitle()); | |||||
mongoTemplate.save(infoContentHtmlEntity); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} |
package com.xdf.creative.module.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.xdf.creative.base.params.creative.InfoContentKeywordQueryParam; | |||||
import com.xdf.creative.base.vo.creative.InfoContentKeywordQueryVo; | |||||
import com.xdf.creative.module.entity.InfoContentKeyword; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.springframework.stereotype.Repository; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 信息和关键字关联表 Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
@Repository | |||||
public interface InfoContentKeywordMapper extends BaseMapper<InfoContentKeyword> { | |||||
/** | |||||
* 根据ID获取查询对象 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
InfoContentKeywordQueryVo getInfoContentKeywordById(Serializable id); | |||||
/** | |||||
* 获取分页对象 | |||||
* | |||||
* @param page | |||||
* @param infoContentKeywordQueryParam | |||||
* @return | |||||
*/ | |||||
IPage<InfoContentKeywordQueryVo> getInfoContentKeywordPageList(@Param("page") Page page, @Param("param") InfoContentKeywordQueryParam infoContentKeywordQueryParam); | |||||
} |
@Repository | @Repository | ||||
public interface InfoContentMapper extends BaseMapper<InfoContent> { | public interface InfoContentMapper extends BaseMapper<InfoContent> { | ||||
InfoContentQueryVo getUpInfoContent(@Param("param") InfoContentQueryParam infoContentQueryParam); | |||||
InfoContentQueryVo getDownInfoContent(@Param("param") InfoContentQueryParam infoContentQueryParam); | |||||
/** | /** | ||||
* 首页显示新闻 | * 首页显示新闻 | ||||
* | * | ||||
List<InfoContentHomePageQueryVo> getHomePageInfo(@Param("param") InfoContentHomePageQueryParam infoContentHomePageQueryParam); | List<InfoContentHomePageQueryVo> getHomePageInfo(@Param("param") InfoContentHomePageQueryParam infoContentHomePageQueryParam); | ||||
List<InfoContentWebSearchQueryVo> getSearchParkRecommendWebInfo(@Param("param") InfoContentWebSearchQueryParam infoContentWebSearchQueryParam); | |||||
List<InfoContentHomePageQueryVo> getHomePagesInfo(InfoContentHomePageListParam infoContentHomePageListParam); | List<InfoContentHomePageQueryVo> getHomePagesInfo(InfoContentHomePageListParam infoContentHomePageListParam); | ||||
package com.xdf.creative.module.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordQueryParam; | |||||
import com.xdf.creative.base.vo.creative.InfoKeywordCheckListVo; | |||||
import com.xdf.creative.base.vo.creative.InfoKeywordQueryVo; | |||||
import com.xdf.creative.module.entity.InfoKeyword; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.springframework.stereotype.Repository; | |||||
import java.io.Serializable; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
@Repository | |||||
public interface InfoKeywordMapper extends BaseMapper<InfoKeyword> { | |||||
/** | |||||
* 获取已经选择的关键词 | |||||
* @param id 内容id | |||||
* @return | |||||
*/ | |||||
List<InfoKeywordCheckListVo> getCheckList(Serializable id); | |||||
/** | |||||
* 根据内容id获取关键词列表 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
List<InfoKeywordCheckListVo> getKeywordListByContentId(Serializable id); | |||||
/** | |||||
* 根据ID获取查询对象 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
InfoKeywordQueryVo getInfoKeywordById(Serializable id); | |||||
/** | |||||
* 获取分页对象 | |||||
* | |||||
* @param page | |||||
* @param infoKeywordQueryParam | |||||
* @return | |||||
*/ | |||||
IPage<InfoKeywordQueryVo> getInfoKeywordPageList(@Param("page") Page page, @Param("param") InfoKeywordQueryParam infoKeywordQueryParam); | |||||
} |
import com.baomidou.mybatisplus.core.metadata.IPage; | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.xdf.creative.base.params.creative.WebInitiationApplyQueryParam; | import com.xdf.creative.base.params.creative.WebInitiationApplyQueryParam; | ||||
import com.xdf.creative.base.vo.creative.WebInitiationApplyExportVo; | |||||
import com.xdf.creative.base.vo.creative.WebInitiationApplyQueryVo; | import com.xdf.creative.base.vo.creative.WebInitiationApplyQueryVo; | ||||
import com.xdf.creative.module.entity.WebInitiationApply; | import com.xdf.creative.module.entity.WebInitiationApply; | ||||
import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
import org.springframework.stereotype.Repository; | import org.springframework.stereotype.Repository; | ||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
*/ | */ | ||||
IPage<WebInitiationApplyQueryVo> getPageListByFinalAudit(@Param("page") Page page, @Param("param") WebInitiationApplyQueryParam webInitiationApplyQueryParam); | IPage<WebInitiationApplyQueryVo> getPageListByFinalAudit(@Param("page") Page page, @Param("param") WebInitiationApplyQueryParam webInitiationApplyQueryParam); | ||||
List<WebInitiationApplyExportVo> getExportPageList(@Param("param") WebInitiationApplyQueryParam webInitiationApplyQueryParam); | |||||
} | } |
package com.xdf.creative.module.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.xdf.creative.base.params.creative.WxGroupQueryParam; | |||||
import com.xdf.creative.base.vo.creative.WxGroupQueryVo; | |||||
import com.xdf.creative.module.entity.WxGroup; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.springframework.stereotype.Repository; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 微信群二维码 Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2021-01-28 | |||||
*/ | |||||
@Repository | |||||
public interface WxGroupMapper extends BaseMapper<WxGroup> { | |||||
/** | |||||
* 根据ID获取查询对象 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
WxGroupQueryVo getWxGroupById(Serializable id); | |||||
/** | |||||
* 获取分页对象 | |||||
* | |||||
* @param page | |||||
* @param wxGroupQueryParam | |||||
* @return | |||||
*/ | |||||
IPage<WxGroupQueryVo> getWxGroupPageList(@Param("page") Page page, @Param("param") WxGroupQueryParam wxGroupQueryParam); | |||||
} |
package com.xdf.creative.module.service; | |||||
import com.xdf.creative.base.params.creative.InfoContentKeywordQueryParam; | |||||
import com.xdf.creative.base.service.BaseService; | |||||
import com.xdf.creative.base.vo.creative.InfoContentKeywordQueryVo; | |||||
import com.xdf.creative.module.entity.InfoContentKeyword; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 信息和关键字关联表 服务类 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
public interface InfoContentKeywordService extends BaseService<InfoContentKeyword> { | |||||
/** | |||||
* 根据ID获取查询对象 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
InfoContentKeywordQueryVo getInfoContentKeywordById(Serializable id) throws Exception; | |||||
/** | |||||
* 获取分页对象 | |||||
* | |||||
* @param infoContentKeywordQueryParam | |||||
* @return | |||||
*/ | |||||
PageTool<InfoContentKeywordQueryVo> getInfoContentKeywordPageList(InfoContentKeywordQueryParam infoContentKeywordQueryParam) throws Exception; | |||||
} |
PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception; | PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception; | ||||
/** | |||||
* 园区推荐列表 | |||||
* @param infoContentWebSearchQueryParam | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
List<InfoContentWebSearchQueryVo> getSearchParkRecommendWebInfo(InfoContentWebSearchQueryParam infoContentWebSearchQueryParam) throws Exception; | |||||
/** | /** | ||||
* 手机端搜索新闻 | * 手机端搜索新闻 | ||||
* @param infoContentWebSearchQueryParam | * @param infoContentWebSearchQueryParam | ||||
*/ | */ | ||||
InfoContentQueryVo getInfoContentById(Serializable id) throws Exception; | InfoContentQueryVo getInfoContentById(Serializable id) throws Exception; | ||||
/** | /** | ||||
* 获取分页对象 | * 获取分页对象 | ||||
* | * | ||||
*/ | */ | ||||
PageTool<InfoContentQueryVo> getInfoContentPageList(InfoContentQueryParam infoContentQueryParam) throws Exception; | PageTool<InfoContentQueryVo> getInfoContentPageList(InfoContentQueryParam infoContentQueryParam) throws Exception; | ||||
ApiResult getInfoHtml(String infoId); | |||||
ApiResult getHtmlByInfo(); | |||||
} | } |
package com.xdf.creative.module.service; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordAddParam; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordQueryParam; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordSaveCheckParam; | |||||
import com.xdf.creative.base.service.BaseService; | |||||
import com.xdf.creative.base.vo.creative.InfoKeywordCheckListVo; | |||||
import com.xdf.creative.base.vo.creative.InfoKeywordQueryVo; | |||||
import com.xdf.creative.module.entity.InfoKeyword; | |||||
import com.xdf.creative.util.page.ApiResult; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import java.io.Serializable; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 服务类 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
public interface InfoKeywordService extends BaseService<InfoKeyword> { | |||||
/** | |||||
* 增加关键词 | |||||
* @param infoKeywordAddParam | |||||
* @return | |||||
*/ | |||||
ApiResult add(InfoKeywordAddParam infoKeywordAddParam); | |||||
/** | |||||
* 编辑关键词 | |||||
* @param infoKeywordAddParam | |||||
* @return | |||||
*/ | |||||
ApiResult edit(InfoKeywordAddParam infoKeywordAddParam); | |||||
/** | |||||
* 启用停用 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
ApiResult enable(Serializable id); | |||||
/** | |||||
* 删除 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
ApiResult del(Serializable id); | |||||
/** | |||||
* 获取已购选的list | |||||
* @param contentId | |||||
* @return | |||||
*/ | |||||
ApiResult getCheckList(Serializable contentId); | |||||
/*** | |||||
* 获取保存的list | |||||
* @param infoKeywordSaveCheckParam | |||||
* @return | |||||
*/ | |||||
ApiResult saveCheckList(InfoKeywordSaveCheckParam infoKeywordSaveCheckParam); | |||||
List<InfoKeywordCheckListVo> getKeywordListByContentId(Serializable contentId); | |||||
/** | |||||
* 根据ID获取查询对象 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
InfoKeywordQueryVo getInfoKeywordById(Serializable id) throws Exception; | |||||
/** | |||||
* 获取分页对象 | |||||
* | |||||
* @param infoKeywordQueryParam | |||||
* @return | |||||
*/ | |||||
PageTool<InfoKeywordQueryVo> getInfoKeywordPageList(InfoKeywordQueryParam infoKeywordQueryParam) throws Exception; | |||||
} |
import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
import javax.servlet.http.HttpServletRequest; | |||||
import java.io.Serializable; | import java.io.Serializable; | ||||
/** | /** | ||||
*/ | */ | ||||
ApiResult<Boolean> sendAudit(WebInitiationApply webInitiationApply); | ApiResult<Boolean> sendAudit(WebInitiationApply webInitiationApply); | ||||
/** | |||||
* @description: 导出 | |||||
* @param: [] | |||||
* @return: com.xdf.creative.util.page.ApiResult | |||||
*/ | |||||
ApiResult getExportPageList(WebInitiationApplyQueryParam webInitiationApplyQueryParam, HttpServletRequest request); | |||||
} | } |
package com.xdf.creative.module.service; | |||||
import com.xdf.creative.base.params.creative.WxGroupQueryParam; | |||||
import com.xdf.creative.base.service.BaseService; | |||||
import com.xdf.creative.base.vo.creative.WxGroupQueryVo; | |||||
import com.xdf.creative.module.entity.WxGroup; | |||||
import com.xdf.creative.util.page.ApiResult; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 微信群二维码 服务类 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2021-01-28 | |||||
*/ | |||||
public interface WxGroupService extends BaseService<WxGroup> { | |||||
/** | |||||
* 启用停用 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
ApiResult enable(Serializable id); | |||||
/** | |||||
* 根据ID获取查询对象 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
WxGroupQueryVo getWxGroupById(Serializable id) throws Exception; | |||||
/** | |||||
* 获取分页对象 | |||||
* | |||||
* @param wxGroupQueryParam | |||||
* @return | |||||
*/ | |||||
PageTool<WxGroupQueryVo> getWxGroupPageList(WxGroupQueryParam wxGroupQueryParam) throws Exception; | |||||
} |
package com.xdf.creative.module.service.impl; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.xdf.creative.base.params.creative.InfoContentKeywordQueryParam; | |||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | |||||
import com.xdf.creative.base.vo.creative.InfoContentKeywordQueryVo; | |||||
import com.xdf.creative.module.entity.InfoContentKeyword; | |||||
import com.xdf.creative.module.mapper.InfoContentKeywordMapper; | |||||
import com.xdf.creative.module.service.InfoContentKeywordService; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 信息和关键字关联表 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
@Slf4j | |||||
@Service | |||||
@Transactional(rollbackFor = Exception.class) | |||||
public class InfoContentKeywordServiceImpl extends BaseServiceImpl<InfoContentKeywordMapper, InfoContentKeyword> implements InfoContentKeywordService { | |||||
@Autowired | |||||
private InfoContentKeywordMapper infoContentKeywordMapper; | |||||
@Override | |||||
public InfoContentKeywordQueryVo getInfoContentKeywordById(Serializable id) throws Exception { | |||||
return infoContentKeywordMapper.getInfoContentKeywordById(id); | |||||
} | |||||
@Override | |||||
public PageTool<InfoContentKeywordQueryVo> getInfoContentKeywordPageList(InfoContentKeywordQueryParam infoContentKeywordQueryParam) throws Exception { | |||||
Page page = setPageParam(infoContentKeywordQueryParam); | |||||
IPage<InfoContentKeywordQueryVo> iPage = infoContentKeywordMapper.getInfoContentKeywordPageList(page, infoContentKeywordQueryParam); | |||||
return new PageTool(iPage); | |||||
} | |||||
} |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
import com.baomidou.mybatisplus.core.metadata.IPage; | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.xdf.creative.base.params.InfoContentHtmlEntity; | |||||
import com.xdf.creative.base.params.creative.*; | import com.xdf.creative.base.params.creative.*; | ||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | import com.xdf.creative.base.service.impl.BaseServiceImpl; | ||||
import com.xdf.creative.base.vo.creative.*; | import com.xdf.creative.base.vo.creative.*; | ||||
import com.xdf.creative.constant.CommonConstant; | |||||
import com.xdf.creative.enums.*; | import com.xdf.creative.enums.*; | ||||
import com.xdf.creative.module.entity.*; | import com.xdf.creative.module.entity.*; | ||||
import com.xdf.creative.module.listener.InfoContentHtmlListenEven; | |||||
import com.xdf.creative.module.mapper.InfoContentMapper; | import com.xdf.creative.module.mapper.InfoContentMapper; | ||||
import com.xdf.creative.module.service.*; | import com.xdf.creative.module.service.*; | ||||
import com.xdf.creative.util.StringUtil; | import com.xdf.creative.util.StringUtil; | ||||
import com.xdf.creative.util.UUIDUtil; | import com.xdf.creative.util.UUIDUtil; | ||||
import com.xdf.creative.util.image.HtmlUtils; | |||||
import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.jsoup.nodes.Document; | |||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.context.ApplicationContext; | |||||
import org.springframework.data.mongodb.core.MongoTemplate; | |||||
import org.springframework.data.mongodb.core.query.Criteria; | |||||
import org.springframework.data.mongodb.core.query.Query; | |||||
import org.springframework.data.redis.core.RedisTemplate; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.time.Duration; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Date; | import java.util.Date; | ||||
import java.util.List; | import java.util.List; | ||||
@Autowired | @Autowired | ||||
private SysUserService sysUserService; | private SysUserService sysUserService; | ||||
@Autowired | |||||
private InfoKeywordService infoKeywordService; | |||||
@Autowired | |||||
private InfoContentKeywordService infoContentKeywordService; | |||||
@Autowired | |||||
private MongoTemplate mongoTemplate; | |||||
@Autowired | |||||
private RedisTemplate redisTemplate; | |||||
@Autowired | |||||
private ApplicationContext applicationContext; | |||||
/** | /** | ||||
* t添加信息内容 | * t添加信息内容 | ||||
* @param infoContentAddQueryParam | * @param infoContentAddQueryParam | ||||
infoContentWebAllQueryVo.setUrlList(infoUrlList); | infoContentWebAllQueryVo.setUrlList(infoUrlList); | ||||
} | } | ||||
} | } | ||||
//获取关键字 | |||||
List<InfoKeywordCheckListVo> infoKeywordCheckListVoList = infoKeywordService.getKeywordListByContentId(id); | |||||
if(null!=infoKeywordCheckListVoList&&infoKeywordCheckListVoList.size()>0){ | |||||
List<String> keyWords = infoKeywordCheckListVoList.stream().map(t->t.getKeyword()).distinct().collect(Collectors.toList()); | |||||
if(null!=keyWords||keyWords.size()>0){ | |||||
infoContentWebAllQueryVo.setKeyWord(keyWords.toString()); | |||||
} | |||||
} | |||||
//上一篇下一篇 | |||||
InfoContentQueryParam infoContentQueryParam =new InfoContentQueryParam(); | |||||
infoContentQueryParam.setId(infoContent.getId()).setTypeId(infoType.getTypeId().substring(0,3)); | |||||
InfoContentQueryVo infoContentQueryVoUp = baseMapper.getUpInfoContent(infoContentQueryParam); | |||||
if(null!=infoContentQueryVoUp){ | |||||
infoContentWebAllQueryVo.setUpTitle(infoContentQueryVoUp.getTitle()).setUpInfoId(infoContentQueryVoUp.getId()).setUpImageUrl(infoContentQueryVoUp.getImageUrl()).setUpHyperlink(infoContentQueryVoUp.getHyperlink()); | |||||
} | |||||
InfoContentQueryVo infoContentQueryVoDown = baseMapper.getDownInfoContent(infoContentQueryParam); | |||||
if(null!=infoContentQueryVoDown){ | |||||
infoContentWebAllQueryVo.setDownTitle(infoContentQueryVoDown.getTitle()).setDownInfoId(infoContentQueryVoDown.getId()).setDownImageUrl(infoContentQueryVoDown.getImageUrl()).setDownHyperlink(infoContentQueryVoDown.getHyperlink()); | |||||
} | |||||
return ApiResult.ok(infoContentWebAllQueryVo); | return ApiResult.ok(infoContentWebAllQueryVo); | ||||
} | } | ||||
infoContent.setFinalAuditTime(new Date()); | infoContent.setFinalAuditTime(new Date()); | ||||
infoContent.setFinalAuditUser(getUserId()); | infoContent.setFinalAuditUser(getUserId()); | ||||
this.saveOrUpdate(infoContent); | this.saveOrUpdate(infoContent); | ||||
//添加关键词 | |||||
List<InfoKeyword> infoKeywordList = infoKeywordService.list(new QueryWrapper<InfoKeyword>().eq("state",StateEnum.ENABLE.getKey()).eq("is_use",StateEnum.ENABLE.getKey())); | |||||
List<InfoContentKeyword> infoContentKeywordList = new ArrayList<>(); | |||||
infoContentKeywordService.remove(new QueryWrapper<InfoContentKeyword>().eq("content_id",infoContent.getId())); | |||||
for (InfoKeyword infoKeyWord:infoKeywordList | |||||
) { | |||||
InfoContentKeyword infoContentKeyword = new InfoContentKeyword(); | |||||
infoContentKeyword.setKeywordId(infoKeyWord.getId()).setContentId(infoContent.getId()).setCreateTime(new Date()); | |||||
infoContentKeywordList.add(infoContentKeyword); | |||||
} | |||||
infoContentKeywordService.saveBatch(infoContentKeywordList); | |||||
if(InfoAuditTypeEnum.INFO_STATE_TYPE_AUDIT_PASS.getCode().equals(infoContentAuditQueryParam.getAuditState())){ | |||||
if(StateEnum.ENABLE.getKey().equals(infoContent.getContentType())){ | |||||
applicationContext.publishEvent(new InfoContentHtmlListenEven(infoContent)); | |||||
} | |||||
} | |||||
return ApiResult.ok(); | return ApiResult.ok(); | ||||
} | } | ||||
return new PageTool(iPage); | return new PageTool(iPage); | ||||
} | } | ||||
@Override | |||||
public List<InfoContentWebSearchQueryVo> getSearchParkRecommendWebInfo(InfoContentWebSearchQueryParam infoContentWebSearchQueryParam) throws Exception { | |||||
List<InfoContentWebSearchQueryVo> list = new ArrayList<>(); | |||||
if(!redisTemplate.hasKey(String.format(CommonConstant.XDF_CULTURE_PARK_INFO_CONTENT_RECOMMEND, CommonConstant.XDF_CULTURE_PARK_INFO_CONTENT_RECOMMEND_KEY))){ | |||||
list = infoContentMapper.getSearchParkRecommendWebInfo(infoContentWebSearchQueryParam); | |||||
redisTemplate.opsForValue().set(String.format(CommonConstant.XDF_CULTURE_PARK_INFO_CONTENT_RECOMMEND, CommonConstant.XDF_CULTURE_PARK_INFO_CONTENT_RECOMMEND_KEY),list, Duration.ofSeconds(72000)); | |||||
}else{ | |||||
Object o = redisTemplate.opsForValue().get(String.format(CommonConstant.XDF_CULTURE_PARK_INFO_CONTENT_RECOMMEND, CommonConstant.XDF_CULTURE_PARK_INFO_CONTENT_RECOMMEND_KEY)); | |||||
list = (List<InfoContentWebSearchQueryVo>) o; | |||||
} | |||||
return list; | |||||
} | |||||
@Override | @Override | ||||
public PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception { | public PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception { | ||||
Page page = setPageParam(infoContentWebSearchListParam); | Page page = setPageParam(infoContentWebSearchListParam); | ||||
return new PageTool(iPage); | return new PageTool(iPage); | ||||
} | } | ||||
@Override | |||||
public ApiResult getInfoHtml(String infoId) { | |||||
if(StringUtil.isEmpty(infoId)){ | |||||
return ApiResult.fail("新闻标识不能为空!"); | |||||
} | |||||
Criteria criteria = new Criteria(); | |||||
//组织名称 | |||||
criteria.and("infoContId").is(infoId); | |||||
Query query = new Query(); | |||||
query.addCriteria(criteria); | |||||
InfoContentHtmlEntity infoContentHtmlEntity = mongoTemplate.findOne(query, InfoContentHtmlEntity.class); | |||||
/* String content = infoContentHtmlEntity.getContent(); | |||||
infoContentHtmlEntity.setContent(content.replaceAll("data-src=\"","src=\"http://img01.sogoucdn.com/net/a/04/link?appid=100520033&url=").replaceFirst("<head>","<head><meta name=\"referrer\" content=\"no-referrer\" />"));*/ | |||||
return ApiResult.ok(infoContentHtmlEntity); | |||||
} | |||||
@Override | |||||
@Transactional | |||||
public ApiResult getHtmlByInfo() { | |||||
List<InfoContent> infoContentList = this.list(new QueryWrapper<InfoContent>().eq("content_type",StateEnum.ENABLE.getKey()).eq("online_type",InfoOnlineStateEnum.PUBLIC_INFO_STATE_ONLINE.getCode()).ge("id",423)); | |||||
int count = infoContentList.size(); | |||||
int successCount = 0; | |||||
for (InfoContent infoContent:infoContentList | |||||
) { | |||||
//取出超链接 | |||||
Criteria criteria = new Criteria(); | |||||
//组织名称 | |||||
criteria.and("infoContId").is(infoContent.getId().toString()); | |||||
Query query = new Query(); | |||||
query.addCriteria(criteria); | |||||
InfoContentHtmlEntity infoContentHtmlEntity = mongoTemplate.findOne(query, InfoContentHtmlEntity.class); | |||||
if(null==infoContentHtmlEntity) { | |||||
InfoDetail infoDetail = infoDetailService.getOne(new QueryWrapper<InfoDetail>().eq("foreign_id", infoContent.getForeignId())); | |||||
if (null != infoDetail) { | |||||
try{ | |||||
String html = HtmlUtils.sendGetTwo(infoDetail.getHyperlink()); | |||||
if (!StringUtil.isEmpty(html)) { | |||||
Document document = HtmlUtils.getDocument(html); | |||||
if (document.hasText()) { | |||||
infoContentHtmlEntity = new InfoContentHtmlEntity(); | |||||
String content =document.html(); | |||||
infoContentHtmlEntity.setContent(content.replaceAll("data-src=\"","src=\"http://img01.sogoucdn.com/net/a/04/link?appid=100520033&url=").replaceFirst("<head>","<head><meta name=\"referrer\" content=\"no-referrer\" />")); | |||||
infoContentHtmlEntity.setContentText(document.text()); | |||||
infoContentHtmlEntity.setInfoContId(infoContent.getId().toString()); | |||||
infoContentHtmlEntity.setTitle(infoContent.getTitle()); | |||||
mongoTemplate.save(infoContentHtmlEntity); | |||||
successCount++; | |||||
} | |||||
} | |||||
}catch (Exception e){ | |||||
log.error("错误id"+infoContent.getId()+"错误信息:"+e.getMessage()); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
return ApiResult.ok("总计"+count+"条,爬取"+successCount+"条!"); | |||||
} | |||||
} | } |
package com.xdf.creative.module.service.impl; | |||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordAddParam; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordQueryParam; | |||||
import com.xdf.creative.base.params.creative.InfoKeywordSaveCheckParam; | |||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | |||||
import com.xdf.creative.base.vo.creative.InfoKeywordCheckListVo; | |||||
import com.xdf.creative.base.vo.creative.InfoKeywordQueryVo; | |||||
import com.xdf.creative.constant.CommonConstant; | |||||
import com.xdf.creative.enums.StateEnum; | |||||
import com.xdf.creative.enums.StatusCode; | |||||
import com.xdf.creative.module.entity.InfoContent; | |||||
import com.xdf.creative.module.entity.InfoContentKeyword; | |||||
import com.xdf.creative.module.entity.InfoKeyword; | |||||
import com.xdf.creative.module.mapper.InfoKeywordMapper; | |||||
import com.xdf.creative.module.service.InfoContentKeywordService; | |||||
import com.xdf.creative.module.service.InfoContentService; | |||||
import com.xdf.creative.module.service.InfoKeywordService; | |||||
import com.xdf.creative.util.page.ApiResult; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.BeanUtils; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.io.Serializable; | |||||
import java.util.ArrayList; | |||||
import java.util.Date; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 信息关键字 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-11-27 | |||||
*/ | |||||
@Slf4j | |||||
@Service | |||||
@Transactional(rollbackFor = Exception.class) | |||||
public class InfoKeywordServiceImpl extends BaseServiceImpl<InfoKeywordMapper, InfoKeyword> implements InfoKeywordService { | |||||
@Autowired | |||||
private InfoKeywordMapper infoKeywordMapper; | |||||
@Autowired | |||||
private InfoContentKeywordService infoContentKeywordService; | |||||
@Autowired | |||||
private InfoContentService infoContentService; | |||||
/** | |||||
* 添加关键词 | |||||
* @param infoKeywordAddParam | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public ApiResult add(InfoKeywordAddParam infoKeywordAddParam) { | |||||
InfoKeyword infoKeyword = new InfoKeyword(); | |||||
BeanUtils.copyProperties(infoKeywordAddParam, infoKeyword); | |||||
infoKeyword.setId(null); | |||||
infoKeyword.setCreateUser(getUserId()); | |||||
infoKeyword.setState(StateEnum.ENABLE.getKey()); | |||||
if (StateEnum.ENABLE.getKey().equals(infoKeyword.getIsUse())) { | |||||
if (this.count(new QueryWrapper<InfoKeyword>().eq("state", StateEnum.ENABLE.getKey()).eq("is_use", StateEnum.ENABLE.getKey())) >= CommonConstant.KEY_WORD_MAX_SIZE) { | |||||
return ApiResult.fail("常用关键字不能操作"+ CommonConstant.KEY_WORD_MAX_SIZE+"个"); | |||||
} | |||||
} | |||||
this.saveOrUpdate(infoKeyword); | |||||
return ApiResult.ok(); | |||||
} | |||||
/** | |||||
* 编辑关键词 | |||||
* @param infoKeywordAddParam | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public ApiResult edit(InfoKeywordAddParam infoKeywordAddParam) { | |||||
InfoKeyword infoKeyword = this.getById(infoKeywordAddParam.getId()); | |||||
if (null == infoKeyword) { | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
} | |||||
if (StateEnum.ENABLE.getKey().equals(infoKeywordAddParam.getIsUse())) { | |||||
if (this.count(new QueryWrapper<InfoKeyword>().eq("state", StateEnum.ENABLE.getKey()).eq("is_use", StateEnum.ENABLE.getKey())) >= CommonConstant.KEY_WORD_MAX_SIZE) { | |||||
return ApiResult.fail("常用关键字不能操作"+ CommonConstant.KEY_WORD_MAX_SIZE+"个"); | |||||
} | |||||
} | |||||
BeanUtils.copyProperties(infoKeywordAddParam, infoKeyword); | |||||
this.saveOrUpdate(infoKeyword); | |||||
return ApiResult.ok(); | |||||
} | |||||
/** | |||||
* 启用停用关键词 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public ApiResult enable(Serializable id) { | |||||
InfoKeyword infoKeyword = this.getById(id); | |||||
if (null == infoKeyword) { | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
} | |||||
if (StateEnum.ENABLE.getKey().equals(infoKeyword.getState())) { | |||||
infoKeyword.setState(StateEnum.DISABLE.getKey()); | |||||
} else { | |||||
infoKeyword.setState(StateEnum.ENABLE.getKey()); | |||||
} | |||||
this.saveOrUpdate(infoKeyword); | |||||
return ApiResult.ok(); | |||||
} | |||||
/** | |||||
* 删除关键字 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public ApiResult del(Serializable id) { | |||||
InfoKeyword infoKeyword = this.getById(id); | |||||
if(null==infoKeyword){ | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
} | |||||
if(StateEnum.ENABLE.getKey().equals(infoKeyword.getState())){ | |||||
return ApiResult.fail("只能删除已停用的关键词!"); | |||||
} | |||||
if(infoContentKeywordService.count(new QueryWrapper<InfoContentKeyword>().eq("keyword_id",id))>0){ | |||||
return ApiResult.fail("当前关键字已经被绑定,只能停用!"); | |||||
} | |||||
this.removeById(infoKeyword); | |||||
return ApiResult.ok(); | |||||
} | |||||
/** | |||||
* 获取已选择关键词列表 | |||||
* @param contentId | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public ApiResult getCheckList(Serializable contentId) { | |||||
return ApiResult.ok(baseMapper.getCheckList(contentId)); | |||||
} | |||||
/** | |||||
* 给新闻添加关键字 | |||||
* @param infoKeywordSaveCheckParam | |||||
* @return | |||||
*/ | |||||
@Override | |||||
@Transactional | |||||
public ApiResult saveCheckList(InfoKeywordSaveCheckParam infoKeywordSaveCheckParam) { | |||||
List<Long> keyIds =infoKeywordSaveCheckParam.getKeyIds(); | |||||
if(null==keyIds||keyIds.size()<=0){ | |||||
return ApiResult.fail("请选择关键词!"); | |||||
} | |||||
InfoContent infoContent = infoContentService.getById(infoKeywordSaveCheckParam.getContentId()); | |||||
if(null == infoContent){ | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
} | |||||
List<InfoContentKeyword> infoContentKeywordList = new ArrayList<>(); | |||||
if(infoContentKeywordService.remove(new QueryWrapper<InfoContentKeyword>().eq("content_id",infoContent.getId()))){ | |||||
for (Long keyId:keyIds | |||||
) { | |||||
InfoKeyword infoKeyword = this.getById(keyId); | |||||
if(null!=infoKeyword&& StateEnum.ENABLE.getKey().equals(infoKeyword.getState())){ | |||||
InfoContentKeyword infoContentKeyword = new InfoContentKeyword(); | |||||
infoContentKeyword.setContentId(infoContent.getId()).setKeywordId(infoKeyword.getId()).setCreateTime(new Date()); | |||||
infoContentKeywordList.add(infoContentKeyword); | |||||
} | |||||
} | |||||
} | |||||
infoContentKeywordService.saveBatch(infoContentKeywordList); | |||||
return ApiResult.ok(); | |||||
} | |||||
@Override | |||||
public List<InfoKeywordCheckListVo> getKeywordListByContentId(Serializable contentId) { | |||||
return baseMapper.getKeywordListByContentId(contentId); | |||||
} | |||||
@Override | |||||
public InfoKeywordQueryVo getInfoKeywordById(Serializable id) throws Exception { | |||||
return infoKeywordMapper.getInfoKeywordById(id); | |||||
} | |||||
@Override | |||||
public PageTool<InfoKeywordQueryVo> getInfoKeywordPageList(InfoKeywordQueryParam infoKeywordQueryParam) throws Exception { | |||||
Page page = setPageParam(infoKeywordQueryParam); | |||||
IPage<InfoKeywordQueryVo> iPage = infoKeywordMapper.getInfoKeywordPageList(page, infoKeywordQueryParam); | |||||
return new PageTool(iPage); | |||||
} | |||||
} |
import com.xdf.creative.base.service.impl.BaseServiceImpl; | import com.xdf.creative.base.service.impl.BaseServiceImpl; | ||||
import com.xdf.creative.base.vo.creative.*; | import com.xdf.creative.base.vo.creative.*; | ||||
import com.xdf.creative.base.vo.tyrz.SysUserCurrentInfoVo; | import com.xdf.creative.base.vo.tyrz.SysUserCurrentInfoVo; | ||||
import com.xdf.creative.constant.CommonConstant; | |||||
import com.xdf.creative.enums.*; | import com.xdf.creative.enums.*; | ||||
import com.xdf.creative.module.entity.*; | import com.xdf.creative.module.entity.*; | ||||
import com.xdf.creative.module.mapper.SysRegionMapper; | import com.xdf.creative.module.mapper.SysRegionMapper; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
import org.springframework.context.annotation.Lazy; | import org.springframework.context.annotation.Lazy; | ||||
import org.springframework.data.redis.core.RedisTemplate; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
@Autowired | @Autowired | ||||
private SysRegionMapper sysRegionMapper; | private SysRegionMapper sysRegionMapper; | ||||
@Autowired | |||||
private RedisTemplate redisTemplate; | |||||
// @Value("${tyrz.app_id}") | // @Value("${tyrz.app_id}") | ||||
private String appId; | private String appId; | ||||
public ApiResult login(LoginParam loginParam, HttpServletRequest request) throws Exception { | public ApiResult login(LoginParam loginParam, HttpServletRequest request) throws Exception { | ||||
// 校验验证码 | // 校验验证码 | ||||
// if (!CodeUtil.checkVerifyCode(request, loginParam.getVerifyCodeActual())) { | |||||
// return ApiResult.fail("验证码错误"); | |||||
// } | |||||
if (StringUtil.isEmpty(loginParam.getVerifyCodeActual() )){ | |||||
return ApiResult.fail("验证码不能为空!"); | |||||
} | |||||
String encrypt = PasswordUtil.encrypt(loginParam.getUsername()+loginParam.getType(), CommonConstant.VERIFY_CODE_KEY); | |||||
String key = String.format(CommonConstant.VERIFY_CODE_GET, loginParam.getUsername(), encrypt); | |||||
String cacheVerifyCode = (String) redisTemplate.opsForValue().get(key); | |||||
if (!loginParam.getVerifyCodeActual().equalsIgnoreCase(cacheVerifyCode)) { | |||||
return ApiResult.fail("验证码错误!"); | |||||
} | |||||
String userName = loginParam.getUsername(); | String userName = loginParam.getUsername(); | ||||
SysUser sysUser = getSysUserByUserName(userName); | SysUser sysUser = getSysUserByUserName(userName); | ||||
if (sysUser == null) { | if (sysUser == null) { |
import com.alibaba.druid.util.StringUtils; | import com.alibaba.druid.util.StringUtils; | ||||
import com.baomidou.mybatisplus.core.metadata.IPage; | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
import com.baomidou.mybatisplus.extension.api.R; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.xdf.creative.base.params.creative.WebInitiationApplyQueryParam; | import com.xdf.creative.base.params.creative.WebInitiationApplyQueryParam; | ||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | import com.xdf.creative.base.service.impl.BaseServiceImpl; | ||||
import com.xdf.creative.base.vo.creative.WebInitiationApplyExportVo; | |||||
import com.xdf.creative.base.vo.creative.WebInitiationApplyQueryVo; | import com.xdf.creative.base.vo.creative.WebInitiationApplyQueryVo; | ||||
import com.xdf.creative.enums.InitiationApplryAduitStateEnum; | import com.xdf.creative.enums.InitiationApplryAduitStateEnum; | ||||
import com.xdf.creative.enums.InitiationApplryAduitTypeEnum; | import com.xdf.creative.enums.InitiationApplryAduitTypeEnum; | ||||
import com.xdf.creative.module.entity.WebInitiationApply; | import com.xdf.creative.module.entity.WebInitiationApply; | ||||
import com.xdf.creative.module.mapper.WebInitiationApplyMapper; | import com.xdf.creative.module.mapper.WebInitiationApplyMapper; | ||||
import com.xdf.creative.module.service.WebInitiationApplyService; | import com.xdf.creative.module.service.WebInitiationApplyService; | ||||
import com.xdf.creative.util.excel.ExportExcel; | |||||
import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.beans.factory.annotation.Value; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
import java.io.Serializable; | |||||
import javax.servlet.http.HttpServletRequest; | |||||
import java.io.*; | |||||
import java.util.Date; | import java.util.Date; | ||||
import java.util.HashMap; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
/** | /** | ||||
@Autowired | @Autowired | ||||
private WebInitiationApplyMapper webInitiationApplyMapper; | private WebInitiationApplyMapper webInitiationApplyMapper; | ||||
@Value("${upload_basePath}") | |||||
private String basePath; | |||||
@Override | @Override | ||||
public WebInitiationApplyQueryVo getWebInitiationApplyById(Serializable id) throws Exception { | public WebInitiationApplyQueryVo getWebInitiationApplyById(Serializable id) throws Exception { | ||||
return webInitiationApplyMapper.getWebInitiationApplyById(id); | return webInitiationApplyMapper.getWebInitiationApplyById(id); | ||||
} | } | ||||
} | } | ||||
; | |||||
/** | |||||
* @description: 导出excel | |||||
* @param: [webInitiationApplyQueryParam] | |||||
* @return: com.xdf.creative.util.page.ApiResult | |||||
* @author 一路心飞扬 lgw | |||||
* @date: 2021/3/1 14:57 | |||||
*/ | |||||
@Override | |||||
public ApiResult getExportPageList(WebInitiationApplyQueryParam webInitiationApplyQueryParam, HttpServletRequest request) { | |||||
List<WebInitiationApplyExportVo> list=baseMapper.getExportPageList(webInitiationApplyQueryParam); | |||||
String[] headers = {"单位名称", "统一社会信用代码 ", "单位类型","省","市","区","详细地址","邮编","网址","法人姓名","法人职务","法人固定电话","法人手机号", "日常联系人姓名", "日常联系人职务", "日常联系电话", "日常联系人手机号", "法人简介", "单位介绍", "专利与荣誉", "金融服务", "产业合作", "企业服务", "其他服务", "行业类别", "申请成为哪级会员","LOGO","执照","申请附件"}; | |||||
String fileName = "入会申请列表"; | |||||
String excelDirPath = basePath+"/excel/"; | |||||
File fileDir = new File(excelDirPath); | |||||
if (!fileDir.isDirectory()) { | |||||
fileDir.mkdirs(); | |||||
} | |||||
String excelPath = excelDirPath + fileName + ".xls";// UUIDGenerator.getUUID() | |||||
File file = new File(excelPath); | |||||
try { | |||||
OutputStream out = new FileOutputStream(file); | |||||
ExportExcel<WebInitiationApplyExportVo> excel = new ExportExcel<WebInitiationApplyExportVo>(); | |||||
excel.exportExcel(fileName, headers, list, out); | |||||
out.close(); | |||||
Map<String, String> mapResult = new HashMap<String, String>(); | |||||
mapResult.put("path", "/excel/" + fileName + ".xls"); | |||||
mapResult.put("fileName", fileName + ".xls"); | |||||
return ApiResult.ok(mapResult); | |||||
} catch (FileNotFoundException e) { | |||||
e.printStackTrace(); | |||||
return ApiResult.fail("当前记录导出失败,文件创建异常"); | |||||
} catch (IOException e) { | |||||
e.printStackTrace(); | |||||
return ApiResult.fail("当前记录导出失败,文件读写异常"); | |||||
} | |||||
} | |||||
} | } |
package com.xdf.creative.module.service.impl; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.xdf.creative.base.params.creative.WxGroupQueryParam; | |||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | |||||
import com.xdf.creative.base.vo.creative.WxGroupQueryVo; | |||||
import com.xdf.creative.enums.StateEnum; | |||||
import com.xdf.creative.enums.StatusCode; | |||||
import com.xdf.creative.module.entity.WxGroup; | |||||
import com.xdf.creative.module.mapper.WxGroupMapper; | |||||
import com.xdf.creative.module.service.WxGroupService; | |||||
import com.xdf.creative.util.page.ApiResult; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 微信群二维码 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2021-01-28 | |||||
*/ | |||||
@Slf4j | |||||
@Service | |||||
@Transactional(rollbackFor = Exception.class) | |||||
public class WxGroupServiceImpl extends BaseServiceImpl<WxGroupMapper, WxGroup> implements WxGroupService { | |||||
@Autowired | |||||
private WxGroupMapper wxGroupMapper; | |||||
@Override | |||||
public ApiResult enable(Serializable id) { | |||||
WxGroup wxGroup = this.getById(id); | |||||
if (null == wxGroup) { | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
} | |||||
if (StateEnum.ENABLE.getKey().equals(wxGroup.getState())) { | |||||
wxGroup.setState(StateEnum.DISABLE.getKey()); | |||||
} else { | |||||
wxGroup.setState(StateEnum.ENABLE.getKey()); | |||||
} | |||||
this.saveOrUpdate(wxGroup); | |||||
return ApiResult.ok(); | |||||
} | |||||
@Override | |||||
public WxGroupQueryVo getWxGroupById(Serializable id) throws Exception { | |||||
return wxGroupMapper.getWxGroupById(id); | |||||
} | |||||
@Override | |||||
public PageTool<WxGroupQueryVo> getWxGroupPageList(WxGroupQueryParam wxGroupQueryParam) throws Exception { | |||||
Page page = setPageParam(wxGroupQueryParam); | |||||
IPage<WxGroupQueryVo> iPage = wxGroupMapper.getWxGroupPageList(page, wxGroupQueryParam); | |||||
return new PageTool(iPage); | |||||
} | |||||
} |
/** | /** | ||||
* 验证token | * 验证token | ||||
* | |||||
* 以前版本遗留问题,token处理方式不对 后期整改 | |||||
* @param token | * @param token | ||||
* @return | * @return | ||||
*/ | */ | ||||
String requestUrl = request.getRequestURI(); | String requestUrl = request.getRequestURI(); | ||||
ApiResult result = new ApiResult(); | ApiResult result = new ApiResult(); | ||||
//token失效 先检查是否存在 不存在则直接令牌过去重新登录 | //token失效 先检查是否存在 不存在则直接令牌过去重新登录 | ||||
OauthTokenQueryVo oauthTokenQueryVo= oauthTokenService.getOauthTokenByToken(token); | |||||
if (JwtUtil.isExpired(token)) { | if (JwtUtil.isExpired(token)) { | ||||
//先查token是否存在 | //先查token是否存在 | ||||
OauthTokenQueryVo oauthTokenQueryVo =oauthTokenService.getOauthTokenByToken(token); | |||||
if(null==oauthTokenQueryVo){ | if(null==oauthTokenQueryVo){ | ||||
log.error("令牌过期"); | log.error("令牌过期"); | ||||
result.setCode(ApiCode.TOKEN_INVALID.getCode()); | result.setCode(ApiCode.TOKEN_INVALID.getCode()); | ||||
result.setMsg(ApiCode.TOKEN_INVALID.getMsg()); | result.setMsg(ApiCode.TOKEN_INVALID.getMsg()); | ||||
getResponseResult(response, result); | getResponseResult(response, result); | ||||
return false; | return false; | ||||
}else{ | |||||
}/*else{ | |||||
return true; | return true; | ||||
} | |||||
}*/ | |||||
// setJwtPropertiesBean(); | // setJwtPropertiesBean(); | ||||
// String oldToken = oauthTokenQueryVo.getAccessToken(); | // String oldToken = oauthTokenQueryVo.getAccessToken(); | ||||
return false; | return false; | ||||
} | } | ||||
//先查token是否存在 | //先查token是否存在 | ||||
OauthTokenQueryVo oauthTokenQueryVo =oauthTokenService.getOauthTokenByToken(token); | |||||
if(null==oauthTokenQueryVo){ | if(null==oauthTokenQueryVo){ | ||||
log.error("该token未登录,非法访问!"); | log.error("该token未登录,非法访问!"); | ||||
result.setCode(ApiCode.TOKEN_INVALID.getCode()); | result.setCode(ApiCode.TOKEN_INVALID.getCode()); | ||||
return false; | return false; | ||||
}else{ | }else{ | ||||
//更新更新时间 | //更新更新时间 | ||||
OauthToken oauthToken = new OauthToken(); | |||||
BeanUtils.copyProperties(oauthTokenQueryVo,oauthToken); | |||||
oauthToken.setUpdateTime(new Date()); | |||||
oauthTokenService.saveOrUpdate(oauthToken); | |||||
if (new Date().getTime() - oauthTokenQueryVo.getUpdateTime().getTime() > jwtProperties.getRefreshTokenCountdown() * 1000) { | |||||
//更新更新时间 | |||||
OauthToken oauthToken = new OauthToken(); | |||||
BeanUtils.copyProperties(oauthTokenQueryVo, oauthToken); | |||||
oauthToken.setUpdateTime(new Date()); | |||||
oauthTokenService.saveOrUpdate(oauthToken); | |||||
} | |||||
} | } | ||||
//根据用户名去数据库查询用户信息 | //根据用户名去数据库查询用户信息 | ||||
SysUser user = null; | SysUser user = null; |
private Long userId; | private Long userId; | ||||
private Integer type; | |||||
} | } |
/* | |||||
package com.xdf.creative.util.excel; | package com.xdf.creative.util.excel; | ||||
import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
import java.util.*; | import java.util.*; | ||||
*/ | |||||
/** | /** | ||||
* @author : lgw | * @author : lgw | ||||
* @date : 14:15 2020/5/7 | * @date : 14:15 2020/5/7 | ||||
*/ | |||||
*//* | |||||
public class ExcelUtil { | public class ExcelUtil { | ||||
if (cell == null) { | if (cell == null) { | ||||
return ""; | return ""; | ||||
} | } | ||||
switch (cell.getCellTypeEnum()) { | |||||
switch (cell.getCellType()) { | |||||
case STRING: | case STRING: | ||||
return cell.getStringCellValue(); | return cell.getStringCellValue(); | ||||
case NUMERIC: | case NUMERIC: | ||||
Date date = HSSFDateUtil.getJavaDate(cell.getNumericCellValue()); | Date date = HSSFDateUtil.getJavaDate(cell.getNumericCellValue()); | ||||
return sdf.format(date); | return sdf.format(date); | ||||
} else { | } else { | ||||
/* return String.format("%.2f", cell.getNumericCellValue());*/ | |||||
/**String.valueOf(cell.getNumericCellValue());*/ | |||||
*/ | |||||
/* return String.format("%.2f", cell.getNumericCellValue());*//* | |||||
*/ | |||||
/**String.valueOf(cell.getNumericCellValue());*//* | |||||
return String.valueOf(cell.getNumericCellValue()); | return String.valueOf(cell.getNumericCellValue()); | ||||
} | } | ||||
case BOOLEAN: | case BOOLEAN: | ||||
} | } | ||||
} | } | ||||
*/ |
package com.xdf.creative.util.excel; | |||||
import org.apache.poi.hssf.usermodel.*; | |||||
import java.io.IOException; | |||||
import java.io.OutputStream; | |||||
import java.lang.reflect.Field; | |||||
import java.lang.reflect.InvocationTargetException; | |||||
import java.lang.reflect.Method; | |||||
import java.text.SimpleDateFormat; | |||||
import java.util.Collection; | |||||
import java.util.Date; | |||||
import java.util.Iterator; | |||||
import java.util.regex.Matcher; | |||||
import org.apache.poi.hssf.util.Region; | |||||
import java.util.regex.Pattern; | |||||
public class ExportExcel<T> { | |||||
public void exportExcel(String title, String[] headers, | |||||
Collection<T> dataset, OutputStream out) { | |||||
doExportExcel(title, headers, dataset, out, "yyyy-MM-dd"); | |||||
} | |||||
public void exportExcel(String title, String[] headers, | |||||
Collection<T> dataset, OutputStream out, String pattern) { | |||||
doExportExcel(title, headers, dataset, out, pattern); | |||||
} | |||||
/** | |||||
* 这是一个通用的方法,利用了JAVA的反射机制,可以将放置在JAVA集合中并且符号一定条件的数据以EXCEL 的形式输出到指定IO设备上 | |||||
* | |||||
* @param title 表格标题名 | |||||
* @param headers 表格属性列名数组 | |||||
* @param dataset 需要显示的数据集合,集合中一定要放置符合javabean风格的类的对象。此方法支持的 | |||||
* javabean属性的数据类型有基本数据类型及String,Date,byte[](图片数据) | |||||
* @param out 与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中 | |||||
* @param pattern 如果有时间数据,设定输出格式。默认为"yyy-MM-dd" | |||||
*/ | |||||
@SuppressWarnings("unchecked") | |||||
public void doExportExcel(String title, String[] headers, | |||||
Collection<T> dataset, OutputStream out, String pattern) { | |||||
// 声明一个工作薄 | |||||
HSSFWorkbook workbook = new HSSFWorkbook(); | |||||
// 生成一个表格 | |||||
HSSFSheet sheet = workbook.createSheet(title); | |||||
// 设置表格默认列宽度为15个字节 | |||||
sheet.setDefaultColumnWidth((short) 15); | |||||
// 生成一个样式 | |||||
HSSFCellStyle style = workbook.createCellStyle(); | |||||
// 设置这些样式 | |||||
// style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); | |||||
style.setBorderBottom(HSSFCellStyle.BORDER_THIN); | |||||
style.setBorderLeft(HSSFCellStyle.BORDER_THIN); | |||||
style.setBorderRight(HSSFCellStyle.BORDER_THIN); | |||||
style.setBorderTop(HSSFCellStyle.BORDER_THIN); | |||||
style.setAlignment(HSSFCellStyle.ALIGN_CENTER); | |||||
// 生成一个字体 | |||||
HSSFFont font = workbook.createFont(); | |||||
font.setFontHeightInPoints((short) 10); | |||||
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); | |||||
// 把字体应用到当前的样式 | |||||
style.setFont(font); | |||||
// 生成并设置另一个样式 | |||||
HSSFCellStyle style2 = workbook.createCellStyle(); | |||||
// style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); | |||||
style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); | |||||
style2.setBorderLeft(HSSFCellStyle.BORDER_THIN); | |||||
style2.setBorderRight(HSSFCellStyle.BORDER_THIN); | |||||
style2.setBorderTop(HSSFCellStyle.BORDER_THIN); | |||||
style2.setAlignment(HSSFCellStyle.ALIGN_CENTER); | |||||
style2.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); | |||||
// 生成另一个字体 | |||||
HSSFFont font2 = workbook.createFont(); | |||||
font2.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); | |||||
// 把字体应用到当前的样式 | |||||
style2.setFont(font2); | |||||
// 声明一个画图的顶级管理器 | |||||
HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); | |||||
// 定义注释的大小和位置,详见文档 | |||||
HSSFComment comment = patriarch.createComment(new HSSFClientAnchor(0, | |||||
0, 0, 0, (short) 4, 2, (short) 6, 5)); | |||||
// 设置注释内容 | |||||
comment.setString(new HSSFRichTextString("可以在POI中添加注释!")); | |||||
// 设置注释作者,当鼠标移动到单元格上是可以在状态栏中看到该内容. | |||||
comment.setAuthor("leno"); | |||||
HSSFRow row1 = sheet.createRow(0); | |||||
row1.setHeight((short) 400); | |||||
HSSFCell cell1 = row1.createCell(0); | |||||
// 定义单元格为字符串类型 | |||||
//cell1.setCellType(HSSFCell.ENCODING_UTF_16); | |||||
cell1.setCellValue(new HSSFRichTextString(title)); | |||||
cell1.setCellStyle(style); | |||||
sheet.addMergedRegion(new Region(0, (short) 0, 0, (short) (headers.length - 1))); | |||||
// 产生表格标题行 | |||||
HSSFRow row = sheet.createRow(1); | |||||
for (short i = 0; i < headers.length; i++) { | |||||
HSSFCell cell = row.createCell(i); | |||||
cell.setCellStyle(style); | |||||
HSSFRichTextString text = new HSSFRichTextString(headers[i]); | |||||
cell.setCellValue(text); | |||||
} | |||||
// 遍历集合数据,产生数据行 | |||||
Iterator<T> it = dataset.iterator(); | |||||
int index = 1; | |||||
while (it.hasNext()) { | |||||
index++; | |||||
row = sheet.createRow(index); | |||||
T t = (T) it.next(); | |||||
// 利用反射,根据javabean属性的先后顺序,动态调用getXxx()方法得到属性值 | |||||
Field[] fields = t.getClass().getDeclaredFields(); | |||||
for (short i = 0; i < fields.length; i++) { | |||||
HSSFCell cell = row.createCell(i); | |||||
cell.setCellStyle(style2); | |||||
Field field = fields[i]; | |||||
String fieldName = field.getName(); | |||||
String getMethodName = "get" | |||||
+ fieldName.substring(0, 1).toUpperCase() | |||||
+ fieldName.substring(1); | |||||
try { | |||||
Class tCls = t.getClass(); | |||||
Method getMethod = tCls.getMethod(getMethodName, | |||||
new Class[]{}); | |||||
Object value = getMethod.invoke(t, new Object[]{}); | |||||
// 判断值的类型后进行强制类型转换 | |||||
String textValue = null; | |||||
if (value instanceof Boolean) { | |||||
boolean bValue = (Boolean) value; | |||||
textValue = "男"; | |||||
if (!bValue) { | |||||
textValue = "女"; | |||||
} | |||||
} else if (value instanceof Date) { | |||||
Date date = (Date) value; | |||||
SimpleDateFormat sdf = new SimpleDateFormat(pattern); | |||||
textValue = sdf.format(date); | |||||
} else if (value instanceof byte[]) { | |||||
row.setHeightInPoints(60); | |||||
// 设置图片所在列宽度为80px,注意这里单位的一个换算 | |||||
sheet.setColumnWidth(i, (short) (35.7 * 80)); | |||||
// sheet.autoSizeColumn(i); | |||||
byte[] bsValue = (byte[]) value; | |||||
HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, | |||||
1023, 255, (short) 6, index, (short) 6, index); | |||||
anchor.setAnchorType(2); | |||||
patriarch.createPicture(anchor, workbook.addPicture( | |||||
bsValue, HSSFWorkbook.PICTURE_TYPE_JPEG)); | |||||
} else { | |||||
// 其它数据类型都当作字符串简单处理 | |||||
if (null != value) { | |||||
textValue = value.toString(); | |||||
} else { | |||||
textValue = ""; | |||||
} | |||||
} | |||||
// 如果不是图片数据,就利用正则表达式判断textValue是否全部由数字组成 | |||||
if (textValue != null) { | |||||
Pattern p = Pattern.compile("^//d+(//.//d+)?$"); | |||||
Matcher matcher = p.matcher(textValue); | |||||
if (matcher.matches()) { | |||||
// 是数字当作double处理 | |||||
cell.setCellValue(Double.parseDouble(textValue)); | |||||
} else { | |||||
HSSFRichTextString richString = new HSSFRichTextString( | |||||
textValue); | |||||
cell.setCellValue(richString); | |||||
} | |||||
} | |||||
} catch (SecurityException e) { | |||||
e.printStackTrace(); | |||||
} catch (NoSuchMethodException e) { | |||||
e.printStackTrace(); | |||||
} catch (IllegalArgumentException e) { | |||||
e.printStackTrace(); | |||||
} catch (IllegalAccessException e) { | |||||
e.printStackTrace(); | |||||
} catch (InvocationTargetException e) { | |||||
e.printStackTrace(); | |||||
} finally { | |||||
// 清理资源 | |||||
} | |||||
} | |||||
} | |||||
try { | |||||
workbook.write(out); | |||||
} catch (IOException e) { | |||||
e.printStackTrace(); | |||||
} | |||||
} | |||||
} |
case 109: | case 109: | ||||
uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_ACTIVITY.getName(); | uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_ACTIVITY.getName(); | ||||
break; | break; | ||||
case 113: | |||||
uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_APPLY.getName(); | |||||
break; | |||||
case 110: | |||||
uploadDir =ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_QR.getName(); | |||||
break; | |||||
case 999: | case 999: | ||||
uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_OTHER.getName(); | uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_OTHER.getName(); | ||||
break; | break; |
package com.xdf.creative.util.image; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 15:23 2020/12/23 | |||||
*/ | |||||
import org.apache.http.HttpEntity; | |||||
import org.apache.http.HttpStatus; | |||||
import org.apache.http.client.ClientProtocolException; | |||||
import org.apache.http.client.methods.CloseableHttpResponse; | |||||
import org.apache.http.client.methods.HttpGet; | |||||
import org.apache.http.client.utils.HttpClientUtils; | |||||
import org.apache.http.impl.client.CloseableHttpClient; | |||||
import org.apache.http.impl.client.HttpClients; | |||||
import org.apache.http.util.EntityUtils; | |||||
import org.jsoup.Jsoup; | |||||
import org.jsoup.nodes.Document; | |||||
import org.slf4j.Logger; | |||||
import org.slf4j.LoggerFactory; | |||||
import java.io.BufferedReader; | |||||
import java.io.IOException; | |||||
import java.io.InputStreamReader; | |||||
import java.net.URL; | |||||
import java.net.URLConnection; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
/** | |||||
* @ClassName HtmlUtils | |||||
* @Date 2020/12/23 15:23 | |||||
* @Version 1.0 | |||||
**/ | |||||
public class HtmlUtils { | |||||
private static Logger log = LoggerFactory.getLogger(HtmlUtils.class); | |||||
public static String sendGetOne(String url) { | |||||
String result = ""; | |||||
BufferedReader in = null; | |||||
try { | |||||
String urlNameString = url; | |||||
URL realUrl = new URL(urlNameString); | |||||
// 打开和URL之间的连接 | |||||
URLConnection connection = realUrl.openConnection(); | |||||
// 设置通用的请求属性 | |||||
connection.setRequestProperty("accept", "*/*"); | |||||
connection.setRequestProperty("connection", "Keep-Alive"); | |||||
connection.setRequestProperty("user-agent", | |||||
"Mozilla/5.0 (Windows NT 6.1) AppleWebkit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.16 Safari/537.36"); | |||||
// 建立实际的连接 | |||||
connection.connect(); | |||||
// 获取所有响应头字段 | |||||
Map<String, List<String>> map = connection.getHeaderFields(); | |||||
// 定义 BufferedReader输入流来读取URL的响应 | |||||
in = new BufferedReader(new InputStreamReader( | |||||
connection.getInputStream())); //这里如果出现乱码,请使用带编码的InputStreamReader构造方法,将需要的编码设置进去 | |||||
String line; | |||||
while ((line = in.readLine()) != null) { | |||||
result += line; | |||||
} | |||||
} catch (Exception e) { | |||||
log.error(url+"获取失败:"+e.getMessage()); | |||||
e.printStackTrace(); | |||||
} | |||||
// 使用finally块来关闭输入流 | |||||
finally { | |||||
try { | |||||
if (in != null) { | |||||
in.close(); | |||||
} | |||||
} catch (Exception e2) { | |||||
e2.printStackTrace(); | |||||
} | |||||
} | |||||
return result; | |||||
} | |||||
public static String sendGetTwo(String url) { | |||||
CloseableHttpClient httpClient = HttpClients.createDefault(); | |||||
CloseableHttpResponse response = null; | |||||
//2.创建get请求,相当于在浏览器地址栏输入 网址 | |||||
HttpGet request = new HttpGet(url); | |||||
String html = ""; | |||||
request.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebkit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.16 Safari/537.36"); | |||||
try { | |||||
//3.执行get请求,相当于在输入地址栏后敲回车键 | |||||
response = httpClient.execute(request); | |||||
//4.判断响应状态为200,进行处理 | |||||
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { | |||||
//5.获取响应内容 | |||||
HttpEntity httpEntity = response.getEntity(); | |||||
html = EntityUtils.toString(httpEntity, "utf-8"); | |||||
} else { | |||||
//如果返回状态不是200,比如404(页面不存在)等,根据情况做处理,这里略 | |||||
log.error(url+"获取失败返回状态不是200:"+EntityUtils.toString(response.getEntity(), "utf-8")); | |||||
html =""; | |||||
} | |||||
} catch (ClientProtocolException e) { | |||||
log.error(url+"获取失败:"+e.getMessage()); | |||||
e.printStackTrace(); | |||||
} catch (IOException e) { | |||||
log.error(url+"获取失败:"+e.getMessage()); | |||||
e.printStackTrace(); | |||||
} finally { | |||||
//6.关闭 | |||||
HttpClientUtils.closeQuietly(response); | |||||
HttpClientUtils.closeQuietly(httpClient); | |||||
} | |||||
return html; | |||||
} | |||||
public static Document getDocument(String html) { | |||||
//获取的数据,存放在到Bid的对象中,自己可以重新建立一个对象存储 | |||||
return Jsoup.parse(html); | |||||
} | |||||
public static String getData(String html) { | |||||
//获取的数据,存放在到Bid的对象中,自己可以重新建立一个对象存储 | |||||
Document document = Jsoup.parse(html); | |||||
if (document.hasText()) { | |||||
return document.text(); | |||||
} else { | |||||
return ""; | |||||
} | |||||
} | |||||
/* | |||||
//像js一样,通过标签获取title | |||||
System.out.println(document.getElementsByTag("title").first()); | |||||
//像js一样,通过id 获取文章列表元素对象 | |||||
Element postList = document.getElementById("post_list"); | |||||
Elements postItems = postList.getElementsByClass("post_item"); | |||||
for (Element postItem : postItems) { | |||||
//像jquery选择器一样,获取文章标题元素 | |||||
Elements titleEle = postItem.select(".post_item_body a[class='titlelnk']"); | |||||
System.out.println("文章标题:" + titleEle.text()); | |||||
; | |||||
System.out.println("文章地址:" + titleEle.attr("href")); | |||||
Elements footEle = postItem.select(".post_item_foot a[class='lightblue']"); | |||||
System.out.println("文章作者:" + footEle.text()); | |||||
; | |||||
System.out.println("作者主页:" + footEle.attr("href")); | |||||
System.out.println("*********************************"); | |||||
}*/ | |||||
public static void main(String args[]) { | |||||
String url = "https://mp.weixin.4b4591f203f&token=738234688&lang=zh_CN#rd"; | |||||
String html = sendGetTwo(url); | |||||
System.out.println(getData(html)); | |||||
} | |||||
} |
/upload/findRandomId,\ | /upload/findRandomId,\ | ||||
/upload/doPictureFile,\ | /upload/doPictureFile,\ | ||||
/upload/uploadByDecoder,\ | /upload/uploadByDecoder,\ | ||||
/upload/doApplyFile,\ | |||||
/sysRegion/getRegionList,\ | /sysRegion/getRegionList,\ | ||||
/user/login,\ | /user/login,\ | ||||
/infoContent/getHomePageInfo,\ | /infoContent/getHomePageInfo,\ | ||||
/index,\ | /index,\ | ||||
/loginHome,\ | /loginHome,\ | ||||
/webInitiationApply/add,\ | /webInitiationApply/add,\ | ||||
/webInitiationApply/info | |||||
/webInitiationApply/info,\ | |||||
/infoContent/getSearchParkRecommendWebInfo,\ | |||||
/infoContent/getInfoHtml,\ | |||||
/infoContent/getHtmlByInfo,\ | |||||
/wxGroup/getWebList,\ | |||||
/webInitiationApply/getExportPageList | |||||
upload_basePath:@upload_basePath@ | upload_basePath:@upload_basePath@ | ||||
wx_basePath=wx/ | wx_basePath=wx/ | ||||
charset: UTF-8 | charset: UTF-8 | ||||
location: classpath:banner.txt | location: classpath:banner.txt | ||||
data: | |||||
mongodb: | |||||
host: 47.101.71.64 | |||||
port: 27018 | |||||
database: companyInfo | |||||
username: dbSpider | |||||
password: f0fb3d94c2a1338d | |||||
datasource: | datasource: | ||||
driver-class-name: com.mysql.jdbc.Driver | driver-class-name: com.mysql.jdbc.Driver | ||||
servlet: | servlet: | ||||
multipart: | multipart: | ||||
enabled: true | enabled: true | ||||
max-file-size: 5MB | |||||
max-request-size: 2MB | |||||
max-file-size: 6MB | |||||
max-request-size: 6MB | |||||
mail: | mail: | ||||
host: smtp.aliyun.com | host: smtp.aliyun.com | ||||
fallback: false | fallback: false | ||||
port: 465 | port: 465 | ||||
redis: | |||||
database: 0 | |||||
host: @redis_host@ | |||||
password: @redis_pass@ | |||||
port: @redis_port@ | |||||
timeout: 10s | |||||
lettuce: | |||||
pool: | |||||
max-active: 200 | |||||
max-idle: 8 | |||||
max-wait: 10s | |||||
min-idle: 2 | |||||
shutdown-timeout: 3s | |||||
############################ JWT start ############################# | ############################ JWT start ############################# | ||||
spring-boot-plus: | spring-boot-plus: | ||||
jwt: | jwt: | ||||
# 是否刷新token | # 是否刷新token | ||||
refresh-token: true | refresh-token: true | ||||
# 刷新token的时间间隔,默认10分钟,单位:秒 | # 刷新token的时间间隔,默认10分钟,单位:秒 | ||||
refresh-token-countdown: 3600 | |||||
refresh-token-countdown: 1200 | |||||
# redis校验jwt token是否存在,可选 | # redis校验jwt token是否存在,可选 | ||||
redis-check: true | redis-check: true | ||||
# true: 同一个账号只能是最后一次登陆token有效,false:同一个账号可多次登陆 | # true: 同一个账号只能是最后一次登陆token有效,false:同一个账号可多次登陆 |
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.xdf.creative.module.mapper.InfoContentKeywordMapper"> | |||||
<!-- 通用查询结果列 --> | |||||
<sql id="Base_Column_List"> | |||||
id, content_id, keyword_id, create_time | |||||
</sql> | |||||
<sql id="Base_If_Condition"> | |||||
<where> | |||||
<if test="param.id !=null and param.id!=''"> | |||||
and id=#{param.id} | |||||
</if> | |||||
<if test="param.contentId !=null and param.contentId!=''"> | |||||
and content_id=#{param.contentId} | |||||
</if> | |||||
<if test="param.keywordId !=null and param.keywordId!=''"> | |||||
and keyword_id=#{param.keywordId} | |||||
</if> | |||||
<if test="param.createTime !=null and param.createTime!=''"> | |||||
and create_time=#{param.createTime} | |||||
</if> | |||||
</where> | |||||
</sql> | |||||
<!--根据ID查询--> | |||||
<select id="getInfoContentKeywordById" resultType="com.xdf.creative.base.vo.creative.InfoContentKeywordQueryVo"> | |||||
select | |||||
<include refid="Base_Column_List"/> | |||||
from inf_content_keyword where id = #{id} | |||||
</select> | |||||
<!--分页查询--> | |||||
<select id="getInfoContentKeywordPageList" | |||||
resultType="com.xdf.creative.base.vo.creative.InfoContentKeywordQueryVo" | |||||
parameterType="com.xdf.creative.base.params.creative.InfoContentKeywordQueryParam"> | |||||
select | |||||
<include refid="Base_Column_List"/> | |||||
from inf_content_keyword | |||||
<include refid="Base_If_Condition"/> | |||||
</select> | |||||
</mapper> |
</select> | </select> | ||||
<select id="getSearchParkRecommendWebInfo" | |||||
resultType="com.xdf.creative.base.vo.creative.InfoContentWebSearchQueryVo" | |||||
parameterType="com.xdf.creative.base.params.creative.InfoContentWebSearchQueryParam"> | |||||
select | |||||
a.id,a.title,a.final_audit_time,a.image_url,a.sort,a.istop,a.istop_time,b.type_id,b.info_name,c.digest,c.hyperlink,a.content_type | |||||
from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on | |||||
a.info_type_id =b.id where | |||||
a.deleted=0 and a.online_type=1 and a.state = 3 | |||||
<if test="param.typeId !=null and param.typeId!=''"> | |||||
and b.type_id like CONCAT('',#{param.typeId},'%') | |||||
</if> | |||||
<if test="param.title !=null and param.title!=''"> | |||||
and a.title like CONCAT('%',#{param.title},'%') | |||||
</if> | |||||
union select | |||||
a.id,a.title,a.final_audit_time,a.image_url,a.sort,a.istop,a.istop_time,b.type_id,b.info_name,c.digest,c.hyperlink,a.content_type | |||||
from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on | |||||
a.info_type_id =b.id where | |||||
a.deleted=0 and a.online_type=1 and a.state = 3 | |||||
<if test="param.typeId !=null and param.typeId!=''"> | |||||
and b.type_id like CONCAT('',#{param.typeId},'%') | |||||
</if> | |||||
<if test="param.title !=null and param.title!=''"> | |||||
and c.digest like CONCAT('%',#{param.title},'%') | |||||
</if> | |||||
union select | |||||
a.id,a.title,a.final_audit_time,a.image_url,a.sort,a.istop,a.istop_time,b.type_id,b.info_name,c.digest,c.hyperlink,a.content_type | |||||
from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on | |||||
a.info_type_id =b.id where | |||||
a.deleted=0 and a.online_type=1 and a.state = 3 | |||||
<if test="param.typeId !=null and param.typeId!=''"> | |||||
and b.type_id like CONCAT('',#{param.typeId},'%') | |||||
</if> | |||||
<if test="param.title !=null and param.title!=''"> | |||||
and c.content like CONCAT('%',#{param.title},'%') | |||||
</if> | |||||
ORDER BY id desc | |||||
limit 30 | |||||
</select> | |||||
</select> | </select> | ||||
<!--上一篇--> | |||||
<select id="getUpInfoContent" | |||||
parameterType="com.xdf.creative.base.params.creative.InfoContentQueryParam" | |||||
resultType="com.xdf.creative.base.vo.creative.InfoContentQueryVo"> | |||||
select a.id,a.title,a.image_url,c.hyperlink from info_content a left join info_type b on a.info_type_id = b.id left join info_detail c on a.foreign_id = c.foreign_id where a.id < #{param.id} and b.type_id like CONCAT('',#{param.typeId},'%') and a.online_type=1 ORDER BY a.id desc limit 1 | |||||
</select> | |||||
<select id="getDownInfoContent" | |||||
parameterType="com.xdf.creative.base.params.creative.InfoContentQueryParam" | |||||
resultType="com.xdf.creative.base.vo.creative.InfoContentQueryVo"> | |||||
select a.id,a.title,a.image_url,c.hyperlink from info_content a left join info_type b on a.info_type_id = b.id left join info_detail c on a.foreign_id = c.foreign_id where a.id > #{param.id} and b.type_id like CONCAT('',#{param.typeId},'%') and a.online_type=1 ORDER BY a.id limit 1 | |||||
</select> | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.xdf.creative.module.mapper.InfoKeywordMapper"> | |||||
<!-- 通用查询结果列 --> | |||||
<sql id="Base_Column_List"> | |||||
id, keyword, is_use, detail, state, create_user, create_time | |||||
</sql> | |||||
<sql id="Base_If_Condition"> | |||||
<where> | |||||
<if test="param.id !=null and param.id!=''"> | |||||
and id=#{param.id} | |||||
</if> | |||||
<if test="param.keyword !=null and param.keyword!=''"> | |||||
and keyword=#{param.keyword} | |||||
</if> | |||||
<if test="param.isUse !=null and param.isUse!=''"> | |||||
and is_use=#{param.isUse} | |||||
</if> | |||||
<if test="param.detail !=null and param.detail!=''"> | |||||
and detail=#{param.detail} | |||||
</if> | |||||
<if test="param.state !=null and param.state!=''"> | |||||
and state=#{param.state} | |||||
</if> | |||||
<if test="param.createUser !=null and param.createUser!=''"> | |||||
and create_user=#{param.createUser} | |||||
</if> | |||||
<if test="param.createTime !=null and param.createTime!=''"> | |||||
and create_time=#{param.createTime} | |||||
</if> | |||||
</where> | |||||
</sql> | |||||
<!--获取选择的词库--> | |||||
<select id="getCheckList" resultType="com.xdf.creative.base.vo.creative.InfoKeywordCheckListVo"> | |||||
select a.id,a.keyword,a.is_use,a.state,case when b.content_id is null then 'false' else 'true' end as checked from info_keyword a left join (select * from info_content_keyword where content_id = #{id})b on a.id = b.keyword_id where a.state =1 | |||||
</select> | |||||
<select id="getKeywordListByContentId" resultType="com.xdf.creative.base.vo.creative.InfoKeywordCheckListVo"> | |||||
select a.id,a.keyword,a.is_use,a.state from info_keyword a left join info_content_keyword b on a.id = b.keyword_id where a.state =1 and b.content_id = #{id} order by a.create_time desc | |||||
</select> | |||||
<!--根据ID查询--> | |||||
<select id="getInfoKeywordById" resultType="com.xdf.creative.base.vo.creative.InfoKeywordQueryVo"> | |||||
select | |||||
<include refid="Base_Column_List"/> | |||||
from info_keyword where id = #{id} | |||||
</select> | |||||
<!--分页查询--> | |||||
<select id="getInfoKeywordPageList" | |||||
resultType="com.xdf.creative.base.vo.creative.InfoKeywordQueryVo" | |||||
parameterType="com.xdf.creative.base.params.creative.InfoKeywordQueryParam"> | |||||
select | |||||
<include refid="Base_Column_List"/> | |||||
from info_keyword | |||||
<include refid="Base_If_Condition"/> | |||||
</select> | |||||
</mapper> |
${alias}.credit_audit_cause, | ${alias}.credit_audit_cause, | ||||
${alias}.credit_audit_time, ${alias}.credit_audit_user_id, ${alias}.final_audit, ${alias}.final_audit_cause, | ${alias}.credit_audit_time, ${alias}.credit_audit_user_id, ${alias}.final_audit, ${alias}.final_audit_cause, | ||||
${alias}.final_audit_time, ${alias}.finance_service, ${alias}.industry, ${alias}.company_service, ${alias}.other_service, | ${alias}.final_audit_time, ${alias}.finance_service, ${alias}.industry, ${alias}.company_service, ${alias}.other_service, | ||||
${alias}.final_audit_user_id, ${alias}.create_time, ${alias}.update_time | |||||
${alias}.final_audit_user_id, ${alias}.create_time, ${alias}.update_time, ${alias}.credit_code,${alias}.apply_attachment | |||||
</sql> | </sql> | ||||
<sql id="Base_Column_Sys_UserName"> | <sql id="Base_Column_Sys_UserName"> | ||||
order by credit_audit_time desc | order by credit_audit_time desc | ||||
</select> | </select> | ||||
<!--导出申请excel列表--> | |||||
<select id="getExportPageList" | |||||
resultType="com.xdf.creative.base.vo.creative.WebInitiationApplyExportVo" | |||||
parameterType="com.xdf.creative.base.params.creative.WebInitiationApplyQueryParam"> | |||||
SELECT a.name,a.credit_code, case when a.unit_type =1 then '国营企业' when a.unit_type =2 then '事业单位' when a.unit_type =3 then '民营企业' when a.unit_type =4 then '社会组织' end as unit_type_str,b.region_name as province_str,c.region_name as city_str,d.region_name as county_str,a.contact_address,a.post,a.website,a.legal_person,a.legal_duty,a.legal_phone,a.legal_mobile,a.link_man,a.link_duty,a.link_phone,a.link_mobile,a.legal_introduction,a.introduction,a.honner, | |||||
case when a.finance_service =1 then '股权' when a.finance_service =2 then '债权' when a.finance_service =3 then '担保' when a.finance_service =4 then '其他' end as finance_service_str,case when a.industry=1 then '对接上下游企业资源' when a.industry=2 then '展会参展' when a.industry=3 then '园区入驻' end as industry_str,case when a.company_service=1 then '扶持资金' when a.company_service=2 then '信用评级' when a.company_service=3 then '知产与版权交易' when a.company_service=4 then '财务与法律咨询' when a.company_service=5 then '投融资对接' end as company_service_str,a.other_service, case when a.declare_category =1 then '媒体业' when a.declare_category =2 then '艺术业' when a.declare_category =3 then '工业设计业' when a.declare_category =4 then '建筑设计业' | |||||
when a.declare_category =5 then '时尚设计业' when a.declare_category =6 then '互联网和相关服务业' when a.declare_category =7 then '软件与信息技术服务业' when a.declare_category =8 then '咨询服务业' | |||||
when a.declare_category =9 then '广告及会展服务业' when a.declare_category =10 then '休闲娱乐服务业' when a.declare_category =11 then '文化装备制造业' when a.declare_category =12 then '文化创意投资运营' | |||||
when a.declare_category =13 then '文化创意用品生产' end as declare_category_str, | |||||
case when a.vip_level=1 then '普通会员' when a.vip_level=2 then '理事单位' when a.vip_level=3 then '副会长单位' end | |||||
as vip_level_str,CONCAT("http://xdfdata.com/static/image/dfzx_wch/",logo) as logo,CONCAT("http://xdfdata.com/static/image/dfzx_wch/",attachment) as attachment,CONCAT("http://xdfdata.com/static/image/dfzx_wch/",apply_attachment) as applyAttachment FROM `web_initiation_apply` a left join sys_region b on a.province = b.id left join sys_region c on a.city = c.id left join sys_region d on a.county = d.id | |||||
<where> | |||||
<if test="param.id !=null"> | |||||
and a.id=#{param.id} | |||||
</if> | |||||
<if test="param.name !=null and param.name!=''"> | |||||
and a.name like CONCAT('%',#{param.name},'%') | |||||
</if> | |||||
<if test="param.firstAudit !=null"> | |||||
and a.first_audit=#{param.firstAudit} | |||||
</if> | |||||
<if test="param.startFirstAuditTime !=null and param.endFirstAuditTime !=null "> | |||||
and a.first_audit_time >= #{param.startFirstAuditTime} and a.first_audit_time <= | |||||
#{param.endFirstAuditTime} | |||||
</if> | |||||
<if test="param.startCreateTime !=null and param.endCreateTime !=null "> | |||||
and a.create_time >= #{param.startCreateTime} and a.create_time <= | |||||
#{param.endCreateTime} | |||||
</if> | |||||
</where> | |||||
</select> | |||||
</mapper> | </mapper> |
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.xdf.creative.module.mapper.WxGroupMapper"> | |||||
<!-- 通用查询结果列 --> | |||||
<sql id="Base_Column_List"> | |||||
id, name, code, create_time, update_time,state, create_user_id | |||||
</sql> | |||||
<sql id="Base_If_Condition"> | |||||
<where> | |||||
<if test="param.id !=null and param.id!=''"> | |||||
and id=#{param.id} | |||||
</if> | |||||
<if test="param.name !=null and param.name!=''"> | |||||
and name like CONCAT('%',#{param.name},'%') | |||||
</if> | |||||
<if test="param.code !=null and param.code!=''"> | |||||
and code=#{param.code} | |||||
</if> | |||||
<if test="param.state !=null"> | |||||
and state=#{param.state} | |||||
</if> | |||||
<if test="param.createTime !=null and param.createTime!=''"> | |||||
and create_time=#{param.createTime} | |||||
</if> | |||||
<if test="param.updateTime !=null and param.updateTime!=''"> | |||||
and update_time=#{param.updateTime} | |||||
</if> | |||||
<if test="param.createUserId !=null and param.createUserId!=''"> | |||||
and create_user_id=#{param.createUserId} | |||||
</if> | |||||
</where> | |||||
</sql> | |||||
<!--根据ID查询--> | |||||
<select id="getWxGroupById" resultType="com.xdf.creative.base.vo.creative.WxGroupQueryVo"> | |||||
select | |||||
<include refid="Base_Column_List"/> | |||||
from wx_group where id = #{id} | |||||
</select> | |||||
<!--分页查询--> | |||||
<select id="getWxGroupPageList" | |||||
resultType="com.xdf.creative.base.vo.creative.WxGroupQueryVo" | |||||
parameterType="com.xdf.creative.base.params.creative.WxGroupQueryParam"> | |||||
select | |||||
<include refid="Base_Column_List"/> | |||||
from wx_group | |||||
<include refid="Base_If_Condition"/> | |||||
</select> | |||||
</mapper> |