提交 9ca4b9eb authored 作者: liuhaiquan's avatar liuhaiquan

commit

上级 3d69548d
package com.clx.performance.param.pc.customer;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PageCustomerComplaintDetailParam extends PageParam {
@ApiModelProperty("司机姓名")
private String driverName; //司机姓名
@ApiModelProperty("联系方式")
private String driverMobile; //司机手机号
@ApiModelProperty("运单编号")
private String childNo; //运单编号
@ApiModelProperty("投诉类型id")
private Integer complaintTypeId; //投诉类型id
@ApiModelProperty(value = "开始时间", example = "")
private String beginTime;
@ApiModelProperty(value = "结束时间", example = "")
private String endTime;
}
package com.clx.performance.param.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* @ClassName saveCustomerComplaintDetailParam
* @Description
* @Author kavin
* @Date 2023/12/8 13:52
* @Version 1.0
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SaveCustomerComplaintDetailParam {
@NotNull(message = "投诉类型ID不能为空")
@ApiModelProperty("投诉类型ID")
private Integer complaintTypeId; //投诉类型id
@ApiModelProperty("运单编号")
private String childNo; //运单编号
@Size(min=1 ,max = 1000)
@ApiModelProperty("运单编号")
private String content; //问题描述
}
package com.clx.performance.vo.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
/**
* @ClassName CustomerComplaintTypeVO
* @Description
* @Author kavin
* @Date 2023/12/7 11:42
* @Version 1.0
*/
@Getter
@Setter
public class CustomerComplaintDetailVO {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("司机用户编号")
private Long driverUserNo; //司机用户编号
@ApiModelProperty("司机姓名")
private String driverName; //司机姓名
@ApiModelProperty("司机手机号")
private String driverMobile; //司机手机号
@ApiModelProperty("运单编号")
private String childNo; //运单编号
@ApiModelProperty("投诉类型id")
private Integer complaintTypeId; //投诉类型id
@ApiModelProperty("问题描述")
private String content; //问题描述
@ApiModelProperty("创建时间")
private LocalDateTime createTime; //创建时间
}
package com.clx.performance.controller.pc.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.param.pc.customer.SaveCustomerComplaintDetailParam;
import com.clx.performance.service.customer.CustomerComplaintDetailService;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.common.base.PageData;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName CustomerComplaintTypeController
* @Description
* @Author kavin
* @Date 2023/12/7 10:44
* @Version 1.0
*/
@Slf4j
@RestController
@RequestMapping(value="/pc/carrier/customer/complaint/type")
@Validated
@Api(tags = "客服-投诉详情")
@AllArgsConstructor
public class CustomerComplaintDetailController {
private final CustomerComplaintDetailService customerComplaintDetailService;
@ApiOperation(value = "保存客户投诉",notes = "<br>By:刘海泉")
@PostMapping("/saveCustomerComplaintDetail")
public Result<Object> saveCustomerComplaintDetail(@RequestBody @Validated SaveCustomerComplaintDetailParam param){
customerComplaintDetailService.saveCustomerComplaintDetail(param);
return Result.ok();
}
@ApiOperation(value = "投诉详情列表",notes = "<br>By:刘海泉")
@PostMapping("/pageCustomerComplaintDetail")
public Result<PageData<CustomerComplaintDetailVO>> pageCustomerComplaintDetail(@RequestBody @Validated PageCustomerComplaintDetailParam param){
IPage<CustomerComplaintDetailVO> page = customerComplaintDetailService.pageCustomerComplaintDetail(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
}
...@@ -29,7 +29,7 @@ import java.util.List; ...@@ -29,7 +29,7 @@ import java.util.List;
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping(value="/pc/carrier/customer/complaint") @RequestMapping(value="/pc/carrier/customer/complaint/type")
@Validated @Validated
@Api(tags = "客服-投诉分类") @Api(tags = "客服-投诉分类")
@AllArgsConstructor @AllArgsConstructor
...@@ -39,7 +39,7 @@ public class CustomerComplaintTypeController { ...@@ -39,7 +39,7 @@ public class CustomerComplaintTypeController {
@ApiOperation(value = "保存/更新投诉分类",notes = "<br>By:刘海泉") @ApiOperation(value = "保存/更新投诉分类",notes = "<br>By:刘海泉")
@PostMapping("/pageCarrierOrderChildList") @PostMapping("/saveCustomerComplaintType")
public Result<Object> saveCustomerComplaintType(@RequestBody @Validated SaveComplaintTypeParam param){ public Result<Object> saveCustomerComplaintType(@RequestBody @Validated SaveComplaintTypeParam param){
customerComplaintTypeService.saveCustomerComplaintType(param); customerComplaintTypeService.saveCustomerComplaintType(param);
return Result.ok(); return Result.ok();
......
package com.clx.performance.dao.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.mapper.customer.CustomerComplaintDetailMapper;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.msl.common.dao.BaseDao;
public interface CustomerComplaintDetailDao extends BaseDao<CustomerComplaintDetailMapper, CustomerComplaintDetail, Integer> {
IPage<CustomerComplaintDetail> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param);
}
package com.clx.performance.dao.impl.customer;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.customer.CustomerComplaintDetailDao;
import com.clx.performance.mapper.customer.CustomerComplaintDetailMapper;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import java.util.Objects;
/**
* @ClassName CustomerComplaintTypeDaoImpl
* @Description
* @Author kavin
* @Date 2023/12/7 11:25
* @Version 1.0
*/
@Repository
public class CustomerComplaintDetailDaoImpl extends BaseDaoImpl<CustomerComplaintDetailMapper, CustomerComplaintDetail, Integer> implements CustomerComplaintDetailDao {
@Override
public IPage<CustomerComplaintDetail> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param) {
LambdaQueryWrapper<CustomerComplaintDetail> query = new LambdaQueryWrapper<>();
if(Objects.nonNull(param.getComplaintTypeId())){
query.eq(CustomerComplaintDetail :: getComplaintTypeId,param.getComplaintTypeId());
}
if(StringUtils.isNotBlank(param.getChildNo())){
query.eq(CustomerComplaintDetail :: getChildNo,param.getChildNo());
}
if(StringUtils.isNotBlank(param.getDriverMobile())){
query.eq(CustomerComplaintDetail :: getDriverMobile,param.getDriverMobile());
}
if(StringUtils.isNotBlank(param.getDriverName())){
query.eq(CustomerComplaintDetail :: getDriverName,param.getDriverName());
}
if(StringUtils.isNotBlank(param.getBeginTime())){
query.ge(CustomerComplaintDetail :: getCreateTime,param.getBeginTime());
}
if(StringUtils.isNotBlank(param.getEndTime())){
query.le(CustomerComplaintDetail :: getCreateTime,param.getEndTime());
}
query.orderByDesc(CustomerComplaintDetail :: getCreateTime);
return baseMapper.selectPage(Page.of(param.getPage(),param.getPageSize()),query);
}
}
package com.clx.performance.mapper.customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.customer.CustomerComplaintDetail;
public interface CustomerComplaintDetailMapper extends BaseMapper<CustomerComplaintDetail> {
}
package com.clx.performance.model.customer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
/**
* @ClassName CustomerComplaintType
* @Description
* @Author kavin
* @Date 2023/12/7 10:54
* @Version 1.0
*/
@Getter
@Setter
@NoArgsConstructor
@TableName(autoResultMap = true)
public class CustomerComplaintDetail implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long driverUserNo; //司机用户编号
private String driverName; //司机姓名
private String driverMobile; //司机手机号
private String childNo; //运单编号
private Integer complaintTypeId; //投诉类型id
private String content; //问题描述
private LocalDateTime createTime; //创建时间
private LocalDateTime modifiedTime; //修改时间
@KeyColumn("id")
@Override
public Integer gainKey() {
return id;
}
}
package com.clx.performance.service.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.param.pc.customer.SaveCustomerComplaintDetailParam;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
public interface CustomerComplaintDetailService {
void saveCustomerComplaintDetail(SaveCustomerComplaintDetailParam param);
IPage<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param);
}
package com.clx.performance.service.customer.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.dao.customer.CustomerComplaintDetailDao;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.param.pc.customer.SaveCustomerComplaintDetailParam;
import com.clx.performance.service.customer.CustomerComplaintDetailService;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @ClassName CustomerComplaintTypeServiceImpl
* @Description
* @Author kavin
* @Date 2023/12/7 10:51
* @Version 1.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class CustomerComplaintDetailServiceImpl implements CustomerComplaintDetailService {
private final CustomerComplaintDetailDao customerComplaintDetailDao;
@Override
public void saveCustomerComplaintDetail(SaveCustomerComplaintDetailParam param) {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
CustomerComplaintDetail detail = new CustomerComplaintDetail();
detail.setDriverUserNo(loginUserInfo.getUserNo());
detail.setDriverName(loginUserInfo.getUserName());
detail.setDriverMobile(loginUserInfo.getUserMobile());
detail.setChildNo(param.getChildNo());
detail.setComplaintTypeId(param.getComplaintTypeId());
detail.setContent(param.getContent());
customerComplaintDetailDao.saveEntity(detail);
}
@Override
public IPage<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param) {
IPage<CustomerComplaintDetail> page = customerComplaintDetailDao.pageCustomerComplaintDetail(param);
return null;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论