| | |
| | | import com.project.enforce.mapper.EnforceComplaintLogMapper; |
| | | import com.project.enforce.service.IEnforceComplaintLogService; |
| | | import com.project.system.service.ISysDeptService; |
| | | import com.project.system.service.ISysUserService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public class EnforceComplaintLogServiceImpl extends ServiceImpl<EnforceComplaintLogMapper, EnforceComplaintLog> implements IEnforceComplaintLogService { |
| | | |
| | | private final ISysDeptService deptService; |
| | | private final ISysUserService userService; |
| | | |
| | | |
| | | @Override//列表查询 |
| | | public List<EnforceComplaintLogVo> queryList(EnforceComplaintLogQueryBo bo) |
| | | { |
| | | QueryWrapper<EnforceComplaintLog> qw = getQw(bo); |
| | | List<EnforceComplaintLog> list = this.list(qw); |
| | | return Convert.toList(EnforceComplaintLogVo.class , list); |
| | | } |
| | | |
| | | @Override//列表查询 |
| | | public List<EnforceComplaintLogVo> complaintList(EnforceComplaintLogQueryBo bo) |
| | | { |
| | | QueryWrapper<EnforceComplaintLog> qw = getQw(bo); |
| | | qw.ne("complaint_type","-1"); |
| | | List<EnforceComplaintLog> list = this.list(qw); |
| | | return Convert.toList(EnforceComplaintLogVo.class , list); |
| | | } |
| | | |
| | | @Override |
| | | public List<EnforceComplaintLogVo> queryPleaseList(EnforceComplaintLogQueryBo bo) { |
| | | QueryWrapper<EnforceComplaintLog> qw = getQw(bo); |
| | | qw.eq("complaint_type","-1"); |
| | | List<EnforceComplaintLog> list = this.list(qw); |
| | | return Convert.toList(EnforceComplaintLogVo.class , list); |
| | | } |
| | |
| | | List<OrderNodeVo> vos = new ArrayList<>(); |
| | | EnforceComplaintLog order = this.getById(id); |
| | | if (order.getComplaintTime()!=null){ |
| | | vos.add(new OrderNodeVo("发起投诉",order.getCompanyUser(),order.getComplaintTime(), null)); |
| | | vos.add(new OrderNodeVo("发起诉求",order.getCompanyUser(),order.getCompanyName(),order.getComplaintTime(), null)); |
| | | } |
| | | if (order.getInTime()!=null){ |
| | | vos.add(new OrderNodeVo("响应投诉",order.getInUser(),order.getInTime(), null)); |
| | | if (order.getInTime()!=null && StringUtils.isNotEmpty(order.getInUser())){ |
| | | |
| | | vos.add(new OrderNodeVo("处理中",order.getInUser(), userService.getDeptNameByUserId(order.getInId()), order.getInTime(), null)); |
| | | } |
| | | if (order.getResultTime()!=null){ |
| | | vos.add(new OrderNodeVo("投诉结果",order.getExecuteUser(),order.getResultTime(), order.getComplaintResult())); |
| | | if (order.getComplaintStatus()==-1){ |
| | | vos.add(new OrderNodeVo("已驳回",order.getResultUser(),userService.getDeptNameByUserId(order.getResultId()),order.getResultTime(), order.getComplaintResult())); |
| | | } else { |
| | | vos.add(new OrderNodeVo("已办结",order.getResultUser(),userService.getDeptNameByUserId(order.getResultId()),order.getResultTime(), order.getComplaintResult())); |
| | | } |
| | | } |
| | | return vos; |
| | | } |
| | |
| | | @Transactional |
| | | public Boolean inComplaint(ComplaintResultBo bo) |
| | | { |
| | | SysUser loginUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser loginUser = userService.selectUserById(SecurityUtils.getUserId()); |
| | | return this.update(lu() |
| | | .set(EnforceComplaintLog::getInId,loginUser.getUserId()) |
| | | .set(EnforceComplaintLog::getInUser,loginUser.getNickName()) |
| | |
| | | if (StringUtils.isEmpty(bo.getResult())){ |
| | | throw new BaseException("请填写处理结果"); |
| | | } |
| | | SysUser loginUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser loginUser = userService.selectUserById(SecurityUtils.getUserId()); |
| | | return this.update(lu() |
| | | .set(EnforceComplaintLog::getResultId,loginUser.getUserId()) |
| | | .set(EnforceComplaintLog::getResultUser,loginUser.getNickName()) |
| | | .set(EnforceComplaintLog::getResultTime, DateUtils.getNowDate()) |
| | | .set(EnforceComplaintLog::getComplaintStatus, bo.getComplaintStatus()) |
| | | .set(EnforceComplaintLog::getComplaintResult, bo.getResult()) |
| | | .eq(EnforceComplaintLog::getId, bo.getId()) |
| | | ); |
| | |
| | | if (StringUtils.isEmpty(entity.getExecuteDeptName()) && entity.getExecuteDeptName()!=null){ |
| | | entity.setExecuteDeptName(deptService.getDeptAllName(entity.getExecuteDeptId())); |
| | | } |
| | | if (entity.getCompanyId()==null |
| | | || StringUtils.isEmpty(entity.getCompanyName()) |
| | | || StringUtils.isEmpty(entity.getCompanyUser()) |
| | | || StringUtils.isEmpty(entity.getCompanyPhone()) |
| | | ){ |
| | | throw new BaseException("投诉企业不能为空!"); |
| | | } |
| | | if (entity.getExecuteDeptId() == null |
| | | || StringUtils.isEmpty(entity.getExecuteDeptName()) |
| | | ){ |
| | | throw new BaseException("投诉单位不能为空!"); |
| | | } |
| | | if (StringUtils.isEmpty(entity.getComplaintType())){ |
| | | throw new BaseException("请选择要投诉类型!"); |
| | | } |
| | | if (StringUtils.isEmpty(entity.getComplaintReason())){ |
| | | throw new BaseException("请填写投诉内容!"); |
| | | } |
| | | if (entity.getId()==null){ |
| | | if (entity.getCompanyId()==null |
| | | || StringUtils.isEmpty(entity.getCompanyName()) |
| | | || StringUtils.isEmpty(entity.getCompanyUser()) |
| | | || StringUtils.isEmpty(entity.getCompanyPhone()) |
| | | ){ |
| | | throw new BaseException("投诉企业不能为空!"); |
| | | } |
| | | // if (entity.getExecuteDeptId() == null |
| | | // || StringUtils.isEmpty(entity.getExecuteDeptName()) |
| | | // ){ |
| | | // throw new BaseException("投诉单位不能为空!"); |
| | | // } |
| | | if (StringUtils.isEmpty(entity.getComplaintType())){ |
| | | throw new BaseException("请选择要投诉类型!"); |
| | | } |
| | | if (StringUtils.isEmpty(entity.getComplaintReason())){ |
| | | throw new BaseException("请填写投诉内容!"); |
| | | } |
| | | |
| | | if (entity.getOrderId()!=null){ //执法单投诉 |
| | | int count = this.count(lq().eq(EnforceComplaintLog::getOrderId, entity.getOrderId())); |
| | | if (count >0){ |