Commit 16668fc0 authored by zhengyi's avatar zhengyi

客户详情获取重构

parent a2a108af
...@@ -63,49 +63,8 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> { ...@@ -63,49 +63,8 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
List<CustomerDO> searchCustomer(@Param("reqVO") CustomerSelectReqVO customerSelectReqVO); List<CustomerDO> searchCustomer(@Param("reqVO") CustomerSelectReqVO customerSelectReqVO);
@ResultType(CustomerDetailRespVO.class)
@Select({
"<script>",
"select c.*, ",
"cl.name_zh as vip_level_name_zh, cl.name_en as vip_level_name_en, ",
"",
"cc.name_zh as credit_level_name_zh, cc.name_en as credit_level_name_en,",
"",
"country.name_zh as country_name_zh, country.name_en as country_name_en,",
"",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_product_type pt WHERE FIND_IN_SET(pt.id,(SELECT product_types FROM ecw_customer WHERE id=c.id))) AS product_type_name_zh, ",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_product_type pt WHERE FIND_IN_SET(pt.id,(SELECT product_types FROM ecw_customer WHERE id=c.id))) AS product_type_name_en, ",
"",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_product p WHERE FIND_IN_SET(p.id,(SELECT product_ids FROM ecw_customer WHERE id=c.id))) AS product_name_zh, ",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_product p WHERE FIND_IN_SET(p.id,(SELECT product_ids FROM ecw_customer WHERE id=c.id))) AS product_name_en, ",
"",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_zh,",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_en,",
"",
"(SELECT GROUP_CONCAT(name_zh) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_zh,",
"(SELECT GROUP_CONCAT(name_en) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_en,",
"",
"(SELECT GROUP_CONCAT(name) FROM ecw_customer_competitor ccp WHERE FIND_IN_SET(ccp.id,(SELECT competitor_ids FROM ecw_customer WHERE id=c.id))) AS competitor_names,",
"",
"uc.nickname as creator_name,",
"uu.nickname as updater_name,",
"",
"c.customer_service,",
"u.nickname as customer_service_name",
"",
"from ecw_customer c",
"left join ecw_customer_level cl on c.level = cl.id",
"left join ecw_customer_credit cc on c.credit_level = cc.id",
"left join ecw_country country on c.country = country.id",
"left join system_user u on c.customer_service = u.id",
"left join system_user uc on c.creator = uc.id",
"left join system_user uu on c.updater = uu.id",
"where c.id = #{id}",
"</script>"
})
CustomerDetailRespVO getCustomerDetailRespVO(@Param("id") Long id); CustomerDetailRespVO getCustomerDetailRespVO(@Param("id") Long id);
List<CustomerDO> getMyCustomerList(@Param("loginUserId") Long loginUserId); List<CustomerDO> getMyCustomerList(@Param("loginUserId") Long loginUserId);
......
...@@ -1098,7 +1098,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, ...@@ -1098,7 +1098,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
@Override @Override
public CustomerDetailRespVO getCustomerDetailRespVO(Long id) { public CustomerDetailRespVO getCustomerDetailRespVO(Long id) {
return customerMapper.getCustomerDetailRespVO(id); CustomerDetailRespVO respVO = customerMapper.getCustomerDetailRespVO(id);
return respVO;
} }
@Override @Override
......
package cn.iocoder.yudao.module.customer.vo.customer.vo; package cn.iocoder.yudao.module.customer.vo.customer.vo;
import cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankBackVO; import cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankBackVO;
import cn.iocoder.yudao.module.product.vo.product.ProductRespVO;
import cn.iocoder.yudao.module.product.vo.product.ProductTypeRespVO;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -306,8 +308,11 @@ public class CustomerDetailRespVO extends CustomerBaseVO { ...@@ -306,8 +308,11 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "竞争对手名称") @ApiModelProperty(value = "竞争对手名称")
private String competitorNames; private String competitorNames;
@ApiModelProperty(value = "选中的主营产品")
private List<ProductRespVO> productList;
@ApiModelProperty(value = "选中的主营产品类型")
private List<ProductTypeRespVO> productTypeList;
@ApiModelProperty(value = "付款人姓名") @ApiModelProperty(value = "付款人姓名")
private String payerName; private String payerName;
......
package cn.iocoder.yudao.module.product.vo.product;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 商品类型 Base VO,提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class ProductTypeBaseVO {
@ApiModelProperty(value = "中文标题", required = true)
@NotNull(message = "中文标题不能为空")
private String titleZh;
@ApiModelProperty(value = "英文标题", required = true)
@NotNull(message = "英文标题不能为空")
private String titleEn;
@ApiModelProperty(value = "排序", required = true)
@NotNull(message = "排序不能为空")
private Integer sort;
@ApiModelProperty(value = "是否展示 默认为展示")
private Integer status;
}
package cn.iocoder.yudao.module.product.vo.product;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
@ApiModel("管理后台 - 商品类型 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductTypeRespVO extends ProductTypeBaseVO {
@ApiModelProperty(value = "", required = true)
private Long id;
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
private Long productNum;
public Long getProductNum() {
if(productNum == null) return 0L;
return productNum;
}
}
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