16 changed files with 434 additions and 10 deletions
@ -0,0 +1,27 @@ |
|||||
|
package com.yxt.supervise.report.wx.auth; |
||||
|
|
||||
|
import com.alibaba.nacos.common.model.RestResult; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/12 14:26 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/wxuser") |
||||
|
public class WxUserRest { |
||||
|
@Autowired |
||||
|
WxUserService wxUserService; |
||||
|
|
||||
|
@GetMapping("/checkNewAndInsert") |
||||
|
public ResultBean checkNewAndInsert(){ |
||||
|
ResultBean rb=new ResultBean(); |
||||
|
return rb.success().setData(wxUserService.checkNewAndInsert()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.supervise.feign.report; |
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.feign.flowable.flowtask.FlowTaskFeignFallBack; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/12 14:33 |
||||
|
*/ |
||||
|
@FeignClient( |
||||
|
contextId = "supervise-report-auth", |
||||
|
name = "supervise-report", |
||||
|
path = "wxuser", |
||||
|
fallback = FlowTaskFeignFallBack.class) |
||||
|
public interface WxUserFeign { |
||||
|
@GetMapping("/checkNewAndInsert") |
||||
|
public ResultBean checkNewAndInsert(); |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.yxt.supervise.system.wxuser; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/12 10:40 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class WxUser { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
private String createTime; |
||||
|
private String modifyTime; |
||||
|
private Integer subscribe; |
||||
|
private String openid; |
||||
|
private String language; |
||||
|
private String subscribe_time; |
||||
|
private String unionid; |
||||
|
private String remark; |
||||
|
private String groupid; |
||||
|
private String tagid_list_json; |
||||
|
private String subscribe_scene; |
||||
|
private String qr_scene; |
||||
|
private String qr_scene_str; |
||||
|
private String miniprogramOpenid; |
||||
|
private String sys_user_sid; |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
package com.yxt.supervise.system.wxuser; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/12 10:41 |
||||
|
*/ |
||||
|
public class WxUserDto { |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package com.yxt.supervise.system.wxuser; |
||||
|
|
||||
|
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.Delete; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
@Mapper |
||||
|
public interface WxUserMapper extends BaseMapper<WxUser> { |
||||
|
|
||||
|
IPage<WxUserVo> selectPageVo(IPage<WxUser> page, @Param(Constants.WRAPPER) Wrapper<WxUser> qw); |
||||
|
|
||||
|
List<WxUserVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<WxUser> qw); |
||||
|
|
||||
|
@Select("select * from sys_staff_post") |
||||
|
List<WxUserVo> selectListVo(); |
||||
|
|
||||
|
@Delete("delete from sys_staff_post where staffSid=#{staffSid} ") |
||||
|
void deleteByStaffSid(String staffSid); |
||||
|
|
||||
|
/** |
||||
|
* 根据员工sid查询员工的岗位信息 |
||||
|
* |
||||
|
* @param sid 员工的sid |
||||
|
* @return |
||||
|
*/ |
||||
|
WxUser selectByStaffSid(@Param("sid") String sid, @Param("postSid") String postSid); |
||||
|
|
||||
|
|
||||
|
|
||||
|
String selectPost(String sid); |
||||
|
|
||||
|
List<String> getPost(String staffSid); |
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
<?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.wxuser.WxUserMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.supervise.system.wxuser.WxUserVo"> |
||||
|
SELECT * |
||||
|
FROM sys_staff_post |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectListAllVo" resultType="com.yxt.supervise.system.wxuser.WxUserVo"> |
||||
|
SELECT * |
||||
|
FROM sys_staff_post |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
<!--根据员工的sid查询员工的岗位信息--> |
||||
|
<select id="selectByStaffSid" resultType="com.yxt.supervise.system.wxuser.WxUser"> |
||||
|
select * |
||||
|
from sys_staff_post |
||||
|
where staffSid = #{sid} |
||||
|
and postSid = #{postSid} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<select id="selectPost" resultType="java.lang.String"> |
||||
|
select sr.sid |
||||
|
from sys_staff_post ssp |
||||
|
left join sys_post sp on sp.sid = ssp.postSid |
||||
|
left join sys_role sr on sp.parentSid = sr.postSid |
||||
|
where ssp.staffSid = #{sid} |
||||
|
</select> |
||||
|
|
||||
|
<select id="getPost" resultType="java.lang.String"> |
||||
|
select sp.name |
||||
|
from sys_staff_post ssp |
||||
|
left join sys_post sp on ssp.postSid = sp.sid |
||||
|
where ssp.staffSid = #{staffSid} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,10 @@ |
|||||
|
package com.yxt.supervise.system.wxuser; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/12 10:41 |
||||
|
*/ |
||||
|
public class WxUserQuery implements Query { |
||||
|
} |
@ -0,0 +1,72 @@ |
|||||
|
package com.yxt.supervise.system.wxuser; |
||||
|
|
||||
|
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.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; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/8/8 16:32 |
||||
|
*/ |
||||
|
@Api(tags = "用户和微信小程序openid") |
||||
|
@RestController |
||||
|
@RequestMapping("wxuser") |
||||
|
public class WxUserRest { |
||||
|
|
||||
|
@Autowired |
||||
|
private WxUserService WxUserService; |
||||
|
|
||||
|
|
||||
|
|
||||
|
public ResultBean<PagerVo<WxUserVo>> listPage(@RequestBody PagerQuery<WxUserQuery> pq) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<WxUserVo> pv = WxUserService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public ResultBean<List<WxUserVo>> listAll(@RequestBody WxUserQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<WxUserVo> list = WxUserService.listAllVo(query); |
||||
|
return rb.success().setData(list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public ResultBean<List<WxUserVo>> list() { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<WxUserVo> list = WxUserService.listVo(); |
||||
|
return rb.success().setData(list); |
||||
|
} |
||||
|
|
||||
|
// @ApiOperation(value = "保存")
|
||||
|
// @PostMapping("/save")
|
||||
|
// public ResultBean save(@RequestBody WxUserDto dto) {
|
||||
|
// ResultBean rb = ResultBean.fireFail();
|
||||
|
// WxUserService.saveOrUpdateDto(dto);
|
||||
|
// return rb.success();
|
||||
|
// }
|
||||
|
|
||||
|
// @ApiOperation(value = "修改")
|
||||
|
// @PostMapping("/update")
|
||||
|
// public ResultBean update(@RequestBody WxUserDto dto, String sid) {
|
||||
|
// ResultBean rb = ResultBean.fireFail();
|
||||
|
// WxUserService.updateBySid(dto.toMap(), sid);
|
||||
|
// return rb.success();
|
||||
|
// }
|
||||
|
|
||||
|
public ResultBean del(String ids) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
WxUserService.delByIds(ids); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,118 @@ |
|||||
|
package com.yxt.supervise.system.wxuser; |
||||
|
|
||||
|
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.vo.PagerVo; |
||||
|
import com.yxt.supervise.feign.crm.BankManagerDto; |
||||
|
import com.yxt.supervise.feign.crm.BankManagerFeign; |
||||
|
import com.yxt.supervise.system.sysuser.SysUser; |
||||
|
import com.yxt.supervise.system.sysuser.SysUserDto; |
||||
|
import com.yxt.supervise.system.sysuser.SysUserRest; |
||||
|
import com.yxt.supervise.system.sysuser.SysUserService; |
||||
|
import com.yxt.supervise.system.sysuserwxauth.SysUserWxAuth; |
||||
|
import com.yxt.supervise.system.sysuserwxauth.SysUserWxAuthService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.UUID; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/8/8 16:32 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class WxUserService extends MybatisBaseService<WxUserMapper, WxUser> { |
||||
|
@Autowired |
||||
|
BankManagerFeign bankManagerFeign; |
||||
|
@Autowired |
||||
|
SysUserService sysUserService; |
||||
|
@Autowired |
||||
|
SysUserWxAuthService sysUserWxAuthService; |
||||
|
@Autowired |
||||
|
SysUserRest sysUserRest; |
||||
|
public PagerVo<WxUser> listPage(PagerQuery<WxUserQuery> pq) { |
||||
|
WxUserQuery query = pq.getParams(); |
||||
|
QueryWrapper<WxUser> qw = new QueryWrapper<>(); |
||||
|
IPage<WxUser> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<WxUser> pagging = baseMapper.selectPage(page, qw); |
||||
|
PagerVo<WxUser> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public List<WxUser> listAll(WxUserQuery query) { |
||||
|
QueryWrapper<WxUser> qw = new QueryWrapper<>(); |
||||
|
return baseMapper.selectList(qw); |
||||
|
} |
||||
|
|
||||
|
// private QueryWrapper<WxUser> createQueryWrapper(WxUserQuery query) {
|
||||
|
// // todo: 这里根据具体业务调整查询条件
|
||||
|
// // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
||||
|
// QueryWrapper<WxUser> qw = new QueryWrapper<>();
|
||||
|
//
|
||||
|
//
|
||||
|
// if (StringUtils.isNotBlank(query.getStaffSid())) {
|
||||
|
// qw.eq("staffSid", query.getStaffSid());
|
||||
|
// }
|
||||
|
//
|
||||
|
// if (StringUtils.isNotBlank(query.getOrgSid())) {
|
||||
|
// qw.eq("orgSid", query.getOrgSid());
|
||||
|
// }
|
||||
|
//
|
||||
|
// if (StringUtils.isNotBlank(query.getPostSid())) {
|
||||
|
// qw.eq("postSid", query.getPostSid());
|
||||
|
// }
|
||||
|
//
|
||||
|
// if (query.getStartDateStart() != null) {
|
||||
|
// qw.ge("startDate", query.getStartDateStart());
|
||||
|
// }
|
||||
|
// if (query.getStartDateEnd() != null) {
|
||||
|
// qw.le("startDate", query.getStartDateEnd());
|
||||
|
// }
|
||||
|
//
|
||||
|
// if (query.getIsDepetHead() != null) {
|
||||
|
// qw.eq("isDepetHead", query.getIsDepetHead());
|
||||
|
// }
|
||||
|
// return qw;
|
||||
|
// }
|
||||
|
|
||||
|
public PagerVo<WxUserVo> listPageVo(PagerQuery<WxUserQuery> pq) { |
||||
|
WxUserQuery query = pq.getParams(); |
||||
|
QueryWrapper<WxUser> qw = new QueryWrapper<>(); |
||||
|
IPage<WxUser> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<WxUserVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
PagerVo<WxUserVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public List<WxUserVo> listAllVo(WxUserQuery query) { |
||||
|
QueryWrapper<WxUser> qw = new QueryWrapper<>(); |
||||
|
return baseMapper.selectListAllVo(qw); |
||||
|
} |
||||
|
|
||||
|
public List<WxUserVo> listVo() { |
||||
|
return baseMapper.selectListVo(); |
||||
|
} |
||||
|
|
||||
|
// public void saveOrUpdateDto(WxUserDto dto) {
|
||||
|
// WxUser entity = new WxUser();
|
||||
|
// BeanUtil.copyProperties(dto, entity, "id", "sid");
|
||||
|
// entity.setSid(UUID.randomUUID().toString());
|
||||
|
// this.saveOrUpdate(entity);
|
||||
|
// }
|
||||
|
|
||||
|
public WxUserVo fetchByIdVo(String id) { |
||||
|
WxUser entity = this.fetchById(id); |
||||
|
WxUserVo vo = new WxUserVo(); |
||||
|
BeanUtil.copyProperties(entity, vo); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
package com.yxt.supervise.system.wxuser; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/10/12 10:41 |
||||
|
*/ |
||||
|
public class WxUserVo { |
||||
|
} |
Loading…
Reference in new issue