提交 877267d3 authored 作者: liuhaiquan's avatar liuhaiquan

Merge branch 'v7.8_listenAndComplaint_20231208' into test

# Conflicts: # performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java
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 com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PageCustomerComplaintTypeParam extends PageParam {
@ApiModelProperty("名称")
private String name;
}
package com.clx.performance.param.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* @ClassName SaveComplaintTypeParam
* @Description
* @Author kavin
* @Date 2023/12/7 10:46
* @Version 1.0
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SaveComplaintTypeParam {
private Integer id;
@Size(min=1 ,max = 10)
@NotBlank(message = "分类名称不能为空")
@ApiModelProperty(value = "分类名称")
private String name;
}
package com.clx.performance.param.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
/**
* @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; //问题描述
@ApiModelProperty("图片")
private List<String> picture; //图片
}
package com.clx.performance.vo.app;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* @ClassName CustomerComplaintOrderChildVO
* @Description
* @Author kavin
* @Date 2023/12/7 17:55
* @Version 1.0
*/
@Getter
@Setter
@ToString
@NoArgsConstructor
public class CustomerComplaintOrderChildVO {
@ApiModelProperty(value = "id", example = "1")
private Integer id;
@ApiModelProperty(value = "运单编号", example = "100000000")
private String childNo;
@ApiModelProperty(value = "货单编号", example = "100000000")
private String orderGoodsNo;
@ApiModelProperty(value = "订单编号", example = "10000000000")
private String orderNo;
@ApiModelProperty(value = "发货地址", example = "朝阳")
private String sendAddress;
@ApiModelProperty(value = "收货地址", example = "西城")
private String receiveAddress;
@ApiModelProperty(value = "车牌号", example = "京A12345")
private String truckNo;
@ApiModelProperty(value = "司机姓名", example = "张三")
private String driverName;
@ApiModelProperty(value = "接单时间", example = "2023-12-12 12:12:12")
private String createTime; //创建时间
@ApiModelProperty(value = "状态", example = "10")
private Integer status; //状态
@ApiModelProperty(value = "状态信息", example = "接单")
private String statusMsg;
}
package com.clx.performance.vo.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* @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 name; //投诉类型名称
@ApiModelProperty("问题描述")
private String content; //问题描述
@ApiModelProperty("图片字符串")
private String picture; //图片
@ApiModelProperty("图片集合")
private List<String> pictureList; //图片集合
@ApiModelProperty("创建时间")
private String createTime; //创建时间
}
package com.clx.performance.vo.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* @ClassName CustomerComplaintTypeVO
* @Description
* @Author kavin
* @Date 2023/12/7 11:42
* @Version 1.0
*/
@Getter
@Setter
public class CustomerComplaintTypeVO {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("投诉类型名称")
private String name; //投诉类型名称
@ApiModelProperty("创建时间")
private String createTime; //创建时间
@ApiModelProperty("最后编辑时间")
private String modifiedTime; //修改时间
}
......@@ -5,6 +5,7 @@ import com.clx.performance.param.app.*;
import com.clx.performance.service.OrderChildService;
import com.clx.performance.vo.app.*;
import com.msl.common.base.PageData;
import com.msl.common.base.PageParam;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
......@@ -174,4 +175,11 @@ public class AppDriverOrderChildController {
return Result.ok(orderChildService.getGoingLatestOrderChild());
}
@ApiOperation(value = "客诉运单列表", notes = "<br>By:刘海泉")
@PostMapping("/pageCustomerComplaintOrderChild")
public Result<PageData<CustomerComplaintOrderChildVO>> pageCustomerComplaintOrderChild(@RequestBody @Validated PageParam param) {
IPage<CustomerComplaintOrderChildVO> page = orderChildService.pageCustomerComplaintOrderChild(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
}
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());
}
}
package com.clx.performance.controller.pc.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.clx.performance.param.pc.customer.SaveComplaintTypeParam;
import com.clx.performance.service.customer.CustomerComplaintTypeService;
import com.clx.performance.vo.pc.customer.CustomerComplaintTypeVO;
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;
import java.util.List;
/**
* @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 CustomerComplaintTypeController {
private final CustomerComplaintTypeService customerComplaintTypeService;
@ApiOperation(value = "保存/更新投诉分类",notes = "<br>By:刘海泉")
@PostMapping("/saveCustomerComplaintType")
public Result<Object> saveCustomerComplaintType(@RequestBody @Validated SaveComplaintTypeParam param){
customerComplaintTypeService.saveCustomerComplaintType(param);
return Result.ok();
}
@ApiOperation(value = "投诉分类列表",notes = "<br>By:刘海泉")
@PostMapping("/pageCustomerComplaintType")
public Result<PageData<CustomerComplaintTypeVO>> pageCustomerComplaintType(@RequestBody @Validated PageCustomerComplaintTypeParam param){
IPage<CustomerComplaintTypeVO> page = customerComplaintTypeService.pageCustomerComplaintType(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "投诉分类下拉选",notes = "<br>By:刘海泉")
@PostMapping("/getCustomerComplaintTypeSelect")
public Result<List<CustomerComplaintTypeVO>> getCustomerComplaintTypeSelect(@RequestBody @Validated PageCustomerComplaintTypeParam param){
List<CustomerComplaintTypeVO> list = customerComplaintTypeService.getCustomerComplaintTypeSelect(param);
return Result.ok(list);
}
}
......@@ -11,6 +11,7 @@ import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.PageCarrierOrderChildVO;
import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO;
import com.msl.common.base.Optional;
import com.msl.common.base.PageParam;
import com.msl.common.dao.BaseDao;
import org.apache.ibatis.annotations.Param;
......@@ -160,4 +161,6 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int
List<OrderChild> selectListWithEmptyCarList();
Page<OrderChild> getMonthAgoByUserNo(Long userNo, LocalDateTime monthAgo, PageParam param);
}
package com.clx.performance.dao.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.mapper.customer.CustomerComplaintDetailMapper;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.common.dao.BaseDao;
public interface CustomerComplaintDetailDao extends BaseDao<CustomerComplaintDetailMapper, CustomerComplaintDetail, Integer> {
Page<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param);
}
package com.clx.performance.dao.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.mapper.customer.CustomerComplaintTypeMapper;
import com.clx.performance.model.customer.CustomerComplaintType;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.msl.common.dao.BaseDao;
import java.util.List;
public interface CustomerComplaintTypeDao extends BaseDao<CustomerComplaintTypeMapper, CustomerComplaintType, Integer> {
long countByNameExcludeSelf(String name, Integer id);
Page<CustomerComplaintType> pageCustomerComplaintType(PageCustomerComplaintTypeParam param);
List<CustomerComplaintType> getCustomerComplaintTypeSelect(PageCustomerComplaintTypeParam param);
}
......@@ -16,6 +16,7 @@ import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.PageCarrierOrderChildVO;
import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO;
import com.msl.common.base.Optional;
import com.msl.common.base.PageParam;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
......@@ -505,4 +506,12 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
);
}
@Override
public Page<OrderChild> getMonthAgoByUserNo(Long userNo, LocalDateTime monthAgo, PageParam param) {
LambdaQueryWrapper<OrderChild> query = new LambdaQueryWrapper<>();
query.eq(OrderChild :: getDriverUserNo,userNo).or().eq(OrderChild :: getTruckOwnUserNo,userNo);
query.ge(OrderChild :: getCreateTime,monthAgo);
query.orderByDesc(OrderChild :: getCreateTime);
return baseMapper.selectPage(Page.of(param.getPage(), param.getPageSize()),query);
}
}
package com.clx.performance.dao.impl.customer;
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.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
/**
* @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 Page<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param) {
return baseMapper.pageCustomerComplaintDetail(Page.of(param.getPage(), param.getPageSize()),param);
}
}
package com.clx.performance.dao.impl.customer;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.customer.CustomerComplaintTypeDao;
import com.clx.performance.mapper.customer.CustomerComplaintTypeMapper;
import com.clx.performance.model.customer.CustomerComplaintType;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Objects;
/**
* @ClassName CustomerComplaintTypeDaoImpl
* @Description
* @Author kavin
* @Date 2023/12/7 11:25
* @Version 1.0
*/
@Repository
public class CustomerComplaintTypeDaoImpl extends BaseDaoImpl<CustomerComplaintTypeMapper, CustomerComplaintType, Integer> implements CustomerComplaintTypeDao {
@Override
public long countByNameExcludeSelf(String name, Integer id) {
LambdaQueryWrapper<CustomerComplaintType> query = new LambdaQueryWrapper<>();
query.eq(CustomerComplaintType :: getName,name);
if(Objects.nonNull(id)){
query.ne(CustomerComplaintType :: getId,id);
}
return baseMapper.selectCount(query);
}
@Override
public Page<CustomerComplaintType> pageCustomerComplaintType(PageCustomerComplaintTypeParam param) {
LambdaQueryWrapper<CustomerComplaintType> query = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(param.getName())){
query.eq(CustomerComplaintType :: getName,param.getName());
}
query.orderByDesc(CustomerComplaintType :: getModifiedTime);
return baseMapper.selectPage(Page.of(param.getPage(),param.getPageSize()),query);
}
@Override
public List<CustomerComplaintType> getCustomerComplaintTypeSelect(PageCustomerComplaintTypeParam param) {
LambdaQueryWrapper<CustomerComplaintType> query = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(param.getName())){
query.eq(CustomerComplaintType :: getName,param.getName());
}
query.orderByDesc(CustomerComplaintType :: getModifiedTime);
return baseMapper.selectList(query);
}
}
package com.clx.performance.mapper.customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.sqlProvider.customer.CustomerComplaintDetailSqlProvider;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
public interface CustomerComplaintDetailMapper extends BaseMapper<CustomerComplaintDetail> {
@SelectProvider(type = CustomerComplaintDetailSqlProvider.class, method = "pageCustomerComplaintDetail")
Page<CustomerComplaintDetailVO> pageCustomerComplaintDetail(@Param("page") Page<CustomerComplaintDetailVO> page , @Param("param") PageCustomerComplaintDetailParam param);
}
package com.clx.performance.mapper.customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.customer.CustomerComplaintType;
public interface CustomerComplaintTypeMapper extends BaseMapper<CustomerComplaintType> {
}
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 String picture; //图片
private String createTime; //创建时间
private String modifiedTime; //修改时间
@KeyColumn("id")
@Override
public Integer gainKey() {
return id;
}
}
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 CustomerComplaintType implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String name; //投诉类型名称
private LocalDateTime createTime; //创建时间
private LocalDateTime modifiedTime; //修改时间
@KeyColumn("id")
@Override
public Integer gainKey() {
return id;
}
}
package com.clx.performance.service;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
......@@ -12,11 +10,10 @@ import com.clx.performance.param.pc.PageMonitorOrderChildQCParam;
import com.clx.performance.param.pc.PagePoundAuditParam;
import com.clx.performance.vo.app.*;
import com.clx.performance.vo.pc.*;
import com.clx.user.vo.pc.driver.truck.DriverTruckVo;
import com.msl.common.base.PageParam;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
/**
......@@ -90,4 +87,5 @@ public interface OrderChildService {
void updateOrderGoodsAmountLoad(OrderGoods orderGoods,String childNo, BigDecimal dif, Integer orderGoodsStatus);
IPage<CustomerComplaintOrderChildVO> pageCustomerComplaintOrderChild(PageParam param);
}
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;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.clx.performance.param.pc.customer.SaveComplaintTypeParam;
import com.clx.performance.vo.pc.customer.CustomerComplaintTypeVO;
import java.util.List;
public interface CustomerComplaintTypeService {
void saveCustomerComplaintType(SaveComplaintTypeParam param);
Page<CustomerComplaintTypeVO> pageCustomerComplaintType(PageCustomerComplaintTypeParam param);
List<CustomerComplaintTypeVO> getCustomerComplaintTypeSelect(PageCustomerComplaintTypeParam param);
}
package com.clx.performance.service.customer.impl;
import cn.hutool.core.collection.CollectionUtil;
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.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.struct.customer.CustomerComplaintDetailStruct;
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.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Arrays;
/**
* @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;
private final CustomerComplaintDetailStruct customerComplaintDetailStruct;
@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());
if(CollectionUtil.isNotEmpty(param.getPicture())){
detail.setPicture(String.join(",",param.getPicture()));
}
customerComplaintDetailDao.saveEntity(detail);
}
@Override
public IPage<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param) {
Page<CustomerComplaintDetailVO> page = customerComplaintDetailDao.pageCustomerComplaintDetail(param);
if(CollectionUtil.isNotEmpty(page.getRecords())){
page.getRecords().forEach(item->{
if(StringUtils.isNotBlank(item.getPicture())){
item.setPictureList(Arrays.asList(item.getPicture().split(",")));
}
});
}
return page;
}
}
package com.clx.performance.service.customer.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.customer.CustomerComplaintTypeDao;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.model.customer.CustomerComplaintType;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.clx.performance.param.pc.customer.SaveComplaintTypeParam;
import com.clx.performance.service.customer.CustomerComplaintTypeService;
import com.clx.performance.struct.customer.CustomerComplaintTypeStruct;
import com.clx.performance.vo.pc.customer.CustomerComplaintTypeVO;
import com.msl.common.exception.ServiceSystemException;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @ClassName CustomerComplaintTypeServiceImpl
* @Description
* @Author kavin
* @Date 2023/12/7 10:51
* @Version 1.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class CustomerComplaintTypeServiceImpl implements CustomerComplaintTypeService {
private final CustomerComplaintTypeDao customerComplaintTypeDao;
private final CustomerComplaintTypeStruct customerComplaintTypeStruct;
@Override
public void saveCustomerComplaintType(SaveComplaintTypeParam param) {
long count = customerComplaintTypeDao.countByNameExcludeSelf(param.getName(),param.getId());
if(count > 0 ){
throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND,"分类名称重复");
}
if(Objects.isNull(param.getId())){ // 新增
CustomerComplaintType insert = new CustomerComplaintType();
insert.setName(param.getName());
customerComplaintTypeDao.saveEntity(insert);
}else{ //更新
CustomerComplaintType update = new CustomerComplaintType();
update.setId(param.getId());
update.setName(param.getName());
customerComplaintTypeDao.updateEntityByKey(update);
}
}
@Override
public Page<CustomerComplaintTypeVO> pageCustomerComplaintType(PageCustomerComplaintTypeParam param) {
Page<CustomerComplaintType> page = customerComplaintTypeDao.pageCustomerComplaintType(param);
Page<CustomerComplaintTypeVO> result = new Page<>();
if(CollectionUtil.isNotEmpty(page.getRecords())){
result.setRecords(customerComplaintTypeStruct.convertList(page.getRecords()));
result.setTotal(page.getTotal());
result.setPages(page.getPages());
}
return result;
}
@Override
public List<CustomerComplaintTypeVO> getCustomerComplaintTypeSelect(PageCustomerComplaintTypeParam param) {
List<CustomerComplaintType> list = customerComplaintTypeDao.getCustomerComplaintTypeSelect(param);
return customerComplaintTypeStruct.convertList(list);
}
}
......@@ -17,10 +17,7 @@ import com.clx.performance.dto.gd.GdRouteDTO;
import com.clx.performance.dto.payment.WalletResidueCardDTO;
import com.clx.performance.dto.zjxl.TruckTraceDTO;
import com.clx.performance.enums.*;
import com.clx.performance.extranal.user.AddressService;
import com.clx.performance.extranal.user.DriverService;
import com.clx.performance.extranal.user.OrderService;
import com.clx.performance.extranal.user.OwnerInfoService;
import com.clx.performance.extranal.user.*;
import com.clx.performance.feign.FeignPaymentService;
import com.clx.performance.model.*;
import com.clx.performance.model.breakcontract.BreakContractDriverRecord;
......@@ -45,6 +42,7 @@ import com.clx.user.enums.driver.DriverInfoEnum;
import com.clx.user.vo.feign.DriverTruckInfoFeignVo;
import com.clx.user.vo.feign.OwnerInfoFeignVO;
import com.msl.common.base.Optional;
import com.msl.common.base.PageParam;
import com.msl.common.enums.ResultCodeEnum;
import com.msl.common.exception.ServiceSystemException;
import com.msl.common.result.Result;
......@@ -164,6 +162,9 @@ public class OrderChildServiceImpl implements OrderChildService {
@Autowired
private OwnerRunningWaterRecordDao ownerRunningWaterRecordDao;
@Autowired
private UserService userService;
@Override
public SaveOrderChildVO saveOrderChild(OrderChildSaveParam param) {
......@@ -2128,6 +2129,18 @@ public class OrderChildServiceImpl implements OrderChildService {
return gdRouteDTOS;
}
@Override
public IPage<CustomerComplaintOrderChildVO> pageCustomerComplaintOrderChild(PageParam param) {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
LocalDateTime monthAgo = LocalDateTime.now().minusMonths(1);
Page<OrderChild> page = orderChildDao.getMonthAgoByUserNo(loginUserInfo.getUserNo(),monthAgo,param);
Page<CustomerComplaintOrderChildVO> returnPage = orderChildStruct.covertPageCustomerComplaintOrderChildVO(
page);
if(CollectionUtils.isNotEmpty(returnPage.getRecords())){
returnPage.getRecords().forEach(item-> item.setStatusMsg(OrderChildEnum.Status.getMsgByCode(item.getStatus())));
}
return returnPage;
}
private static String formatTimeStr(Integer n) {
if (n > Long.MAX_VALUE) {
......
package com.clx.performance.sqlProvider.customer;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;
import java.util.Objects;
/**
* @ClassName CustomerComplaintDetailSqlProvider
* @Description
* @Author kavin
* @Date 2023/12/13 13:31
* @Version 1.0
*/
public class CustomerComplaintDetailSqlProvider {
public String pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param) {
return new SQL(){{
SELECT( " a.id, a.driver_user_no ,a.driver_name,a.driver_mobile,a.child_no," +
" a.complaint_type_id,a.content,a.picture,b.name," +
" date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as createTime, " +
" date_format(a.modified_time, '%Y-%m-%d %H:%i:%s') as modifiedTime ");
FROM("customer_complaint_detail a");
LEFT_OUTER_JOIN("customer_complaint_type b on a.complaint_type_id = b.id");
if(Objects.nonNull(param.getComplaintTypeId())){
WHERE("a.complaint_type_id = #{param.complaintTypeId}");
}
if(StringUtils.isNotBlank(param.getChildNo())){
WHERE("a.child_no = #{param.childNo}");
}
if(StringUtils.isNotBlank(param.getDriverMobile())){
WHERE("a.driver_mobile = #{param.driverMobile}");
}
if(StringUtils.isNotBlank(param.getDriverName())){
WHERE("a.driver_name = #{param.driverName}");
}
if(StringUtils.isNotBlank(param.getBeginTime())){
WHERE("a.create_time >= #{param.beginTime}");
}
if(StringUtils.isNotBlank(param.getEndTime())){
WHERE("a.create_time <= #{param.endTime}");
}
ORDER_BY("a.create_time desc");
}}.toString();
}
}
package com.clx.performance.struct;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.open.sdk.callback.message.OrderChildMessage;
import com.clx.performance.model.OrderChild;
import com.clx.performance.vo.app.CustomerComplaintOrderChildVO;
import com.clx.performance.vo.app.GoingOrderChildVO;
import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.CarrierOrderChildDetailVO;
......@@ -26,6 +28,5 @@ public interface OrderChildStruct {
OrderChildMessage convertMessage(OrderChild item);
Page<CustomerComplaintOrderChildVO> covertPageCustomerComplaintOrderChildVO(Page<OrderChild> page);
}
package com.clx.performance.struct.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.common.utils.DateStructUtil;
import com.msl.common.utils.DateUtils;
import org.mapstruct.Mapper;
@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class})
public interface CustomerComplaintDetailStruct {
Page<CustomerComplaintDetailVO> convertPage(Page<CustomerComplaintDetail> page);
}
package com.clx.performance.struct.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.customer.CustomerComplaintType;
import com.clx.performance.vo.pc.customer.CustomerComplaintTypeVO;
import com.msl.common.utils.DateStructUtil;
import com.msl.common.utils.DateUtils;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class})
public interface CustomerComplaintTypeStruct {
Page<CustomerComplaintTypeVO> convertPage(Page<CustomerComplaintType> page);
List<CustomerComplaintTypeVO> convertList(List<CustomerComplaintType> list);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论