| | |
| | | import com.panzhihua.sangeshenbian.model.dto.ComplaintProcessDTO; |
| | | import com.panzhihua.sangeshenbian.model.entity.Complaint; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.sangeshenbian.enums.ReportTypeEnum; |
| | | import com.panzhihua.sangeshenbian.model.dto.*; |
| | | import com.panzhihua.sangeshenbian.model.entity.*; |
| | |
| | | import com.panzhihua.sangeshenbian.model.vo.ComplaintVO; |
| | | import com.panzhihua.sangeshenbian.service.ISystemUserService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.List; |
| | | |
| | | import static cn.hutool.core.util.ObjectUtil.isNull; |
| | | |
| | |
| | | * @since 2025-02-22 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @RequiredArgsConstructor(onConstructor_ = {@Lazy}) |
| | | public class ComplaintServiceImpl extends ServiceImpl<ComplaintMapper, Complaint> implements IComplaintService { |
| | | private final ISystemUserService systemUserService; |
| | | private final IComplaintFlowService complaintFlowService; |
| | |
| | | List<ComplaintFlow> list = complaintFlowService.lambdaQuery().eq(ComplaintFlow::getComplaintId, id).orderByAsc(ComplaintFlow::getCreateTime).list(); |
| | | detail.setComplaintFlows(list); |
| | | } |
| | | //查询办理进度 |
| | | List<ComplaintProgress> list = complaintProgressService.lambdaQuery().eq(ComplaintProgress::getComplaintId, id) |
| | | .orderByAsc(ComplaintProgress::getCreateTime).list(); |
| | | detail.setComplaintProgresses(list); |
| | | return detail; |
| | | } |
| | | |
| | |
| | | * 办理进度录入 |
| | | * |
| | | * @param dto |
| | | * @param userId |
| | | * @param loginUserInfoVO |
| | | */ |
| | | @Override |
| | | public void saveProcess(ComplaintProcessDTO dto,Long userId) { |
| | | public void saveProcess(ComplaintProcessDTO dto, LoginUserInfoVO loginUserInfoVO) { |
| | | ComplaintProgress complaintProgress = BeanUtil.copyProperties(dto, ComplaintProgress.class); |
| | | complaintProgress.setCreateTime(new Date()); |
| | | complaintProgress.setCreateBy(userId); |
| | | complaintProgress.setCreateBy(loginUserInfoVO.getUserId()); |
| | | complaintProgress.setCreateByName(loginUserInfoVO.getName()); |
| | | complaintProgressService.save(complaintProgress); |
| | | } |
| | | |
| | |
| | | complaint.setCompletionTime(new Date()); |
| | | this.updateById(complaint); |
| | | } |
| | | |
| | | /** |
| | | * 办理进度列表 |
| | | * @param complaintId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ComplaintProgress> progress(Long complaintId) { |
| | | //查询办理进度 |
| | | return complaintProgressService.lambdaQuery().eq(ComplaintProgress::getComplaintId, complaintId) |
| | | .orderByAsc(ComplaintProgress::getCreateTime).list(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | throw new ServiceException("未知的账号等级"); |
| | | } |
| | | return dispatchVOList; |
| | | } |
| | | /** |
| | | * 获取待办诉求 |
| | | * @param page |
| | | * @param basePage |
| | | * @param loginUserInfo |
| | | * @return |
| | | */ |
| | |
| | | Page<ComplaintTodoVO> page = baseMapper.getTodoList(new Page<>(basePage.getPageNum(), basePage.getPageSize()), targetId,isSuperior); |
| | | return page; |
| | | } |
| | | /** |
| | | * 延期情况说明 |
| | | * @param complaintId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ComplaintAuditRecord delayDetail(Long complaintId) { |
| | | return complaintAuditRecordService.lambdaQuery().eq(ComplaintAuditRecord::getComplaintId, complaintId) |
| | | .eq(ComplaintAuditRecord::getAuditType, 1) |
| | | .eq(ComplaintAuditRecord::getLatestFlag, true) |
| | | .last("LIMIT 1").one(); |
| | | } |
| | | } |
| | | |