|
@@ -61,6 +61,8 @@ public class ElectronicMembershipCardController {
|
|
private StationOilGunService stationOilGunService;
|
|
private StationOilGunService stationOilGunService;
|
|
@Resource
|
|
@Resource
|
|
private SysDictDataService sysDictDataService;
|
|
private SysDictDataService sysDictDataService;
|
|
|
|
+ @Resource
|
|
|
|
+ private AppUserInfoService appUserInfoService;
|
|
@Value("${yijia.path.global-prefix}")
|
|
@Value("${yijia.path.global-prefix}")
|
|
private String globalPrefix;
|
|
private String globalPrefix;
|
|
|
|
|
|
@@ -93,48 +95,66 @@ public class ElectronicMembershipCardController {
|
|
stationInfo.setStationId(stationId);
|
|
stationInfo.setStationId(stationId);
|
|
StationInfo stationInfos = stationService.selectStationInfo(stationInfo);
|
|
StationInfo stationInfos = stationService.selectStationInfo(stationInfo);
|
|
if(stationInfos.getCardEnabledFlag().equals("1")){
|
|
if(stationInfos.getCardEnabledFlag().equals("1")){
|
|
- //1.获取当前油站所开启的电子卡种类
|
|
|
|
- CustomerCardSetting customerCardSetting = new CustomerCardSetting();
|
|
|
|
- customerCardSetting.setStationId(stationId);
|
|
|
|
- if(stationInfos.getCardRuleFlag().equals("1")){
|
|
|
|
- //集团下油站共享充值规则
|
|
|
|
- customerCardSetting.setStationId(stationInfos.getGroupId());
|
|
|
|
- }
|
|
|
|
- List<CustomerCardSetting> cardRechargeSettingList = electronicMembershipCardService.getCardRechargeSettingList(customerCardSetting);
|
|
|
|
- if(cardRechargeSettingList !=null && cardRechargeSettingList.size() >0){
|
|
|
|
- //2.获取油站开卡的种类
|
|
|
|
- String cardOilsType = cardRechargeSettingList.get(0).getCardOilsType();
|
|
|
|
- String[] cardOilsTypeArray = cardOilsType.split(",");
|
|
|
|
-
|
|
|
|
- //2.1查询客户现已拥有的电子卡
|
|
|
|
- CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard();
|
|
|
|
- customerElectronicCard.setStationId(customerCardSetting.getStationId());
|
|
|
|
- customerElectronicCard.setUnionId(unionId);
|
|
|
|
- String[] cardTypesArray = {};
|
|
|
|
- List<String> hasCard = Arrays.asList(cardTypesArray);
|
|
|
|
- List<CustomerElectronicCard> electronicCardList = electronicMembershipCardService.getElectronicCardList(customerElectronicCard);
|
|
|
|
- for(CustomerElectronicCard c : electronicCardList){
|
|
|
|
- hasCard.add(c.getCardOilsType());
|
|
|
|
- }
|
|
|
|
- List<String> cardOilsTypeArrayList = Arrays.asList(cardOilsTypeArray);
|
|
|
|
- //2.2获取客户要新增的电子卡
|
|
|
|
- for (int i=0; i<cardOilsTypeArrayList.size(); i++){
|
|
|
|
- for (int y=0; y< hasCard.size(); y++){
|
|
|
|
- if(cardOilsTypeArrayList.get(i).equals(hasCard.get(y))){
|
|
|
|
- cardOilsTypeArrayList.remove(i);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //3.依次生成该用户的电子卡
|
|
|
|
- System.out.println(cardOilsTypeArrayList);
|
|
|
|
- List<CustomerElectronicCard> listParam = new ArrayList<>();
|
|
|
|
- for(int i =0; i<cardOilsTypeArrayList.size(); i++){
|
|
|
|
- CustomerElectronicCard c = new CustomerElectronicCard();
|
|
|
|
- listParam.add(c);
|
|
|
|
- }
|
|
|
|
- //3.1批量插入
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+// //1.获取当前油站所开启的电子卡种类
|
|
|
|
+// CustomerCardSetting customerCardSetting = new CustomerCardSetting();
|
|
|
|
+// customerCardSetting.setStationId(stationId);
|
|
|
|
+// if(stationInfos.getCardRuleFlag().equals("1")){
|
|
|
|
+// //集团下油站共享充值规则
|
|
|
|
+// customerCardSetting.setStationId(stationInfos.getGroupId());
|
|
|
|
+// }
|
|
|
|
+// List<CustomerCardSetting> cardRechargeSettingList = electronicMembershipCardService.getCardRechargeSettingList(customerCardSetting);
|
|
|
|
+// if(cardRechargeSettingList !=null && cardRechargeSettingList.size() >0){
|
|
|
|
+// //2.获取油站开卡的种类
|
|
|
|
+// String cardOilsType = cardRechargeSettingList.get(0).getCardOilsType();
|
|
|
|
+// String[] cardOilsTypeArray = cardOilsType.split(",");
|
|
|
|
+//
|
|
|
|
+// //2.1查询客户现已拥有的电子卡
|
|
|
|
+// CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard();
|
|
|
|
+// customerElectronicCard.setStationId(customerCardSetting.getStationId());
|
|
|
|
+// customerElectronicCard.setUnionId(unionId);
|
|
|
|
+// String[] cardTypesArray = {};
|
|
|
|
+// List<String> hasCard = Arrays.asList(cardTypesArray);
|
|
|
|
+// List<CustomerElectronicCard> electronicCardList = electronicMembershipCardService.getElectronicCardList(customerElectronicCard);
|
|
|
|
+// for(CustomerElectronicCard c : electronicCardList){
|
|
|
|
+// hasCard.add(c.getCardOilsType());
|
|
|
|
+// }
|
|
|
|
+// List<String> cardOilsTypeArrayList = Arrays.asList(cardOilsTypeArray);
|
|
|
|
+// //2.2获取客户要新增的电子卡
|
|
|
|
+// for (int i=0; i<cardOilsTypeArrayList.size(); i++){
|
|
|
|
+// for (int y=0; y< hasCard.size(); y++){
|
|
|
|
+// if(cardOilsTypeArrayList.get(i).equals(hasCard.get(y))){
|
|
|
|
+// cardOilsTypeArrayList.remove(i);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// //3.依次生成该用户的电子卡
|
|
|
|
+// System.out.println(cardOilsTypeArrayList);
|
|
|
|
+// AppUserInfo appUserInfo = new AppUserInfo();
|
|
|
|
+// appUserInfo.setStationId(stationId);
|
|
|
|
+// appUserInfo.setUnionId(unionId);
|
|
|
|
+//
|
|
|
|
+// List<AppUserInfo> userInfo = appUserInfoService.getUserInfo(appUserInfo);
|
|
|
|
+// if(userInfo !=null ){
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+// List<CustomerElectronicCard> listParam = new ArrayList<>();
|
|
|
|
+// for(int i =0; i<cardOilsTypeArrayList.size(); i++){
|
|
|
|
+// CustomerElectronicCard c = new CustomerElectronicCard();
|
|
|
|
+// c.setStationId(stationId);
|
|
|
|
+// c.setUnionId(unionId);
|
|
|
|
+// c.setCreateTime(new Date());
|
|
|
|
+// c.setAmt(new BigDecimal(0));
|
|
|
|
+// c.setCardOilsType(cardOilsTypeArrayList.get(i));
|
|
|
|
+// //c.setBlogOpenid();
|
|
|
|
+// //c.setCustomerNo();
|
|
|
|
+// //c.setMobilePhone();
|
|
|
|
+// //c.setMinaOpenid();
|
|
|
|
+// listParam.add(c);
|
|
|
|
+// }
|
|
|
|
+// //3.1批量插入
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard();
|
|
CustomerElectronicCard customerElectronicCard = new CustomerElectronicCard();
|