liujie
2025-04-28 125188b338a603de0d3bf6bad7a3f803b7306fa2
后台日志管理
10个文件已修改
10个文件已添加
488 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/ServiceSangeshenbianApplication.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/annotation/SysLog.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemLogController.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/aspectj/OperLogAspect.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemLogMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/Complaint.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/SystemLog.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/query/SystemLogQuery.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/vo/ComplaintVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/ISystemLogService.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/SystemLogServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/utils/IpUtils.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/warpper/PartyMemberQuery.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/warpper/TokenVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/PartyMemberMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/SystemLogMapper.xml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/ServiceSangeshenbianApplication.java
@@ -7,6 +7,7 @@
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@@ -22,6 +23,7 @@
@ComponentScan({"com.panzhihua.sangeshenbian", "com.panzhihua.common"})
@EnableScheduling
@MapperScan("com.panzhihua.sangeshenbian.dao")
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class ServiceSangeshenbianApplication
{
    public static void main(String[] args) {
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/annotation/SysLog.java
New file
@@ -0,0 +1,18 @@
package com.panzhihua.sangeshenbian.annotation;
import java.lang.annotation.*;
/**
 * @author liujie
 * @date 2025/4/28
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface SysLog {
    long operUserId() default 0; // 操作模块
    String operatorCategory() default ""; // 操作类型 业务类型(0其它 1新增 2修改 3删除)
    String targetName() default ""; //操作类型
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemLogController.java
New file
@@ -0,0 +1,39 @@
package com.panzhihua.sangeshenbian.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.sangeshenbian.model.entity.SystemLog;
import com.panzhihua.sangeshenbian.model.query.SystemLogQuery;
import com.panzhihua.sangeshenbian.service.ISystemLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * <p>
 * 日志表 前端控制器
 * </p>
 *
 * @author
 * @since 2025-04-28
 */
@RestController
@RequestMapping("/system-log")
public class SystemLogController {
    @Autowired
    private ISystemLogService systemLogMapper;
    @GetMapping("/list")
    @ApiOperation(value = "获取日志数据", tags = {"三个身边后台-日志"})
    public R<IPage<SystemLog>> list(SystemLogQuery query){
        IPage<SystemLog> list = systemLogMapper.getLogList(query);
        return R.ok(list);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
@@ -1,10 +1,5 @@
package com.panzhihua.sangeshenbian.api;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.controller.BaseController;
@@ -13,8 +8,7 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo;
import com.panzhihua.common.service.auth.TokenService;
import com.panzhihua.common.utlis.HttpClientUtil;
import com.panzhihua.common.utlis.ServletUtils;
import com.panzhihua.sangeshenbian.annotation.SysLog;
import com.panzhihua.sangeshenbian.model.entity.*;
import com.panzhihua.sangeshenbian.model.vo.RegionVO;
import com.panzhihua.sangeshenbian.service.*;
@@ -25,20 +19,13 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.MessageDigest;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.TimeUnit;
@@ -78,13 +65,16 @@
    @Resource
    private IComActService comActService;
    @Resource
    private ISystemLogService systemLogService;
    @PostMapping("/login")
    @ApiOperation(value = "登录", tags = {"三个身边后台-登录"})
    @OperLog(operModul = "三个身边后台",operType = 0,businessType = "登录")
    @SysLog(operatorCategory = "登录")
    public R<TokenVo> login(@RequestBody LoginVo vo){
        String key = "login:" + vo.getPhone();
        Integer size = (Integer) redisTemplate.opsForValue().get(key);
@@ -115,6 +105,7 @@
        LoginReturnVO loginReturnVO = reult.getData();
        TokenVo tokenVo = new TokenVo();
        BeanUtils.copyProperties(loginReturnVO, tokenVo);
        tokenVo.setUserId(Long.valueOf(systemUser.getId()));
        List<SystemRoleMenu> list = systemRoleMenuService.list(new LambdaQueryWrapper<SystemRoleMenu>().eq(SystemRoleMenu::getSystemRoleId, systemUser.getSystemRoleId()));
        List<Integer> collect = list.stream().map(SystemRoleMenu::getSystemMenuId).collect(Collectors.toList());
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/aspectj/OperLogAspect.java
New file
@@ -0,0 +1,85 @@
package com.panzhihua.sangeshenbian.aspectj;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo;
import com.panzhihua.sangeshenbian.annotation.SysLog;
import com.panzhihua.sangeshenbian.model.entity.SystemLog;
import com.panzhihua.sangeshenbian.service.ISystemLogService;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
/**
 * 切面处理类,操作日志异常日志记录处理
 *
 * @author wu
 * @date 2019/03/21
 */
@Slf4j
@Aspect
@Component
public class OperLogAspect extends BaseController {
    @Autowired
    private ISystemLogService systemLogService;
    /**
     * 设置操作日志切入点 记录操作日志 在注解的位置切入代码
     */
    @Pointcut("@annotation(com.panzhihua.sangeshenbian.annotation.SysLog)")
    public void operLogPoinCut() {}
    /**
     * 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行
     *
     * @param joinPoint
     *            切入点
     * @param keys
     *            返回结果
     */
    @AfterReturning(value = "operLogPoinCut()", returning = "keys")
    public void saveOperLog(JoinPoint joinPoint, Object keys) {
        log.info("进入切面");
        // 从切面织入点处通过反射机制获取织入点处的方法
        MethodSignature signature = (MethodSignature)joinPoint.getSignature();
        // 获取切入点所在的方法
        Method method = signature.getMethod();
        try {
        // 获取操作
            SysLog opLog = method.getAnnotation(SysLog.class);
            SystemLog sysLog = new SystemLog();
            if("登录".equals(opLog.operatorCategory())){
                // 将返回结果转为JSON对象
                JSONObject jsonResult = JSONObject.parseObject(JSONObject.toJSONString(keys));
                // 提取data字段中的TokenVo信息
                JSONObject data = jsonResult.getJSONObject("data");
                Long userId = data.getLong("userId");
                String name = data.getString("name");// 直接获取userId
                sysLog.setOperatorId(Long.valueOf(userId));
                sysLog.setTargetName(name);
            }else {
                SystemUserVo systemUserVo = this.getLoginUserInfoSanGeShenBian();
                sysLog.setOperatorId(Long.valueOf(systemUserVo.getId()));
                sysLog.setTargetName(systemUserVo.getName());
            }
            sysLog.setOperatorCategory(opLog.operatorCategory());
            sysLog.setIp(this.getRequest().getRemoteAddr());
            sysLog.setOperatorInto(opLog.operatorCategory());
            systemLogService.save(sysLog);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/dao/SystemLogMapper.java
New file
@@ -0,0 +1,21 @@
package com.panzhihua.sangeshenbian.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.sangeshenbian.model.entity.SystemLog;
import org.apache.ibatis.annotations.Param;
/**
 * <p>
 * 日志表 Mapper 接口
 * </p>
 *
 * @author
 * @since 2025-04-28
 */
public interface SystemLogMapper extends BaseMapper<SystemLog> {
    IPage<SystemLog> getLogList(@Param("page") Page page, @Param("sTime") String sTime, @Param("eTime") String eTime, @Param("operatorName") String operatorName, @Param("operatorPhone") String operatorPhone, @Param("operatorCategory") String operatorCategory, @Param("ip") String ip);
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/Complaint.java
@@ -1,25 +1,21 @@
package com.panzhihua.sangeshenbian.model.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.checkerframework.checker.units.qual.A;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * <p>
@@ -94,7 +90,7 @@
    @TableField("videos")
    private String videos;
    @ApiModelProperty(value = "流转状态:0-正在办理 1-延期办理 2-超时办理 3-已办结 4-群众撤销 5-上报待审核 6-上级驳回 7-延期待审核 8-已评价")
    @ApiModelProperty(value = "流转状态:0-正在办理 1-延期办理 2-超时办理 3-已办结 4-群众撤销 5-上报待审核 6-上级驳回 7-延期待审核 8-已评价 9-延期驳回")
    @TableField("status")
    private Integer status;
@@ -203,4 +199,8 @@
    @ApiModelProperty(value = "录入人联系方式")
    @TableField("report_user_phone")
    private String reportUserPhone;
    @ApiModelProperty(value = "语音文件")
    @TableField("voice_file")
    private String voiceFile;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/entity/SystemLog.java
New file
@@ -0,0 +1,64 @@
package com.panzhihua.sangeshenbian.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * <p>
 * 日志表
 * </p>
 *
 * @author
 * @since 2025-04-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sgsb_system_log")
@ApiModel(value="SystemLog对象", description="日志表")
public class SystemLog implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    @ApiModelProperty(value = "操作人id")
    private Long operatorId;
    @ApiModelProperty(value = "操作类型 1登录 2职位  3角色 4账号 5 问题 6banner  7党员 8党员审核 9导出")
    private String operatorCategory;
    @ApiModelProperty(value = "目标名称(对象)")
    private String targetName;
    @ApiModelProperty(value = "ip")
    private String ip;
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "操作描述")
    private String operatorInto;
    @ApiModelProperty(value = "操作人")
    @TableField(exist = false)
    private String operatorName;
    @ApiModelProperty(value = "操作人电话")
    @TableField(exist = false)
    private String operatorPhone;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/query/SystemLogQuery.java
New file
@@ -0,0 +1,21 @@
package com.panzhihua.sangeshenbian.model.query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("后台日志查询query")
public class SystemLogQuery extends BasePage{
    @ApiModelProperty("操作用户")
    private String operatorName;
    @ApiModelProperty("联系电话")
    private String operatorPhone;
    @ApiModelProperty("操作类型")
    private String operatorCategory;
    @ApiModelProperty("所在ip")
    private String ip;
    @ApiModelProperty("操作时间 2022-02-02 - 2022-03-03")
    private String createTime;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/model/vo/ComplaintVO.java
@@ -1,7 +1,5 @@
package com.panzhihua.sangeshenbian.model.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.panzhihua.sangeshenbian.model.entity.Complaint;
import com.panzhihua.sangeshenbian.model.entity.ComplaintComment;
import com.panzhihua.sangeshenbian.model.entity.ComplaintFlow;
@@ -67,10 +65,10 @@
    private String auditTime;
    @ApiModelProperty(value = "诉求流转记录")
    List<ComplaintFlow> complaintFlows;
    private List<ComplaintFlow> complaintFlows;
    @ApiModelProperty(value = "办理进度")
    List<ComplaintProgress> complaintProgresses;
    private List<ComplaintProgress> complaintProgresses;
    @ApiModelProperty(value = "审核按钮状态(0=显示,1=隐藏)")
    private Integer auditButtonStatus;
@@ -89,4 +87,7 @@
    
    @ApiModelProperty(value = "评价按钮状态(0=显示,1=隐藏)")
    private Integer evaluateButtonStatus;
    @ApiModelProperty(value = "语音文件集合")
    private List<String> voiceFileList;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/IComplaintService.java
@@ -72,13 +72,13 @@
    void saveAndReport(ComplaintVO complaintVO, LoginUserInfoVO loginUserInfo);
    void saveAndComplete(@Valid ComplaintSaveAndCompleteDTO complaintVO, LoginUserInfoVO loginUserInfo);
    /**
     * 诉求上报
     */
    void saveReport(ComplaintReportDTO dto, LoginUserInfoVO loginUserInfoVO);
    void saveAndComplete(@Valid ComplaintSaveAndCompleteDTO complaintVO, LoginUserInfoVO loginUserInfo);
    /**
     * 诉求上报撤回
     */
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/ISystemLogService.java
New file
@@ -0,0 +1,36 @@
package com.panzhihua.sangeshenbian.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.sangeshenbian.model.entity.SystemLog;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.sangeshenbian.model.query.SystemLogQuery;
/**
 * <p>
 * 日志表 服务类
 * </p>
 *
 * @author
 * @since 2025-04-28
 */
public interface ISystemLogService extends IService<SystemLog> {
    /**
     * 获取日志列表
     * @param query
     * @return
     */
    IPage<SystemLog> getLogList(SystemLogQuery query);
    /**
     *
     * @param operatorId 操作人id  登录人id
     * @param operatorCategory  操作方式 如登录 添加职位
     * @param targetName  目标名称 如 登录 记录登录用户名称
     * @param ip
     * @param operatorInto  操作内容
     */
    void addLogInfo(Long operatorId, String operatorCategory, String targetName,String ip,String operatorInto);
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
@@ -12,6 +12,7 @@
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo;
import com.panzhihua.common.redis.RedisUtils;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.sangeshenbian.config.AutoColumnWidthStrategy;
import com.panzhihua.sangeshenbian.dao.ComplaintMapper;
import com.panzhihua.sangeshenbian.enums.AuditStatusEnum;
@@ -1182,6 +1183,15 @@
        //查询评价
        ComplaintComment comment = complaintCommentService.lambdaQuery().eq(ComplaintComment::getComplaintId, id).last("LIMIT 1").one();
        complaintVO.setComplaintComment(comment);
        ArrayList<String> voiceFileList = new ArrayList<>();
        String voiceFile = complaint.getVoiceFile();
        if(StringUtils.isNotEmpty(voiceFile)){
            for (String file :voiceFile.split(",")) {
                voiceFileList.add(file);
            }
        }
        complaintVO.setVoiceFileList(voiceFileList);
        return complaintVO;
    }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/PartyMemberServiceImpl.java
@@ -90,6 +90,7 @@
            partyMember.setSource(1);
            save(partyMember);
        } else {
            partyMember.setIsConfirm(0);
            partyMember.setUpdateBy(Long.parseLong(loginUserInfo.getId().toString()));
            updateById(partyMember);
        }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/SystemLogServiceImpl.java
New file
@@ -0,0 +1,50 @@
package com.panzhihua.sangeshenbian.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.sangeshenbian.model.entity.SystemLog;
import com.panzhihua.sangeshenbian.dao.SystemLogMapper;
import com.panzhihua.sangeshenbian.model.query.SystemLogQuery;
import com.panzhihua.sangeshenbian.service.ISystemLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
 * <p>
 * 日志表 服务实现类
 * </p>
 *
 * @author
 * @since 2025-04-28
 */
@Service
public class SystemLogServiceImpl extends ServiceImpl<SystemLogMapper, SystemLog> implements ISystemLogService {
    @Override
    public IPage<SystemLog> getLogList(SystemLogQuery query) {
        Page page = new Page<>();
        page.setCurrent(query.getPageNum());
        page.setSize(query.getPageSize());
        String sTime=null;
        String eTime=null;
        if(StringUtils.isNotEmpty(query.getCreateTime())){
            String[] split = query.getCreateTime().split(" - ");
            sTime=split[0]+" 00:00:00";
            eTime=split[1]+" 23:59:59";
        }
        return this.baseMapper.getLogList(page,sTime,eTime,query.getOperatorName(),query.getOperatorPhone(),query.getOperatorCategory(),query.getIp());
    }
    @Override
    public void addLogInfo(Long operatorId, String operatorCategory, String targetName, String ip, String operatorInto) {
        SystemLog systemLog = new SystemLog();
        systemLog.setOperatorId(operatorId);
        systemLog.setOperatorCategory(operatorCategory);
        systemLog.setTargetName(targetName);
        systemLog.setIp(ip);
        systemLog.setOperatorInto(operatorInto);
        this.save(systemLog);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/utils/IpUtils.java
New file
@@ -0,0 +1,30 @@
package com.panzhihua.sangeshenbian.utils;
import javax.servlet.http.HttpServletRequest;
public class IpUtils {
    public static String getClientIp(HttpServletRequest request) {
        String ip = null;
        // 1. 优先检查代理头信息(需注意头可能被伪造)
        String[] headers = {"X-Forwarded-For", "Proxy-Client-IP", "WL-Proxy-Client-IP"};
        for (String header : headers) {
            ip = request.getHeader(header);
            if (isValidIp(ip)) {
                // 处理多层代理情况(X-Forwarded-For可能有多个逗号分隔的IP)
                return ip.contains(",") ? ip.split(",")[0].trim() : ip;
            }
        }
        // 2. 无代理头时使用默认方法
        ip = request.getRemoteAddr();
        // 处理IPv6本地地址格式
        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
    }
    private static boolean isValidIp(String ip) {
        return ip != null && ip.length() != 0
                && !"unknown".equalsIgnoreCase(ip);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/warpper/PartyMemberQuery.java
@@ -32,4 +32,13 @@
    @ApiModelProperty(value = "审核状态 0:待审核 1:审核通过 党员管理列表传1,审核列表传0")
    @NotNull(message = "审核状态不能为空")
    private Integer auditStatus;
    @ApiModelProperty(value = "身份证号")
    private String idNumber;
    @ApiModelProperty(value = "创建时间排序 1倒叙  2正序  默认不传")
    private Integer createTimeSort;
    @ApiModelProperty(value = "更新时间排序 1倒叙  2正序 默认不传")
    private Integer updateTimeSort;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/warpper/TokenVo.java
@@ -4,7 +4,6 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Set;
/**
@@ -40,4 +39,5 @@
    private String districtsCode;
    @ApiModelProperty("市编号")
    private String cityCode;
    private Long userId;
}
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/PartyMemberMapper.xml
@@ -55,8 +55,26 @@
            <if test="query.freezeStatus != null and query.freezeStatus != ''">
                and freeze_status = #{query.freezeStatus}
            </if>
            <if test="query.idNumber != null and query.idNumber != ''">
                and id_number = #{query.idNumber}
            </if>
        </where>
        ORDER BY create_time DESC
            <if test="query.createTimeSort != null and query.createTimeSort==1 ">
                order by create_time desc
            </if>
            <if test="query.createTimeSort != null and query.createTimeSort==2 ">
                order by create_time asc
            </if>
            <if test="query.createTimeSort ==null and query.updateTimeSort != null and query.updateTimeSort == 1">
                order by update_time desc
            </if>
            <if test="query.createTimeSort ==null and query.updateTimeSort != null and query.updateTimeSort == 2">
                order by update_time asc
            </if>
            <if test="query.createTimeSort ==null and query.updateTimeSort == null ">
                order by create_time desc
            </if>
    </select>
    <select id="queryList" resultType="com.panzhihua.sangeshenbian.model.entity.PartyMember">
        select id,
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/mapper/SystemLogMapper.xml
New file
@@ -0,0 +1,26 @@
<?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.panzhihua.sangeshenbian.dao.SystemLogMapper">
    <select id="getLogList" resultType="com.panzhihua.sangeshenbian.model.entity.SystemLog">
        select t1.id, t1.operator_id, t2.name as operatorName, t2.phone as operatorPhone, t1.operator_category, t1.target_name, t1.ip, t1.create_time, t1.operator_into
        from sgsb_system_log t1 left join  sgsb_system_user t2 on t1.operator_id = t2.id
        where 1=1
        <if test="operatorName != null and operatorName != ''">
            and t2.name like concat('%',#{operatorName},'%')
        </if>
        <if test="operatorPhone != null and operatorPhone != ''">
            and t2.phone like concat('%',#{operatorPhone},'%')
        </if>
        <if test="operatorCategory != null and operatorCategory != ''">
            and t1.operator_category = #{operatorCategory}
        </if>
        <if test="ip != null and ip != ''">
            and t1.ip = #{ip}
        </if>
        <if test="sTime != null">
            and t1.create_time between #{sTime} and #{eTime}
        </if>
        order by t1.create_time desc
    </select>
</mapper>