From 91ebbdc5ef67699d166498f6cf5fcc21058817dd Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期二, 25 二月 2025 19:59:50 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintFlowServiceImpl.java | 35 +++++++++++++++++++---------------- 1 files changed, 19 insertions(+), 16 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintFlowServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintFlowServiceImpl.java index e08bc6a..a11c5bb 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintFlowServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintFlowServiceImpl.java @@ -1,7 +1,11 @@ package com.panzhihua.sangeshenbian.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.netflix.servo.monitor.LongGauge; import com.panzhihua.common.exceptions.ServiceException; +import com.panzhihua.common.model.vos.LoginUserInfoVO; +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.service.user.UserService; import com.panzhihua.sangeshenbian.enums.ReportTypeEnum; import com.panzhihua.sangeshenbian.model.entity.*; import com.panzhihua.sangeshenbian.dao.ComplaintFlowMapper; @@ -24,23 +28,19 @@ * @since 2025-02-22 */ @Service -@RequiredArgsConstructor +@RequiredArgsConstructor(onConstructor_ = {@Lazy}) public class ComplaintFlowServiceImpl extends ServiceImpl<ComplaintFlowMapper, ComplaintFlow> implements IComplaintFlowService { - @Lazy - @Resource - private IComplaintService complaintService; + private final IComplaintService complaintService; private final IBcRegionService bcRegionService; private final IComStreetService comStreetService; private final IComActService comActService; - - + private final UserService userService; + @Override - public void createFlow(Long complaintId , Integer type, Long userId) { + public void createFlow(Long complaintId , Long superiorId, Integer reportType, Integer type, Long userId) { - Complaint complaint = complaintService.getById(complaintId); - Integer reportType = complaint.getReportType(); - String name = getFlowName(reportType, complaint); + String name = getFlowName(reportType, superiorId); ComplaintFlow complaintFlow = new ComplaintFlow(); complaintFlow.setComplaintId(complaintId); @@ -51,21 +51,24 @@ save(complaintFlow); } - private String getFlowName(Integer reportType, Complaint complaint) { + private String getFlowName(Integer reportType, Long superiorId) { String name; if (reportType == ReportTypeEnum.COMMUNITY.getCode()) { - ComAct byId = comActService.getById(complaint.getSuperiorId()); + ComAct byId = comActService.getById(superiorId); name = byId.getName(); }else if (reportType == ReportTypeEnum.STREET.getCode()) { - ComStreet comStreet = comStreetService.getById(complaint.getSuperiorId()); + ComStreet comStreet = comStreetService.getById(superiorId); name = comStreet.getName(); } else if (reportType == ReportTypeEnum.CITY.getCode() || reportType == ReportTypeEnum.DISTRICT.getCode()){ BcRegion bcRegion = bcRegionService.getOne(new LambdaQueryWrapper<BcRegion>() - .eq(BcRegion::getRegionCode, complaint.getSuperiorId())); + .eq(BcRegion::getRegionCode, superiorId)); name = bcRegion.getRegionName(); } else { - // 处理未预期的账号等级 - throw new ServiceException("未知的账号等级"); + R<LoginUserInfoVO> userR = userService.getUserInfoByUserId(String.valueOf(superiorId)); + if (R.isOk(userR)) { + throw new ServiceException("获取用户信息失败"); + } + name = userR.getData().getNickName(); } return name; } -- Gitblit v1.7.1