21 changed files with 829 additions and 0 deletions
@ -0,0 +1,33 @@ |
|||||
|
package com.yxt.supervise.customer.biz.system; |
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.customer.feign.system.sysmenu.SysMenuFeign; |
||||
|
import com.yxt.supervise.customer.feign.system.sysmenu.SysMenuQuery; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
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 java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/26 9:54 |
||||
|
*/ |
||||
|
@RestController("com.yxt.supervise.report.biz.system.SysMenuRest") |
||||
|
@RequestMapping("v1/sysmenu") |
||||
|
public class SysMenuRest { |
||||
|
@Autowired |
||||
|
SysMenuFeign sysMenuFeign; |
||||
|
|
||||
|
|
||||
|
@ApiOperation("根据资源sid查询所有数据列表 ") |
||||
|
@PostMapping("/sourcemenutree") |
||||
|
public ResultBean<List<Map<String, Object>>> sourcemenutree(@RequestBody SysMenuQuery query){ |
||||
|
return sysMenuFeign.sourcemenutree(query); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package com.yxt.supervise.customer.biz.system; |
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.customer.feign.system.sysuser.SysUserFeign; |
||||
|
import com.yxt.supervise.customer.feign.system.sysuser.SysUserVo; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/25 9:51 |
||||
|
*/ |
||||
|
@RestController("com.yxt.supervise.report.biz.system.SysUserRest") |
||||
|
@RequestMapping("v1/sysuser") |
||||
|
public class SysUserRest { |
||||
|
@Autowired |
||||
|
SysUserFeign sysUserFeign; |
||||
|
@PostMapping(value = "/loginDetailsNew", headers = "token") |
||||
|
@ApiOperation("根据token值获取登录后的用户信息") |
||||
|
public ResultBean<SysUserVo> loginDetailsNew(HttpServletRequest httpServletRequest){ |
||||
|
httpServletRequest.getHeader("token"); |
||||
|
return sysUserFeign.loginDetailsNew(httpServletRequest.getHeader("token")); |
||||
|
} |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysmenu; |
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/26 9:50 |
||||
|
*/ |
||||
|
@Api(tags = "菜单表") |
||||
|
@FeignClient( |
||||
|
contextId = "supervise-system-SysMenu", |
||||
|
name = "supervise-system", |
||||
|
path = "v1/sysmenu") |
||||
|
public interface SysMenuFeign { |
||||
|
@ApiOperation("根据资源sid查询所有数据列表 ") |
||||
|
@PostMapping("/sourcemenutree") |
||||
|
public ResultBean<List<Map<String, Object>>> sourcemenutree(@RequestBody SysMenuQuery query); |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysmenu; |
||||
|
|
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui_portal(门户建设) <br/> |
||||
|
* File: SysMenuQuery.java <br/> |
||||
|
* Class: SysMenuQuery <br/> |
||||
|
* Description: 菜单表 查询条件. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-08-03 00:24:28 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "菜单表 查询条件", description = "菜单表 查询条件") |
||||
|
@Data |
||||
|
public class SysMenuQuery implements Query { |
||||
|
|
||||
|
|
||||
|
@ApiModelProperty("菜单名称") |
||||
|
private String name; |
||||
|
|
||||
|
@ApiModelProperty("菜单路由路径(VUE)") |
||||
|
private String menuUrl; |
||||
|
|
||||
|
@ApiModelProperty("菜单对应的前端页面路径") |
||||
|
private String pageUrl; |
||||
|
|
||||
|
@ApiModelProperty("菜单图标地址") |
||||
|
private String iconUrl; |
||||
|
|
||||
|
@ApiModelProperty("资源sid") |
||||
|
private String sourceSid; |
||||
|
@ApiModelProperty("用户sid") |
||||
|
private String userSid; |
||||
|
@ApiModelProperty("角色sid") |
||||
|
private String roleSid; |
||||
|
|
||||
|
@ApiModelProperty("是否显示,默认为1显示,0为不显示") |
||||
|
private String isShow; |
||||
|
|
||||
|
@ApiModelProperty("排序号") |
||||
|
private Integer sortNo; |
||||
|
|
||||
|
@ApiModelProperty("上级sid") |
||||
|
private String pSid; |
||||
|
|
||||
|
@ApiModelProperty("前端页面路径重定向") |
||||
|
private Integer pageUrlRedirect; |
||||
|
|
||||
|
@ApiModelProperty("前端页面名称(vue组件名)") |
||||
|
private String pageName; |
||||
|
|
||||
|
@ApiModelProperty("前端页面别名") |
||||
|
private String pageAliasName; |
||||
|
|
||||
|
@ApiModelProperty("菜单类型(0左侧当行菜单,1页面中功能)") |
||||
|
private String menuType; |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/9/21 9:26 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OrgList implements Vo { |
||||
|
private static final long serialVersionUID = -2867882982421321776L; |
||||
|
|
||||
|
private String orgName; |
||||
|
private String orgPath; |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/25 9:29 |
||||
|
*/ |
||||
|
@ApiModel(value = "项目信息 视图数据对象", description = "项目信息 视图数据对象") |
||||
|
@Data |
||||
|
public class ProjectInformationVo implements Vo { |
||||
|
private String sid; |
||||
|
//项目名称
|
||||
|
private String entryName; |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
|
import com.yxt.common.core.result.FileUploadResult; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/8/5 9:22 |
||||
|
*/ |
||||
|
@FeignClient( |
||||
|
contextId = "supervise-system-sysUser", |
||||
|
name = "supervise-system", |
||||
|
path = "v1/sysuser") |
||||
|
public interface SysUserFeign { |
||||
|
@PostMapping(value = "/loginDetailsNew") |
||||
|
@ApiOperation("根据token值获取登录后的用户信息") |
||||
|
public ResultBean<SysUserVo> loginDetailsNew(@RequestHeader("token") String token); |
||||
|
@PostMapping(value = "/uploadfile",consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
||||
|
public ResultBean<FileUploadResult> uploadImage(@RequestPart(value = "file") MultipartFile file); |
||||
|
@PostMapping("/uploadImage") |
||||
|
public ResultBean updateSysUserImage(@RequestBody Map<String, String> map); |
||||
|
@PostMapping("/updatePassword") |
||||
|
@ApiOperation(value = "5、修改密码") |
||||
|
public ResultBean updatePassword(@RequestBody SysUserUpdate sysUserUpdate); |
||||
|
@PostMapping("/login") |
||||
|
@ResponseBody |
||||
|
@ApiOperation(value = "3、登录") |
||||
|
@ApiOperationSupport(order = 30) |
||||
|
public ResultBean<SysUserVo> login(@RequestBody SysUserQuery sysUserQuery); |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class SysUserLoginVo implements Vo { |
||||
|
@ApiModelProperty(value = "用户Sid") |
||||
|
private String sysUserSid; |
||||
|
@ApiModelProperty(value = "用户登录时随机生成身份验证字符串") |
||||
|
private String token; |
||||
|
@ApiModelProperty(value = "是否登陆") |
||||
|
private Boolean isLogin; |
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui_portal(门户建设) <br/> |
||||
|
* File: SysUserQuery.java <br/> |
||||
|
* Class: SysUserQuery <br/> |
||||
|
* Description: 用户表 查询条件. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-08-03 00:24:30 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "用户表 查询条件", description = "用户表 查询条件") |
||||
|
@Data |
||||
|
public class SysUserQuery implements Query { |
||||
|
|
||||
|
|
||||
|
@ApiModelProperty("角色sid") |
||||
|
private String roleSid; |
||||
|
@ApiModelProperty("用户名称") |
||||
|
private String userName; |
||||
|
@ApiModelProperty("姓名") |
||||
|
private String name; |
||||
|
@ApiModelProperty("部门名称") |
||||
|
private String orgName; |
||||
|
|
||||
|
@ApiModelProperty("密码(加密或签名后)") |
||||
|
private String password; |
||||
|
|
||||
|
@ApiModelProperty("用户登录时随机生成身份验证字符串") |
||||
|
private String token; |
||||
|
@ApiModelProperty("用户登录时随机生成的验证码字符串") |
||||
|
private String verifyCode; |
||||
|
private String uuid; |
||||
|
|
||||
|
@ApiModelProperty("手机登录唯一标识,手机与用户绑定字段") |
||||
|
private String appId; |
||||
|
@ApiModelProperty("手机登录类型:1、密码登录2、验证码登录") |
||||
|
private String type; |
||||
|
@ApiModelProperty(value = "是否是测试",example = "false") |
||||
|
private Boolean isTest; |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-08-18-17:19 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SysUserUpdate { |
||||
|
private String original; |
||||
|
private String password; |
||||
|
private String confirmPassword; |
||||
|
private String userSid; |
||||
|
} |
@ -0,0 +1,95 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui_portal(门户建设) <br/> |
||||
|
* File: SysUserVo.java <br/> |
||||
|
* Class: SysUserVo <br/> |
||||
|
* Description: 用户表 视图数据对象. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-08-03 00:24:30 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "用户表 视图数据对象", description = "用户表 视图数据对象") |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class SysUserVo implements Vo { |
||||
|
private static final long serialVersionUID = 2415131854581950721L; |
||||
|
@ApiModelProperty("部门sid") |
||||
|
private String departmentSid; |
||||
|
@ApiModelProperty("部门名称") |
||||
|
private String departmentName; |
||||
|
@ApiModelProperty("上级部门名称-本级部门名称 岗位名称") |
||||
|
@JsonProperty("pNameAndDepartmentNameAndPostName") |
||||
|
private String pNameAndDepartmentNameAndPostName; |
||||
|
@ApiModelProperty("岗位名称") |
||||
|
private String postName; |
||||
|
@ApiModelProperty("岗位Sid") |
||||
|
private String postSid; |
||||
|
@ApiModelProperty("单位sid") |
||||
|
private String organizationSid; |
||||
|
@ApiModelProperty("单位名称") |
||||
|
private String organizationName; |
||||
|
@ApiModelProperty("用户姓名") |
||||
|
private String name; |
||||
|
@ApiModelProperty("登录名,登录名不能相同") |
||||
|
private String userName; |
||||
|
|
||||
|
@ApiModelProperty("id") |
||||
|
private Integer id; |
||||
|
@ApiModelProperty("用户sid") |
||||
|
private String sid; |
||||
|
@ApiModelProperty("是否是管理员:1管理员,2一般用户,0是超级管理员,3尚无单位人员") |
||||
|
private String isAdmin; |
||||
|
@ApiModelProperty("角色名称") |
||||
|
private String roleName; |
||||
|
|
||||
|
@ApiModelProperty("关联的人员sid") |
||||
|
private String staffSid; |
||||
|
|
||||
|
@ApiModelProperty("手机号") |
||||
|
private String mobile; |
||||
|
@ApiModelProperty(value = "禁用状态") |
||||
|
private String isEnable; |
||||
|
|
||||
|
@ApiModelProperty("用户类型:1员工、2客户、3供应商") |
||||
|
private String userType; |
||||
|
@ApiModelProperty("用户类型:1、2、3") |
||||
|
private String userTypeKey; |
||||
|
@ApiModelProperty("用户头像") |
||||
|
private String headImage; |
||||
|
@ApiModelProperty("组织名称") |
||||
|
private String orgNamePath; |
||||
|
@ApiModelProperty("组织sid") |
||||
|
private String orgSidPath; |
||||
|
@ApiModelProperty(value = "token") |
||||
|
private String token; |
||||
|
@ApiModelProperty(value = "角色sids") |
||||
|
private List<String> roleSids = new ArrayList<>(); |
||||
|
|
||||
|
private List<OrgList> orgList = new ArrayList<>(); |
||||
|
private String defaultOrgPath; |
||||
|
private String defaultOrgPathName; |
||||
|
|
||||
|
@ApiModelProperty("是否需要更换密码") |
||||
|
private Boolean needResetPsd; |
||||
|
@ApiModelProperty("工号") |
||||
|
private String jobNumber; |
||||
|
private String openid; |
||||
|
@ApiModelProperty("项目sid集合") |
||||
|
private List<ProjectInformationVo> projectSidList; |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class SysUserWxBindMobileDto implements Dto { |
||||
|
@ApiModelProperty(value = "用户登陆授权Sid") |
||||
|
private String sysUserWxAuthSid; |
||||
|
@ApiModelProperty(value = "手机号") |
||||
|
private String mobile; |
||||
|
@ApiModelProperty(value = "验证码") |
||||
|
private String code; |
||||
|
//微信id
|
||||
|
private String openid; |
||||
|
private String unionid; |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.yxt.supervise.customer.feign.system.sysuser; |
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/31 10:46 |
||||
|
*/ |
||||
|
@FeignClient( |
||||
|
contextId = "supervise-portal-WxUser", |
||||
|
name = "supervise-system", |
||||
|
path = "v1/wxuser") |
||||
|
public interface WxSysUserFeign { |
||||
|
@PostMapping("/wxBindMobile") |
||||
|
@ApiOperation(value = "微信绑定手机") |
||||
|
public ResultBean wxBindMobile(@RequestBody SysUserWxBindMobileDto sysUserWxBindMobileDto); |
||||
|
@ApiOperation(value = "发送验证码") |
||||
|
@GetMapping("/sendVerificationCode/{mobile}/{type}") |
||||
|
public ResultBean sendVerificationCode(@PathVariable("mobile") String mobile, @PathVariable("type") String type); |
||||
|
@ApiOperation(value = "微信静默登录") |
||||
|
@GetMapping("/wxSilentLogin") |
||||
|
public ResultBean wxSilentLogin(@RequestParam(value = "wxCode") String wxCode); |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.yxt.supervise.system.buildadv; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 首页轮播广告表 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author zscat |
||||
|
* @since 2019-12-02 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("build_adv") |
||||
|
public class BuildAdv extends BaseEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
|
||||
|
private String name; |
||||
|
/** |
||||
|
* 轮播位置:0->PC首页轮播;1->app首页轮播 |
||||
|
*/ |
||||
|
private Integer type; |
||||
|
|
||||
|
private String pic; |
||||
|
|
||||
|
private Date startTime; |
||||
|
|
||||
|
private Date endTime; |
||||
|
|
||||
|
/** |
||||
|
* 上下线状态:0->下线;1->上线 |
||||
|
*/ |
||||
|
private Integer status; |
||||
|
|
||||
|
/** |
||||
|
* 链接地址 |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String note; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 所属店铺 |
||||
|
*/ |
||||
|
private Integer communityId; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
package com.yxt.supervise.system.buildadv; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/11/9 15:15 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BuildAdvDto implements Dto { |
||||
|
|
||||
|
private Long id; |
||||
|
private String sid; |
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 轮播位置:0->PC首页轮播;1->app首页轮播 |
||||
|
*/ |
||||
|
private Integer type; |
||||
|
|
||||
|
private String pic; |
||||
|
|
||||
|
|
||||
|
private Date startTime; |
||||
|
|
||||
|
|
||||
|
private Date endTime; |
||||
|
|
||||
|
/** |
||||
|
* 上下线状态:0->下线;1->上线 |
||||
|
*/ |
||||
|
private Integer status; |
||||
|
|
||||
|
/** |
||||
|
* 链接地址 |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String note; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 所属店铺 |
||||
|
*/ |
||||
|
|
||||
|
private Integer communityId; |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.supervise.system.buildadv; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.system.dicttype.DictType; |
||||
|
import com.yxt.supervise.system.dicttype.DictTypeVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/11/9 15:00 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface BuildAdvMapper extends BaseMapper<BuildAdv> { |
||||
|
IPage<BuildAdvVo> selectPageVo(IPage<BuildAdv> page, @Param(Constants.WRAPPER) Wrapper<BuildAdv> qw); |
||||
|
@Select("select * from build_adv where sid =#{sid}") |
||||
|
BuildAdvVo getById(@Param("sid") String sid); |
||||
|
|
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.yxt.supervise.system.buildadv; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/11/9 15:05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BuildAdvQuery implements Query { |
||||
|
} |
@ -0,0 +1,89 @@ |
|||||
|
package com.yxt.supervise.system.buildadv; |
||||
|
|
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/11/9 14:50 |
||||
|
*/ |
||||
|
public class BuildAdvRest { |
||||
|
|
||||
|
@Resource |
||||
|
private BuildAdvService BuildAdvService; |
||||
|
|
||||
|
|
||||
|
@ApiOperation("根据条件查询所有轮播广告列表") |
||||
|
@GetMapping(value = "/list") |
||||
|
public ResultBean<PagerVo<BuildAdv>> getBuildAdvByPage( @RequestBody PagerQuery<BuildAdvQuery> pq) { |
||||
|
ResultBean rb=new ResultBean(); |
||||
|
PagerVo<BuildAdvVo> pv = BuildAdvService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("保存轮播广告") |
||||
|
@PostMapping(value = "/create") |
||||
|
public ResultBean saveBuildAdv(@RequestBody BuildAdvDto dto) { |
||||
|
return BuildAdvService.save(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("更新轮播广告") |
||||
|
@PostMapping(value = "/update/{id}") |
||||
|
public Object updateBuildAdv(@RequestBody BuildAdvDto dto) { |
||||
|
return BuildAdvService.update(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("根据sid批量删除") |
||||
|
@PostMapping("/delBySids") |
||||
|
public ResultBean delBySids(@RequestBody String[] sids){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
int i = BuildAdvService.delBySids(sids); |
||||
|
if (i==0){ |
||||
|
return rb; |
||||
|
} |
||||
|
return rb.setMsg("删除成功"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
@ApiOperation("查询轮播广告明细") |
||||
|
@GetMapping(value = "/{sid}") |
||||
|
public ResultBean getBuildAdvById( @PathVariable("sid") String sid) { |
||||
|
return BuildAdvService.getById(sid); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
@ApiOperation("修改上下线状态") |
||||
|
@RequestMapping(value = "/update/status/{sid}/{status}", method = RequestMethod.POST) |
||||
|
@ResponseBody |
||||
|
public Object updateStatus(@PathVariable("sid") String sid, @PathVariable("status")Integer status) { |
||||
|
BuildAdv record = new BuildAdv(); |
||||
|
record.setSid(sid); |
||||
|
record.setStatus(status); |
||||
|
return BuildAdvService.updateById(record); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// @GetMapping("/exportExcel")
|
||||
|
// public void export(HttpServletResponse response, BuildAdv entity) {
|
||||
|
// // 模拟从数据库获取需要导出的数据
|
||||
|
// List<BuildAdv> personList = BuildAdvService.list(new QueryWrapper<>(entity));
|
||||
|
// // 导出操作
|
||||
|
// EasyPoiUtils.exportExcel(personList, "导出社区数据", "社区数据", BuildAdv.class, "导出社区数据.xls", response);
|
||||
|
//
|
||||
|
// }
|
||||
|
//
|
||||
|
// @PostMapping("/importExcel")
|
||||
|
// public void importUsers(@RequestParam MultipartFile file) {
|
||||
|
// List<BuildAdv> personList = EasyPoiUtils.importExcel(file, BuildAdv.class);
|
||||
|
// IBuildAdvService.saveBatch(personList);
|
||||
|
// }
|
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
package com.yxt.supervise.system.buildadv; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.base.utils.PagerUtil; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import com.yxt.supervise.system.dicttype.DictType; |
||||
|
import com.yxt.supervise.system.dicttype.DictTypeDto; |
||||
|
import com.yxt.supervise.system.dicttype.DictTypeQuery; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 首页轮播广告表 服务类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author zscat |
||||
|
* @since 2019-12-02 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class BuildAdvService extends MybatisBaseService<BuildAdvMapper, BuildAdv> { |
||||
|
public PagerVo<BuildAdvVo> listPageVo(PagerQuery<BuildAdvQuery> pq) { |
||||
|
BuildAdvQuery query = pq.getParams(); |
||||
|
QueryWrapper<BuildAdv> qw = new QueryWrapper<>(); |
||||
|
// if(StringUtils.isNotNull(query.getState())){
|
||||
|
// if(query.getState().equals("2")){}
|
||||
|
// else if(query.getState().equals("0")){
|
||||
|
// qw.eq("o.state",0);
|
||||
|
// }else if(query.getState().equals("1")){
|
||||
|
// qw.eq("o.state",1);
|
||||
|
// }
|
||||
|
// }
|
||||
|
IPage<BuildAdv> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<BuildAdvVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
PagerVo<BuildAdvVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
public ResultBean save(BuildAdvDto dto){ |
||||
|
ResultBean rb=ResultBean.fireFail(); |
||||
|
BuildAdv entity = new BuildAdv(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.insert(entity); |
||||
|
return rb.success().setMsg("成功"); |
||||
|
} |
||||
|
public ResultBean update(BuildAdvDto dto){ |
||||
|
ResultBean rb=ResultBean.fireFail(); |
||||
|
String dtoSid = dto.getSid(); |
||||
|
// if (StringUtils.isBlank(dtoSid)) {
|
||||
|
// return;
|
||||
|
// }
|
||||
|
BuildAdv entity = fetchBySid(dtoSid); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.updateById(entity); |
||||
|
return rb.success().setMsg("成功"); |
||||
|
} |
||||
|
public ResultBean getById(String sid){ |
||||
|
ResultBean rb=ResultBean.fireFail(); |
||||
|
BuildAdvVo vo= baseMapper.getById(sid); |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
package com.yxt.supervise.system.buildadv; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/11/9 15:09 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BuildAdvVo implements Vo { |
||||
|
|
||||
|
private String id; |
||||
|
private String sid; |
||||
|
private String name; |
||||
|
/** |
||||
|
* 轮播位置:0->PC首页轮播;1->app首页轮播 |
||||
|
*/ |
||||
|
private Integer type; |
||||
|
|
||||
|
private String pic; |
||||
|
|
||||
|
private Date startTime; |
||||
|
|
||||
|
private Date endTime; |
||||
|
|
||||
|
/** |
||||
|
* 上下线状态:0->下线;1->上线 |
||||
|
*/ |
||||
|
private Integer status; |
||||
|
|
||||
|
/** |
||||
|
* 链接地址 |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String note; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 所属店铺 |
||||
|
*/ |
||||
|
private Integer communityId; |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
<?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.yxt.supervise.system.buildadv.BuildAdvMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.supervise.system.buildadv.BuildAdvVo"> |
||||
|
SELECT * FROM build_adv <where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue