|
@@ -425,52 +425,52 @@ public class ElectronicMembershipCardController {
|
|
}
|
|
}
|
|
|
|
|
|
//电子卡消费公众号通知
|
|
//电子卡消费公众号通知
|
|
-// if(cardInfo.getBlogOpenid() !=null){
|
|
|
|
-// String gzhAppId ="";
|
|
|
|
-// String gzhAppSecret ="";
|
|
|
|
-// Map<String, String> m = stationService.getStationAppIdAndAppSecret(cardInfo.getStationId());
|
|
|
|
-// if(m !=null && m.containsKey("stationName") && m.containsKey("gzhAppId") && m.containsKey("gzhAppSecret")){
|
|
|
|
-// stationName = m.get("stationName");
|
|
|
|
-// gzhAppId = m.get("gzhAppId");
|
|
|
|
-// gzhAppSecret = m.get("gzhAppSecret");
|
|
|
|
-// //推送模板
|
|
|
|
-// List<WxMpTemplateData> wxMpTemplate = new ArrayList<>();
|
|
|
|
-// wxMpTemplate.add(new WxMpTemplateData("first","尊敬的"+cardInfo.getCustomerName()+",您好:\n" + "您在"+stationName+"的最新消费交易信息如下"));
|
|
|
|
-// wxMpTemplate.add(new WxMpTemplateData("keyword1", new SimpleDateFormat("yyyy年MM月dd日HH时mm分").format(new Date())));
|
|
|
|
-// wxMpTemplate.add(new WxMpTemplateData("keyword2", stationName));
|
|
|
|
-// wxMpTemplate.add(new WxMpTemplateData("keyword3", oilName));
|
|
|
|
-// wxMpTemplate.add(new WxMpTemplateData("keyword4", "电子卡"));
|
|
|
|
-// wxMpTemplate.add(new WxMpTemplateData("keyword5", amt));
|
|
|
|
-// wxMpTemplate.add(new WxMpTemplateData("remark","感谢您在"+stationName+"本次消费,当前还剩余额 "+c.getAmt()+"元,祝您生活愉快~!"));
|
|
|
|
-// GzhNewsTemplate gzhNewsTemplate = new GzhNewsTemplate();
|
|
|
|
-// gzhNewsTemplate.setStationId(cardInfo.getStationId());
|
|
|
|
-// gzhNewsTemplate.setTemplateType("5");
|
|
|
|
-// GzhNewsTemplate gzhNewsTemplateInfo = gzhNewsTemplateService.getGzhNewsTemplate(gzhNewsTemplate);
|
|
|
|
-// if(gzhNewsTemplateInfo !=null && gzhNewsTemplateInfo.getTemplateId() !=null){
|
|
|
|
-// wxPushUtil.push(gzhAppId, gzhAppSecret, gzhNewsTemplateInfo.getTemplateId(), cardInfo.getBlogOpenid(), wxMpTemplate);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ if(cardInfo.getBlogOpenid() !=null){
|
|
|
|
+ String gzhAppId ="";
|
|
|
|
+ String gzhAppSecret ="";
|
|
|
|
+ Map<String, String> m = stationService.getStationAppIdAndAppSecret(cardInfo.getStationId());
|
|
|
|
+ if(m !=null && m.containsKey("stationName") && m.containsKey("gzhAppId") && m.containsKey("gzhAppSecret")){
|
|
|
|
+ stationName = m.get("stationName");
|
|
|
|
+ gzhAppId = m.get("gzhAppId");
|
|
|
|
+ gzhAppSecret = m.get("gzhAppSecret");
|
|
|
|
+ //推送模板
|
|
|
|
+ List<WxMpTemplateData> wxMpTemplate = new ArrayList<>();
|
|
|
|
+ wxMpTemplate.add(new WxMpTemplateData("first","尊敬的"+cardInfo.getCustomerName()+",您好:\n" + "您在"+stationName+"的最新消费交易信息如下"));
|
|
|
|
+ wxMpTemplate.add(new WxMpTemplateData("keyword1", new SimpleDateFormat("yyyy年MM月dd日HH时mm分").format(new Date())));
|
|
|
|
+ wxMpTemplate.add(new WxMpTemplateData("keyword2", stationName));
|
|
|
|
+ wxMpTemplate.add(new WxMpTemplateData("keyword3", oilName));
|
|
|
|
+ wxMpTemplate.add(new WxMpTemplateData("keyword4", "电子卡"));
|
|
|
|
+ wxMpTemplate.add(new WxMpTemplateData("keyword5", amt));
|
|
|
|
+ wxMpTemplate.add(new WxMpTemplateData("remark","感谢您在"+stationName+"本次消费,当前还剩余额 "+c.getAmt()+"元,祝您生活愉快~!"));
|
|
|
|
+ GzhNewsTemplate gzhNewsTemplate = new GzhNewsTemplate();
|
|
|
|
+ gzhNewsTemplate.setStationId(cardInfo.getStationId());
|
|
|
|
+ gzhNewsTemplate.setTemplateType("5");
|
|
|
|
+ GzhNewsTemplate gzhNewsTemplateInfo = gzhNewsTemplateService.getGzhNewsTemplate(gzhNewsTemplate);
|
|
|
|
+ if(gzhNewsTemplateInfo !=null && gzhNewsTemplateInfo.getTemplateId() !=null){
|
|
|
|
+ wxPushUtil.push(gzhAppId, gzhAppSecret, gzhNewsTemplateInfo.getTemplateId(), cardInfo.getBlogOpenid(), wxMpTemplate);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
int integral =0;
|
|
int integral =0;
|
|
-// StationPayManage stationPayManage = new StationPayManage();
|
|
|
|
-// stationPayManage.setStationId(Integer.valueOf(stationId));
|
|
|
|
-// StationPayManage stationPayManageInfo = stationService.selectStationPayManage(stationPayManage);
|
|
|
|
-// //是否启用积分功能
|
|
|
|
-// if(stationPayManageInfo !=null && stationPayManageInfo.getIntegralFlag().equals("1")){
|
|
|
|
-// //计算积分
|
|
|
|
-// CalculateIntegral calculateIntegral = new CalculateIntegral();
|
|
|
|
-// calculateIntegral.setAmt(new BigDecimal(amt));
|
|
|
|
-// calculateIntegral.setReceivableAmt(new BigDecimal(receivableAmt));
|
|
|
|
-// calculateIntegral.setOilLiters(new BigDecimal(oilLiters));
|
|
|
|
-// calculateIntegral.setOilName(oilName);
|
|
|
|
-// calculateIntegral.setOilType(orderType);
|
|
|
|
-// calculateIntegral.setStationId(Integer.valueOf(stationId));
|
|
|
|
-// calculateIntegral.setUnionId(unionId);
|
|
|
|
-// calculateIntegral.setOpenId(minaOpenid); //小程序openId
|
|
|
|
-// //计算积分且推送积分
|
|
|
|
-// integral = calculateIntegralAndPushIntegral(calculateIntegral, customerManage);
|
|
|
|
-// }
|
|
|
|
|
|
+ StationPayManage stationPayManage = new StationPayManage();
|
|
|
|
+ stationPayManage.setStationId(Integer.valueOf(stationId));
|
|
|
|
+ StationPayManage stationPayManageInfo = stationService.selectStationPayManage(stationPayManage);
|
|
|
|
+ //是否启用积分功能
|
|
|
|
+ if(stationPayManageInfo !=null && stationPayManageInfo.getIntegralFlag().equals("1")){
|
|
|
|
+ //计算积分
|
|
|
|
+ CalculateIntegral calculateIntegral = new CalculateIntegral();
|
|
|
|
+ calculateIntegral.setAmt(new BigDecimal(amt));
|
|
|
|
+ calculateIntegral.setReceivableAmt(new BigDecimal(receivableAmt));
|
|
|
|
+ calculateIntegral.setOilLiters(new BigDecimal(oilLiters));
|
|
|
|
+ calculateIntegral.setOilName(oilName);
|
|
|
|
+ calculateIntegral.setOilType(orderType);
|
|
|
|
+ calculateIntegral.setStationId(Integer.valueOf(stationId));
|
|
|
|
+ calculateIntegral.setUnionId(unionId);
|
|
|
|
+ calculateIntegral.setOpenId(minaOpenid); //小程序openId
|
|
|
|
+ //计算积分且推送积分
|
|
|
|
+ integral = calculateIntegralAndPushIntegral(calculateIntegral, customerManage);
|
|
|
|
+ }
|
|
resultData = ResultData.success(CodeMsg.SUCCESS);
|
|
resultData = ResultData.success(CodeMsg.SUCCESS);
|
|
//打印小票
|
|
//打印小票
|
|
this.printReceipt(payOrder);
|
|
this.printReceipt(payOrder);
|