Procházet zdrojové kódy

修复微信登陆

赵冬冬 před 4 roky
rodič
revize
fa053630fd

+ 7 - 8
carbon-back/carbon-back-service/src/main/resources/carbon/CustomerCompanyInfoMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="CustomerCompanyInfoMapper">
-    <resultMap id="BaseResultMap" type="CustomerCompanyInfo">
+<mapper namespace="com.hcloud.microserver.system.bank.dao.CustomerCompanyInfoMapper">
+    <resultMap id="BaseResultMap" type="com.hcloud.microserver.system.facade.carbon.entity.CustomerCompanyInfo">
         <id column="guid" jdbcType="CHAR" property="guid"/>
         <result column="fk_customer_id" jdbcType="CHAR" property="fkCustomerId"/>
         <result column="company_name" jdbcType="VARCHAR" property="companyName"/>
@@ -35,7 +35,7 @@
         delete from t_customer_company_info
         where guid = #{guid,jdbcType=CHAR}
     </delete>
-    <insert id="insert" parameterType="CustomerCompanyInfo">
+    <insert id="insert" parameterType="com.hcloud.microserver.system.facade.carbon.entity.CustomerCompanyInfo">
         insert into t_customer_company_info (guid, fk_customer_id, company_name,
         org_code, principals, phone,
         email, company_address, company_images,
@@ -47,7 +47,7 @@
         #{state,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP}
         )
     </insert>
-    <insert id="insertSelective" parameterType="CustomerCompanyInfo">
+    <insert id="insertSelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.CustomerCompanyInfo">
         insert into t_customer_company_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="guid != null">
@@ -127,7 +127,7 @@
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective"
-            parameterType="CustomerCompanyInfo">
+            parameterType="com.hcloud.microserver.system.facade.carbon.entity.CustomerCompanyInfo">
         update t_customer_company_info
         <set>
             <if test="fkCustomerId != null">
@@ -166,7 +166,7 @@
         </set>
         where guid = #{guid,jdbcType=CHAR}
     </update>
-    <update id="updateByPrimaryKey" parameterType="CustomerCompanyInfo">
+    <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.system.facade.carbon.entity.CustomerCompanyInfo">
         update t_customer_company_info
         set fk_customer_id = #{fkCustomerId,jdbcType=CHAR},
         company_name = #{companyName,jdbcType=VARCHAR},
@@ -182,8 +182,7 @@
         where guid = #{guid,jdbcType=CHAR}
     </update>
 
-    <select id="selectListByPage" parameterType="CustomerCompanyInfoForm"
-            resultType="CompanyBO">
+    <select id="selectListByPage" parameterType="com.hcloud.microserver.system.facade.carbon.forms.CustomerCompanyInfoForm" resultType="com.hcloud.microserver.system.bank.bo.CompanyBO">
         select
         ci.account as account,
         ci.customer_type as customerType,

+ 69 - 62
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/CustomerController.java

@@ -1,5 +1,6 @@
 package com.hcloud.microserver.h5.controller.web;
 
+import com.hcloud.microserver.h5.facade.carbon.entity.CustomerCompanyInfo;
 import com.hcloud.microserver.h5.forms.CompanyValidateForm;
 import com.hcloud.microserver.h5.forms.LoginForm;
 import com.hcloud.microserver.h5.forms.PersonValidateForm;
@@ -53,16 +54,16 @@ public class CustomerController extends BaseController {
     @Value("${jwt.tokenHead}")
     private String tokenHead;
 
-    @ApiOperation(value = "通过用户账号或手机登录系统",notes = "通过用户账号或手机登录系统,需要输入密码")
+    @ApiOperation(value = "通过用户账号或手机登录系统", notes = "通过用户账号或手机登录系统,需要输入密码")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "loginForm",value = "登录相关信息", dataType = "LoginForm")
+            @ApiImplicitParam(name = "loginForm", value = "登录相关信息", dataType = "LoginForm")
     })
-    @ApiResponse(code =0,message = "查询成功")
+    @ApiResponse(code = 0, message = "查询成功")
     @PostMapping("/customerLogin")
