Commit fd31b549 authored by lius's avatar lius

在goodsowner包下完成了货主联系客服的功能,

在carrier包下完成了司机联系客服的功能。
parent b8012e99
package com.esv.freight.customer.module.carrier.controller;
import com.esv.freight.customer.common.response.EResponse;
import com.esv.freight.customer.module.carrier.service.CarrierCustomerServiceService;
import com.esv.freight.customer.module.goodsowner.vo.CustomerServiceVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.carrier.controller.CarrierCustomerServiceController
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 17:27
* @version: 1.0
*/
@Slf4j
@RestController
@RequestMapping("/carrier")
@Validated
public class CarrierCustomerServiceController {
private CarrierCustomerServiceService serviceService;
@Autowired
public CarrierCustomerServiceController(CarrierCustomerServiceService serviceService) {
this.serviceService = serviceService;
}
/**
* description 获取司机客服电话
* param []
* return com.esv.freight.customer.common.response.EResponse
* author 刘胜
* createTime 2020/8/12 17:47
**/
@PostMapping("/customerservice")
public EResponse getDriverCustomer(){
CustomerServiceVO customerServiceVO =serviceService.getDriverCustomer();
return EResponse.ok(customerServiceVO);
}
}
package com.esv.freight.customer.module.carrier.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.esv.freight.customer.module.carrier.entity.CarrierCustomerServiceEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @description: 司机客服信息表
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.dao.CustomerServiceDao
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 15:25
* @version: 1.0
*/
@Mapper
public interface CarrierCustomerServiceDao extends BaseMapper<CarrierCustomerServiceEntity> {
}
package com.esv.freight.customer.module.carrier.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @description: 司机客服电话表
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.carrier.entity.DriverCustomerEntity
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 16:38
* @version: 1.0
*/
@Data
@TableName("driver_customer_service")
public class CarrierCustomerServiceEntity implements Serializable {
private static final long serialVersionUID = -5630139812015991171L;
/**
*
*/
@TableId
private Long id;
/**
* 租户ID
*/
@TableField(fill = FieldFill.INSERT)
private Long tenantId;
/**
* 部门ID
*/
@TableField(fill = FieldFill.INSERT)
private Long departmentId;
/**
* 客服手机号
*/
private String phone;
/**
* 创建者
*/
@TableField(fill = FieldFill.INSERT)
private String createUser;
/**
* 修改者
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private String updateUser;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}
package com.esv.freight.customer.module.carrier.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.esv.freight.customer.module.carrier.entity.CarrierCustomerServiceEntity;
import com.esv.freight.customer.module.goodsowner.vo.CustomerServiceVO;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.service.CustomerServiseService
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 15:16
* @version: 1.0
*/
public interface CarrierCustomerServiceService extends IService<CarrierCustomerServiceEntity> {
/**
* description 获取司机客服电话
* param []
* return com.esv.freight.customer.module.goodsowner.vo.CustomerServiceVO
* author 刘胜
* createTime 2020/8/12 15:19
**/
CustomerServiceVO getDriverCustomer();
}
package com.esv.freight.customer.module.carrier.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.esv.freight.customer.module.carrier.dao.CarrierCustomerServiceDao;
import com.esv.freight.customer.module.carrier.entity.CarrierCustomerServiceEntity;
import com.esv.freight.customer.module.carrier.service.CarrierCustomerServiceService;
import com.esv.freight.customer.module.goodsowner.entity.GoodsOwnerCustomerServiceEntity;
import com.esv.freight.customer.module.goodsowner.vo.CustomerServiceVO;
import org.springframework.stereotype.Service;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.service.impl.CustomerServiceServiceImpl
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 15:23
* @version: 1.0
*/
@Service("carrierCustomerServiceService")
public class CarrierCustomerServiceServiceImpl extends ServiceImpl<CarrierCustomerServiceDao, CarrierCustomerServiceEntity> implements CarrierCustomerServiceService {
@Override
public CustomerServiceVO getDriverCustomer() {
CarrierCustomerServiceEntity carrierCustomerServiceEntity=lambdaQuery()
.eq(CarrierCustomerServiceEntity::getTenantId, 2)
.one();
CustomerServiceVO customerServiceVO = new CustomerServiceVO();
customerServiceVO.setPhone(carrierCustomerServiceEntity.getPhone());
return customerServiceVO;
}
}
package com.esv.freight.customer.module.goodsowner.controller;
import com.esv.freight.customer.common.response.EResponse;
import com.esv.freight.customer.module.goodsowner.service.CustomerServiceService;
import com.esv.freight.customer.module.goodsowner.vo.CustomerServiceVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.controller.GoodsOwnerCustomerServiceController
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 15:35
* @version: 1.0
*/
@Slf4j
@RestController
@RequestMapping("/goodsowner")
@Validated
public class GoodsOwnerCustomerServiceController {
private CustomerServiceService serviceService;
@Autowired
public GoodsOwnerCustomerServiceController(CustomerServiceService serviceService) {
this.serviceService = serviceService;
}
/**
* description 获取货主客服电话
* param []
* return com.esv.freight.customer.common.response.EResponse
* author 刘胜
* createTime 2020/8/12 17:47
**/
@PostMapping("/customerservice")
public EResponse getGoodsCustomer(){
CustomerServiceVO customerServiceVO =serviceService.getGoodsCustomer();
return EResponse.ok(customerServiceVO);
}
}
package com.esv.freight.customer.module.goodsowner.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.esv.freight.customer.module.goodsowner.entity.GoodsOwnerCustomerServiceEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* @description: 货主客服信息表
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.dao.CustomerServiceDao
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 15:25
* @version: 1.0
*/
@Mapper
public interface CustomerServiceDao extends BaseMapper<GoodsOwnerCustomerServiceEntity> {
}
package com.esv.freight.customer.module.goodsowner.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @description: 货主客服电话表
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.entity.GoodsOwnerCustomerServiceEntity
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 15:03
* @version: 1.0
*/
@Data
@TableName("goods_owner_customer_service")
public class GoodsOwnerCustomerServiceEntity implements Serializable {
private static final long serialVersionUID = -823795391097137993L;
/**
*
*/
@TableId
private Long id;
/**
* 租户ID
*/
@TableField(fill = FieldFill.INSERT)
private Long tenantId;
/**
* 部门ID
*/
@TableField(fill = FieldFill.INSERT)
private Long departmentId;
/**
* 客服手机号
*/
private String phone;
/**
* 创建者
*/
@TableField(fill = FieldFill.INSERT)
private String createUser;
/**
* 修改者
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private String updateUser;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}
package com.esv.freight.customer.module.goodsowner.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.esv.freight.customer.module.goodsowner.entity.GoodsOwnerCustomerServiceEntity;
import com.esv.freight.customer.module.goodsowner.vo.CustomerServiceVO;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.service.CustomerServiseService
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 15:16
* @version: 1.0
*/
public interface CustomerServiceService extends IService<GoodsOwnerCustomerServiceEntity> {
/**
* description 获取货主客服电话
* param []
* return com.esv.freight.customer.module.goodsowner.vo.CustomerServiceVO
* author 刘胜
* createTime 2020/8/12 15:19
**/
CustomerServiceVO getGoodsCustomer();
}
package com.esv.freight.customer.module.goodsowner.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.esv.freight.customer.module.goodsowner.dao.CustomerServiceDao;
import com.esv.freight.customer.module.goodsowner.entity.GoodsOwnerCustomerServiceEntity;
import com.esv.freight.customer.module.goodsowner.service.CustomerServiceService;
import com.esv.freight.customer.module.goodsowner.vo.CustomerServiceVO;
import org.springframework.stereotype.Service;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.module.goodsowner.service.impl.CustomerServiceServiceImpl
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 15:23
* @version: 1.0
*/
@Service("goodsCustomerServiceService")
public class CustomerServiceServiceImpl extends ServiceImpl<CustomerServiceDao, GoodsOwnerCustomerServiceEntity> implements CustomerServiceService {
@Override
public CustomerServiceVO getGoodsCustomer() {
GoodsOwnerCustomerServiceEntity customerServiceEntity=lambdaQuery()
.eq(GoodsOwnerCustomerServiceEntity::getTenantId, 2)
.one();
CustomerServiceVO customerServiceVO = new CustomerServiceVO();
customerServiceVO.setPhone(customerServiceEntity.getPhone());
return customerServiceVO;
}
}
package com.esv.freight.customer.module.goodsowner.vo;
import lombok.Data;
/**
* @description: 客服电话VO
* @project: app-service
* @name: com.esv.freight.app.module.customerservice.vo.CustomerServiceVO
* @author: 刘胜
* @email: <liusheng@esvtek.com>
* @createTime: 2020/8/12 13:26
* @version: 1.0
*/
@Data
public class CustomerServiceVO {
/**
* 客服电话
*/
private String phone;
}
......@@ -3,14 +3,14 @@ server:
servlet:
context-path: /customer
nacos:
url: 119.3.171.225:8848
namespace: 38512237-cfe2-44e5-a6ba-df156723d7b6
group: TEST_GROUP
url: 192.168.31.248:8848
namespace: aad5aa26-5351-4e7a-a65e-ecb332f3c52c
group: DEFAULT_GROUP
spring:
application:
name: freight-customer-service
profiles:
active: test
active: dev
cloud:
nacos:
discovery:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment