wwl 4 years ago
parent
commit
b5138ceb18

+ 3 - 2
zzjs-admin/src/main/java/com/miaxis/pc/controller/customer/CustomerInfoController.java

@@ -8,6 +8,7 @@ import com.miaxis.common.enums.BusinessTypeEnum;
 import com.miaxis.common.utils.poi.ExcelUtil;
 import com.miaxis.customer.domain.CustomerInfo;
 import com.miaxis.customer.service.ICustomerInfoService;
+import com.miaxis.customer.vo.CustomerInfoVo;
 import io.swagger.annotations.*;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -65,11 +66,11 @@ public class CustomerInfoController extends BaseController {
     @PreAuthorize("@ss.hasPermi('customer:customer:query')")
     @GetMapping(value = "/{id}")
     @ApiOperation("获取客户信息详细信息")
-    public Response<CustomerInfo> getInfo(
+    public Response<CustomerInfoVo> getInfo(
             @ApiParam(name = "id", value = "客户信息参数", required = true)
             @PathVariable("id") Long id
     ) {
-        return Response.success(customerInfoService.getById(id));
+        return customerInfoService.getCustomerById(id);
     }
 
     /**

+ 8 - 0
zzjs-service/src/main/java/com/miaxis/customer/mapper/CustomerInfoMapper.java

@@ -3,6 +3,8 @@ package com.miaxis.customer.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.miaxis.customer.domain.CustomerInfo;
+import com.miaxis.customer.vo.CustomerInfoVo;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 客户信息Mapper接口
@@ -20,4 +22,10 @@ public interface CustomerInfoMapper extends BaseMapper<CustomerInfo> {
      */
     List<CustomerInfo> selectCustomerInfoList(CustomerInfo customerInfo);
 
+    /**
+     * 获取客户信息详细信息
+     * @param id
+     * @return
+     */
+    CustomerInfoVo getCustomerById(@Param("id") Long id);
 }

+ 8 - 0
zzjs-service/src/main/java/com/miaxis/customer/service/ICustomerInfoService.java

@@ -5,6 +5,7 @@ import java.util.List;
 import com.miaxis.common.core.domain.Response;
 import com.miaxis.customer.domain.CustomerInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.customer.vo.CustomerInfoVo;
 
 /**
  * 客户信息Service接口
@@ -36,4 +37,11 @@ public interface ICustomerInfoService extends IService<CustomerInfo>{
      * @return
      */
     Response removeCustomerByIds(Long[] ids);
+
+    /**
+     * 获取客户信息详细信息
+     * @param id
+     * @return
+     */
+    Response<CustomerInfoVo> getCustomerById(Long id);
 }

+ 12 - 0
zzjs-service/src/main/java/com/miaxis/customer/service/impl/CustomerInfoServiceImpl.java

@@ -7,6 +7,7 @@ import com.miaxis.common.core.domain.Response;
 import com.miaxis.customer.domain.CustomerInfo;
 import com.miaxis.customer.mapper.CustomerInfoMapper;
 import com.miaxis.customer.service.ICustomerInfoService;
+import com.miaxis.customer.vo.CustomerInfoVo;
 import lombok.RequiredArgsConstructor;
 import lombok.SneakyThrows;
 import org.springframework.stereotype.Service;
@@ -67,4 +68,15 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
         }
         return Response.success();
     }
+
+    /**
+     * 获取客户信息详细信息
+     * @param id
+     * @return
+     */
+    @Override
+    @SneakyThrows
+    public Response<CustomerInfoVo> getCustomerById(Long id) {
+        return Response.success(customerInfoMapper.getCustomerById(id));
+    }
 }

+ 131 - 0
zzjs-service/src/main/java/com/miaxis/customer/vo/CustomerInfoVo.java

