feat:账户变更记录
This commit is contained in:
parent
e21b3cf15e
commit
f04357f279
16
sql/init.sql
Normal file
16
sql/init.sql
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS plat_user_role_job_change
|
||||||
|
(
|
||||||
|
id bigint auto_increment comment '主键',
|
||||||
|
axzo_user_id bigint default 0 not null comment '安心筑id',
|
||||||
|
change_type varchar(20) default '' not null comment '变更类型',
|
||||||
|
change_detail varchar(256) default '' not null comment '变更详情',
|
||||||
|
operator varchar(50) not null comment '变更操作人',
|
||||||
|
operator_time datetime default CURRENT_TIMESTAMP not null comment '变更时间',
|
||||||
|
is_delete tinyint default 0 not null comment '未删除0,删除1',
|
||||||
|
create_at datetime default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||||
|
update_at datetime default CURRENT_TIMESTAMP not null comment '更新时间',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8 comment '平台账户角色岗位变动记录';
|
||||||
|
create index idx_plat_user_role_job_change
|
||||||
|
on plat_user_role_job_change (axzo_user_id, operator_time);
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
package cn.axzo.tyr.client.feign;
|
||||||
|
|
||||||
|
import cn.axzo.framework.domain.web.result.ApiPageResult;
|
||||||
|
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||||
|
import cn.axzo.tyr.client.model.req.GetWorkflowQueryAndUpdatePermissionReq;
|
||||||
|
import cn.axzo.tyr.client.model.req.PlatAccountChangeLogReq;
|
||||||
|
import cn.axzo.tyr.client.model.req.PlatAccountChangeQuery;
|
||||||
|
import cn.axzo.tyr.client.model.res.GetWorkflowQueryAndUpdatePermissionRes;
|
||||||
|
import cn.axzo.tyr.client.model.res.PlatAccountChangeLogResp;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tyr
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:03
|
||||||
|
*/
|
||||||
|
@FeignClient(name = "tyr", url = "${axzo.service.tyr:http://tyr:8080}")
|
||||||
|
public interface PlatUserRoleChangeApi {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存账户变更日志
|
||||||
|
*
|
||||||
|
* @param req 户变更日志
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/api/v1/plat/user/change/log")
|
||||||
|
ApiResult<Void> savePlatUserAccountChangeLog(@RequestBody @Validated PlatAccountChangeLogReq req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询平台账户变更日志
|
||||||
|
*
|
||||||
|
* @param platAccountChangeQuery 查询条件
|
||||||
|
* @return 返回账户变动记录列表
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/api/v1/plat/user/change/log/query")
|
||||||
|
ApiPageResult<PlatAccountChangeLogResp> queryPlatUserAccountChangeLog(@RequestBody @Validated PlatAccountChangeQuery platAccountChangeQuery);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
package cn.axzo.tyr.client.model.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PlatAccountChangeLogReq
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class PlatAccountChangeLogReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安心筑id
|
||||||
|
*/
|
||||||
|
private Long axzoUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更类型
|
||||||
|
*/
|
||||||
|
private String changeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更详情
|
||||||
|
*/
|
||||||
|
private String changeDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* operator
|
||||||
|
*/
|
||||||
|
private String operator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更时间
|
||||||
|
*/
|
||||||
|
private Date operatorTime;
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package cn.axzo.tyr.client.model.req;
|
||||||
|
|
||||||
|
import cn.axzo.core.domain.PageRequest;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PlatAccountChangeLogReq
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class PlatAccountChangeQuery extends PageRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安心筑id
|
||||||
|
*/
|
||||||
|
private Long axzoUserId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package cn.axzo.tyr.client.model.res;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PlatAccountChangeLogReq
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class PlatAccountChangeLogResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安心筑id
|
||||||
|
*/
|
||||||
|
private Long axzoUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更类型
|
||||||
|
*/
|
||||||
|
private String changeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更详情
|
||||||
|
*/
|
||||||
|
private String changeDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* operator
|
||||||
|
*/
|
||||||
|
private String operator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更时间
|
||||||
|
*/
|
||||||
|
private Date operatorTime;
|
||||||
|
}
|
||||||
38
tyr-api/src/main/java/cn/axzo/tyr/client/model/res/Test.java
Normal file
38
tyr-api/src/main/java/cn/axzo/tyr/client/model/res/Test.java
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package cn.axzo.tyr.client.model.res;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tyr
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:43
|
||||||
|
*/
|
||||||
|
public class Test {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Test test = new Test();
|
||||||
|
System.out.println(JSON.toJSON(test));
|
||||||
|
System.out.println("--------------");
|
||||||
|
System.out.println(JSON.toJSONString(test));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String xxxMethod1(){
|
||||||
|
System.out.println("333");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMethod123(){
|
||||||
|
System.out.println("123");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMethod1(){
|
||||||
|
System.out.println("11");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMethod2(){
|
||||||
|
System.out.println("22");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package cn.axzo.tyr.server.controller.change;
|
||||||
|
|
||||||
|
import cn.axzo.framework.domain.web.result.ApiPageResult;
|
||||||
|
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||||
|
import cn.axzo.tyr.client.feign.PlatUserRoleChangeApi;
|
||||||
|
import cn.axzo.tyr.client.model.req.PlatAccountChangeLogReq;
|
||||||
|
import cn.axzo.tyr.client.model.req.PlatAccountChangeQuery;
|
||||||
|
import cn.axzo.tyr.client.model.res.PlatAccountChangeLogResp;
|
||||||
|
import cn.axzo.tyr.server.service.impl.PlatUserRoleChangeService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tyr
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:27
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PlatUserRoleChangeController implements PlatUserRoleChangeApi {
|
||||||
|
|
||||||
|
private PlatUserRoleChangeService roleChangeService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResult<Void> savePlatUserAccountChangeLog(PlatAccountChangeLogReq accountChangeLog) {
|
||||||
|
roleChangeService.savePlatUserAccountChangeLog(accountChangeLog);
|
||||||
|
return ApiResult.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiPageResult<PlatAccountChangeLogResp> queryPlatUserAccountChangeLog(PlatAccountChangeQuery platAccountChangeQuery) {
|
||||||
|
return roleChangeService.queryPlatUserAccountChangeLog(platAccountChangeQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package cn.axzo.tyr.server.repository.dao;
|
||||||
|
|
||||||
|
import cn.axzo.tyr.server.repository.entity.PlatUserAccountChangeLog;
|
||||||
|
import cn.axzo.tyr.server.repository.mapper.PlatUserAccountChangeMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tyr
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:28
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class PlatUserRoleChangeDao extends ServiceImpl<PlatUserAccountChangeMapper, PlatUserAccountChangeLog> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package cn.axzo.tyr.server.repository.entity;
|
||||||
|
|
||||||
|
import cn.axzo.pokonyan.config.mybatisplus.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.apache.ibatis.type.BooleanTypeHandler;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: zuoqinbo
|
||||||
|
* @date: 2023/11/23 17:39
|
||||||
|
* @description: 账号异动记录
|
||||||
|
* @modifiedBy:
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName("plat_user_role_job_change")
|
||||||
|
public class PlatUserAccountChangeLog extends BaseEntity<PlatUserAccountChangeLog> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安心筑id
|
||||||
|
*/
|
||||||
|
@TableField(value = "axzo_user_id")
|
||||||
|
private Long axzoUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "change_type")
|
||||||
|
private String changeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更详情
|
||||||
|
*/
|
||||||
|
@TableField(value = "change_detail")
|
||||||
|
private String changeDetail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* operator
|
||||||
|
*/
|
||||||
|
@TableField(value = "operator")
|
||||||
|
private String operator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "operator_time")
|
||||||
|
private Date operatorTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package cn.axzo.tyr.server.repository.mapper;
|
||||||
|
|
||||||
|
import cn.axzo.tyr.server.repository.entity.PlatUserAccountChangeLog;
|
||||||
|
import cn.axzo.tyr.server.repository.entity.ProductModule;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tyr
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:34
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PlatUserAccountChangeMapper extends BaseMapper<PlatUserAccountChangeLog> {
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
package cn.axzo.tyr.server.service.impl;
|
||||||
|
|
||||||
|
import cn.axzo.basics.common.BeanMapper;
|
||||||
|
import cn.axzo.framework.domain.page.PageResp;
|
||||||
|
import cn.axzo.framework.domain.web.result.ApiPageResult;
|
||||||
|
import cn.axzo.tyr.client.model.product.ProductVO;
|
||||||
|
import cn.axzo.tyr.client.model.req.PlatAccountChangeLogReq;
|
||||||
|
import cn.axzo.tyr.client.model.req.PlatAccountChangeQuery;
|
||||||
|
import cn.axzo.tyr.client.model.res.PlatAccountChangeLogResp;
|
||||||
|
import cn.axzo.tyr.server.repository.dao.PlatUserRoleChangeDao;
|
||||||
|
import cn.axzo.tyr.server.repository.dao.SaasFeatureDao;
|
||||||
|
import cn.axzo.tyr.server.repository.entity.PlatUserAccountChangeLog;
|
||||||
|
import cn.axzo.tyr.server.repository.entity.ProductModule;
|
||||||
|
import cn.axzo.tyr.server.repository.entity.SaasProductModuleFeatureRelation;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tyr
|
||||||
|
*
|
||||||
|
* @author zuoqinbo
|
||||||
|
* @version V1.0
|
||||||
|
* @date 2023/11/23 18:28
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class PlatUserRoleChangeService {
|
||||||
|
|
||||||
|
private final PlatUserRoleChangeDao userRoleChangeDao;
|
||||||
|
|
||||||
|
public void savePlatUserAccountChangeLog(PlatAccountChangeLogReq accountChangeLog) {
|
||||||
|
PlatUserAccountChangeLog platUserAccountChangeLog = new PlatUserAccountChangeLog();
|
||||||
|
BeanUtils.copyProperties(accountChangeLog, platUserAccountChangeLog);
|
||||||
|
userRoleChangeDao.saveOrUpdate(platUserAccountChangeLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiPageResult<PlatAccountChangeLogResp> queryPlatUserAccountChangeLog(PlatAccountChangeQuery platAccountChangeQuery) {
|
||||||
|
IPage<PlatUserAccountChangeLog> page = userRoleChangeDao.lambdaQuery()
|
||||||
|
.eq(PlatUserAccountChangeLog::getAxzoUserId, platAccountChangeQuery.getAxzoUserId())
|
||||||
|
.page(platAccountChangeQuery.toPage());
|
||||||
|
List<PlatAccountChangeLogResp> list = BeanMapper.copyList(page.getRecords(), PlatAccountChangeLogResp.class);
|
||||||
|
PageResp<PlatAccountChangeLogResp> data = PageResp.list(page.getCurrent(), page.getSize(), page.getTotal(), list);
|
||||||
|
return ApiPageResult.ok(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user