Sfoglia il codice sorgente

客户管理修改

jk-GitHub-coder 4 anni fa
parent
commit
56198e5bfd

+ 19 - 31
YijiaRestful/src/main/java/com/platform/yijia/controller/ElectronicMembershipCardController.java

@@ -148,7 +148,8 @@ public class ElectronicMembershipCardController {
                     //循环优惠规则明细
                     for (CustomerCardSettingDetail cardDetail : cardRechargeSettingList.get(0).getCustomerCardSettingDetailList()){
                         if(cardDetail.getStatus() !=null && cardDetail.getStatus().equals("1")){
-                            if(amt.compareTo(cardDetail.getDiscountAmtEnd()) ==-1 || amt.compareTo(cardDetail.getDiscountAmtEnd()) ==0){
+                            //|| amt.compareTo(cardDetail.getDiscountAmtEnd()) ==0
+                            if(amt.compareTo(cardDetail.getDiscountAmtStart()) ==1 || amt.compareTo(cardDetail.getDiscountAmtStart()) ==0){
                                 //String isDiscountCoupon = cardRechargeSettingList.get(0).getIsDiscountCoupon();       //是否使用优惠券
                                 //充值优惠类型
                                 if(cardDetail.getSettingRuleType().equals("1")){ //按充值金额
@@ -275,6 +276,7 @@ public class ElectronicMembershipCardController {
             payOrder.setOrderNo(ordNo);
             //获取用户订单信息
             Map<String, Object> resultMap = payOrderService.getOrderInfoAndUserInfoByOrderNo(payOrder);
+            logger.info("电子卡支付时用户订单信息和用户信息:", resultMap.toString());
             if(resultMap !=null && resultMap.get("status").toString().equals("0")){
                 String stationId = resultMap.get("stationId").toString();
                 String oilName =resultMap.get("oilName").toString();
@@ -366,12 +368,14 @@ public class ElectronicMembershipCardController {
                     //获取该油站的优惠方式
                     String discountPlanType = stationService.getStationDiscountWay(stationId);
                     logger.info("油站优惠方式:"+discountPlanType);
+                    //获取客户会员信息
                     CustomerManage customerManageInfo = customerManagerService.getCustomerManageInfo(customerManage);
                     customerManage.setGroupId(Integer.valueOf(groupId));
                     if(customerManageInfo !=null){
                         //此处用于更新没有会员ID的用户
                         if(!StringUtils.isNotBlank(customerManageInfo.getMemberId())){
-                            this.updateCustomerManagerMemberId(resultMap);
+                            String customerId=groupId+stationId+System.nanoTime();
+                            customerManage.setMemberId(customerId);
                         }
                         customerManage.setGroupId(Integer.valueOf(groupId));
                         customerManage.setPhoneNumber(mobilePhone);
@@ -410,7 +414,19 @@ public class ElectronicMembershipCardController {
                         }
                         //客户会员号
                         String memberId=groupId+stationId+System.nanoTime();
-                        customerManage.setMemberId(memberId);
+                        CustomerManage cm = new CustomerManage();
+                        cm.setStationId(Integer.valueOf(stationId));
+                        cm.setPhoneNumber(mobilePhone);
+                        List<CustomerManage> customerManageInfoList = customerManagerService.getCustomerManageInfoList(cm);
+                        if(customerManageInfoList !=null && customerManageInfoList.size()>0){
+                            if(StringUtils.isNotBlank(customerManageInfoList.get(0).getMemberId())){
+                                customerManage.setMemberId(customerManageInfoList.get(0).getMemberId());
+                            }else {
+                                customerManage.setMemberId(memberId);
+                            }
+                        }else {
+                            customerManage.setMemberId(memberId);
+                        }
                         customerManagerService.insertCustomerInfo(customerManage);
                     }
 
@@ -479,34 +495,6 @@ public class ElectronicMembershipCardController {
         }
     }
 
-    //更新客户ID
-    public void updateCustomerManagerMemberId(Map infoMap){
-        CustomerManage customerManage  = new CustomerManage();
-        String customerId=infoMap.get("groupId").toString()+infoMap.get("stationId").toString()+System.nanoTime();
-        customerManage.setMemberId(customerId);
-        customerManage.setUnionId(infoMap.get("unionId").toString());
-        customerManage.setStationId(Integer.valueOf(infoMap.get("groupId").toString()));
-        customerManagerService.updateCustomerInfo(customerManage);
-
-    }
-
-//    //插入集团客户信息
-//    public CustomerGroup insertCustomerGroup(Map infoMap){
-//        CustomerGroup customerGroup = new CustomerGroup();
-//        customerGroup.setGroupId(Integer.valueOf(infoMap.get("groupId").toString()));
-//        customerGroup.setUnionId(infoMap.get("unionId").toString());
-//        CustomerGroup customerGroupInfo = customerManagerService.selectCustomerGroup(customerGroup);
-//        if(customerGroupInfo ==null){
-//            customerGroup.setPhoneNumber(infoMap.get("mobilePhone").toString());
-//            //客户ID格式:集团+油站+时间戳
-//            String customerId=infoMap.get("groupId").toString()+infoMap.get("stationId").toString()+System.nanoTime();
-//            customerGroup.setCustomerId(customerId);
-//            logger.info("集团客户会员ID: " +customerId);
-//            customerManagerService.insertCustomerGroup(customerGroup);
-//        }
-//        return customerGroup;
-//    }
-
     /**
      * 打印小票
      */

+ 17 - 30
YijiaRestful/src/main/java/com/platform/yijia/controller/PayController.java

@@ -602,33 +602,6 @@ public class PayController {
         }
     }
 
-    //更新客户ID
-    public void updateCustomerManagerMemberId(Map infoMap){
-        CustomerManage customerManage  = new CustomerManage();
-        String customerId=infoMap.get("groupId").toString()+infoMap.get("stationId").toString()+System.nanoTime();
-        customerManage.setMemberId(customerId);
-        customerManage.setUnionId(infoMap.get("unionId").toString());
-        customerManage.setStationId(Integer.valueOf(infoMap.get("groupId").toString()));
-        customerManagerService.updateCustomerInfo(customerManage);
-
-    }
-
-    //插入集团客户信息
-//    public CustomerGroup insertCustomerGroup(Map infoMap){
-//        CustomerGroup customerGroup = new CustomerGroup();
-//        customerGroup.setGroupId(Integer.valueOf(infoMap.get("groupId").toString()));
-//        customerGroup.setUnionId(infoMap.get("unionId").toString());
-//        CustomerGroup customerGroupInfo = customerManagerService.selectCustomerGroup(customerGroup);
-//        if(customerGroupInfo ==null){
-//            customerGroup.setPhoneNumber(infoMap.get("mobilePhone").toString());
-//            //客户ID格式:集团+油站+时间戳
-//            String customerId=infoMap.get("groupId").toString()+infoMap.get("stationId").toString()+System.nanoTime();
-//            customerGroup.setCustomerId(customerId);
-//            customerManagerService.insertCustomerGroup(customerGroup);
-//        }
-//        return customerGroup;
-//    }
-
     /***
      * 插入客户信息
      * @param infoMap
@@ -688,7 +661,7 @@ public class PayController {
         customerManage.setOilName(infoMap.get("oilName").toString());    //油品名称
         customerManage.setStationName(infoMap.get("stationName").toString());   //存入油站名称
 
-        CustomerManage existCustomer = payOrderService.isExistCustomer(customerManage);         //已存在用户信息 existCustomer
+        CustomerManage existCustomer = customerManagerService.getCustomerManageInfo(customerManage);         //已存在用户信息 existCustomer
         logger.info("查询出客户是否存在数据 null表示没有: " + existCustomer);
 
         //获取该油站的优惠方式
@@ -705,7 +678,8 @@ public class PayController {
 
             //此处用于更新没有会员ID的用户
             if(!StringUtils.isNotBlank(existCustomer.getMemberId())){
-                this.updateCustomerManagerMemberId(infoMap);
+                String customerId=infoMap.get("groupId").toString()+infoMap.get("stationId").toString()+System.nanoTime();
+                customerManage.setMemberId(customerId);
             }
 
             if(infoMap.containsKey("orderType") && infoMap.get("orderType").equals("1")) {
@@ -750,7 +724,20 @@ public class PayController {
             logger.info("不存在客户 新增时参数: " + customerManage.toString());
             //客户会员号
             String memberId=infoMap.get("groupId").toString()+infoMap.get("stationId").toString()+System.nanoTime();
-            customerManage.setMemberId(memberId);
+            //客户会员号
+            CustomerManage cm = new CustomerManage();
+            cm.setStationId(Integer.valueOf(infoMap.get("stationId").toString()));
+            cm.setPhoneNumber(infoMap.get("mobilePhone").toString());
+            List<CustomerManage> customerManageInfoList = customerManagerService.getCustomerManageInfoList(cm);
+            if(customerManageInfoList !=null && customerManageInfoList.size()>0){
+                if(StringUtils.isNotBlank(customerManageInfoList.get(0).getMemberId())){
+                    customerManage.setMemberId(customerManageInfoList.get(0).getMemberId());
+                }else {
+                    customerManage.setMemberId(memberId);
+                }
+            }else {
+                customerManage.setMemberId(memberId);
+            }
             customerManagerService.insertCustomerInfo(customerManage);
             //payOrderService.insertCustomer(customerManage);//不存在 新增
         }

+ 27 - 14
YijiaRestful/src/main/java/com/platform/yijia/controller/PayOrderController.java

@@ -507,7 +507,8 @@ public class PayOrderController {
                         discountAmt = oilLiters.multiply(new BigDecimal(customerGradeInfo.get(0).get("gasoilDiscountLitre").toString()));
                         discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                         amt = receivableAmt_b.subtract(discountAmt);
-                        discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                        discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                        //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                         resultMap.put("discountAmt", discountAmt.doubleValue());
                         resultMap.put("amt", amt.doubleValue());
                         resultMap.put("oilLiters", oilLiters.doubleValue());
@@ -522,7 +523,8 @@ public class PayOrderController {
                             discountAmt = oilLiters.multiply(new BigDecimal(customerGradeList.get(0).get("gasoilDiscountLitre").toString()));
                             discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                             amt = receivableAmt_b.subtract(discountAmt);
-                            discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                            discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                            //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                             resultMap.put("discountAmt", discountAmt.doubleValue());
                             resultMap.put("amt", amt.doubleValue());
                             resultMap.put("oilLiters", oilLiters.doubleValue());
@@ -553,13 +555,14 @@ public class PayOrderController {
                             discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                             amt = receivableAmt_b.subtract(discountAmt);   //实收金额
                             oilLiters = receivableAmt_b.divide(new BigDecimal(oilPrice),2, BigDecimal.ROUND_HALF_UP);   //加油升数
-                            discountPrice = amt.divide(oilLiters,2,BigDecimal.ROUND_HALF_UP);        //优惠价格
+                            discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                            //discountPrice = amt.divide(oilLiters,2,BigDecimal.ROUND_HALF_UP);        //优惠价格
                             switch (vipDiscountyPlus){
                                 case "1":
                                     Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
                                     discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
                                     amt = amt.subtract(discountAmt);
-                                    discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                    discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                                     resultMap.put("discountAmt", discountAmt.doubleValue());
                                     resultMap.put("amt", amt.doubleValue());
                                     resultMap.put("oilLiters", oilLiters.doubleValue());
@@ -578,7 +581,8 @@ public class PayOrderController {
                                     Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
                                     discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
                                     amt = amt.subtract(discountAmt);
-                                    discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                    //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                    discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                                     resultMap.put("discountAmt", discountAmt.doubleValue());
                                     resultMap.put("amt", amt.doubleValue());
                                     resultMap.put("oilLiters", oilLiters.doubleValue());
@@ -615,13 +619,15 @@ public class PayOrderController {
                             discountAmt = gasoilDiscountAmt_b;  //优惠金额
                             amt = receivableAmt_b.subtract(gasoilDiscountAmt_b);   //实收金额
                             oilLiters = receivableAmt_b.divide(new BigDecimal(oilPrice), 2, BigDecimal.ROUND_HALF_UP);   //加油升数
-                            discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);        //优惠价格
+                            discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                            //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);        //优惠价格
                             switch (vipDiscountyPlus){
                                 case "1":
                                     Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
                                     discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
                                     amt = amt.subtract(discountAmt);
-                                    discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                    discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                    //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                                     resultMap.put("discountAmt", discountAmt.doubleValue());
                                     resultMap.put("amt", amt.doubleValue());
                                     resultMap.put("oilLiters", oilLiters.doubleValue());
@@ -641,7 +647,8 @@ public class PayOrderController {
                                     Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
                                     discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
                                     amt = amt.subtract(discountAmt);
-                                    discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                    discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                    //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                                     resultMap.put("discountAmt", discountAmt.doubleValue());
                                     resultMap.put("amt", amt.doubleValue());
                                     resultMap.put("oilLiters", oilLiters.doubleValue());
@@ -681,14 +688,16 @@ public class PayOrderController {
                                     discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
                                     discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                                     amt = receivableAmt_b.subtract(discountAmt);
-                                    discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);        //优惠价格
+                                    discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                    //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);        //优惠价格
                                     //是否共享会员优惠叠加
                                     String vipDiscountyPlus_3 = m.get("vipDiscountyPlus").toString();
                                     if(vipDiscountyPlus_3.equals("1")){
                                         Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
                                         discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
                                         amt = amt.subtract(discountAmt);
-                                        discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                        discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                        //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                                     }
                                     resultMap.put("discountAmt", discountAmt.doubleValue());
                                     resultMap.put("amt", amt.doubleValue());
@@ -702,14 +711,16 @@ public class PayOrderController {
                                     discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
                                     discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                                     amt = receivableAmt_b.subtract(discountAmt);
-                                    discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);        //优惠价格
+                                    discountPrice = oilLiters !=new BigDecimal("0.00") ? amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP) : new BigDecimal(oilPrice);
+                                    //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);        //优惠价格
                                     //是否共享会员优惠叠加
                                     String vipDiscountyPlus_3 = m.get("vipDiscountyPlus").toString();
                                     if(vipDiscountyPlus_3.equals("1")){
                                         Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
                                         discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
                                         amt = amt.subtract(discountAmt);
-                                        discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                        discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                                        //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                                     }
                                     resultMap.put("discountAmt", discountAmt.doubleValue());
                                     resultMap.put("amt", amt.doubleValue());
@@ -759,7 +770,8 @@ public class PayOrderController {
             discountAmt = oilLiters.multiply(new BigDecimal(customerGradeInfo.get(0).get("gasoilDiscountLitre").toString()));
             discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
             amt = receivableAmt_b.subtract(discountAmt);
-            discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+            discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+            //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
             resultMap.put("discountAmt", discountAmt.doubleValue());
             resultMap.put("amt", amt.doubleValue());
             resultMap.put("oilLiters", oilLiters.doubleValue());
@@ -774,7 +786,8 @@ public class PayOrderController {
                 discountAmt = oilLiters.multiply(new BigDecimal(customerGradeList.get(0).get("gasoilDiscountLitre").toString()));
                 discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                 amt = receivableAmt_b.subtract(discountAmt);
-                discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
+                //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
                 resultMap.put("discountAmt", discountAmt.doubleValue());
                 resultMap.put("amt", amt.doubleValue());
                 resultMap.put("oilLiters", oilLiters.doubleValue());

+ 5 - 6
YijiaRestful/src/main/java/com/platform/yijia/dao/CustomerManagerMapper.java

@@ -3,19 +3,18 @@ package com.platform.yijia.dao;
 import com.platform.yijia.pojo.CustomerGroup;
 import com.platform.yijia.pojo.CustomerManage;
 
+import java.util.List;
+
 public interface CustomerManagerMapper {
     //查询油站客户信息
     CustomerManage getCustomerManageInfo(CustomerManage customerManage);
 
+    //查询客户信息
+    List<CustomerManage> getCustomerManageInfoList(CustomerManage customerManage);
+
     //更新客户信息
     void updateCustomerInfo(CustomerManage customerManage);
 
     //插入客户信息
     void insertCustomerInfo(CustomerManage customerManage);
-
-    //查询客户集团
-    CustomerGroup selectCustomerGroup(CustomerGroup customerGroup);
-
-    //插入集团客户表
-    void insertCustomerGroup(CustomerGroup customerGroup);
 }

+ 3 - 8
YijiaRestful/src/main/java/com/platform/yijia/service/CustomerManagerService.java

@@ -1,9 +1,7 @@
 package com.platform.yijia.service;
 
 
-import com.platform.yijia.pojo.CustomerGroup;
 import com.platform.yijia.pojo.CustomerManage;
-import com.platform.yijia.pojo.IntegralRule;
 
 import java.util.List;
 
@@ -12,16 +10,13 @@ public interface CustomerManagerService {
     //查询油站客户信息
     CustomerManage getCustomerManageInfo(CustomerManage customerManage);
 
+    //查询客户信息
+    List<CustomerManage> getCustomerManageInfoList(CustomerManage customerManage);
+
     //更新客户信息
     void updateCustomerInfo(CustomerManage customerManage);
 
     //插入客户信息
     void insertCustomerInfo(CustomerManage customerManage);
 
-    //查询客户集团
-    CustomerGroup selectCustomerGroup(CustomerGroup customerGroup);
-
-    //插入集团客户表
-    void insertCustomerGroup(CustomerGroup customerGroup);
-
 }

+ 6 - 12
YijiaRestful/src/main/java/com/platform/yijia/service/impl/CustomerManagerServiceImpl.java

@@ -7,24 +7,13 @@ import com.platform.yijia.service.CustomerManagerService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 @Service("customerManagerService")
 public class CustomerManagerServiceImpl implements CustomerManagerService {
     @Resource
     private CustomerManagerMapper customerManagerMapper;
 
-    //查询集团客户信息
-    @Override
-    public CustomerGroup selectCustomerGroup(CustomerGroup customerGroup) {
-        return customerManagerMapper.selectCustomerGroup(customerGroup);
-    }
-
-    //插入集团客户表
-    @Override
-    public void insertCustomerGroup(CustomerGroup customerGroup) {
-        customerManagerMapper.insertCustomerGroup(customerGroup);
-    }
-
     //更新客户信息
     @Override
     public void updateCustomerInfo(CustomerManage customerManage) {
@@ -42,4 +31,9 @@ public class CustomerManagerServiceImpl implements CustomerManagerService {
     public CustomerManage getCustomerManageInfo(CustomerManage customerManage) {
         return customerManagerMapper.getCustomerManageInfo(customerManage);
     }
+
+    @Override
+    public List<CustomerManage> getCustomerManageInfoList(CustomerManage customerManage) {
+        return customerManagerMapper.getCustomerManageInfoList(customerManage);
+    }
 }

+ 24 - 46
YijiaRestful/src/main/resources/mapper/CustomerManagerMapper.xml

@@ -34,19 +34,6 @@
       <result column="group_id"                 jdbcType="INTEGER"      property="groupId" />
   </resultMap>
 
-    <!--集团客户信息返回结果-->
-    <resultMap id="customerGroupBaseResultMap" type="com.platform.yijia.pojo.CustomerGroup">
-        <result column="customer_id"              jdbcType="VARCHAR"      property="customerId" />
-        <result column="union_id"                 jdbcType="VARCHAR"      property="unionId" />
-        <result column="phone_number"             jdbcType="VARCHAR"      property="phoneNumber" />
-        <result column="group_id"                 jdbcType="INTEGER"      property="groupId" />
-    </resultMap>
-
-    <!--查询集团客户列-->
-    <sql id="Base_Column_List_CustomerGroup">
-        customer_id, union_id, phone_number, group_id
-    </sql>
-
     <!--查询-->
     <sql id="Base_Column_List">
         id, member_id, customer_name, commend_man, member_grade, phone_number, car_number, balance,
@@ -55,39 +42,6 @@
         liters, amt, union_id, group_id
     </sql>
 
-    <!--获取客户信息-->
-<!--    <select id="selectCustomerMannagerInfo" parameterType="com.platform.yijia.pojo.CustomerManage" resultMap="BaseResultMap">-->
-<!--        SELECT-->
-<!--            <include refid="Base_Column_List"/>-->
-<!--        FROM-->
-<!--            customer_manage-->
-<!--        <where>-->
-<!--            <if test="stationId !=null">-->
-<!--                station_id = #{stationId}-->
-<!--            </if>-->
-<!--            <if test="unionId !=null">-->
-<!--                AND union_id = #{unionId}-->
-<!--            </if>-->
-<!--        </where>-->
-
-<!--    </select>-->
-
-
-    <!--查询集团下客户信息-->
-    <select id="selectCustomerGroup" parameterType="com.platform.yijia.pojo.CustomerGroup" resultMap="customerGroupBaseResultMap">
-        SELECT
-            <include refid="Base_Column_List_CustomerGroup"/>
-        FROM
-            customer_group
-        <where>
-            <if test="unionId !=null and unionId !=''">
-                union_id = #{unionId}
-            </if>
-            <if test="groupId !=null">
-                AND group_id = #{groupId}
-            </if>
-        </where>
-    </select>
 
     <!--插入集团客户信息-->
     <insert id="insertCustomerGroup" parameterType="com.platform.yijia.pojo.CustomerGroup">
@@ -149,6 +103,30 @@
     </where>
   </select>
 
+
+    <!--查询油站客户信息查询出多条-->
+    <select id="getCustomerManageInfoList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.CustomerManage">
+        SELECT
+            <include refid="Base_Column_List" />
+        FROM
+            customer_manage
+        <where>
+            <if test="stationId !=null and stationId !=''">
+                station_id = #{stationId}
+            </if>
+            <if test="phoneNumber !=null and phoneNumber !='' ">
+                AND phone_number = #{phoneNumber}
+            </if>
+            <if test="minaOpenid !=null and minaOpenid !=''">
+                AND mina_openid = #{minaOpenid}
+            </if>
+            <if test="unionId !=null and unionId !=''">
+                AND union_id = #{unionId}
+            </if>
+        </where>
+    </select>
+
+
     <!-- 更新客户表 -->
     <update id="updateCustomerInfo" parameterType="com.platform.yijia.pojo.CustomerManage">
         UPDATE