@@ -0,0 +1,131 @@
+package com.miaxis.customer.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 客户信息对象返回参
+ *
+ * @author miaxis
+ * @date 2021-03-15
+ */
+@Data
+@ApiModel(value = "CustomerInfoVo", description = "客户信息对象返回参")
+public class CustomerInfoVo extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @TableField("corporate_name")
+    @ApiModelProperty(value = "公司名称")
+    private String corporateName;
+
+    @TableField("business_type")
+    @ApiModelProperty(value = "业务类型  0:内部小程序、1:外部小程序")
+    private Integer businessType;
+
+    @TableField("corporate_logo")
+    @ApiModelProperty(value = "公司LOGO图片--(对应file_info的id)")
+    private Long corporateLogo;
+
+    @ApiModelProperty(value = "公司LOGO图片访问地址")
+    private String corporateLogoFileUrl;
+
+    @TableField("customer_source")
+    @ApiModelProperty(value = "客户来源  0:电话营销、1:主动来电、2:客户介绍、3:朋友介绍、4:销售推广、5:网络搜索、6:广告杂志、7:展会促销、8:其他")
+    private Integer customerSource;
+
+    @TableField("city_code")
+    @ApiModelProperty(value = "所在城市编码(对应城市表)")
+    private String cityCode;
+
+    @TableField("attributed_personnel")
+    @ApiModelProperty(value = "归属人员--关联用户表")
+    private Long attributedPersonnel;
+
+    @TableField("detailed_address")
+    @ApiModelProperty(value = "详细地址")
+    private String detailedAddress;
+
+    @TableField("industry_type")
+    @ApiModelProperty(value = "行业类型---关联product_type_info 品类表")
+    private Long industryType;
+
+    @TableField("corporate_phone")
+    @ApiModelProperty(value = "公司电话")
+    private String corporatePhone;
+
+    @TableField("corporate_contacts")
+    @ApiModelProperty(value = "公司联系人")
+    private String corporateContacts;
+
+    @TableField("phone")
+    @ApiModelProperty(value = "手机号码")
+    private String phone;
+
+    @TableField("customer_star")
+    @ApiModelProperty(value = "客户星级  1:一星、2:二星、3:三星、4:四星、5:五星")
+    private Integer customerStar;
+
+    @TableField("enterprise_tax_number")
+    @ApiModelProperty(value = "企业税号")
+    private String enterpriseTaxNumber;
+
+    @TableField("invoice_title")
+    @ApiModelProperty(value = "发票抬头")
+    private String invoiceTitle;
+
+    @TableField("bank_of_deposit")
+    @ApiModelProperty(value = "开户银行")
+    private String bankOfDeposit;
+
+    @TableField("bank_account")
+    @ApiModelProperty(value = "银行帐户")
+    private String bankAccount;
+
+    @TableField("finance_phone")
+    @ApiModelProperty(value = "财务电话号码")
+    private String financePhone;
+
+    @TableField("fax_number")
+    @ApiModelProperty(value = "传真号码")
+    private String faxNumber;
+
+    @TableField("applet_address")
+    @ApiModelProperty(value = "小程序地址")
+    private String appletAddress;
+
+    @TableField("applet_logo")
+    @ApiModelProperty(value = "小程序图标---(对应file_info的id)")
+    private Long appletLogo;
+
+    @ApiModelProperty(value = "小程序图标访问地址")
+    private String appletLogoFileUrl;
+
+    @TableField("applet_qr_code")
+    @ApiModelProperty(value = "小程序二维码---(对应file_info的id)")
+    private Long appletQrCode;
+
+    @ApiModelProperty(value = "小程序二维码访问地址")
+    private String appletQrCodeFileUrl;
+
+    @TableField("applet_introduce")
+    @ApiModelProperty(value = "小程序介绍")
+    private String appletIntroduce;
+
+    @TableField("shelf_status")
+    @ApiModelProperty(value = "上架状态  0:已上架、1:未上架")
+    private Integer shelfStatus;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private Integer status;
+
+
+}

+ 39 - 0
zzjs-service/src/main/resources/mapper/customer/CustomerInfoMapper.xml

@@ -64,5 +64,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+    <select id="getCustomerById" resultType="com.miaxis.customer.vo.CustomerInfoVo">
+        select
+        ci.id,
+        ci.corporate_name,
+        ci.business_type,
+        ci.corporate_logo,
+        f1.file_url as corporateLogoFileUrl,
+        ci.customer_source,
+        ci.city_code,
+        ci.attributed_personnel,
+        ci.detailed_address,
+        ci.industry_type,
+        ci.corporate_phone,
+        ci.corporate_contacts,
+        ci.phone,
+        ci.customer_star,
+        ci.enterprise_tax_number,
+        ci.invoice_title,
+        ci.bank_of_deposit,
+        ci.bank_account,
+        ci.finance_phone,
+        ci.fax_number,
+        ci.applet_address,
+        ci.applet_logo,
+        f2.file_url as appletLogoFileUrl,
+        ci.applet_qr_code,
+        f3.file_url as appletQrCodeFileUrl,
+        ci.applet_introduce,
+        ci.shelf_status,
+        ci.create_time,
+        ci.update_time,
+        ci.status
+        from customer_info ci
+        LEFT JOIN file_info f1 on f1.file_id = ci.corporate_logo
+        LEFT JOIN file_info f2 on f2.file_id = ci.applet_logo
+        LEFT JOIN file_info f3 on f3.file_id = ci.applet_qr_code
+        WHERE ci.id = #{id}
+
+    </select>
 
 </mapper>