Commit 55132bbf authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents b4cfe11d accb02fa
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 法大大企业接入方信息
*
* @author fxj
* @date 2022-06-28 16:24:12
*/
@Data
@TableName("fdd_company_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "法大大企业接入方信息")
public class FddCompanyInfo extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
/**
* 企业名称
*/
@Schema(description ="企业名称")
private String companyName;
/**
* 管理员unionId
*/
@Schema(description ="管理员unionId")
private String managerUnionId;
/**
* 管理员姓名
*/
@Schema(description ="管理员姓名")
private String managerName;
/**
* 企业unionId
*/
@Schema(description ="企业unionId")
private String companyUnionId;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 法大大个人实名认证表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Data
@TableName("fdd_person_account")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "法大大个人实名认证表")
public class FddPersonAccount extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
/**
* 手机号
*/
@Schema(description ="手机号")
private String moblie;
/**
* 姓名
*/
@Schema(description ="姓名")
private String name;
/**
* 身份证号码
*/
@Schema(description ="身份证号码")
private String idCard;
/**
* 法大大用户唯一标识
*/
@Schema(description ="法大大用户唯一标识")
private String unionid;
/**
* 授权状态,0未授权 1已授权
*/
@Schema(description ="授权状态,0未授权 1已授权")
private String authStatus;
/**
* 0企业用户,1普通员工
*/
@Schema(description ="0企业用户,1普通员工")
private String systemFlag;
/**
* 法大大企业接入方信息id
*/
@Schema(description ="法大大企业接入方信息id")
private String companyInfoId;
/**
* 实名认证状态,0未实名 1已实名
*/
@Schema(description ="实名认证状态,0未实名 1已实名")
private String realStatus;
/**
* 实名短信发送:0未发送 1已发送
*/
@Schema(description ="实名短信发送:0未发送 1已发送")
private String realMessageFlag;
/**
* 创建者
*/
@Schema(description ="创建者")
private String createBy;
/**
* 更新人
*/
@Schema(description ="更新人")
private String updateBy;
/**
* 创建时间
*/
@Schema(description ="创建时间")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Schema(description ="更新时间")
private LocalDateTime updateTime;
/**
* 创建人姓名
*/
@Schema(description ="创建人姓名")
private String createName;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 法大大日志记录表
*
* @author fxj
* @date 2022-06-28 16:24:12
*/
@Data
@TableName("fdd_req_log")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "法大大日志记录表")
public class FddReqLog extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
/**
* 请求数据
*/
@Schema(description ="请求数据")
private String reqData;
/**
* 返回数据
*/
@Schema(description ="返回数据")
private String resData;
/**
* 调用方法
*/
@Schema(description ="调用方法")
private String methodName;
/**
* 调用类名
*/
@Schema(description ="调用类名")
private String className;
/**
* 创建者
*/
@Schema(description ="创建者")
private String createBy;
/**
* 更新人
*/
@Schema(description ="更新人")
private String updateBy;
/**
* 创建时间
*/
@Schema(description ="创建时间")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Schema(description ="更新时间")
private LocalDateTime updateTime;
/**
* 创建人姓名
*/
@Schema(description ="创建人姓名")
private String createName;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 法大大印章
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Data
@TableName("fdd_seal_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "法大大印章")
public class FddSealInfo extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
/**
* 印章名称
*/
@Schema(description ="印章名称")
private String sealName;
/**
* 0:未删除; 1:已删除
*/
@Schema(description ="0:未删除; 1:已删除")
private Integer deleteFlag;
/**
* 法大大印章ID
*/
@Schema(description ="法大大印章ID")
private String sealId;
/**
* 印章状态 -1:审核不通过 1:待审核 2:审核通过
*/
@Schema(description ="印章状态 -1:审核不通过 1:待审核 2:审核通过")
private String status;
/**
* 系统章状态: 0:否 1:是
*/
@Schema(description ="系统章状态: 0:否 1:是")
private String sysFlag;
/**
* 印章对应的公司id
*/
@Schema(description ="印章对应的公司id")
private String sealCompanyId;
/**
* 创建者
*/
@Schema(description ="创建者")
private String createBy;
/**
* 更新人
*/
@Schema(description ="更新人")
private String updateBy;
/**
* 创建时间
*/
@Schema(description ="创建时间")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Schema(description ="更新时间")
private LocalDateTime updateTime;
/**
* 创建人姓名
*/
@Schema(description ="创建人姓名")
private String createName;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 法大大印章授权表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Data
@TableName("fdd_seal_person_auth")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "法大大印章授权表")
public class FddSealPersonAuth extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
/**
* 法大大印章ID
*/
@Schema(description ="法大大印章ID")
private String sealId;
/**
* 员工id
*/
@Schema(description ="员工id")
private String fddPersonAccountId;
/**
* 授权状态 0:未授权 1已授权
*/
@Schema(description ="授权状态 0:未授权 1已授权")
private String status;
/**
* 创建者
*/
@Schema(description ="创建者")
private String createBy;
/**
* 更新人
*/
@Schema(description ="更新人")
private String updateBy;
/**
* 创建时间
*/
@Schema(description ="创建时间")
private LocalDateTime createTime;
/**
* 更新时间
*/
@Schema(description ="更新时间")
private LocalDateTime updateTime;
/**
* 创建人姓名
*/
@Schema(description ="创建人姓名")
private String createName;
}
......@@ -23,7 +23,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.Max;
import java.util.Date;
import java.time.LocalDate;
/**
* 员工学历信息表
......@@ -75,7 +75,7 @@ public class TEmpEducation extends BaseEntity {
* 入学时间
*/
@Schema(description = "入学时间")
private Date entryDate;
private LocalDate entryDate;
/**
* 学历名称
......@@ -88,7 +88,7 @@ public class TEmpEducation extends BaseEntity {
* 结业日期
*/
@Schema(description = "结业日期")
private Date gradutionDate;
private LocalDate gradutionDate;
/**
* 学校名称
......
......@@ -30,7 +30,6 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Set;
......@@ -63,15 +62,15 @@ public class TEmployeeInfo extends BaseEntity {
* 员工类型(字典值,0外包1派遣2代理)
*/
@Schema(description = "员工类型(字典值,0外包1派遣2代理)")
@NotNull( message = "员工类型不可为空")
@Size(max = 1, message = "员工类型不可超过1位")
@NotNull(message = "员工类型不可为空")
@Size(max = 1, message = "员工类型不可超过1位")
private String empNatrue;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
@NotNull( message = "员工姓名不可为空")
@NotNull(message = "员工姓名不可为空")
@Size(max = 20, message = "员工姓名不可超过20位")
private String empName;
......@@ -79,7 +78,7 @@ public class TEmployeeInfo extends BaseEntity {
* 身份证号码
*/
@Schema(description = "身份证号码")
@NotNull( message = "身份证号码不可为空")
@NotNull(message = "身份证号码不可为空")
@Size(max = 20, message = "身份证号码不可超过20位")
private String empIdcard;
......@@ -144,8 +143,8 @@ public class TEmployeeInfo extends BaseEntity {
* 手机号码
*/
@Schema(description = "手机号码")
@NotNull( message = "手机号码不可为空")
@Size(max = 11,min = 11, message = "手机号码只能11位")
@NotNull(message = "手机号码不可为空")
@Size(max = 11, min = 11, message = "手机号码只能11位")
private String empPhone;
/**
......@@ -218,13 +217,13 @@ public class TEmployeeInfo extends BaseEntity {
* 入学时间
*/
@Schema(description = "入学时间")
private Date admissionDate;
private LocalDate admissionDate;
/**
* 毕业时间
*/
@Schema(description = "毕业时间")
private Date gradutionDate;
private LocalDate gradutionDate;
/**
* 备注
......
......@@ -24,7 +24,6 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
/**
* 项目档案表excel对应的实体
......@@ -190,13 +189,13 @@ public class EmployeeVO implements Serializable {
* 入学时间
*/
@ExcelProperty(value = "入学时间")
private Date admissionDate;
private LocalDate admissionDate;
/**
* 毕业时间
*/
@ExcelProperty(value = "毕业时间")
private Date gradutionDate;
private LocalDate gradutionDate;
/**
* 备注
......
......@@ -62,6 +62,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.fadada.api</groupId>
<version>1.8.0</version>
<artifactId>fadada-java-sdk-api3</artifactId>
</dependency>
</dependencies>
<build>
......
package com.yifu.cloud.plus.v1.yifu.archives.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
/**
* @auther wangan
* @date 2021/1/18
* 法大大基本配置
*/
@RefreshScope
@ConfigurationProperties(prefix = "fdd")
@Data
public class FddConfigProperties {
/**
* @Author: wangan
* @Date: 2021/1/18
* @Description: 法大大分配的接入id
**/
private String appId;
/**
* @Description: 法大大分配的appid对应的key
**/
private String appKey;
/**
* @Description: 指定环境请求url
**/
private String serverUrl;
/**
* http连接超时时间
*/
private int connectTimeout;
/**
* http读超时时间
*/
private int readTimeout;
/**
* 系统地址
*/
private String hrmsUrl;
/**
* 异步通知地址
*/
private String notifyUrl="/fdd/notifyUrl";
/**
* 个人实名回调地址
*/
private String personRedirectUrl="/fdd/personRedirectUrl";
/**
* 邀请员工回调地址
*/
private String addEmployeeRedirectUrl="/fdd/addEmployeeRedirectUrl";
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddCompanyInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
/**
* 法大大企业接入方信息
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/fddcompanyinfo" )
@Tag(name = "法大大企业接入方信息管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class FddCompanyInfoController {
private final FddCompanyInfoService fddCompanyInfoService;
/**
* 分页查询
* @param page 分页对象
* @param fddCompanyInfo 法大大企业接入方信息
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R getFddCompanyInfoPage(Page page, FddCompanyInfo fddCompanyInfo) {
return R.ok(fddCompanyInfoService.getFddCompanyInfoPage(page, fddCompanyInfo));
}
/**
* 通过id查询法大大企业接入方信息
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(fddCompanyInfoService.getById(id));
}
/**
* 新增法大大企业接入方信息
* @param fddCompanyInfo 法大大企业接入方信息
* @return R
*/
@Operation(summary = "新增法大大企业接入方信息", description = "新增法大大企业接入方信息:hasPermission('demo_fddcompanyinfo_add')")
@SysLog("新增法大大企业接入方信息" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_fddcompanyinfo_add')" )
public R save(@RequestBody FddCompanyInfo fddCompanyInfo) {
return R.ok(fddCompanyInfoService.save(fddCompanyInfo));
}
/**
* 修改法大大企业接入方信息
* @param fddCompanyInfo 法大大企业接入方信息
* @return R
*/
@Operation(summary = "修改法大大企业接入方信息", description = "修改法大大企业接入方信息:hasPermission('demo_fddcompanyinfo_edit')")
@SysLog("修改法大大企业接入方信息" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_fddcompanyinfo_edit')" )
public R updateById(@RequestBody FddCompanyInfo fddCompanyInfo) {
return R.ok(fddCompanyInfoService.updateById(fddCompanyInfo));
}
/**
* 通过id删除法大大企业接入方信息
* @param id id
* @return R
*/
@Operation(summary = "通过id删除法大大企业接入方信息", description = "通过id删除法大大企业接入方信息:hasPermission('demo_fddcompanyinfo_del')")
@SysLog("通过id删除法大大企业接入方信息" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_fddcompanyinfo_del')" )
public R removeById(@PathVariable String id) {
return R.ok(fddCompanyInfoService.removeById(id));
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddPersonAccount;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddPersonAccountService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* 法大大个人实名认证表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/fddpersonaccount" )
@Tag(name = "法大大个人实名认证表管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class FddPersonAccountController {
private final FddPersonAccountService fddPersonAccountService;
/**
* 分页查询
* @param page 分页对象
* @param fddPersonAccount 法大大个人实名认证表
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R getFddPersonAccountPage(Page page, FddPersonAccount fddPersonAccount) {
return R.ok(fddPersonAccountService.getFddPersonAccountPage(page, fddPersonAccount));
}
/**
* 通过id查询法大大个人实名认证表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(fddPersonAccountService.getById(id));
}
/**
* 新增法大大个人实名认证表
* @param fddPersonAccount 法大大个人实名认证表
* @return R
*/
@Operation(summary = "新增法大大个人实名认证表", description = "新增法大大个人实名认证表:hasPermission('demo_fddpersonaccount_add')")
@SysLog("新增法大大个人实名认证表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_fddpersonaccount_add')" )
public R saveAuth(@RequestBody FddPersonAccount fddPersonAccount) {
return R.ok(fddPersonAccountService.save(fddPersonAccount));
}
/**
* 修改法大大个人实名认证表
* @param fddPersonAccount 法大大个人实名认证表
* @return R
*/
@Operation(summary = "修改法大大个人实名认证表", description = "修改法大大个人实名认证表:hasPermission('demo_fddpersonaccount_edit')")
@SysLog("修改法大大个人实名认证表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_fddpersonaccount_edit')" )
public R updateById(@RequestBody FddPersonAccount fddPersonAccount) {
return R.ok(fddPersonAccountService.updateById(fddPersonAccount));
}
/**
* 通过id删除法大大个人实名认证表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除法大大个人实名认证表", description = "通过id删除法大大个人实名认证表:hasPermission('demo_fddpersonaccount_del')")
@SysLog("通过id删除法大大个人实名认证表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_fddpersonaccount_del')" )
public R removeById(@PathVariable String id) {
return R.ok(fddPersonAccountService.removeById(id));
}
/**
* 邀请客服进行法大大实名
* @param fddPersonAccount
* @return R
*/
@Operation(summary = "邀请客服进行法大大实名", description = "邀请客服进行法大大实名")
@SysLog("邀请客服进行法大大实名" )
@PostMapping("/saneSend")
public R<String> save(@Valid @RequestBody FddPersonAccount fddPersonAccount) throws ApiException {
return fddPersonAccountService.getPersonUnionIdUrl(fddPersonAccount);
}
/**
* 邀请客服加入组织
* @param fddPersonAccount
* @return R
*/
@Operation(summary = "邀请客服加入组织", description = "邀请客服加入组织")
@PostMapping("/getAddEmployeeUrl")
public R<String> getAddEmployeeUrl(@Valid @RequestBody List<FddPersonAccount> fddPersonAccount) throws ApiException {
return fddPersonAccountService.getAddEmployeeUrl(fddPersonAccount);
}
/**
* 主动发送员工进行法大大实名
* @param id
* @return R
*/
@Operation(summary = "主动发送员工进行法大大实名", description = "主动发送员工进行法大大实名")
@PostMapping("/sendAuthMessage")
public R<String> sendAuthMessage(@RequestParam String id) throws ApiException {
return fddPersonAccountService.sendAuthMessage(id);
}
/**
* 移除员工
* @param id
* @return R
*/
@Operation(summary = "移除员工", description = "移除员工")
@PostMapping("/delEmployee")
public R<String> delEmployee(@RequestParam(name = "id") String id,@RequestParam(name = "companyUnionIds") List<String> companyUnionIds, @RequestParam(name = "unionIds") String unionIds) throws ApiException {
return fddPersonAccountService.delEmployee(id,companyUnionIds,unionIds);
}
/**
* 获取员工加入的组织
* @param id
* @return R
*/
@Operation(summary = "获取员工加入的组织", description = "获取员工加入的组织")
@PostMapping("/getAllDepart")
public R<List<FddCompanyInfo>> getAllDepart(@RequestParam String id){
return fddPersonAccountService.getAllDepart(id);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddReqLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddReqLogService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
/**
* 法大大日志记录表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/fddreqlog" )
@Tag(name = "法大大日志记录表管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class FddReqLogController {
private final FddReqLogService fddReqLogService;
/**
* 分页查询
* @param page 分页对象
* @param fddReqLog 法大大日志记录表
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R getFddReqLogPage(Page page, FddReqLog fddReqLog) {
return R.ok(fddReqLogService.getFddReqLogPage(page, fddReqLog));
}
/**
* 通过id查询法大大日志记录表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_fddreqlog_get')")
@GetMapping("/{id}" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(fddReqLogService.getById(id));
}
/**
* 新增法大大日志记录表
* @param fddReqLog 法大大日志记录表
* @return R
*/
@Operation(summary = "新增法大大日志记录表", description = "新增法大大日志记录表:hasPermission('demo_fddreqlog_add')")
@SysLog("新增法大大日志记录表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_fddreqlog_add')" )
public R save(@RequestBody FddReqLog fddReqLog) {
return R.ok(fddReqLogService.save(fddReqLog));
}
/**
* 修改法大大日志记录表
* @param fddReqLog 法大大日志记录表
* @return R
*/
@Operation(summary = "修改法大大日志记录表", description = "修改法大大日志记录表:hasPermission('demo_fddreqlog_edit')")
@SysLog("修改法大大日志记录表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_fddreqlog_edit')" )
public R updateById(@RequestBody FddReqLog fddReqLog) {
return R.ok(fddReqLogService.updateById(fddReqLog));
}
/**
* 通过id删除法大大日志记录表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除法大大日志记录表", description = "通过id删除法大大日志记录表:hasPermission('demo_fddreqlog_del')")
@SysLog("通过id删除法大大日志记录表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_fddreqlog_del')" )
public R removeById(@PathVariable String id) {
return R.ok(fddReqLogService.removeById(id));
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddSealInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 法大大印章
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/fddsealinfo" )
@Tag(name = "法大大印章管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class FddSealInfoController {
private final FddSealInfoService fddSealInfoService;
/**
* 分页查询
* @param page 分页对象
* @param fddSealInfo 法大大印章
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R getFddSealInfoPage(Page page, FddSealInfo fddSealInfo) {
return R.ok(fddSealInfoService.getFddSealInfoPage(page, fddSealInfo));
}
/**
* 通过id查询法大大印章
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(fddSealInfoService.getById(id));
}
/**
* 新增法大大印章
* @param fddSealInfo 法大大印章
* @return R
*/
@Operation(summary = "新增法大大印章", description = "新增法大大印章:hasPermission('demo_fddsealinfo_add')")
@SysLog("新增法大大印章" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_fddsealinfo_add')" )
public R save(@RequestBody FddSealInfo fddSealInfo) {
return R.ok(fddSealInfoService.save(fddSealInfo));
}
/**
* 修改法大大印章
* @param fddSealInfo 法大大印章
* @return R
*/
@Operation(summary = "修改法大大印章", description = "修改法大大印章:hasPermission('demo_fddsealinfo_edit')")
@SysLog("修改法大大印章" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_fddsealinfo_edit')" )
public R updateById(@RequestBody FddSealInfo fddSealInfo) {
return R.ok(fddSealInfoService.updateById(fddSealInfo));
}
/**
* 通过id删除法大大印章
* @param id id
* @return R
*/
@Operation(summary = "通过id删除法大大印章", description = "通过id删除法大大印章:hasPermission('demo_fddsealinfo_del')")
@SysLog("通过id删除法大大印章" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_fddsealinfo_del')" )
public R removeById(@PathVariable String id) {
return R.ok(fddSealInfoService.removeById(id));
}
/**
* 印章授权
* @return R
*/
@Operation(summary = "印章授权", description = "印章授权")
@SysLog("印章授权")
@PostMapping("/sealAuth")
public R<String> sealAuth(@RequestParam List<String> id, @RequestParam String fddPersonAccountId) throws ApiException {
return fddSealInfoService.sealAuth(id, fddPersonAccountId);
}
/**
* 印章取消授权
* @return R
*/
@Operation(summary = "印章取消授权", description = "印章取消授权")
@SysLog("印章取消授权")
@PostMapping("/cancelSealAuth")
public R<String> cancelSealAuth(@RequestParam List<String> id,@RequestParam String fddPersonAccountId) throws ApiException {
return fddSealInfoService.cancelSealAuth(id, fddPersonAccountId);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealPersonAuth;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddSealPersonAuthService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 法大大印章授权表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/fddsealpersonauth" )
@Tag(name = "法大大印章授权表管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class FddSealPersonAuthController {
private final FddSealPersonAuthService fddSealPersonAuthService;
/**
* 分页查询
* @param page 分页对象
* @param fddSealPersonAuth 法大大印章授权表
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R getFddSealPersonAuthPage(Page page, FddSealPersonAuth fddSealPersonAuth) {
return R.ok(fddSealPersonAuthService.getFddSealPersonAuthPage(page, fddSealPersonAuth));
}
/**
* 通过id查询法大大印章授权表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(fddSealPersonAuthService.getById(id));
}
/**
* 新增法大大印章授权表
* @param fddSealPersonAuth 法大大印章授权表
* @return R
*/
@Operation(summary = "新增法大大印章授权表", description = "新增法大大印章授权表:hasPermission('demo_fddsealpersonauth_add')")
@SysLog("新增法大大印章授权表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_fddsealpersonauth_add')" )
public R save(@RequestBody FddSealPersonAuth fddSealPersonAuth) {
return R.ok(fddSealPersonAuthService.save(fddSealPersonAuth));
}
/**
* 修改法大大印章授权表
* @param fddSealPersonAuth 法大大印章授权表
* @return R
*/
@Operation(summary = "修改法大大印章授权表", description = "修改法大大印章授权表:hasPermission('demo_fddsealpersonauth_edit')")
@SysLog("修改法大大印章授权表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_fddsealpersonauth_edit')" )
public R updateById(@RequestBody FddSealPersonAuth fddSealPersonAuth) {
return R.ok(fddSealPersonAuthService.updateById(fddSealPersonAuth));
}
/**
* 通过id删除法大大印章授权表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除法大大印章授权表", description = "通过id删除法大大印章授权表:hasPermission('demo_fddsealpersonauth_del')")
@SysLog("通过id删除法大大印章授权表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_fddsealpersonauth_del')" )
public R removeById(@PathVariable String id) {
return R.ok(fddSealPersonAuthService.removeById(id));
}
/**
* 通过员工id查询所拥有的印章权限
* @param personAccountId
* @return R
*/
@Operation(summary = "通过员工id查询所拥有的印章权限", description = "通过员工id查询所拥有的印章权限")
@SysLog("通过员工id查询所拥有的印章的id")
@PostMapping("/getSealId")
public R<List<FddSealInfo>> getSealId(@RequestParam String personAccountId){
return fddSealPersonAuthService.getSealId(personAccountId);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.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.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 法大大企业接入方信息
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Mapper
public interface FddCompanyInfoMapper extends BaseMapper<FddCompanyInfo> {
/**
* 法大大企业接入方信息简单分页查询
* @param fddCompanyInfo 法大大企业接入方信息
* @return
*/
IPage<FddCompanyInfo> getFddCompanyInfoPage(Page<FddCompanyInfo> page, @Param("fddCompanyInfo") FddCompanyInfo fddCompanyInfo);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.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.yifu.cloud.plus.v1.yifu.archives.entity.FddPersonAccount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 法大大个人实名认证表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Mapper
public interface FddPersonAccountMapper extends BaseMapper<FddPersonAccount> {
/**
* 法大大个人实名认证表简单分页查询
* @param fddPersonAccount 法大大个人实名认证表
* @return
*/
IPage<FddPersonAccount> getFddPersonAccountPage(Page<FddPersonAccount> page, @Param("fddPersonAccount") FddPersonAccount fddPersonAccount);
/**
* 移除员工
* @param id
* @param unionIds
* @return
*/
int delEmployee(@Param("id")String id,@Param("unionIds") String unionIds);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.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.yifu.cloud.plus.v1.yifu.archives.entity.FddReqLog;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealPersonAuth;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 法大大日志记录表
*
* @author fxj
* @date 2022-06-28 16:24:12
*/
@Mapper
public interface FddReqLogMapper extends BaseMapper<FddReqLog> {
/**
* 法大大日志记录表简单分页查询
*
* @param fddReqLog 法大大日志记录表
* @return
*/
IPage<FddReqLog> getFddReqLogPage(Page<FddReqLog> page, @Param("fddReqLog") FddReqLog fddReqLog);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.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.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 法大大印章
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Mapper
public interface FddSealInfoMapper extends BaseMapper<FddSealInfo> {
/**
* 法大大印章简单分页查询
* @param fddSealInfo 法大大印章
* @return
*/
IPage<FddSealInfo> getFddSealInfoPage(Page<FddSealInfo> page, @Param("fddSealInfo") FddSealInfo fddSealInfo);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.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.yifu.cloud.plus.v1.yifu.archives.entity.FddSealPersonAuth;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 法大大印章授权表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Mapper
public interface FddSealPersonAuthMapper extends BaseMapper<FddSealPersonAuth> {
/**
* 法大大印章授权表简单分页查询
* @param fddSealPersonAuth 法大大印章授权表
* @return
*/
IPage<FddSealPersonAuth> getFddSealPersonAuthPage(Page<FddSealPersonAuth> page, @Param("fddSealPersonAuth") FddSealPersonAuth fddSealPersonAuth);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo;
/**
* 法大大企业接入方信息
*
* @author fxj
* @date 2022-06-28 16:24:12
*/
public interface FddCompanyInfoService extends IService<FddCompanyInfo> {
/**
* 法大大企业接入方信息简单分页查询
* @param fddCompanyInfo 法大大企业接入方信息
* @return
*/
IPage<FddCompanyInfo> getFddCompanyInfoPage(Page<FddCompanyInfo> page, FddCompanyInfo fddCompanyInfo);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddPersonAccount;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/**
* 法大大个人实名认证表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
public interface FddPersonAccountService extends IService<FddPersonAccount> {
/**
* 法大大个人实名认证表简单分页查询
* @param fddPersonAccount 法大大个人实名认证表
* @return IPage
*/
IPage<FddPersonAccount> getFddPersonAccountPage(Page<FddPersonAccount> page, FddPersonAccount fddPersonAccount);
/**
* 邀请客服进行法大大实名
* @param fddPersonAccount 邀请客服进行法大大实名
* @return R
*/
R<String> getPersonUnionIdUrl(FddPersonAccount fddPersonAccount) throws ApiException;
/**
* 邀请客服加入组织
* @param fddPersonAccount 邀请客服加入组织
* @return R
*/
R<String> getAddEmployeeUrl(List<FddPersonAccount> fddPersonAccount) throws ApiException;
/**
* 移除员工
* @param companyUnionIds
* @param unionIds
* @return R
*/
R<String> delEmployee(String id,List<String> companyUnionIds,String unionIds) throws ApiException;
/**
* 主动发送员工进行法大大实名
* @param id
* @return R
*/
R<String> sendAuthMessage(String id) throws ApiException;
/**
* 主动发送员工进行法大大实名
* @param id
* @return R
*/
R<List<FddCompanyInfo>> getAllDepart(String id);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fadada.api.bean.req.BaseReq;
import com.fadada.api.bean.rsp.BaseRsp;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddReqLog;
import org.apache.ibatis.annotations.Param;
/**
* 法大大日志记录表
*
* @author fxj
* @date 2022-06-28 16:24:12
*/
public interface FddReqLogService extends IService<FddReqLog> {
/**
* 法大大日志记录表简单分页查询
* @param fddReqLog 法大大日志记录表
* @return
*/
IPage<FddReqLog> getFddReqLogPage(Page<FddReqLog> page, @Param("fddReqLog") FddReqLog fddReqLog);
/**
* 保存记录
* @param className
* @param methodName
* @param req
* @param rsp
* @return
*/
void saveLog(String className, String methodName, BaseReq req, BaseRsp rsp);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/**
* 法大大印章
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
public interface FddSealInfoService extends IService<FddSealInfo> {
/**
* 法大大印章简单分页查询
* @param fddSealInfo 法大大印章
* @return
*/
IPage<FddSealInfo> getFddSealInfoPage(Page<FddSealInfo> page, FddSealInfo fddSealInfo);
/**
* 印章授权
* @param fddPersonAccountId 客服id
* @return
*/
R<String> sealAuth(List<String> id, String fddPersonAccountId) throws ApiException;
/**
* 印章取消授权
* @param id
* @param fddPersonAccountId
* @return
*/
R<String> cancelSealAuth(List<String> id, String fddPersonAccountId) throws ApiException;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealPersonAuth;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/**
* 法大大印章授权表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
public interface FddSealPersonAuthService extends IService<FddSealPersonAuth> {
/**
* 法大大印章授权表简单分页查询
* @param fddSealPersonAuth 法大大印章授权表
* @return
*/
IPage<FddSealPersonAuth> getFddSealPersonAuthPage(Page<FddSealPersonAuth> page, FddSealPersonAuth fddSealPersonAuth);
/**
* 通过员工id获得所拥有的印章权限
* @param personAccountId 客服id
* @return
*/
R<List<FddSealInfo>> getSealId(String personAccountId);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fadada.api.bean.req.BaseReq;
import com.fadada.api.bean.rsp.BaseRsp;
import com.fadada.api.bean.rsp.account.GetAccessObjectInfoRsp;
import com.fadada.api.client.AccountClient;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddCompanyInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddCompanyInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddReqLogService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.FddUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
/**
* 法大大企业接入方信息
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Service
@RequiredArgsConstructor
public class FddCompanyInfoServiceImpl extends ServiceImpl<FddCompanyInfoMapper, FddCompanyInfo> implements FddCompanyInfoService {
private final FddUtil fddUtil;
private final FddReqLogService reqLogService;
/**
* 法大大企业接入方信息简单分页查询
*
* @param fddCompanyInfo 法大大企业接入方信息
* @return
*/
@Override
public IPage<FddCompanyInfo> getFddCompanyInfoPage(Page<FddCompanyInfo> page, FddCompanyInfo fddCompanyInfo) {
long records = this.count();
if (records == CommonConstants.ZERO_INT) {
try {
//法大大接入方信息
BaseReq req = new BaseReq();
req.setToken(fddUtil.getToken());
//发送请求
AccountClient accountClient = new AccountClient(fddUtil.getFadadaApiClient());
BaseRsp<GetAccessObjectInfoRsp> rsp = accountClient.getAccessObjectInfo(req);
reqLogService.saveLog(Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getMethodName(),req, rsp);
GetAccessObjectInfoRsp data = rsp.getData();
//插入信息
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
FddCompanyInfo companyInfo = new FddCompanyInfo();
companyInfo.setCompanyName(data.getCompanyName());
companyInfo.setCompanyUnionId(data.getCompanyUnionId());
companyInfo.setManagerName(data.getManagerName());
companyInfo.setManagerUnionId(data.getManagerUnionId());
this.save(companyInfo);
}
} catch (ApiException e) {
e.printStackTrace();
}
}
return baseMapper.getFddCompanyInfoPage(page, fddCompanyInfo);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fadada.api.bean.req.account.GetPersonUnionIdUrlReq;
import com.fadada.api.bean.req.account.NoticeReq;
import com.fadada.api.bean.req.account.PersonReq;
import com.fadada.api.bean.req.organization.DelSubEmployeeReq;
import com.fadada.api.bean.req.organization.GetAddEmployeeUrlReq;
import com.fadada.api.bean.rsp.BaseRsp;
import com.fadada.api.bean.rsp.account.GetUnionIdUrlRsp;
import com.fadada.api.bean.rsp.organization.GetAddEmployeeUrlRsp;
import com.fadada.api.client.AccountClient;
import com.fadada.api.client.OrgClient;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.config.FddConfigProperties;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddPersonAccount;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealPersonAuth;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddPersonAccountMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddCompanyInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddPersonAccountService;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddReqLogService;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddSealPersonAuthService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.FddUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
* 法大大个人实名认证表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Service
@RequiredArgsConstructor
@EnableConfigurationProperties(FddConfigProperties.class)
public class FddPersonAccountServiceImpl extends ServiceImpl<FddPersonAccountMapper, FddPersonAccount> implements FddPersonAccountService {
private final FddCompanyInfoService fddCompanyInfoService;
private final FddConfigProperties fddConfigProperties;
private final FddUtil fddUtil;
private final FddSealPersonAuthService fddSealPersonAuthService;
private final FddReqLogService reqLogService;
@Override
public IPage<FddPersonAccount> getFddPersonAccountPage(Page<FddPersonAccount> page, FddPersonAccount fddPersonAccount) {
return baseMapper.getFddPersonAccountPage(page, fddPersonAccount);
}
@Override
public R<String> getPersonUnionIdUrl(FddPersonAccount fddPersonAccount) throws ApiException {
long mobileCount = this.count(Wrappers.<FddPersonAccount>query().lambda().eq(FddPersonAccount::getMoblie, fddPersonAccount.getMoblie())
.eq(FddPersonAccount::getSystemFlag, CommonConstants.ZERO_STRING));
if(mobileCount > CommonConstants.ZERO_INT){
return R.failed("手机号已存在");
}
long idCardCount = this.count(Wrappers.<FddPersonAccount>query().lambda().eq(FddPersonAccount::getIdCard, fddPersonAccount.getIdCard())
.eq(FddPersonAccount::getSystemFlag, CommonConstants.ZERO_STRING));
if(idCardCount > CommonConstants.ZERO_INT){
return R.failed("身份证号已存在");
}
FddPersonAccount entity = new FddPersonAccount();
entity.setIdCard(fddPersonAccount.getIdCard());
entity.setName(fddPersonAccount.getName());
entity.setMoblie(fddPersonAccount.getMoblie());
entity.setSystemFlag(CommonConstants.ZERO_STRING);
this.save(entity);
//发送请求
GetPersonUnionIdUrlReq req = new GetPersonUnionIdUrlReq();
req.setToken(fddUtil.getToken());
req.setClientId(entity.getId());
req.setAuthScheme(CommonConstants.ZERO_INT);
NoticeReq notice = new NoticeReq();
//短信发送实名认证链接
notice.setNotifyWay(CommonConstants.ONE_INT);
notice.setNotifyAddress(fddPersonAccount.getMoblie());
req.setNotice(notice);
//发送人信息
PersonReq person = new PersonReq();
person.setIdentNo(fddPersonAccount.getIdCard());
person.setMobile(fddPersonAccount.getMoblie());
person.setName(fddPersonAccount.getName());
req.setPerson(person);
//实名授权
req.setAuthScope(CommonConstants.ONE_STRING);
req.setReRealName(CommonConstants.ONE_INT);
//是否允许用户在认证页面修改接口所传的个人认证信息
//跳转链接
req.setRedirectUrl(fddConfigProperties.getHrmsUrl() + fddConfigProperties.getPersonRedirectUrl());
//发送请求
AccountClient accountClient = new AccountClient(fddUtil.getFadadaApiClient());
BaseRsp<GetUnionIdUrlRsp> rsp = accountClient.getPersonUnionIdUrl(req);
reqLogService.saveLog(Thread.currentThread().getStackTrace()[1].getClassName(), Thread.currentThread().getStackTrace()[1].getMethodName(), req, rsp);
//校验参数
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
entity.setRealMessageFlag(CommonConstants.ONE_STRING);
return new R<>(rsp.getData().getNextUrl());
} else {
return R.failed(rsp.getMsg());
}
}
/**
* 邀请客服加入组织
* @param fddPersonAccountList
* @author huyc
* @date 2022-06-28 18:52:16
*/
@Override
public R<String> getAddEmployeeUrl(List<FddPersonAccount> fddPersonAccountList) throws ApiException {
for (FddPersonAccount fddPersonAccount: fddPersonAccountList) {
if (StringUtils.isEmpty(fddPersonAccount.getCompanyInfoId())) {
return R.failed("组织id不能为空");
}
FddPersonAccount entity = this.getById(fddPersonAccount.getId());
if (entity == null) {
return R.failed("未获取到员工相关记录");
}
if (null != entity.getCompanyInfoId()) {
if (entity.getCompanyInfoId().contains(fddPersonAccount.getCompanyInfoId())) {
return R.failed("员工已加入公司");
}
}
if (StringUtils.isEmpty(entity.getUnionid())) {
return R.failed("法大大用户唯一标识为空");
}
//组织
FddCompanyInfo fddCompanyInfo = fddCompanyInfoService.getById(fddPersonAccount.getCompanyInfoId());
if (fddCompanyInfo == null) {
return R.failed("未获取到组织相关记录");
}
//发送请求
GetAddEmployeeUrlReq req = new GetAddEmployeeUrlReq();
req.setToken(fddUtil.getToken());
req.setCompany(fddCompanyInfo.getCompanyUnionId());
req.setRedirectUrl(fddConfigProperties.getHrmsUrl() + fddConfigProperties.getAddEmployeeRedirectUrl());
GetAddEmployeeUrlReq.EmployeeInfo employeeInfo = new GetAddEmployeeUrlReq.EmployeeInfo();
employeeInfo.setUnionId(entity.getUnionid());
req.setEmployeeInfo(employeeInfo);
//发送请求
OrgClient orgClient = new OrgClient(fddUtil.getFadadaApiClient());
BaseRsp<GetAddEmployeeUrlRsp> rsp = orgClient.getAddEmployeeUrl(req);
reqLogService.saveLog(Thread.currentThread().getStackTrace()[1].getClassName(), Thread.currentThread().getStackTrace()[1].getMethodName(), req, rsp);
//校验参数
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
entity.setCompanyInfoId(fddPersonAccount.getCompanyInfoId());
return new R<>(rsp.getData().getAddGroupEmployeeUrl());
} else {
return R.failed(rsp.getMsg());
}
}
return null;
}
@Override
public R<String> delEmployee(String id, List<String> companyUnionIds, String unionIds) throws ApiException {
FddPersonAccount entity = this.getById(id);
if (entity == null) {
return R.failed("未获取到员工相关记录");
}
if (StringUtils.isEmpty(entity.getCompanyInfoId())) {
return R.failed("员工未加入公司");
}
//判断是否印章授权了
long fddSealPersonCount = fddSealPersonAuthService.count(Wrappers.<FddSealPersonAuth>query().lambda().eq(FddSealPersonAuth::getFddPersonAccountId, entity.getId()));
if (fddSealPersonCount > CommonConstants.ZERO_INT) {
return R.failed("请先取消客服印章授权");
}
for (String unionId : companyUnionIds) {
//组织
FddCompanyInfo fddCompanyInfo = fddCompanyInfoService.getById(unionId);
if (fddCompanyInfo == null) {
return R.failed("未获取到组织相关记录");
}
//发送请求
DelSubEmployeeReq req = new DelSubEmployeeReq();
req.setToken(fddUtil.getToken());
req.setCompany(fddCompanyInfo.getCompanyUnionId());
DelSubEmployeeReq.EmployeeInfo employeeInfo = new DelSubEmployeeReq.EmployeeInfo();
employeeInfo.setUnionId(entity.getUnionid());
req.setEmployeeInfo(employeeInfo);
//发送请求
OrgClient orgClient = new OrgClient(fddUtil.getFadadaApiClient());
BaseRsp rsp = orgClient.delSubEmployee(req);
reqLogService.saveLog(Thread.currentThread().getStackTrace()[1].getClassName(), Thread.currentThread().getStackTrace()[1].getMethodName(), req, rsp);
//校验参数
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
baseMapper.delEmployee(entity.getId(),unionIds);
} else {
if (!Common.isEmpty(unionIds)) {
baseMapper.delEmployee(entity.getId(), unionIds.concat(",").concat(unionId));
}else {
baseMapper.delEmployee(entity.getId(), unionId);
}
return R.failed(rsp.getMsg());
}
}
return R.ok();
}
@Override
public R<String> sendAuthMessage(String id) throws ApiException {
FddPersonAccount entity = this.getById(id);
if (entity == null) {
return R.failed("为获取到员工记录");
}
//发送请求
GetPersonUnionIdUrlReq req = new GetPersonUnionIdUrlReq();
req.setToken(fddUtil.getToken());
req.setClientId(entity.getId());
req.setAuthScheme(CommonConstants.ZERO_INT);
NoticeReq notice = new NoticeReq();
//短信发送实名认证链接
notice.setNotifyWay(CommonConstants.ONE_INT);
notice.setNotifyAddress(entity.getMoblie());
req.setNotice(notice);
//发送人信息
PersonReq person = new PersonReq();
person.setIdentNo(entity.getIdCard());
person.setMobile(entity.getMoblie());
person.setName(entity.getName());
req.setPerson(person);
//实名授权
req.setAuthScope(CommonConstants.ONE_STRING);
//是否允许用户在认证页面修改接口所传的个人认证信息
req.setReRealName(CommonConstants.ONE_INT);
//跳转链接
req.setRedirectUrl(fddConfigProperties.getHrmsUrl() + fddConfigProperties.getPersonRedirectUrl());
//发送请求
AccountClient accountClient = new AccountClient(fddUtil.getFadadaApiClient());
BaseRsp<GetUnionIdUrlRsp> rsp = accountClient.getPersonUnionIdUrl(req);
reqLogService.saveLog(Thread.currentThread().getStackTrace()[1].getClassName(), Thread.currentThread().getStackTrace()[1].getMethodName(), req, rsp);
//校验参数
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
entity.setRealMessageFlag(CommonConstants.ONE_STRING);
return new R<>(rsp.getData().getNextUrl());
} else {
return R.failed(rsp.getMsg());
}
}
@Override
public R<List<FddCompanyInfo>> getAllDepart(String id) {
FddPersonAccount fddPersonAccount = this.getById(id);
List<String> companyList = Arrays.asList(fddPersonAccount.getCompanyInfoId().split(","));
List<FddCompanyInfo> fddCompanyInfoList = fddCompanyInfoService.list(Wrappers.<FddCompanyInfo>query().lambda().in(FddCompanyInfo::getId,companyList));
return new R<>(fddCompanyInfoList);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fadada.api.bean.req.BaseReq;
import com.fadada.api.bean.rsp.BaseRsp;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddReqLog;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddReqLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddReqLogService;
import org.springframework.stereotype.Service;
/**
* 法大大日志记录表
*
* @author fxj
* @date 2022-06-28 16:24:12
*/
@Service
public class FddReqLogServiceImpl extends ServiceImpl<FddReqLogMapper, FddReqLog> implements FddReqLogService {
/**
* 法大大日志记录表简单分页查询
*
* @param fddReqLog 法大大日志记录表
* @return
*/
@Override
public IPage<FddReqLog> getFddReqLogPage(Page<FddReqLog> page, FddReqLog fddReqLog) {
return baseMapper.getFddReqLogPage(page, fddReqLog);
}
@Override
public void saveLog(String className,String methodName,BaseReq req, BaseRsp rsp) {
FddReqLog fddReqLog = new FddReqLog();
fddReqLog.setReqData(JSON.toJSONString(req));
fddReqLog.setResData(JSON.toJSONString(rsp));
fddReqLog.setMethodName(methodName);
fddReqLog.setClassName(className);
this.save(fddReqLog);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fadada.api.bean.req.seal.CancelSealAuthReq;
import com.fadada.api.bean.req.seal.CompanySealListReq;
import com.fadada.api.bean.req.seal.OwnerInfo;
import com.fadada.api.bean.req.seal.SealAuthReq;
import com.fadada.api.bean.rsp.BaseRsp;
import com.fadada.api.bean.rsp.seal.CompanySealListRsp;
import com.fadada.api.bean.rsp.seal.SealRes;
import com.fadada.api.client.SealClient;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddPersonAccount;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealPersonAuth;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddSealInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.utils.FddUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 法大大印章
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Service
@RequiredArgsConstructor
public class FddSealInfoServiceImpl extends ServiceImpl<FddSealInfoMapper, FddSealInfo> implements FddSealInfoService {
private final FddUtil fddUtil;
private final FddSealPersonAuthService fddSealPersonAuthService;
private final FddCompanyInfoService fddCompanyInfoService;
private final FddPersonAccountService fddPersonAccountService;
private final FddReqLogService reqLogService;
@Override
public IPage<FddSealInfo> getFddSealInfoPage(Page<FddSealInfo> page, FddSealInfo fddSealInfo) {
long count = this.count(Wrappers.<FddSealInfo>query().lambda().eq(FddSealInfo::getStatus,CommonConstants.TWO_STRING));
if (count == CommonConstants.ZERO_INT) {
//初始化印章
//发送请求
CompanySealListReq req = new CompanySealListReq();
try {
//获取法大大印章列表
BaseRsp<CompanySealListRsp> rsp = getCompanySealListRspBaseRsp(req);
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
List<SealRes> seals = rsp.getData().getSeals();
for (SealRes seal : seals) {
FddSealInfo sealInfo = new FddSealInfo();
sealInfo.setSealName(seal.getSealName());
sealInfo.setDeleteFlag(CommonConstants.ZERO_INT);
sealInfo.setSealId(String.valueOf(seal.getSealId()));
sealInfo.setStatus(String.valueOf(seal.getStatus()));
sealInfo.setSysFlag(String.valueOf(seal.getSysFlag()));
this.save(sealInfo);
}
}
} catch (ApiException e) {
e.printStackTrace();
}
} else {
List<FddSealInfo> records = this.list(Wrappers.<FddSealInfo>query().lambda().eq(FddSealInfo::getStatus,CommonConstants.TWO_STRING));
for (FddSealInfo record : records) {
//判断列表中法大大的sealId是否都存在。如果不存在,则获取记录,并更新印章值
if (StringUtils.isEmpty(record.getSealId()) && StringUtils.isEmpty(record.getStatus())) {
//发送请求
CompanySealListReq req = new CompanySealListReq();
try {
//获取法大大印章列表
BaseRsp<CompanySealListRsp> rsp = getCompanySealListRspBaseRsp(req);
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
List<SealRes> seals = rsp.getData().getSeals();
for (SealRes seal : seals) {
if (StringUtils.equals(seal.getSealName(), record.getSealName())) {
record.setSealId(String.valueOf(seal.getSealId()));
record.setStatus(String.valueOf(seal.getStatus()));
record.setSysFlag(String.valueOf(seal.getSysFlag()));
this.updateById(record);
}
}
}
} catch (ApiException e) {
e.printStackTrace();
}
}
}
}
return baseMapper.getFddSealInfoPage(page, fddSealInfo);
}
@Override
public R<String> sealAuth(List<String> id, String fddPersonAccountId) throws ApiException {
for (String sId : id) {
FddSealInfo entity = this.getById(sId);
if (entity == null) {
return R.failed("未获取到印章信息");
}
//获取员工信息
FddPersonAccount fddPersonAccount = fddPersonAccountService.getById(fddPersonAccountId);
if (fddPersonAccount == null) {
return R.failed("未获取到员工信息");
}
FddSealPersonAuth fddSealPersonAuth = fddSealPersonAuthService.getOne(Wrappers.<FddSealPersonAuth>query().lambda().eq(FddSealPersonAuth::getFddPersonAccountId, fddPersonAccountId)
.eq(FddSealPersonAuth::getSealId, entity.getSealId()));
if (fddSealPersonAuth != null) {
return R.failed("当前印章已经授权该员工");
}
SealAuthReq req = new SealAuthReq();
req.setToken(fddUtil.getToken());
SealAuthReq.EmployeeInfo employeeInfo = new SealAuthReq.EmployeeInfo();
employeeInfo.setUnionId(fddPersonAccount.getUnionid());
req.setEmployeeInfo(employeeInfo);
OwnerInfo owner = new OwnerInfo();
FddCompanyInfo fddCompanyInfo1 = fddCompanyInfoService.getOne(Wrappers.<FddCompanyInfo>query().lambda().eq(FddCompanyInfo::getId, entity.getSealCompanyId()));
owner.setUnionId(fddCompanyInfo1.getCompanyUnionId());
req.setOwner(owner);
SealAuthReq.SealInfo seal = new SealAuthReq.SealInfo();
seal.setSealId(entity.getSealId());
req.setSealInfo(seal);
//发送请求
SealClient sealClient = new SealClient(fddUtil.getFadadaApiClient());
BaseRsp rsp = sealClient.sealAuth(req);
reqLogService.saveLog(this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName(), req, rsp);
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
//生成授权数据
FddSealPersonAuth auth = new FddSealPersonAuth();
auth.setFddPersonAccountId(fddPersonAccount.getId());
auth.setSealId(entity.getSealId());
auth.setStatus(CommonConstants.ONE_STRING);
fddSealPersonAuthService.save(auth);
}else {
throw new CheckedException(rsp.getMsg());
}
}
return R.ok();
}
@Override
public R<String> cancelSealAuth(List<String> id, String fddPersonAccountId) throws ApiException {
for (String sId : id) {
FddSealInfo entity = this.getById(sId);
if (entity == null) {
return R.failed("未获取到印章信息");
}
FddSealPersonAuth fddSealPersonAuth = fddSealPersonAuthService.getOne(Wrappers.<FddSealPersonAuth>query().lambda().eq(FddSealPersonAuth::getFddPersonAccountId, fddPersonAccountId)
.eq(FddSealPersonAuth::getSealId, entity.getSealId()));
if (fddSealPersonAuth == null) {
return R.failed("未获取到印章对应的授权员工信息");
}
//获取员工信息
FddPersonAccount fddPersonAccount = fddPersonAccountService.getById(fddPersonAccountId);
if (fddPersonAccount == null) {
return R.failed("未获取到员工信息");
}
CancelSealAuthReq req = new CancelSealAuthReq();
req.setToken(fddUtil.getToken());
CancelSealAuthReq.EmployeeInfo employeeInfo = new CancelSealAuthReq.EmployeeInfo();
employeeInfo.setUnionId(fddPersonAccount.getUnionid());
req.setEmployeeInfo(employeeInfo);
CancelSealAuthReq.SealInfo seal = new CancelSealAuthReq.SealInfo();
seal.setSealId(entity.getSealId());
req.setSealInfo(seal);
//发送请求
SealClient sealClient = new SealClient(fddUtil.getFadadaApiClient());
BaseRsp rsp = sealClient.cancelSealAuth(req);
reqLogService.saveLog(this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName(), req, rsp);
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
//生成授权数据
fddSealPersonAuthService.removeById(fddSealPersonAuth);
} else {
return R.failed("取消印章授权失败");
}
}
return R.ok();
}
/**
* @param req
* @Author: huyc
* @Date: 2022/6/29
* @Description: 获取法大大印章列表
* @return: com.fadada.api.bean.rsp.BaseRsp<com.fadada.api.bean.rsp.seal.CompanySealListRsp>
**/
private BaseRsp<CompanySealListRsp> getCompanySealListRspBaseRsp(CompanySealListReq req) throws ApiException {
req.setToken(fddUtil.getToken());
req.setSealInfo(CommonConstants.ONE_INT);
SealClient sealClient = new SealClient(fddUtil.getFadadaApiClient());
BaseRsp<CompanySealListRsp> rsp = sealClient.companySealList(req);
reqLogService.saveLog(this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName(), req, rsp);
return rsp;
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealPersonAuth;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddSealInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddSealPersonAuthMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddSealInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddSealPersonAuthService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 法大大印章授权表
*
* @author huyc
* @date 2022-06-28 16:24:12
*/
@Service
@RequiredArgsConstructor
public class FddSealPersonAuthServiceImpl extends ServiceImpl<FddSealPersonAuthMapper, FddSealPersonAuth> implements FddSealPersonAuthService {
private final FddSealInfoMapper fddSealInfoMapper;
/**
* 法大大印章授权表简单分页查询
* @param fddSealPersonAuth 法大大印章授权表
* @return
*/
@Override
public IPage<FddSealPersonAuth> getFddSealPersonAuthPage(Page<FddSealPersonAuth> page, FddSealPersonAuth fddSealPersonAuth){
return baseMapper.getFddSealPersonAuthPage(page,fddSealPersonAuth);
}
@Override
public R<List<FddSealInfo>> getSealId(String personAccountId) {
List<FddSealPersonAuth> fddSealList = this.list(Wrappers.<FddSealPersonAuth>query().lambda()
.eq(FddSealPersonAuth::getFddPersonAccountId, personAccountId));
if (Common.isNotEmpty(fddSealList)) {
List<String> sealIdList = fddSealList.stream().map(FddSealPersonAuth::getSealId).collect(Collectors.toList());
List<FddSealInfo> fddSealInfoList = fddSealInfoMapper.selectList(Wrappers.<FddSealInfo>query().lambda().in(FddSealInfo::getSealId, sealIdList));
return new R<>(fddSealInfoList);
}
List<FddSealInfo> listR = new ArrayList<>();
return new R<>(listR);
}
}
......@@ -169,7 +169,8 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
*/
@Override
public R<List<TSettleDomain>> getAllDept() {
List<TSettleDomain> list = tSettleDomainService.list(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL));
List<TSettleDomain> list = tSettleDomainService.list(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getStopFlag,CommonConstants.STATUS_NORMAL));
return R.ok(list);
}
......
......@@ -112,7 +112,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
, "/tcheckidcard/inner/checkIdCardSingle", checkIdCard, TCheckIdCard.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
TCheckIdCard check = checkListR.getData();
if (check == null || Common.isEmpty(check.getId())) {
if (check == null || Common.isEmpty(check.getIsTrue())) {
return R.failed("校验服务器未返回,请联系管理员!!");
} else if (check.getIsTrue() == CommonConstants.ZERO_INT) {
return R.failed(check.getReason());
......@@ -508,13 +508,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return R.failed("该手机号已被使用!");
}
// 调用校验服务-校验手机号
R<Map<String, TCheckMobile>> checkMobileR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckmobile/inner/checkMobiles", employeeInfo.getEmpPhone(), TCheckMobile.class, SecurityConstants.FROM_IN);
R<Boolean> checkMobileR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckmobile/inner/checkOneMobile", employeeInfo.getEmpPhone(), Boolean.class, SecurityConstants.FROM_IN);
if (checkMobileR != null && checkMobileR.getData() != null) {
for (TCheckMobile checkMobile : checkMobileR.getData().values()) {
if (!CommonConstants.ONE_STRING.equals(checkMobile.getStatus())) {
return R.failed("手机号校验错误!");
}
if (Boolean.FALSE.equals(checkMobileR.getData())) {
return R.failed("手机号校验错误!");
}
}
}
......@@ -741,7 +739,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
, "/tcheckidcard/inner/checkIdCardSingle", checkIdCard, TCheckIdCard.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
TCheckIdCard check = checkListR.getData();
if (check.getIsTrue() == CommonConstants.ZERO_INT) {
if (check == null || Common.isEmpty(check.getIsTrue())) {
errorMsg.add("校验服务器未返回,请联系管理员!!");
} else if (check.getIsTrue() == CommonConstants.ZERO_INT) {
errorMsg.add(check.getReason());
}
}
......@@ -757,14 +757,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_PHONE_EXIST_ERROR, existEmp.getEmpIdcard()));
}
} else {
R<Map<String, TCheckMobile>> checkMobileR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckmobile/inner/checkMobiles", excel.getEmpPhone(), TCheckMobile.class, SecurityConstants.FROM_IN);
R<Boolean> checkMobileR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckmobile/inner/checkOneMobile", excel.getEmpPhone(), Boolean.class, SecurityConstants.FROM_IN);
if (checkMobileR != null && checkMobileR.getData() != null) {
for (TCheckMobile check : checkMobileR.getData().values()) {
if (!CommonConstants.ONE_STRING.equals(check.getStatus())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_PHONE_CHECK_ERROR, excel.getEmpIdcard()));
break;
}
if (Boolean.FALSE.equals(checkMobileR.getData())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_PHONE_CHECK_ERROR, excel.getEmpIdcard()));
}
}
}
......@@ -1129,14 +1126,11 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_PHONE_EXIST_ERROR, existEmp.getEmpIdcard()));
}
} else {
R<Map<String, TCheckMobile>> checkMobileR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckmobile/inner/checkMobiles", excel.getEmpPhone(), TCheckMobile.class, SecurityConstants.FROM_IN);
R<Boolean> checkMobileR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckmobile/inner/checkOneMobile", excel.getEmpPhone(), Boolean.class, SecurityConstants.FROM_IN);
if (checkMobileR != null && checkMobileR.getData() != null) {
for (TCheckMobile check : checkMobileR.getData().values()) {
if (!CommonConstants.ONE_STRING.equals(check.getStatus())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_PHONE_CHECK_ERROR, excel.getEmpIdcard()));
break;
}
if (Boolean.FALSE.equals(checkMobileR.getData())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_PHONE_CHECK_ERROR, excel.getEmpIdcard()));
}
}
}
......
package com.yifu.cloud.plus.v1.yifu.archives.utils;
import com.alibaba.fastjson.JSON;
import com.fadada.api.*;
import com.fadada.api.bean.rsp.BaseRsp;
import com.fadada.api.bean.rsp.oauth2.AccessTokenRsp;
import com.fadada.api.client.Oauth2Client;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.config.FddConfigProperties;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddReqLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddReqLogService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
/**
* @auther wangan
* @date 2021/1/18
* 法大大工具类
*/
@Slf4j
@Component
@EnableConfigurationProperties(FddConfigProperties.class)
public class FddUtil {
public static final String SUCCESS = "100000";
//法大大员工角色
public static final String PERSON = "person";
//法大大公司角色
public static final String COMPANY = "company";
@Autowired
private FddReqLogService reqLogService;
@Autowired
private RedisTemplate<String, String> stringRedisTemplate;
@Autowired
private FddConfigProperties config;
/**
* @param
* @Author: wangan
* @Date: 2021/1/18
* @Description: 法大大请求对象
* @return: com.fadada.api.FadadaApiClient
**/
public FadadaApiClient getFadadaApiClient() {
FadadaApiConfig fadadaApiConfig = new FadadaApiConfig();
fadadaApiConfig.setReadTimeout(config.getReadTimeout());
fadadaApiConfig.setConnectTimeout(config.getConnectTimeout());
// DefaultFadadaApiServiceImpl实现了接口FadadaApiService接口提供了json字符串转换以及http请求方法
// 如果要自定义实现json和http方法,只需要实现FadadaApiService接口方法
FadadaApiService fadadaApiService = new DefaultFadadaApiServiceImpl();
DefaultFadadaApiClient client = new DefaultFadadaApiClient(config.getAppId(), config.getAppKey(), config.getServerUrl(), fadadaApiConfig,
fadadaApiService);
return client;
}
/**
* @param
* @Author: wangan
* @Date: 2021/1/18
* @Description: 获取token
* @return: java.lang.String
**/
public String getToken() throws ApiException {
String accessTokenKey = "fdd_access_token";
ValueOperations<String, String> stringValueOperations = stringRedisTemplate.opsForValue();
String accessToken = stringValueOperations.get(accessTokenKey);
if (StringUtils.isEmpty(accessToken)) {
Oauth2Client oauth2Client = new Oauth2Client(getFadadaApiClient());
BaseRsp<AccessTokenRsp> rsp = oauth2Client.getToken();
AccessTokenRsp data = rsp.getData();
if (data == null || StringUtils.isEmpty(data.getAccessToken())) {
log.error("法大大返回:" + JSON.toJSON(data));
throw new CheckedException("获取法大大token失败");
}
accessToken = data.getAccessToken();
stringValueOperations.set(accessTokenKey, accessToken, CommonConstants.dingleDigitIntArray[2], TimeUnit.HOURS);
//记录日志
FddReqLog fddReqLog = new FddReqLog();
fddReqLog.setReqData("getToken");
fddReqLog.setResData(JSON.toJSONString(data));
fddReqLog.setMethodName(Thread.currentThread().getStackTrace()[1].getMethodName());
fddReqLog.setClassName(Thread.currentThread().getStackTrace()[1].getClassName());
reqLogService.save(fddReqLog);
}
return accessToken;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.FddCompanyInfoMapper">
<resultMap id="fddCompanyInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.FddCompanyInfo">
<id property="id" column="ID"/>
<result property="companyName" column="COMPANY_NAME"/>
<result property="managerUnionId" column="MANAGER_UNION_ID"/>
<result property="managerName" column="MANAGER_NAME"/>
<result property="companyUnionId" column="COMPANY_UNION_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.COMPANY_NAME,
a.MANAGER_UNION_ID,
a.MANAGER_NAME,
a.COMPANY_UNION_ID
</sql>
<sql id="fddCompanyInfo_where">
<if test="fddCompanyInfo != null">
<if test="fddCompanyInfo.id != null and fddCompanyInfo.id.trim() != ''">
AND a.ID = #{fddCompanyInfo.id}
</if>
<if test="fddCompanyInfo.companyName != null and fddCompanyInfo.companyName.trim() != ''">
AND a.COMPANY_NAME = #{fddCompanyInfo.companyName}
</if>
<if test="fddCompanyInfo.managerUnionId != null and fddCompanyInfo.managerUnionId.trim() != ''">
AND a.MANAGER_UNION_ID = #{fddCompanyInfo.managerUnionId}
</if>
<if test="fddCompanyInfo.managerName != null and fddCompanyInfo.managerName.trim() != ''">
AND a.MANAGER_NAME = #{fddCompanyInfo.managerName}
</if>
<if test="fddCompanyInfo.companyUnionId != null and fddCompanyInfo.companyUnionId.trim() != ''">
AND a.COMPANY_UNION_ID = #{fddCompanyInfo.companyUnionId}
</if>
</if>
</sql>
<!--fddCompanyInfo简单分页查询-->
<select id="getFddCompanyInfoPage" resultMap="fddCompanyInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM fdd_company_info a
<where>
1=1
<include refid="fddCompanyInfo_where"/>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.FddPersonAccountMapper">
<resultMap id="fddPersonAccountMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.FddPersonAccount">
<id property="id" column="ID"/>
<result property="moblie" column="MOBLIE"/>
<result property="name" column="NAME"/>
<result property="idCard" column="ID_CARD"/>
<result property="unionid" column="UNIONID"/>
<result property="authStatus" column="AUTH_STATUS"/>
<result property="systemFlag" column="SYSTEM_FLAG"/>
<result property="companyInfoId" column="COMPANY_INFO_ID"/>
<result property="realStatus" column="REAL_STATUS"/>
<result property="realMessageFlag" column="REAL_MESSAGE_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createName" column="CREATE_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.MOBLIE,
a.NAME,
a.ID_CARD,
a.UNIONID,
a.AUTH_STATUS,
a.SYSTEM_FLAG,
a.REAL_STATUS,
a.COMPANY_INFO_ID,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="fddPersonAccount_where">
<if test="fddPersonAccount != null">
<if test="fddPersonAccount.id != null and fddPersonAccount.id.trim() != ''">
AND a.ID = #{fddPersonAccount.id}
</if>
<if test="fddPersonAccount.moblie != null and fddPersonAccount.moblie.trim() != ''">
AND a.MOBLIE = #{fddPersonAccount.moblie}
</if>
<if test="fddPersonAccount.name != null and fddPersonAccount.name.trim() != ''">
AND a.NAME = #{fddPersonAccount.name}
</if>
<if test="fddPersonAccount.idCard != null and fddPersonAccount.idCard.trim() != ''">
AND a.ID_CARD = #{fddPersonAccount.idCard}
</if>
<if test="fddPersonAccount.unionid != null and fddPersonAccount.unionid.trim() != ''">
AND a.UNIONID = #{fddPersonAccount.unionid}
</if>
<if test="fddPersonAccount.authStatus != null and fddPersonAccount.authStatus.trim() != ''">
AND a.AUTH_STATUS = #{fddPersonAccount.authStatus}
</if>
<if test="fddPersonAccount.systemFlag != null and fddPersonAccount.systemFlag.trim() != ''">
AND a.SYSTEM_FLAG = #{fddPersonAccount.systemFlag}
</if>
<if test="fddPersonAccount.realStatus != null and fddPersonAccount.realStatus.trim() != ''">
AND a.REAL_STATUS = #{fddPersonAccount.realStatus}
</if>
<if test="fddPersonAccount.companyInfoId != null and fddPersonAccount.companyInfoId.trim() != ''">
AND a.COMPANY_INFO_ID = #{fddPersonAccount.companyInfoId}
</if>
<if test="fddPersonAccount.createBy != null and fddPersonAccount.createBy.trim() != ''">
AND a.CREATE_BY = #{fddPersonAccount.createBy}
</if>
<if test="fddPersonAccount.createName != null and fddPersonAccount.createName.trim() != ''">
AND a.CREATE_NAME = #{fddPersonAccount.createName}
</if>
<if test="fddPersonAccount.createTime != null">
AND a.CREATE_TIME = #{fddPersonAccount.createTime}
</if>
<if test="fddPersonAccount.updateBy != null and fddPersonAccount.updateBy.trim() != ''">
AND a.UPDATE_BY = #{fddPersonAccount.updateBy}
</if>
<if test="fddPersonAccount.updateTime != null">
AND a.UPDATE_TIME = #{fddPersonAccount.updateTime}
</if>
</if>
</sql>
<update id="delEmployee">
update fdd_person_account set COMPANY_INFO_ID=#{unionIds} where id=#{id}
</update>
<!--fddPersonAccount简单分页查询-->
<select id="getFddPersonAccountPage" resultMap="fddPersonAccountMap">
SELECT
<include refid="Base_Column_List"/>,GROUP_CONCAT(distinct c.COMPANY_NAME) as COMPANY_NAME,GROUP_CONCAT(distinct l.SEAL_NAME) as SEAL_NAME,GROUP_CONCAT(distinct l.id) as SEAL_ID
FROM fdd_person_account a
left join fdd_company_info c on FIND_IN_SET(c.ID,a.COMPANY_INFO_ID)
left join fdd_seal_person_auth s on s.FDD_PERSON_ACCOUNT_ID=a.id
left join fdd_seal_info l on l.SEAL_ID=s.SEAL_ID
<where>
1=1
<include refid="fddPersonAccount_where"/>
</where>
GROUP BY a.NAME
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.FddReqLogMapper">
<resultMap id="fddReqLogMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.FddReqLog">
<id property="id" column="ID"/>
<result property="reqData" column="REQ_DATA"/>
<result property="resData" column="RES_DATA"/>
<result property="methodName" column="METHOD_NAME"/>
<result property="className" column="CLASS_NAME"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createName" column="CREATE_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.REQ_DATA,
a.RES_DATA,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="fddReqLog_where">
<if test="fddReqLog != null">
<if test="fddReqLog.id != null and fddReqLog.id.trim() != ''">
AND a.ID = #{fddReqLog.id}
</if>
<if test="fddReqLog.reqDate != null and fddReqLog.reqDate.trim() != ''">
AND a.REQ_DATE = #{fddReqLog.reqDate}
</if>
<if test="fddReqLog.resDate != null and fddReqLog.resDate.trim() != ''">
AND a.RES_DATE = #{fddReqLog.resDate}
</if>
<if test="fddReqLog.createBy != null and fddReqLog.createBy.trim() != ''">
AND a.CREATE_BY = #{fddReqLog.createBy}
</if>
<if test="fddReqLog.createName != null and fddReqLog.createName.trim() != ''">
AND a.CREATE_NAME = #{fddReqLog.createName}
</if>
<if test="fddReqLog.createTime != null">
AND a.CREATE_TIME = #{fddReqLog.createTime}
</if>
<if test="fddReqLog.updateBy != null and fddReqLog.updateBy.trim() != ''">
AND a.UPDATE_BY = #{fddReqLog.updateBy}
</if>
<if test="fddReqLog.updateTime != null">
AND a.UPDATE_TIME = #{fddReqLog.updateTime}
</if>
</if>
</sql>
<!--fddReqLog简单分页查询-->
<select id="getFddReqLogPage" resultMap="fddReqLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM fdd_req_log a
<where>
1=1
<include refid="fddReqLog_where"/>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.FddSealInfoMapper">
<resultMap id="fddSealInfoMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo">
<id property="id" column="ID"/>
<result property="sealName" column="SEAL_NAME"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="sealId" column="SEAL_ID"/>
<result property="status" column="STATUS"/>
<result property="sysFlag" column="SYS_FLAG"/>
<result property="sealCompanyId" column="SEAL_COMPANY_ID"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createName" column="CREATE_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.SEAL_NAME,
a.DELETE_FLAG,
a.SEAL_ID,
a.STATUS,
a.SYS_FLAG,
a.SEAL_COMPANY_ID,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="fddSealInfo_where">
<if test="fddSealInfo != null">
<if test="fddSealInfo.id != null and fddSealInfo.id.trim() != ''">
AND a.ID = #{fddSealInfo.id}
</if>
<if test="fddSealInfo.sealName != null and fddSealInfo.sealName.trim() != ''">
AND a.SEAL_NAME = #{fddSealInfo.sealName}
</if>
<if test="fddSealInfo.deleteFlag != null">
AND a.DELETE_FLAG = #{fddSealInfo.deleteFlag}
</if>
<if test="fddSealInfo.sealId != null and fddSealInfo.sealId.trim() != ''">
AND a.SEAL_ID = #{fddSealInfo.sealId}
</if>
<if test="fddSealInfo.status != null and fddSealInfo.status.trim() != ''">
AND a.STATUS = #{fddSealInfo.status}
</if>
<if test="fddSealInfo.sysFlag != null and fddSealInfo.sysFlag.trim() != ''">
AND a.SYS_FLAG = #{fddSealInfo.sysFlag}
</if>
<if test="fddSealInfo.sealCompanyId != null">
AND a.SEAL_COMPANY_ID = #{fddSealInfo.sealCompanyId}
</if>
<if test="fddSealInfo.createBy != null and fddSealInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{fddSealInfo.createBy}
</if>
<if test="fddSealInfo.createName != null and fddSealInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{fddSealInfo.createName}
</if>
<if test="fddSealInfo.createTime != null">
AND a.CREATE_TIME = #{fddSealInfo.createTime}
</if>
<if test="fddSealInfo.updateBy != null and fddSealInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{fddSealInfo.updateBy}
</if>
<if test="fddSealInfo.updateTime != null">
AND a.UPDATE_TIME = #{fddSealInfo.updateTime}
</if>
</if>
</sql>
<!--fddSealInfo简单分页查询-->
<select id="getFddSealInfoPage" resultMap="fddSealInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM fdd_seal_info a
<where>
1=1 and DELETE_FLAG=0
<include refid="fddSealInfo_where"/>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.FddSealPersonAuthMapper">
<resultMap id="fddSealPersonAuthMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealPersonAuth">
<id property="id" column="ID"/>
<result property="sealId" column="SEAL_ID"/>
<result property="fddPersonAccountId" column="FDD_PERSON_ACCOUNT_ID"/>
<result property="status" column="STATUS"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createName" column="CREATE_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.SEAL_ID,
a.FDD_PERSON_ACCOUNT_ID,
a.STATUS,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="fddSealPersonAuth_where">
<if test="fddSealPersonAuth != null">
<if test="fddSealPersonAuth.id != null and fddSealPersonAuth.id.trim() != ''">
AND a.ID = #{fddSealPersonAuth.id}
</if>
<if test="fddSealPersonAuth.sealId != null and fddSealPersonAuth.sealId.trim() != ''">
AND a.SEAL_ID = #{fddSealPersonAuth.sealId}
</if>
<if test="fddSealPersonAuth.fddPersonAccountId != null and fddSealPersonAuth.fddPersonAccountId.trim() != ''">
AND a.FDD_PERSON_ACCOUNT_ID = #{fddSealPersonAuth.fddPersonAccountId}
</if>
<if test="fddSealPersonAuth.status != null and fddSealPersonAuth.status.trim() != ''">
AND a.STATUS = #{fddSealPersonAuth.status}
</if>
<if test="fddSealPersonAuth.createBy != null and fddSealPersonAuth.createBy.trim() != ''">
AND a.CREATE_BY = #{fddSealPersonAuth.createBy}
</if>
<if test="fddSealPersonAuth.createName != null and fddSealPersonAuth.createName.trim() != ''">
AND a.CREATE_NAME = #{fddSealPersonAuth.createName}
</if>
<if test="fddSealPersonAuth.createTime != null">
AND a.CREATE_TIME = #{fddSealPersonAuth.createTime}
</if>
<if test="fddSealPersonAuth.updateBy != null and fddSealPersonAuth.updateBy.trim() != ''">
AND a.UPDATE_BY = #{fddSealPersonAuth.updateBy}
</if>
<if test="fddSealPersonAuth.updateTime != null">
AND a.UPDATE_TIME = #{fddSealPersonAuth.updateTime}
</if>
</if>
</sql>
<!--fddSealPersonAuth简单分页查询-->
<select id="getFddSealPersonAuthPage" resultMap="fddSealPersonAuthMap">
SELECT
<include refid="Base_Column_List"/>
FROM fdd_seal_person_auth a
<where>
1=1
<include refid="fddSealPersonAuth_where"/>
</where>
</select>
</mapper>
......@@ -159,7 +159,7 @@ public class TCheckIdCardController {
@SysLog("校验姓名身份证 --- 单个")
@Inner
@PostMapping("/inner/checkIdCardSingle")
public R<TCheckIdCard> checkIdCardSingle(@RequestBody TCheckIdCard tCheckIdCard) {
public TCheckIdCard checkIdCardSingle(@RequestBody TCheckIdCard tCheckIdCard) {
return tCheckIdCardService.checkIdCardSingle(tCheckIdCard);
}
}
......@@ -138,4 +138,18 @@ public class TCheckMobileController {
return tCheckMobileService.checkMobiles(mobiles);
}
/**
* @Description: 单个检测手机号
* @Author: hgw
* @Date: 2022/6/29 15:08
* @return: boolean
**/
@Operation(description = "单个检测手机号,仅支持国内号码")
@SysLog("单个检测手机号状态" )
@Inner
@GetMapping("/inner/checkOneMobile" )
public boolean checkOneMobile(String mobile) {
return tCheckMobileService.checkOneMobile(mobile);
}
}
......@@ -45,5 +45,5 @@ public interface TCheckIdCardService extends IService<TCheckIdCard> {
**/
R<List<TCheckIdCard>> checkIdCard(List<TCheckIdCard> checkList);
R<TCheckIdCard> checkIdCardSingle(TCheckIdCard tCheckIdCard);
TCheckIdCard checkIdCardSingle(TCheckIdCard tCheckIdCard);
}
......@@ -32,4 +32,6 @@ import java.util.Map;
public interface TCheckMobileService extends IService<TCheckMobile> {
R<Map<String,TCheckMobile>> checkMobiles(String mobiles);
boolean checkOneMobile(String mobile);
}
......@@ -226,11 +226,23 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
}
@Override
public R<TCheckIdCard> checkIdCardSingle(TCheckIdCard tCheckIdCard) {
public TCheckIdCard checkIdCardSingle(TCheckIdCard tCheckIdCard) {
String idCard = tCheckIdCard.getIdCard();
String name = tCheckIdCard.getName();
if (Common.isEmpty(idCard) || Common.isEmpty(name)){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
tCheckIdCard.setIsTrue(CommonConstants.ZERO_INT);
tCheckIdCard.setReason(CommonConstants.PARAM_IS_NOT_EMPTY);
return tCheckIdCard;
}
// 校验姓名身份证规则
if (!regIdCard(idCard)) {
tCheckIdCard.setIsTrue(0);
tCheckIdCard.setReason("身份证格式有误");
return tCheckIdCard;
} else if (regEmpName(name)) {
tCheckIdCard.setIsTrue(0);
tCheckIdCard.setReason("姓名含数字或空格,无法校验");
return tCheckIdCard;
}
synchronized (this){
TCheckIdCard checkIdCard = baseMapper.selectOne(Wrappers.<TCheckIdCard>query().lambda()
......@@ -238,7 +250,7 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
.eq(TCheckIdCard::getIsTrue,CommonConstants.ONE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(checkIdCard)){
return R.ok(checkIdCard);
return checkIdCard;
} else {
// 没找到正确的,再去找有没有错误的,如果还没有,再查
List<TCheckIdCard> checkList = baseMapper.selectList(Wrappers.<TCheckIdCard>query().lambda()
......@@ -246,7 +258,7 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
if (checkList != null && !checkList.isEmpty()) {
for (TCheckIdCard c : checkList) {
if (idCard.equals(c.getIdCard()) && name.equals(c.getName())) {
return R.ok(c);
return c;
}
}
}
......@@ -255,7 +267,7 @@ public class TCheckIdCardServiceImpl extends ServiceImpl<TCheckIdCardMapper, TCh
c.setName(name);
ChecksUtil.checkIdCard(c,canCheckService.getCanCheck());
baseMapper.insert(c);
return R.ok(c);
return c;
}
}
}
......
......@@ -52,64 +52,98 @@ public class TCheckMobileServiceImpl extends ServiceImpl<TCheckMobileMapper, TCh
* @Author fxj
* @Description 号码状态校验,单次请求上限100 多一个号码请以逗号分割
* @Date 19:18 2022/6/20
**/
**/
@Override
public synchronized R<Map<String,TCheckMobile>> checkMobiles(String mobiles){
R<Map<String,TCheckMobile>> mobileMapR = null;
Map<String,TCheckMobile> checkMobileMap = null;
Map<String,TCheckMobile> existMap = new HashMap<>();
if (Common.isNotNull(mobiles)){
List<String> mobileList = Common.initStrToList(mobiles,CommonConstants.COMMA_STRING);
if (Common.isNotEmpty(mobileList) && mobileList.size() > CommonConstants.INTEGER_HUNDRED){
public synchronized R<Map<String, TCheckMobile>> checkMobiles(String mobiles) {
R<Map<String, TCheckMobile>> mobileMapR = null;
Map<String, TCheckMobile> checkMobileMap = null;
Map<String, TCheckMobile> existMap = new HashMap<>();
if (Common.isNotNull(mobiles)) {
List<String> mobileList = Common.initStrToList(mobiles, CommonConstants.COMMA_STRING);
if (Common.isNotEmpty(mobileList) && mobileList.size() > CommonConstants.INTEGER_HUNDRED) {
return R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_LIMIT_HUNDRED));
}
//1.先从本地库获取正常数据
List<TCheckMobile> checkMobiles = baseMapper.selectList(Wrappers.<TCheckMobile>query().lambda()
.in(TCheckMobile::getMobile,mobileList)
.eq(TCheckMobile::getStatus,CommonConstants.ONE_STRING));
if (Common.isNotNull(checkMobiles)){
existMap = checkMobiles.stream().collect(Collectors.toMap(TCheckMobile::getMobile,TCheckMobile -> TCheckMobile));
.in(TCheckMobile::getMobile, mobileList)
.eq(TCheckMobile::getStatus, CommonConstants.ONE_STRING));
if (Common.isNotNull(checkMobiles)) {
existMap = checkMobiles.stream().collect(Collectors.toMap(TCheckMobile::getMobile, TCheckMobile -> TCheckMobile));
}
mobileList.removeAll(existMap.keySet());
//2.从远处端获取数据
if (Common.isNotNull(mobileList)){
mobileMapR = ChecksUtil.checkMobile(Common.ListToStr(mobileList,CommonConstants.COMMA_STRING),canCheckService.getCanCheck());
if (Common.isEmpty(mobileMapR) || Common.isEmpty(mobileMapR.getData())){
if (Common.isNotNull(mobileList)) {
mobileMapR = ChecksUtil.checkMobile(Common.ListToStr(mobileList, CommonConstants.COMMA_STRING), canCheckService.getCanCheck());
if (Common.isEmpty(mobileMapR) || Common.isEmpty(mobileMapR.getData())) {
return R.failed(MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR)
+(Common.isNotNull(mobileMapR)?mobileMapR.getMsg():CommonConstants.EMPTY_STRING));
+ (Common.isNotNull(mobileMapR) ? mobileMapR.getMsg() : CommonConstants.EMPTY_STRING));
}
checkMobileMap = mobileMapR.getData();
if (Common.isNotNull(mobileList) && Common.isNotNull(checkMobileMap)){
if (Common.isNotNull(mobileList) && Common.isNotNull(checkMobileMap)) {
TCheckMobile checkMobile = null;
for (String mobile:mobileList){
if (Common.isEmpty(checkMobileMap.get(mobile))){
for (String mobile : mobileList) {
if (Common.isEmpty(checkMobileMap.get(mobile))) {
checkMobile = new TCheckMobile();
checkMobile.setType(CommonConstants.ONE_STRING);
checkMobile.setMobile(mobile);
checkMobile.setStatus(CommonConstants.TEN_STRING);
checkMobile.setMessage(Common.isEmpty(mobileMapR)?MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR):mobileMapR.getMsg());
checkMobile.setMessage(Common.isEmpty(mobileMapR) ? MsgUtils.getMessage(ErrorCodes.CHECKS_MOBILE_REQUEST_ERROR) : mobileMapR.getMsg());
checkMobile.setChargesstatus(CommonConstants.ZERO_STRING);
checkMobile.setNumbertype(CommonConstants.EMPTY_STRING);
checkMobile.setArea(CommonConstants.EMPTY_STRING);
checkMobileMap.put(mobile,checkMobile);
checkMobileMap.put(mobile, checkMobile);
}
}
}
}
}else {
} else {
return R.failed(MsgUtils.getMessage(ErrorCodes.PARAM_NOT_EMPTY));
}
if (Common.isNotNull(checkMobileMap)){
if (Common.isNotNull(checkMobileMap)) {
this.saveBatch(checkMobileMap.values());
}else {
} else {
checkMobileMap = new HashMap<>();
}
checkMobileMap.putAll(existMap);
if (Common.isEmpty(mobileMapR)){
if (Common.isEmpty(mobileMapR)) {
mobileMapR = new R<>();
}
mobileMapR.setData(checkMobileMap);
return mobileMapR;
}
@Override
public synchronized boolean checkOneMobile(String mobile) {
if (Common.isNotNull(mobile)) {
//1.先从本地库获取正常数据
List<TCheckMobile> checkMobiles = baseMapper.selectList(Wrappers.<TCheckMobile>query().lambda()
.eq(TCheckMobile::getMobile, mobile));
if (Common.isNotNull(checkMobiles)) {
for (TCheckMobile c : checkMobiles) {
if (CommonConstants.ONE_STRING.equals(c.getStatus())) {
return true;
}
}
return false;
} else {
//2.从远处端获取数据
R<Map<String, TCheckMobile>> mobileMapR = ChecksUtil.checkMobile(mobile, canCheckService.getCanCheck());
if (Common.isEmpty(mobileMapR) || Common.isEmpty(mobileMapR.getData())) {
return false;
}
Map<String, TCheckMobile> checkMobileMap = mobileMapR.getData();
if (Common.isNotNull(checkMobileMap) && checkMobileMap.get(mobile) != null) {
TCheckMobile checkMobile = checkMobileMap.get(mobile);
this.save(checkMobile);
if (checkMobile != null && CommonConstants.ONE_STRING.equals(checkMobile.getStatus())) {
return true;
} else {
return false;
}
}
}
}
return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment