Переглянути джерело

电子储蓄卡消费生成积分记录

jk-GitHub-coder 4 роки тому
батько
коміт
4906188092

+ 1 - 1
YijiaRestful/src/main/java/com/platform/yijia/controller/IntegralShoppingMallController.java

@@ -207,7 +207,7 @@ public class IntegralShoppingMallController {
                         customerPointsRecord.setRecordType("-");    //客户积分表记录
                         customerPointsRecord.setCreateTime(new Date());
                         //插入客户积分记录
-                        customerPointsRecordService.insertCustomerPointsInfo(customerPointsRecord);
+                        customerPointsRecordService.insertCustomerPointsRecordInfo(customerPointsRecord);
 
                         integralOrder.setWaresPic(integralWaresInfo.getWaresPic());
                         integralOrder.setWaresDetail(integralWaresInfo.getWaresDetail());

+ 1 - 13
YijiaRestful/src/main/java/com/platform/yijia/controller/PayController.java

@@ -698,18 +698,6 @@ public class PayController {
                                 customerPointsRecord.setStationId(Integer.valueOf(infoMap.get("stationId").toString()));
                                 customerPointsRecord.setStationName(infoMap.get("stationName").toString());
                                 customerPointsRecord.setCreateTime(new Date());
-
-//                                if(infoMap.containsKey("userType") && infoMap.get("userType") !=null){
-//                                    switch (infoMap.get("userType").toString()){
-//                                        case "1":
-//                                            customerPoints.setBlogOpenId(infoMap.get("blogOpenid").toString());
-//                                            break;
-//                                        case "2":
-//                                            customerPoints.setMinaOpenId(infoMap.get("minaOpenid").toString());
-//                                            break;
-//                                    }
-//                                }
-
                                 //获取该用户积分信息
                                 CustomerPoints customerPointsInfo = customerPointsService.getCustomerPointsInfo(customerPoints);
                                 if(customerPointsInfo !=null){
@@ -801,7 +789,7 @@ public class PayController {
                                     //更新客户余额积分
                                     customerPointsService.updateCustomerPointsInfo(customerPoints);
                                     //插入客户积分记录表
-                                    customerPointsRecordService.insertCustomerPointsInfo(customerPointsRecord);
+                                    customerPointsRecordService.insertCustomerPointsRecordInfo(customerPointsRecord);
                                     //客户公众号积分增加通知
                                     //customerPoints.getBlogOpenId()
                                     //weiXinPushIntegralInfo(infoMap.get("stationId").toString(), infoMap.get("consumer").toString(), customerPointsRecord.getIntegral().toString(), customerPoints.getPoints().toString(), customerPoints.getBlogOpenId());

+ 12 - 1
YijiaRestful/src/main/java/com/platform/yijia/controller/PayOrderController.java

@@ -44,6 +44,8 @@ public class PayOrderController {
     private IntegralRuleService integralRuleService;
     @Resource
     private CustomerPointsService customerPointsService;
+    @Resource
+    private CustomerPointsRecordService customerPointsRecordService;
 
     //一键支付,生成订单
     @RequestMapping(value = "/AddPayOrderInfo", consumes = "application/json", method = RequestMethod.POST)
@@ -511,7 +513,7 @@ public class PayOrderController {
     }
 
     /**
-     * 计算使用电子会员卡消费生成积分
+     * 计算消费生成积分
      */
     public int calculateIntegral(CalculateIntegral calculateIntegral){
         int integral =0;
@@ -636,6 +638,15 @@ public class PayOrderController {
             if(customerPointsInfo !=null){
                 customerName =customerPointsInfo.getCustomerName();
                 surplusIntegral =new BigDecimal(customerPointsInfo.getPoints()).add(new BigDecimal(integral));
+                CustomerPointsRecord customerPointsRecord = new CustomerPointsRecord();
+                customerPointsRecord.setCreateTime(new Date());
+                customerPointsRecord.setCustomerName(customerName);
+                customerPointsRecord.setStationName(stationName);
+                customerPointsRecord.setStationId(stationId);
+                customerPointsRecord.setRecordType("+");
+                customerPointsRecord.setUnionId(customerPointsInfo.getUnionId());
+                customerPointsRecord.setIntegral(integral);
+                customerPointsRecordService.insertCustomerPointsRecordInfo(customerPointsRecord);
                 customerPoints.setUnionId(customerPointsInfo.getUnionId());
                 customerPoints.setPoints(surplusIntegral.intValue());
                 //更新客户积分

+ 1 - 1
YijiaRestful/src/main/java/com/platform/yijia/dao/CustomerPointsRecordMapper.java

@@ -10,5 +10,5 @@ public interface CustomerPointsRecordMapper {
     List<CustomerPointsRecord> getCustomerPointsRecordList(CustomerPointsRecord customerPointsRecord);
 
     //插入用户积分信息
-    void insertCustomerPointsInfo(CustomerPointsRecord customerPointsRecord);
+    void insertCustomerPointsRecordInfo(CustomerPointsRecord customerPointsRecord);
 }

+ 1 - 1
YijiaRestful/src/main/java/com/platform/yijia/service/CustomerPointsRecordService.java

@@ -11,5 +11,5 @@ public interface CustomerPointsRecordService {
     List<CustomerPointsRecord> getCustomerPointsRecordList(CustomerPointsRecord customerPointsRecord);
 
     //插入用户积分信息
-    void insertCustomerPointsInfo(CustomerPointsRecord customerPointsRecord);
+    void insertCustomerPointsRecordInfo(CustomerPointsRecord customerPointsRecord);
 }

+ 2 - 2
YijiaRestful/src/main/java/com/platform/yijia/service/impl/CustomerPointsRecordServiceImpl.java

@@ -20,7 +20,7 @@ public class CustomerPointsRecordServiceImpl implements CustomerPointsRecordServ
 
     //新增客户积分记录
     @Override
-    public void insertCustomerPointsInfo(CustomerPointsRecord customerPointsRecord) {
-        customerPointsRecordMapper.insertCustomerPointsInfo(customerPointsRecord);
+    public void insertCustomerPointsRecordInfo(CustomerPointsRecord customerPointsRecord) {
+        customerPointsRecordMapper.insertCustomerPointsRecordInfo(customerPointsRecord);
     }
 }

+ 1 - 1
YijiaRestful/src/main/resources/mapper/CustomerPointsRecordMapper.xml

@@ -39,7 +39,7 @@
   </select>
 
   <!--插入客户积分记录表-->
-  <insert id="insertCustomerPointsInfo" parameterType="com.platform.yijia.pojo.CustomerPoints">
+  <insert id="insertCustomerPointsRecordInfo" parameterType="com.platform.yijia.pojo.CustomerPoints">
     INSERT INTO customer_points_record
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="unionId !=null">