@@ -203,6 +203,13 @@ | |||
</exclusions> | |||
</dependency> | |||
<!-- kaptcha验证码 --> | |||
<dependency> | |||
<groupId>com.github.penggle</groupId> | |||
<artifactId>kaptcha</artifactId> | |||
<version>2.3.2</version> | |||
</dependency> | |||
</dependencies> | |||
@@ -7,6 +7,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties | |||
import org.springframework.boot.web.servlet.ServletComponentScan; | |||
import org.springframework.context.annotation.Bean; | |||
import org.springframework.context.annotation.ComponentScan; | |||
import org.springframework.context.annotation.ImportResource; | |||
import org.springframework.scheduling.annotation.EnableScheduling; | |||
import org.springframework.transaction.annotation.EnableTransactionManagement; | |||
import org.springframework.web.context.request.RequestContextListener; | |||
@@ -20,7 +21,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
@EnableTransactionManagement | |||
@SpringBootApplication | |||
@ServletComponentScan | |||
@EnableScheduling | |||
//@EnableScheduling | |||
@ImportResource(locations = {"classpath:kaptcha.xml"}) | |||
public class CreativeApplication { | |||
public static void main(String[] args) { |
@@ -0,0 +1,21 @@ | |||
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; | |||
} |
@@ -45,9 +45,9 @@ public class InfoContentAddQueryParam extends QueryParam { | |||
@ApiModelProperty(value = "内容类型 0、图文形式 1 、超链接形式") | |||
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 = "图片地址") | |||
private String imageUrl; |
@@ -0,0 +1,72 @@ | |||
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; | |||
} |
@@ -0,0 +1,34 @@ | |||
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; | |||
} |
@@ -0,0 +1,40 @@ | |||
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; | |||
} |
@@ -0,0 +1,49 @@ | |||
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; | |||
} |
@@ -108,6 +108,25 @@ public class DtParkInfoDraftUpdateParam extends QueryParam { | |||
@ApiModelProperty(value = "完整地址") | |||
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; | |||
} |
@@ -59,6 +59,8 @@ public class WebParkEnterQueryParam extends QueryParam { | |||
@ApiModelProperty(value = "结束创建时间") | |||
private Date endCreateTime; | |||
private String regionId; | |||
} |
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||
*/ | |||
public interface BaseService<T> extends IService<T> { | |||
Long getUserId(); | |||
Long getUserId() ; | |||
Long getOrganizeId(); | |||
@@ -56,4 +56,7 @@ public class SysRoleListQueryVo implements Serializable { | |||
private Date createTime; | |||
} |
@@ -65,4 +65,6 @@ public class SysRoleQueryVo implements Serializable { | |||
@ApiModelProperty(value = "修改时间") | |||
private Date updateTime; | |||
private Integer level; | |||
} |
@@ -45,6 +45,9 @@ public class DtParkActivityWebVo implements Serializable { | |||
@ApiModelProperty(value = "创建人id") | |||
private Long createUserId; | |||
@ApiModelProperty(value = "操作类型 0:初始 1:增加 2:修改 3:删除") | |||
private Integer operateType; | |||
private String userName; | |||
private String organizeName; |
@@ -0,0 +1,52 @@ | |||
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; | |||
} |
@@ -104,9 +104,28 @@ public class DtParkInfoDraftDetailVo implements Serializable { | |||
private Integer enterStatus; | |||
@ApiModelProperty(value = "简介") | |||
private String intro; | |||
@ApiModelProperty(value = "政策") | |||
private String policy; | |||
@ApiModelProperty(value = "服务") | |||
private String serve; | |||
@ApiModelProperty(value = "完整地址") | |||
private String newAddress; | |||
private Long dateParkId; | |||
private String logo; | |||
@ApiModelProperty(value = "二维码") | |||
private String qr; | |||
private String addressAp; | |||
} |
@@ -106,6 +106,19 @@ public class DtParkInfoDraftQueryVo implements Serializable { | |||
@ApiModelProperty(value = "状态:1正常 0待审核 -1已删除") | |||
private Integer status; | |||
@ApiModelProperty(value = "政策") | |||
private String policy; | |||
@ApiModelProperty(value = "服务") | |||
private String serve; | |||
@ApiModelProperty(value = "简介") | |||
private String intro; | |||
@ApiModelProperty(value = "添加时间") | |||
private Date createTime; | |||
@@ -124,4 +137,13 @@ public class DtParkInfoDraftQueryVo implements Serializable { | |||
@ApiModelProperty(value = "组织机构ID") | |||
private Long dateParkId; | |||
private String logo; | |||
@ApiModelProperty(value = "二维码") | |||
private String qr; | |||
@ApiModelProperty(value = "补充地址") | |||
private String addressAp; | |||
} |
@@ -120,4 +120,20 @@ public class ParkDataTeamQueryVo implements Serializable { | |||
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; | |||
} |
@@ -75,5 +75,28 @@ public class ParkDataTeamWebVo implements Serializable { | |||
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; | |||
} |
@@ -21,6 +21,7 @@ public class CorsFilter implements Filter { | |||
httpResponse.setHeader("Access-Control-Allow-Origin", httpRequest.getHeader("Origin")); | |||
httpResponse.setHeader("Access-Control-Allow-Methods", httpRequest.getMethod()); | |||
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")); | |||
XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( | |||
(HttpServletRequest) request); |
@@ -2,7 +2,9 @@ package com.xdf.creative.config; | |||
import java.io.IOException; | |||
import com.auth0.jwt.exceptions.JWTDecodeException; | |||
import com.xdf.creative.enums.ApiCode; | |||
import com.xdf.creative.enums.StatusCode; | |||
import com.xdf.creative.support.exception.SysLoginException; | |||
import com.xdf.creative.util.page.ApiResult; | |||
import org.springframework.web.bind.annotation.ExceptionHandler; | |||
@@ -16,6 +18,8 @@ public class CustomExceptionHandler { | |||
return ApiResult.fail("最大上传文件为5M,上传文件大小超出限制!"); | |||
} | |||
@ExceptionHandler(JWTDecodeException.class) | |||
public ApiResult jWTDecodeException(JWTDecodeException e) throws IOException { | |||
return ApiResult.fail(ApiCode.TOKEN_INVALID); | |||
} | |||
} |
@@ -17,9 +17,9 @@ import java.util.Calendar; | |||
import java.util.Date; | |||
@Slf4j | |||
@Getter | |||
/*@Getter | |||
@Setter | |||
@Configuration | |||
@Configuration*/ | |||
public class CustomScheduled implements SchedulingConfigurer { | |||
private String cron = "0 0 0 */1 * ?"; | |||
@@ -48,7 +48,7 @@ public class CustomScheduled implements SchedulingConfigurer { | |||
return new Runnable() { | |||
@Override | |||
public void run() { | |||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | |||
/* SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | |||
Date date = new Date(); | |||
Calendar calendar = Calendar.getInstance();//new一个Calendar类,把Date放进去 | |||
calendar.setTime(date); | |||
@@ -67,7 +67,7 @@ public class CustomScheduled implements SchedulingConfigurer { | |||
System.out.println(); | |||
} | |||
} | |||
log.error("后缀文件为"+indexFileName+"删除"); | |||
log.error("后缀文件为"+indexFileName+"删除");*/ | |||
} | |||
}; | |||
} |
@@ -0,0 +1,25 @@ | |||
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; | |||
} | |||
} | |||
*/ |
@@ -31,12 +31,17 @@ public enum ServiceFileDirEnum { | |||
//专项资金 | |||
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_FILE_DIR_OTHER(999, "other"); | |||
private Integer code; | |||
private String name; | |||
@@ -0,0 +1,88 @@ | |||
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); | |||
} | |||
} | |||
} |
@@ -9,6 +9,7 @@ import com.xdf.creative.base.vo.dt.DtInfoAuditBackVo; | |||
import com.xdf.creative.base.vo.dt.DtInfoAuditQueryVo; | |||
import com.xdf.creative.module.entity.DtInfoAudit; | |||
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.PageTool; | |||
import io.swagger.annotations.Api; | |||
@@ -62,6 +63,7 @@ public class DtInfoAuditController extends BaseController { | |||
*/ | |||
@PostMapping("/auditInfo") | |||
@ApiOperation(value = "修改DtInfoAudit对象", notes = "审核基本信息", response = ApiResult.class) | |||
@OperateLogger(name = "审核自主信息",attributeId="id",attributeName="organizeId") | |||
public ApiResult auditInfo(@Valid @RequestBody DtInfoAuditQueryAuiditParam dtInfoAuditQueryAuiditParam) throws Exception { | |||
return dtInfoAuditService.auditInfo(dtInfoAuditQueryAuiditParam); | |||
} |
@@ -0,0 +1,89 @@ | |||
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); | |||
} | |||
} | |||
@@ -6,9 +6,11 @@ import com.xdf.creative.enums.ServiceFileUploadTypeEnum; | |||
import com.xdf.creative.enums.StatusCode; | |||
import com.xdf.creative.module.entity.FileUploadQuery; | |||
import com.xdf.creative.module.service.FileClientService; | |||
import com.xdf.creative.util.StringUtil; | |||
import com.xdf.creative.util.UUIDUtil; | |||
import com.xdf.creative.util.file.ServerUploadDirUtil; | |||
import com.xdf.creative.util.file.UploadUtil; | |||
import com.xdf.creative.util.image.FileToBase64; | |||
import com.xdf.creative.util.page.ApiResult; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -87,6 +89,25 @@ public class FileUploadController { | |||
} | |||
} | |||
@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 | |||
*/ |
@@ -83,6 +83,17 @@ public class InfoContentController extends BaseController { | |||
} | |||
@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); | |||
} | |||
/** | |||
* 管理员初审信息 | |||
* | |||
@@ -209,6 +220,17 @@ public class InfoContentController extends BaseController { | |||
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); | |||
} | |||
/** | |||
* 首页搜索信息 | |||
*/ | |||
@@ -219,6 +241,14 @@ public class InfoContentController extends BaseController { | |||
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); | |||
} | |||
/** | |||
* 后台发布列表 | |||
*/ |
@@ -3,10 +3,7 @@ package com.xdf.creative.module.controller; | |||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
import com.xdf.creative.base.controller.BaseController; | |||
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.SysOrganizeQueryVo; | |||
import com.xdf.creative.base.vo.creative.SysOrganizeTreeVo; | |||
@@ -57,9 +54,20 @@ public class SysOrganizeController extends BaseController { | |||
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); | |||
} | |||
@@ -59,8 +59,8 @@ public class SysUserController extends BaseController { | |||
*/ | |||
@PostMapping("/login") | |||
@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); | |||
} | |||
@@ -0,0 +1,52 @@ | |||
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; | |||
} |
@@ -121,6 +121,7 @@ public class DtParkInfoDraft extends BaseEntity { | |||
@ApiModelProperty(value = "完整地址") | |||
private String newAddress; | |||
@ApiModelProperty(value = "操作类型 0:初始 1:增加 2:修改 3:删除") | |||
private Integer operateType; | |||
@@ -132,11 +133,29 @@ public class DtParkInfoDraft extends BaseEntity { | |||
@ApiModelProperty(value = "组织机构ID") | |||
private Long dateParkId; | |||
@ApiModelProperty(value = "政策") | |||
private String policy; | |||
@ApiModelProperty(value = "服务") | |||
private String serve; | |||
@ApiModelProperty(value = "简介") | |||
private String intro; | |||
private String logo; | |||
@ApiModelProperty(value = "二维码") | |||
private String qr; | |||
@ApiModelProperty(value = "补充地址") | |||
private String addressAp; | |||
private Long createUserId; | |||
@@ -1,6 +1,8 @@ | |||
package com.xdf.creative.module.entity; | |||
import com.baomidou.mybatisplus.annotation.FieldStrategy; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.xdf.creative.base.entity.BaseEntity; | |||
import io.swagger.annotations.ApiModel; | |||
@@ -79,6 +81,8 @@ public class InfoContent extends BaseEntity { | |||
@ApiModelProperty(value = "终审时间") | |||
private Date finalAuditTime; | |||
@ApiModelProperty(value = "终审排序时间") | |||
private Date orderAuditTime; | |||
@ApiModelProperty(value = "排序") | |||
private Integer sort; | |||
@@ -87,6 +91,7 @@ public class InfoContent extends BaseEntity { | |||
private Integer istop; | |||
@ApiModelProperty(value = "置顶时间") | |||
@TableField(strategy = FieldStrategy.IGNORED) | |||
private Date istopTime; | |||
@ApiModelProperty(value = "上下状态 0 下线 1上线") |
@@ -121,6 +121,27 @@ public class ParkDataTeam extends BaseEntity { | |||
@ApiModelProperty(value = "完整地址") | |||
private String newAddress; | |||
@ApiModelProperty(value = "政策") | |||
private String policy; | |||
@ApiModelProperty(value = "服务") | |||
private String serve; | |||
@ApiModelProperty(value = "简介") | |||
private String intro; | |||
private Integer sort; | |||
private String logo; | |||
@ApiModelProperty(value = "二维码") | |||
private String qr; | |||
@ApiModelProperty(value = "补充地址") | |||
private String addressAp; | |||
} |
@@ -66,5 +66,6 @@ public class SysRole extends BaseEntity { | |||
@ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除") | |||
private Integer deleted; | |||
private Integer level; | |||
} |
@@ -13,6 +13,7 @@ import org.apache.ibatis.annotations.Param; | |||
import org.springframework.stereotype.Repository; | |||
import java.io.Serializable; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
@@ -40,7 +41,7 @@ public interface DtInfoAuditMapper extends BaseMapper<DtInfoAudit> { | |||
* @param dtInfoAuditQueryOrganizeIdParam | |||
* @return | |||
*/ | |||
DtInfoAudit getInfoAuditByOrganize(DtInfoAuditQueryOrganizeIdParam dtInfoAuditQueryOrganizeIdParam); | |||
List<DtInfoAudit> getInfoAuditByOrganize(DtInfoAuditQueryOrganizeIdParam dtInfoAuditQueryOrganizeIdParam); | |||
/** |
@@ -0,0 +1,42 @@ | |||
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); | |||
} |
@@ -3,10 +3,7 @@ package com.xdf.creative.module.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.xdf.creative.base.params.creative.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.module.entity.InfoContent; | |||
import org.apache.ibatis.annotations.Param; | |||
@@ -34,11 +31,18 @@ public interface InfoContentMapper extends BaseMapper<InfoContent> { | |||
*/ | |||
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> getSearchWebsInfo(@Param("page") Page page, @Param("param") InfoContentWebSearchListParam infoContentWebSearchListParam); | |||
/** | |||
* 后台发布列表 |
@@ -31,7 +31,7 @@ public interface SysRegionMapper extends BaseMapper<SysRegion> { | |||
* @param dtRegionParam | |||
* @return | |||
*/ | |||
DtRegionVo getParkRegion(DtRegionParam dtRegionParam); | |||
DtRegionVo getParkRegion(@Param("param") DtRegionParam dtRegionParam); | |||
@@ -29,7 +29,7 @@ public interface SysRoleMapper extends BaseMapper<SysRole> { | |||
* 获取角色列表 | |||
* @return | |||
*/ | |||
List<SysRoleListQueryVo> getRoleList(); | |||
List<SysRoleListQueryVo> getRoleList(Integer level); | |||
/** |
@@ -0,0 +1,41 @@ | |||
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; | |||
} |
@@ -0,0 +1,38 @@ | |||
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; | |||
} | |||
@@ -34,6 +34,15 @@ public interface InfoContentService extends BaseService<InfoContent> { | |||
*/ | |||
ApiResult updateInfoContent(InfoContentAddQueryParam infoContentAddQueryParam); | |||
/** | |||
* 管理员修改内容信息 | |||
* @param infoContentEditQueryParam | |||
* @return | |||
*/ | |||
ApiResult editInfoManage(InfoContentEditQueryParam infoContentEditQueryParam); | |||
/** | |||
* 初审核内容信息 | |||
* @param infoContentAuditQueryParam | |||
@@ -91,6 +100,10 @@ public interface InfoContentService extends BaseService<InfoContent> { | |||
*/ | |||
ApiResult getHomePageInfo(InfoContentHomePageQueryParam infoContentHomePageQueryParam); | |||
ApiResult getHomePagesInfo(InfoContentHomePageListParam infoContentHomePageListParam); | |||
/** | |||
* 获取新闻搜索 | |||
* @param infoContentWebSearchQueryParam | |||
@@ -99,6 +112,9 @@ public interface InfoContentService extends BaseService<InfoContent> { | |||
*/ | |||
PageTool<InfoContentWebSearchQueryVo> getSearchWebInfo(InfoContentWebSearchQueryParam infoContentWebSearchQueryParam) throws Exception; | |||
PageTool<InfoContentWebSearchQueryVo> getSearchWebsInfo(InfoContentWebSearchListParam infoContentWebSearchListParam) throws Exception; | |||
/** | |||
* 后台发布列表 | |||
*/ |
@@ -1,5 +1,6 @@ | |||
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.service.BaseService; | |||
import com.xdf.creative.base.vo.creative.SysOrganizeBackVo; | |||
@@ -49,6 +50,13 @@ public interface SysOrganizeService extends BaseService<SysOrganize> { | |||
ApiResult editPark(SysOrganizeEditParam sysOrganizeAddParam) throws Exception; | |||
/** | |||
* 停用启用用户 | |||
* @param idParam | |||
* @return | |||
*/ | |||
ApiResult enabledOrganize(IdParam idParam); | |||
@@ -15,6 +15,7 @@ import com.xdf.creative.support.auth.LoginSysUserTokenVo; | |||
import com.xdf.creative.util.page.ApiResult; | |||
import com.xdf.creative.util.page.PageTool; | |||
import javax.servlet.http.HttpServletRequest; | |||
import java.io.Serializable; | |||
import java.util.Set; | |||
@@ -35,7 +36,7 @@ public interface SysUserService extends BaseService<SysUser> { | |||
* @return | |||
* @throws Exception | |||
*/ | |||
ApiResult login(LoginParam loginParam) throws Exception; | |||
ApiResult login(LoginParam loginParam, HttpServletRequest request) throws Exception; | |||
/** |
@@ -80,12 +80,18 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
@Override | |||
public ApiResult getOrganizeAuditInfo() { | |||
DtInfoAuditQueryOrganizeIdParam dtInfoAuditQueryOrganizeIdParam = new DtInfoAuditQueryOrganizeIdParam(); | |||
if (!OrganizeTypeEnum.ORGANIZE_PARK.getCode().equals(getOrganizeType())) { | |||
return ApiResult.fail("非园区账户,无权限访问!"); | |||
} | |||
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<>(); | |||
//如果为空就新建 | |||
if (null == dtInfoAudit) { | |||
if (dtInfoAuditList.size()<=0) { | |||
DtInfoAudit dtInfoAuditNew = new DtInfoAudit(); | |||
dtInfoAuditNew.setAuditState(AuditInfoStateEnum.PROJECT_ADUIT_STATE_INIT.getCode()); | |||
dtInfoAuditNew.setAuditType(getOrganizeType()); | |||
@@ -95,25 +101,28 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
dtInfoAuditNew.setInfoState(InfoStateTypeEnum.DRAFT.getCode()); | |||
dtInfoAuditNew.setUpdateTime(new Date()); | |||
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())); | |||
if (null == dtParkInfoDraft) { | |||
dtParkInfoDraft = new DtParkInfoDraft(); | |||
SysOrganize sysOrganize = sysOrganizeService.getById(getOrganizeId()); | |||
dtParkInfoDraft.setOrganizeId(getOrganizeId()); | |||
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()); | |||
if(null!=sysRegion){ | |||
if (null != sysRegion) { | |||
DtRegionParam dtRegionParam = new DtRegionParam(); | |||
dtRegionParam.setName(sysRegion.getRegionName()); | |||
DtRegionVo dtRegionVo = sysRegionMapper.getParkRegion(dtRegionParam); | |||
if(null!=dtRegionVo){ | |||
if (null != dtRegionVo) { | |||
dtParkInfoDraft.setDistrictId(dtRegionVo.getId()); | |||
} | |||
} | |||
@@ -139,9 +148,7 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
*/ | |||
@Override | |||
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) { | |||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||
} | |||
@@ -159,6 +166,7 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
/** | |||
* 审核基本信息 | |||
* | |||
* @param dtInfoAuditQueryAuiditParam | |||
* @return | |||
*/ | |||
@@ -195,6 +203,7 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
/** | |||
* 后台审核自主信息列表 | |||
* | |||
* @param dtInfoAuditBackParam | |||
* @return | |||
* @throws Exception | |||
@@ -214,6 +223,7 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
* @param dtInfoAudit | |||
* @return | |||
*/ | |||
@Transactional | |||
public DtInfoAudit parkHandle(DtInfoAudit dtInfoAudit) { | |||
QueryWrapper<DtParkInfoDraft> parkInfoQueryWrapper = new QueryWrapper<>(); | |||
parkInfoQueryWrapper.eq("organize_id", dtInfoAudit.getOrganizeId()); | |||
@@ -237,30 +247,30 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
* @return | |||
*/ | |||
public boolean parkInfoOperate(DtParkInfoDraft dtParkInfoDraft) { | |||
if(null==dtParkInfoDraft.getDateParkId()) { | |||
if (null == dtParkInfoDraft.getDateParkId()) { | |||
ParkDataTeam parkDataTeam = parkDataTeamService.getOne(new QueryWrapper<ParkDataTeam>().eq("name", dtParkInfoDraft.getName())); | |||
dtParkInfoDraft.setOperateType(InfoOperatorTypeEnum.INFO_OPERATOR_INIT.getCode()); | |||
dtParkInfoDraft.setUpdateTime(new Date()); | |||
if(null==parkDataTeam){ | |||
if (null == parkDataTeam) { | |||
parkDataTeam = new ParkDataTeam(); | |||
BeanUtils.copyProperties(dtParkInfoDraft,parkDataTeam); | |||
BeanUtils.copyProperties(dtParkInfoDraft, parkDataTeam); | |||
ParkDataTeam parkDataTeamNew = parkDataTeamService.getOne(new QueryWrapper<ParkDataTeam>().eq("name", dtParkInfoDraft.getName())); | |||
if(null==parkDataTeamNew){ | |||
if (null == parkDataTeamNew) { | |||
throw new BusinessException("园区发布信息创建失败"); | |||
}else { | |||
} else { | |||
dtParkInfoDraft.setDateParkId(parkDataTeamNew.getId()); | |||
parkDataTeamService.saveOrUpdate(parkDataTeam); | |||
dtParkInfoDraftService.saveOrUpdate(dtParkInfoDraft); | |||
} | |||
}else{ | |||
} else { | |||
dtParkInfoDraft.setDateParkId(parkDataTeam.getId()); | |||
BeanUtils.copyProperties(dtParkInfoDraft,parkDataTeam); | |||
BeanUtils.copyProperties(dtParkInfoDraft, parkDataTeam); | |||
parkDataTeamService.saveOrUpdate(parkDataTeam); | |||
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()); | |||
BeanUtils.copyProperties(dtParkInfoDraft, parkDataTeam); | |||
dtParkInfoDraft.setOperateType(InfoOperatorTypeEnum.INFO_OPERATOR_INIT.getCode()); | |||
@@ -278,6 +288,7 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
* @param parkActivityListDraft | |||
* @return | |||
*/ | |||
public boolean parkActivityOperate(List<DtParkActivity> parkActivityListDraft) { | |||
for (DtParkActivity dtParkActivity : parkActivityListDraft) { | |||
if (InfoOperatorTypeEnum.INFO_OPERATOR_UPDATE.getCode() | |||
@@ -287,11 +298,11 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
dtParkActivityUpdateParams.put("organize_id", dtParkActivity.getOrganizeId()); | |||
dtParkActivityUpdateParams.put("display_type", DisplayTypeEnum.PUBLISH.getCode()); | |||
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); | |||
@@ -305,11 +316,11 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
dtParkActivityDeleteParams.put("organize_id", dtParkActivity.getOrganizeId()); | |||
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); | |||
@@ -328,7 +339,7 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
dtParkActivity.setUpdateTime(new Date()); | |||
DtParkActivity dtParkActivityNew = new DtParkActivity(); | |||
BeanUtils.copyProperties(dtParkActivity, dtParkActivityNew); | |||
String uuid= UUIDUtil.getUUID(); | |||
String uuid = UUIDUtil.getUUID(); | |||
dtParkActivityNew.setDisplayType(DisplayTypeEnum.PUBLISH.getCode()); | |||
dtParkActivityNew.setOrganizeId(dtParkActivity.getOrganizeId()); | |||
dtParkActivityNew.setGroupId(dtParkActivity.getGroupId()); | |||
@@ -336,10 +347,10 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
dtParkActivityNew.setId((long) 0); | |||
dtParkActivityService.saveOrUpdate(dtParkActivity); | |||
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.setDisplayType(DisplayTypeEnum.PUBLISH.getCode()); | |||
dtActivityAttachment.setGroupId(dtParkActivityNew.getGroupId()); | |||
@@ -351,7 +362,6 @@ public class DtInfoAuditServiceImpl extends BaseServiceImpl<DtInfoAuditMapper, D | |||
} | |||
@Override | |||
public DtInfoAuditQueryVo getDtInfoAuditById(Serializable id) throws Exception { | |||
return dtInfoAuditMapper.getDtInfoAuditById(id); |
@@ -9,6 +9,7 @@ import com.xdf.creative.base.vo.dt.DtParkActivityBackVo; | |||
import com.xdf.creative.base.vo.dt.DtParkActivityInfoDetailVo; | |||
import com.xdf.creative.base.vo.dt.DtParkActivityQueryVo; | |||
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.dt.DisplayTypeEnum; | |||
import com.xdf.creative.enums.dt.InfoOperatorTypeEnum; | |||
@@ -186,8 +187,20 @@ public class DtParkActivityServiceImpl extends BaseServiceImpl<DtParkActivityMap | |||
Page page = setPageParam(dtParkActivitWebParam); | |||
IPage<DtParkActivityWebVo> iPage = dtParkActivityMapper.getUserPageList(page, dtParkActivitWebParam); | |||
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{ | |||
return new PageTool(null); | |||
IPage<DtParkActivityWebVo> iPage =null; | |||
return new PageTool(iPage); | |||
} | |||
} | |||
@@ -0,0 +1,64 @@ | |||
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); | |||
} | |||
} |
@@ -6,6 +6,7 @@ import com.xdf.creative.base.params.dt.DtParkInfoDraftQueryParam; | |||
import com.xdf.creative.base.params.dt.DtParkInfoDraftUpdateParam; | |||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | |||
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.dt.InfoOperatorTypeEnum; | |||
import com.xdf.creative.module.entity.DtParkInfoDraft; | |||
@@ -46,6 +47,7 @@ public class DtParkInfoDraftServiceImpl extends BaseServiceImpl<DtParkInfoDraftM | |||
return ApiResult.error(StatusCode.FORM_SUBMIT_ID_VERIFY); | |||
} | |||
if(null== dtParkInfoDraft.getCreateUserId()) { | |||
dtParkInfoDraft.setCreateUserId(getUserId()); | |||
if (!verifyOrganizePermission(dtParkInfoDraft.getOrganizeId())) { | |||
return ApiResult.error(StatusCode.AUTH_UPDATE_VERIFY_ERROR); | |||
} | |||
@@ -73,9 +75,14 @@ public class DtParkInfoDraftServiceImpl extends BaseServiceImpl<DtParkInfoDraftM | |||
@Override | |||
public ApiResult getParkDraf(Long companyId) throws Exception { | |||
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("非法获取数据!"); | |||
} | |||
if(!organizeId.equals(companyId)){ | |||
organizeId = companyId; | |||
} | |||
return ApiResult.ok(dtParkInfoDraftMapper.getParkDraf(organizeId)); | |||
} | |||
@@ -18,7 +18,7 @@ import java.util.ArrayList; | |||
@Service | |||
public class FileClientServiceImpl implements FileClientService { | |||
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 | |||
public ApiResult uploadUtilFileByDecoder(FileUploadQuery fileUploadQuery,String baseUrl) throws Exception { |
@@ -126,12 +126,16 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
//获取初审人员姓名 | |||
if(null!=infoContent.getFirstAuditUser()) { | |||
SysUser userAudit = sysUserService.getById(infoContent.getFirstAuditUser()); | |||
infoContentAllQueryVo.setFirstAuditUserName(userAudit.getUsername()); | |||
if(null!=userAudit) { | |||
infoContentAllQueryVo.setFirstAuditUserName(userAudit.getUsername()); | |||
} | |||
} | |||
//获取终审人员姓名 | |||
if(null!=infoContent.getFinalAuditUser()){ | |||
SysUser userFinalAudit = sysUserService.getById(infoContent.getFinalAuditUser()); | |||
infoContentAllQueryVo.setFinalAuditUserName(userFinalAudit.getUsername()); | |||
if(null!=userFinalAudit){ | |||
infoContentAllQueryVo.setFinalAuditUserName(userFinalAudit.getUsername()); | |||
} | |||
} | |||
@@ -223,7 +227,7 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
if (StringUtil.isEmpty(infoContentNew.getForeignId())) { | |||
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.getId()) { | |||
return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||
@@ -239,10 +243,10 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
List<InfoAttachment> infoAttachmentList = infoContentAddQueryParam.getAttachmentList(); | |||
if (null != infoAttachmentList) { | |||
//不为空 等于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) { | |||
for (InfoAttachment infoAttachment : infoAttachmentList) { | |||
infoAttachment.setForeignId(infoContentAddQueryParam.getForeignId()); | |||
infoAttachment.setForeignId(infoContentNew.getForeignId()); | |||
infoAttachmentService.save(infoAttachment); | |||
} | |||
} | |||
@@ -251,10 +255,66 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
List<InfoUrl> infoUrlList = infoContentAddQueryParam.getUrlList(); | |||
if (null != infoUrlList) { | |||
//不为空 等于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) { | |||
for (InfoUrl infoUrl : infoUrlList) { | |||
infoUrl.setForeignId(infoContentAddQueryParam.getForeignId()); | |||
infoUrl.setForeignId(infoContentNew.getForeignId()); | |||
infoUrlService.save(infoUrl); | |||
} | |||
} | |||
@@ -346,6 +406,7 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
infoContent.setState(InfoStateTypeEnum.INFO_STATE_TYPE_FINAL_AUDIT_NOPASS.getCode()); | |||
} | |||
infoContent.setUpdateTime(new Date()); | |||
infoContent.setOrderAuditTime(new Date()); | |||
infoContent.setFinalAuditTime(new Date()); | |||
infoContent.setFinalAuditUser(getUserId()); | |||
this.saveOrUpdate(infoContent); | |||
@@ -428,6 +489,7 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
} | |||
if (infoContent.getIstop().equals(StateEnum.ENABLE.getKey())) { | |||
infoContent.setIstop(StateEnum.DISABLE.getKey()); | |||
infoContent.setIstopTime(null); | |||
} else { | |||
infoContent.setIstop(StateEnum.ENABLE.getKey()); | |||
infoContent.setIstopTime(new Date()); | |||
@@ -528,7 +590,7 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
/** | |||
* 首页显示新闻信息 | |||
* 首页显示新闻信息 单类型模糊匹配 | |||
* @param infoContentHomePageQueryParam | |||
* @return | |||
*/ | |||
@@ -537,6 +599,16 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
return ApiResult.ok(infoContentMapper.getHomePageInfo(infoContentHomePageQueryParam)); | |||
} | |||
/** | |||
* 首页显示新闻 多类型全匹配 | |||
* @param infoContentHomePageListParam | |||
* @return | |||
*/ | |||
@Override | |||
public ApiResult getHomePagesInfo(InfoContentHomePageListParam infoContentHomePageListParam) { | |||
return ApiResult.ok(infoContentMapper.getHomePagesInfo(infoContentHomePageListParam)); | |||
} | |||
/** | |||
* 首页搜索信息 | |||
@@ -551,6 +623,26 @@ public class InfoContentServiceImpl extends BaseServiceImpl<InfoContentMapper, I | |||
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 |
@@ -0,0 +1,126 @@ | |||
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)); | |||
} | |||
} | |||
} |
@@ -3,14 +3,18 @@ package com.xdf.creative.module.service.impl; | |||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.xdf.creative.base.params.IdParam; | |||
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.vo.creative.SysOrganizeBackVo; | |||
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.enums.OrganizeTypeEnum; | |||
import com.xdf.creative.enums.StateEnum; | |||
import com.xdf.creative.enums.StatusCode; | |||
import com.xdf.creative.enums.dt.InfoOperatorTypeEnum; | |||
import com.xdf.creative.module.entity.*; | |||
import com.xdf.creative.module.mapper.SysOrganizeMapper; | |||
import com.xdf.creative.module.mapper.SysRegionMapper; | |||
@@ -101,47 +105,70 @@ public class SysOrganizeServiceImpl extends BaseServiceImpl<SysOrganizeMapper, S | |||
} | |||
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); | |||
SysOrganize sysOrganizeNew = this.getOne(new QueryWrapper<SysOrganize>().eq("organize_name", sysOrganizeAddParkParam.getOrganizeName())); | |||
if(null==sysOrganizeNew){ | |||
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.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(); | |||
} | |||
@@ -240,6 +267,27 @@ public class SysOrganizeServiceImpl extends BaseServiceImpl<SysOrganizeMapper, S | |||
} | |||
@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(); | |||
} | |||
/** | |||
* 获取组织机构资源数 | |||
* |
@@ -79,6 +79,25 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleMapper, SysRole> | |||
//取最大角色id | |||
SysRole sysRole = new 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) { | |||
sysRole.setCode("role"+sysRoleManage.get(0).getId()); | |||
}else{ | |||
@@ -168,7 +187,16 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleMapper, SysRole> | |||
*/ | |||
@Override | |||
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)); | |||
} | |||
@@ -10,6 +10,8 @@ import com.xdf.creative.base.params.creative.*; | |||
import com.xdf.creative.base.service.impl.BaseServiceImpl; | |||
import com.xdf.creative.base.vo.creative.*; | |||
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.mapper.SysUserMapper; | |||
import com.xdf.creative.module.service.*; | |||
@@ -36,6 +38,7 @@ import org.springframework.context.annotation.Lazy; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import javax.servlet.http.HttpServletRequest; | |||
import java.io.Serializable; | |||
import java.lang.reflect.Method; | |||
import java.time.Duration; | |||
@@ -86,10 +89,18 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> | |||
@Autowired | |||
private SysRegionService sysRegionService; | |||
@Autowired | |||
private DtInfoAuditService dtInfoAuditService; | |||
/*登录*/ | |||
@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(); | |||
SysUser sysUser = getSysUserByUserName(userName); | |||
if (sysUser == null) { | |||
@@ -121,6 +132,25 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> | |||
if (sysRegion == null) { | |||
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); | |||
@@ -268,6 +298,20 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> | |||
return ApiResult.error(StatusCode.SYS_USER_NAME_EXIST); | |||
} | |||
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){ | |||
return ApiResult.error(StatusCode.SYS_USER_ROLE_VERIFY_EXIST); | |||
} | |||
@@ -308,6 +352,9 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> | |||
// if(null==sysUserAddQueryParam.getRoleId()||null==sysRole){ | |||
// return ApiResult.error(StatusCode.SYS_USER_ROLE_VERIFY_EXIST); | |||
// } | |||
if(null==sysUserAddParkParam.getOrganizeId()){ | |||
return ApiResult.fail("请选择正确的园区!"); | |||
} | |||
SysOrganize sysOrganize = sysOrganizeService.getById(sysUserAddParkParam.getOrganizeId()); | |||
if( null==sysUserAddParkParam.getOrganizeId()||null==sysOrganize){ | |||
return ApiResult.fail("所选机构不存在!"); | |||
@@ -369,7 +416,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> | |||
if(StateEnum.ENABLE.getKey().equals(sysUser.getState())){ | |||
return ApiResult.error(StatusCode.SYS_USER_NAME_STATE_EXIST); | |||
} | |||
sysUser.setState(StateEnum.DISABLE.getKey()); | |||
sysUser.setDeleted(StateEnum.ENABLE.getKey()); | |||
sysUser.setUpdateTime(new Date()); | |||
sysUserRoleService.remove(new QueryWrapper<SysUserRole>().eq("user_id",sysUser.getId())); | |||
this.saveOrUpdate(sysUser); | |||
@@ -564,7 +611,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser> | |||
public ApiResult getSysUserById() { | |||
Long userId =getUserId(); | |||
if(null==userId){ | |||
return ApiResult.fail("身份验证失败!"); | |||
return ApiResult.fail(ApiCode.TOKEN_INVALID); | |||
} | |||
SysUser sysUser = this.getById(userId); | |||
if(null ==sysUser){ |
@@ -102,9 +102,12 @@ public class WebParkEnterServiceImpl extends BaseServiceImpl<WebParkEnterMapper, | |||
@Override | |||
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()); | |||
}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); | |||
IPage<WebParkEnterQueryVo> iPage = webParkEnterMapper.getWebParkEnterPageList(page, webParkEnterQueryParam); | |||
return new PageTool(iPage); |
@@ -51,6 +51,7 @@ public class ConfigPathInterceptor implements HandlerInterceptor { | |||
@Override | |||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | |||
log.info(request.getRequestURI()); | |||
String token = request.getHeader("Authorization"); | |||
if (null == token||StringUtil.isEmpty(token)||token.length()<50) { | |||
ApiResult result = new ApiResult(); | |||
@@ -84,7 +85,7 @@ public class ConfigPathInterceptor implements HandlerInterceptor { | |||
* @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(); | |||
ApiResult result = new ApiResult(); | |||
//token失效 先检查是否存在 不存在则直接令牌过去重新登录 | |||
@@ -177,7 +178,7 @@ public class ConfigPathInterceptor implements HandlerInterceptor { | |||
getResponseResult(response, result); | |||
return false; | |||
} | |||
/* List<String> permissionList = Arrays.asList(oauthTokenQueryVo.getPermissions().trim().split(",")); | |||
List<String> permissionList = Arrays.asList(oauthTokenQueryVo.getPermissions().trim().split(",")); | |||
boolean permissionflag = false; | |||
for (String permissionUrl:permissionList ) { | |||
if(permissionUrl.contains(requestUrl)){ | |||
@@ -190,7 +191,7 @@ public class ConfigPathInterceptor implements HandlerInterceptor { | |||
result.setMsg(ApiCode.NOT_PERMISSION.getMsg()); | |||
getResponseResult(response, result); | |||
return false; | |||
}*/ | |||
} | |||
return true; |
@@ -20,7 +20,7 @@ public class InterceptorConfiguration implements WebMvcConfigurer { | |||
public void addInterceptors(InterceptorRegistry registry) { | |||
//注册TestInterceptor拦截器 | |||
InterceptorRegistration registration = registry.addInterceptor(new ConfigPathInterceptor()); | |||
registration.addPathPatterns("/**"); //所有路径都被拦截 | |||
registration.addPathPatterns("/wcapi/**"); //所有路径都被拦截 | |||
registration.excludePathPatterns( //添加不拦截路径 | |||
skipAuthUrls | |||
); |
@@ -27,9 +27,11 @@ public class LoginParam { | |||
private String password; | |||
@ApiModelProperty("验证码Token") | |||
private String verifyToken; | |||
private String verifyCodeActual; | |||
@ApiModelProperty("验证码") | |||
private String code; | |||
} |
@@ -0,0 +1,45 @@ | |||
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; | |||
} | |||
} |
@@ -0,0 +1,52 @@ | |||
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); | |||
} | |||
} |
@@ -58,6 +58,15 @@ public class ServerUploadDirUtil { | |||
case 888: | |||
uploadDir = ServiceFileDirEnum.SERVICE_PARK_ACTIVITY_DIR_OTHER.getName(); | |||
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: | |||
uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_OTHER.getName(); | |||
break; |
@@ -42,6 +42,7 @@ public final class UploadUtil { | |||
add("PNG"); | |||
add("JPG"); | |||
add("TXT"); | |||
add("GIF"); | |||
}}; | |||
/** |
@@ -0,0 +1,69 @@ | |||
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(); | |||
} | |||
} | |||
} |
@@ -15,7 +15,12 @@ public class ImageUtils { | |||
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_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对象 | |||
} | |||
@@ -32,6 +37,7 @@ public class ImageUtils { | |||
conn.setRequestMethod("GET"); | |||
//超时响应时间为5秒 | |||
conn.setConnectTimeout(5 * 1000); | |||
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); | |||
//通过输入流获取图片数据 | |||
InputStream inStream = conn.getInputStream(); | |||
//得到图片的二进制数据,以二进制封装得到数据,具有通用性 |
@@ -23,8 +23,10 @@ public class PageTool<T> implements Serializable { | |||
@JSONField(name = "records") | |||
@JsonProperty("records") | |||
private List<T> records = Collections.emptyList(); | |||
public PageTool() { | |||
} | |||
public PageTool(IPage<T> iPage) { | |||
this.total = iPage.getTotal(); | |||
this.records = iPage.getRecords(); |
@@ -1,19 +1,24 @@ | |||
############################# ·ÃÎÊ·¾¶¡¢¶Ë¿Útomcat start ############################# | |||
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/ |
@@ -3,12 +3,12 @@ server: | |||
address: | |||
port: 8999 | |||
servlet: | |||
context-path: / | |||
context-path: /wcapi | |||
tomcat: | |||
max-threads: 1000 | |||
min-spare-threads: 30 | |||
max-http-header-size: 8192 | |||
uri-encoding: utf-8 | |||
max-http-post-size: 2MB | |||
@@ -28,6 +28,7 @@ spring: | |||
location: classpath:banner.txt | |||
profiles: | |||
active: dev | |||
datasource: | |||
@@ -76,7 +77,8 @@ spring: | |||
multipart: | |||
enabled: true | |||
max-file-size: 5MB | |||
max-request-size: 10MB | |||
max-request-size: 2MB | |||
############################ JWT start ############################# |
@@ -0,0 +1,33 @@ | |||
<?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> |
@@ -57,10 +57,10 @@ | |||
<include refid="Base_Column_List"/> | |||
from dt_info_audit where 1=1 | |||
<if test="auditType !=null and auditType !=''"> | |||
AND audit_type = #{auditType,jdbcType=VARCHAR} | |||
AND audit_type = #{auditType} | |||
</if> | |||
<if test="organizeId !=null and organizeId !=''"> | |||
AND organize_id = #{organizeId,jdbcType=VARCHAR} | |||
AND organize_id = #{organizeId} | |||
</if> | |||
</select> | |||
@@ -0,0 +1,95 @@ | |||
<?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> |
@@ -5,7 +5,7 @@ | |||
<!-- 通用查询结果列 --> | |||
<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 id="Base_If_Condition"> |
@@ -69,11 +69,38 @@ | |||
<if test="param.typeId !=null and param.typeId!=''"> | |||
and b.type_id like CONCAT('',#{param.typeId},'%') | |||
</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 id="getSearchWebInfo" | |||
resultType="com.xdf.creative.base.vo.creative.InfoContentWebSearchQueryVo" | |||
parameterType="com.xdf.creative.base.params.creative.InfoContentWebSearchQueryParam"> | |||
@@ -130,6 +157,69 @@ | |||
</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" | |||
parameterType="com.xdf.creative.base.params.creative.InfoContentBackSearchQueryParam"> | |||
select | |||
@@ -146,8 +236,7 @@ | |||
</include> | |||
, | |||
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> | |||
a.deleted = 0 | |||
<include refid="Base_If_Condition"> |
@@ -5,12 +5,13 @@ | |||
<!-- 通用查询结果列 --> | |||
<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 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> | |||
@@ -140,6 +141,7 @@ | |||
<property name="alias" value="a"/> | |||
</include> | |||
</where> | |||
order by a.sort desc | |||
</select> | |||
@@ -166,6 +166,7 @@ | |||
<property name="alias" value="b"/> | |||
</include> | |||
</where> | |||
order by a.update_time desc | |||
</select> | |||
@@ -90,10 +90,10 @@ | |||
and sp.deleted = 0 | |||
) and state = 1 | |||
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"> |
@@ -90,7 +90,7 @@ | |||
<if test="param.regionId !=null and param.regionId!=''"> | |||
and b.region_id =#{param.regionId} | |||
</if> | |||
<if test="param.regionName !=null and param.regionName!=''"> | |||
<if test="param.name !=null and param.name!=''"> | |||
and b.region_name=#{param.name} | |||
</if> | |||
@@ -17,7 +17,7 @@ | |||
<!-- 查询角色列表--> | |||
<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> | |||
@@ -46,6 +46,12 @@ | |||
</if> | |||
</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查询--> | |||
@@ -68,7 +74,7 @@ | |||
<include refid="Base_Organize_Column_List"> | |||
<property name="alias" value="b"/> | |||
</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> | |||
<include refid="Base_If_Condition"> | |||
<property name="alias" value="a"/> | |||
@@ -76,6 +82,9 @@ | |||
<include refid="Base_Organize_If_Condition"> | |||
<property name="alias" value="b"/> | |||
</include> | |||
<include refid="Base_Region_If_Condition"> | |||
<property name="alias" value="c"/> | |||
</include> | |||
</where> | |||
</select> | |||