|
@@ -630,6 +630,7 @@ public class PayOrderController {
|
|
|
CustomerElectronicCard electronicCardInfo = electronicMembershipCardService.getElectronicCardInfoByUnionId(customerElectronicCard);
|
|
|
BigDecimal balance = null;
|
|
|
String cardOilsType1 ="";
|
|
|
+
|
|
|
Map<String, String> result = new HashMap<>();
|
|
|
if(electronicCardInfo !=null){
|
|
|
balance = electronicCardInfo.getAmt();
|
|
@@ -638,7 +639,41 @@ public class PayOrderController {
|
|
|
result.put("oilsCardFlag", "1");
|
|
|
result.put("cardOilsType",cardOilsType1);
|
|
|
}else {
|
|
|
- result.put("oilsCardFlag", "0");
|
|
|
+ StationInfo stationInfo = new StationInfo();
|
|
|
+ stationInfo.setStationId(stationId);
|
|
|
+ StationInfo stationInfos = stationService.selectStationInfo(stationInfo);
|
|
|
+
|
|
|
+ CustomerCardSetting customerCardSetting = new CustomerCardSetting();
|
|
|
+ customerCardSetting.setStationId(stationId);
|
|
|
+ if(stationInfos.getCardRuleFlag().equals("1")){
|
|
|
+ customerCardSetting.setStationId(stationInfos.getGroupId());
|
|
|
+ }
|
|
|
+ customerCardSetting.setDelFlag("0");
|
|
|
+ //customerCardSetting.setCardOilsType(cardOilsType);
|
|
|
+ List<CustomerCardSetting> cardRechargeSettingList = electronicMembershipCardService.getCardRechargeSettingList(customerCardSetting);
|
|
|
+ if(cardRechargeSettingList !=null && cardRechargeSettingList.size()>0){
|
|
|
+ String cardOilsTypeExist = cardRechargeSettingList.get(0).getCardOilsType();
|
|
|
+ String[] split = cardOilsTypeExist.split(",");
|
|
|
+ List<String> strings = Arrays.asList(split);
|
|
|
+ if(strings.contains(cardOilsType)){
|
|
|
+ String currentTime = String.valueOf(System.currentTimeMillis());
|
|
|
+ String customerNo = stationId + currentTime;
|
|
|
+ customerElectronicCard.setCustomerNo(customerNo);
|
|
|
+ customerElectronicCard.setAmt(new BigDecimal(0));
|
|
|
+ customerElectronicCard.setCreateTime(new Date());
|
|
|
+ electronicMembershipCardService.insetElectronicCard(customerElectronicCard);
|
|
|
+ CustomerElectronicCard electronicCardInfoNew = electronicMembershipCardService.getElectronicCardInfoByUnionId(customerElectronicCard);
|
|
|
+ balance = electronicCardInfoNew.getAmt();
|
|
|
+ result.put("balance",balance.toString());
|
|
|
+ result.put("oilsCardFlag", "1");
|
|
|
+ result.put("cardOilsType",electronicCardInfoNew.getCardOilsType());
|
|
|
+ }else {
|
|
|
+ result.put("oilsCardFlag", "0");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ result.put("oilsCardFlag", "0");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
return result;
|
|
|
}
|