| <version>2.3.2</version> | <version>2.3.2</version> | ||||
| </dependency> | </dependency> | ||||
| <dependency> | |||||
| <groupId>org.apache.poi</groupId> | |||||
| <artifactId>poi</artifactId> | |||||
| <version>RELEASE</version> | |||||
| </dependency> | |||||
| <dependency> | |||||
| <groupId>org.apache.poi</groupId> | |||||
| <artifactId>poi-ooxml</artifactId> | |||||
| <version>RELEASE</version> | |||||
| </dependency> | |||||
| <dependency> | |||||
| <groupId>org.apache.httpcomponents</groupId> | |||||
| <artifactId>httpclient</artifactId> | |||||
| <version>4.5.4</version> | |||||
| </dependency> | |||||
| </dependencies> | </dependencies> | ||||
| package com.xdf.creative.base.params; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableId; | |||||
| import com.xdf.creative.base.entity.BaseEntity; | |||||
| import com.xdf.creative.util.excel.Description; | |||||
| 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-05-07 | |||||
| */ | |||||
| @Data | |||||
| public class DtUploadCompanyDescript { | |||||
| @Description(showName = "园区名称") | |||||
| private String parkName; | |||||
| @Description(showName = "企业名称") | |||||
| private String companyName; | |||||
| @Description(showName = "企业统一社会信用代码") | |||||
| private String serialNumber; | |||||
| @Description(showName = "企业法人") | |||||
| private String legalPersonName; | |||||
| @Description(showName = "注册资本数字") | |||||
| private String regCapitalNo; | |||||
| @Description(showName = "注册资本单位") | |||||
| private String unit; | |||||
| @Description(showName = "所属行业名称") | |||||
| private String cateName; | |||||
| @Description(showName = "成立日期") | |||||
| private String estiblishTime; | |||||
| @Description(showName = "是否为个体户") | |||||
| private String companyType; | |||||
| } |
| package com.xdf.creative.base.params.dt; | |||||
| 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 2020-05-11 | |||||
| */ | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| @ApiModel(value = "DtEnterCompanyQueryParam对象", description = "查询参数") | |||||
| public class DtEnterCompanyQueryParam 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 orgParkId; | |||||
| @ApiModelProperty(value = "园区库id") | |||||
| private Long bizParkId; | |||||
| @ApiModelProperty(value = "企业名称") | |||||
| private String companyName; | |||||
| @ApiModelProperty(value = "园区名称") | |||||
| private String parkName; | |||||
| @ApiModelProperty(value = "企业统一社会信用代码") | |||||
| private String serialNumber; | |||||
| @ApiModelProperty(value = "企业法人名字") | |||||
| private String legalPersonName; | |||||
| @ApiModelProperty(value = "注册资本数字") | |||||
| private String regCapitalNo; | |||||
| @ApiModelProperty(value = "注册资本单位") | |||||
| private String unit; | |||||
| @ApiModelProperty(value = "注册资本") | |||||
| private String regCapital; | |||||
| @ApiModelProperty(value = "所属行业名称") | |||||
| private String categ; | |||||
| @ApiModelProperty(value = "所属行业名称") | |||||
| private String cateName; | |||||
| @ApiModelProperty(value = "成立日期") | |||||
| private Date estiblishTime; | |||||
| @ApiModelProperty(value = "是否为战略融资") | |||||
| private String isInvest; | |||||
| @ApiModelProperty(value = "是否为上市公司") | |||||
| private String listedCom; | |||||
| @ApiModelProperty(value = "是否为高新技术企业") | |||||
| private String isHighTecNew; | |||||
| @ApiModelProperty(value = "是否为企业500强") | |||||
| private String isFiveNew; | |||||
| @ApiModelProperty(value = "是否存在") | |||||
| private Integer exist; | |||||
| @ApiModelProperty(value = "是否为个体户 0否 1是") | |||||
| private Integer companyType; | |||||
| @ApiModelProperty(value = "开始更新时间") | |||||
| private Date startUpdateTime; | |||||
| @ApiModelProperty(value = "结束更新时间") | |||||
| private Date endUpdateTime; | |||||
| @ApiModelProperty(value = "企业id") | |||||
| private Long companyId; | |||||
| } |
| package com.xdf.creative.base.params.dt; | |||||
| 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 2020-05-07 | |||||
| */ | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| @ApiModel(value = "DtUploadCompanyQueryParam对象", description = "企业上传查询参数") | |||||
| public class DtUploadCompanyQueryParam 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 orgParkId; | |||||
| @ApiModelProperty(value = "园区库id") | |||||
| private Long bizParkId; | |||||
| @ApiModelProperty(value = "企业名称") | |||||
| private String companyName; | |||||
| @ApiModelProperty(value = "园区名称") | |||||
| private String parkName; | |||||
| @ApiModelProperty(value = "企业统一社会信用代码") | |||||
| private String serialNumber; | |||||
| @ApiModelProperty(value = "企业法人名字") | |||||
| private String legalPersonName; | |||||
| @ApiModelProperty(value = "注册资本数字") | |||||
| private String regCapitalNo; | |||||
| @ApiModelProperty(value = "注册资本单位") | |||||
| private String unit; | |||||
| @ApiModelProperty(value = "注册资本") | |||||
| private String regCapital; | |||||
| @ApiModelProperty(value = "所属行业名称") | |||||
| private String cateName; | |||||
| @ApiModelProperty(value = "成立日期") | |||||
| private Date estiblishTime; | |||||
| @ApiModelProperty(value = "是否为个体户 0否 1是") | |||||
| private Integer companyType; | |||||
| @ApiModelProperty(value = "开始更新时间") | |||||
| private Date startUpdateTime; | |||||
| @ApiModelProperty(value = "结束更新时间") | |||||
| private Date endUpdateTime; | |||||
| @ApiModelProperty(value = "开始上传时间") | |||||
| private Date startCreateTime; | |||||
| @ApiModelProperty(value = "结束上传时间") | |||||
| private Date endCreateTime; | |||||
| @ApiModelProperty(value = "更新状态 1、新增 (待处理) 2、更新(待处理) 3、删除(待处理) ") | |||||
| private Integer state; | |||||
| @ApiModelProperty(value = "处理状态1、待处理 2、已处理(成功) 3已处理(失败) 4 未找到") | |||||
| private Integer disposeState; | |||||
| } |
| package com.xdf.creative.base.vo; | |||||
| import lombok.Data; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Data | |||||
| public class CompanyBaseInfoVO { | |||||
| private Long id; | |||||
| /** | |||||
| * 企业名称 | |||||
| */ | |||||
| private String name; | |||||
| /** | |||||
| * 法人代表 | |||||
| */ | |||||
| private String legalPersonName; | |||||
| /** | |||||
| * 注册资金 | |||||
| */ | |||||
| private String regCapital; | |||||
| /** | |||||
| * 实收注册资金 | |||||
| */ | |||||
| private String actualCapital; | |||||
| /** | |||||
| * 营业状态 | |||||
| */ | |||||
| private String regStatus; | |||||
| /** | |||||
| * 成立日期 | |||||
| */ | |||||
| private Date estiblishTime; | |||||
| /** | |||||
| * 统一社会信用代码 | |||||
| */ | |||||
| private String propertyCode; | |||||
| /** | |||||
| * 纳税识别号 | |||||
| */ | |||||
| private String payTaxesNumber; | |||||
| /** | |||||
| * 注册号 | |||||
| */ | |||||
| private String regNumber; | |||||
| /** | |||||
| * 组织机构代码 | |||||
| */ | |||||
| private String orgNumber; | |||||
| /** | |||||
| * 公司类型 | |||||
| */ | |||||
| private String companyOrgType; | |||||
| /** | |||||
| * 核准日期 | |||||
| */ | |||||
| private Date approvedTime; | |||||
| /** | |||||
| * 登记机关 | |||||
| */ | |||||
| private String regInstitute; | |||||
| /** | |||||
| * 营业期限开始日期 | |||||
| */ | |||||
| private Date fromTime; | |||||
| /** | |||||
| * 营业期限终止日期 | |||||
| */ | |||||
| private Date toTime; | |||||
| /** | |||||
| * 注册地址 | |||||
| */ | |||||
| private String regLocation; | |||||
| /** | |||||
| * 经营范围 | |||||
| */ | |||||
| private String businessScope; | |||||
| /** | |||||
| * 雇员数量 | |||||
| */ | |||||
| private String employeeNum; | |||||
| /** | |||||
| * 参保人数 | |||||
| */ | |||||
| private String endowmentInsurance; | |||||
| /** | |||||
| * categoryName | |||||
| */ | |||||
| private String categoryName; | |||||
| /** | |||||
| * 英文名 | |||||
| */ | |||||
| private String enName; | |||||
| /** | |||||
| * 归属省份的首字母小写 | |||||
| */ | |||||
| private String base; | |||||
| /** | |||||
| * 曾用名 | |||||
| */ | |||||
| private List<String> historyName; | |||||
| /** | |||||
| * 企业简介 | |||||
| */ | |||||
| private String introduction; | |||||
| } |
| package com.xdf.creative.base.vo; | |||||
| import lombok.Data; | |||||
| import java.util.Date; | |||||
| @Data | |||||
| public class CompanyInfoDocument { | |||||
| /** | |||||
| * 公司id | |||||
| */ | |||||
| private Long com_id; | |||||
| /** | |||||
| * 是否抽查检查 | |||||
| */ | |||||
| private String is_check_info; | |||||
| /** | |||||
| * 是否经营异常 | |||||
| */ | |||||
| private String is_abnormal; | |||||
| /** | |||||
| * 是否上市公司 | |||||
| */ | |||||
| private String listed_com; | |||||
| /** | |||||
| * 信用等级 | |||||
| */ | |||||
| private String tax_credit; | |||||
| /** | |||||
| * 是否严重违法 | |||||
| */ | |||||
| private String is_illegal_info; | |||||
| /** | |||||
| * 是否股权出质 | |||||
| */ | |||||
| private String is_equity_info; | |||||
| /** | |||||
| * 是否购地 | |||||
| */ | |||||
| private String is_purchase_land; | |||||
| /** | |||||
| * 是否欠税 | |||||
| */ | |||||
| private String is_own_tax; | |||||
| /** | |||||
| * 是否融资信息 | |||||
| */ | |||||
| private String is_invest; | |||||
| /** | |||||
| * 是否失信 | |||||
| */ | |||||
| private String is_dishonest; | |||||
| /** | |||||
| * 是否是执行人 | |||||
| */ | |||||
| private String is_zhixing; | |||||
| /** | |||||
| * 是否有产品 | |||||
| */ | |||||
| private String is_product; | |||||
| /** | |||||
| * 是否动产抵押 | |||||
| */ | |||||
| private String is_mortgage; | |||||
| /** | |||||
| * 是否有作品著作权 | |||||
| */ | |||||
| private String is_copyright_work; | |||||
| /** | |||||
| * 是否有执行处罚 | |||||
| */ | |||||
| private String is_punish; | |||||
| /** | |||||
| * 是否有招聘信息 | |||||
| */ | |||||
| private String is_employer; | |||||
| /** | |||||
| * 是否招标 | |||||
| */ | |||||
| private String is_purchaser; | |||||
| /** | |||||
| * 高管名称 | |||||
| */ | |||||
| private String high_name; | |||||
| /** | |||||
| * 高管ID | |||||
| */ | |||||
| private String high_id; | |||||
| /** | |||||
| * 是否有软件著作权 | |||||
| */ | |||||
| private String is_copyright_reg; | |||||
| /** | |||||
| * 参保人数 | |||||
| */ | |||||
| private String endowment_insurance; | |||||
| /** | |||||
| * 公司名称 | |||||
| */ | |||||
| private String com_name; | |||||
| /** | |||||
| * 法人名称 | |||||
| */ | |||||
| private String fr_nm; | |||||
| /** | |||||
| * 公司类型 | |||||
| */ | |||||
| private String com_org_tp; | |||||
| /** | |||||
| * 注册地址 | |||||
| */ | |||||
| private String reg_loc; | |||||
| /** | |||||
| * 注册时间 | |||||
| */ | |||||
| private String est_tm; | |||||
| /** | |||||
| * 经营范围 | |||||
| */ | |||||
| private String bus_sp; | |||||
| /** | |||||
| * 注册状态 | |||||
| */ | |||||
| private String reg_st; | |||||
| /** | |||||
| * 注册资本 | |||||
| */ | |||||
| private String reg_cpl; | |||||
| /** | |||||
| * 注册号 | |||||
| */ | |||||
| private String reg_num; | |||||
| /** | |||||
| * 组织机构代码 | |||||
| */ | |||||
| private String org_num; | |||||
| /** | |||||
| * 统一社会信用代码 | |||||
| */ | |||||
| private String soci_num; | |||||
| /** | |||||
| * 注册资金 | |||||
| */ | |||||
| private String reg_val; | |||||
| /** | |||||
| * 资金单位 | |||||
| */ | |||||
| private String reg_unit; | |||||
| /** | |||||
| * 行业代码 | |||||
| */ | |||||
| private String categ; | |||||
| /** | |||||
| * 是否有商标 | |||||
| */ | |||||
| private String is_trade_mark; | |||||
| /** | |||||
| * 是否有专利 | |||||
| */ | |||||
| private String is_patents; | |||||
| /** | |||||
| * 是否有网站 | |||||
| */ | |||||
| private String is_haveWeb; | |||||
| /** | |||||
| * 是否500强 | |||||
| */ | |||||
| private String is_500; | |||||
| /** | |||||
| * 是否高新 | |||||
| */ | |||||
| private String is_high_tec; | |||||
| /** | |||||
| * 是否诉讼 | |||||
| */ | |||||
| private String is_lawsuit; | |||||
| /** | |||||
| * 是否法院公告 | |||||
| */ | |||||
| private String is_court; | |||||
| /** | |||||
| * 是否有座机 | |||||
| */ | |||||
| private String is_phone; | |||||
| /** | |||||
| * 是否有移动电话 | |||||
| */ | |||||
| private String is_mobile; | |||||
| /** | |||||
| * 是否有电邮 | |||||
| */ | |||||
| private String is_email; | |||||
| //注册时间 | |||||
| private Date reg_date; | |||||
| /** | |||||
| * 企业信用评分 | |||||
| */ | |||||
| private int com_score; | |||||
| //认领状态 | |||||
| private int claimStatus; | |||||
| //是否高薪技术企业 | |||||
| private String is_high_tec_new; | |||||
| //是否500强 | |||||
| private String is_500_new; | |||||
| } |
| 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-05-11 | |||||
| */ | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| @ApiModel(value = "DtEnterCompanyQueryVo对象", description = "查询参数") | |||||
| public class DtEnterCompanyQueryVo implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @ApiModelProperty(value = "主键id") | |||||
| private Long id; | |||||
| @ApiModelProperty(value = "组织id") | |||||
| private Long orgParkId; | |||||
| @ApiModelProperty(value = "园区库id") | |||||
| private Long bizParkId; | |||||
| @ApiModelProperty(value = "园区名称") | |||||
| private String organizeName; | |||||
| @ApiModelProperty(value = "企业名称") | |||||
| private String companyName; | |||||
| @ApiModelProperty(value = "企业统一社会信用代码") | |||||
| private String serialNumber; | |||||
| @ApiModelProperty(value = "企业法人名字") | |||||
| private String legalPersonName; | |||||
| @ApiModelProperty(value = "注册资本数字") | |||||
| private String regCapitalNo; | |||||
| @ApiModelProperty(value = "注册资本单位") | |||||
| private String unit; | |||||
| @ApiModelProperty(value = "注册资本") | |||||
| private String regCapital; | |||||
| @ApiModelProperty(value = "所属行业名称") | |||||
| private String categ; | |||||
| @ApiModelProperty(value = "所属行业名称") | |||||
| private String cateName; | |||||
| @ApiModelProperty(value = "成立日期") | |||||
| private Date estiblishTime; | |||||
| @ApiModelProperty(value = "是否为战略融资") | |||||
| private String isInvest; | |||||
| @ApiModelProperty(value = "是否为上市公司") | |||||
| private String listedCom; | |||||
| @ApiModelProperty(value = "是否为高新技术企业") | |||||
| private String isHighTecNew; | |||||
| @ApiModelProperty(value = "是否为企业500强") | |||||
| private String isFiveNew; | |||||
| @ApiModelProperty(value = "是否存在") | |||||
| private Integer exist; | |||||
| @ApiModelProperty(value = "是否为个体户 0否 1是") | |||||
| private Integer companyType; | |||||
| @ApiModelProperty(value = "更新时间") | |||||
| private Date updateTime; | |||||
| @ApiModelProperty(value = "企业id") | |||||
| private Long companyId; | |||||
| } |
| 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-03-09 | |||||
| */ | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| @ApiModel(value = "InfoContentQueryVo对象", description = "信息内容查询参数") | |||||
| public class InfoContentWebSearchMbQueryVo implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @ApiModelProperty(value = "主键id") | |||||
| private Long id; | |||||
| @ApiModelProperty(value = "标题") | |||||
| private String title; | |||||
| @ApiModelProperty(value = "终审时间") | |||||
| private Date finalAuditTime; | |||||
| @ApiModelProperty(value = "来源地址") | |||||
| private String sourceUrl; | |||||
| @ApiModelProperty(value = "是否置顶 0否 1是") | |||||
| private Integer istop; | |||||
| @ApiModelProperty(value = "超链接") | |||||
| private String hyperlink; | |||||
| @ApiModelProperty(value = "内容类型 0、图文形式 1 、超链接形式") | |||||
| private Integer contentType; | |||||
| @ApiModelProperty(value = "图片地址") | |||||
| private String imageUrl; | |||||
| } |
| package com.xdf.creative.base.vo.dt; | |||||
| 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-05-07 | |||||
| */ | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| @ApiModel(value = "DtUploadCompanyQueryVo对象", description = "企业上传查询参数") | |||||
| public class DtUploadCompanyQueryVo implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @ApiModelProperty(value = "主键id") | |||||
| private Long id; | |||||
| @ApiModelProperty(value = "园区名称") | |||||
| private String organizeName; | |||||
| @ApiModelProperty(value = "组织id") | |||||
| private Long orgParkId; | |||||
| @ApiModelProperty(value = "园区库id") | |||||
| private Long bizParkId; | |||||
| @ApiModelProperty(value = "企业名称") | |||||
| private String companyName; | |||||
| @ApiModelProperty(value = "企业统一社会信用代码") | |||||
| private String serialNumber; | |||||
| @ApiModelProperty(value = "企业法人名字") | |||||
| private String legalPersonName; | |||||
| @ApiModelProperty(value = "注册资本数字") | |||||
| private String regCapitalNo; | |||||
| @ApiModelProperty(value = "注册资本单位") | |||||
| private String unit; | |||||
| @ApiModelProperty(value = "注册资本") | |||||
| private String regCapital; | |||||
| @ApiModelProperty(value = "所属行业名称") | |||||
| private String cateName; | |||||
| @ApiModelProperty(value = "成立日期") | |||||
| private Date estiblishTime; | |||||
| @ApiModelProperty(value = "是否为个体户 0否 1是") | |||||
| private Integer companyType; | |||||
| @ApiModelProperty(value = "更新时间") | |||||
| private Date updateTime; | |||||
| @ApiModelProperty(value = "上传时间") | |||||
| private Date createTime; | |||||
| @ApiModelProperty(value = "更新状态 1、新增 (待处理) 2、更新(待处理) 3、删除(待处理) ") | |||||
| private Integer state; | |||||
| @ApiModelProperty(value = "处理状态1、待处理 2、已处理(成功) 3已处理(失败) 4 未找到") | |||||
| private Integer disposeState; | |||||
| } |
| package com.xdf.creative.config; | |||||
| import org.springframework.context.annotation.Configuration; | |||||
| import org.springframework.web.servlet.config.annotation.CorsRegistry; | |||||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |||||
| @Configuration | |||||
| public class CorsConfig implements WebMvcConfigurer { | |||||
| @Override | |||||
| public void addCorsMappings(CorsRegistry registry) { | |||||
| registry.addMapping("/**") | |||||
| .allowedOrigins("*") | |||||
| .allowCredentials(true) | |||||
| .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") | |||||
| .maxAge(3600); | |||||
| } | |||||
| } |
| package com.xdf.creative.enums.dt; | |||||
| import lombok.AllArgsConstructor; | |||||
| import lombok.Getter; | |||||
| @Getter | |||||
| @AllArgsConstructor | |||||
| public enum DisposeStateEnum { | |||||
| /**处理状态1、待处理 2、已处理(成功) 3已处理(失败) 4 未找到 | |||||
| */ | |||||
| INFO_STATE_TYPE_ENUM( 1, "待处理"), | |||||
| INFO_STATE_TYPE_SUCCESS(2, "已处理(成功)"), | |||||
| INFO_STATE_TYPE_FAILE( 3, "已处理(失败)"), | |||||
| INFO_STATE_TYPE_NOT_FOUND( 4, "未找到"), | |||||
| ; | |||||
| private Integer code; | |||||
| private String name; | |||||
| } |
| package com.xdf.creative.enums.dt; | |||||
| import lombok.AllArgsConstructor; | |||||
| import lombok.Getter; | |||||
| @Getter | |||||
| @AllArgsConstructor | |||||
| public enum UploadCompanyStateEnum { | |||||
| /** | |||||
| * 1、新增 (待处理) 2、更新(待处理) 3、删除(待处理) | |||||
| */ | |||||
| INFO_STATE_INIT_ENUM( 0, "初始状态(已处理)"), | |||||
| INFO_STATE_ADD_ENUM( 1, "新增 (待处理)"), | |||||
| INFO_STATE_UPDATE_ENUM(2, "更新(待处理)"), | |||||
| INFO_STATE_DEL_ENUM( 3, "删除(待处理)"), | |||||
| ; | |||||
| private Integer code; | |||||
| private String name; | |||||
| } |
| 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.dt.DtEnterCompanyQueryParam; | |||||
| import com.xdf.creative.base.vo.creative.DtEnterCompanyQueryVo; | |||||
| import com.xdf.creative.module.entity.DtEnterCompany; | |||||
| import com.xdf.creative.module.service.DtEnterCompanyService; | |||||
| 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.*; | |||||
| import javax.validation.Valid; | |||||
| /** | |||||
| * <p> | |||||
| * 前端控制器 | |||||
| * </p> | |||||
| * | |||||
| * @author lgw | |||||
| * @since 2020-05-11 | |||||
| */ | |||||
| @Slf4j | |||||
| @RestController | |||||
| @RequestMapping("/dtEnterCompany") | |||||
| @Api("API") | |||||
| public class DtEnterCompanyController extends BaseController { | |||||
| @Autowired | |||||
| private DtEnterCompanyService dtEnterCompanyService; | |||||
| /** | |||||
| * 清理数据 | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| @PostMapping("/cleanParkCompany") | |||||
| @ApiOperation(value = "清理数据DtEnterCompany对象", notes = "清理数据", response = ApiResult.class) | |||||
| public ApiResult cleanParkCompany() throws Exception { | |||||
| return dtEnterCompanyService.cleanParkCompany(); | |||||
| } | |||||
| /** | |||||
| * 添加 | |||||
| */ | |||||
| @PostMapping("/add") | |||||
| @ApiOperation(value = "添加DtEnterCompany对象", notes = "添加", response = ApiResult.class) | |||||
| public ApiResult<Boolean> addDtEnterCompany(@Valid @RequestBody DtEnterCompany dtEnterCompany) throws Exception { | |||||
| boolean flag = dtEnterCompanyService.save(dtEnterCompany); | |||||
| return ApiResult.result(flag); | |||||
| } | |||||
| /** | |||||
| * 修改 | |||||
| */ | |||||
| @PostMapping("/update") | |||||
| @ApiOperation(value = "修改DtEnterCompany对象", notes = "修改", response = ApiResult.class) | |||||
| public ApiResult<Boolean> updateDtEnterCompany(@Valid @RequestBody DtEnterCompany dtEnterCompany) throws Exception { | |||||
| boolean flag = dtEnterCompanyService.updateById(dtEnterCompany); | |||||
| return ApiResult.result(flag); | |||||
| } | |||||
| /** | |||||
| * 删除 | |||||
| */ | |||||
| @PostMapping("/delete") | |||||
| @ApiOperation(value = "删除DtEnterCompany对象", notes = "删除", response = ApiResult.class) | |||||
| public ApiResult<Boolean> deleteDtEnterCompany(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
| boolean flag = dtEnterCompanyService.removeById(idParam.getId()); | |||||
| return ApiResult.result(flag); | |||||
| } | |||||
| /** | |||||
| * 获取 | |||||
| */ | |||||
| @PostMapping("/info") | |||||
| @ApiOperation(value = "获取DtEnterCompany对象详情", notes = "查看", response = DtEnterCompanyQueryVo.class) | |||||
| public ApiResult<DtEnterCompanyQueryVo> getDtEnterCompany(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
| DtEnterCompanyQueryVo dtEnterCompanyQueryVo = dtEnterCompanyService.getDtEnterCompanyById(idParam.getId()); | |||||
| return ApiResult.ok(dtEnterCompanyQueryVo); | |||||
| } | |||||
| /** | |||||
| * 分页列表 | |||||
| */ | |||||
| @PostMapping("/getPageList") | |||||
| @ApiOperation(value = "获取DtEnterCompany分页列表", notes = "分页列表", response = DtEnterCompanyQueryVo.class) | |||||
| public ApiResult<PageTool<DtEnterCompanyQueryVo>> getDtEnterCompanyPageList(@RequestBody DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception { | |||||
| PageTool<DtEnterCompanyQueryVo> pageList = dtEnterCompanyService.getDtEnterCompanyPageList(dtEnterCompanyQueryParam); | |||||
| return ApiResult.ok(pageList); | |||||
| } | |||||
| @PostMapping("/getUserList") | |||||
| @ApiOperation(value = "获取DtEnterCompany分页列表", notes = "分页列表", response = DtEnterCompanyQueryVo.class) | |||||
| public ApiResult<PageTool<DtEnterCompanyQueryVo>> getDtEnterCompanyUserList(@RequestBody DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception { | |||||
| PageTool<DtEnterCompanyQueryVo> pageList = dtEnterCompanyService.getDtEnterCompanyUserList(dtEnterCompanyQueryParam); | |||||
| return ApiResult.ok(pageList); | |||||
| } | |||||
| @PostMapping("/getHomeList") | |||||
| @ApiOperation(value = "获取DtEnterCompany分页列表", notes = "分页列表", response = DtEnterCompanyQueryVo.class) | |||||
| public ApiResult<PageTool<DtEnterCompanyQueryVo>> getDtEnterCompanyHomeList(@RequestBody DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception { | |||||
| if(null==dtEnterCompanyQueryParam.getOrgParkId()){ | |||||
| return ApiResult.fail("请选择园区!"); | |||||
| } | |||||
| PageTool<DtEnterCompanyQueryVo> pageList = dtEnterCompanyService.getDtEnterCompanyHomeList(dtEnterCompanyQueryParam); | |||||
| return ApiResult.ok(pageList); | |||||
| } | |||||
| } | |||||
| 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.dt.DtUploadCompanyQueryParam; | |||||
| import com.xdf.creative.base.vo.dt.DtUploadCompanyQueryVo; | |||||
| import com.xdf.creative.module.entity.DtUploadCompany; | |||||
| import com.xdf.creative.module.service.DtUploadCompanyService; | |||||
| 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-05-07 | |||||
| */ | |||||
| @Slf4j | |||||
| @RestController | |||||
| @RequestMapping("/dtUploadCompany") | |||||
| @Api("企业上传 API") | |||||
| public class DtUploadCompanyController extends BaseController { | |||||
| @Autowired | |||||
| private DtUploadCompanyService dtUploadCompanyService; | |||||
| /** | |||||
| * 添加企业上传 | |||||
| */ | |||||
| @PostMapping("/add") | |||||
| @ApiOperation(value = "添加DtUploadCompany对象", notes = "添加企业上传", response = ApiResult.class) | |||||
| public ApiResult<Boolean> addDtUploadCompany(@Valid @RequestBody DtUploadCompany dtUploadCompany) throws Exception { | |||||
| boolean flag = dtUploadCompanyService.save(dtUploadCompany); | |||||
| return ApiResult.result(flag); | |||||
| } | |||||
| /** | |||||
| * 修改企业上传 | |||||
| */ | |||||
| @PostMapping("/update") | |||||
| @ApiOperation(value = "修改DtUploadCompany对象", notes = "修改企业上传", response = ApiResult.class) | |||||
| public ApiResult<Boolean> updateDtUploadCompany(@Valid @RequestBody DtUploadCompany dtUploadCompany) throws Exception { | |||||
| boolean flag = dtUploadCompanyService.updateById(dtUploadCompany); | |||||
| return ApiResult.result(flag); | |||||
| } | |||||
| /** | |||||
| * 删除企业上传 | |||||
| */ | |||||
| @PostMapping("/delete") | |||||
| @ApiOperation(value = "删除DtUploadCompany对象", notes = "删除企业上传", response = ApiResult.class) | |||||
| public ApiResult<Boolean> deleteDtUploadCompany(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
| boolean flag = dtUploadCompanyService.removeById(idParam.getId()); | |||||
| return ApiResult.result(flag); | |||||
| } | |||||
| /** | |||||
| * 获取企业上传 | |||||
| */ | |||||
| @PostMapping("/info") | |||||
| @ApiOperation(value = "获取DtUploadCompany对象详情", notes = "查看企业上传", response = DtUploadCompanyQueryVo.class) | |||||
| public ApiResult<DtUploadCompanyQueryVo> getDtUploadCompany(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
| DtUploadCompanyQueryVo dtUploadCompanyQueryVo = dtUploadCompanyService.getDtUploadCompanyById(idParam.getId()); | |||||
| return ApiResult.ok(dtUploadCompanyQueryVo); | |||||
| } | |||||
| /** | |||||
| * 企业上传分页列表 | |||||
| */ | |||||
| @PostMapping("/getPageList") | |||||
| @ApiOperation(value = "获取DtUploadCompany分页列表", notes = "企业上传分页列表", response = DtUploadCompanyQueryVo.class) | |||||
| public ApiResult<PageTool<DtUploadCompanyQueryVo>> getDtUploadCompanyPageList(@RequestBody DtUploadCompanyQueryParam dtUploadCompanyQueryParam) throws Exception { | |||||
| PageTool<DtUploadCompanyQueryVo> pageList = dtUploadCompanyService.getDtUploadCompanyPageList(dtUploadCompanyQueryParam); | |||||
| return ApiResult.ok(pageList); | |||||
| } | |||||
| } | |||||
| package com.xdf.creative.module.controller; | package com.xdf.creative.module.controller; | ||||
| import com.xdf.creative.base.params.DtUploadCompanyDescript; | |||||
| import com.xdf.creative.enums.ApiCode; | import com.xdf.creative.enums.ApiCode; | ||||
| import com.xdf.creative.enums.ServiceFileUploadTypeEnum; | import com.xdf.creative.enums.ServiceFileUploadTypeEnum; | ||||
| import com.xdf.creative.enums.StatusCode; | import com.xdf.creative.enums.StatusCode; | ||||
| import com.xdf.creative.module.entity.DtUploadCompany; | |||||
| import com.xdf.creative.module.entity.FileUploadQuery; | import com.xdf.creative.module.entity.FileUploadQuery; | ||||
| import com.xdf.creative.module.service.DtUploadCompanyService; | |||||
| 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; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| import java.util.List; | |||||
| import java.util.stream.Collectors; | |||||
| @Slf4j | @Slf4j | ||||
| @RestController | @RestController | ||||
| @RequestMapping("/upload") | @RequestMapping("/upload") | ||||
| @Autowired | @Autowired | ||||
| private FileClientService fileClientService; | private FileClientService fileClientService; | ||||
| @Autowired | |||||
| private DtUploadCompanyService dtUploadCompanyService; | |||||
| /** | /** | ||||
| * 上传文件 | * 上传文件 | ||||
| * | * | ||||
| } | } | ||||
| } | } | ||||
| @PostMapping("/doExcelFile") | |||||
| @ApiOperation(value = "添加MultipartFile对象", notes = "添加文件上传", response = ApiResult.class) | |||||
| public ApiResult<String> doExcelFile(MultipartFile file, @RequestParam Integer uploadPath) throws Exception { | |||||
| //检测excel是否符合要求 | |||||
| ApiResult rs = ExcelUtil.importExcel(file); | |||||
| if(ApiCode.SUCCESS.getCode()!=rs.getCode()){ | |||||
| return rs; | |||||
| } | |||||
| 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; | |||||
| } | |||||
| } | |||||
| /** | /** | ||||
| * 上传图片文件 | * 上传图片文件 | ||||
| * | * | ||||
| public ApiResult findRandomId() { | public ApiResult findRandomId() { | ||||
| return ApiResult.ok(UUIDUtil.getUUID()); | return ApiResult.ok(UUIDUtil.getUUID()); | ||||
| } | } | ||||
| /** | |||||
| * excle导入更新 | |||||
| * @param file | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| @PostMapping("/importCompany") | |||||
| @ApiOperation(value = "添加MultipartFile对象", notes = "添加图片上传", response = ApiResult.class) | |||||
| public ApiResult<String> importCompany(MultipartFile file) throws Exception { | |||||
| List<DtUploadCompanyDescript> dtoList =new ExcelUtil().readExcelFileToDTO(file, DtUploadCompanyDescript.class); | |||||
| return dtUploadCompanyService.addCompanyByExcel(dtoList); | |||||
| } | |||||
| } | } |
| import com.xdf.creative.base.controller.BaseController; | import com.xdf.creative.base.controller.BaseController; | ||||
| import com.xdf.creative.base.params.IdParam; | import com.xdf.creative.base.params.IdParam; | ||||
| import com.xdf.creative.base.params.creative.*; | import com.xdf.creative.base.params.creative.*; | ||||
| import com.xdf.creative.base.vo.creative.InfoContentBackSearchQueryVo; | |||||
| import com.xdf.creative.base.vo.creative.InfoContentQueryVo; | |||||
| import com.xdf.creative.base.vo.creative.InfoContentRecycleSearchQueryVo; | |||||
| import com.xdf.creative.base.vo.creative.InfoContentWebSearchQueryVo; | |||||
| import com.xdf.creative.base.vo.creative.*; | |||||
| import com.xdf.creative.module.entity.InfoContent; | import com.xdf.creative.module.entity.InfoContent; | ||||
| import com.xdf.creative.module.service.InfoContentService; | import com.xdf.creative.module.service.InfoContentService; | ||||
| import com.xdf.creative.support.aop.OperateLogger; | import com.xdf.creative.support.aop.OperateLogger; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| 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.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 org.springframework.web.bind.annotation.*; | |||||
| import javax.validation.Valid; | import javax.validation.Valid; | ||||
| return infoContentService.editInfoManage(infoContentEditQueryParam); | return infoContentService.editInfoManage(infoContentEditQueryParam); | ||||
| } | } | ||||
| /** | /** | ||||
| * 管理员初审信息 | * 管理员初审信息 | ||||
| * | * | ||||
| return infoContentService.firstAuditInfo(infoContentAuditQueryParam); | return infoContentService.firstAuditInfo(infoContentAuditQueryParam); | ||||
| } | } | ||||
| /** | /** | ||||
| * 管理员终审信息 | * 管理员终审信息 | ||||
| * | * | ||||
| /** | |||||
| * 首页搜索信息 | |||||
| */ | |||||
| @PostMapping("/getSearchMbInfo") | |||||
| @ApiOperation(value = "获取InfoContentWeb分页列表", notes = "信息内容分页列表", response = InfoContentWebSearchMbQueryVo.class) | |||||
| public ApiResult<PageTool<InfoContentWebSearchMbQueryVo>> getSearchMbInfo(@Valid @RequestBody InfoContentWebSearchQueryParam infoContentWebSearchQueryParam) throws Exception { | |||||
| PageTool<InfoContentWebSearchMbQueryVo> pageList = infoContentService.getSearchMbInfo(infoContentWebSearchQueryParam); | |||||
| return ApiResult.ok(pageList); | |||||
| } | |||||
| /** | /** | ||||
| * 首页查询信息 | * 首页查询信息 | ||||
| */ | */ |
| 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-05-11 | |||||
| */ | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| @ApiModel(value = "DtEnterCompany对象", description = "") | |||||
| public class DtEnterCompany 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 orgParkId; | |||||
| @ApiModelProperty(value = "园区库id") | |||||
| private Long bizParkId; | |||||
| @ApiModelProperty(value = "企业名称") | |||||
| private String companyName; | |||||
| @ApiModelProperty(value = "企业统一社会信用代码") | |||||
| private String serialNumber; | |||||
| @ApiModelProperty(value = "企业法人名字") | |||||
| private String legalPersonName; | |||||
| @ApiModelProperty(value = "注册资本数字") | |||||
| private String regCapitalNo; | |||||
| @ApiModelProperty(value = "注册资本单位") | |||||
| private String unit; | |||||
| @ApiModelProperty(value = "注册资本") | |||||
| private String regCapital; | |||||
| @ApiModelProperty(value = "所属行业代码") | |||||
| private String categ; | |||||
| @ApiModelProperty(value = "所属行业名称") | |||||
| private String cateName; | |||||
| @ApiModelProperty(value = "成立日期") | |||||
| private Date estiblishTime; | |||||
| @ApiModelProperty(value = "是否为战略融资") | |||||
| private String isInvest; | |||||
| @ApiModelProperty(value = "是否为上市公司") | |||||
| private String listedCom; | |||||
| @ApiModelProperty(value = "是否为高新技术企业") | |||||
| private String isHighTecNew; | |||||
| @ApiModelProperty(value = "是否为企业500强") | |||||
| private String isFiveNew; | |||||
| @ApiModelProperty(value = "是否存在") | |||||
| private Integer exist; | |||||
| @ApiModelProperty(value = "是否为个体户 0否 1是") | |||||
| private Integer companyType; | |||||
| @ApiModelProperty(value = "更新时间") | |||||
| private Date updateTime; | |||||
| @ApiModelProperty(value = "企业id") | |||||
| private Long companyId; | |||||
| @ApiModelProperty(value = "排序号") | |||||
| private Integer sort; | |||||
| } |
| package com.xdf.creative.module.entity; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| 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-05-07 | |||||
| */ | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| @ApiModel(value = "DtUploadCompany对象", description = "企业上传") | |||||
| public class DtUploadCompany extends BaseEntity { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @ApiModelProperty(value = "主键id") | |||||
| @TableId(value = "id", type = IdType.AUTO) | |||||
| private Long id; | |||||
| @ApiModelProperty(value = "园区名称") | |||||
| @TableField(exist = false) | |||||
| private String parkName; | |||||
| @ApiModelProperty(value = "组织id") | |||||
| private Long orgParkId; | |||||
| @ApiModelProperty(value = "园区库id") | |||||
| private Long bizParkId; | |||||
| @ApiModelProperty(value = "企业名称") | |||||
| private String companyName; | |||||
| @ApiModelProperty(value = "企业统一社会信用代码") | |||||
| private String serialNumber; | |||||
| @ApiModelProperty(value = "企业法人名字") | |||||
| private String legalPersonName; | |||||
| @ApiModelProperty(value = "注册资本数字") | |||||
| private String regCapitalNo; | |||||
| @ApiModelProperty(value = "注册资本单位") | |||||
| private String unit; | |||||
| @ApiModelProperty(value = "注册资本") | |||||
| private String regCapital; | |||||
| @ApiModelProperty(value = "所属行业名称") | |||||
| private String cateName; | |||||
| @ApiModelProperty(value = "成立日期") | |||||
| private Date estiblishTime; | |||||
| @ApiModelProperty(value = "是否为个体户 0否 1是") | |||||
| private Integer companyType; | |||||
| @ApiModelProperty(value = "更新时间") | |||||
| private Date updateTime; | |||||
| @ApiModelProperty(value = "上传时间") | |||||
| private Date createTime; | |||||
| @ApiModelProperty(value = "更新状态 1、新增 (待处理) 2、更新(待处理) 3、删除(待处理) ") | |||||
| private Integer state; | |||||
| @ApiModelProperty(value = "处理状态1、待处理 2、已处理(成功) 3已处理(失败) 4 未找到") | |||||
| private Integer disposeState; | |||||
| } |
| 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.dt.DtEnterCompanyQueryParam; | |||||
| import com.xdf.creative.base.vo.creative.DtEnterCompanyQueryVo; | |||||
| import com.xdf.creative.module.entity.DtEnterCompany; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| import org.springframework.stereotype.Repository; | |||||
| import java.io.Serializable; | |||||
| /** | |||||
| * <p> | |||||
| * Mapper 接口 | |||||
| * </p> | |||||
| * | |||||
| * @author lgw | |||||
| * @since 2020-05-11 | |||||
| */ | |||||
| @Repository | |||||
| public interface DtEnterCompanyMapper extends BaseMapper<DtEnterCompany> { | |||||
| /** | |||||
| * 根据ID获取查询对象 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| DtEnterCompanyQueryVo getDtEnterCompanyById(Serializable id); | |||||
| /** | |||||
| * 获取分页对象 | |||||
| * | |||||
| * @param page | |||||
| * @param dtEnterCompanyQueryParam | |||||
| * @return | |||||
| */ | |||||
| IPage<DtEnterCompanyQueryVo> getDtEnterCompanyPageList(@Param("page") Page page, @Param("param") DtEnterCompanyQueryParam dtEnterCompanyQueryParam); | |||||
| IPage<DtEnterCompanyQueryVo> getDtEnterCompanyUserList(@Param("page") Page page, @Param("param") DtEnterCompanyQueryParam dtEnterCompanyQueryParam); | |||||
| IPage<DtEnterCompanyQueryVo> getDtEnterCompanyHomeList(@Param("page") Page page, @Param("param") DtEnterCompanyQueryParam dtEnterCompanyQueryParam); | |||||
| } |
| 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.dt.DtUploadCompanyQueryParam; | |||||
| import com.xdf.creative.base.vo.dt.DtUploadCompanyQueryVo; | |||||
| import com.xdf.creative.module.entity.DtUploadCompany; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| import org.springframework.stereotype.Repository; | |||||
| import java.io.Serializable; | |||||
| /** | |||||
| * <p> | |||||
| * 企业上传 Mapper 接口 | |||||
| * </p> | |||||
| * | |||||
| * @author lgw | |||||
| * @since 2020-05-07 | |||||
| */ | |||||
| @Repository | |||||
| public interface DtUploadCompanyMapper extends BaseMapper<DtUploadCompany> { | |||||
| /** | |||||
| * 根据ID获取查询对象 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| DtUploadCompanyQueryVo getDtUploadCompanyById(Serializable id); | |||||
| /** | |||||
| * 获取分页对象 | |||||
| * | |||||
| * @param page | |||||
| * @param dtUploadCompanyQueryParam | |||||
| * @return | |||||
| */ | |||||
| IPage<DtUploadCompanyQueryVo> getDtUploadCompanyPageList(@Param("page") Page page, @Param("param") DtUploadCompanyQueryParam dtUploadCompanyQueryParam); | |||||
| } |
| IPage<InfoContentRecycleSearchQueryVo> getInfoContentByRecycle(@Param("page") Page page, @Param("param") InfoContentBackSearchQueryParam infoContentBackSearchQueryParam); | IPage<InfoContentRecycleSearchQueryVo> getInfoContentByRecycle(@Param("page") Page page, @Param("param") InfoContentBackSearchQueryParam infoContentBackSearchQueryParam); | ||||
| /** | |||||
| * 手机首页新闻搜索 | |||||
| */ | |||||
| IPage<InfoContentWebSearchMbQueryVo> getSearchMbInfo(@Param("page") Page page, @Param("param") InfoContentWebSearchQueryParam infoContentWebSearchQueryParam); | |||||
| /** | /** | ||||
| * 根据ID获取查询对象 | * 根据ID获取查询对象 | ||||
| * | * |
| package com.xdf.creative.module.service; | |||||
| import com.xdf.creative.base.params.dt.DtEnterCompanyQueryParam; | |||||
| import com.xdf.creative.base.service.BaseService; | |||||
| import com.xdf.creative.base.vo.creative.DtEnterCompanyQueryVo; | |||||
| import com.xdf.creative.module.entity.DtEnterCompany; | |||||
| import com.xdf.creative.util.page.ApiResult; | |||||
| import com.xdf.creative.util.page.PageTool; | |||||
| import java.io.Serializable; | |||||
| /** | |||||
| * <p> | |||||
| * 服务类 | |||||
| * </p> | |||||
| * | |||||
| * @author lgw | |||||
| * @since 2020-05-11 | |||||
| */ | |||||
| public interface DtEnterCompanyService extends BaseService<DtEnterCompany> { | |||||
| /** | |||||
| * 清理数据 | |||||
| * @return | |||||
| */ | |||||
| ApiResult cleanParkCompany(); | |||||
| /** | |||||
| * 根据ID获取查询对象 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| DtEnterCompanyQueryVo getDtEnterCompanyById(Serializable id) throws Exception; | |||||
| /** | |||||
| * 获取分页对象 | |||||
| * | |||||
| * @param dtEnterCompanyQueryParam | |||||
| * @return | |||||
| */ | |||||
| PageTool<DtEnterCompanyQueryVo> getDtEnterCompanyPageList(DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception; | |||||
| /** | |||||
| * 获取分页对象 | |||||
| * | |||||
| * @param dtEnterCompanyQueryParam | |||||
| * @return | |||||
| */ | |||||
| PageTool<DtEnterCompanyQueryVo> getDtEnterCompanyUserList(DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception; | |||||
| /** | |||||
| * 获取分页对象 | |||||
| * | |||||
| * @param dtEnterCompanyQueryParam | |||||
| * @return | |||||
| */ | |||||
| PageTool<DtEnterCompanyQueryVo> getDtEnterCompanyHomeList(DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception; | |||||
| } |
| package com.xdf.creative.module.service; | |||||
| import com.xdf.creative.base.params.DtUploadCompanyDescript; | |||||
| import com.xdf.creative.base.params.dt.DtUploadCompanyQueryParam; | |||||
| import com.xdf.creative.base.service.BaseService; | |||||
| import com.xdf.creative.base.vo.dt.DtUploadCompanyQueryVo; | |||||
| import com.xdf.creative.module.entity.DtUploadCompany; | |||||
| 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-05-07 | |||||
| */ | |||||
| public interface DtUploadCompanyService extends BaseService<DtUploadCompany> { | |||||
| /** | |||||
| * 根据ID获取查询对象 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| DtUploadCompanyQueryVo getDtUploadCompanyById(Serializable id) throws Exception; | |||||
| /** | |||||
| * excel 上传更新 | |||||
| * @param list | |||||
| * @return | |||||
| */ | |||||
| ApiResult addCompanyByExcel(List<DtUploadCompanyDescript> list); | |||||
| /** | |||||
| * 获取分页对象 | |||||
| * | |||||
| * @param dtUploadCompanyQueryParam | |||||
| * @return | |||||
| */ | |||||
| PageTool<DtUploadCompanyQueryVo> getDtUploadCompanyPageList(DtUploadCompanyQueryParam dtUploadCompanyQueryParam) throws Exception; | |||||
| } |
| /** | /** | ||||
| * 获取新闻搜索 | * 获取新闻搜索 | ||||
| * @param infoContentWebSearchQueryParam | * @param infoContentWebSearchQueryParam | ||||
| PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception; | PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception; | ||||
| /** | |||||
| * 手机端搜索新闻 | |||||
| * @param infoContentWebSearchQueryParam | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| PageTool<InfoContentWebSearchMbQueryVo> getSearchMbInfo(InfoContentWebSearchQueryParam infoContentWebSearchQueryParam) throws Exception; | |||||
| /** | /** | ||||
| * 后台发布列表 | * 后台发布列表 | ||||
| */ | */ |
| package com.xdf.creative.module.service.impl; | |||||
| import com.alibaba.fastjson.JSON; | |||||
| import com.alibaba.fastjson.JSONArray; | |||||
| import com.alibaba.fastjson.JSONObject; | |||||
| 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.dt.DtEnterCompanyQueryParam; | |||||
| import com.xdf.creative.base.service.impl.BaseServiceImpl; | |||||
| import com.xdf.creative.base.vo.CompanyBaseInfoVO; | |||||
| import com.xdf.creative.base.vo.CompanyInfoDocument; | |||||
| import com.xdf.creative.base.vo.creative.DtEnterCompanyQueryVo; | |||||
| import com.xdf.creative.enums.StateEnum; | |||||
| import com.xdf.creative.enums.dt.DisposeStateEnum; | |||||
| import com.xdf.creative.enums.dt.UploadCompanyStateEnum; | |||||
| import com.xdf.creative.module.entity.DtEnterCompany; | |||||
| import com.xdf.creative.module.entity.DtUploadCompany; | |||||
| import com.xdf.creative.module.mapper.DtEnterCompanyMapper; | |||||
| import com.xdf.creative.module.service.DtEnterCompanyService; | |||||
| import com.xdf.creative.module.service.DtUploadCompanyService; | |||||
| import com.xdf.creative.util.HttpClient; | |||||
| import com.xdf.creative.util.StringUtil; | |||||
| 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.beans.factory.annotation.Value; | |||||
| import org.springframework.stereotype.Service; | |||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| import java.io.IOException; | |||||
| import java.io.Serializable; | |||||
| import java.text.ParseException; | |||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| /** | |||||
| * <p> | |||||
| * 服务实现类 | |||||
| * </p> | |||||
| * | |||||
| * @author lgw | |||||
| * @since 2020-05-11 | |||||
| */ | |||||
| @Slf4j | |||||
| @Service | |||||
| public class DtEnterCompanyServiceImpl extends BaseServiceImpl<DtEnterCompanyMapper, DtEnterCompany> implements DtEnterCompanyService { | |||||
| @Value("${xdf_company_info_id_url}") | |||||
| private String xdfInfoIdUrl; | |||||
| @Value("${xdf_company_info_name_url}") | |||||
| private String xdfInfoNameUrl; | |||||
| @Value("${xdf_company_es_url}") | |||||
| private String esInfoUrl; | |||||
| private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| @Autowired | |||||
| private DtEnterCompanyMapper dtEnterCompanyMapper; | |||||
| @Autowired | |||||
| private DtUploadCompanyService dtUploadCompanyService; | |||||
| @Override | |||||
| public DtEnterCompanyQueryVo getDtEnterCompanyById(Serializable id) throws Exception { | |||||
| return dtEnterCompanyMapper.getDtEnterCompanyById(id); | |||||
| } | |||||
| @Override | |||||
| public ApiResult cleanParkCompany() { | |||||
| //获取excle数据 | |||||
| List<DtUploadCompany> uploadCompanyList = dtUploadCompanyService.list(new QueryWrapper<DtUploadCompany>().eq("dispose_state", DisposeStateEnum.INFO_STATE_TYPE_ENUM.getCode())); | |||||
| for (DtUploadCompany dtUploadCompany : uploadCompanyList | |||||
| ) { | |||||
| if (UploadCompanyStateEnum.INFO_STATE_ADD_ENUM.getCode().equals(dtUploadCompany.getState())) { | |||||
| changeCompanyInfo(dtUploadCompany); | |||||
| } else if (UploadCompanyStateEnum.INFO_STATE_UPDATE_ENUM.getCode().equals(dtUploadCompany.getState())) { | |||||
| //先删除后修改 | |||||
| changeCompanyInfo(dtUploadCompany); | |||||
| } else if (UploadCompanyStateEnum.INFO_STATE_DEL_ENUM.getCode().equals(dtUploadCompany.getState())) { | |||||
| this.remove(new QueryWrapper<DtEnterCompany>().eq("company_name",dtUploadCompany.getCompanyName())); | |||||
| } | |||||
| } | |||||
| return ApiResult.ok(); | |||||
| } | |||||
| @Transactional | |||||
| public void changeCompanyInfo(DtUploadCompany dtUploadCompany) { | |||||
| try { | |||||
| if (UploadCompanyStateEnum.INFO_STATE_UPDATE_ENUM.getCode().equals(dtUploadCompany.getState())) { | |||||
| //先删除后修改 | |||||
| this.remove(new QueryWrapper<DtEnterCompany>().eq("company_name",dtUploadCompany.getCompanyName())); | |||||
| } | |||||
| DtEnterCompany dtEnterCompany = new DtEnterCompany(); | |||||
| BeanUtils.copyProperties(dtUploadCompany, dtEnterCompany); | |||||
| dtEnterCompany.setUpdateTime(new Date()); | |||||
| //开始拉取数据 | |||||
| Map<String, String> map = new HashMap<String, String>(); | |||||
| map.put("companyName", dtUploadCompany.getCompanyName()); | |||||
| if (!StringUtil.isEmpty(dtUploadCompany.getSerialNumber())) { | |||||
| map.put("societyNum", dtUploadCompany.getSerialNumber()); | |||||
| } | |||||
| //先从es拉取数据 如果没有从mysql库中拉取 | |||||
| CompanyInfoDocument companyInfoDocument = getXdfEsCompanyInfo(map); | |||||
| if (null == companyInfoDocument) { | |||||
| CompanyBaseInfoVO companyBaseInfoVO = getXdfCompanyInfoByName(dtUploadCompany.getCompanyName()); | |||||
| if(null==companyBaseInfoVO){ | |||||
| dtUploadCompany.setUpdateTime(new Date()); | |||||
| dtUploadCompany.setDisposeState(DisposeStateEnum.INFO_STATE_TYPE_NOT_FOUND.getCode()); | |||||
| dtUploadCompany.setState(UploadCompanyStateEnum.INFO_STATE_ADD_ENUM.getCode()); | |||||
| dtEnterCompany.setExist(StateEnum.DISABLE.getKey()); | |||||
| dtEnterCompany.setSort(0); | |||||
| }else{ | |||||
| dtEnterCompany.setExist(StateEnum.ENABLE.getKey()); | |||||
| dtEnterCompany.setSort(1); | |||||
| if (StringUtil.isEmpty(dtEnterCompany.getSerialNumber())) { | |||||
| dtEnterCompany.setSerialNumber(companyBaseInfoVO.getPropertyCode()); | |||||
| } | |||||
| //注册资金 | |||||
| if (StringUtil.isEmpty(dtEnterCompany.getRegCapitalNo())) { | |||||
| dtEnterCompany.setRegCapital(companyBaseInfoVO.getRegCapital()); | |||||
| } | |||||
| //成立日期 | |||||
| if (null == dtEnterCompany.getEstiblishTime()) { | |||||
| dtEnterCompany.setEstiblishTime(companyBaseInfoVO.getEstiblishTime()); | |||||
| } | |||||
| //行业代码 | |||||
| if (StringUtil.isEmpty(dtEnterCompany.getCateName())) { | |||||
| if (!StringUtil.isEmpty(companyBaseInfoVO.getCategoryName())) { | |||||
| dtEnterCompany.setCateName(companyBaseInfoVO.getCategoryName()); | |||||
| } | |||||
| } | |||||
| //法人 | |||||
| if(StringUtil.isEmpty(dtEnterCompany.getLegalPersonName())){ | |||||
| dtEnterCompany.setLegalPersonName(companyBaseInfoVO.getLegalPersonName()); | |||||
| } | |||||
| dtEnterCompany.setCompanyId(companyBaseInfoVO.getId()); | |||||
| dtUploadCompany.setUpdateTime(new Date()); | |||||
| dtUploadCompany.setDisposeState(DisposeStateEnum.INFO_STATE_TYPE_SUCCESS.getCode()); | |||||
| dtUploadCompany.setState(UploadCompanyStateEnum.INFO_STATE_INIT_ENUM.getCode()); | |||||
| } | |||||
| } else { | |||||
| dtEnterCompany.setExist(StateEnum.ENABLE.getKey()); | |||||
| //统一社会信用代码 | |||||
| if (StringUtil.isEmpty(dtEnterCompany.getSerialNumber())) { | |||||
| dtEnterCompany.setSerialNumber(companyInfoDocument.getSoci_num()); | |||||
| } | |||||
| //注册资金 | |||||
| if (StringUtil.isEmpty(dtEnterCompany.getRegCapitalNo())) { | |||||
| dtEnterCompany.setRegCapitalNo(companyInfoDocument.getReg_val()); | |||||
| dtEnterCompany.setUnit(companyInfoDocument.getReg_unit()); | |||||
| dtEnterCompany.setRegCapital(companyInfoDocument.getReg_cpl()); | |||||
| }else{ | |||||
| dtEnterCompany.setRegCapital(dtEnterCompany.getRegCapitalNo()+dtEnterCompany.getUnit()); | |||||
| } | |||||
| //成立日期 | |||||
| if (null == dtEnterCompany.getEstiblishTime()) { | |||||
| try { | |||||
| if (!StringUtil.isEmpty(companyInfoDocument.getEst_tm())) { | |||||
| dtEnterCompany.setEstiblishTime(sdf.parse(companyInfoDocument.getEst_tm())); | |||||
| } | |||||
| } catch (ParseException e) { | |||||
| log.error(dtEnterCompany.getCompanyName() + "日期转换失败:" + companyInfoDocument.getEst_tm()); | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| //法人 | |||||
| if(StringUtil.isEmpty(dtEnterCompany.getLegalPersonName())){ | |||||
| dtEnterCompany.setLegalPersonName(companyInfoDocument.getFr_nm()); | |||||
| } | |||||
| //行业代码 | |||||
| if (StringUtil.isEmpty(dtEnterCompany.getCateName())) { | |||||
| CompanyBaseInfoVO companyBaseInfoVO = getXdfCompanyInfoById(companyInfoDocument.getCom_id().toString()); | |||||
| if (!StringUtil.isEmpty(companyBaseInfoVO.getCategoryName())) { | |||||
| dtEnterCompany.setCateName(companyBaseInfoVO.getCategoryName()); | |||||
| } | |||||
| if (!StringUtil.isEmpty(companyInfoDocument.getCateg())) { | |||||
| dtEnterCompany.setCateg(companyInfoDocument.getCateg()); | |||||
| } | |||||
| } | |||||
| dtEnterCompany.setCompanyId(companyInfoDocument.getCom_id()); | |||||
| dtEnterCompany.setSort(1); | |||||
| if("Y".equals(companyInfoDocument.getIs_500_new())){ | |||||
| dtEnterCompany.setSort(dtEnterCompany.getSort()+1); | |||||
| } | |||||
| dtEnterCompany.setIsFiveNew(companyInfoDocument.getIs_500_new()); | |||||
| if("Y".equals(companyInfoDocument.getIs_high_tec_new())){ | |||||
| dtEnterCompany.setSort(dtEnterCompany.getSort()+1); | |||||
| } | |||||
| dtEnterCompany.setIsHighTecNew(companyInfoDocument.getIs_high_tec_new()); | |||||
| if("Y".equals(companyInfoDocument.getListed_com())){ | |||||
| dtEnterCompany.setSort(dtEnterCompany.getSort()+1); | |||||
| } | |||||
| dtEnterCompany.setListedCom(companyInfoDocument.getListed_com()); | |||||
| if("Y".equals(companyInfoDocument.getIs_invest())){ | |||||
| dtEnterCompany.setSort(dtEnterCompany.getSort()+1); | |||||
| } | |||||
| dtEnterCompany.setIsInvest(companyInfoDocument.getIs_invest()); | |||||
| dtUploadCompany.setUpdateTime(new Date()); | |||||
| dtUploadCompany.setDisposeState(DisposeStateEnum.INFO_STATE_TYPE_SUCCESS.getCode()); | |||||
| dtUploadCompany.setState(UploadCompanyStateEnum.INFO_STATE_INIT_ENUM.getCode()); | |||||
| } | |||||
| dtUploadCompanyService.saveOrUpdate(dtUploadCompany); | |||||
| this.saveOrUpdate(dtEnterCompany); | |||||
| } catch (Exception e) { | |||||
| dtUploadCompany.setUpdateTime(new Date()); | |||||
| dtUploadCompany.setDisposeState(DisposeStateEnum.INFO_STATE_TYPE_FAILE.getCode()); | |||||
| dtUploadCompany.setState(UploadCompanyStateEnum.INFO_STATE_INIT_ENUM.getCode()); | |||||
| dtUploadCompanyService.saveOrUpdate(dtUploadCompany); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * 获取信东方es企业基本信息 | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| public CompanyInfoDocument getXdfEsCompanyInfo(Map<String, String> map) { | |||||
| String body = null; | |||||
| CompanyInfoDocument companyInfoDocument = null; | |||||
| try { | |||||
| body = HttpClient.sendPostDataByMap(esInfoUrl, map, "utf-8"); | |||||
| JSONObject object = JSON.parseObject(body); | |||||
| if (JSONArray.parseArray(object.get("data").toString()).size() > 0) { | |||||
| String companyInfo = JSONArray.parseArray(object.get("data").toString()).get(0).toString(); | |||||
| companyInfoDocument = JSONObject.parseObject(companyInfo, CompanyInfoDocument.class); | |||||
| } else { | |||||
| companyInfoDocument = null; | |||||
| } | |||||
| } catch (IOException e) { | |||||
| log.error("企业" + map.get("companyName") + "拉取数据异常!"); | |||||
| e.printStackTrace(); | |||||
| } | |||||
| return companyInfoDocument; | |||||
| } | |||||
| /** | |||||
| * 获取信东方企业基本信息 | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| public CompanyBaseInfoVO getXdfCompanyInfoById(String companyId) { | |||||
| String body = ""; | |||||
| CompanyBaseInfoVO companyBaseInfoVO = null; | |||||
| try { | |||||
| body = HttpClient.sendGetData(xdfInfoIdUrl + companyId, "utf-8"); | |||||
| JSONObject object = JSON.parseObject(body); | |||||
| String companyInfo = object.get("data").toString(); | |||||
| companyBaseInfoVO = JSONObject.parseObject(companyInfo, CompanyBaseInfoVO.class); | |||||
| } catch (IOException e) { | |||||
| log.error("企业id" + companyId + "拉取数据异常!"); | |||||
| e.printStackTrace(); | |||||
| } | |||||
| return companyBaseInfoVO; | |||||
| } | |||||
| /** | |||||
| * 获取信东方企业基本信息 | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| public CompanyBaseInfoVO getXdfCompanyInfoByName(String name) { | |||||
| String body = ""; | |||||
| CompanyBaseInfoVO companyBaseInfoVO = null; | |||||
| try { | |||||
| body = HttpClient.sendGetData(xdfInfoNameUrl + name, "utf-8"); | |||||
| JSONObject object = JSON.parseObject(body); | |||||
| String companyInfo = object.get("data").toString(); | |||||
| companyBaseInfoVO = JSONObject.parseObject(companyInfo, CompanyBaseInfoVO.class); | |||||
| } catch (IOException e) { | |||||
| log.error("企业名称" + name + "拉取数据异常!"); | |||||
| e.printStackTrace(); | |||||
| } | |||||
| return companyBaseInfoVO; | |||||
| } | |||||
| @Override | |||||
| public PageTool<DtEnterCompanyQueryVo> getDtEnterCompanyPageList(DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception { | |||||
| Page page = setPageParam(dtEnterCompanyQueryParam); | |||||
| IPage<DtEnterCompanyQueryVo> iPage = dtEnterCompanyMapper.getDtEnterCompanyPageList(page, dtEnterCompanyQueryParam); | |||||
| return new PageTool(iPage); | |||||
| } | |||||
| @Override | |||||
| public PageTool<DtEnterCompanyQueryVo> getDtEnterCompanyUserList(DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception { | |||||
| dtEnterCompanyQueryParam.setOrgParkId(getOrganizeId()); | |||||
| Page page = setPageParam(dtEnterCompanyQueryParam); | |||||
| IPage<DtEnterCompanyQueryVo> iPage = dtEnterCompanyMapper.getDtEnterCompanyUserList(page, dtEnterCompanyQueryParam); | |||||
| return new PageTool(iPage); | |||||
| } | |||||
| @Override | |||||
| public PageTool<DtEnterCompanyQueryVo> getDtEnterCompanyHomeList(DtEnterCompanyQueryParam dtEnterCompanyQueryParam) throws Exception { | |||||
| Page page = setPageParam(dtEnterCompanyQueryParam); | |||||
| IPage<DtEnterCompanyQueryVo> iPage = dtEnterCompanyMapper.getDtEnterCompanyHomeList(page, dtEnterCompanyQueryParam); | |||||
| return new PageTool(iPage); | |||||
| } | |||||
| } |
| package com.xdf.creative.module.service.impl; | |||||
| import com.alibaba.druid.util.StringUtils; | |||||
| 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.DtUploadCompanyDescript; | |||||
| import com.xdf.creative.base.params.dt.DtUploadCompanyQueryParam; | |||||
| import com.xdf.creative.base.service.impl.BaseServiceImpl; | |||||
| import com.xdf.creative.base.vo.dt.DtUploadCompanyQueryVo; | |||||
| import com.xdf.creative.enums.StateEnum; | |||||
| import com.xdf.creative.enums.dt.DisposeStateEnum; | |||||
| import com.xdf.creative.enums.dt.UploadCompanyStateEnum; | |||||
| import com.xdf.creative.module.entity.DtParkInfoDraft; | |||||
| import com.xdf.creative.module.entity.DtUploadCompany; | |||||
| import com.xdf.creative.module.mapper.DtUploadCompanyMapper; | |||||
| import com.xdf.creative.module.service.DtParkInfoDraftService; | |||||
| import com.xdf.creative.module.service.DtUploadCompanyService; | |||||
| import com.xdf.creative.util.StringUtil; | |||||
| 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.text.ParseException; | |||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| /** | |||||
| * <p> | |||||
| * 企业上传 服务实现类 | |||||
| * </p> | |||||
| * | |||||
| * @author lgw | |||||
| * @since 2020-05-07 | |||||
| */ | |||||
| @Slf4j | |||||
| @Service | |||||
| @Transactional(rollbackFor = Exception.class) | |||||
| public class DtUploadCompanyServiceImpl extends BaseServiceImpl<DtUploadCompanyMapper, DtUploadCompany> implements DtUploadCompanyService { | |||||
| private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| @Autowired | |||||
| private DtUploadCompanyMapper dtUploadCompanyMapper; | |||||
| @Autowired | |||||
| private DtParkInfoDraftService dtParkInfoDraftService; | |||||
| @Override | |||||
| public DtUploadCompanyQueryVo getDtUploadCompanyById(Serializable id) { | |||||
| return dtUploadCompanyMapper.getDtUploadCompanyById(id); | |||||
| } | |||||
| @Override | |||||
| public ApiResult addCompanyByExcel(List<DtUploadCompanyDescript> list) { | |||||
| int excelCount = list.size(); | |||||
| int addCount = 0; | |||||
| int updateCount =0; | |||||
| int successCount = 0; | |||||
| List<DtUploadCompany> companyList = new ArrayList<>(); | |||||
| for (int i = 0; i < list.size(); i++) { | |||||
| DtUploadCompanyDescript dtUploadCompanyDescript = list.get(i); | |||||
| DtUploadCompany dtUploadCompany = new DtUploadCompany(); | |||||
| BeanUtils.copyProperties(dtUploadCompanyDescript, dtUploadCompany); | |||||
| if (StringUtil.isEmpty(dtUploadCompanyDescript.getCompanyType())) { | |||||
| dtUploadCompany.setCompanyType(StateEnum.DISABLE.getKey()); | |||||
| } else { | |||||
| dtUploadCompany.setCompanyType(Integer.parseInt(dtUploadCompanyDescript.getCompanyType())); | |||||
| } | |||||
| if (!StringUtil.isEmpty(dtUploadCompanyDescript.getEstiblishTime())) { | |||||
| System.out.println(dtUploadCompanyDescript.toString()); | |||||
| try { | |||||
| dtUploadCompany.setEstiblishTime(sdf.parse(dtUploadCompanyDescript.getEstiblishTime())); | |||||
| } catch (ParseException e) { | |||||
| log.error(dtUploadCompany.getCompanyName() + "日期转换失败:" + dtUploadCompanyDescript.getEstiblishTime()); | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| companyList.add(dtUploadCompany); | |||||
| } | |||||
| for (DtUploadCompany dtUploadCompany : companyList | |||||
| ) { | |||||
| try { | |||||
| DtUploadCompany dtUploadCompanyOld = this.getOne(new QueryWrapper<DtUploadCompany>().eq("company_name", dtUploadCompany.getCompanyName().trim())); | |||||
| if (null == dtUploadCompanyOld) { | |||||
| dtUploadCompany.setCreateTime(new Date()); | |||||
| dtUploadCompany.setDisposeState(DisposeStateEnum.INFO_STATE_TYPE_ENUM.getCode()); | |||||
| dtUploadCompany.setState(UploadCompanyStateEnum.INFO_STATE_ADD_ENUM.getCode()); | |||||
| dtUploadCompany.setCompanyName(dtUploadCompany.getCompanyName().trim()); | |||||
| DtParkInfoDraft dtParkInfoDraft = dtParkInfoDraftService.getOne(new QueryWrapper<DtParkInfoDraft>().eq("name", dtUploadCompany.getParkName())); | |||||
| if (null != dtParkInfoDraft) { | |||||
| dtUploadCompany.setOrgParkId(dtParkInfoDraft.getOrganizeId()); | |||||
| dtUploadCompany.setBizParkId(dtParkInfoDraft.getDateParkId()); | |||||
| this.saveOrUpdate(dtUploadCompany); | |||||
| addCount++; | |||||
| }else{ | |||||
| log.error("园区名未找到:"+dtUploadCompany.getParkName()); | |||||
| } | |||||
| } else { | |||||
| Long oldCompanyId = dtUploadCompanyOld.getId(); | |||||
| BeanUtils.copyProperties(dtUploadCompany, dtUploadCompanyOld); | |||||
| dtUploadCompanyOld.setId(oldCompanyId); | |||||
| dtUploadCompanyOld.setUpdateTime(new Date()); | |||||
| dtUploadCompanyOld.setDisposeState(DisposeStateEnum.INFO_STATE_TYPE_ENUM.getCode()); | |||||
| dtUploadCompanyOld.setState(UploadCompanyStateEnum.INFO_STATE_UPDATE_ENUM.getCode()); | |||||
| this.saveOrUpdate(dtUploadCompanyOld); | |||||
| updateCount++; | |||||
| } | |||||
| } catch (Exception e) { | |||||
| log.error("出错企业:"+dtUploadCompany.getCompanyName()); | |||||
| successCount++; | |||||
| } | |||||
| } | |||||
| System.out.println("总计" + excelCount + "条,增量数据"+addCount+"条,更新数据"+updateCount+"条,执行失败" + successCount + "条"); | |||||
| return ApiResult.ok("总计" + excelCount + "条,增量数据"+addCount+"条,更新数据"+updateCount+"条,执行失败" + successCount + "条"); | |||||
| } | |||||
| @Override | |||||
| public PageTool<DtUploadCompanyQueryVo> getDtUploadCompanyPageList(DtUploadCompanyQueryParam dtUploadCompanyQueryParam) throws Exception { | |||||
| Page page = setPageParam(dtUploadCompanyQueryParam); | |||||
| IPage<DtUploadCompanyQueryVo> iPage = dtUploadCompanyMapper.getDtUploadCompanyPageList(page, dtUploadCompanyQueryParam); | |||||
| return new PageTool(iPage); | |||||
| } | |||||
| } |
| /** | /** | ||||
| * t添加信息内容 | * t添加信息内容 | ||||
| * | |||||
| * @param infoContentAddQueryParam | * @param infoContentAddQueryParam | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| return new PageTool(iPage); | return new PageTool(iPage); | ||||
| } | } | ||||
| /** | |||||
| * 首页搜索新闻 | |||||
| * @param infoContentWebSearchQueryParam | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| @Override | |||||
| public PageTool<InfoContentWebSearchMbQueryVo> getSearchMbInfo(InfoContentWebSearchQueryParam infoContentWebSearchQueryParam) throws Exception { | |||||
| Page page = setPageParam(infoContentWebSearchQueryParam); | |||||
| IPage<InfoContentWebSearchMbQueryVo> iPage = infoContentMapper.getSearchMbInfo(page, infoContentWebSearchQueryParam); | |||||
| return new PageTool(iPage); | |||||
| } | |||||
| /** | /** | ||||
| * 发布列表 | * 发布列表 |
| public ApiResult login(LoginParam loginParam, HttpServletRequest request) throws Exception { | public ApiResult login(LoginParam loginParam, HttpServletRequest request) throws Exception { | ||||
| // 校验验证码 | // 校验验证码 | ||||
| /* if (!CodeUtil.checkVerifyCode(request,loginParam.getVerifyCodeActual())) { | |||||
| if (!CodeUtil.checkVerifyCode(request,loginParam.getVerifyCodeActual())) { | |||||
| return ApiResult.fail("验证码错误"); | 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) { |
| List<String> permissionList = Arrays.asList(oauthTokenQueryVo.getPermissions().trim().split(",")); | List<String> permissionList = Arrays.asList(oauthTokenQueryVo.getPermissions().trim().split(",")); | ||||
| boolean permissionflag = false; | boolean permissionflag = false; | ||||
| for (String permissionUrl:permissionList ) { | for (String permissionUrl:permissionList ) { | ||||
| if(permissionUrl.contains(requestUrl)){ | |||||
| if(permissionUrl.contains(requestUrl.replaceAll("/wcapi",""))){ | |||||
| return true; | return true; | ||||
| } | } | ||||
| } | } |
| import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.context.annotation.Configuration; | import org.springframework.context.annotation.Configuration; | ||||
| import org.springframework.web.servlet.config.annotation.CorsRegistry; | |||||
| import org.springframework.web.servlet.config.annotation.InterceptorRegistration; | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; | ||||
| import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||||
| @Override | @Override | ||||
| public void addInterceptors(InterceptorRegistry registry) { | public void addInterceptors(InterceptorRegistry registry) { | ||||
| //注册TestInterceptor拦截器 | //注册TestInterceptor拦截器 | ||||
| InterceptorRegistration registration = registry.addInterceptor(new ConfigPathInterceptor()); | InterceptorRegistration registration = registry.addInterceptor(new ConfigPathInterceptor()); | ||||
| registration.addPathPatterns("/wcapi/**"); //所有路径都被拦截 | |||||
| registration.excludePathPatterns( //添加不拦截路径 | |||||
| skipAuthUrls | |||||
| ); | |||||
| registration.addPathPatterns("/**") | |||||
| .excludePathPatterns( //添加不拦截路径 | |||||
| skipAuthUrls | |||||
| ).excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**"); //所有路径都被拦截 | |||||
| } | |||||
| @Override | |||||
| public void addCorsMappings(CorsRegistry registry) { | |||||
| registry.addMapping("/**") | |||||
| .allowedOrigins("*") | |||||
| .allowCredentials(true) | |||||
| .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") | |||||
| .maxAge(3600); | |||||
| } | } | ||||
| } | } |
| package com.xdf.creative.util; | |||||
| import java.io.IOException; | |||||
| import java.util.ArrayList; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import java.util.Map.Entry; | |||||
| import com.alibaba.fastjson.JSONArray; | |||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.xdf.creative.base.vo.CompanyBaseInfoVO; | |||||
| import com.xdf.creative.base.vo.CompanyInfoDocument; | |||||
| import org.apache.http.HttpStatus; | |||||
| import org.apache.http.NameValuePair; | |||||
| import org.apache.http.client.ClientProtocolException; | |||||
| import org.apache.http.client.entity.UrlEncodedFormEntity; | |||||
| import org.apache.http.client.methods.CloseableHttpResponse; | |||||
| import org.apache.http.client.methods.HttpGet; | |||||
| import org.apache.http.client.methods.HttpPost; | |||||
| import org.apache.http.entity.ContentType; | |||||
| import org.apache.http.entity.StringEntity; | |||||
| import org.apache.http.impl.client.CloseableHttpClient; | |||||
| import org.apache.http.impl.client.HttpClients; | |||||
| import org.apache.http.message.BasicNameValuePair; | |||||
| import org.apache.http.util.EntityUtils; | |||||
| import com.alibaba.fastjson.JSON; | |||||
| /** | |||||
| * @author : lgw | |||||
| * @date : 18:08 2020/5/9 | |||||
| */ | |||||
| public class HttpClient { | |||||
| /** | |||||
| * post请求传输map数据 | |||||
| * | |||||
| * @param url | |||||
| * @param map | |||||
| * @param encoding | |||||
| * @return | |||||
| * @throws ClientProtocolException | |||||
| * @throws IOException | |||||
| */ | |||||
| public static String sendPostDataByMap(String url, Map<String, String> map, String encoding) throws ClientProtocolException, IOException { | |||||
| String result = ""; | |||||
| // 创建httpclient对象 | |||||
| CloseableHttpClient httpClient = HttpClients.createDefault(); | |||||
| // 创建post方式请求对象 | |||||
| HttpPost httpPost = new HttpPost(url); | |||||
| // 装填参数 | |||||
| List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); | |||||
| if (map != null) { | |||||
| for (Entry<String, String> entry : map.entrySet()) { | |||||
| nameValuePairs.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); | |||||
| } | |||||
| } | |||||
| // 设置参数到请求对象中 | |||||
| httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, encoding)); | |||||
| // 设置header信息 | |||||
| // 指定报文头【Content-type】、【User-Agent】 | |||||
| httpPost.setHeader("Content-type", "application/x-www-form-urlencoded"); | |||||
| httpPost.setHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); | |||||
| // 执行请求操作,并拿到结果(同步阻塞) | |||||
| CloseableHttpResponse response = httpClient.execute(httpPost); | |||||
| // 获取结果实体 | |||||
| // 判断网络连接状态码是否正常(0--200都数正常) | |||||
| if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { | |||||
| result = EntityUtils.toString(response.getEntity(), "utf-8"); | |||||
| } | |||||
| // 释放链接 | |||||
| response.close(); | |||||
| return result; | |||||
| } | |||||
| /** | |||||
| * post请求传输json数据 | |||||
| * | |||||
| * @param url | |||||
| * @param json | |||||
| * @param encoding | |||||
| * @return | |||||
| * @throws ClientProtocolException | |||||
| * @throws IOException | |||||
| */ | |||||
| public static String sendPostDataByJson(String url, String json, String encoding) throws ClientProtocolException, IOException { | |||||
| String result = ""; | |||||
| // 创建httpclient对象 | |||||
| CloseableHttpClient httpClient = HttpClients.createDefault(); | |||||
| // 创建post方式请求对象 | |||||
| HttpPost httpPost = new HttpPost(url); | |||||
| // 设置参数到请求对象中 | |||||
| StringEntity stringEntity = new StringEntity(json, ContentType.APPLICATION_JSON); | |||||
| stringEntity.setContentEncoding("utf-8"); | |||||
| httpPost.setEntity(stringEntity); | |||||
| // 执行请求操作,并拿到结果(同步阻塞) | |||||
| CloseableHttpResponse response = httpClient.execute(httpPost); | |||||
| // 获取结果实体 | |||||
| // 判断网络连接状态码是否正常(0--200都数正常) | |||||
| if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { | |||||
| result = EntityUtils.toString(response.getEntity(), "utf-8"); | |||||
| } | |||||
| // 释放链接 | |||||
| response.close(); | |||||
| return result; | |||||
| } | |||||
| /** | |||||
| * get请求传输数据 | |||||
| * | |||||
| * @param url | |||||
| * @param encoding | |||||
| * @return | |||||
| * @throws ClientProtocolException | |||||
| * @throws IOException | |||||
| */ | |||||
| public static String sendGetData(String url, String encoding) throws ClientProtocolException, IOException { | |||||
| String result = ""; | |||||
| // 创建httpclient对象 | |||||
| CloseableHttpClient httpClient = HttpClients.createDefault(); | |||||
| // 创建get方式请求对象 | |||||
| HttpGet httpGet = new HttpGet(url); | |||||
| httpGet.addHeader("Content-type", "application/json"); | |||||
| // 通过请求对象获取响应对象 | |||||
| CloseableHttpResponse response = httpClient.execute(httpGet); | |||||
| // 获取结果实体 | |||||
| // 判断网络连接状态码是否正常(0--200都数正常) | |||||
| if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { | |||||
| result = EntityUtils.toString(response.getEntity(), "utf-8"); | |||||
| } | |||||
| // 释放链接 | |||||
| response.close(); | |||||
| return result; | |||||
| } | |||||
| public static String testSendPostDataByMap() throws ClientProtocolException, IOException { | |||||
| String url = "http://192.168.1.101:8700/xdf/elastic/companyInfo/getCompanyInfoByNameAndSocNum"; | |||||
| Map<String, String> map = new HashMap<String, String>(); | |||||
| map.put("companyName", "上海浦宸埃尔医疗科技股份有限公司"); | |||||
| map.put("societyNum", "91310000660712441J"); | |||||
| String body = sendPostDataByMap(url, map, "utf-8"); | |||||
| JSONObject object = JSON.parseObject(body); | |||||
| String companyInfo =JSONArray.parseArray( object.get("data").toString()).get(0).toString(); | |||||
| String regNum = JSONObject.parseObject(companyInfo, CompanyInfoDocument.class).getReg_num(); | |||||
| String companyId = JSONObject.parseObject(companyInfo).get("com_id").toString(); | |||||
| System.out.println("注册号码:" + regNum); | |||||
| return companyId; | |||||
| } | |||||
| public static void testSendPostDataByJson() throws ClientProtocolException, IOException { | |||||
| String url = "http://192.168.1.101:8700/xdf/elastic/companyInfo/getCompanyInfoByNameAndSocNum"; | |||||
| Map<String, String> map = new HashMap<String, String>(); | |||||
| map.put("companyName", "上海浦宸埃尔医疗科技股份有限公司"); | |||||
| map.put("societyNum", "91310000660712441J"); | |||||
| String body = sendPostDataByJson(url, JSON.toJSONString(map), "utf-8"); | |||||
| } | |||||
| public static void testSendGetData(String companyId) throws ClientProtocolException, IOException { | |||||
| String url = "http://xdfdata.com/xdf/company/company/baseInfo/"+companyId; | |||||
| String body = sendGetData(url, "utf-8"); | |||||
| JSONObject object = JSON.parseObject(body); | |||||
| String companyInfo =object.get("data").toString(); | |||||
| String categoryName = JSONObject.parseObject(companyInfo, CompanyBaseInfoVO.class).getCategoryName(); | |||||
| System.out.println("行业名称:" + categoryName); | |||||
| } | |||||
| public static void main(String args[]){ | |||||
| try { | |||||
| String companyId = testSendPostDataByMap(); | |||||
| testSendGetData(companyId); | |||||
| } catch (IOException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| } |
| package com.xdf.creative.util.excel; | |||||
| import java.lang.annotation.ElementType; | |||||
| import java.lang.annotation.Retention; | |||||
| import java.lang.annotation.Target; | |||||
| import static java.lang.annotation.ElementType.TYPE; | |||||
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | |||||
| /** | |||||
| * @author : lgw | |||||
| * @date : 14:25 2020/5/7 | |||||
| */ | |||||
| @Target({TYPE, ElementType.FIELD}) | |||||
| @Retention(RUNTIME) | |||||
| public @interface Description { | |||||
| String showName() default ""; | |||||
| } |
| package com.xdf.creative.util.excel; | |||||
| import com.xdf.creative.util.page.ApiResult; | |||||
| import org.apache.poi.hssf.usermodel.HSSFDateUtil; | |||||
| import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |||||
| import org.apache.poi.ss.usermodel.*; | |||||
| import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |||||
| import org.springframework.web.multipart.MultipartFile; | |||||
| import java.io.IOException; | |||||
| import java.lang.reflect.Field; | |||||
| import java.lang.reflect.Method; | |||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.*; | |||||
| /** | |||||
| * @author : lgw | |||||
| * @date : 14:15 2020/5/7 | |||||
| */ | |||||
| public class ExcelUtil { | |||||
| public static final String XLS = ".xls"; | |||||
| public static final String XLSX = ".xlsx"; | |||||
| private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| public static ApiResult importExcel(MultipartFile file) { | |||||
| try { | |||||
| Workbook workbook = null; | |||||
| String filename = file.getOriginalFilename(); | |||||
| if (filename.endsWith(XLS)) { | |||||
| workbook = new HSSFWorkbook(file.getInputStream()); | |||||
| } else if (filename.endsWith(XLSX)) { | |||||
| workbook = new XSSFWorkbook(file.getInputStream()); | |||||
| } else { | |||||
| return ApiResult.fail("文件读取失败,请确认导入的excel后缀名为xls或者xlsx!"); | |||||
| } | |||||
| Sheet sheet = workbook.getSheetAt(0); | |||||
| //获取sheet的行数 | |||||
| int rows = sheet.getPhysicalNumberOfRows(); | |||||
| for (int i = 0; i < 2; i++) { | |||||
| //过滤表头行 | |||||
| if (i == 0) { | |||||
| continue; | |||||
| } | |||||
| if (i == 1) { | |||||
| Row rowTitle = sheet.getRow(1); | |||||
| if(rowTitle.getLastCellNum()!=9){ | |||||
| return ApiResult.fail("文件上传失败(下载Excel模板格式不能更改)"); | |||||
| } | |||||
| for (int j=0;j<rowTitle.getLastCellNum();j++){ | |||||
| Cell cell = rowTitle.getCell(j); | |||||
| if(j==1){ | |||||
| if(!"企业名称".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:企业名称不能更改"); | |||||
| } | |||||
| } | |||||
| if(j==0){ | |||||
| if(!"园区名称".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:园区名称不能更改"); | |||||
| } | |||||
| } | |||||
| if(j==2){ | |||||
| if(!"企业统一社会信用代码".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:企业统一社会信用代码不能更改"); | |||||
| } | |||||
| } | |||||
| if(j==3){ | |||||
| if(!"企业法人".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:企业法人不能更改"); | |||||
| } | |||||
| } | |||||
| if(j==4){ | |||||
| if(!"注册资本数字".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:注册资本数字不能更改"); | |||||
| } | |||||
| } | |||||
| if(j==5){ | |||||
| if(!"注册资本单位".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:园注册资本单位不能更改"); | |||||
| } | |||||
| }if(j==6){ | |||||
| if(!"所属行业名称".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:所属行业名称不能更改"); | |||||
| } | |||||
| }if(j==7){ | |||||
| if(!"成立日期".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:成立日期不能更改"); | |||||
| } | |||||
| }if(j==8){ | |||||
| if(!"是否为个体户".equals(cell.getStringCellValue())){ | |||||
| return ApiResult.fail("上传错误,列名:是否为个体户不能更改"); | |||||
| } | |||||
| } | |||||
| } | |||||
| return ApiResult.ok(); | |||||
| } | |||||
| } | |||||
| } catch (IOException e) { | |||||
| e.printStackTrace(); | |||||
| return ApiResult.fail("文件读取失败,请确认导入的excel后缀名为xls或者xlsx!"); | |||||
| } | |||||
| return ApiResult.ok(); | |||||
| } | |||||
| public <T> List<T> readExcelFileToDTO(MultipartFile file, Class<T> clazz) throws IOException { | |||||
| return readExcelFileToDTO(file, clazz, 0); | |||||
| } | |||||
| public <T> List<T> readExcelFileToDTO(MultipartFile file, Class<T> clazz, Integer sheetId) throws IOException { | |||||
| //将文件转成workbook类型 | |||||
| Workbook workbook = buildWorkbook(file); | |||||
| //第一个表 | |||||
| return readSheetToDTO(workbook.getSheetAt(sheetId), clazz); | |||||
| } | |||||
| public <T> List<T> readSheetToDTO(Sheet sheet, Class<T> clazz) throws IOException { | |||||
| List<T> result = new ArrayList<>(); | |||||
| List<Map<String, String>> sheetValue = changeSheetToMapList(sheet); | |||||
| for (Map<String, String> valueMap : sheetValue) { | |||||
| T dto = buildDTOByClass(clazz, valueMap); | |||||
| if (dto != null) { | |||||
| result.add(dto); | |||||
| } | |||||
| } | |||||
| return result; | |||||
| } | |||||
| //类型转换 | |||||
| private Workbook buildWorkbook(MultipartFile file) throws IOException { | |||||
| String filename = file.getOriginalFilename(); | |||||
| if (filename.endsWith(XLS)) { | |||||
| return new HSSFWorkbook(file.getInputStream()); | |||||
| } else if (filename.endsWith(XLSX)) { | |||||
| return new XSSFWorkbook(file.getInputStream()); | |||||
| } else { | |||||
| throw new IOException("unknown file format: " + filename); | |||||
| } | |||||
| } | |||||
| private List<Map<String, String>> changeSheetToMapList(Sheet sheet) { | |||||
| List<Map<String, String>> result = new ArrayList<>(); | |||||
| int rowNumber = sheet.getPhysicalNumberOfRows(); | |||||
| String[] titles = getSheetRowValues(sheet.getRow(0)); // 第一行作为表头 | |||||
| for (int i = 1; i < rowNumber; i++) { | |||||
| String[] values = getSheetRowValues(sheet.getRow(i)); | |||||
| Map<String, String> valueMap = new HashMap<>(); | |||||
| for (int j = 0; j < titles.length; j++) { | |||||
| valueMap.put(titles[j], values[j]); | |||||
| } | |||||
| result.add(valueMap); | |||||
| } | |||||
| return result; | |||||
| } | |||||
| private <T> T buildDTOByClass(Class<T> clazz, Map<String, String> valueMap) { | |||||
| try { | |||||
| T dto = clazz.newInstance(); | |||||
| for (Field field : clazz.getDeclaredFields()) { | |||||
| Description desc = field.getAnnotation(Description.class); | |||||
| String value = valueMap.get(desc.showName()); | |||||
| if (value != null) { | |||||
| Method method = clazz.getMethod(getSetMethodName(field.getName()), field.getType()); | |||||
| method.invoke(dto, value); | |||||
| } | |||||
| } | |||||
| return dto; | |||||
| } catch (Exception e) { | |||||
| e.getStackTrace(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private String getSetMethodName(String name) { | |||||
| String firstChar = name.substring(0, 1); | |||||
| return "set" + firstChar.toUpperCase() + name.substring(1); | |||||
| } | |||||
| private String[] getSheetRowValues(Row row) { | |||||
| if (row == null) { | |||||
| return new String[]{}; | |||||
| } else { | |||||
| int cellNumber = row.getLastCellNum(); | |||||
| List<String> cellValueList = new ArrayList<>(); | |||||
| for (int i = 0; i < cellNumber; i++) { | |||||
| cellValueList.add(getValueOnCell(row.getCell(i))); | |||||
| } | |||||
| return cellValueList.toArray(new String[0]); | |||||
| } | |||||
| } | |||||
| private String getValueOnCell(Cell cell) { | |||||
| if (cell == null) { | |||||
| return ""; | |||||
| } | |||||
| switch (cell.getCellTypeEnum()) { | |||||
| case STRING: | |||||
| return cell.getStringCellValue(); | |||||
| case NUMERIC: | |||||
| if (DateUtil.isCellDateFormatted(cell)) { | |||||
| Date date = HSSFDateUtil.getJavaDate(cell.getNumericCellValue()); | |||||
| return sdf.format(date); | |||||
| } else { | |||||
| /* return String.format("%.2f", cell.getNumericCellValue());*/ | |||||
| /**String.valueOf(cell.getNumericCellValue());*/ | |||||
| return String.valueOf(cell.getNumericCellValue()); | |||||
| } | |||||
| case BOOLEAN: | |||||
| return cell.getBooleanCellValue() ? "true" : "false"; | |||||
| case FORMULA: | |||||
| try { | |||||
| return cell.getStringCellValue(); | |||||
| } catch (Exception e) { | |||||
| return String.valueOf(cell.getNumericCellValue()); | |||||
| //String.format("%.2f", cell.getNumericCellValue()); | |||||
| } | |||||
| default: | |||||
| return ""; | |||||
| } | |||||
| } | |||||
| public static void main(String args[]) { | |||||
| } | |||||
| } |
| ############################# 访问路径、端口tomcat start ############################# | ############################# 访问路径、端口tomcat start ############################# | ||||
| auth_skip_urls=\ | auth_skip_urls=\ | ||||
| /wcapi/sysUser/login,\ | |||||
| /wcapi/sysUser/logout,\ | |||||
| /wcapi/infoContent/getHomePageInfo,\ | |||||
| /wcapi/infoContent/getHomePagesInfo,\ | |||||
| /wcapi/infoContent/getSearchWebInfo,\ | |||||
| /wcapi/infoContent/getSearchWebsInfo,\ | |||||
| /wcapi/resource/**,\ | |||||
| /wcapi/infoType/**,\ | |||||
| /wcapi/infoContent/getWebInfoContent,\ | |||||
| /wcapi/error,\ | |||||
| /wcapi/sysPermission/getTreeMenusByUserId,\ | |||||
| /wcapi/sysPermission/currentUserResource,\ | |||||
| /wcapi/parkDataTeam/getWebPageList,\ | |||||
| /wcapi/parkDataTeam/info,\ | |||||
| /wcapi/webParkEnter/apply,\ | |||||
| /wcapi/dtParkActivity/getWebPageList,\ | |||||
| /wcapi/dtParkActivity/getParkActivityInfo,\ | |||||
| /wcapi/auth/code,\ | |||||
| /wcapi/auth/verifyCode | |||||
| /sysUser/login,\ | |||||
| /sysUser/logout,\ | |||||
| /infoContent/getHomePageInfo,\ | |||||
| /infoContent/getHomePagesInfo,\ | |||||
| /infoContent/getSearchWebInfo,\ | |||||
| /infoContent/getSearchWebsInfo,\ | |||||
| /infoContent/getSearchMbInfo,\ | |||||
| /resource/**,\ | |||||
| /infoType/**,\ | |||||
| /infoContent/getWebInfoContent,\ | |||||
| /error,\ | |||||
| /sysPermission/getTreeMenusByUserId,\ | |||||
| /sysPermission/currentUserResource,\ | |||||
| /parkDataTeam/getWebPageList,\ | |||||
| /parkDataTeam/info,\ | |||||
| /webParkEnter/apply,\ | |||||
| /dtParkActivity/getWebPageList,\ | |||||
| /dtParkActivity/getParkActivityInfo,\ | |||||
| /auth/code,\ | |||||
| /auth/verifyCode,\ | |||||
| /v2/api-docs,\ | |||||
| /dtEnterCompany/getHomeList | |||||
| #upload_basePath=/mnt/dfzx/nfs01/dfzx_creative/ | #upload_basePath=/mnt/dfzx/nfs01/dfzx_creative/ | ||||
| upload_basePath=D:/xdf_image/xdf/ | upload_basePath=D:/xdf_image/xdf/ | ||||
| wx_basePath=wx/ | wx_basePath=wx/ | ||||
| #xss攻击拦截 | #xss攻击拦截 | ||||
| xss.enabled=true | xss.enabled=true | ||||
| xss.excludes= | xss.excludes= | ||||
| xss.urlPatterns=/* | |||||
| xss.urlPatterns=/* | |||||
| #es.hostip=172.19.175.248 | |||||
| es.hostip=192.168.1.101 | |||||
| es.port=9200 | |||||
| xdf_company_info_id_url=http://xdfdata.com/xdf/company/company/baseInfo/ | |||||
| xdf_company_info_name_url=http://xdfdata.com/xdf/company/company/baseInfoByName/ | |||||
| xdf_company_es_url=http://xdfdata.com/xdf/elastic/companyInfo/getCompanyInfoByNameAndSocNum |
| <?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.DtEnterCompanyMapper"> | |||||
| <!-- 通用查询结果列 --> | |||||
| <sql id="Base_Column_List"> | |||||
| id, org_park_id, biz_park_id, company_name, serial_number, legal_person_name, reg_capital_no, unit, reg_capital, categ, cate_name, estiblish_time, is_invest, listed_com, is_high_tec_new, is_five_new, exist, company_type, update_time, company_id | |||||
| </sql> | |||||
| <sql id="Base_If_Condition"> | |||||
| <where> | |||||
| <if test="param.id !=null and param.id!=''"> | |||||
| and id=#{param.id} | |||||
| </if> | |||||
| <if test="param.orgParkId !=null and param.orgParkId!=''"> | |||||
| and org_park_id=#{param.orgParkId} | |||||
| </if> | |||||
| <if test="param.bizParkId !=null and param.bizParkId!=''"> | |||||
| and biz_park_id=#{param.bizParkId} | |||||
| </if> | |||||
| <if test="param.companyName !=null and param.companyName!=''"> | |||||
| and company_name=#{param.companyName} | |||||
| </if> | |||||
| <if test="param.serialNumber !=null and param.serialNumber!=''"> | |||||
| and serial_number=#{param.serialNumber} | |||||
| </if> | |||||
| <if test="param.legalPersonName !=null and param.legalPersonName!=''"> | |||||
| and legal_person_name=#{param.legalPersonName} | |||||
| </if> | |||||
| <if test="param.regCapitalNo !=null and param.regCapitalNo!=''"> | |||||
| and reg_capital_no=#{param.regCapitalNo} | |||||
| </if> | |||||
| <if test="param.unit !=null and param.unit!=''"> | |||||
| and unit=#{param.unit} | |||||
| </if> | |||||
| <if test="param.regCapital !=null and param.regCapital!=''"> | |||||
| and reg_capital=#{param.regCapital} | |||||
| </if> | |||||
| <if test="param.categ !=null and param.categ!=''"> | |||||
| and categ=#{param.categ} | |||||
| </if> | |||||
| <if test="param.cateName !=null and param.cateName!=''"> | |||||
| and cate_name=#{param.cateName} | |||||
| </if> | |||||
| <if test="param.estiblishTime !=null and param.estiblishTime!=''"> | |||||
| and estiblish_time=#{param.estiblishTime} | |||||
| </if> | |||||
| <if test="param.isInvest !=null and param.isInvest!=''"> | |||||
| and is_invest=#{param.isInvest} | |||||
| </if> | |||||
| <if test="param.listedCom !=null and param.listedCom!=''"> | |||||
| and listed_com=#{param.listedCom} | |||||
| </if> | |||||
| <if test="param.isHighTecNew !=null and param.isHighTecNew!=''"> | |||||
| and is_high_tec_new=#{param.isHighTecNew} | |||||
| </if> | |||||
| <if test="param.isFiveNew !=null and param.isFiveNew!=''"> | |||||
| and is_five_new=#{param.isFiveNew} | |||||
| </if> | |||||
| <if test="param.exist !=null"> | |||||
| and exist=#{param.exist} | |||||
| </if> | |||||
| <if test="param.companyType !=null"> | |||||
| and company_type=#{param.companyType} | |||||
| </if> | |||||
| <if test="param.updateTime !=null and param.updateTime!=''"> | |||||
| and update_time=#{param.updateTime} | |||||
| </if> | |||||
| <if test="param.companyId !=null and param.companyId!=''"> | |||||
| and company_id=#{param.companyId} | |||||
| </if> | |||||
| </where> | |||||
| </sql> | |||||
| <!--根据ID查询--> | |||||
| <select id="getDtEnterCompanyById" resultType="com.xdf.creative.base.vo.creative.DtEnterCompanyQueryVo"> | |||||
| select | |||||
| <include refid="Base_Column_List"/> | |||||
| from dt_enter_company where id = #{id} | |||||
| </select> | |||||
| <!--后台分页查询--> | |||||
| <select id="getDtEnterCompanyPageList" | |||||
| resultType="com.xdf.creative.base.vo.creative.DtEnterCompanyQueryVo" | |||||
| parameterType="com.xdf.creative.base.params.dt.DtEnterCompanyQueryParam"> | |||||
| select a.id, a.org_park_id, a.biz_park_id, a.company_name, a.serial_number, a.legal_person_name, a.reg_capital_no, a.unit, a.reg_capital, a.categ, a.cate_name, a.estiblish_time, a.is_invest, a.listed_com, a.is_high_tec_new, a.is_five_new, a.exist, a.company_type, a.update_time, a.company_id,b.organize_name | |||||
| from dt_enter_company a left join sys_organize b on a.org_park_id = b.id | |||||
| <where> | |||||
| <if test="param.companyName !=null and param.companyName!=''"> | |||||
| and a.company_name like CONCAT('%',#{param.companyName},'%') | |||||
| </if> | |||||
| <if test="param.parkName !=null and param.parkName!=''"> | |||||
| and b.organize_name like CONCAT('%',#{param.parkName},'%') | |||||
| </if> | |||||
| <if test="param.serialNumber !=null and param.serialNumber!=''"> | |||||
| and a.serial_number like CONCAT('%',#{param.serialNumber},'%') | |||||
| </if> | |||||
| <if test="param.companyType !=null "> | |||||
| and a.company_type=#{param.companyType} | |||||
| </if> | |||||
| <if test="param.exist !=null "> | |||||
| and a.exist=#{param.exist} | |||||
| </if> | |||||
| <if test="param.startUpdateTime !=null and param.endUpdateTime !=null "> | |||||
| and a.update_time >= #{param.startUpdateTime} and a.update_time <=#{param.endUpdateTime} | |||||
| </if> | |||||
| </where> | |||||
| order by a.update_time desc | |||||
| </select> | |||||
| <select id="getDtEnterCompanyUserList" | |||||
| resultType="com.xdf.creative.base.vo.creative.DtEnterCompanyQueryVo" | |||||
| parameterType="com.xdf.creative.base.params.dt.DtEnterCompanyQueryParam"> | |||||
| select b.organize_name,a.org_park_id,a.biz_park_id,a.company_name,a.serial_number,a.cate_name, | |||||
| a.legal_person_name,a.reg_capital,a.estiblish_time,a.company_type,a.update_time,a.company_id | |||||
| from dt_enter_company a left join sys_organize b on a.org_park_id = b.id | |||||
| <where> | |||||
| <if test="param.orgParkId !=null and param.orgParkId!=''"> | |||||
| and a.org_park_id=#{param.orgParkId} | |||||
| </if> | |||||
| <if test="param.companyName !=null and param.companyName!=''"> | |||||
| and a.company_name like CONCAT('%',#{param.companyName},'%') | |||||
| </if> | |||||
| <if test="param.serialNumber !=null and param.serialNumber!=''"> | |||||
| and a.serial_number like CONCAT('%',#{param.serialNumber},'%') | |||||
| </if> | |||||
| order by a.sort desc | |||||
| </where> | |||||
| </select> | |||||
| <select id="getDtEnterCompanyHomeList" | |||||
| resultType="com.xdf.creative.base.vo.creative.DtEnterCompanyQueryVo" | |||||
| parameterType="com.xdf.creative.base.params.dt.DtEnterCompanyQueryParam"> | |||||
| select a.org_park_id,a.biz_park_id,a.company_name,a.serial_number,a.cate_name, | |||||
| a.legal_person_name,a.reg_capital,a.estiblish_time,a.is_invest, a.listed_com, | |||||
| a.is_high_tec_new, a.is_five_new, a.exist, a.company_type, a.update_time, a.company_id,a.reg_capital_no,a.unit | |||||
| from dt_enter_company a | |||||
| <where> | |||||
| <if test="param.orgParkId !=null and param.orgParkId!=''"> | |||||
| and a.org_park_id=#{param.orgParkId} | |||||
| </if> | |||||
| </where> | |||||
| order by a.sort desc | |||||
| </select> | |||||
| <!-- --> | |||||
| </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.DtUploadCompanyMapper"> | |||||
| <!-- 通用查询结果列 --> | |||||
| <sql id="Base_Column_List"> | |||||
| id, org_park_id, biz_park_id, company_name, serial_number, legal_person_name, reg_capital_no, unit, reg_capital, cate_name, estiblish_time, company_type, update_time, create_time, state, dispose_state | |||||
| </sql> | |||||
| <sql id="Base_If_Condition"> | |||||
| <where> | |||||
| <if test="param.id !=null and param.id!=''"> | |||||
| and id=#{param.id} | |||||
| </if> | |||||
| <if test="param.orgParkId !=null and param.orgParkId!=''"> | |||||
| and org_park_id=#{param.orgParkId} | |||||
| </if> | |||||
| <if test="param.bizParkId !=null and param.bizParkId!=''"> | |||||
| and biz_park_id=#{param.bizParkId} | |||||
| </if> | |||||
| <if test="param.companyName !=null and param.companyName!=''"> | |||||
| and company_name=#{param.companyName} | |||||
| </if> | |||||
| <if test="param.serialNumber !=null and param.serialNumber!=''"> | |||||
| and serial_number=#{param.serialNumber} | |||||
| </if> | |||||
| <if test="param.legalPersonName !=null and param.legalPersonName!=''"> | |||||
| and legal_person_name=#{param.legalPersonName} | |||||
| </if> | |||||
| <if test="param.regCapitalNo !=null and param.regCapitalNo!=''"> | |||||
| and reg_capital_no=#{param.regCapitalNo} | |||||
| </if> | |||||
| <if test="param.unit !=null and param.unit!=''"> | |||||
| and unit=#{param.unit} | |||||
| </if> | |||||
| <if test="param.regCapital !=null and param.regCapital!=''"> | |||||
| and reg_capital=#{param.regCapital} | |||||
| </if> | |||||
| <if test="param.cateName !=null and param.cateName!=''"> | |||||
| and cate_name=#{param.cateName} | |||||
| </if> | |||||
| <if test="param.estiblishTime !=null and param.estiblishTime!=''"> | |||||
| and estiblish_time=#{param.estiblishTime} | |||||
| </if> | |||||
| <if test="param.companyType !=null and param.companyType!=''"> | |||||
| and company_type=#{param.companyType} | |||||
| </if> | |||||
| <if test="param.updateTime !=null and param.updateTime!=''"> | |||||
| and update_time=#{param.updateTime} | |||||
| </if> | |||||
| <if test="param.createTime !=null and param.createTime!=''"> | |||||
| and create_time=#{param.createTime} | |||||
| </if> | |||||
| <if test="param.state !=null and param.state!=''"> | |||||
| and state=#{param.state} | |||||
| </if> | |||||
| <if test="param.disposeState !=null and param.disposeState!=''"> | |||||
| and dispose_state=#{param.disposeState} | |||||
| </if> | |||||
| </where> | |||||
| </sql> | |||||
| <!--根据ID查询--> | |||||
| <select id="getDtUploadCompanyById" resultType="com.xdf.creative.base.vo.dt.DtUploadCompanyQueryVo"> | |||||
| select | |||||
| <include refid="Base_Column_List"/> | |||||
| from dt_upload_company where id = #{id} | |||||
| </select> | |||||
| <!--分页查询--> | |||||
| <select id="getDtUploadCompanyPageList" | |||||
| resultType="com.xdf.creative.base.vo.dt.DtUploadCompanyQueryVo" | |||||
| parameterType="com.xdf.creative.base.params.dt.DtUploadCompanyQueryParam"> | |||||
| select | |||||
| a.*,b.organize_name | |||||
| from dt_upload_company a left join sys_organize b on a.org_park_id = b.id | |||||
| <where> | |||||
| <if test="param.companyName !=null and param.companyName!=''"> | |||||
| and a.company_name like CONCAT('%',#{param.companyName},'%') | |||||
| </if> | |||||
| <if test="param.parkName !=null and param.parkName!=''"> | |||||
| and b.organize_name like CONCAT('%',#{param.parkName},'%') | |||||
| </if> | |||||
| <if test="param.serialNumber !=null and param.serialNumber!=''"> | |||||
| and a.serial_number like CONCAT('%',#{param.serialNumber},'%') | |||||
| </if> | |||||
| <if test="param.companyType !=null and param.companyType!=''"> | |||||
| and a.company_type=#{param.companyType} | |||||
| </if> | |||||
| <if test="param.startCreateTime !=null and param.endCreateTime !=null "> | |||||
| and a.create_time >= #{param.startCreateTime} and a.create_time <=#{param.endCreateTime} | |||||
| </if> | |||||
| <if test="param.startUpdateTime !=null and param.endUpdateTime !=null "> | |||||
| and a.update_time >= #{param.startUpdateTime} and a.update_time <=#{param.endUpdateTime} | |||||
| </if> | |||||
| <if test="param.state !=null and param.state!=''"> | |||||
| and a.state=#{param.state} | |||||
| </if> | |||||
| <if test="param.disposeState !=null and param.disposeState!=''"> | |||||
| and a.dispose_state=#{param.disposeState} | |||||
| </if> | |||||
| </where> | |||||
| order by a.create_time desc,a.update_time desc | |||||
| </select> | |||||
| </mapper> |
| </select> | </select> | ||||
| <!--手机端首页搜索新闻--> | |||||
| <select id="getSearchMbInfo" | |||||
| resultType="com.xdf.creative.base.vo.creative.InfoContentWebSearchMbQueryVo" | |||||
| parameterType="com.xdf.creative.base.params.creative.InfoContentWebSearchQueryParam"> | |||||
| select a.id,a.title,a.final_audit_time,a.sort,a.istop,c.hyperlink,a.source_url,a.image_url,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> | |||||
| order by a.istop DESC,a.istop_time DESC,a.order_audit_time DESC,a.sort | |||||
| DESC,a.final_audit_time DESC | |||||
| </select> | |||||
| <!--根据ID查询--> | <!--根据ID查询--> | ||||
| <select id="getInfoContentById" resultType="com.xdf.creative.base.vo.creative.InfoContentQueryVo"> | <select id="getInfoContentById" resultType="com.xdf.creative.base.vo.creative.InfoContentQueryVo"> | ||||
| select | select |