|
@@ -244,7 +244,8 @@ public class PayOrderController {
|
|
payOrder.setDzkAmt(Double.valueOf(resultMap.get("amt").toString())); //订单电子会员卡消费金额
|
|
payOrder.setDzkAmt(Double.valueOf(resultMap.get("amt").toString())); //订单电子会员卡消费金额
|
|
CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard();
|
|
CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard();
|
|
customerElectronicCard.setCardOilsType(cardOilsType);
|
|
customerElectronicCard.setCardOilsType(cardOilsType);
|
|
- customerElectronicCard.setMinaOpenid(payOrderRequest.getOpenId());
|
|
|
|
|
|
+ //customerElectronicCard.setMinaOpenid(payOrderRequest.getOpenId());
|
|
|
|
+ customerElectronicCard.setUnionId(appUserInfoList.get(0).getUnionId());
|
|
customerElectronicCard.setStationId(payOrderRequest.getStationId());
|
|
customerElectronicCard.setStationId(payOrderRequest.getStationId());
|
|
//获取用户电子会员卡信息
|
|
//获取用户电子会员卡信息
|
|
CustomerElectronicCard cardInfo = electronicMembershipCardService.getElectronicCardInfoByMinaOpenId(customerElectronicCard);
|
|
CustomerElectronicCard cardInfo = electronicMembershipCardService.getElectronicCardInfoByMinaOpenId(customerElectronicCard);
|
|
@@ -305,7 +306,7 @@ public class PayOrderController {
|
|
}
|
|
}
|
|
customerManagerService.updateCustomerInfo(customerManage);
|
|
customerManagerService.updateCustomerInfo(customerManage);
|
|
}else {
|
|
}else {
|
|
- customerManage.setCommendMan(payOrder.getConsumer());
|
|
|
|
|
|
+ customerManage.setCustomerName(payOrder.getConsumer());
|
|
customerManage.setStationName(payOrder.getStationName());
|
|
customerManage.setStationName(payOrder.getStationName());
|
|
customerManage.setLiters(new BigDecimal(resultMap.get("oilLiters").toString()));
|
|
customerManage.setLiters(new BigDecimal(resultMap.get("oilLiters").toString()));
|
|
customerManage.setAmt(new BigDecimal(resultMap.get("amt").toString()));
|
|
customerManage.setAmt(new BigDecimal(resultMap.get("amt").toString()));
|
|
@@ -333,6 +334,7 @@ public class PayOrderController {
|
|
calculateIntegral.setOilName(payOrder.getOilName());
|
|
calculateIntegral.setOilName(payOrder.getOilName());
|
|
calculateIntegral.setOilType(payOrder.getOrderType());
|
|
calculateIntegral.setOilType(payOrder.getOrderType());
|
|
calculateIntegral.setStationId(payOrder.getStationId());
|
|
calculateIntegral.setStationId(payOrder.getStationId());
|
|
|
|
+ calculateIntegral.setUnionId(appUserInfoList.get(0).getUnionId());
|
|
calculateIntegral.setOpenId(payOrderRequest.getOpenId()); //小程序openId
|
|
calculateIntegral.setOpenId(payOrderRequest.getOpenId()); //小程序openId
|
|
//计算积分且推送积分
|
|
//计算积分且推送积分
|
|
//CustomerManage customerManage = new CustomerManage();
|
|
//CustomerManage customerManage = new CustomerManage();
|
|
@@ -763,7 +765,8 @@ public class PayOrderController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.pushIntegral(calculateIntegral.getStationId(), integral, calculateIntegral.getOpenId());
|
|
|
|
|
|
+ calculateIntegral.setIntegral(integral);
|
|
|
|
+ this.pushIntegral(calculateIntegral);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -773,7 +776,11 @@ public class PayOrderController {
|
|
* @param integral 本次所得积分
|
|
* @param integral 本次所得积分
|
|
* @param openId 小程序用户openID
|
|
* @param openId 小程序用户openID
|
|
*/
|
|
*/
|
|
- public void pushIntegral(Integer stationId, int integral, String openId){
|
|
|
|
|
|
+ public void pushIntegral(CalculateIntegral calculateIntegral){
|
|
|
|
+ Integer stationId = calculateIntegral.getStationId();
|
|
|
|
+ int integral = calculateIntegral.getIntegral();
|
|
|
|
+ String openId = calculateIntegral.getOpenId();
|
|
|
|
+ String unionId = calculateIntegral.getUnionId();
|
|
String gzhAppId ="";
|
|
String gzhAppId ="";
|
|
String gzhAppSecret ="";
|
|
String gzhAppSecret ="";
|
|
String stationName = ""; //油站名称
|
|
String stationName = ""; //油站名称
|
|
@@ -789,7 +796,8 @@ public class PayOrderController {
|
|
CustomerPoints customerPoints = new CustomerPoints();
|
|
CustomerPoints customerPoints = new CustomerPoints();
|
|
customerPoints.setStationId(stationId);
|
|
customerPoints.setStationId(stationId);
|
|
customerPoints.setMinaOpenId(openId);
|
|
customerPoints.setMinaOpenId(openId);
|
|
- CustomerPoints customerPointsInfo = customerPointsService.getCustomerPointsInfoByMinaOpenId(customerPoints);
|
|
|
|
|
|
+ customerPoints.setUnionId(unionId);
|
|
|
|
+ CustomerPoints customerPointsInfo = customerPointsService.getCustomerPointsInfoByUnionId(customerPoints);
|
|
if(customerPointsInfo !=null){
|
|
if(customerPointsInfo !=null){
|
|
customerName =customerPointsInfo.getCustomerName();
|
|
customerName =customerPointsInfo.getCustomerName();
|
|
surplusIntegral =new BigDecimal(customerPointsInfo.getPoints()).add(new BigDecimal(integral));
|
|
surplusIntegral =new BigDecimal(customerPointsInfo.getPoints()).add(new BigDecimal(integral));
|
|
@@ -817,8 +825,6 @@ public class PayOrderController {
|
|
wxMpTemplate.add(new WxMpTemplateData("From", stationName));
|
|
wxMpTemplate.add(new WxMpTemplateData("From", stationName));
|
|
wxMpTemplate.add(new WxMpTemplateData("remark",
|
|
wxMpTemplate.add(new WxMpTemplateData("remark",
|
|
"截止至" + new SimpleDateFormat(" yyyy年MM月dd日HH时mm分").format(new Date())+",您在"+stationName+"的可用积分为 "+surplusIntegral.toString()+" 分"));
|
|
"截止至" + new SimpleDateFormat(" yyyy年MM月dd日HH时mm分").format(new Date())+",您在"+stationName+"的可用积分为 "+surplusIntegral.toString()+" 分"));
|
|
- //String templateId = "G9tN--a3tGM5BN3otqZr73b4ErQCYWISSgyshbTqLYc"; //积分兑换成功通知模板
|
|
|
|
- //wxPushUtil.push(gzhAppId, gzhAppSecret, templateId, blogOpenId, wxMpTemplate); //oJR5R6r4EJhaORFcPap70r_mtFZo
|
|
|
|
GzhNewsTemplate gzhNewsTemplate = new GzhNewsTemplate();
|
|
GzhNewsTemplate gzhNewsTemplate = new GzhNewsTemplate();
|
|
gzhNewsTemplate.setStationId(stationId);
|
|
gzhNewsTemplate.setStationId(stationId);
|
|
gzhNewsTemplate.setTemplateType("1");
|
|
gzhNewsTemplate.setTemplateType("1");
|