-    public ResponseBase<Map<String, String>> login(@RequestBody LoginForm loginForm){
+    public ResponseBase<Map<String, String>> login(@RequestBody LoginForm loginForm) {
         String token = customerService.login(loginForm);
         if (token == null) {
-             Asserts.fail("用户名或密码错误");
+            Asserts.fail("用户名或密码错误");
         }
         Map<String, String> tokenMap = new HashMap<>();
         tokenMap.put("token", token);
@@ -70,86 +71,97 @@ public class CustomerController extends BaseController {
         return responseResultSuccess(tokenMap);
     }
 
-    @ApiOperation(value = "获取爱心用户登录信息",notes = "获取爱心用户登录信息,通过token")
-    @ApiResponse(code =0,message = "查询成功")
+    @ApiOperation(value = "退出", notes = "退出,需要输入密码")
+    @GetMapping("/logout")
+    public ResponseBase logout() {
+        customerService.logout();
+        return responseResultSuccess();
+    }
+
+    @ApiOperation(value = "获取爱心用户登录信息", notes = "获取爱心用户登录信息,通过token")
+    @ApiResponse(code = 0, message = "查询成功")
     @GetMapping("/getCustomerByToken")
     @AuthCarbonValidate
-    public ResponseBase getCustomerInfoByToken(Principal principal){
-        if (principal == null){
+    public ResponseBase getCustomerInfoByToken(Principal principal) {
+        if (principal == null) {
             responseError(new ResultVO(ResultEnum.UNAUTHORIZED));
         }
         CustomerInfoForm customerInfo = customerService.getCurrentMember();
+        Integer isCompany = customerInfo.getIsCompany();
+
         return responseResultSuccess(customerInfo);
     }
 
-    @ApiOperation(value = "获取爱心用户基本信息",notes = "获取爱心用户基本信息及统计分析信息")
+    @ApiOperation(value = "获取爱心用户基本信息", notes = "获取爱心用户基本信息及统计分析信息")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "customerId",value = "客户id", dataType = "String",paramType = "query")
+            @ApiImplicitParam(name = "customerId", value = "客户id", dataType = "String", paramType = "query")
     })
-    @ApiResponse(code =0,message = "查询成功")
+    @ApiResponse(code = 0, message = "查询成功")
     @GetMapping("/getCustomerById")
     @AuthCarbonValidate
-    public ResponseBase getCustomAnalysisInfo(@RequestParam("userId") String customerId){
+    public ResponseBase getCustomAnalysisInfo(@RequestParam("userId") String customerId) {
         CustomerInfoForm customerInfoById = customerInfoService.getCustomerInfoById(customerId);
-        if(customerInfoById != null){
+        if (customerInfoById != null) {
             return responseResultSuccess(customerInfoById);
         }
         return responseError(new ResultVO(ResultEnum.SYS_ERROR));
     }
 
 
-    @ApiOperation(value = "更新爱心用户基本信息",notes = "更新爱心用户基本信息(昵称,头像等)")
+    @ApiOperation(value = "更新爱心用户基本信息", notes = "更新爱心用户基本信息(昵称,头像等)")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "smallCustomer",value = "爱心用户基本信息", dataType = "SmallCustomer")
+            @ApiImplicitParam(name = "smallCustomer", value = "爱心用户基本信息", dataType = "SmallCustomer")
     })
-    @ApiResponse(code =0,message = "查询成功")
+    @ApiResponse(code = 0, message = "查询成功")
     @PostMapping("/updateBaseInfo")
     @AuthCarbonValidate
-    public ResponseBase modifiedCustomerInfo(@RequestBody SmallCustomer smallCustomer){
+    public ResponseBase modifiedCustomerInfo(@RequestBody SmallCustomer smallCustomer) {
         CustomerInfoForm customerInfo = customerService.getCurrentMember();
-        if(Objects.isNull(customerInfo)){return responseError(new ResultVO(ResultEnum.UNAUTHORIZED));}
+        if (Objects.isNull(customerInfo)) {
+            return responseError(new ResultVO(ResultEnum.UNAUTHORIZED));
+        }
         CustomerInfoForm customerInfoForm = new CustomerInfoForm();
         customerInfoForm.setGuid(customerInfo.getGuid());
         customerInfoForm.setNickName(smallCustomer.getNickName());
         customerInfoForm.setHeadImage(smallCustomer.getHeadImage());
         customerInfoForm.setModifiedTime(new Date());
-        int i  = customerInfoService.modifyByPrimaryKeySelective(customerInfoForm);
-        if(i>0){
+        int i = customerInfoService.modifyByPrimaryKeySelective(customerInfoForm);
+        if (i > 0) {
             return responseResultSuccess();
         }
         return responseResultFailure();
     }
 
-    @ApiOperation(value = "个人认证",notes = "爱心用户个人认证")
+    @ApiOperation(value = "个人认证", notes = "爱心用户个人认证")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "personValidateForm",value = "认证信息", dataType = "PersonValidateForm")
+            @ApiImplicitParam(name = "personValidateForm", value = "认证信息", dataType = "PersonValidateForm")
     })
-    @ApiResponse(code =0,message = "查询成功")
+    @ApiResponse(code = 0, message = "查询成功")
     @PostMapping("/validateCustomer")
     @AuthCarbonValidate
-    public ResponseBase validateCustomerInfo(@RequestBody PersonValidateForm personValidateForm){
+    public ResponseBase validateCustomerInfo(@RequestBody PersonValidateForm personValidateForm) {
         CustomerInfoForm customerInfoForm = new CustomerInfoForm();
         customerInfoForm.setGuid(personValidateForm.getCustomerId());
         customerInfoForm.setPid(personValidateForm.getPid());
         customerInfoForm.setCustomerName(personValidateForm.getCustomerName());
         customerInfoForm.setIsValidate(1);
         customerInfoForm.setModifiedTime(new Date());
-        int i =  customerInfoService.modifyByPrimaryKeySelective(customerInfoForm);
-        if(i>0){
+        int i = customerInfoService.modifyByPrimaryKeySelective(customerInfoForm);
+        if (i > 0) {
             return responseResultSuccess();
         }
         return responseResultFailure();
     }
 
-    @ApiOperation(value = "个人认证信息查询",notes = "查询个人认证信息")
+    @ApiOperation(value = "个人认证信息查询", notes = "查询个人认证信息")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "customerId",value = "认证信息", dataType = "String",paramType = "query")
+            @ApiImplicitParam(name = "customerId", value = "认证信息", dataType = "String", paramType = "query")
     })
