</exclusions> | </exclusions> | ||||
</dependency> | </dependency> | ||||
<!-- kaptcha验证码 --> | |||||
<dependency> | |||||
<groupId>com.github.penggle</groupId> | |||||
<artifactId>kaptcha</artifactId> | |||||
<version>2.3.2</version> | |||||
</dependency> | |||||
</dependencies> | </dependencies> | ||||
import org.springframework.boot.web.servlet.ServletComponentScan; | import org.springframework.boot.web.servlet.ServletComponentScan; | ||||
import org.springframework.context.annotation.Bean; | import org.springframework.context.annotation.Bean; | ||||
import org.springframework.context.annotation.ComponentScan; | import org.springframework.context.annotation.ComponentScan; | ||||
import org.springframework.context.annotation.ImportResource; | |||||
import org.springframework.scheduling.annotation.EnableScheduling; | import org.springframework.scheduling.annotation.EnableScheduling; | ||||
import org.springframework.transaction.annotation.EnableTransactionManagement; | import org.springframework.transaction.annotation.EnableTransactionManagement; | ||||
import org.springframework.web.context.request.RequestContextListener; | import org.springframework.web.context.request.RequestContextListener; | ||||
@EnableTransactionManagement | @EnableTransactionManagement | ||||
@SpringBootApplication | @SpringBootApplication | ||||
@ServletComponentScan | @ServletComponentScan | ||||
@EnableScheduling | |||||
//@EnableScheduling | |||||
@ImportResource(locations = {"classpath:kaptcha.xml"}) | |||||
public class CreativeApplication { | public class CreativeApplication { | ||||
public static void main(String[] args) { | public static void main(String[] args) { |
package com.xdf.creative.base.params; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 11:27 2020/4/11 | |||||
*/ | |||||
import lombok.Data; | |||||
/** | |||||
* 验证码类 | |||||
*/ | |||||
@Data | |||||
public class VerifyCode { | |||||
private String code; | |||||
private byte[] imgBytes; | |||||
private long expireTime; | |||||
} |
@ApiModelProperty(value = "内容类型 0、图文形式 1 、超链接形式") | @ApiModelProperty(value = "内容类型 0、图文形式 1 、超链接形式") | ||||
private Integer contentType; | private Integer contentType; | ||||
@ApiModelProperty(value = "内容状态 0 、草稿 1、待初审 2、待终审 3 终审通过 4、初审退回 5、终审退回 6 初审不通过 7终审不通过") | |||||
private Integer state; | |||||
// | |||||
// @ApiModelProperty(value = "内容状态 0 、草稿 1、待初审 2、待终审 3 终审通过 4、初审退回 5、终审退回 6 初审不通过 7终审不通过") | |||||
// private Integer state; | |||||
@ApiModelProperty(value = "图片地址") | @ApiModelProperty(value = "图片地址") | ||||
private String imageUrl; | private String imageUrl; |
package com.xdf.creative.base.params.creative; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.xdf.creative.base.params.QueryParam; | |||||
import com.xdf.creative.module.entity.InfoAttachment; | |||||
import com.xdf.creative.module.entity.InfoDetail; | |||||
import com.xdf.creative.module.entity.InfoUrl; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 信息内容 查询参数对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-03-09 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "InfoContentQueryParam对象", description = "信息内容查询参数") | |||||
public class InfoContentEditQueryParam extends QueryParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty(value = "标题") | |||||
private String title; | |||||
@ApiModelProperty(value = "栏目类型id") | |||||
private Long infoTypeId; | |||||
@ApiModelProperty(value = "内容类型 0、图文形式 1 、超链接形式") | |||||
private Integer contentType; | |||||
@ApiModelProperty(value = "图片地址") | |||||
private String imageUrl; | |||||
@ApiModelProperty(value = "来源地址") | |||||
private String sourceUrl; | |||||
@ApiModelProperty(value = "作者") | |||||
private String author; | |||||
/** | |||||
* 信息详情 | |||||
*/ | |||||
private InfoDetail infoDetail; | |||||
/** | |||||
* 附件列表 | |||||
*/ | |||||
private List<InfoAttachment> attachmentList; | |||||
/** | |||||
* url列表 | |||||
*/ | |||||
private List<InfoUrl> urlList; | |||||
} |
package com.xdf.creative.base.params.creative; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 信息内容 查询参数对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-03-09 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@ApiModel(value = "InfoContentQueryParam对象", description = "信息内容查询参数") | |||||
public class InfoContentHomePageListParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "栏目id") | |||||
private List<String> typeIds; | |||||
@ApiModelProperty(value = "内容大小") | |||||
@NotNull(message = "请选择显示条数") | |||||
private Integer contentSize; | |||||
} |
package com.xdf.creative.base.params.creative; | |||||
import com.xdf.creative.base.params.QueryParam; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import java.util.List; | |||||
/** | |||||
* <p> | |||||
* 信息内容 查询参数对象 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @date 2020-03-09 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "InfoContentQueryParam对象", description = "信息内容查询参数") | |||||
public class InfoContentWebSearchListParam extends QueryParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "栏目id") | |||||
private List<String> typeIds; | |||||
@ApiModelProperty(value = "栏目id") | |||||
private String typeId; | |||||
@ApiModelProperty(value = "标题") | |||||
// @NotBlank(message = "搜索内容不能为空!") | |||||
private String title; | |||||
} |
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-04-20 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "DtParkCompanyQueryParam对象", description = "园区企业申诉文件查询参数") | |||||
public class DtParkCompanyQueryParam extends QueryParam { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
@ApiModelProperty(value = "文件类型") | |||||
private String fileType; | |||||
@ApiModelProperty(value = "状态 0 不可用 1可用") | |||||
private Integer state; | |||||
private String organizeName; | |||||
private String nickName; | |||||
private String userName; | |||||
} |
@ApiModelProperty(value = "完整地址") | @ApiModelProperty(value = "完整地址") | ||||
private String newAddress; | private String newAddress; | ||||
@ApiModelProperty(value = "政策") | |||||
private String policy; | |||||
@ApiModelProperty(value = "服务") | |||||
private String serve; | |||||
@ApiModelProperty(value = "简介") | |||||
private String intro; | |||||
private String logo; | |||||
private String qr; | |||||
@ApiModelProperty(value = "补充地址") | |||||
private String addressAp; | |||||
} | } |
@ApiModelProperty(value = "结束创建时间") | @ApiModelProperty(value = "结束创建时间") | ||||
private Date endCreateTime; | private Date endCreateTime; | ||||
private String regionId; | |||||
} | } |
*/ | */ | ||||
public interface BaseService<T> extends IService<T> { | public interface BaseService<T> extends IService<T> { | ||||
Long getUserId(); | |||||
Long getUserId() ; | |||||
Long getOrganizeId(); | Long getOrganizeId(); | ||||
private Date createTime; | private Date createTime; | ||||
} | } |
@ApiModelProperty(value = "修改时间") | @ApiModelProperty(value = "修改时间") | ||||
private Date updateTime; | private Date updateTime; | ||||
private Integer level; | |||||
} | } |
@ApiModelProperty(value = "创建人id") | @ApiModelProperty(value = "创建人id") | ||||
private Long createUserId; | private Long createUserId; | ||||
@ApiModelProperty(value = "操作类型 0:初始 1:增加 2:修改 3:删除") | |||||
private Integer operateType; | |||||
private String userName; | private String userName; | ||||
private String organizeName; | private String organizeName; |
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-04-20 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@ApiModel(value = "DtParkCompanyQueryVo对象", description = "园区企业申诉文件查询参数") | |||||
public class DtParkCompanyQueryVo implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "主键id") | |||||
private Long id; | |||||
@ApiModelProperty(value = "上传企业id") | |||||
private Long organizeId; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
@ApiModelProperty(value = "上传用户id1") | |||||
private Long createUserId; | |||||
@ApiModelProperty(value = "文件地址") | |||||
private String path; | |||||
@ApiModelProperty(value = "文件类型") | |||||
private String fileType; | |||||
@ApiModelProperty(value = "状态 0 不可用 1可用") | |||||
private Integer state; | |||||
private String organizeName; | |||||
private String nickName; | |||||
private String userName; | |||||
} |
private Integer enterStatus; | private Integer enterStatus; | ||||
@ApiModelProperty(value = "简介") | |||||
private String intro; | |||||
@ApiModelProperty(value = "政策") | |||||
private String policy; | |||||
@ApiModelProperty(value = "服务") | |||||
private String serve; | |||||
@ApiModelProperty(value = "完整地址") | @ApiModelProperty(value = "完整地址") | ||||
private String newAddress; | private String newAddress; | ||||
private Long dateParkId; | private Long dateParkId; | ||||
private String logo; | |||||
@ApiModelProperty(value = "二维码") | |||||
private String qr; | |||||
private String addressAp; | |||||
} | } |
@ApiModelProperty(value = "状态:1正常 0待审核 -1已删除") | @ApiModelProperty(value = "状态:1正常 0待审核 -1已删除") | ||||
private Integer status; | private Integer status; | ||||
@ApiModelProperty(value = "政策") | |||||
private String policy; | |||||
@ApiModelProperty(value = "服务") | |||||
private String serve; | |||||
@ApiModelProperty(value = "简介") | |||||
private String intro; | |||||
@ApiModelProperty(value = "添加时间") | @ApiModelProperty(value = "添加时间") | ||||
private Date createTime; | private Date createTime; | ||||
@ApiModelProperty(value = "组织机构ID") | @ApiModelProperty(value = "组织机构ID") | ||||
private Long dateParkId; | private Long dateParkId; | ||||
private String logo; | |||||
@ApiModelProperty(value = "二维码") | |||||
private String qr; | |||||
@ApiModelProperty(value = "补充地址") | |||||
private String addressAp; | |||||
} | } |
private Long organizeId; | private Long organizeId; | ||||
@ApiModelProperty(value = "政策") | |||||
private String policy; | |||||
@ApiModelProperty(value = "服务") | |||||
private String serve; | |||||
private String logo; | |||||
private String qr; | |||||
private String addressAp; | |||||
private Integer parkType; | |||||
} | } |
private Integer enterStatus; | private Integer enterStatus; | ||||
@ApiModelProperty(value = "政策") | |||||
private String policy; | |||||
@ApiModelProperty(value = "服务") | |||||
private String serve; | |||||
private String logo; | |||||
@ApiModelProperty(value = "简介") | |||||
private String intro; | |||||
private Long organizeId; | |||||
private String qr; | |||||
private String addressAp; | |||||
private Integer parkType; | |||||
} | } |
httpResponse.setHeader("Access-Control-Allow-Origin", httpRequest.getHeader("Origin")); | httpResponse.setHeader("Access-Control-Allow-Origin", httpRequest.getHeader("Origin")); | ||||
httpResponse.setHeader("Access-Control-Allow-Methods", httpRequest.getMethod()); | httpResponse.setHeader("Access-Control-Allow-Methods", httpRequest.getMethod()); | ||||
httpResponse.setHeader("Access-Control-Max-Age", "3600"); | httpResponse.setHeader("Access-Control-Max-Age", "3600"); | ||||
httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); | |||||
httpResponse.setHeader("Access-Control-Allow-Headers", httpRequest.getHeader("Access-Control-Request-Headers")); | httpResponse.setHeader("Access-Control-Allow-Headers", httpRequest.getHeader("Access-Control-Request-Headers")); | ||||
XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( | XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( | ||||
(HttpServletRequest) request); | (HttpServletRequest) request); |
import java.io.IOException; | import java.io.IOException; | ||||
import com.auth0.jwt.exceptions.JWTDecodeException; | |||||
import com.xdf.creative.enums.ApiCode; | import com.xdf.creative.enums.ApiCode; | ||||
import com.xdf.creative.enums.StatusCode; | |||||
import com.xdf.creative.support.exception.SysLoginException; | import com.xdf.creative.support.exception.SysLoginException; | ||||
import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import org.springframework.web.bind.annotation.ExceptionHandler; | import org.springframework.web.bind.annotation.ExceptionHandler; | ||||
return ApiResult.fail("最大上传文件为5M,上传文件大小超出限制!"); | return ApiResult.fail("最大上传文件为5M,上传文件大小超出限制!"); | ||||
} | } | ||||
@ExceptionHandler(JWTDecodeException.class) | |||||
public ApiResult jWTDecodeException(JWTDecodeException e) throws IOException { | |||||
return ApiResult.fail(ApiCode.TOKEN_INVALID); | |||||
} | |||||
} | } |
import java.util.Date; | import java.util.Date; | ||||
@Slf4j | @Slf4j | ||||
@Getter | |||||
/*@Getter | |||||
@Setter | @Setter | ||||
@Configuration | |||||
@Configuration*/ | |||||
public class CustomScheduled implements SchedulingConfigurer { | public class CustomScheduled implements SchedulingConfigurer { | ||||
private String cron = "0 0 0 */1 * ?"; | private String cron = "0 0 0 */1 * ?"; | ||||
return new Runnable() { | return new Runnable() { | ||||
@Override | @Override | ||||
public void run() { | public void run() { | ||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | |||||
/* SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | |||||
Date date = new Date(); | Date date = new Date(); | ||||
Calendar calendar = Calendar.getInstance();//new一个Calendar类,把Date放进去 | Calendar calendar = Calendar.getInstance();//new一个Calendar类,把Date放进去 | ||||
calendar.setTime(date); | calendar.setTime(date); | ||||
System.out.println(); | System.out.println(); | ||||
} | } | ||||
} | } | ||||
log.error("后缀文件为"+indexFileName+"删除"); | |||||
log.error("后缀文件为"+indexFileName+"删除");*/ | |||||
} | } | ||||
}; | }; | ||||
} | } |
package com.xdf.creative.config; | |||||
import org.springframework.context.annotation.Bean; | |||||
import org.springframework.context.annotation.Configuration; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 12:21 2020/4/11 | |||||
*/ | |||||
/* | |||||
@Configuration | |||||
public class SpringSessionConfig { | |||||
public SpringSessionConfig() { | |||||
} | |||||
@Bean | |||||
public CookieSerializer httpSessionIdResolver() { | |||||
DefaultCookieSerializer cookieSerializer = new DefaultCookieSerializer(); | |||||
// 取消仅限同一站点设置 | |||||
cookieSerializer.setSameSite(null); | |||||
return cookieSerializer; | |||||
} | |||||
} | |||||
*/ |
//专项资金 | //专项资金 | ||||
SERVICE_FILE_DIR_SUPPORT(110, "support"), | SERVICE_FILE_DIR_SUPPORT(110, "support"), | ||||
SERVICE_PARK_FILE_DIR_OTHER(776, "parkFile"), | |||||
SERVICE_PARK_LOGO_DIR_OTHER(777, "parkLogo"), | |||||
SERVICE_PARK_QR_DIR_OTHER(778, "parkQr"), | |||||
SERVICE_PARK_ACTIVITY_DIR_OTHER(888, "parkActivity"), | SERVICE_PARK_ACTIVITY_DIR_OTHER(888, "parkActivity"), | ||||
//其他 | //其他 | ||||
SERVICE_FILE_DIR_OTHER(999, "other"); | SERVICE_FILE_DIR_OTHER(999, "other"); | ||||
private Integer code; | private Integer code; | ||||
private String name; | private String name; | ||||
package com.xdf.creative.module.controller; | |||||
import com.google.code.kaptcha.Constants; | |||||
import com.google.code.kaptcha.Producer; | |||||
import com.xdf.creative.base.params.VerifyCode; | |||||
import com.xdf.creative.module.service.IVerifyCodeGen; | |||||
import com.xdf.creative.module.service.impl.SimpleCharVerifyCodeGenImpl; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.slf4j.Logger; | |||||
import org.slf4j.LoggerFactory; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.imageio.ImageIO; | |||||
import javax.servlet.ServletOutputStream; | |||||
import javax.servlet.http.HttpServletRequest; | |||||
import javax.servlet.http.HttpServletResponse; | |||||
import javax.servlet.http.HttpSession; | |||||
import java.awt.image.BufferedImage; | |||||
import java.io.IOException; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 11:00 2020/4/11 | |||||
*/ | |||||
@Slf4j | |||||
@RestController | |||||
@RequestMapping("/auth") | |||||
@Api("验证吗 API") | |||||
public class CodeController { | |||||
@Autowired | |||||
private Producer captchaProducer = null; | |||||
private Logger logger = LoggerFactory.getLogger(CodeController.class); | |||||
/* @RequestMapping("/code") | |||||
public void getKaptchaImage(HttpServletRequest request, HttpServletResponse response) throws Exception { | |||||
HttpSession session = request.getSession(); | |||||
response.setDateHeader("Expires", 0); | |||||
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); | |||||
response.addHeader("Cache-Control", "post-check=0, pre-check=0"); | |||||
response.setHeader("Pragma", "no-cache"); | |||||
response.setContentType("image/jpeg"); | |||||
//生成验证码 | |||||
String capText = captchaProducer.createText(); | |||||
session.setAttribute(Constants.KAPTCHA_SESSION_KEY, capText); | |||||
//向客户端写出 | |||||
BufferedImage bi = captchaProducer.createImage(capText); | |||||
ServletOutputStream out = response.getOutputStream(); | |||||
ImageIO.write(bi, "jpg", out); | |||||
try { | |||||
out.flush(); | |||||
} finally { | |||||
out.close(); | |||||
} | |||||
}*/ | |||||
@ApiOperation(value = "验证码") | |||||
@RequestMapping("/code") | |||||
public void verifyCode(HttpServletRequest request, HttpServletResponse response) { | |||||
IVerifyCodeGen iVerifyCodeGen = new SimpleCharVerifyCodeGenImpl(); | |||||
try { | |||||
//设置长宽 | |||||
VerifyCode verifyCode = iVerifyCodeGen.generate(100, 50); | |||||
String code = verifyCode.getCode(); | |||||
logger.info(code); | |||||
//将VerifyCode绑定session | |||||
request.getSession().setAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY, code); | |||||
//设置响应头 | |||||
response.setHeader("Pragma", "no-cache"); | |||||
//设置响应头 | |||||
response.setHeader("Cache-Control", "no-cache"); | |||||
//在代理服务器端防止缓冲 | |||||
response.setDateHeader("Expires", 0); | |||||
//设置响应内容类型 | |||||
response.setContentType("image/jpeg"); | |||||
response.getOutputStream().write(verifyCode.getImgBytes()); | |||||
response.getOutputStream().flush(); | |||||
} catch (IOException e) { | |||||
logger.info("", e); | |||||
} | |||||
} | |||||
} |
import com.xdf.creative.base.vo.dt.DtInfoAuditQueryVo; | import com.xdf.creative.base.vo.dt.DtInfoAuditQueryVo; | ||||
import com.xdf.creative.module.entity.DtInfoAudit; | import com.xdf.creative.module.entity.DtInfoAudit; | ||||
import com.xdf.creative.module.service.DtInfoAuditService; | import com.xdf.creative.module.service.DtInfoAuditService; | ||||
import com.xdf.creative.support.aop.OperateLogger; | |||||
import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
*/ | */ | ||||
@PostMapping("/auditInfo") | @PostMapping("/auditInfo") | ||||
@ApiOperation(value = "修改DtInfoAudit对象", notes = "审核基本信息", response = ApiResult.class) | @ApiOperation(value = "修改DtInfoAudit对象", notes = "审核基本信息", response = ApiResult.class) | ||||
@OperateLogger(name = "审核自主信息",attributeId="id",attributeName="organizeId") | |||||
public ApiResult auditInfo(@Valid @RequestBody DtInfoAuditQueryAuiditParam dtInfoAuditQueryAuiditParam) throws Exception { | public ApiResult auditInfo(@Valid @RequestBody DtInfoAuditQueryAuiditParam dtInfoAuditQueryAuiditParam) throws Exception { | ||||
return dtInfoAuditService.auditInfo(dtInfoAuditQueryAuiditParam); | return dtInfoAuditService.auditInfo(dtInfoAuditQueryAuiditParam); | ||||
} | } |
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.DtParkCompanyQueryParam; | |||||
import com.xdf.creative.base.vo.dt.DtParkCompanyQueryVo; | |||||
import com.xdf.creative.module.entity.DtParkCompany; | |||||
import com.xdf.creative.module.service.DtParkCompanyService; | |||||
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-04-20 | |||||
*/ | |||||
@Slf4j | |||||
@RestController | |||||
@RequestMapping("/dtParkCompany") | |||||
@Api("园区企业申诉文件 API") | |||||
public class DtParkCompanyController extends BaseController { | |||||
@Autowired | |||||
private DtParkCompanyService dtParkCompanyService; | |||||
/** | |||||
* 添加园区企业申诉文件 | |||||
*/ | |||||
@PostMapping("/add") | |||||
@ApiOperation(value = "添加DtParkCompany对象", notes = "添加园区企业申诉文件", response = ApiResult.class) | |||||
public ApiResult add(@Valid @RequestBody DtParkCompany dtParkCompany) throws Exception { | |||||
return dtParkCompanyService.add(dtParkCompany); | |||||
} | |||||
/** | |||||
* 修改园区企业申诉文件 | |||||
*/ | |||||
@PostMapping("/update") | |||||
@ApiOperation(value = "修改DtParkCompany对象", notes = "修改园区企业申诉文件", response = ApiResult.class) | |||||
public ApiResult<Boolean> updateDtParkCompany(@Valid @RequestBody DtParkCompany dtParkCompany) throws Exception { | |||||
boolean flag = dtParkCompanyService.updateById(dtParkCompany); | |||||
return ApiResult.result(flag); | |||||
} | |||||
/** | |||||
* 删除园区企业申诉文件 | |||||
*/ | |||||
@PostMapping("/delete") | |||||
@ApiOperation(value = "删除DtParkCompany对象", notes = "删除园区企业申诉文件", response = ApiResult.class) | |||||
public ApiResult<Boolean> deleteDtParkCompany(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
boolean flag = dtParkCompanyService.removeById(idParam.getId()); | |||||
return ApiResult.result(flag); | |||||
} | |||||
/** | |||||
* 获取园区企业申诉文件 | |||||
*/ | |||||
@PostMapping("/info") | |||||
@ApiOperation(value = "获取DtParkCompany对象详情", notes = "查看园区企业申诉文件", response = DtParkCompanyQueryVo.class) | |||||
public ApiResult<DtParkCompanyQueryVo> getDtParkCompany(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
DtParkCompanyQueryVo dtParkCompanyQueryVo = dtParkCompanyService.getDtParkCompanyById(idParam.getId()); | |||||
return ApiResult.ok(dtParkCompanyQueryVo); | |||||
} | |||||
/** | |||||
* 园区企业申诉文件分页列表 | |||||
*/ | |||||
@PostMapping("/getPageList") | |||||
@ApiOperation(value = "获取DtParkCompany分页列表", notes = "园区企业申诉文件分页列表", response = DtParkCompanyQueryVo.class) | |||||
public ApiResult<PageTool<DtParkCompanyQueryVo>> getDtParkCompanyPageList(@Valid @RequestBody DtParkCompanyQueryParam dtParkCompanyQueryParam) throws Exception { | |||||
PageTool<DtParkCompanyQueryVo> pageList = dtParkCompanyService.getDtParkCompanyPageList(dtParkCompanyQueryParam); | |||||
return ApiResult.ok(pageList); | |||||
} | |||||
} | |||||
import com.xdf.creative.enums.StatusCode; | import com.xdf.creative.enums.StatusCode; | ||||
import com.xdf.creative.module.entity.FileUploadQuery; | import com.xdf.creative.module.entity.FileUploadQuery; | ||||
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.UUIDUtil; | import com.xdf.creative.util.UUIDUtil; | ||||
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.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
} | } | ||||
} | } | ||||
@RequestMapping(value = "/getFileByte") | |||||
public ApiResult getFileByte(@RequestBody FileUploadQuery fileUploadQuery) { | |||||
try { | |||||
String uploadPath = fileUploadQuery.getUploadPath(); | |||||
if(StringUtil.isEmpty(uploadPath)){ | |||||
return ApiResult.fail("图片地址不能为空!"); | |||||
} | |||||
String encode = FileToBase64.encodeBase64File(basePath+uploadPath); | |||||
return ApiResult.ok(encode); | |||||
} catch (Exception e) { | |||||
return ApiResult.fail("文件读取失败!"); | |||||
} | |||||
} | |||||
/** | /** | ||||
* 获取随机ID | * 获取随机ID | ||||
*/ | */ |
} | } | ||||
@PostMapping("/editInfoManage") | |||||
@ApiOperation(value = "修改InfoContent对象", notes = "修改信息内容", response = ApiResult.class) | |||||
@OperateLogger(name = "管理员修改内容", attributeId = "id", attributeName = "title") | |||||
public ApiResult editInfoManage(@Valid @RequestBody InfoContentEditQueryParam infoContentEditQueryParam) throws Exception { | |||||
return infoContentService.editInfoManage(infoContentEditQueryParam); | |||||
} | |||||
/** | /** | ||||
* 管理员初审信息 | * 管理员初审信息 | ||||
* | * | ||||
return infoContentService.getHomePageInfo(infoContentHomePageQueryParam); | return infoContentService.getHomePageInfo(infoContentHomePageQueryParam); | ||||
} | } | ||||
/** | |||||
* 首页查询信息 | |||||
*/ | |||||
@PostMapping("/getHomePagesInfo") | |||||
@ApiOperation(value = "显示InfoContent对象", notes = "首页查询信息", response = ApiResult.class) | |||||
public ApiResult getHomePagesInfo(@Valid @RequestBody InfoContentHomePageListParam infoContentHomePageListParam) throws Exception { | |||||
return infoContentService.getHomePagesInfo(infoContentHomePageListParam); | |||||
} | |||||
/** | /** | ||||
* 首页搜索信息 | * 首页搜索信息 | ||||
*/ | */ | ||||
return ApiResult.ok(pageList); | return ApiResult.ok(pageList); | ||||
} | } | ||||
@PostMapping("/getSearchWebsInfo") | |||||
@ApiOperation(value = "获取InfoContentWeb分页列表", notes = "信息内容分页列表", response = InfoContentWebSearchQueryVo.class) | |||||
public ApiResult<PageTool<InfoContentWebSearchQueryVo>> getSearchWebsInfo(@Valid @RequestBody InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception { | |||||
PageTool<InfoContentWebSearchQueryVo> pageList = infoContentService.getSearchWebsInfo(infoContentWebSearchListParam); | |||||
return ApiResult.ok(pageList); | |||||
} | |||||
/** | /** | ||||
* 后台发布列表 | * 后台发布列表 | ||||
*/ | */ |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
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.SysOrganizeAddParam; | |||||
import com.xdf.creative.base.params.creative.SysOrganizeBackParam; | |||||
import com.xdf.creative.base.params.creative.SysOrganizeEditParam; | |||||
import com.xdf.creative.base.params.creative.SysOrganizeQueryParam; | |||||
import com.xdf.creative.base.params.creative.*; | |||||
import com.xdf.creative.base.vo.creative.SysOrganizeBackVo; | import com.xdf.creative.base.vo.creative.SysOrganizeBackVo; | ||||
import com.xdf.creative.base.vo.creative.SysOrganizeQueryVo; | import com.xdf.creative.base.vo.creative.SysOrganizeQueryVo; | ||||
import com.xdf.creative.base.vo.creative.SysOrganizeTreeVo; | import com.xdf.creative.base.vo.creative.SysOrganizeTreeVo; | ||||
return sysOrganizeService.add(sysOrganizeAddParam); | return sysOrganizeService.add(sysOrganizeAddParam); | ||||
} | } | ||||
@PostMapping("/addPark") | |||||
@ApiOperation(value = "添加SysOrganize对象", notes = "添加组织信息", response = ApiResult.class) | |||||
public ApiResult addPark(@Valid @RequestBody SysOrganizeAddParkParam sysOrganizeAddParkParam) throws Exception { | |||||
return sysOrganizeService.addPark(sysOrganizeAddParkParam); | |||||
} | |||||
/** | |||||
* 启用停用组织 | |||||
*/ | |||||
@PostMapping("/enabledOrganize") | |||||
@ApiOperation(value = "添加SysOrganize对象", notes = "编辑文创办组织信息", response = ApiResult.class) | |||||
public ApiResult enabledOrganize(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
return sysOrganizeService.enabledOrganize(idParam); | |||||
} | |||||
*/ | */ | ||||
@PostMapping("/login") | @PostMapping("/login") | ||||
@ApiOperation(value = "登陆", notes = "系统用户登陆", response = ApiResult.class) | @ApiOperation(value = "登陆", notes = "系统用户登陆", response = ApiResult.class) | ||||
public ApiResult login(@Valid @RequestBody LoginParam loginParam, HttpServletResponse response) throws Exception { | |||||
return sysUserService.login(loginParam); | |||||
public ApiResult login(@Valid @RequestBody LoginParam loginParam, HttpServletRequest request, HttpServletResponse response) throws Exception { | |||||
return sysUserService.login(loginParam,request); | |||||
} | } | ||||
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-04-20 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@ApiModel(value = "DtParkCompany对象", description = "园区企业申诉文件") | |||||
public class DtParkCompany 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 organizeId; | |||||
@ApiModelProperty(value = "创建时间") | |||||
private Date createTime; | |||||
@ApiModelProperty(value = "上传用户id1") | |||||
private Long createUserId; | |||||
@ApiModelProperty(value = "文件地址") | |||||
private String path; | |||||
@ApiModelProperty(value = "文件类型") | |||||
private String fileType; | |||||
@ApiModelProperty(value = "状态 0 不可用 1可用") | |||||
private Integer state; | |||||
} |
@ApiModelProperty(value = "完整地址") | @ApiModelProperty(value = "完整地址") | ||||
private String newAddress; | private String newAddress; | ||||
@ApiModelProperty(value = "操作类型 0:初始 1:增加 2:修改 3:删除") | @ApiModelProperty(value = "操作类型 0:初始 1:增加 2:修改 3:删除") | ||||
private Integer operateType; | private Integer operateType; | ||||
@ApiModelProperty(value = "组织机构ID") | @ApiModelProperty(value = "组织机构ID") | ||||
private Long dateParkId; | private Long dateParkId; | ||||
@ApiModelProperty(value = "政策") | |||||
private String policy; | |||||
@ApiModelProperty(value = "服务") | |||||
private String serve; | |||||
@ApiModelProperty(value = "简介") | @ApiModelProperty(value = "简介") | ||||
private String intro; | private String intro; | ||||
private String logo; | |||||
@ApiModelProperty(value = "二维码") | |||||
private String qr; | |||||
@ApiModelProperty(value = "补充地址") | |||||
private String addressAp; | |||||
private Long createUserId; | private Long createUserId; | ||||
package com.xdf.creative.module.entity; | package com.xdf.creative.module.entity; | ||||
import com.baomidou.mybatisplus.annotation.FieldStrategy; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | import com.baomidou.mybatisplus.annotation.IdType; | ||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | import com.baomidou.mybatisplus.annotation.TableId; | ||||
import com.xdf.creative.base.entity.BaseEntity; | import com.xdf.creative.base.entity.BaseEntity; | ||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
@ApiModelProperty(value = "终审时间") | @ApiModelProperty(value = "终审时间") | ||||
private Date finalAuditTime; | private Date finalAuditTime; | ||||
@ApiModelProperty(value = "终审排序时间") | |||||
private Date orderAuditTime; | |||||
@ApiModelProperty(value = "排序") | @ApiModelProperty(value = "排序") | ||||
private Integer sort; | private Integer sort; | ||||
private Integer istop; | private Integer istop; | ||||
@ApiModelProperty(value = "置顶时间") | @ApiModelProperty(value = "置顶时间") | ||||
@TableField(strategy = FieldStrategy.IGNORED) | |||||
private Date istopTime; | private Date istopTime; | ||||
@ApiModelProperty(value = "上下状态 0 下线 1上线") | @ApiModelProperty(value = "上下状态 0 下线 1上线") |
@ApiModelProperty(value = "完整地址") | @ApiModelProperty(value = "完整地址") | ||||
private String newAddress; | private String newAddress; | ||||
@ApiModelProperty(value = "政策") | |||||
private String policy; | |||||
@ApiModelProperty(value = "服务") | |||||
private String serve; | |||||
@ApiModelProperty(value = "简介") | @ApiModelProperty(value = "简介") | ||||
private String intro; | private String intro; | ||||
private Integer sort; | |||||
private String logo; | |||||
@ApiModelProperty(value = "二维码") | |||||
private String qr; | |||||
@ApiModelProperty(value = "补充地址") | |||||
private String addressAp; | |||||
} | } |
@ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除") | @ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除") | ||||
private Integer deleted; | private Integer deleted; | ||||
private Integer level; | |||||
} | } |
import org.springframework.stereotype.Repository; | import org.springframework.stereotype.Repository; | ||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* @param dtInfoAuditQueryOrganizeIdParam | * @param dtInfoAuditQueryOrganizeIdParam | ||||
* @return | * @return | ||||
*/ | */ | ||||
DtInfoAudit getInfoAuditByOrganize(DtInfoAuditQueryOrganizeIdParam dtInfoAuditQueryOrganizeIdParam); | |||||
List<DtInfoAudit> getInfoAuditByOrganize(DtInfoAuditQueryOrganizeIdParam dtInfoAuditQueryOrganizeIdParam); | |||||
/** | /** |
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.DtParkCompanyQueryParam; | |||||
import com.xdf.creative.base.vo.dt.DtParkCompanyQueryVo; | |||||
import com.xdf.creative.module.entity.DtParkCompany; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.springframework.stereotype.Repository; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 园区企业申诉文件 Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-04-20 | |||||
*/ | |||||
@Repository | |||||
public interface DtParkCompanyMapper extends BaseMapper<DtParkCompany> { | |||||
/** | |||||
* 根据ID获取查询对象 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
DtParkCompanyQueryVo getDtParkCompanyById(Serializable id); | |||||
/** | |||||
* 获取分页对象 | |||||
* | |||||
* @param page | |||||
* @param dtParkCompanyQueryParam | |||||
* @return | |||||
*/ | |||||
IPage<DtParkCompanyQueryVo> getDtParkCompanyPageList(@Param("page") Page page, @Param("param") DtParkCompanyQueryParam dtParkCompanyQueryParam); | |||||
} |
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
import com.baomidou.mybatisplus.core.metadata.IPage; | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.xdf.creative.base.params.creative.InfoContentBackSearchQueryParam; | |||||
import com.xdf.creative.base.params.creative.InfoContentHomePageQueryParam; | |||||
import com.xdf.creative.base.params.creative.InfoContentQueryParam; | |||||
import com.xdf.creative.base.params.creative.InfoContentWebSearchQueryParam; | |||||
import com.xdf.creative.base.params.creative.*; | |||||
import com.xdf.creative.base.vo.creative.*; | import com.xdf.creative.base.vo.creative.*; | ||||
import com.xdf.creative.module.entity.InfoContent; | import com.xdf.creative.module.entity.InfoContent; | ||||
import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
*/ | */ | ||||
List<InfoContentHomePageQueryVo> getHomePageInfo(@Param("param") InfoContentHomePageQueryParam infoContentHomePageQueryParam); | List<InfoContentHomePageQueryVo> getHomePageInfo(@Param("param") InfoContentHomePageQueryParam infoContentHomePageQueryParam); | ||||
List<InfoContentHomePageQueryVo> getHomePagesInfo(InfoContentHomePageListParam infoContentHomePageListParam); | |||||
/** | /** | ||||
* 首页新闻搜索 | * 首页新闻搜索 | ||||
*/ | */ | ||||
IPage<InfoContentWebSearchQueryVo> getSearchWebInfo(@Param("page") Page page, @Param("param") InfoContentWebSearchQueryParam infoContentWebSearchQueryParam); | IPage<InfoContentWebSearchQueryVo> getSearchWebInfo(@Param("page") Page page, @Param("param") InfoContentWebSearchQueryParam infoContentWebSearchQueryParam); | ||||
IPage<InfoContentWebSearchQueryVo> getSearchWebsInfo(@Param("page") Page page, @Param("param") InfoContentWebSearchListParam infoContentWebSearchListParam); | |||||
/** | /** | ||||
* 后台发布列表 | * 后台发布列表 |
* @param dtRegionParam | * @param dtRegionParam | ||||
* @return | * @return | ||||
*/ | */ | ||||
DtRegionVo getParkRegion(DtRegionParam dtRegionParam); | |||||
DtRegionVo getParkRegion(@Param("param") DtRegionParam dtRegionParam); | |||||
* 获取角色列表 | * 获取角色列表 | ||||
* @return | * @return | ||||
*/ | */ | ||||
List<SysRoleListQueryVo> getRoleList(); | |||||
List<SysRoleListQueryVo> getRoleList(Integer level); | |||||
/** | /** |
package com.xdf.creative.module.service; | |||||
import com.xdf.creative.base.params.dt.DtParkCompanyQueryParam; | |||||
import com.xdf.creative.base.service.BaseService; | |||||
import com.xdf.creative.base.vo.dt.DtParkCompanyQueryVo; | |||||
import com.xdf.creative.module.entity.DtParkCompany; | |||||
import com.xdf.creative.util.page.ApiResult; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 园区企业申诉文件 服务类 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-04-20 | |||||
*/ | |||||
public interface DtParkCompanyService extends BaseService<DtParkCompany> { | |||||
ApiResult add(DtParkCompany dtParkCompany); | |||||
/** | |||||
* 根据ID获取查询对象 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
DtParkCompanyQueryVo getDtParkCompanyById(Serializable id) throws Exception; | |||||
/** | |||||
* 获取分页对象 | |||||
* | |||||
* @param dtParkCompanyQueryParam | |||||
* @return | |||||
*/ | |||||
PageTool<DtParkCompanyQueryVo> getDtParkCompanyPageList(DtParkCompanyQueryParam dtParkCompanyQueryParam) throws Exception; | |||||
} |
package com.xdf.creative.module.service; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 11:28 2020/4/11 | |||||
*/ | |||||
import com.xdf.creative.base.params.VerifyCode; | |||||
import java.io.IOException; | |||||
import java.io.OutputStream; | |||||
/** | |||||
* 验证码生成接口 | |||||
*/ | |||||
public interface IVerifyCodeGen { | |||||
/** | |||||
* 生成验证码并返回code,将图片写的os中 | |||||
* | |||||
* @param width | |||||
* @param height | |||||
* @param os | |||||
* @return | |||||
* @throws IOException | |||||
*/ | |||||
String generate(int width, int height, OutputStream os) throws IOException; | |||||
/** | |||||
* 生成验证码对象 | |||||
* | |||||
* @param width | |||||
* @param height | |||||
* @return | |||||
* @throws IOException | |||||
*/ | |||||
VerifyCode generate(int width, int height) throws IOException; | |||||
} | |||||
*/ | */ | ||||
ApiResult updateInfoContent(InfoContentAddQueryParam infoContentAddQueryParam); | ApiResult updateInfoContent(InfoContentAddQueryParam infoContentAddQueryParam); | ||||
/** | |||||
* 管理员修改内容信息 | |||||
* @param infoContentEditQueryParam | |||||
* @return | |||||
*/ | |||||
ApiResult editInfoManage(InfoContentEditQueryParam infoContentEditQueryParam); | |||||
/** | /** | ||||
* 初审核内容信息 | * 初审核内容信息 | ||||
* @param infoContentAuditQueryParam | * @param infoContentAuditQueryParam | ||||
*/ | */ | ||||
ApiResult getHomePageInfo(InfoContentHomePageQueryParam infoContentHomePageQueryParam); | ApiResult getHomePageInfo(InfoContentHomePageQueryParam infoContentHomePageQueryParam); | ||||
ApiResult getHomePagesInfo(InfoContentHomePageListParam infoContentHomePageListParam); | |||||
/** | /** | ||||
* 获取新闻搜索 | * 获取新闻搜索 | ||||
* @param infoContentWebSearchQueryParam | * @param infoContentWebSearchQueryParam | ||||
*/ | */ | ||||
PageTool<InfoContentWebSearchQueryVo> getSearchWebInfo(InfoContentWebSearchQueryParam infoContentWebSearchQueryParam) throws Exception; | PageTool<InfoContentWebSearchQueryVo> getSearchWebInfo(InfoContentWebSearchQueryParam infoContentWebSearchQueryParam) throws Exception; | ||||
PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception; | |||||
/** | /** | ||||
* 后台发布列表 | * 后台发布列表 | ||||
*/ | */ |
package com.xdf.creative.module.service; | package com.xdf.creative.module.service; | ||||
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.service.BaseService; | import com.xdf.creative.base.service.BaseService; | ||||
import com.xdf.creative.base.vo.creative.SysOrganizeBackVo; | import com.xdf.creative.base.vo.creative.SysOrganizeBackVo; | ||||
ApiResult editPark(SysOrganizeEditParam sysOrganizeAddParam) throws Exception; | ApiResult editPark(SysOrganizeEditParam sysOrganizeAddParam) throws Exception; | ||||
/** | |||||
* 停用启用用户 | |||||
* @param idParam | |||||
* @return | |||||
*/ | |||||
ApiResult enabledOrganize(IdParam idParam); | |||||
import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
import javax.servlet.http.HttpServletRequest; | |||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.util.Set; | import java.util.Set; | ||||
* @return | * @return | ||||
* @throws Exception | * @throws Exception | ||||
*/ | */ | ||||
ApiResult login(LoginParam loginParam) throws Exception; | |||||
ApiResult login(LoginParam loginParam, HttpServletRequest request) throws Exception; | |||||
/** | /** |
@Override | @Override | ||||
public ApiResult getOrganizeAuditInfo() { | public ApiResult getOrganizeAuditInfo() { | ||||
DtInfoAuditQueryOrganizeIdParam dtInfoAuditQueryOrganizeIdParam = new DtInfoAuditQueryOrganizeIdParam(); | DtInfoAuditQueryOrganizeIdParam dtInfoAuditQueryOrganizeIdParam = new DtInfoAuditQueryOrganizeIdParam(); | ||||
if (!OrganizeTypeEnum.ORGANIZE_PARK.getCode().equals(getOrganizeType())) { | |||||
return ApiResult.fail("非园区账户,无权限访问!"); | |||||
} | |||||
dtInfoAuditQueryOrganizeIdParam.setOrganizeId(getOrganizeId()); | dtInfoAuditQueryOrganizeIdParam.setOrganizeId(getOrganizeId()); | ||||
dtInfoAuditQueryOrganizeIdParam.setAuditType(getOrganizeType()); | |||||
DtInfoAudit dtInfoAudit = dtInfoAuditMapper.getInfoAuditByOrganize(dtInfoAuditQueryOrganizeIdParam); | |||||
dtInfoAuditQueryOrganizeIdParam.setAuditType(OrganizeTypeEnum.ORGANIZE_PARK.getCode()); | |||||
List<DtInfoAudit> dtInfoAuditList = this.list(new QueryWrapper<DtInfoAudit>().eq("organize_id",getOrganizeId()).eq("audit_type",OrganizeTypeEnum.ORGANIZE_PARK.getCode()).orderByDesc("submit_time")); | |||||
DtInfoAudit dtInfoAudit = null; | |||||
/* DtInfoAudit dtInfoAudit = this.getOne(new QueryWrapper<DtInfoAudit>().eq("organize_id",getOrganizeId()).eq("audit_type",OrganizeTypeEnum.ORGANIZE_PARK.getCode()));*/ | |||||
Map<String, Object> map = new HashMap<>(); | Map<String, Object> map = new HashMap<>(); | ||||
//如果为空就新建 | //如果为空就新建 | ||||
if (null == dtInfoAudit) { | |||||
if (dtInfoAuditList.size()<=0) { | |||||
DtInfoAudit dtInfoAuditNew = new DtInfoAudit(); | DtInfoAudit dtInfoAuditNew = new DtInfoAudit(); | ||||
dtInfoAuditNew.setAuditState(AuditInfoStateEnum.PROJECT_ADUIT_STATE_INIT.getCode()); | dtInfoAuditNew.setAuditState(AuditInfoStateEnum.PROJECT_ADUIT_STATE_INIT.getCode()); | ||||
dtInfoAuditNew.setAuditType(getOrganizeType()); | dtInfoAuditNew.setAuditType(getOrganizeType()); | ||||
dtInfoAuditNew.setInfoState(InfoStateTypeEnum.DRAFT.getCode()); | dtInfoAuditNew.setInfoState(InfoStateTypeEnum.DRAFT.getCode()); | ||||
dtInfoAuditNew.setUpdateTime(new Date()); | dtInfoAuditNew.setUpdateTime(new Date()); | ||||
this.saveOrUpdate(dtInfoAuditNew); | this.saveOrUpdate(dtInfoAuditNew); | ||||
dtInfoAudit = dtInfoAuditMapper.getInfoAuditByOrganize(dtInfoAuditQueryOrganizeIdParam); | |||||
dtInfoAudit = this.list(new QueryWrapper<DtInfoAudit>().eq("organize_id",getOrganizeId()).eq("audit_type",OrganizeTypeEnum.ORGANIZE_PARK.getCode()).orderByDesc("submit_time")).get(0); | |||||
} | |||||
if(null==dtInfoAudit){ | |||||
dtInfoAudit = dtInfoAuditList.get(0); | |||||
} | } | ||||
map.put("dtInfoAudit", dtInfoAudit); | |||||
if (OrganizeTypeEnum.ORGANIZE_PARK.getCode().equals(getOrganizeType())) { | |||||
map.put("dtInfoAudit",dtInfoAudit); | |||||
if (OrganizeTypeEnum.ORGANIZE_PARK.getCode().equals(getOrganizeType())) { | |||||
DtParkInfoDraft dtParkInfoDraft = dtParkInfoDraftService.getOne(new QueryWrapper<DtParkInfoDraft>().eq("organize_id", getOrganizeId())); | DtParkInfoDraft dtParkInfoDraft = dtParkInfoDraftService.getOne(new QueryWrapper<DtParkInfoDraft>().eq("organize_id", getOrganizeId())); | ||||
if (null == dtParkInfoDraft) { | if (null == dtParkInfoDraft) { | ||||
dtParkInfoDraft = new DtParkInfoDraft(); | dtParkInfoDraft = new DtParkInfoDraft(); | ||||
SysOrganize sysOrganize = sysOrganizeService.getById(getOrganizeId()); | SysOrganize sysOrganize = sysOrganizeService.getById(getOrganizeId()); | ||||
dtParkInfoDraft.setOrganizeId(getOrganizeId()); | dtParkInfoDraft.setOrganizeId(getOrganizeId()); | ||||
dtParkInfoDraft.setName(sysOrganize.getOrganizeName()); | dtParkInfoDraft.setName(sysOrganize.getOrganizeName()); | ||||
dtParkInfoDraft.setProvinceId((long)9); | |||||
dtParkInfoDraft.setCityId((long)72); | |||||
dtParkInfoDraft.setProvinceId((long) 9); | |||||
dtParkInfoDraft.setCityId((long) 72); | |||||
//本地库查询 | //本地库查询 | ||||
SysRegion sysRegion = sysRegionMapper.selectById(sysOrganize.getPopedomId()); | SysRegion sysRegion = sysRegionMapper.selectById(sysOrganize.getPopedomId()); | ||||
if(null!=sysRegion){ | |||||
if (null != sysRegion) { | |||||
DtRegionParam dtRegionParam = new DtRegionParam(); | DtRegionParam dtRegionParam = new DtRegionParam(); | ||||
dtRegionParam.setName(sysRegion.getRegionName()); | dtRegionParam.setName(sysRegion.getRegionName()); | ||||
DtRegionVo dtRegionVo = sysRegionMapper.getParkRegion(dtRegionParam); | DtRegionVo dtRegionVo = sysRegionMapper.getParkRegion(dtRegionParam); | ||||
if(null!=dtRegionVo){ | |||||
if (null != dtRegionVo) { | |||||
dtParkInfoDraft.setDistrictId(dtRegionVo.getId()); | dtParkInfoDraft.setDistrictId(dtRegionVo.getId()); | ||||
} | } | ||||
} | } | ||||
*/ | */ | ||||
@Override | @Override | ||||
public ApiResult submitAuditInfo() { | public ApiResult submitAuditInfo() { | ||||
DtInfoAuditQueryOrganizeIdParam dtInfoAuditQueryOrganizeIdParam = new DtInfoAuditQueryOrganizeIdParam(); | |||||
dtInfoAuditQueryOrganizeIdParam.setOrganizeId(getOrganizeId()); | |||||
DtInfoAudit dtInfoAudit = dtInfoAuditMapper.getInfoAuditByOrganize(dtInfoAuditQueryOrganizeIdParam); | |||||
DtInfoAudit dtInfoAudit = this.getOne(new QueryWrapper<DtInfoAudit>().eq("organize_id",getOrganizeId())); | |||||
if (null == dtInfoAudit) { | if (null == dtInfoAudit) { | ||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | ||||
} | } | ||||
/** | /** | ||||
* 审核基本信息 | * 审核基本信息 | ||||
* | |||||
* @param dtInfoAuditQueryAuiditParam | * @param dtInfoAuditQueryAuiditParam | ||||
* @return | * @return | ||||
*/ | */ | ||||
/** | /** | ||||
* 后台审核自主信息列表 | * 后台审核自主信息列表 | ||||
* | |||||
* @param dtInfoAuditBackParam | * @param dtInfoAuditBackParam | ||||
* @return | * @return | ||||
* @throws Exception | * @throws Exception | ||||
* @param dtInfoAudit | * @param dtInfoAudit | ||||
* @return | * @return | ||||
*/ | */ | ||||
@Transactional | |||||
public DtInfoAudit parkHandle(DtInfoAudit dtInfoAudit) { | public DtInfoAudit parkHandle(DtInfoAudit dtInfoAudit) { | ||||
QueryWrapper<DtParkInfoDraft> parkInfoQueryWrapper = new QueryWrapper<>(); | QueryWrapper<DtParkInfoDraft> parkInfoQueryWrapper = new QueryWrapper<>(); | ||||
parkInfoQueryWrapper.eq("organize_id", dtInfoAudit.getOrganizeId()); | parkInfoQueryWrapper.eq("organize_id", dtInfoAudit.getOrganizeId()); | ||||
* @return | * @return | ||||
*/ | */ | ||||
public boolean parkInfoOperate(DtParkInfoDraft dtParkInfoDraft) { | public boolean parkInfoOperate(DtParkInfoDraft dtParkInfoDraft) { | ||||
if(null==dtParkInfoDraft.getDateParkId()) { | |||||
if (null == dtParkInfoDraft.getDateParkId()) { | |||||
ParkDataTeam parkDataTeam = parkDataTeamService.getOne(new QueryWrapper<ParkDataTeam>().eq("name", dtParkInfoDraft.getName())); | ParkDataTeam parkDataTeam = parkDataTeamService.getOne(new QueryWrapper<ParkDataTeam>().eq("name", dtParkInfoDraft.getName())); | ||||
dtParkInfoDraft.setOperateType(InfoOperatorTypeEnum.INFO_OPERATOR_INIT.getCode()); | dtParkInfoDraft.setOperateType(InfoOperatorTypeEnum.INFO_OPERATOR_INIT.getCode()); | ||||
dtParkInfoDraft.setUpdateTime(new Date()); | dtParkInfoDraft.setUpdateTime(new Date()); | ||||
if(null==parkDataTeam){ | |||||
if (null == parkDataTeam) { | |||||
parkDataTeam = new ParkDataTeam(); | parkDataTeam = new ParkDataTeam(); | ||||
BeanUtils.copyProperties(dtParkInfoDraft,parkDataTeam); | |||||
BeanUtils.copyProperties(dtParkInfoDraft, parkDataTeam); | |||||
ParkDataTeam parkDataTeamNew = parkDataTeamService.getOne(new QueryWrapper<ParkDataTeam>().eq("name", dtParkInfoDraft.getName())); | ParkDataTeam parkDataTeamNew = parkDataTeamService.getOne(new QueryWrapper<ParkDataTeam>().eq("name", dtParkInfoDraft.getName())); | ||||
if(null==parkDataTeamNew){ | |||||
if (null == parkDataTeamNew) { | |||||
throw new BusinessException("园区发布信息创建失败"); | throw new BusinessException("园区发布信息创建失败"); | ||||
}else { | |||||
} else { | |||||
dtParkInfoDraft.setDateParkId(parkDataTeamNew.getId()); | dtParkInfoDraft.setDateParkId(parkDataTeamNew.getId()); | ||||
parkDataTeamService.saveOrUpdate(parkDataTeam); | parkDataTeamService.saveOrUpdate(parkDataTeam); | ||||
dtParkInfoDraftService.saveOrUpdate(dtParkInfoDraft); | dtParkInfoDraftService.saveOrUpdate(dtParkInfoDraft); | ||||
} | } | ||||
}else{ | |||||
} else { | |||||
dtParkInfoDraft.setDateParkId(parkDataTeam.getId()); | dtParkInfoDraft.setDateParkId(parkDataTeam.getId()); | ||||
BeanUtils.copyProperties(dtParkInfoDraft,parkDataTeam); | |||||
BeanUtils.copyProperties(dtParkInfoDraft, parkDataTeam); | |||||
parkDataTeamService.saveOrUpdate(parkDataTeam); | parkDataTeamService.saveOrUpdate(parkDataTeam); | ||||
dtParkInfoDraftService.saveOrUpdate(dtParkInfoDraft); | dtParkInfoDraftService.saveOrUpdate(dtParkInfoDraft); | ||||
} | } | ||||
}else{ | |||||
if(InfoOperatorTypeEnum.INFO_OPERATOR_UPDATE.getCode().equals(dtParkInfoDraft.getOperateType())) { | |||||
} else { | |||||
if (InfoOperatorTypeEnum.INFO_OPERATOR_UPDATE.getCode().equals(dtParkInfoDraft.getOperateType())) { | |||||
ParkDataTeam parkDataTeam = parkDataTeamService.getById(dtParkInfoDraft.getDateParkId()); | ParkDataTeam parkDataTeam = parkDataTeamService.getById(dtParkInfoDraft.getDateParkId()); | ||||
BeanUtils.copyProperties(dtParkInfoDraft, parkDataTeam); | BeanUtils.copyProperties(dtParkInfoDraft, parkDataTeam); | ||||
dtParkInfoDraft.setOperateType(InfoOperatorTypeEnum.INFO_OPERATOR_INIT.getCode()); | dtParkInfoDraft.setOperateType(InfoOperatorTypeEnum.INFO_OPERATOR_INIT.getCode()); | ||||
* @param parkActivityListDraft | * @param parkActivityListDraft | ||||
* @return | * @return | ||||
*/ | */ | ||||
public boolean parkActivityOperate(List<DtParkActivity> parkActivityListDraft) { | public boolean parkActivityOperate(List<DtParkActivity> parkActivityListDraft) { | ||||
for (DtParkActivity dtParkActivity : parkActivityListDraft) { | for (DtParkActivity dtParkActivity : parkActivityListDraft) { | ||||
if (InfoOperatorTypeEnum.INFO_OPERATOR_UPDATE.getCode() | if (InfoOperatorTypeEnum.INFO_OPERATOR_UPDATE.getCode() | ||||
dtParkActivityUpdateParams.put("organize_id", dtParkActivity.getOrganizeId()); | dtParkActivityUpdateParams.put("organize_id", dtParkActivity.getOrganizeId()); | ||||
dtParkActivityUpdateParams.put("display_type", DisplayTypeEnum.PUBLISH.getCode()); | dtParkActivityUpdateParams.put("display_type", DisplayTypeEnum.PUBLISH.getCode()); | ||||
dtParkActivityUpdateParams.put("group_id", dtParkActivity.getGroupId()); | dtParkActivityUpdateParams.put("group_id", dtParkActivity.getGroupId()); | ||||
List<DtParkActivity> dtParkActivityList = dtParkActivityService.list(new QueryWrapper<DtParkActivity>().eq("organize_id",dtParkActivity.getOrganizeId()).eq("display_type", DisplayTypeEnum.PUBLISH.getCode()).eq("group_id",dtParkActivity.getGroupId())); | |||||
for (DtParkActivity dtParkActivityPublish:dtParkActivityList | |||||
) { | |||||
List<DtParkActivity> dtParkActivityList = dtParkActivityService.list(new QueryWrapper<DtParkActivity>().eq("organize_id", dtParkActivity.getOrganizeId()).eq("display_type", DisplayTypeEnum.PUBLISH.getCode()).eq("group_id", dtParkActivity.getGroupId())); | |||||
for (DtParkActivity dtParkActivityPublish : dtParkActivityList | |||||
) { | |||||
//先删附件 | //先删附件 | ||||
dtActivityAttachmentService.remove(new QueryWrapper<DtActivityAttachment>().eq("park_activity_id",dtParkActivityPublish.getForeignId())); | |||||
dtActivityAttachmentService.remove(new QueryWrapper<DtActivityAttachment>().eq("park_activity_id", dtParkActivityPublish.getForeignId())); | |||||
} | } | ||||
dtParkActivityService.removeByMap(dtParkActivityUpdateParams); | dtParkActivityService.removeByMap(dtParkActivityUpdateParams); | ||||
dtParkActivityDeleteParams.put("organize_id", dtParkActivity.getOrganizeId()); | dtParkActivityDeleteParams.put("organize_id", dtParkActivity.getOrganizeId()); | ||||
dtParkActivityDeleteParams.put("group_id", dtParkActivity.getGroupId()); | dtParkActivityDeleteParams.put("group_id", dtParkActivity.getGroupId()); | ||||
List<DtParkActivity> dtParkActivityList = dtParkActivityService.list(new QueryWrapper<DtParkActivity>().eq("organize_id",dtParkActivity.getOrganizeId()).eq("group_id",dtParkActivity.getGroupId())); | |||||
for (DtParkActivity dtParkActivityPublish:dtParkActivityList | |||||
List<DtParkActivity> dtParkActivityList = dtParkActivityService.list(new QueryWrapper<DtParkActivity>().eq("organize_id", dtParkActivity.getOrganizeId()).eq("group_id", dtParkActivity.getGroupId())); | |||||
for (DtParkActivity dtParkActivityPublish : dtParkActivityList | |||||
) { | ) { | ||||
//先删附件 | //先删附件 | ||||
dtActivityAttachmentService.remove(new QueryWrapper<DtActivityAttachment>().eq("park_activity_id",dtParkActivityPublish.getForeignId())); | |||||
dtActivityAttachmentService.remove(new QueryWrapper<DtActivityAttachment>().eq("park_activity_id", dtParkActivityPublish.getForeignId())); | |||||
} | } | ||||
dtParkActivityService.removeByMap(dtParkActivityDeleteParams); | dtParkActivityService.removeByMap(dtParkActivityDeleteParams); | ||||
dtParkActivity.setUpdateTime(new Date()); | dtParkActivity.setUpdateTime(new Date()); | ||||
DtParkActivity dtParkActivityNew = new DtParkActivity(); | DtParkActivity dtParkActivityNew = new DtParkActivity(); | ||||
BeanUtils.copyProperties(dtParkActivity, dtParkActivityNew); | BeanUtils.copyProperties(dtParkActivity, dtParkActivityNew); | ||||
String uuid= UUIDUtil.getUUID(); | |||||
String uuid = UUIDUtil.getUUID(); | |||||
dtParkActivityNew.setDisplayType(DisplayTypeEnum.PUBLISH.getCode()); | dtParkActivityNew.setDisplayType(DisplayTypeEnum.PUBLISH.getCode()); | ||||
dtParkActivityNew.setOrganizeId(dtParkActivity.getOrganizeId()); | dtParkActivityNew.setOrganizeId(dtParkActivity.getOrganizeId()); | ||||
dtParkActivityNew.setGroupId(dtParkActivity.getGroupId()); | dtParkActivityNew.setGroupId(dtParkActivity.getGroupId()); | ||||
dtParkActivityNew.setId((long) 0); | dtParkActivityNew.setId((long) 0); | ||||
dtParkActivityService.saveOrUpdate(dtParkActivity); | dtParkActivityService.saveOrUpdate(dtParkActivity); | ||||
dtParkActivityService.save(dtParkActivityNew); | dtParkActivityService.save(dtParkActivityNew); | ||||
List<DtActivityAttachment> dtActivityAttachmentList = dtActivityAttachmentService.list(new QueryWrapper<DtActivityAttachment>().eq("park_activity_id",dtParkActivity.getForeignId())); | |||||
if(dtActivityAttachmentList.size()>0){ | |||||
for (DtActivityAttachment dtActivityAttachment:dtActivityAttachmentList) { | |||||
dtActivityAttachment.setId((long)0); | |||||
List<DtActivityAttachment> dtActivityAttachmentList = dtActivityAttachmentService.list(new QueryWrapper<DtActivityAttachment>().eq("park_activity_id", dtParkActivity.getForeignId())); | |||||
if (dtActivityAttachmentList.size() > 0) { | |||||
for (DtActivityAttachment dtActivityAttachment : dtActivityAttachmentList) { | |||||
dtActivityAttachment.setId((long) 0); | |||||
dtActivityAttachment.setUploadTime(new Date()); | dtActivityAttachment.setUploadTime(new Date()); | ||||
dtActivityAttachment.setDisplayType(DisplayTypeEnum.PUBLISH.getCode()); | dtActivityAttachment.setDisplayType(DisplayTypeEnum.PUBLISH.getCode()); | ||||
dtActivityAttachment.setGroupId(dtParkActivityNew.getGroupId()); | dtActivityAttachment.setGroupId(dtParkActivityNew.getGroupId()); | ||||
} | } | ||||
@Override | @Override | ||||
public DtInfoAuditQueryVo getDtInfoAuditById(Serializable id) throws Exception { | public DtInfoAuditQueryVo getDtInfoAuditById(Serializable id) throws Exception { | ||||
return dtInfoAuditMapper.getDtInfoAuditById(id); | return dtInfoAuditMapper.getDtInfoAuditById(id); |
import com.xdf.creative.base.vo.dt.DtParkActivityInfoDetailVo; | import com.xdf.creative.base.vo.dt.DtParkActivityInfoDetailVo; | ||||
import com.xdf.creative.base.vo.dt.DtParkActivityQueryVo; | import com.xdf.creative.base.vo.dt.DtParkActivityQueryVo; | ||||
import com.xdf.creative.base.vo.dt.DtParkActivityWebVo; | import com.xdf.creative.base.vo.dt.DtParkActivityWebVo; | ||||
import com.xdf.creative.enums.OrganizeTypeEnum; | |||||
import com.xdf.creative.enums.StatusCode; | import com.xdf.creative.enums.StatusCode; | ||||
import com.xdf.creative.enums.dt.DisplayTypeEnum; | import com.xdf.creative.enums.dt.DisplayTypeEnum; | ||||
import com.xdf.creative.enums.dt.InfoOperatorTypeEnum; | import com.xdf.creative.enums.dt.InfoOperatorTypeEnum; | ||||
Page page = setPageParam(dtParkActivitWebParam); | Page page = setPageParam(dtParkActivitWebParam); | ||||
IPage<DtParkActivityWebVo> iPage = dtParkActivityMapper.getUserPageList(page, dtParkActivitWebParam); | IPage<DtParkActivityWebVo> iPage = dtParkActivityMapper.getUserPageList(page, dtParkActivitWebParam); | ||||
return new PageTool(iPage); | return new PageTool(iPage); | ||||
}else if(OrganizeTypeEnum.ORGANIZE_DISTRICT.getCode().equals(getOrganizeType())||OrganizeTypeEnum.ORGANIZE_CITY.getCode().equals(getOrganizeType())|| | |||||
OrganizeTypeEnum.ORGANIZE_MANAGE.getCode().equals(getOrganizeType())){ | |||||
if(null==dtParkActivitWebParam.getOrganizeId()){ | |||||
IPage<DtParkActivityWebVo> iPage =null; | |||||
return new PageTool(iPage); | |||||
} | |||||
dtParkActivitWebParam.setOrganizeId(dtParkActivitWebParam.getOrganizeId()); | |||||
Page page = setPageParam(dtParkActivitWebParam); | |||||
IPage<DtParkActivityWebVo> iPage = dtParkActivityMapper.getUserPageList(page, dtParkActivitWebParam); | |||||
return new PageTool(iPage); | |||||
}else{ | }else{ | ||||
return new PageTool(null); | |||||
IPage<DtParkActivityWebVo> iPage =null; | |||||
return new PageTool(iPage); | |||||
} | } | ||||
} | } | ||||
package com.xdf.creative.module.service.impl; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.xdf.creative.base.params.dt.DtParkCompanyQueryParam; | |||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | |||||
import com.xdf.creative.base.vo.dt.DtParkCompanyQueryVo; | |||||
import com.xdf.creative.enums.StateEnum; | |||||
import com.xdf.creative.module.entity.DtParkCompany; | |||||
import com.xdf.creative.module.mapper.DtParkCompanyMapper; | |||||
import com.xdf.creative.module.service.DtParkCompanyService; | |||||
import com.xdf.creative.util.page.ApiResult; | |||||
import com.xdf.creative.util.page.PageTool; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.BeanUtils; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import org.springframework.transaction.annotation.Transactional; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
/** | |||||
* <p> | |||||
* 园区企业申诉文件 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author lgw | |||||
* @since 2020-04-20 | |||||
*/ | |||||
@Slf4j | |||||
@Service | |||||
@Transactional(rollbackFor = Exception.class) | |||||
public class DtParkCompanyServiceImpl extends BaseServiceImpl<DtParkCompanyMapper, DtParkCompany> implements DtParkCompanyService { | |||||
@Autowired | |||||
private DtParkCompanyMapper dtParkCompanyMapper; | |||||
@Override | |||||
public ApiResult add(DtParkCompany dtParkCompany) { | |||||
DtParkCompany dtParkCompanyNew = new DtParkCompany(); | |||||
BeanUtils.copyProperties(dtParkCompany,dtParkCompanyNew); | |||||
dtParkCompanyNew.setCreateUserId(getUserId()); | |||||
dtParkCompanyNew.setCreateTime(new Date()); | |||||
dtParkCompanyNew.setOrganizeId(getOrganizeId()); | |||||
dtParkCompanyNew.setState(StateEnum.ENABLE.getKey()); | |||||
this.saveOrUpdate(dtParkCompanyNew); | |||||
return ApiResult.ok(); | |||||
} | |||||
@Override | |||||
public DtParkCompanyQueryVo getDtParkCompanyById(Serializable id) throws Exception { | |||||
return dtParkCompanyMapper.getDtParkCompanyById(id); | |||||
} | |||||
@Override | |||||
public PageTool<DtParkCompanyQueryVo> getDtParkCompanyPageList(DtParkCompanyQueryParam dtParkCompanyQueryParam) throws Exception { | |||||
Page page = setPageParam(dtParkCompanyQueryParam); | |||||
IPage<DtParkCompanyQueryVo> iPage = dtParkCompanyMapper.getDtParkCompanyPageList(page, dtParkCompanyQueryParam); | |||||
return new PageTool(iPage); | |||||
} | |||||
} |
import com.xdf.creative.base.params.dt.DtParkInfoDraftUpdateParam; | import com.xdf.creative.base.params.dt.DtParkInfoDraftUpdateParam; | ||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | import com.xdf.creative.base.service.impl.BaseServiceImpl; | ||||
import com.xdf.creative.base.vo.dt.DtParkInfoDraftQueryVo; | import com.xdf.creative.base.vo.dt.DtParkInfoDraftQueryVo; | ||||
import com.xdf.creative.enums.OrganizeTypeEnum; | |||||
import com.xdf.creative.enums.StatusCode; | import com.xdf.creative.enums.StatusCode; | ||||
import com.xdf.creative.enums.dt.InfoOperatorTypeEnum; | import com.xdf.creative.enums.dt.InfoOperatorTypeEnum; | ||||
import com.xdf.creative.module.entity.DtParkInfoDraft; | import com.xdf.creative.module.entity.DtParkInfoDraft; | ||||
return ApiResult.error(StatusCode.FORM_SUBMIT_ID_VERIFY); | return ApiResult.error(StatusCode.FORM_SUBMIT_ID_VERIFY); | ||||
} | } | ||||
if(null== dtParkInfoDraft.getCreateUserId()) { | if(null== dtParkInfoDraft.getCreateUserId()) { | ||||
dtParkInfoDraft.setCreateUserId(getUserId()); | |||||
if (!verifyOrganizePermission(dtParkInfoDraft.getOrganizeId())) { | if (!verifyOrganizePermission(dtParkInfoDraft.getOrganizeId())) { | ||||
return ApiResult.error(StatusCode.AUTH_UPDATE_VERIFY_ERROR); | return ApiResult.error(StatusCode.AUTH_UPDATE_VERIFY_ERROR); | ||||
} | } | ||||
@Override | @Override | ||||
public ApiResult getParkDraf(Long companyId) throws Exception { | public ApiResult getParkDraf(Long companyId) throws Exception { | ||||
Long organizeId =getOrganizeId(); | Long organizeId =getOrganizeId(); | ||||
if(!organizeId.equals(companyId)){ | |||||
if(!organizeId.equals(companyId)&& !OrganizeTypeEnum.ORGANIZE_DISTRICT.getCode().equals(getOrganizeType())&&!OrganizeTypeEnum.ORGANIZE_CITY.getCode().equals(getOrganizeType())&& | |||||
!OrganizeTypeEnum.ORGANIZE_MANAGE.getCode().equals(getOrganizeType())){ | |||||
return ApiResult.fail("非法获取数据!"); | return ApiResult.fail("非法获取数据!"); | ||||
} | } | ||||
if(!organizeId.equals(companyId)){ | |||||
organizeId = companyId; | |||||
} | |||||
return ApiResult.ok(dtParkInfoDraftMapper.getParkDraf(organizeId)); | return ApiResult.ok(dtParkInfoDraftMapper.getParkDraf(organizeId)); | ||||
} | } | ||||
@Service | @Service | ||||
public class FileClientServiceImpl implements FileClientService { | public class FileClientServiceImpl implements FileClientService { | ||||
public static ArrayList<String> fileTypeList = new ArrayList<String>(){{add("PDF"); add("DOC");add("DOCX");add("XLS"); | public static ArrayList<String> fileTypeList = new ArrayList<String>(){{add("PDF"); add("DOC");add("DOCX");add("XLS"); | ||||
add("XLSX");add("PPT");add("PPTX");add("PNG");add("JPG");}}; | |||||
add("XLSX");add("PPT");add("PPTX");add("PNG");add("JPG");add("GIF");}}; | |||||
@Override | @Override | ||||
public ApiResult uploadUtilFileByDecoder(FileUploadQuery fileUploadQuery,String baseUrl) throws Exception { | public ApiResult uploadUtilFileByDecoder(FileUploadQuery fileUploadQuery,String baseUrl) throws Exception { |
//获取初审人员姓名 | //获取初审人员姓名 | ||||
if(null!=infoContent.getFirstAuditUser()) { | if(null!=infoContent.getFirstAuditUser()) { | ||||
SysUser userAudit = sysUserService.getById(infoContent.getFirstAuditUser()); | SysUser userAudit = sysUserService.getById(infoContent.getFirstAuditUser()); | ||||
infoContentAllQueryVo.setFirstAuditUserName(userAudit.getUsername()); | |||||
if(null!=userAudit) { | |||||
infoContentAllQueryVo.setFirstAuditUserName(userAudit.getUsername()); | |||||
} | |||||
} | } | ||||
//获取终审人员姓名 | //获取终审人员姓名 | ||||
if(null!=infoContent.getFinalAuditUser()){ | if(null!=infoContent.getFinalAuditUser()){ | ||||
SysUser userFinalAudit = sysUserService.getById(infoContent.getFinalAuditUser()); | SysUser userFinalAudit = sysUserService.getById(infoContent.getFinalAuditUser()); | ||||
infoContentAllQueryVo.setFinalAuditUserName(userFinalAudit.getUsername()); | |||||
if(null!=userFinalAudit){ | |||||
infoContentAllQueryVo.setFinalAuditUserName(userFinalAudit.getUsername()); | |||||
} | |||||
} | } | ||||
if (StringUtil.isEmpty(infoContentNew.getForeignId())) { | if (StringUtil.isEmpty(infoContentNew.getForeignId())) { | ||||
return ApiResult.error(StatusCode.FORM_SUBMIT_ID_VERIFY); | return ApiResult.error(StatusCode.FORM_SUBMIT_ID_VERIFY); | ||||
} | } | ||||
InfoDetail infoDetailNew = infoDetailService.getOne(new QueryWrapper<InfoDetail>().eq("foreign_id", infoContentAddQueryParam.getForeignId())); | |||||
InfoDetail infoDetailNew = infoDetailService.getOne(new QueryWrapper<InfoDetail>().eq("foreign_id", infoContentNew.getForeignId())); | |||||
if (null != infoDetailNew) { | if (null != infoDetailNew) { | ||||
if (null == infoDetailNew.getId()) { | if (null == infoDetailNew.getId()) { | ||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | ||||
List<InfoAttachment> infoAttachmentList = infoContentAddQueryParam.getAttachmentList(); | List<InfoAttachment> infoAttachmentList = infoContentAddQueryParam.getAttachmentList(); | ||||
if (null != infoAttachmentList) { | if (null != infoAttachmentList) { | ||||
//不为空 等于0就删除 | //不为空 等于0就删除 | ||||
infoAttachmentService.remove(new QueryWrapper<InfoAttachment>().eq("foreign_id", infoContentAddQueryParam.getForeignId())); | |||||
infoAttachmentService.remove(new QueryWrapper<InfoAttachment>().eq("foreign_id", infoContentNew.getForeignId())); | |||||
if (infoAttachmentList.size() > 0) { | if (infoAttachmentList.size() > 0) { | ||||
for (InfoAttachment infoAttachment : infoAttachmentList) { | for (InfoAttachment infoAttachment : infoAttachmentList) { | ||||
infoAttachment.setForeignId(infoContentAddQueryParam.getForeignId()); | |||||
infoAttachment.setForeignId(infoContentNew.getForeignId()); | |||||
infoAttachmentService.save(infoAttachment); | infoAttachmentService.save(infoAttachment); | ||||
} | } | ||||
} | } | ||||
List<InfoUrl> infoUrlList = infoContentAddQueryParam.getUrlList(); | List<InfoUrl> infoUrlList = infoContentAddQueryParam.getUrlList(); | ||||
if (null != infoUrlList) { | if (null != infoUrlList) { | ||||
//不为空 等于0就删除 | //不为空 等于0就删除 | ||||
infoUrlService.remove(new QueryWrapper<InfoUrl>().eq("foreign_id", infoContentAddQueryParam.getForeignId())); | |||||
infoUrlService.remove(new QueryWrapper<InfoUrl>().eq("foreign_id", infoContentNew.getForeignId())); | |||||
if (infoUrlList.size() > 0) { | |||||
for (InfoUrl infoUrl : infoUrlList) { | |||||
infoUrl.setForeignId(infoContentNew.getForeignId()); | |||||
infoUrlService.save(infoUrl); | |||||
} | |||||
} | |||||
} | |||||
return ApiResult.result(true); | |||||
} | |||||
@Override | |||||
@Transactional | |||||
public ApiResult editInfoManage(InfoContentEditQueryParam infoContentEditQueryParam) { | |||||
if (null == infoContentEditQueryParam.getId()) { | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_ID_VERIFY); | |||||
} | |||||
InfoContent infoContentNew = this.getById(infoContentEditQueryParam.getId()); | |||||
if (null == infoContentNew) { | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
} | |||||
BeanUtils.copyProperties(infoContentEditQueryParam, infoContentNew); | |||||
infoContentNew.setUpdateTime(new Date()); | |||||
InfoDetail infoDetail = infoContentEditQueryParam.getInfoDetail(); | |||||
if (null != infoDetail) { | |||||
if (StringUtil.isEmpty(infoContentNew.getForeignId())) { | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_ID_VERIFY); | |||||
} | |||||
InfoDetail infoDetailNew = infoDetailService.getOne(new QueryWrapper<InfoDetail>().eq("foreign_id", infoContentNew.getForeignId())); | |||||
if (null != infoDetailNew) { | |||||
if (null == infoDetailNew.getId()) { | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
} | |||||
Long detailId = infoDetailNew.getId(); | |||||
BeanUtils.copyProperties(infoDetail, infoDetailNew); | |||||
infoDetailNew.setId(detailId); | |||||
infoDetailService.saveOrUpdate(infoDetailNew); | |||||
} | |||||
} | |||||
this.updateById(infoContentNew); | |||||
//附件先删除再添加 | |||||
List<InfoAttachment> infoAttachmentList = infoContentEditQueryParam.getAttachmentList(); | |||||
if (null != infoAttachmentList) { | |||||
//不为空 等于0就删除 | |||||
infoAttachmentService.remove(new QueryWrapper<InfoAttachment>().eq("foreign_id", infoContentNew.getForeignId())); | |||||
if (infoAttachmentList.size() > 0) { | |||||
for (InfoAttachment infoAttachment : infoAttachmentList) { | |||||
infoAttachment.setForeignId(infoContentNew.getForeignId()); | |||||
infoAttachmentService.save(infoAttachment); | |||||
} | |||||
} | |||||
} | |||||
//url先删除再添加 | |||||
List<InfoUrl> infoUrlList = infoContentEditQueryParam.getUrlList(); | |||||
if (null != infoUrlList) { | |||||
//不为空 等于0就删除 | |||||
infoUrlService.remove(new QueryWrapper<InfoUrl>().eq("foreign_id", infoContentNew.getForeignId())); | |||||
if (infoUrlList.size() > 0) { | if (infoUrlList.size() > 0) { | ||||
for (InfoUrl infoUrl : infoUrlList) { | for (InfoUrl infoUrl : infoUrlList) { | ||||
infoUrl.setForeignId(infoContentAddQueryParam.getForeignId()); | |||||
infoUrl.setForeignId(infoContentNew.getForeignId()); | |||||
infoUrlService.save(infoUrl); | infoUrlService.save(infoUrl); | ||||
} | } | ||||
} | } | ||||
infoContent.setState(InfoStateTypeEnum.INFO_STATE_TYPE_FINAL_AUDIT_NOPASS.getCode()); | infoContent.setState(InfoStateTypeEnum.INFO_STATE_TYPE_FINAL_AUDIT_NOPASS.getCode()); | ||||
} | } | ||||
infoContent.setUpdateTime(new Date()); | infoContent.setUpdateTime(new Date()); | ||||
infoContent.setOrderAuditTime(new Date()); | |||||
infoContent.setFinalAuditTime(new Date()); | infoContent.setFinalAuditTime(new Date()); | ||||
infoContent.setFinalAuditUser(getUserId()); | infoContent.setFinalAuditUser(getUserId()); | ||||
this.saveOrUpdate(infoContent); | this.saveOrUpdate(infoContent); | ||||
} | } | ||||
if (infoContent.getIstop().equals(StateEnum.ENABLE.getKey())) { | if (infoContent.getIstop().equals(StateEnum.ENABLE.getKey())) { | ||||
infoContent.setIstop(StateEnum.DISABLE.getKey()); | infoContent.setIstop(StateEnum.DISABLE.getKey()); | ||||
infoContent.setIstopTime(null); | |||||
} else { | } else { | ||||
infoContent.setIstop(StateEnum.ENABLE.getKey()); | infoContent.setIstop(StateEnum.ENABLE.getKey()); | ||||
infoContent.setIstopTime(new Date()); | infoContent.setIstopTime(new Date()); | ||||
/** | /** | ||||
* 首页显示新闻信息 | |||||
* 首页显示新闻信息 单类型模糊匹配 | |||||
* @param infoContentHomePageQueryParam | * @param infoContentHomePageQueryParam | ||||
* @return | * @return | ||||
*/ | */ | ||||
return ApiResult.ok(infoContentMapper.getHomePageInfo(infoContentHomePageQueryParam)); | return ApiResult.ok(infoContentMapper.getHomePageInfo(infoContentHomePageQueryParam)); | ||||
} | } | ||||
/** | |||||
* 首页显示新闻 多类型全匹配 | |||||
* @param infoContentHomePageListParam | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public ApiResult getHomePagesInfo(InfoContentHomePageListParam infoContentHomePageListParam) { | |||||
return ApiResult.ok(infoContentMapper.getHomePagesInfo(infoContentHomePageListParam)); | |||||
} | |||||
/** | /** | ||||
* 首页搜索信息 | * 首页搜索信息 | ||||
return new PageTool(iPage); | return new PageTool(iPage); | ||||
} | } | ||||
@Override | |||||
public PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception { | |||||
Page page = setPageParam(infoContentWebSearchListParam); | |||||
List<String> typeIds = infoContentWebSearchListParam.getTypeIds(); | |||||
if(null!=typeIds&&typeIds.size()>0) { | |||||
StringBuffer s = new StringBuffer(""); | |||||
for (String typeId : typeIds | |||||
) { | |||||
s.append(typeId).append(","); | |||||
} | |||||
infoContentWebSearchListParam.setTypeId(s.substring(0, s.length() - 1)); | |||||
}else{ | |||||
infoContentWebSearchListParam.setTypeId(null); | |||||
} | |||||
IPage<InfoContentWebSearchQueryVo> iPage = infoContentMapper.getSearchWebsInfo(page, infoContentWebSearchListParam); | |||||
return new PageTool(iPage); | |||||
} | |||||
/** | /** | ||||
* 发布列表 | * 发布列表 | ||||
* @param infoContentBackSearchQueryParam | * @param infoContentBackSearchQueryParam |
package com.xdf.creative.module.service.impl; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 11:28 2020/4/11 | |||||
*/ | |||||
import com.xdf.creative.base.params.VerifyCode; | |||||
import com.xdf.creative.module.service.IVerifyCodeGen; | |||||
import com.xdf.creative.util.RandomUtils; | |||||
import org.slf4j.Logger; | |||||
import org.slf4j.LoggerFactory; | |||||
import javax.imageio.ImageIO; | |||||
import java.awt.*; | |||||
import java.awt.image.BufferedImage; | |||||
import java.io.ByteArrayOutputStream; | |||||
import java.io.IOException; | |||||
import java.io.OutputStream; | |||||
import java.util.Random; | |||||
/** | |||||
* 验证码实现类 | |||||
*/ | |||||
public class SimpleCharVerifyCodeGenImpl implements IVerifyCodeGen { | |||||
private static final Logger logger = LoggerFactory.getLogger(SimpleCharVerifyCodeGenImpl.class); | |||||
private static final String[] FONT_TYPES = { "\u5b8b\u4f53", "\u65b0\u5b8b\u4f53", "\u9ed1\u4f53", "\u6977\u4f53", "\u96b6\u4e66" }; | |||||
private static final int VALICATE_CODE_LENGTH = 4; | |||||
/** | |||||
* 设置背景颜色及大小,干扰线 | |||||
* | |||||
* @param graphics | |||||
* @param width | |||||
* @param height | |||||
*/ | |||||
private static void fillBackground(Graphics graphics, int width, int height) { | |||||
// 填充背景 | |||||
graphics.setColor(Color.WHITE); | |||||
//设置矩形坐标x y 为0 | |||||
graphics.fillRect(0, 0, width, height); | |||||
Graphics2D g2 = (Graphics2D)graphics; //g是Graphics对象 | |||||
g2.setStroke(new BasicStroke(1.8f)); | |||||
// 加入干扰线条 | |||||
for (int i = 0; i < 8; i++) { | |||||
//设置随机颜色算法参数 | |||||
graphics.setColor(RandomUtils.randomColor(40, 150)); | |||||
Random random = new Random(); | |||||
int x = random.nextInt(width); | |||||
int y = random.nextInt(height); | |||||
int x1 = random.nextInt(width); | |||||
int y1 = random.nextInt(height); | |||||
graphics.drawLine(x, y, x1, y1); | |||||
} | |||||
} | |||||
/** | |||||
* 生成随机字符 | |||||
* | |||||
* @param width | |||||
* @param height | |||||
* @param os | |||||
* @return | |||||
* @throws IOException | |||||
*/ | |||||
@Override | |||||
public String generate(int width, int height, OutputStream os) throws IOException { | |||||
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); | |||||
Graphics graphics = image.getGraphics(); | |||||
fillBackground(graphics, width, height); | |||||
String randomStr = RandomUtils.randomString(VALICATE_CODE_LENGTH); | |||||
createCharacter(graphics, randomStr); | |||||
graphics.dispose(); | |||||
//设置JPEG格式 | |||||
ImageIO.write(image, "JPEG", os); | |||||
return randomStr; | |||||
} | |||||
/** | |||||
* 验证码生成 | |||||
* | |||||
* @param width | |||||
* @param height | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public VerifyCode generate(int width, int height) { | |||||
VerifyCode verifyCode = null; | |||||
try ( | |||||
//将流的初始化放到这里就不需要手动关闭流 | |||||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||||
) { | |||||
String code = generate(width, height, baos); | |||||
verifyCode = new VerifyCode(); | |||||
verifyCode.setCode(code); | |||||
verifyCode.setImgBytes(baos.toByteArray()); | |||||
} catch (IOException e) { | |||||
logger.error(e.getMessage(), e); | |||||
verifyCode = null; | |||||
} | |||||
return verifyCode; | |||||
} | |||||
/** | |||||
* 设置字符颜色大小 | |||||
* | |||||
* @param g | |||||
* @param randomStr | |||||
*/ | |||||
private void createCharacter(Graphics g, String randomStr) { | |||||
char[] charArray = randomStr.toCharArray(); | |||||
for (int i = 0; i < charArray.length; i++) { | |||||
//设置RGB颜色算法参数 | |||||
g.setColor(new Color(50 + RandomUtils.nextInt(100), | |||||
50 + RandomUtils.nextInt(100), 50 + RandomUtils.nextInt(100))); | |||||
//设置字体大小,类型 | |||||
g.setFont(new Font(FONT_TYPES[RandomUtils.nextInt(FONT_TYPES.length)], Font.BOLD, 35)); | |||||
//设置x y 坐标 | |||||
g.drawString(String.valueOf(charArray[i]), 20 * i + 15, 25 + RandomUtils.nextInt(8)); | |||||
} | |||||
} | |||||
} |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
import com.baomidou.mybatisplus.core.metadata.IPage; | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.xdf.creative.base.params.IdParam; | |||||
import com.xdf.creative.base.params.creative.*; | import com.xdf.creative.base.params.creative.*; | ||||
import com.xdf.creative.base.params.dt.DtRegionParam; | |||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | import com.xdf.creative.base.service.impl.BaseServiceImpl; | ||||
import com.xdf.creative.base.vo.creative.SysOrganizeBackVo; | import com.xdf.creative.base.vo.creative.SysOrganizeBackVo; | ||||
import com.xdf.creative.base.vo.creative.SysOrganizeQueryVo; | import com.xdf.creative.base.vo.creative.SysOrganizeQueryVo; | ||||
import com.xdf.creative.base.vo.dt.DtRegionVo; | |||||
import com.xdf.creative.constant.CommonConstant; | import com.xdf.creative.constant.CommonConstant; | ||||
import com.xdf.creative.enums.OrganizeTypeEnum; | import com.xdf.creative.enums.OrganizeTypeEnum; | ||||
import com.xdf.creative.enums.StateEnum; | import com.xdf.creative.enums.StateEnum; | ||||
import com.xdf.creative.enums.StatusCode; | import com.xdf.creative.enums.StatusCode; | ||||
import com.xdf.creative.enums.dt.InfoOperatorTypeEnum; | |||||
import com.xdf.creative.module.entity.*; | import com.xdf.creative.module.entity.*; | ||||
import com.xdf.creative.module.mapper.SysOrganizeMapper; | import com.xdf.creative.module.mapper.SysOrganizeMapper; | ||||
import com.xdf.creative.module.mapper.SysRegionMapper; | import com.xdf.creative.module.mapper.SysRegionMapper; | ||||
} | } | ||||
sysOrganize.setOrganizeName(sysOrganizeAddParkParam.getOrganizeName()).setCreateUserId(getUserId()).setPopedomId(sysRegion.getId()).setState(StateEnum.ENABLE.getKey()).setSystemCreate(StateEnum.DISABLE.getKey()).setOrganizeType(OrganizeTypeEnum.ORGANIZE_PARK.getCode()); | sysOrganize.setOrganizeName(sysOrganizeAddParkParam.getOrganizeName()).setCreateUserId(getUserId()).setPopedomId(sysRegion.getId()).setState(StateEnum.ENABLE.getKey()).setSystemCreate(StateEnum.DISABLE.getKey()).setOrganizeType(OrganizeTypeEnum.ORGANIZE_PARK.getCode()); | ||||
sysOrganize.setUpdateTime(new Date()); | |||||
this.saveOrUpdate(sysOrganize); | this.saveOrUpdate(sysOrganize); | ||||
SysOrganize sysOrganizeNew = this.getOne(new QueryWrapper<SysOrganize>().eq("organize_name", sysOrganizeAddParkParam.getOrganizeName())); | SysOrganize sysOrganizeNew = this.getOne(new QueryWrapper<SysOrganize>().eq("organize_name", sysOrganizeAddParkParam.getOrganizeName())); | ||||
if(null==sysOrganizeNew){ | if(null==sysOrganizeNew){ | ||||
return ApiResult.fail("园区添加失败,请重新再试!"); | return ApiResult.fail("园区添加失败,请重新再试!"); | ||||
} | } | ||||
boolean isExists = sysUserService.isExistsByUsername(sysOrganizeAddParkParam.getUsername()); | |||||
if (isExists) { | |||||
throw new BusinessException(101001,"当前用户名已存在!"); | |||||
// return ApiResult.error(StatusCode.SYS_USER_NAME_EXIST); | |||||
} | |||||
SysUser sysUser =new SysUser(); | |||||
BeanUtils.copyProperties(sysOrganizeAddParkParam,sysUser); | |||||
String salt = UUIDUtil.getUUID(); | |||||
sysUser.setSalt(salt).setCreateUserId(getUserId()).setUserType(OrganizeTypeEnum.ORGANIZE_PARK.getCode()) | |||||
.setDeleted(StateEnum.DISABLE.getKey()).setCreateUserId(getUserId()).setOrganizeId(sysOrganize.getId()); | |||||
// 密码加密 | |||||
String newPassword = PasswordUtil.encrypt(sysUser.getPassword(), salt); | |||||
sysUser.setPassword(newPassword); | |||||
sysUser.setState(StateEnum.ENABLE.getKey()); | |||||
sysUserService.saveOrUpdate(sysUser); | |||||
//添加角色 | |||||
SysUser sysUserNew = sysUserService.getSysUserByUserName(sysUser.getUsername()); | |||||
SysUserRole sysUserRole = new SysUserRole(); | |||||
sysUserRole.setUserId(sysUserNew.getId()).setRoleId((long)3); | |||||
sysUserRoleService.saveOrUpdate(sysUserRole); | |||||
if (StateEnum.ENABLE.getKey().equals(sysOrganizeAddParkParam.getIsCreateUser()) | |||||
) { | |||||
boolean isExists = sysUserService.isExistsByUsername(sysOrganizeAddParkParam.getUsername()); | |||||
if (isExists) { | |||||
throw new BusinessException(101001, "当前用户名已存在!"); | |||||
// return ApiResult.error(StatusCode.SYS_USER_NAME_EXIST); | |||||
} | |||||
SysUser sysUser = new SysUser(); | |||||
BeanUtils.copyProperties(sysOrganizeAddParkParam, sysUser); | |||||
if(StringUtil.isEmpty(sysUser.getNickname())){ | |||||
sysUser.setNickname(sysOrganize.getOrganizeName()); | |||||
} | |||||
String salt = UUIDUtil.getUUID(); | |||||
sysUser.setSalt(salt).setCreateUserId(getUserId()).setUserType(OrganizeTypeEnum.ORGANIZE_PARK.getCode()) | |||||
.setDeleted(StateEnum.DISABLE.getKey()).setCreateUserId(getUserId()).setOrganizeId(sysOrganize.getId()); | |||||
// 密码加密 | |||||
String newPassword = PasswordUtil.encrypt(sysUser.getPassword(), salt); | |||||
sysUser.setPassword(newPassword); | |||||
sysUser.setState(StateEnum.ENABLE.getKey()); | |||||
sysUserService.saveOrUpdate(sysUser); | |||||
//添加角色 | |||||
SysUser sysUserNew = sysUserService.getSysUserByUserName(sysUser.getUsername()); | |||||
SysUserRole sysUserRole = new SysUserRole(); | |||||
sysUserRole.setUserId(sysUserNew.getId()).setRoleId((long) 3); | |||||
sysUserRoleService.saveOrUpdate(sysUserRole); | |||||
} | |||||
//初始化基本信息 | //初始化基本信息 | ||||
ParkDataTeam parkDataTeam = new ParkDataTeam(); | |||||
BeanUtils.copyProperties(sysOrganizeAddParkParam,parkDataTeam); | |||||
parkDataTeam.setName(sysOrganize.getOrganizeName()); | |||||
parkDataTeam.setStatus(StateEnum.ENABLE.getKey()); | |||||
parkDataTeamService.saveOrUpdate(parkDataTeam); | |||||
DtParkInfoDraft dtParkInfoDraft = new DtParkInfoDraft(); | DtParkInfoDraft dtParkInfoDraft = new DtParkInfoDraft(); | ||||
dtParkInfoDraft.setOrganizeId(sysOrganizeNew.getId()); | |||||
dtParkInfoDraft.setName(sysOrganizeNew.getOrganizeName()); | |||||
dtParkInfoDraft.setProvinceId((long)9); | |||||
dtParkInfoDraft.setCityId((long)72); | |||||
//本地库查询 | |||||
if(null!=sysRegion){ | |||||
DtRegionParam dtRegionParam = new DtRegionParam(); | |||||
dtRegionParam.setName(sysRegion.getRegionName()); | |||||
DtRegionVo dtRegionVo = sysRegionMapper.getParkRegion(dtRegionParam); | |||||
if(null!=dtRegionVo){ | |||||
dtParkInfoDraft.setDistrictId(dtRegionVo.getId()); | |||||
} | |||||
} | |||||
dtParkInfoDraft.setDistrictName(sysRegion.getRegionName()); | |||||
dtParkInfoDraft.setStatus(StateEnum.DISABLE.getKey()); | |||||
dtParkInfoDraft.setOperateType(InfoOperatorTypeEnum.INFO_OPERATOR_INIT.getCode()); | |||||
dtParkInfoDraft.setCreateTime(new Date()); | |||||
dtParkInfoDraft.setAddress(sysOrganizeAddParkParam.getAddress()); | |||||
dtParkInfoDraft.setContactor(sysOrganizeAddParkParam.getContactor()); | |||||
dtParkInfoDraft.setCntComCult(sysOrganizeAddParkParam.getCntComCult()); | |||||
dtParkInfoDraft.setCntComJoin(sysOrganizeAddParkParam.getCntComJoin()); | |||||
dtParkInfoDraft.setParentCom(sysOrganizeAddParkParam.getParentCom()); | |||||
dtParkInfoDraft.setPhone(sysOrganizeAddParkParam.getPhone()); | |||||
dtParkInfoDraft.setUpdateTime(new Date()); | |||||
dtParkInfoDraftService.saveOrUpdate(dtParkInfoDraft); | |||||
return ApiResult.ok(); | return ApiResult.ok(); | ||||
} | } | ||||
} | } | ||||
@Override | |||||
public ApiResult enabledOrganize(IdParam idParam) { | |||||
if(null == idParam){ | |||||
return ApiResult.fail("未选择组织"); | |||||
} | |||||
SysOrganize sysOrganize = this.getById(idParam.getId()); | |||||
if(null==sysOrganize){ | |||||
return ApiResult.error(StatusCode.FORM_SUBMIT_ID_VERIFY); | |||||
} | |||||
if(sysOrganize.getState().equals(StateEnum.ENABLE.getKey())){ | |||||
sysOrganize.setState(StateEnum.DISABLE.getKey()); | |||||
}else{ | |||||
sysOrganize.setState(StateEnum.ENABLE.getKey()); | |||||
} | |||||
this.saveOrUpdate(sysOrganize); | |||||
return ApiResult.ok(); | |||||
} | |||||
/** | /** | ||||
* 获取组织机构资源数 | * 获取组织机构资源数 | ||||
* | * |
//取最大角色id | //取最大角色id | ||||
SysRole sysRole = new SysRole(); | SysRole sysRole = new SysRole(); | ||||
BeanUtils.copyProperties(sysRoleQueryParam,sysRole); | BeanUtils.copyProperties(sysRoleQueryParam,sysRole); | ||||
List<SysRoleQueryVo> roleList = this.getUserRoleByUserId(getUserId()); | |||||
int level=99; | |||||
boolean sysTemRoleStatus = false; | |||||
for (SysRoleQueryVo sysRoleQueryVo:roleList | |||||
) { | |||||
if(sysRoleQueryVo.getLevel()<level){ | |||||
level = sysRoleQueryVo.getLevel(); | |||||
} | |||||
if(StateEnum.DISABLE.getKey().equals(sysRoleQueryVo.getType())){ | |||||
sysTemRoleStatus = true; | |||||
} | |||||
} | |||||
if(sysTemRoleStatus){ | |||||
sysRole.setLevel(level+1); | |||||
}else{ | |||||
sysRole.setLevel(level); | |||||
} | |||||
if (sysRoleManage.size() > 0) { | if (sysRoleManage.size() > 0) { | ||||
sysRole.setCode("role"+sysRoleManage.get(0).getId()); | sysRole.setCode("role"+sysRoleManage.get(0).getId()); | ||||
}else{ | }else{ | ||||
*/ | */ | ||||
@Override | @Override | ||||
public ApiResult getRoleList() { | public ApiResult getRoleList() { | ||||
return ApiResult.ok(sysRoleMapper.getRoleList()); | |||||
List<SysRoleQueryVo> roleList = this.getUserRoleByUserId(getUserId()); | |||||
int level=99; | |||||
for (SysRoleQueryVo sysRoleQueryVo:roleList | |||||
) { | |||||
if(sysRoleQueryVo.getLevel()<level){ | |||||
level = sysRoleQueryVo.getLevel(); | |||||
} | |||||
} | |||||
return ApiResult.ok(sysRoleMapper.getRoleList(level)); | |||||
} | } | ||||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | import com.xdf.creative.base.service.impl.BaseServiceImpl; | ||||
import com.xdf.creative.base.vo.creative.*; | import com.xdf.creative.base.vo.creative.*; | ||||
import com.xdf.creative.enums.*; | import com.xdf.creative.enums.*; | ||||
import com.xdf.creative.enums.dt.AuditInfoStateEnum; | |||||
import com.xdf.creative.enums.dt.InfoStateTypeEnum; | |||||
import com.xdf.creative.module.entity.*; | import com.xdf.creative.module.entity.*; | ||||
import com.xdf.creative.module.mapper.SysUserMapper; | import com.xdf.creative.module.mapper.SysUserMapper; | ||||
import com.xdf.creative.module.service.*; | import com.xdf.creative.module.service.*; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
import javax.servlet.http.HttpServletRequest; | |||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.lang.reflect.Method; | import java.lang.reflect.Method; | ||||
import java.time.Duration; | import java.time.Duration; | ||||
@Autowired | @Autowired | ||||
private SysRegionService sysRegionService; | private SysRegionService sysRegionService; | ||||
@Autowired | |||||
private DtInfoAuditService dtInfoAuditService; | |||||
/*登录*/ | /*登录*/ | ||||
@Override | @Override | ||||
public ApiResult login(LoginParam loginParam) throws Exception { | |||||
public ApiResult login(LoginParam loginParam, HttpServletRequest request) throws Exception { | |||||
// 校验验证码 | // 校验验证码 | ||||
/* if (!CodeUtil.checkVerifyCode(request,loginParam.getVerifyCodeActual())) { | |||||
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) { | ||||
if (sysRegion == null) { | if (sysRegion == null) { | ||||
return ApiResult.fail("所属辖区不存在"); | return ApiResult.fail("所属辖区不存在"); | ||||
} | } | ||||
//检测园区审核信息是否存在 | |||||
if(OrganizeTypeEnum.ORGANIZE_PARK.getCode().equals(sysOrganizeQueryVo.getOrganizeType())){ | |||||
List<DtInfoAudit> dtInfoAuditList = dtInfoAuditService.list(new QueryWrapper<DtInfoAudit>().eq("organize_id",sysOrganizeQueryVo.getId()).eq("audit_type",OrganizeTypeEnum.ORGANIZE_PARK.getCode()).orderByDesc("submit_time")); | |||||
if(dtInfoAuditList.size()<=0){ | |||||
DtInfoAudit dtInfoAuditNew = new DtInfoAudit(); | |||||
dtInfoAuditNew.setAuditState(AuditInfoStateEnum.PROJECT_ADUIT_STATE_INIT.getCode()); | |||||
dtInfoAuditNew.setAuditType(sysOrganizeQueryVo.getOrganizeType()); | |||||
dtInfoAuditNew.setSubmitTime(new Date()); | |||||
dtInfoAuditNew.setOrganizeId(sysOrganizeQueryVo.getId()); | |||||
dtInfoAuditNew.setSubmitUserId(sysUser.getId()); | |||||
dtInfoAuditNew.setInfoState(InfoStateTypeEnum.DRAFT.getCode()); | |||||
dtInfoAuditNew.setUpdateTime(new Date()); | |||||
dtInfoAuditService.saveOrUpdate(dtInfoAuditNew); | |||||
} | |||||
} | |||||
// 将系统用户对象转换成登陆用户对象 | // 将系统用户对象转换成登陆用户对象 | ||||
LoginSysUserVo loginSysUserVo = SysUserConvert.INSTANCE.sysUserToLoginSysUserVo(sysUser); | LoginSysUserVo loginSysUserVo = SysUserConvert.INSTANCE.sysUserToLoginSysUserVo(sysUser); | ||||
return ApiResult.error(StatusCode.SYS_USER_NAME_EXIST); | return ApiResult.error(StatusCode.SYS_USER_NAME_EXIST); | ||||
} | } | ||||
SysRole sysRole =sysRoleService.getById(sysUserAddQueryParam.getRoleId()); | SysRole sysRole =sysRoleService.getById(sysUserAddQueryParam.getRoleId()); | ||||
// | |||||
List<SysRoleQueryVo> sysRoleQueryVoList = sysRoleService.getUserRoleByUserId(getUserId()); | |||||
boolean roleFlag = true; | |||||
for (SysRoleQueryVo sysRoleQueryVo:sysRoleQueryVoList | |||||
) { | |||||
if(sysRoleQueryVo.getLevel()<sysRole.getLevel()){ | |||||
roleFlag = false; | |||||
} | |||||
} | |||||
if(roleFlag){ | |||||
return ApiResult.fail("非法授权!"); | |||||
} | |||||
if(null==sysUserAddQueryParam.getRoleId()||null==sysRole){ | if(null==sysUserAddQueryParam.getRoleId()||null==sysRole){ | ||||
return ApiResult.error(StatusCode.SYS_USER_ROLE_VERIFY_EXIST); | return ApiResult.error(StatusCode.SYS_USER_ROLE_VERIFY_EXIST); | ||||
} | } | ||||
// if(null==sysUserAddQueryParam.getRoleId()||null==sysRole){ | // if(null==sysUserAddQueryParam.getRoleId()||null==sysRole){ | ||||
// return ApiResult.error(StatusCode.SYS_USER_ROLE_VERIFY_EXIST); | // return ApiResult.error(StatusCode.SYS_USER_ROLE_VERIFY_EXIST); | ||||
// } | // } | ||||
if(null==sysUserAddParkParam.getOrganizeId()){ | |||||
return ApiResult.fail("请选择正确的园区!"); | |||||
} | |||||
SysOrganize sysOrganize = sysOrganizeService.getById(sysUserAddParkParam.getOrganizeId()); | SysOrganize sysOrganize = sysOrganizeService.getById(sysUserAddParkParam.getOrganizeId()); | ||||
if( null==sysUserAddParkParam.getOrganizeId()||null==sysOrganize){ | if( null==sysUserAddParkParam.getOrganizeId()||null==sysOrganize){ | ||||
return ApiResult.fail("所选机构不存在!"); | return ApiResult.fail("所选机构不存在!"); | ||||
if(StateEnum.ENABLE.getKey().equals(sysUser.getState())){ | if(StateEnum.ENABLE.getKey().equals(sysUser.getState())){ | ||||
return ApiResult.error(StatusCode.SYS_USER_NAME_STATE_EXIST); | return ApiResult.error(StatusCode.SYS_USER_NAME_STATE_EXIST); | ||||
} | } | ||||
sysUser.setState(StateEnum.DISABLE.getKey()); | |||||
sysUser.setDeleted(StateEnum.ENABLE.getKey()); | |||||
sysUser.setUpdateTime(new Date()); | sysUser.setUpdateTime(new Date()); | ||||
sysUserRoleService.remove(new QueryWrapper<SysUserRole>().eq("user_id",sysUser.getId())); | sysUserRoleService.remove(new QueryWrapper<SysUserRole>().eq("user_id",sysUser.getId())); | ||||
this.saveOrUpdate(sysUser); | this.saveOrUpdate(sysUser); | ||||
public ApiResult getSysUserById() { | public ApiResult getSysUserById() { | ||||
Long userId =getUserId(); | Long userId =getUserId(); | ||||
if(null==userId){ | if(null==userId){ | ||||
return ApiResult.fail("身份验证失败!"); | |||||
return ApiResult.fail(ApiCode.TOKEN_INVALID); | |||||
} | } | ||||
SysUser sysUser = this.getById(userId); | SysUser sysUser = this.getById(userId); | ||||
if(null ==sysUser){ | if(null ==sysUser){ |
@Override | @Override | ||||
public PageTool<WebParkEnterQueryVo> getWebParkEnterPageList(WebParkEnterQueryParam webParkEnterQueryParam) throws Exception { | public PageTool<WebParkEnterQueryVo> getWebParkEnterPageList(WebParkEnterQueryParam webParkEnterQueryParam) throws Exception { | ||||
if(OrganizeTypeEnum.ORGANIZE_PARK.getCode().equals(getOrganizeType())||OrganizeTypeEnum.ORGANIZE_CITY.getCode().equals(getOrganizeType())||OrganizeTypeEnum.ORGANIZE_DISTRICT.getCode().equals(getOrganizeType())){ | |||||
if(OrganizeTypeEnum.ORGANIZE_PARK.getCode().equals(getOrganizeType())){ | |||||
webParkEnterQueryParam.setParkId(getOrganizeId()); | webParkEnterQueryParam.setParkId(getOrganizeId()); | ||||
}else if(OrganizeTypeEnum.ORGANIZE_CITY.getCode().equals(getOrganizeType())||OrganizeTypeEnum.ORGANIZE_DISTRICT.getCode().equals(getOrganizeType())||OrganizeTypeEnum.ORGANIZE_MANAGE.getCode().equals(getOrganizeType())){ | |||||
webParkEnterQueryParam.setRegionId(getRegionId("")); | |||||
} | } | ||||
Page page = setPageParam(webParkEnterQueryParam); | Page page = setPageParam(webParkEnterQueryParam); | ||||
IPage<WebParkEnterQueryVo> iPage = webParkEnterMapper.getWebParkEnterPageList(page, webParkEnterQueryParam); | IPage<WebParkEnterQueryVo> iPage = webParkEnterMapper.getWebParkEnterPageList(page, webParkEnterQueryParam); | ||||
return new PageTool(iPage); | return new PageTool(iPage); |
@Override | @Override | ||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | ||||
log.info(request.getRequestURI()); | |||||
String token = request.getHeader("Authorization"); | String token = request.getHeader("Authorization"); | ||||
if (null == token||StringUtil.isEmpty(token)||token.length()<50) { | if (null == token||StringUtil.isEmpty(token)||token.length()<50) { | ||||
ApiResult result = new ApiResult(); | ApiResult result = new ApiResult(); | ||||
* @return | * @return | ||||
*/ | */ | ||||
public boolean verifyToken(String token,HttpServletRequest request, HttpServletResponse response) { | |||||
public boolean verifyToken(String token,HttpServletRequest request, HttpServletResponse response) throws Exception { | |||||
String requestUrl = request.getRequestURI(); | String requestUrl = request.getRequestURI(); | ||||
ApiResult result = new ApiResult(); | ApiResult result = new ApiResult(); | ||||
//token失效 先检查是否存在 不存在则直接令牌过去重新登录 | //token失效 先检查是否存在 不存在则直接令牌过去重新登录 | ||||
getResponseResult(response, result); | getResponseResult(response, result); | ||||
return false; | return false; | ||||
} | } | ||||
/* 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)){ | ||||
result.setMsg(ApiCode.NOT_PERMISSION.getMsg()); | result.setMsg(ApiCode.NOT_PERMISSION.getMsg()); | ||||
getResponseResult(response, result); | getResponseResult(response, result); | ||||
return false; | return false; | ||||
}*/ | |||||
} | |||||
return true; | return true; |
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("/**"); //所有路径都被拦截 | |||||
registration.addPathPatterns("/wcapi/**"); //所有路径都被拦截 | |||||
registration.excludePathPatterns( //添加不拦截路径 | registration.excludePathPatterns( //添加不拦截路径 | ||||
skipAuthUrls | skipAuthUrls | ||||
); | ); |
private String password; | private String password; | ||||
@ApiModelProperty("验证码Token") | @ApiModelProperty("验证码Token") | ||||
private String verifyToken; | |||||
private String verifyCodeActual; | |||||
@ApiModelProperty("验证码") | @ApiModelProperty("验证码") | ||||
private String code; | private String code; | ||||
} | } |
package com.xdf.creative.util; | |||||
import javax.servlet.http.HttpServletRequest; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 11:02 2020/4/11 | |||||
*/ | |||||
public class CodeUtil { | |||||
/** | |||||
* 将获取到的前端参数转为string类型 | |||||
* @param request | |||||
* @param key | |||||
* @return | |||||
*/ | |||||
public static String getString(HttpServletRequest request, String key) { | |||||
try { | |||||
String result = request.getParameter(key); | |||||
if(result != null) { | |||||
result = result.trim(); | |||||
} | |||||
if("".equals(result)) { | |||||
result = null; | |||||
} | |||||
return result; | |||||
}catch(Exception e) { | |||||
return null; | |||||
} | |||||
} | |||||
/** | |||||
* 验证码校验 | |||||
* @param request | |||||
* @return | |||||
*/ | |||||
public static boolean checkVerifyCode(HttpServletRequest request,String code) { | |||||
//获取生成的验证码 | |||||
String verifyCodeExpected = (String) request.getSession().getAttribute(com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY); | |||||
//获取用户输入的验证码 | |||||
// String verifyCodeActual = CodeUtil.getString(request, "verifyCodeActual"); | |||||
if(code == null ||!code.equals(verifyCodeExpected)) { | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
} |
package com.xdf.creative.util; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 11:29 2020/4/11 | |||||
*/ | |||||
import java.awt.*; | |||||
import java.util.Random; | |||||
public class RandomUtils extends org.apache.commons.lang3.RandomUtils { | |||||
private static final char[] CODE_SEQ = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', | |||||
'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', | |||||
'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7', '8', '9' }; | |||||
private static final char[] NUMBER_ARRAY = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; | |||||
private static Random random = new Random(); | |||||
public static String randomString(int length) { | |||||
StringBuilder sb = new StringBuilder(); | |||||
for (int i = 0; i < length; i++) { | |||||
sb.append(String.valueOf(CODE_SEQ[random.nextInt(CODE_SEQ.length)])); | |||||
} | |||||
return sb.toString(); | |||||
} | |||||
public static String randomNumberString(int length) { | |||||
StringBuilder sb = new StringBuilder(); | |||||
for (int i = 0; i < length; i++) { | |||||
sb.append(String.valueOf(NUMBER_ARRAY[random.nextInt(NUMBER_ARRAY.length)])); | |||||
} | |||||
return sb.toString(); | |||||
} | |||||
public static Color randomColor(int fc, int bc) { | |||||
int f = fc; | |||||
int b = bc; | |||||
Random random = new Random(); | |||||
if (f > 255) { | |||||
f = 255; | |||||
} | |||||
if (b > 255) { | |||||
b = 255; | |||||
} | |||||
return new Color(f + random.nextInt(b - f), f + random.nextInt(b - f), f + random.nextInt(b - f)); | |||||
} | |||||
public static int nextInt(int bound) { | |||||
return random.nextInt(bound); | |||||
} | |||||
} |
case 888: | case 888: | ||||
uploadDir = ServiceFileDirEnum.SERVICE_PARK_ACTIVITY_DIR_OTHER.getName(); | uploadDir = ServiceFileDirEnum.SERVICE_PARK_ACTIVITY_DIR_OTHER.getName(); | ||||
break; | break; | ||||
case 776: | |||||
uploadDir = ServiceFileDirEnum.SERVICE_PARK_FILE_DIR_OTHER.getName(); | |||||
break; | |||||
case 777: | |||||
uploadDir = ServiceFileDirEnum.SERVICE_PARK_LOGO_DIR_OTHER.getName(); | |||||
break; | |||||
case 778: | |||||
uploadDir = ServiceFileDirEnum.SERVICE_PARK_QR_DIR_OTHER.getName(); | |||||
break; | |||||
case 999: | case 999: | ||||
uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_OTHER.getName(); | uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_OTHER.getName(); | ||||
break; | break; |
add("PNG"); | add("PNG"); | ||||
add("JPG"); | add("JPG"); | ||||
add("TXT"); | add("TXT"); | ||||
add("GIF"); | |||||
}}; | }}; | ||||
/** | /** |
package com.xdf.creative.util.image; | |||||
import sun.misc.BASE64Decoder; | |||||
import sun.misc.BASE64Encoder; | |||||
import java.io.File; | |||||
import java.io.FileInputStream; | |||||
import java.io.FileOutputStream; | |||||
/** | |||||
* @author : lgw | |||||
* @date : 13:26 2020/4/21 | |||||
*/ | |||||
public class FileToBase64 { | |||||
/** | |||||
* <p>将文件转成base64 字符串</p> | |||||
* | |||||
* @param path 文件路径 | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
public static String encodeBase64File(String path) throws Exception { | |||||
File file = new File(path); | |||||
FileInputStream inputFile = new FileInputStream(file); | |||||
byte[] buffer = new byte[(int) file.length()]; | |||||
inputFile.read(buffer); | |||||
inputFile.close(); | |||||
return new BASE64Encoder().encode(buffer); | |||||
} | |||||
/** | |||||
* <p>将base64字符解码保存文件</p> | |||||
* | |||||
* @param base64Code | |||||
* @param targetPath | |||||
* @throws Exception | |||||
*/ | |||||
public static void decoderBase64File(String base64Code, String targetPath) throws Exception { | |||||
byte[] buffer = new BASE64Decoder().decodeBuffer(base64Code); | |||||
FileOutputStream out = new FileOutputStream(targetPath); | |||||
out.write(buffer); | |||||
out.close(); | |||||
} | |||||
/** | |||||
* <p>将base64字符保存文本文件</p> | |||||
* | |||||
* @param base64Code | |||||
* @param targetPath | |||||
* @throws Exception | |||||
*/ | |||||
public static void toFile(String base64Code, String targetPath) throws Exception { | |||||
byte[] buffer = base64Code.getBytes(); | |||||
FileOutputStream out = new FileOutputStream(targetPath); | |||||
out.write(buffer); | |||||
out.close(); | |||||
} | |||||
public static void main(String[] args) { | |||||
try { | |||||
String base64Code = encodeBase64File("D:/xdf_image/xdf/wx/2020-04-16ab1fdb25cd9c45e590e0fb9bbd866df7.png"); | |||||
System.out.println(base64Code); | |||||
/*decoderBase64File(base64Code, "/Users/Crazy/Desktop/zyb.png"); | |||||
toFile(base64Code, "/Users/Crazy/Desktop/zyb.txt");*/ | |||||
} catch (Exception e) { | |||||
e.printStackTrace(); | |||||
} | |||||
} | |||||
} |
public static void main(String[] args) throws Exception { | public static void main(String[] args) throws Exception { | ||||
// String path ="https://mmbiz.qpic.cn/mmbiz_png/qdWB7wH8tTr9fREsrH8pjYA86OuqHoP2IAWiaicNW88AFWwQFALKb27tVFhIGHrWRNlD5dAtK07o6C4oe0t8ic15Q/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1"; | // String path ="https://mmbiz.qpic.cn/mmbiz_png/qdWB7wH8tTr9fREsrH8pjYA86OuqHoP2IAWiaicNW88AFWwQFALKb27tVFhIGHrWRNlD5dAtK07o6C4oe0t8ic15Q/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1"; | ||||
String path = "https://mmbiz.qpic.cn/mmbiz_jpg/mic9Ll6Oy4sP9xwic0EgKSSRfNmAAV9S0ukMicFFOxKThvRK1ejJY1Isz1EKhPOO3GWpbWsLS94HHib8e5Gm6Ir6hA/640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1"; | |||||
String path = "https://mmbiz.qpic.cn/sz_mmbiz_jpg/qZZ1X4EPLhJUxbNWkMicial0ASalv9CWNyRvjT9b7xbOp2PfuIZgTbpRxicosibQatjJTvicvtos6FichyibKBpuVPSgQ/640?wx_fmt=jpeg&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1"; | |||||
String filePath = "D:/xdf_image/xdf/"; | |||||
String fileType ="jpg"; | |||||
String filename ="2"; | |||||
readFileByUrl(filePath,filename,fileType,path); | |||||
//new一个URL对象 | //new一个URL对象 | ||||
} | } | ||||
conn.setRequestMethod("GET"); | conn.setRequestMethod("GET"); | ||||
//超时响应时间为5秒 | //超时响应时间为5秒 | ||||
conn.setConnectTimeout(5 * 1000); | conn.setConnectTimeout(5 * 1000); | ||||
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); | |||||
//通过输入流获取图片数据 | //通过输入流获取图片数据 | ||||
InputStream inStream = conn.getInputStream(); | InputStream inStream = conn.getInputStream(); | ||||
//得到图片的二进制数据,以二进制封装得到数据,具有通用性 | //得到图片的二进制数据,以二进制封装得到数据,具有通用性 |
@JSONField(name = "records") | @JSONField(name = "records") | ||||
@JsonProperty("records") | @JsonProperty("records") | ||||
private List<T> records = Collections.emptyList(); | private List<T> records = Collections.emptyList(); | ||||
public PageTool() { | public PageTool() { | ||||
} | } | ||||
public PageTool(IPage<T> iPage) { | public PageTool(IPage<T> iPage) { | ||||
this.total = iPage.getTotal(); | this.total = iPage.getTotal(); | ||||
this.records = iPage.getRecords(); | this.records = iPage.getRecords(); |
############################# ·ÃÎÊ·¾¶¡¢¶Ë¿Útomcat start ############################# | ############################# ·ÃÎÊ·¾¶¡¢¶Ë¿Útomcat start ############################# | ||||
auth_skip_urls=\ | auth_skip_urls=\ | ||||
/sysUser/login,\ | |||||
/sysUser/logout,\ | |||||
/infoContent/getHomePageInfo,\ | |||||
/infoContent/getSearchWebInfo,\ | |||||
/resource/**,\ | |||||
/infoType/**,\ | |||||
/infoContent/getWebInfoContent,\ | |||||
/error,\ | |||||
/sysPermission/getTreeMenusByUserId,\ | |||||
/sysPermission/currentUserResource,\ | |||||
/parkDataTeam/getWebPageList,\ | |||||
/parkDataTeam/info,\ | |||||
/webParkEnter/apply,\ | |||||
/dtParkActivity/getWebPageList | |||||
/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 | |||||
#upload_basePath=/mnt/dfzx/nfs01/dfzx_creative/ | #upload_basePath=/mnt/dfzx/nfs01/dfzx_creative/ |
address: | address: | ||||
port: 8999 | port: 8999 | ||||
servlet: | servlet: | ||||
context-path: / | |||||
context-path: /wcapi | |||||
tomcat: | tomcat: | ||||
max-threads: 1000 | max-threads: 1000 | ||||
min-spare-threads: 30 | min-spare-threads: 30 | ||||
max-http-header-size: 8192 | |||||
uri-encoding: utf-8 | uri-encoding: utf-8 | ||||
max-http-post-size: 2MB | |||||
location: classpath:banner.txt | location: classpath:banner.txt | ||||
profiles: | profiles: | ||||
active: dev | active: dev | ||||
datasource: | datasource: | ||||
multipart: | multipart: | ||||
enabled: true | enabled: true | ||||
max-file-size: 5MB | max-file-size: 5MB | ||||
max-request-size: 10MB | |||||
max-request-size: 2MB | |||||
############################ JWT start ############################# | ############################ JWT start ############################# |
<?xml version="1.0" encoding="UTF-8"?> | |||||
<beans xmlns="http://www.springframework.org/schema/beans" | |||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | |||||
<!-- 生成kaptcha的bean--> | |||||
<bean id="captchaProducer" class="com.google.code.kaptcha.impl.DefaultKaptcha"> | |||||
<property name="config"> | |||||
<bean class="com.google.code.kaptcha.util.Config"> | |||||
<constructor-arg type="java.util.Properties"> | |||||
<!--设置kaptcha属性 --> | |||||
<props> | |||||
<prop key = "kaptcha.border">no</prop> | |||||
<prop key="kaptcha.border.color">105,179,90</prop> | |||||
<prop key="kaptcha.textproducer.font.color">red</prop> | |||||
<prop key="kaptcha.image.width">100</prop> | |||||
<prop key="kaptcha.image.height">50</prop> | |||||
<prop key="kaptcha.textproducer.font.size">27</prop> | |||||
<prop key="kaptcha.session.key">code</prop> | |||||
<prop key="kaptcha.textproducer.char.length">4</prop> | |||||
<prop key="kaptcha.textproducer.font.names">微软雅黑</prop> | |||||
<prop key="kaptcha.textproducer.char.string">0123456789ABCEFGHIJKLMNOPQRSTUVWXYZ</prop> | |||||
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.WaterRipple</prop> | |||||
<prop key="kaptcha.noise.color">green</prop> | |||||
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.DefaultNoise</prop> | |||||
<prop key="kaptcha.background.clear.from">white</prop> | |||||
<prop key="kaptcha.background.clear.to">white</prop> | |||||
<prop key="kaptcha.textproducer.char.space">3</prop> | |||||
</props> | |||||
</constructor-arg> | |||||
</bean> | |||||
</property> | |||||
</bean> | |||||
</beans> |
<include refid="Base_Column_List"/> | <include refid="Base_Column_List"/> | ||||
from dt_info_audit where 1=1 | from dt_info_audit where 1=1 | ||||
<if test="auditType !=null and auditType !=''"> | <if test="auditType !=null and auditType !=''"> | ||||
AND audit_type = #{auditType,jdbcType=VARCHAR} | |||||
AND audit_type = #{auditType} | |||||
</if> | </if> | ||||
<if test="organizeId !=null and organizeId !=''"> | <if test="organizeId !=null and organizeId !=''"> | ||||
AND organize_id = #{organizeId,jdbcType=VARCHAR} | |||||
AND organize_id = #{organizeId} | |||||
</if> | </if> | ||||
</select> | </select> | ||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.xdf.creative.module.mapper.DtParkCompanyMapper"> | |||||
<!-- 通用查询结果列 --> | |||||
<sql id="Base_Column_List"> | |||||
${alias}.id, ${alias}.organize_id, ${alias}.create_time, ${alias}.create_user_id, ${alias}.path, ${alias}.file_type, ${alias}.state | |||||
</sql> | |||||
<sql id="Base_User_Column_List"> | |||||
${alias}.username,${alias}.nickname | |||||
</sql> | |||||
<sql id="Base_Organize_Column_List"> | |||||
${alias}.organize_name | |||||
</sql> | |||||
<sql id="Base_If_Condition"> | |||||
<if test="param.createTime !=null and param.createTime!=''"> | |||||
and ${alias}.create_time=#{param.createTime} | |||||
</if> | |||||
<if test="param.fileType !=null and param.fileType!=''"> | |||||
and ${alias}.file_type=#{param.fileType} | |||||
</if> | |||||
<if test="param.state !=null and param.state!=''"> | |||||
and ${alias}.state=#{param.state} | |||||
</if> | |||||
</sql> | |||||
<sql id="Base_Organize_If_Condition"> | |||||
<if test="param.organizeName !=null and param.organizeName!=''"> | |||||
and ${alias}.organize_name like CONCAT('%',#{param.organizeName},'%') | |||||
</if> | |||||
</sql> | |||||
<sql id="Base_User_If_Condition"> | |||||
<if test="param.userName !=null and param.userName!=''"> | |||||
and ${alias}.username like CONCAT('%',#{param.userName},'%') | |||||
</if> | |||||
<if test="param.nickName !=null and param.nickName!=''"> | |||||
and ${alias}.nickname like CONCAT('%',#{param.nickName},'%') | |||||
</if> | |||||
</sql> | |||||
<!--根据ID查询--> | |||||
<select id="getDtParkCompanyById" resultType="com.xdf.creative.base.vo.dt.DtParkCompanyQueryVo"> | |||||
select | |||||
<include refid="Base_Column_List"> | |||||
<property name="alias" value="a"/> | |||||
</include> | |||||
from dt_park_company a where a.id = #{id} | |||||
</select> | |||||
<!--分页查询--> | |||||
<select id="getDtParkCompanyPageList" | |||||
resultType="com.xdf.creative.base.vo.dt.DtParkCompanyQueryVo" | |||||
parameterType="com.xdf.creative.base.params.dt.DtParkCompanyQueryParam"> | |||||
select | |||||
<include refid="Base_Column_List"> | |||||
<property name="alias" value="a"/> | |||||
</include>, | |||||
<include refid="Base_User_Column_List"> | |||||
<property name="alias" value="b"/> | |||||
</include>, | |||||
<include refid="Base_Organize_Column_List"> | |||||
<property name="alias" value="c"/> | |||||
</include> | |||||
from dt_park_company a left join sys_user b on a.create_user_id = b.id left join sys_organize c on b.organize_id = c.id | |||||
<where> | |||||
<include refid="Base_If_Condition"> | |||||
<property name="alias" value="a"/> | |||||
</include> | |||||
<include refid="Base_User_If_Condition"> | |||||
<property name="alias" value="b "/> | |||||
</include> | |||||
<include refid="Base_Organize_If_Condition"> | |||||
<property name="alias" value="c"/> | |||||
</include> | |||||
</where> | |||||
</select> | |||||
</mapper> |
<!-- 通用查询结果列 --> | <!-- 通用查询结果列 --> | ||||
<sql id="Base_Column_List"> | <sql id="Base_Column_List"> | ||||
id, name, province_id, city_id, district_id, district_name, address, longitude, latitude, old_new, contactor, contactor_pos, mobile, phone, area_build, area_ocup, area_lice, area_lease, cnt_com_join, cnt_com_cult, cnt_mg_staff, cnt_join_staff, cnt_pub_plat, cnt_bands_com, cnt_high_staff, parent_com, enter_status, status, create_time, update_time, new_address,date_park_id | |||||
id, name, province_id, city_id, district_id, district_name, address, longitude, latitude, old_new, contactor, contactor_pos, mobile, phone, area_build, area_ocup, area_lice, area_lease, cnt_com_join, cnt_com_cult, cnt_mg_staff, cnt_join_staff, cnt_pub_plat, cnt_bands_com, cnt_high_staff, parent_com, enter_status, status, create_time, update_time, new_address,intro,date_park_id,policy,serve,logo,qr,address_ap | |||||
</sql> | </sql> | ||||
<sql id="Base_If_Condition"> | <sql id="Base_If_Condition"> |
<if test="param.typeId !=null and param.typeId!=''"> | <if test="param.typeId !=null and param.typeId!=''"> | ||||
and b.type_id like CONCAT('',#{param.typeId},'%') | and b.type_id like CONCAT('',#{param.typeId},'%') | ||||
</if> | </if> | ||||
order by a.istop DESC,a.sort | |||||
DESC,a.final_audit_time DESC LIMIT #{param.contentSize} | |||||
order by a.istop DESC,a.istop_time DESC,a.order_audit_time DESC,a.sort | |||||
DESC,a.final_audit_time DESC LIMIT #{param.contentSize} | |||||
</select> | |||||
<!-- order by a.istop DESC,a.sort | |||||
DESC,a.final_audit_time DESC LIMIT #{param.contentSize}--> | |||||
<!--首页获取信息--> | |||||
<select id="getHomePagesInfo" | |||||
resultType="com.xdf.creative.base.vo.creative.InfoContentHomePageQueryVo" | |||||
parameterType="com.xdf.creative.base.params.creative.InfoContentHomePageListParam"> | |||||
select | |||||
a.id,a.title,a.final_audit_time,a.sort,a.image_url,a.istop,a.istop_time,b.type_id,b.info_name,c.hyperlink,a.content_type | |||||
from info_content a | |||||
left join info_type b on a.info_type_id =b.id | |||||
left join info_detail c on a.foreign_id = c.foreign_id | |||||
where a.deleted=0 and a.online_type=1 and a.state = 3 and b.type_id | |||||
in ( | |||||
<foreach collection="typeIds" separator="," item="typeId" index="index"> | |||||
#{typeId} | |||||
</foreach> | |||||
) | |||||
order by a.istop DESC,a.istop_time DESC,a.order_audit_time DESC,a.sort | |||||
DESC,a.final_audit_time DESC LIMIT #{contentSize} | |||||
</select> | </select> | ||||
<select id="getSearchWebInfo" | <select id="getSearchWebInfo" | ||||
resultType="com.xdf.creative.base.vo.creative.InfoContentWebSearchQueryVo" | resultType="com.xdf.creative.base.vo.creative.InfoContentWebSearchQueryVo" | ||||
parameterType="com.xdf.creative.base.params.creative.InfoContentWebSearchQueryParam"> | parameterType="com.xdf.creative.base.params.creative.InfoContentWebSearchQueryParam"> | ||||
</select> | </select> | ||||
<select id="getSearchWebsInfo" | |||||
resultType="com.xdf.creative.base.vo.creative.InfoContentWebSearchQueryVo" | |||||
parameterType="com.xdf.creative.base.params.creative.InfoContentWebSearchListParam"> | |||||
<!-- select a.id,a.title,a.final_audit_time,a.image_url,a.sort,a.istop,a.istop_time,b.type_id,b.info_name,c.digest,c.hyperlink,a.content_type | |||||
from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on a.info_type_id =b.id where | |||||
a.deleted=0 and a.online_type=1 and a.state = 3 | |||||
<if test="param.typeId !=null and param.typeId!=''"> | |||||
and b.type_id like CONCAT('',#{param.typeId},'%') | |||||
</if> | |||||
<if test="param.title !=null and param.title!=''"> | |||||
and ( a.title like CONCAT('%',#{param.title},'%') | |||||
or c.digest like CONCAT('%',#{param.title},'%') | |||||
or c.content like CONCAT('%',#{param.title},'%') | |||||
) | |||||
</if>--> | |||||
select | |||||
a.id,a.title,a.final_audit_time,a.image_url,a.sort,a.istop,a.istop_time,b.type_id,b.info_name,c.digest,c.hyperlink,a.content_type | |||||
from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on | |||||
a.info_type_id =b.id where | |||||
a.deleted=0 and a.online_type=1 and a.state = 3 | |||||
<if test="param.typeId !=null and param.typeId!=''"> | |||||
and b.type_id in (${param.typeId}) | |||||
</if> | |||||
<if test="param.title !=null and param.title!=''"> | |||||
and a.title like CONCAT('%',#{param.title},'%') | |||||
</if> | |||||
union select | |||||
a.id,a.title,a.final_audit_time,a.image_url,a.sort,a.istop,a.istop_time,b.type_id,b.info_name,c.digest,c.hyperlink,a.content_type | |||||
from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on | |||||
a.info_type_id =b.id where | |||||
a.deleted=0 and a.online_type=1 and a.state = 3 | |||||
<if test="param.typeId !=null and param.typeId!=''"> | |||||
and b.type_id in (${param.typeId}) | |||||
</if> | |||||
<if test="param.title !=null and param.title!=''"> | |||||
and a.title like CONCAT('%',#{param.title},'%') | |||||
</if> | |||||
union select | |||||
a.id,a.title,a.final_audit_time,a.image_url,a.sort,a.istop,a.istop_time,b.type_id,b.info_name,c.digest,c.hyperlink,a.content_type | |||||
from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on | |||||
a.info_type_id =b.id where | |||||
a.deleted=0 and a.online_type=1 and a.state = 3 | |||||
<if test="param.typeId !=null and param.typeId!=''"> | |||||
and b.type_id in (${param.typeId}) | |||||
</if> | |||||
<if test="param.title !=null and param.title!=''"> | |||||
and a.title like CONCAT('%',#{param.title},'%') | |||||
</if> | |||||
</select> | |||||
<select id="getInfoContentByAdd" resultType="com.xdf.creative.base.vo.creative.InfoContentBackSearchQueryVo" | <select id="getInfoContentByAdd" resultType="com.xdf.creative.base.vo.creative.InfoContentBackSearchQueryVo" | ||||
parameterType="com.xdf.creative.base.params.creative.InfoContentBackSearchQueryParam"> | parameterType="com.xdf.creative.base.params.creative.InfoContentBackSearchQueryParam"> | ||||
select | select | ||||
</include> | </include> | ||||
, | , | ||||
d.reason,d.back_time | d.reason,d.back_time | ||||
from (select m.* from info_content m where m.info_type_id in(select info_type_id from info_role_type where role_id in (select role_id from sys_user_role where user_id = #{param.userId})))a left join info_type b on a.info_type_id =b.id left join sys_user c on a.create_user = c.id | |||||
left join (select * from info_back order by back_time desc limit 1 )d on a.id =d.info_id | |||||
from (select m.* from info_content m where m.info_type_id in(select info_type_id from info_role_type where role_id in (select role_id from sys_user_role where user_id = #{param.userId})))a left join info_type b on a.info_type_id =b.id left join sys_user c on a.create_user = c.id left join (select * from info_back where id in(select max(id) as id from info_back GROUP BY info_id))d on a.id =d.info_id | |||||
<where> | <where> | ||||
a.deleted = 0 | a.deleted = 0 | ||||
<include refid="Base_If_Condition"> | <include refid="Base_If_Condition"> |
<!-- 通用查询结果列 --> | <!-- 通用查询结果列 --> | ||||
<sql id="Base_Column_List"> | <sql id="Base_Column_List"> | ||||
id, name, province_id, city_id, district_id, district_name, address, longitude, latitude, old_new, contactor, contactor_pos, mobile, phone, area_build, area_ocup, area_lice, area_lease, cnt_com_join, cnt_com_cult, cnt_mg_staff, cnt_join_staff, cnt_pub_plat, cnt_bands_com, cnt_high_staff, parent_com, enter_status, status, create_time, update_time, new_address,intro | |||||
id, name, province_id, city_id, district_id, district_name, address, longitude, latitude, old_new, contactor, contactor_pos,insert(mobile, 4, 4, '****') as mobile, insert( phone, 4, 4, '****') as phone, area_build, area_ocup, area_lice, area_lease, cnt_com_join, cnt_com_cult, cnt_mg_staff, cnt_join_staff, cnt_pub_plat, cnt_bands_com, cnt_high_staff, parent_com, enter_status, status, create_time, update_time, new_address,intro,policy,serve,logo,qr,address_ap,park_type | |||||
</sql> | </sql> | ||||
<sql id="Base_Select_Column_List"> | <sql id="Base_Select_Column_List"> | ||||
${alias}.id, ${alias}.name, ${alias}.district_id, ${alias}.district_name, ${alias}.address,${alias}.longitude, ${alias}.latitude, ${alias}.longitude, ${alias}.latitude, ${alias}.contactor, ${alias}.contactor_pos, ${alias}.mobile, ${alias}.phone, ${alias}.create_time, ${alias}.update_time, ${alias}.new_address,${alias}.cnt_com_join,${alias}.cnt_com_cult,${alias}.parent_com | |||||
${alias}.id, ${alias}.name, ${alias}.district_id, ${alias}.district_name, ${alias}.address,${alias}.longitude, ${alias}.latitude, ${alias}.longitude, ${alias}.latitude, ${alias}.contactor, ${alias}.contactor_pos,insert( | |||||
${alias}.mobile, 4, 4, '****') as mobile, insert( ${alias}.phone, 4, 4, '****') as phone, ${alias}.create_time, ${alias}.update_time, ${alias}.new_address,${alias}.cnt_com_join,${alias}.cnt_com_cult,${alias}.parent_com,${alias}.policy,${alias}.serve,${alias}.logo,${alias}.qr,${alias}.address_ap,${alias}.park_type | |||||
</sql> | </sql> | ||||
<property name="alias" value="a"/> | <property name="alias" value="a"/> | ||||
</include> | </include> | ||||
</where> | </where> | ||||
order by a.sort desc | |||||
</select> | </select> | ||||
<property name="alias" value="b"/> | <property name="alias" value="b"/> | ||||
</include> | </include> | ||||
</where> | </where> | ||||
order by a.update_time desc | |||||
</select> | </select> | ||||
and sp.deleted = 0 | and sp.deleted = 0 | ||||
) and state = 1 | ) and state = 1 | ||||
and deleted = 0 | and deleted = 0 | ||||
and (type = 2 or type = 1) | |||||
</select> | |||||
</select> | |||||
<!--and (type = 2 or type = 1)--> | |||||
<select id="getMenusByUserId" resultType="com.xdf.creative.module.entity.SysPermission" parameterType="java.lang.Long"> | <select id="getMenusByUserId" resultType="com.xdf.creative.module.entity.SysPermission" parameterType="java.lang.Long"> |
<if test="param.regionId !=null and param.regionId!=''"> | <if test="param.regionId !=null and param.regionId!=''"> | ||||
and b.region_id =#{param.regionId} | and b.region_id =#{param.regionId} | ||||
</if> | </if> | ||||
<if test="param.regionName !=null and param.regionName!=''"> | |||||
<if test="param.name !=null and param.name!=''"> | |||||
and b.region_name=#{param.name} | and b.region_name=#{param.name} | ||||
</if> | </if> | ||||
<!-- 查询角色列表--> | <!-- 查询角色列表--> | ||||
<select id="getRoleList" resultType="com.xdf.creative.base.vo.creative.SysRoleListQueryVo"> | <select id="getRoleList" resultType="com.xdf.creative.base.vo.creative.SysRoleListQueryVo"> | ||||
select id, name, code, remark,create_time from sys_role | |||||
select id, name, code, remark,create_time from sys_role where level>= #{level} order by level; | |||||
</select> | </select> | ||||
</if> | </if> | ||||
</sql> | </sql> | ||||
<sql id="Base_Region_If_Condition"> | |||||
<if test="param.regionId !=null and param.regionId!=''"> | |||||
and ${alias}.region_id like CONCAT('',#{param.regionId},'%') | |||||
</if> | |||||
</sql> | |||||
<!--根据ID查询--> | <!--根据ID查询--> | ||||
<include refid="Base_Organize_Column_List"> | <include refid="Base_Organize_Column_List"> | ||||
<property name="alias" value="b"/> | <property name="alias" value="b"/> | ||||
</include> | </include> | ||||
from web_park_enter a left join sys_organize b on a.park_id = b.id | |||||
from web_park_enter a left join sys_organize b on a.park_id = b.id left join sys_region c on b.popedom_id = c.id | |||||
<where> | <where> | ||||
<include refid="Base_If_Condition"> | <include refid="Base_If_Condition"> | ||||
<property name="alias" value="a"/> | <property name="alias" value="a"/> | ||||
<include refid="Base_Organize_If_Condition"> | <include refid="Base_Organize_If_Condition"> | ||||
<property name="alias" value="b"/> | <property name="alias" value="b"/> | ||||
</include> | </include> | ||||
<include refid="Base_Region_If_Condition"> | |||||
<property name="alias" value="c"/> | |||||
</include> | |||||
</where> | </where> | ||||
</select> | </select> | ||||