| | |
| | | package com.panzhihua.sangeshenbian.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.sangeshenbian.annotation.DistributedLock; |
| | | import com.panzhihua.sangeshenbian.model.dto.*; |
| | | import com.panzhihua.sangeshenbian.model.entity.Complaint; |
| | | import com.panzhihua.sangeshenbian.model.entity.ComplaintAuditRecord; |
| | | import com.panzhihua.sangeshenbian.model.entity.ComplaintProgress; |
| | | import com.panzhihua.sangeshenbian.model.entity.ProblemType; |
| | | import com.panzhihua.sangeshenbian.model.entity.*; |
| | | import com.panzhihua.sangeshenbian.model.query.ComplaintQuery; |
| | | import com.panzhihua.sangeshenbian.model.vo.ComplaintVO; |
| | | import com.panzhihua.sangeshenbian.model.vo.DispatchVO; |
| | | import com.panzhihua.sangeshenbian.service.IComplaintCommentService; |
| | | import com.panzhihua.sangeshenbian.service.IComplaintService; |
| | | import com.panzhihua.sangeshenbian.service.IProblemTypeService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | private final IComplaintService complaintService; |
| | | private final IProblemTypeService problemTypeService; |
| | | private final IComplaintCommentService complaintCommentService; |
| | | @GetMapping("/problem-type/list") |
| | | @ApiOperation("获取诉求问题类型列表") |
| | | public R<List<ProblemType>> problemTypeList() { |
| | |
| | | public R<List<DispatchVO>> getDispatchList() { |
| | | return R.ok(complaintService.getDispatchList(getLoginUserInfo())); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 评价诉求 |
| | | * @param complaintComment |
| | | * @return |
| | | */ |
| | | @PostMapping("/commentComplaint") |
| | | @ApiOperation(value = "评价诉求") |
| | | public R<?> commentComplaint(@RequestBody ComplaintComment complaintComment){ |
| | | int count = complaintCommentService.count(new LambdaQueryWrapper<ComplaintComment>().eq(ComplaintComment::getComplaintId, complaintComment.getComplaintId()) |
| | | .eq(ComplaintComment::getDelFlag, 0)); |
| | | if(0 != count){ |
| | | return R.fail("不能重复评价"); |
| | | } |
| | | Long userId = getLoginUserInfo().getUserId(); |
| | | complaintComment.setUserId(userId); |
| | | complaintComment.setCreateTime(new Date()); |
| | | complaintComment.setCreateBy(userId); |
| | | complaintComment.setUpdateBy(userId); |
| | | complaintComment.setUpdateTime(new Date()); |
| | | complaintComment.setDelFlag(0); |
| | | complaintCommentService.save(complaintComment); |
| | | return R.ok(); |
| | | } |
| | | } |