28 changed files with 1035 additions and 9 deletions
Binary file not shown.
@ -0,0 +1,27 @@ |
|||
package com.zdxt.enforcementcode.domain.bo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangQueryComplaintBo { |
|||
|
|||
@Schema(description = "页码,从1开始,默认1") |
|||
private Integer pageNum = 1; |
|||
|
|||
@Schema(description = "每页条数,默认 100") |
|||
private Integer pageSize = 100; |
|||
|
|||
@Schema(description = "开始时间(yyyy-MM-dd HH:mm:ss)") |
|||
private String startTime; |
|||
|
|||
@Schema(description = "结束时间(yyyy-MM-dd HH:mm:ss)") |
|||
private String endTime; |
|||
|
|||
@Schema(description = "投诉id") |
|||
private String complaintId; |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.zdxt.enforcementcode.domain.bo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangQueryPlanBo { |
|||
|
|||
@Schema(description = "页码,从1开始,默认1") |
|||
private Integer pageNum = 1; |
|||
|
|||
@Schema(description = "每页条数,默认 100") |
|||
private Integer pageSize = 100; |
|||
|
|||
@Schema(description = "开始时间(yyyy-MM-dd HH:mm:ss)") |
|||
private String startTime; |
|||
|
|||
@Schema(description = "结束时间(yyyy-MM-dd HH:mm:ss)") |
|||
private String endTime; |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.zdxt.enforcementcode.domain.bo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangQueryUserBo { |
|||
|
|||
@Schema(description = "页码,从1开始,默认1") |
|||
private Integer pageNum = 1; |
|||
|
|||
@Schema(description = "每页条数,默认 100") |
|||
private Integer pageSize = 100; |
|||
|
|||
@Schema(description = "开始时间(yyyy-MM-dd HH:mm:ss)") |
|||
private String startTime; |
|||
|
|||
@Schema(description = "结束时间(yyyy-MM-dd HH:mm:ss)") |
|||
private String endTime; |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.zdxt.enforcementcode.domain.vo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangComplaintSyncPageVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "页码,从1开始") |
|||
private Integer pageNum; |
|||
|
|||
@Schema(description = "每页条数") |
|||
private Integer pageSize; |
|||
|
|||
@Schema(description = "总条数") |
|||
private Long total; |
|||
|
|||
@Schema(description = "投诉列表") |
|||
private List<LongGangComplaintSyncVo> list = new ArrayList<>(); |
|||
} |
|||
@ -0,0 +1,178 @@ |
|||
package com.zdxt.enforcementcode.domain.vo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangComplaintSyncVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 关联执法记录ID |
|||
*/ |
|||
@Schema(description = "关联执法记录ID") |
|||
private String relId; |
|||
|
|||
/** |
|||
* 执法类型 |
|||
*/ |
|||
@Schema(description = "执法类型") |
|||
private Long enforceType; |
|||
|
|||
/** |
|||
* 问题描述 |
|||
*/ |
|||
@Schema(description = "问题描述") |
|||
private String problemDescription; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
@Schema(description = "联系人") |
|||
private String linkman; |
|||
|
|||
/** |
|||
* 联系方式 |
|||
*/ |
|||
@Schema(description = "联系方式") |
|||
private String linkmanTel; |
|||
|
|||
/** |
|||
* 是否删除 0 否 1 是 |
|||
*/ |
|||
@Schema(description = "是否删除 0 否 1 是") |
|||
private Long isDelete; |
|||
|
|||
/** |
|||
* 投诉对接12345案件类型 |
|||
*/ |
|||
@Schema(description = "投诉对接12345案件类型") |
|||
private String caseType; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Long authorization; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Long comOrOpi; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String enterpriseAddress; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String proWoCode; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Long status; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date evaluateTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String enterpriseNumber; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String enterpriseName; |
|||
|
|||
/** |
|||
* 执法部门多个-逗号隔开 |
|||
*/ |
|||
@Schema(description = "执法部门多个-逗号隔开") |
|||
private String complaintDepartments; |
|||
|
|||
/** |
|||
* 执法部门id多个-逗号隔开 |
|||
*/ |
|||
@Schema(description = "执法部门id多个-逗号隔开") |
|||
private String complaintDepartmentIds; |
|||
|
|||
/** |
|||
* 执法时间 |
|||
*/ |
|||
@Schema(description = "执法时间") |
|||
private Date enforcementTime; |
|||
|
|||
/** |
|||
* 投诉类型 0 系默认 1 联合检查 |
|||
*/ |
|||
@Schema(description = "投诉类型 0 系默认 1 联合检查") |
|||
private Long complaintType; |
|||
|
|||
/** |
|||
* 投诉事项编码,多个逗号隔开 |
|||
*/ |
|||
@Schema(description = "投诉事项编码,多个逗号隔开") |
|||
private String complaintItemCodes; |
|||
|
|||
/** |
|||
* 投诉事项名称,多个逗号隔开 |
|||
*/ |
|||
@Schema(description = "投诉事项名称,多个逗号隔开") |
|||
private String complaintItemNames; |
|||
|
|||
/** |
|||
* 同步过来的处理时间 |
|||
*/ |
|||
@Schema(description = "同步过来的处理时间") |
|||
private String handleTime; |
|||
|
|||
/** |
|||
* 投诉事项(对应记录表执法/入企事项) |
|||
*/ |
|||
@Schema(description = "投诉事项(对应记录表执法/入企事项)") |
|||
private String complaintRecordItem; |
|||
|
|||
/** |
|||
* 数据类型 0行政 1 非行政 |
|||
*/ |
|||
@Schema(description = "数据类型 0行政 1 非行政") |
|||
private Long recordType; |
|||
|
|||
/** |
|||
* 详细地址 |
|||
*/ |
|||
@Schema(description = "详细地址") |
|||
private String detailedAddress; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@Schema(description = "创建时间") |
|||
private Date createTime; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
@Schema(description = "更新时间") |
|||
private Date updateTime; |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.zdxt.enforcementcode.domain.vo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 外部接口-执法计划同步分页结果 |
|||
* |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangPlanSyncPageVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "页码,从1开始") |
|||
private Integer pageNum; |
|||
|
|||
@Schema(description = "每页条数") |
|||
private Integer pageSize; |
|||
|
|||
@Schema(description = "总条数") |
|||
private Long total; |
|||
|
|||
@Schema(description = "计划列表") |
|||
private List<LongGangPlanSyncVo> list = new ArrayList<>(); |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
package com.zdxt.enforcementcode.domain.vo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangPlanSyncVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "计划id") |
|||
private String planId; |
|||
|
|||
@Schema(description = "任务id") |
|||
private String taskId; |
|||
|
|||
@Schema(description = "外部流水号") |
|||
private String outSerialNo; |
|||
|
|||
@Schema(description = "执法单位ID") |
|||
private String bureauDeptId; |
|||
|
|||
@Schema(description = "执法单位名称") |
|||
private String bureauDeptName; |
|||
|
|||
@Schema(description = "计划执行日期(如 2025-05-08)") |
|||
private Date planDate; |
|||
|
|||
@Schema(description = "执行时段:1=上午,2=下午,3=其他") |
|||
private Long planTime; |
|||
|
|||
@Schema(description = "被检查企业/机构名称") |
|||
private String enterpriseName; |
|||
|
|||
@Schema(description = "被检查企业/机构信用代码") |
|||
private String enterpriseNumber; |
|||
|
|||
@Schema(description = "执法人员姓名(多个逗号分隔)") |
|||
private String enforceUserNames; |
|||
|
|||
@Schema(description = "执法人员ID(多个逗号分隔)") |
|||
private String enforceUserIds; |
|||
|
|||
@Schema(description = "创建时间") |
|||
private Date createTime; |
|||
|
|||
@Schema(description = "更新时间") |
|||
private Date updateTime; |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.zdxt.enforcementcode.domain.vo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangUserSyncPageVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Schema(description = "页码,从1开始") |
|||
private Integer pageNum; |
|||
|
|||
@Schema(description = "每页条数") |
|||
private Integer pageSize; |
|||
|
|||
@Schema(description = "总条数") |
|||
private Long total; |
|||
|
|||
@Schema(description = "用户列表") |
|||
private List<LongGangUserSyncVo> list = new ArrayList<>(); |
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package com.zdxt.enforcementcode.domain.vo.externalInterface; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* |
|||
* @author msy |
|||
* @Date: 2026/11/10 |
|||
*/ |
|||
@Data |
|||
public class LongGangUserSyncVo { |
|||
|
|||
@Schema(description = "用户ID") |
|||
private Long userId; |
|||
|
|||
@Schema(description = "部门ID") |
|||
private String deptId; |
|||
|
|||
@Schema(description = "用户账号") |
|||
private String userName; |
|||
|
|||
@Schema(description = "用户昵称") |
|||
private String nickName; |
|||
|
|||
@Schema(description = "用户类型(sys_user系统用户)") |
|||
private String userType; |
|||
|
|||
@Schema(description = "用户邮箱") |
|||
private String email; |
|||
|
|||
@Schema(description = "手机号码") |
|||
private String phonenumber; |
|||
|
|||
@Schema(description = "用户性别") |
|||
private String sex; |
|||
|
|||
@Schema(description = "账号状态(0正常 1停用)") |
|||
private String status; |
|||
|
|||
@Schema(description = "删除标志(0代表存在 1代表删除)") |
|||
private String delFlag; |
|||
|
|||
@Schema(description = "备注") |
|||
private String remark; |
|||
|
|||
@Schema(description = "登录账号") |
|||
private String loginName; |
|||
|
|||
@Schema(description = "用户类型") |
|||
private String type; |
|||
|
|||
@Schema(description = "执法证件号") |
|||
private String lawCertificateNum; |
|||
|
|||
@Schema(description = "姓名") |
|||
private String fullname; |
|||
|
|||
@Schema(description = "是否删除 (0否;1是)") |
|||
private String isDeleted; |
|||
|
|||
@Schema(description = "是否禁用 (0否;1是)") |
|||
private String isDisabled; |
|||
|
|||
@Schema(description = "创建日期(时间戳)") |
|||
private String createAt; |
|||
|
|||
@Schema(description = "更新日期(时间戳)") |
|||
private String updateAt; |
|||
|
|||
@Schema(description = "创建时间") |
|||
private Date createTime; |
|||
|
|||
@Schema(description = "更新时间") |
|||
private Date updateTime; |
|||
|
|||
@Schema(description = "加密备注二") |
|||
private String cryptoRemarkTwo; |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.zdxt.enforcementcode.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.zdxt.enforcementcode.domain.vo.externalInterface.LongGangUserSyncVo; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 龙岗外部接口-用户同步查询 Mapper |
|||
* |
|||
* @author msy |
|||
*/ |
|||
public interface LongGangUserQueryMapper { |
|||
|
|||
/** |
|||
* 按所属区域分页查询用户,支持按更新时间区间增量同步 |
|||
* |
|||
* @param page 分页参数 |
|||
* @param areaCode 龙岗区行政区编码(dashboard_area_info.code) |
|||
* @param startTime 更新时间起(含),null 不限 |
|||
* @param endTime 更新时间止(含),null 不限 |
|||
* @return 用户分页数据 |
|||
*/ |
|||
Page<LongGangUserSyncVo> selectUserSyncPage(Page<LongGangUserSyncVo> page, |
|||
@Param("areaCode") String areaCode, |
|||
@Param("startTime") Date startTime, |
|||
@Param("endTime") Date endTime); |
|||
|
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.zdxt.enforcementcode.service; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.externalInterface.LongGangQueryUserBo; |
|||
import com.zdxt.enforcementcode.domain.vo.externalInterface.LongGangUserSyncPageVo; |
|||
|
|||
/** |
|||
* 龙岗外部接口-用户同步查询 |
|||
*/ |
|||
public interface ILongGangUserQueryService { |
|||
|
|||
/** |
|||
* 分页查询龙岗区用户,支持按更新时间区间增量同步。 |
|||
* |
|||
* @param bo 查询参数(pageNum、pageSize、startTime、endTime) |
|||
* @param areaCode 龙岗区行政区编码(dashboard_area_info.code) |
|||
* @return 用户分页结果 |
|||
*/ |
|||
LongGangUserSyncPageVo syncUser(LongGangQueryUserBo bo, String areaCode); |
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
package com.zdxt.enforcementcode.service.impl; |
|||
|
|||
import cn.hutool.core.date.DateUtil; |
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.zdxt.enforcementcode.common.util.CommonUtil; |
|||
import com.zdxt.enforcementcode.domain.bo.externalInterface.LongGangQueryUserBo; |
|||
import com.zdxt.enforcementcode.domain.vo.externalInterface.LongGangUserSyncPageVo; |
|||
import com.zdxt.enforcementcode.domain.vo.externalInterface.LongGangUserSyncVo; |
|||
import com.zdxt.enforcementcode.mapper.LongGangUserQueryMapper; |
|||
import com.zdxt.enforcementcode.service.ILongGangUserQueryService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.dromara.common.core.exception.ServiceException; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 龙岗外部接口-用户同步查询。 |
|||
* 按所属区域分页查询用户,供第三方按更新时间增量同步。 |
|||
*/ |
|||
@Slf4j |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class LongGangUserQueryServiceImpl implements ILongGangUserQueryService { |
|||
|
|||
private static final int DEFAULT_PAGE_NUM = 1; |
|||
private static final int DEFAULT_PAGE_SIZE = 100; |
|||
private static final int MAX_PAGE_SIZE = 500; |
|||
|
|||
private final LongGangUserQueryMapper userQueryMapper; |
|||
|
|||
|
|||
@Override |
|||
public LongGangUserSyncPageVo syncUser(LongGangQueryUserBo bo, String areaCode) { |
|||
int pageNum = bo.getPageNum() == null || bo.getPageNum() < 1 ? DEFAULT_PAGE_NUM : bo.getPageNum(); |
|||
int pageSize = bo.getPageSize() == null || bo.getPageSize() < 1 ? DEFAULT_PAGE_SIZE : Math.min(bo.getPageSize(), MAX_PAGE_SIZE); |
|||
|
|||
Date startTime = parseTime(bo.getStartTime(), "开始时间"); |
|||
Date endTime = parseTime(bo.getEndTime(), "结束时间"); |
|||
|
|||
Page<LongGangUserSyncVo> page = userQueryMapper.selectUserSyncPage( |
|||
new Page<>(pageNum, pageSize), areaCode, startTime, endTime); |
|||
|
|||
// crypto_remark_two 可能存 AES 密文或明文: 明文直接使用, 密文解密后使用.
|
|||
page.getRecords().parallelStream().forEach(record -> { |
|||
String phone = record.getCryptoRemarkTwo(); |
|||
record.setPhonenumber(CommonUtil.isPhoneEncrypted(phone) ? CommonUtil.decryptPhone(phone) : phone); |
|||
}); |
|||
|
|||
LongGangUserSyncPageVo vo = new LongGangUserSyncPageVo(); |
|||
vo.setPageNum(pageNum); |
|||
vo.setPageSize(pageSize); |
|||
vo.setTotal(page.getTotal()); |
|||
vo.setList(page.getRecords()); |
|||
return vo; |
|||
} |
|||
|
|||
private Date parseTime(String time, String fieldName) { |
|||
if (StrUtil.isBlank(time)) { |
|||
return null; |
|||
} |
|||
try { |
|||
return DateUtil.parse(time); |
|||
} catch (Exception e) { |
|||
throw new ServiceException(fieldName + "格式错误,应为 yyyy-MM-dd HH:mm:ss"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.zdxt.enforcementcode.mapper.LongGangUserQueryMapper"> |
|||
|
|||
<!-- 按所属区域(sys_dept.area_node → dashboard_area_info.code)分页查询未删除用户, |
|||
支持按 sys_user.update_time 区间增量同步; 按更新时间升序保证增量翻页顺序稳定 --> |
|||
<select id="selectUserSyncPage" resultType="com.zdxt.enforcementcode.domain.vo.externalInterface.LongGangUserSyncVo"> |
|||
SELECT |
|||
u.user_id, |
|||
u.dept_id, |
|||
u.user_name, |
|||
u.nick_name, |
|||
u.user_type, |
|||
u.email, |
|||
u.phonenumber, |
|||
u.crypto_remark_two, |
|||
u.sex, |
|||
u.status, |
|||
u.del_flag, |
|||
u.remark, |
|||
u.login_name, |
|||
u.type, |
|||
u.law_certificate_num, |
|||
u.fullname, |
|||
u.isDeleted, |
|||
u.isDisabled, |
|||
u.createAt, |
|||
u.updateAt, |
|||
u.create_time, |
|||
u.update_time |
|||
FROM sys_user u |
|||
INNER JOIN sys_dept d ON u.dept_id = d.dept_id |
|||
WHERE u.del_flag = '0' |
|||
AND d.del_flag = '0' |
|||
AND d.area_node = #{areaCode} |
|||
<if test="startTime != null"> |
|||
AND u.update_time >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null"> |
|||
AND u.update_time <= #{endTime} |
|||
</if> |
|||
ORDER BY u.update_time ASC, u.user_id ASC |
|||
</select> |
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue