23 changed files with 681 additions and 24 deletions
@ -0,0 +1,43 @@ |
|||
package com.yxt.supervise.crm.biz.userproject; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.EntityWithId; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/8/6 11:34 |
|||
*/ |
|||
@TableName("user_project") |
|||
public class UserProject extends EntityWithId { |
|||
|
|||
private String sid; |
|||
private String projectSid; |
|||
private String userSid; |
|||
|
|||
|
|||
|
|||
|
|||
public String getSid() { |
|||
return sid; |
|||
} |
|||
|
|||
public void setSid(String sid) { |
|||
this.sid = sid; |
|||
} |
|||
|
|||
public String getProjectSid() { |
|||
return projectSid; |
|||
} |
|||
|
|||
public void setProjectSid(String projectSid) { |
|||
this.projectSid = projectSid; |
|||
} |
|||
|
|||
public String getUserSid() { |
|||
return userSid; |
|||
} |
|||
|
|||
public void setUserSid(String userSid) { |
|||
this.userSid = userSid; |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.yxt.supervise.crm.biz.userproject; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/8/6 11:34 |
|||
*/ |
|||
public class UserProjectDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
private String projectSid; |
|||
private String userSid; |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getSid() { |
|||
return sid; |
|||
} |
|||
|
|||
public void setSid(String sid) { |
|||
this.sid = sid; |
|||
} |
|||
|
|||
public String getProjectSid() { |
|||
return projectSid; |
|||
} |
|||
|
|||
public void setProjectSid(String projectSid) { |
|||
this.projectSid = projectSid; |
|||
} |
|||
|
|||
public String getUserSid() { |
|||
return userSid; |
|||
} |
|||
|
|||
public void setUserSid(String userSid) { |
|||
this.userSid = userSid; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.supervise.crm.biz.userproject; |
|||
|
|||
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 org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/8/6 11:36 |
|||
*/ |
|||
@Mapper |
|||
public interface UserProjectMapper extends BaseMapper<UserProject> { |
|||
IPage<UserProjectVo> selectPageVo(IPage<UserProject> page, @Param(Constants.WRAPPER) Wrapper<UserProject> qw); |
|||
List<UserProjectVo> typeList(); |
|||
UserProjectVo getProjectTypeBySid( @Param("sid") String sid); |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
<?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.crm.biz.userproject.UserProjectMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.crm.biz.userproject.UserProjectVo"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
user_project |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
<select id="typeList" resultType="com.yxt.supervise.crm.biz.userproject.UserProjectVo"> |
|||
SELECT * |
|||
FROM user_project |
|||
</select> |
|||
<select id="getProjectTypeBySid" resultType="com.yxt.supervise.crm.biz.userproject.UserProjectVo"> |
|||
SELECT * |
|||
FROM user_project |
|||
WHERE sid=#{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,46 @@ |
|||
package com.yxt.supervise.crm.biz.userproject; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/8/6 11:35 |
|||
*/ |
|||
public class UserProjectQuery implements Query { |
|||
private String id; |
|||
private String sid; |
|||
private String projectSid; |
|||
private String userSid; |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getSid() { |
|||
return sid; |
|||
} |
|||
|
|||
public void setSid(String sid) { |
|||
this.sid = sid; |
|||
} |
|||
|
|||
public String getProjectSid() { |
|||
return projectSid; |
|||
} |
|||
|
|||
public void setProjectSid(String projectSid) { |
|||
this.projectSid = projectSid; |
|||
} |
|||
|
|||
public String getUserSid() { |
|||
return userSid; |
|||
} |
|||
|
|||
public void setUserSid(String userSid) { |
|||
this.userSid = userSid; |
|||
} |
|||
} |
@ -0,0 +1,64 @@ |
|||
package com.yxt.supervise.crm.biz.userproject; |
|||
|
|||
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.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/8/6 11:34 |
|||
*/ |
|||
@Api(tags = "用户项目关联") |
|||
@RestController |
|||
@RequestMapping("userproject") |
|||
public class UserProjectRest { |
|||
|
|||
@Autowired |
|||
UserProjectService UserProjectService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<UserProjectVo>> listPage(@RequestBody PagerQuery<UserProjectQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<UserProjectVo> pv = UserProjectService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
@ApiOperation("查询项目类型字典") |
|||
@PostMapping("/list") |
|||
public ResultBean<List<UserProjectVo>> listPage() { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<UserProjectVo> pv = UserProjectService.typeList(); |
|||
return rb.success().setData(pv); |
|||
} |
|||
@ApiOperation("保存") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody UserProjectDto dto) { |
|||
return UserProjectService.save(dto); |
|||
} |
|||
@ApiOperation("修改") |
|||
@PostMapping("/update") |
|||
public ResultBean update(@RequestBody UserProjectDto dto) { |
|||
return UserProjectService.update(dto); |
|||
} |
|||
@ApiOperation("根据sid查询") |
|||
@GetMapping("/getProjTypeBySid/{sid}") |
|||
public ResultBean getWarehouse(@PathVariable String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
UserProjectVo UserProjectVo=UserProjectService.getProjectTypeBySid(sid); |
|||
return rb.success().setData(UserProjectVo); |
|||
} |
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable String sid) { |
|||
return UserProjectService.delete(sid); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.yxt.supervise.crm.biz.userproject; |
|||
|
|||
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.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/8/6 11:37 |
|||
*/ |
|||
@Service |
|||
public class UserProjectService extends MybatisBaseService<UserProjectMapper, UserProject> { |
|||
public PagerVo<UserProjectVo> listPageVo(PagerQuery<UserProjectQuery> pq) { |
|||
UserProjectQuery query = pq.getParams(); |
|||
QueryWrapper<UserProject> qw = new QueryWrapper<>(); |
|||
// if(StringUtils.isNotBlank(query.getTypeName())){
|
|||
// qw.like("projectType",query.getTypeName());
|
|||
// }
|
|||
IPage<UserProject> page = PagerUtil.queryToPage(pq); |
|||
IPage<UserProjectVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<UserProjectVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
public List<UserProjectVo> typeList() { |
|||
List<UserProjectVo> pagging = baseMapper.typeList(); |
|||
return pagging; |
|||
} |
|||
public ResultBean save(UserProjectDto dto) { |
|||
ResultBean rb=new ResultBean(); |
|||
UserProject entity=new UserProject(); |
|||
// dto.setProjectType(dto.getTypeName());
|
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg("保存项目类型成功"); |
|||
} |
|||
public ResultBean update(UserProjectDto dto) { |
|||
ResultBean rb=new ResultBean(); |
|||
String dtoSid = dto.getSid(); |
|||
// dto.setProjectType(dto.getTypeName());
|
|||
UserProject entity=fetchBySid(dtoSid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
return rb.success().setMsg("修改项目类型成功"); |
|||
} |
|||
public UserProjectVo getProjectTypeBySid(String sid){ |
|||
UserProjectVo bank=baseMapper.getProjectTypeBySid(sid); |
|||
return bank; |
|||
} |
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb=new ResultBean(); |
|||
baseMapper.delete(new QueryWrapper<UserProject>().eq("sid",sid)); |
|||
return rb.success().setMsg("删除项目类型成功"); |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.yxt.supervise.crm.biz.userproject; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/8/6 11:35 |
|||
*/ |
|||
public class UserProjectVo implements Query { |
|||
private String id; |
|||
private String sid; |
|||
private String projectSid; |
|||
private String userSid; |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getSid() { |
|||
return sid; |
|||
} |
|||
|
|||
public void setSid(String sid) { |
|||
this.sid = sid; |
|||
} |
|||
|
|||
public String getProjectSid() { |
|||
return projectSid; |
|||
} |
|||
|
|||
public void setProjectSid(String projectSid) { |
|||
this.projectSid = projectSid; |
|||
} |
|||
|
|||
public String getUserSid() { |
|||
return userSid; |
|||
} |
|||
|
|||
public void setUserSid(String userSid) { |
|||
this.userSid = userSid; |
|||
} |
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.yxt.supervise.report.ds.crm; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.EntityWithId; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/8/6 11:34 |
|||
*/ |
|||
@TableName("user_project") |
|||
public class UserProject extends EntityWithId { |
|||
|
|||
private String sid; |
|||
private String projectSid; |
|||
private String userSid; |
|||
|
|||
|
|||
|
|||
|
|||
public String getSid() { |
|||
return sid; |
|||
} |
|||
|
|||
public void setSid(String sid) { |
|||
this.sid = sid; |
|||
} |
|||
|
|||
public String getProjectSid() { |
|||
return projectSid; |
|||
} |
|||
|
|||
public void setProjectSid(String projectSid) { |
|||
this.projectSid = projectSid; |
|||
} |
|||
|
|||
public String getUserSid() { |
|||
return userSid; |
|||
} |
|||
|
|||
public void setUserSid(String userSid) { |
|||
this.userSid = userSid; |
|||
} |
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.yxt.supervise.report.ds.system; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: anrui_portal(门户建设) <br/> |
|||
* File: SysUser.java <br/> |
|||
* Class: SysUser <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 = "用户表") |
|||
@TableName("sys_user") |
|||
@Data |
|||
public class SysUser extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
@ApiModelProperty("登录名,登录名不能相同") |
|||
private String userName; |
|||
|
|||
@ApiModelProperty("密码(加密或签名后)") |
|||
private String password; |
|||
|
|||
@ApiModelProperty("密码修改时限") |
|||
private String pwdDayslimit; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@ApiModelProperty("最后一次密码修改时间") |
|||
private Date pwdModifyTime; |
|||
|
|||
@ApiModelProperty("在线状态(0为离线、1为在线)") |
|||
private Integer onlineState; |
|||
|
|||
@ApiModelProperty("用户登录时随机生成身份验证字符串") |
|||
private String token; |
|||
|
|||
@ApiModelProperty("是否是管理员:1管理员,2一般用户,0是超级管理员,3尚无单位人员") |
|||
private String isAdmin; |
|||
|
|||
@ApiModelProperty("手机登录唯一标识,手机与用户绑定字段") |
|||
private String appId; |
|||
|
|||
@ApiModelProperty("关联的人员sid") |
|||
private String staffSid; |
|||
|
|||
@ApiModelProperty("手机号") |
|||
private String mobile; |
|||
|
|||
@ApiModelProperty("用户类型:1员工、2客户、3供应商") |
|||
private Integer userType; |
|||
|
|||
@ApiModelProperty("用户头像") |
|||
private String headImage; |
|||
private String openId; |
|||
private String appletOpenid; |
|||
@TableField(exist = false) |
|||
private List<String> roleNames; |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.supervise.report.ds.system; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.supervise.report.ds.crm.ProjectInfo; |
|||
import com.yxt.supervise.report.ds.crm.UserProject; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
@DS("system") |
|||
@Mapper |
|||
public interface systemMapper extends BaseMapper<com.yxt.supervise.report.ds.system.SysUser> { |
|||
|
|||
@Select("select openid from sys_user where sid=#{userSid}") |
|||
String getOpenId(@Param("userSid") String userSid); |
|||
} |
Loading…
Reference in new issue