-    @ApiResponse(code =0,message = "查询成功")
+    @ApiResponse(code = 0, message = "查询成功")
     @GetMapping("/getValidateInfo")
     @AuthCarbonValidate
-    public ResponseBase getCustomerValidateInfo(Principal principal){
-        if (principal == null){
+    public ResponseBase getCustomerValidateInfo(Principal principal) {
+        if (principal == null) {
             Asserts.fail("token过期!");
         }
         CustomerInfoForm customerInfo = customerService.getCurrentMember();
@@ -157,75 +169,70 @@ public class CustomerController extends BaseController {
         return responseResultSuccess(customerInfo);
     }
 
-    @ApiOperation(value = "企业认证",notes = "爱心用户企业认证")
+    @ApiOperation(value = "企业认证", notes = "爱心用户企业认证")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "companyValidateForm",value = "企业认证信息", dataType = "CompanyValidateForm")
+            @ApiImplicitParam(name = "companyValidateForm", value = "企业认证信息", dataType = "CompanyValidateForm")
     })
-    @ApiResponse(code =0,message = "查询成功")
+    @ApiResponse(code = 0, message = "查询成功")
     @PostMapping("/validateCompany")
     @AuthCarbonValidate
-    public ResponseBase validateCompanyInfo(@RequestBody CompanyValidateForm companyValidateForm){
-        CustomerCompanyInfoForm companyInfoForm = BeanCopyUtil.convertBean(companyValidateForm,CustomerCompanyInfoForm.class);
+    public ResponseBase validateCompanyInfo(@RequestBody CompanyValidateForm companyValidateForm) {
+        CustomerCompanyInfoForm companyInfoForm = BeanCopyUtil.convertBean(companyValidateForm, CustomerCompanyInfoForm.class);
         int i = customerCompanyInfoService.validateCompanyInfo(companyInfoForm);
-        if(i>1){
+        if (i > 1) {
             return responseResultSuccess();
         }
         return responseResultFailure();
     }
 
-    @ApiOperation(value = "查询企业认证信息",notes = "查询企业认证信息")
+    @ApiOperation(value = "查询企业认证信息", notes = "查询企业认证信息")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "customerId",value = "爱心用户id", dataType = "String",paramType = "query")
+            @ApiImplicitParam(name = "customerId", value = "爱心用户id", dataType = "String", paramType = "query")
     })
-    @ApiResponse(code =0,message = "查询成功")
+    @ApiResponse(code = 0, message = "查询成功")
     @GetMapping("/getCompanyInfo")
     @AuthCarbonValidate
-    public ResponseBase getCompanyInfoByCid(Principal principal){
-        if (principal == null){
+    public ResponseBase getCompanyInfoByCid(Principal principal) {
+        if (principal == null) {
             return responseEnum(ResultEnum.UNAUTHORIZED);
         }
         CustomerInfoForm customerInfo = customerService.getCurrentMember();
         CustomerCompanyInfoForm companyInfoForm = customerInfo.getCustomerCompanyInfoForm();
         CustomerCompanyInfoForm customerCompanyInfoByCustomerId = customerCompanyInfoService.getCustomerCompanyInfoByCustomerId(customerInfo.getGuid());
-        if(customerCompanyInfoByCustomerId != null){
+        if (customerCompanyInfoByCustomerId != null) {
             return responseResultSuccess(customerCompanyInfoByCustomerId);
         }
         return responseResultFailure();
     }
 
 
-    @ApiOperation(value = "绑定手机",notes = "爱心用户手机号绑定")
+    @ApiOperation(value = "绑定手机", notes = "爱心用户手机号绑定")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "customerInfoForm",value = "爱心用户信息", dataType = "CustomerInfoForm")
+            @ApiImplicitParam(name = "customerInfoForm", value = "爱心用户信息", dataType = "CustomerInfoForm")
     })
-    @ApiResponse(code =0,message = "操作成功")
+    @ApiResponse(code = 0, message = "操作成功")
     @PostMapping("/updatePhone")
     @AuthCarbonValidate
-    public ResponseBase updateCustomerPhone(@RequestBody CustomerInfoForm customerInfoForm){
+    public ResponseBase updateCustomerPhone(@RequestBody CustomerInfoForm customerInfoForm) {
         CustomerInfoForm member = customerService.getCurrentMember();
         ValueOperations<String, Object> operations = redisTemplate.opsForValue();
         String pcode = customerInfoForm.getMsgCode();
-        String phone =customerInfoForm.getPhone();
-        if(pcode==null || "".equals(pcode)){return responseError(new ResultVO(ResultEnum.CODE_ERROR));}
-        String redisKey = phone+":"+pcode;
+        String phone = customerInfoForm.getPhone();
+        if (pcode == null || "".equals(pcode)) {
+            return responseError(new ResultVO(ResultEnum.CODE_ERROR));
+        }
+        String redisKey = phone + ":" + pcode;
         String redisCode = (String) operations.get(redisKey);
-        if(pcode.equals(redisCode)||pcode.equals("000000")){
-            int i =  customerInfoService.bindCustomerPhone(customerInfoForm.getGuid(),phone);
-            if(i>0){
+        if (pcode.equals(redisCode) || pcode.equals("000000")) {
+            int i = customerInfoService.bindCustomerPhone(customerInfoForm.getGuid(), phone);
+            if (i > 0) {
                 return responseResultSuccess();
             }
             return responseResultFailure();
-        }else {
+        } else {
             return responseError(new ResultVO(ResultEnum.CODE_ERROR));
         }
     }
 
 
-
-
-
-
-
-
-
 }

+ 0 - 1
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/OrderManagerController.java

@@ -77,7 +77,6 @@ public class OrderManagerController extends CarbonBaseController {
     @AuthCarbonValidate
     public ResponseBase<GoodsOrderInfoForm> searchCustomerOrderByClass(@RequestBody OrderQueryForm queryForm) {
         CustomerInfoForm customerInfo = customerService.getCurrentMember();
-
         GoodsOrderInfoForm goodsOrderInfoForm = new GoodsOrderInfoForm();
         goodsOrderInfoForm.setFkCustomerGuid(customerInfo.getGuid());
         goodsOrderInfoForm.setOrderStatus(queryForm.getOrderStatus());

+ 1 - 1
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/WechatAppPayController.java

@@ -54,7 +54,7 @@ public class WechatAppPayController extends BaseController {
     @ApiOperation(value = "微信支付接口(二次支付)", notes = "微信支付接口请勿随意调用(二次支付)")
     @ApiResponse(code = 500, message = "请求的配置参数有问题")
     @AuthCarbonValidate
-    @PostMapping("/pay")
+    @PostMapping
     public ResponseBase pay(@RequestBody WxPayFrom wxPayFrom, HttpServletRequest request) {
         String orderId = wxPayFrom.getOrderId();
         String openid = wxPayFrom.getOpenid();

+ 1 - 0
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/dao/CustomerInfoMapper.java

@@ -3,6 +3,7 @@ package com.hcloud.microserver.h5.dao;
 import com.hcloud.microserver.h5.bo.CustomerInfoBO;
 import com.hcloud.microserver.commoncore.base.BaseMapper;
 import com.hcloud.microserver.commoncore.base.PageBean;
+import com.hcloud.microserver.h5.facade.carbon.entity.CustomerCompanyInfo;
 import com.hcloud.microserver.h5.facade.carbon.entity.CustomerInfo;
 import com.hcloud.microserver.h5.facade.carbon.forms.CustomerInfoForm;
 import com.hcloud.microserver.h5.facade.carbon.vo.MyWxMpUser;

+ 3 - 0
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/CustomerService.java

@@ -1,6 +1,7 @@
 package com.hcloud.microserver.h5.service;
 
 import com.hcloud.microserver.h5.bo.CustomerDetails;
+import com.hcloud.microserver.h5.facade.carbon.entity.CustomerCompanyInfo;
 import com.hcloud.microserver.h5.forms.LoginForm;
 import com.hcloud.microserver.h5.facade.carbon.forms.CustomerInfoForm;
 
@@ -16,4 +17,6 @@ public interface CustomerService {
     public String login(LoginForm loginForm);
 
 
+    void logout();
+
 }

+ 13 - 0
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/impl/CustomerServiceImpl.java

@@ -1,7 +1,9 @@
 package com.hcloud.microserver.h5.service.impl;
 
 import com.hcloud.microserver.h5.bo.CustomerDetails;
+import com.hcloud.microserver.h5.dao.CustomerCompanyInfoMapper;
 import com.hcloud.microserver.h5.dao.CustomerInfoMapper;
+import com.hcloud.microserver.h5.facade.carbon.entity.CustomerCompanyInfo;
 import com.hcloud.microserver.h5.forms.LoginForm;
 import com.hcloud.microserver.h5.service.CustomerCacheService;
 import com.hcloud.microserver.h5.service.CustomerInfoService;
@@ -97,4 +99,15 @@ public class CustomerServiceImpl implements CustomerService {
         customerCacheService.setToken(token, accountStr);
         return token;
     }
+    @Autowired
+    private CustomerService customerService;
+
+    public void logout(){
+        CustomerInfoForm customerInfo = customerService.getCurrentMember();
+        String account = customerInfo.getAccount();
+        customerCacheService.delToken(account);
+    }
+
+
+
 }

+ 1 - 1
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/impl/OrderInfoServiceImpl.java

@@ -532,7 +532,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
         if (customerInfo == null) {
             throw new RuntimeException("获取登陆信息失败");
         }
-        if(customerInfo.getCustomerType() != 1){
+        if(customerInfo.getIsCompany() == 1){
             throw new RuntimeException("不是自然人无法购买商品!");
         }
         String customerId = customerInfo.getGuid();

+ 307 - 307
carbon-h5/carbon-h5-service/src/main/resources/com/hcloud/microserver/h5/dao/CustomerInfoMapper.xml

@@ -1,119 +1,119 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.hcloud.microserver.h5.dao.CustomerInfoMapper">
-  <resultMap id="BaseResultMap" type="CustomerInfo">
-    <id column="guid" jdbcType="CHAR" property="guid" />
-    <result column="account" jdbcType="VARCHAR" property="account" />
-    <result column="passwd" jdbcType="VARCHAR" property="passwd" />
-    <result column="customer_type" jdbcType="INTEGER" property="customerType" />
-    <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
-    <result column="nick_name" jdbcType="VARCHAR" property="nickName" />
-    <result column="pid" jdbcType="CHAR" property="pid" />
-    <result column="phone" jdbcType="CHAR" property="phone" />
-    <result column="sex" jdbcType="INTEGER" property="sex" />
-    <result column="score" jdbcType="INTEGER" property="score" />
-    <result column="wx_id" jdbcType="VARCHAR" property="wxId" />
-    <result column="union_id" jdbcType="VARCHAR" property="unionId" />
-    <result column="head_image" jdbcType="VARCHAR" property="headImage" />
-    <result column="is_company" jdbcType="INTEGER" property="isCompany" />
-    <result column="is_validate" jdbcType="INTEGER" property="isValidate" />
-    <result column="is_enable" jdbcType="INTEGER" property="isEnable" />
-    <result column="state" jdbcType="INTEGER" property="state" />
-    <result column="create_user" jdbcType="CHAR" property="createUser" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
+    <resultMap id="BaseResultMap" type="CustomerInfo">
+        <id column="guid" jdbcType="CHAR" property="guid"/>
+        <result column="account" jdbcType="VARCHAR" property="account"/>
+        <result column="passwd" jdbcType="VARCHAR" property="passwd"/>
+        <result column="customer_type" jdbcType="INTEGER" property="customerType"/>
+        <result column="customer_name" jdbcType="VARCHAR" property="customerName"/>
+        <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
+        <result column="pid" jdbcType="CHAR" property="pid"/>
+        <result column="phone" jdbcType="CHAR" property="phone"/>
+        <result column="sex" jdbcType="INTEGER" property="sex"/>
+        <result column="score" jdbcType="INTEGER" property="score"/>
+        <result column="wx_id" jdbcType="VARCHAR" property="wxId"/>
+        <result column="union_id" jdbcType="VARCHAR" property="unionId"/>
+        <result column="head_image" jdbcType="VARCHAR" property="headImage"/>
+        <result column="is_company" jdbcType="INTEGER" property="isCompany"/>
+        <result column="is_validate" jdbcType="INTEGER" property="isValidate"/>
+        <result column="is_enable" jdbcType="INTEGER" property="isEnable"/>
+        <result column="state" jdbcType="INTEGER" property="state"/>
+        <result column="create_user" jdbcType="CHAR" property="createUser"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="modified_user" jdbcType="CHAR" property="modifiedUser"/>
 
 
-    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
-  </resultMap>
-  <sql id="Base_Column_List">
+        <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
     guid, account, passwd, customer_type, customer_name, nick_name, pid, phone, sex,
     score, wx_id, union_id,head_image,is_company, is_validate, is_enable, state, create_user, create_time,
     modified_user, modified_time
   </sql>
-  <sql id="Base_Column_List_spc">
+    <sql id="Base_Column_List_spc">
     aa.guid,aa.account, aa.passwd, aa.customer_type, aa.customer_name, aa.nick_name, aa.pid, aa.phone, aa.sex,
     aa.score, aa.wx_id, aa.union_id,aa.head_image,aa.is_company, aa.is_validate, aa.is_enable, aa.state, aa.create_user,
     aa.create_time,aa.modified_user, aa.modified_time
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select
-    <include refid="Base_Column_List" />
-    from t_customer_info
-    where guid = #{guid,jdbcType=CHAR}
-  </select>
-  <select id="searchCustomerByPage" parameterType="com.hcloud.microserver.commoncore.base.PageBean"
-          resultType="com.hcloud.microserver.h5.bo.CustomerInfoBO">
-    SELECT
-    aa.guid,
-    aa.account AS account,
-    aa.customer_name AS customerName,
-    CASE aa.customer_type
-    WHEN 1 THEN
-    '自然人'
-    WHEN 2 THEN
-    '履约企业'
-    ELSE
-    '非履约企业'
-    END AS customerType,
-    aa.is_company AS isCompany,
-    aa.is_validate AS isValidate,
-    aa.nick_name AS nickName,
-    aa.phone AS customerPhone,
-    aa.pid AS pid,
-    aa.score AS score,
-    aa.create_time as createTime,
-    aa.modified_time as modifiedTime,
-    aa.is_enable as isEnable,
-    aa.wx_id as wxId,
-    aa.phone,
-    CASE aa.sex
-    WHEN 1 THEN
-    '男'
-    ELSE
-    '女'
-    END AS sexName,
-    bb.company_name AS companyName,
-    bb.principals AS principals,
-    bb.phone AS companyPhone
-    FROM
-    t_customer_info aa
-    LEFT JOIN t_customer_company_info bb ON aa.guid = bb.fk_customer_id
-    <where>
-      aa.state = 1
-      <if test="data.customerName != null and data.customerName != ''">
-        and aa.customer_name like concat('%',#{data.customerName},'%')
-      </if>
-      <if test="data.phone != null and data.phone != ''">
-        and aa.phone like concat('%',#{data.phone},'%')
-      </if>
-      <if test="data.account != null and data.account != ''">
-        and aa.account like concat('%', #{data.account}, '%')
-      </if>
-      <if test="data.customerType != null">
-        and aa.customer_type = #{data.customerType}
-      </if>
-      <if test="data.isValidate != null">
-        and aa.is_validate = #{data.isValidate}
-      </if>
-    </where>
-    order by aa.modified_time desc
-  </select>
-  <select id="searchCustomerByAccount" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select
-    <include refid="Base_Column_List" />
-    from t_customer_info
-    where account = #{account,jdbcType=CHAR} limit 1
-  </select>
-  <select id="getCustomerByInfo" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select
-    <include refid="Base_Column_List" />
-    from t_customer_info
-    where
-    state =1
-    and (account=#{queryStr,jdbcType=VARCHAR} or phone=#{queryStr,jdbcType=VARCHAR})
-  </select>
-  <select id="getCustomerByThreeCode" resultType="com.hcloud.microserver.h5.bo.CustomerInfoBO">
+    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from t_customer_info
+        where guid = #{guid,jdbcType=CHAR}
+    </select>
+    <select id="searchCustomerByPage" parameterType="com.hcloud.microserver.commoncore.base.PageBean"
+            resultType="com.hcloud.microserver.h5.bo.CustomerInfoBO">
+        SELECT
+        aa.guid,
+        aa.account AS account,
+        aa.customer_name AS customerName,
+        CASE aa.customer_type
+        WHEN 1 THEN
+        '自然人'
+        WHEN 2 THEN
+        '履约企业'
+        ELSE
+        '非履约企业'
+        END AS customerType,
+        aa.is_company AS isCompany,
+        aa.is_validate AS isValidate,
+        aa.nick_name AS nickName,
+        aa.phone AS customerPhone,
+        aa.pid AS pid,
+        aa.score AS score,
+        aa.create_time as createTime,
+        aa.modified_time as modifiedTime,
+        aa.is_enable as isEnable,
+        aa.wx_id as wxId,
+        aa.phone,
+        CASE aa.sex
+        WHEN 1 THEN
+        '男'
+        ELSE
+        '女'
+        END AS sexName,
+        bb.company_name AS companyName,
+        bb.principals AS principals,
+        bb.phone AS companyPhone
+        FROM
+        t_customer_info aa
+        LEFT JOIN t_customer_company_info bb ON aa.guid = bb.fk_customer_id
+        <where>
+            aa.state = 1
+            <if test="data.customerName != null and data.customerName != ''">
+                and aa.customer_name like concat('%',#{data.customerName},'%')
+            </if>
+            <if test="data.phone != null and data.phone != ''">
+                and aa.phone like concat('%',#{data.phone},'%')
+            </if>
+            <if test="data.account != null and data.account != ''">
+                and aa.account like concat('%', #{data.account}, '%')
+            </if>
+            <if test="data.customerType != null">
+                and aa.customer_type = #{data.customerType}
+            </if>
+            <if test="data.isValidate != null">
+                and aa.is_validate = #{data.isValidate}
+            </if>
+        </where>
+        order by aa.modified_time desc
+    </select>
+    <select id="searchCustomerByAccount" parameterType="java.lang.String" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from t_customer_info
+        where account = #{account,jdbcType=CHAR} limit 1
+    </select>
+    <select id="getCustomerByInfo" parameterType="java.lang.String" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from t_customer_info
+        where
+        state =1
+        and (account=#{queryStr,jdbcType=VARCHAR} or phone=#{queryStr,jdbcType=VARCHAR})
+    </select>
+    <select id="getCustomerByThreeCode" resultType="com.hcloud.microserver.h5.bo.CustomerInfoBO">
         SELECT
           aa.guid as guid,
           aa.account as account,
@@ -139,7 +139,7 @@
         AND bb.channel_type =#{channel}
         AND (bb.channel_keyword_one = #{code} or bb.channel_keyword_two=#{code})
   </select>
-  <select id="getCustomerStatisticalInfo" resultType="com.hcloud.microserver.h5.bo.CustomerInfoBO">
+    <select id="getCustomerStatisticalInfo" resultType="com.hcloud.microserver.h5.bo.CustomerInfoBO">
     SELECT
         aa.fk_customer_guid AS customId,
         SUM(bb.sale_num) AS carbonAmount,
@@ -158,7 +158,7 @@
         aa.fk_customer_guid
   </select>
 
-  <select id="wxlogin" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <select id="wxlogin" parameterType="java.lang.String" resultMap="BaseResultMap">
       SELECT
           a.*
       FROM
@@ -169,11 +169,11 @@
       OR a.union_id = #{myWxMpUser.unionId}
       LIMIT 1
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
   delete from t_customer_info
   where guid = #{guid,jdbcType=CHAR}
   </delete>
-  <insert id="insert" parameterType="CustomerInfo">
+    <insert id="insert" parameterType="CustomerInfo">
     insert into t_customer_info (guid, account, passwd,
       customer_type, customer_name, nick_name,
       pid, phone, sex, score,
@@ -189,206 +189,206 @@
       #{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, #{modifiedUser,jdbcType=CHAR},
       #{modifiedTime,jdbcType=TIMESTAMP})
   </insert>
-  <insert id="insertSelective" parameterType="CustomerInfo">
-    insert into t_customer_info
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="guid != null">
-        guid,
-      </if>
-      <if test="account != null">
-        account,
-      </if>
-      <if test="passwd != null">
-        passwd,
-      </if>
-      <if test="customerType != null">
-        customer_type,
-      </if>
-      <if test="customerName != null">
-        customer_name,
-      </if>
-      <if test="nickName != null">
-        nick_name,
-      </if>
-      <if test="pid != null">
-        pid,
-      </if>
-      <if test="phone != null">
-        phone,
-      </if>
-      <if test="sex != null">
-        sex,
-      </if>
-      <if test="score != null">
-        score,
-      </if>
-      <if test="wxId != null">
-        wx_id,
-      </if>
-      <if test="unionId != null">
-        union_id,
-      </if>
-      <if test="headImage != null">
-        head_image,
-      </if>
-      <if test="isCompany != null">
-        is_company,
-      </if>
-      <if test="isValidate != null">
-        is_validate,
-      </if>
-      <if test="isEnable != null">
-        is_enable,
-      </if>
-      <if test="state != null">
-        state,
-      </if>
-      <if test="createUser != null">
-        create_user,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="modifiedUser != null">
-        modified_user,
-      </if>
-      <if test="modifiedTime != null">
-        modified_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="guid != null">
-        #{guid,jdbcType=CHAR},
-      </if>
-      <if test="account != null">
-        #{account,jdbcType=VARCHAR},
-      </if>
-      <if test="passwd != null">
-        #{passwd,jdbcType=VARCHAR},
-      </if>
-      <if test="customerType != null">
-        #{customerType,jdbcType=INTEGER},
-      </if>
-      <if test="customerName != null">
-        #{customerName,jdbcType=VARCHAR},
-      </if>
-      <if test="nickName != null">
-        #{nickName,jdbcType=VARCHAR},
-      </if>
-      <if test="pid != null">
-        #{pid,jdbcType=CHAR},
-      </if>
-      <if test="phone != null">
-        #{phone,jdbcType=CHAR},
-      </if>
-      <if test="sex != null">
-        #{sex,jdbcType=INTEGER},
-      </if>
-      <if test="score != null">
-        #{score,jdbcType=INTEGER},
-      </if>
-      <if test="wxId != null">
-        #{wxId,jdbcType=VARCHAR},
-      </if>
-      <if test="unionId != null">
-        #{unionId,jdbcType=VARCHAR},
-      </if>
-      <if test="headImage != null">
-        #{headImage,jdbcType=VARCHAR},
-      </if>
-      <if test="isCompany != null">
-        #{isCompany,jdbcType=INTEGER},
-      </if>
-      <if test="isValidate != null">
-        #{isValidate,jdbcType=INTEGER},
-      </if>
-      <if test="isEnable != null">
-        #{isEnable,jdbcType=INTEGER},
-      </if>
-      <if test="state != null">
-        #{state,jdbcType=INTEGER},
-      </if>
-      <if test="createUser != null">
-        #{createUser,jdbcType=CHAR},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="modifiedUser != null">
-        #{modifiedUser,jdbcType=CHAR},
-      </if>
-      <if test="modifiedTime != null">
-        #{modifiedTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="CustomerInfo">
-    update t_customer_info
-    <set>
-      <if test="account != null">
-        account = #{account,jdbcType=VARCHAR},
-      </if>
-      <if test="passwd != null">
-        passwd = #{passwd,jdbcType=VARCHAR},
-      </if>
-      <if test="customerType != null">
-        customer_type = #{customerType,jdbcType=INTEGER},
-      </if>
-      <if test="customerName != null">
-        customer_name = #{customerName,jdbcType=VARCHAR},
-      </if>
-      <if test="nickName != null">
-        nick_name = #{nickName,jdbcType=VARCHAR},
-      </if>
-      <if test="pid != null">
-        pid = #{pid,jdbcType=CHAR},
-      </if>
-      <if test="phone != null">
-        phone = #{phone,jdbcType=CHAR},
-      </if>
-      <if test="sex != null">
-        sex = #{sex,jdbcType=INTEGER},
-      </if>
-      <if test="score != null">
-        score = #{score,jdbcType=INTEGER},
-      </if>
-      <if test="wxId != null">
-        wx_id = #{wxId,jdbcType=VARCHAR},
-      </if>
-      <if test="unionId != null">
-        union_id = #{unionId,jdbcType=VARCHAR},
-      </if>
-      <if test="headImage != null">
-        head_image = #{headImage,jdbcType=VARCHAR},
-      </if>
-      <if test="isCompany != null">
-        is_company = #{isCompany,jdbcType=INTEGER},
-      </if>
-      <if test="isValidate != null">
-        is_validate = #{isValidate,jdbcType=INTEGER},
-      </if>
-      <if test="isEnable != null">
-        is_enable = #{isEnable,jdbcType=INTEGER},
-      </if>
-      <if test="state != null">
-        state = #{state,jdbcType=INTEGER},
-      </if>
-      <if test="createUser != null">
-        create_user = #{createUser,jdbcType=CHAR},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="modifiedUser != null">
-        modified_user = #{modifiedUser,jdbcType=CHAR},
-      </if>
-      <if test="modifiedTime != null">
-        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where guid = #{guid,jdbcType=CHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="CustomerInfo">
+    <insert id="insertSelective" parameterType="CustomerInfo">
+        insert into t_customer_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="guid != null">
+                guid,
+            </if>
+            <if test="account != null">
+                account,
+            </if>
+            <if test="passwd != null">
+                passwd,
+            </if>
+            <if test="customerType != null">
+                customer_type,
+            </if>
+            <if test="customerName != null">
+                customer_name,
+            </if>
+            <if test="nickName != null">
+                nick_name,
+            </if>
+            <if test="pid != null">
+                pid,
+            </if>
+            <if test="phone != null">
+                phone,
+            </if>
+            <if test="sex != null">
+                sex,
+            </if>
+            <if test="score != null">
+                score,
+            </if>
+            <if test="wxId != null">
+                wx_id,
+            </if>
+            <if test="unionId != null">
+                union_id,
+            </if>
+            <if test="headImage != null">
+                head_image,
+            </if>
+            <if test="isCompany != null">
+                is_company,
+            </if>
+            <if test="isValidate != null">
+                is_validate,
+            </if>
+            <if test="isEnable != null">
+                is_enable,
+            </if>
+            <if test="state != null">
+                state,
+            </if>
+            <if test="createUser != null">
+                create_user,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="modifiedUser != null">
+                modified_user,
+            </if>
+            <if test="modifiedTime != null">
+                modified_time,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="guid != null">
+                #{guid,jdbcType=CHAR},
+            </if>
+            <if test="account != null">
+                #{account,jdbcType=VARCHAR},
+            </if>
+            <if test="passwd != null">
+                #{passwd,jdbcType=VARCHAR},
+            </if>
+            <if test="customerType != null">
+                #{customerType,jdbcType=INTEGER},
+            </if>
+            <if test="customerName != null">
+                #{customerName,jdbcType=VARCHAR},
+            </if>
+            <if test="nickName != null">
+                #{nickName,jdbcType=VARCHAR},
+            </if>
+            <if test="pid != null">
+                #{pid,jdbcType=CHAR},
+            </if>
+            <if test="phone != null">
+                #{phone,jdbcType=CHAR},
+            </if>
+            <if test="sex != null">
+                #{sex,jdbcType=INTEGER},
+            </if>
+            <if test="score != null">
+                #{score,jdbcType=INTEGER},
+            </if>
+            <if test="wxId != null">
+                #{wxId,jdbcType=VARCHAR},
+            </if>
+            <if test="unionId != null">
+                #{unionId,jdbcType=VARCHAR},
+            </if>
+            <if test="headImage != null">
+                #{headImage,jdbcType=VARCHAR},
+            </if>
+            <if test="isCompany != null">
+                #{isCompany,jdbcType=INTEGER},
+            </if>
+            <if test="isValidate != null">
+                #{isValidate,jdbcType=INTEGER},
+            </if>
+            <if test="isEnable != null">
+                #{isEnable,jdbcType=INTEGER},
+            </if>
+            <if test="state != null">
+                #{state,jdbcType=INTEGER},
+            </if>
+            <if test="createUser != null">
+                #{createUser,jdbcType=CHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="modifiedUser != null">
+                #{modifiedUser,jdbcType=CHAR},
+            </if>
+            <if test="modifiedTime != null">
+                #{modifiedTime,jdbcType=TIMESTAMP},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="CustomerInfo">
+        update t_customer_info
+        <set>
+            <if test="account != null">
+                account = #{account,jdbcType=VARCHAR},
+            </if>
+            <if test="passwd != null">
+                passwd = #{passwd,jdbcType=VARCHAR},
+            </if>
+            <if test="customerType != null">
+                customer_type = #{customerType,jdbcType=INTEGER},
+            </if>
+            <if test="customerName != null">
+                customer_name = #{customerName,jdbcType=VARCHAR},
+            </if>
+            <if test="nickName != null">
+                nick_name = #{nickName,jdbcType=VARCHAR},
+            </if>
+            <if test="pid != null">
+                pid = #{pid,jdbcType=CHAR},
+            </if>
+            <if test="phone != null">
+                phone = #{phone,jdbcType=CHAR},
+            </if>
+            <if test="sex != null">
+                sex = #{sex,jdbcType=INTEGER},
+            </if>
+            <if test="score != null">
+                score = #{score,jdbcType=INTEGER},
+            </if>
+            <if test="wxId != null">
+                wx_id = #{wxId,jdbcType=VARCHAR},
+            </if>
+            <if test="unionId != null">
+                union_id = #{unionId,jdbcType=VARCHAR},
+            </if>
+            <if test="headImage != null">
+                head_image = #{headImage,jdbcType=VARCHAR},
+            </if>
+            <if test="isCompany != null">
+                is_company = #{isCompany,jdbcType=INTEGER},
+            </if>
+            <if test="isValidate != null">
+                is_validate = #{isValidate,jdbcType=INTEGER},
+            </if>
+            <if test="isEnable != null">
+                is_enable = #{isEnable,jdbcType=INTEGER},
+            </if>
+            <if test="state != null">
+                state = #{state,jdbcType=INTEGER},
+            </if>
+            <if test="createUser != null">
+                create_user = #{createUser,jdbcType=CHAR},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="modifiedUser != null">
+                modified_user = #{modifiedUser,jdbcType=CHAR},
+            </if>
+            <if test="modifiedTime != null">
+                modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        where guid = #{guid,jdbcType=CHAR}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="CustomerInfo">
     update t_customer_info
     set account = #{account,jdbcType=VARCHAR},
       passwd = #{passwd,jdbcType=VARCHAR},