|
@@ -653,34 +653,15 @@ public class AppUserInfoController {
|
|
customerPoints.setStationName(stationInfos.getStationName());
|
|
customerPoints.setStationName(stationInfos.getStationName());
|
|
customerElectronicCard.setStationName(stationInfos.getStationName());
|
|
customerElectronicCard.setStationName(stationInfos.getStationName());
|
|
}
|
|
}
|
|
-
|
|
|
|
- //
|
|
|
|
- //Integer excelId = null;
|
|
|
|
-
|
|
|
|
//是否开起积分功能
|
|
//是否开起积分功能
|
|
if(stationInfos.getIntegralRuleFlagGroup().equals("1")){
|
|
if(stationInfos.getIntegralRuleFlagGroup().equals("1")){
|
|
customerPoints.setStationId(stationInfos.getGroupId());
|
|
customerPoints.setStationId(stationInfos.getGroupId());
|
|
if(stationInfos.getIntegralFlagGroup().equals("1")){
|
|
if(stationInfos.getIntegralFlagGroup().equals("1")){
|
|
-// //积分导入
|
|
|
|
-// CardExcelImport cardExcelImport = this.selectCardExcelImportInfo(request.getMobilePhone(), customerPoints.getStationId());
|
|
|
|
-// if(cardExcelImport !=null && cardExcelImport.getIntegral() !=null){
|
|
|
|
-// excelId = cardExcelImport.getExcelId();
|
|
|
|
-// BigDecimal newPoints = new BigDecimal(customerPoints.getPoints().toString()).add(new BigDecimal(cardExcelImport.getIntegral().toString()));
|
|
|
|
-// customerPoints.setPoints(newPoints.intValue());
|
|
|
|
-// }
|
|
|
|
this.insertCustomerPointsInfo(customerPoints, request, stationInfos);
|
|
this.insertCustomerPointsInfo(customerPoints, request, stationInfos);
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
if(stationInfos.getIntegralFlag().equals("1")){
|
|
if(stationInfos.getIntegralFlag().equals("1")){
|
|
customerPoints.setStationId(request.getStationId());
|
|
customerPoints.setStationId(request.getStationId());
|
|
-// //积分导入
|
|
|
|
-// CardExcelImport cardExcelImport = this.selectCardExcelImportInfo(request.getMobilePhone(), customerPoints.getStationId());
|
|
|
|
-// if(cardExcelImport !=null && cardExcelImport.getIntegral() !=null){
|
|
|
|
-// excelId = cardExcelImport.getExcelId();
|
|
|
|
-// BigDecimal newPoints = new BigDecimal(customerPoints.getPoints().toString()).add(new BigDecimal(cardExcelImport.getIntegral().toString()));
|
|
|
|
-// customerPoints.setPoints(newPoints.intValue());
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
this.insertCustomerPointsInfo(customerPoints, request, stationInfos);
|
|
this.insertCustomerPointsInfo(customerPoints, request, stationInfos);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -697,6 +678,9 @@ public class AppUserInfoController {
|
|
this.insertCustomerElectronicCard(customerElectronicCard, request, stationInfos);
|
|
this.insertCustomerElectronicCard(customerElectronicCard, request, stationInfos);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //数据迁移
|
|
|
|
+ this.selectCardExcelImportInfo(request, stationInfos);
|
|
|
|
+
|
|
resultData = ResultData.success(CodeMsg.SUCCESS);
|
|
resultData = ResultData.success(CodeMsg.SUCCESS);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
resultData = ResultData.error(CodeMsg.INSERT_FAIL);
|
|
resultData = ResultData.error(CodeMsg.INSERT_FAIL);
|
|
@@ -751,7 +735,9 @@ public class AppUserInfoController {
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
|
|
+ * ********************************************************************************************************************** ******
|
|
* 数据迁移功能:业务逻辑: SAAS系统导入Excel表格数据到临时表,用户登录小程序时根据手机号和站点Id 找寻数据插入到客户电子卡表,积分表,成功后删除此条信息
|
|
* 数据迁移功能:业务逻辑: SAAS系统导入Excel表格数据到临时表,用户登录小程序时根据手机号和站点Id 找寻数据插入到客户电子卡表,积分表,成功后删除此条信息
|
|
|
|
+ * ********************************************************************************************************************** ******
|
|
*/
|
|
*/
|
|
public void selectCardExcelImportInfo(AppUserInfoRequest request, StationInfo stationInfos){
|
|
public void selectCardExcelImportInfo(AppUserInfoRequest request, StationInfo stationInfos){
|
|
|
|
|
|
@@ -759,12 +745,7 @@ public class AppUserInfoController {
|
|
if(StringUtils.isNotBlank(request.getMobilePhone())){
|
|
if(StringUtils.isNotBlank(request.getMobilePhone())){
|
|
String mobilePhone = request.getMobilePhone();
|
|
String mobilePhone = request.getMobilePhone();
|
|
//站点Id
|
|
//站点Id
|
|
- Integer stationId = stationInfos.getStationId();
|
|
|
|
- if(StringUtils.isNotBlank(stationInfos.getCardRuleFlagGroup()) && stationInfos.getCardRuleFlagGroup().equals("1")){
|
|
|
|
- if(StringUtils.isNotBlank(stationInfos.getCardEnabledFlagGroup()) &&stationInfos.getCouponEnabledFlag().equals("1")){
|
|
|
|
- stationId = stationInfos.getGroupId();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ Integer stationId = request.getStationId();
|
|
AppUserInfo a = new AppUserInfo();
|
|
AppUserInfo a = new AppUserInfo();
|
|
a.setMobilePhone(mobilePhone);
|
|
a.setMobilePhone(mobilePhone);
|
|
//app_user_info 存储的为集团Id
|
|
//app_user_info 存储的为集团Id
|
|
@@ -774,7 +755,7 @@ public class AppUserInfoController {
|
|
List<AppUserInfo> userInfoList = appUserInfoService.getUserInfo(a);
|
|
List<AppUserInfo> userInfoList = appUserInfoService.getUserInfo(a);
|
|
if(StringUtils.isNotBlank(userInfoList.get(0).getUnionId())){
|
|
if(StringUtils.isNotBlank(userInfoList.get(0).getUnionId())){
|
|
String unionId = userInfoList.get(0).getUnionId();
|
|
String unionId = userInfoList.get(0).getUnionId();
|
|
- logger.info("当前要导入用户的手机号和站点所对应的unionId:" +unionId);
|
|
|
|
|
|
+ logger.info("当前要导入用户的手机号和站点所对应的unionId:" +mobilePhone +" ; "+unionId);
|
|
|
|
|
|
//******* 1、根据油站Id和用户手机号查询该用户已有的信息; *******/
|
|
//******* 1、根据油站Id和用户手机号查询该用户已有的信息; *******/
|
|
CardExcelImport cei = new CardExcelImport();
|
|
CardExcelImport cei = new CardExcelImport();
|
|
@@ -784,7 +765,7 @@ public class AppUserInfoController {
|
|
logger.info("当前用户是否有导入信息:" + cardExcelImportList.toString());
|
|
logger.info("当前用户是否有导入信息:" + cardExcelImportList.toString());
|
|
if(cardExcelImportList !=null && cardExcelImportList.size() >0){
|
|
if(cardExcelImportList !=null && cardExcelImportList.size() >0){
|
|
|
|
|
|
- //***** 2、更新电子卡余额, 积分 标签到SAAS系统电子卡积分等信息;*/
|
|
|
|
|
|
+ //***** 2、更新电子卡余额, 积分 标签到SAAS系统电子卡积分等信息;*****/
|
|
String phoneNumber = cardExcelImportList.get(0).getPhoneNumber();
|
|
String phoneNumber = cardExcelImportList.get(0).getPhoneNumber();
|
|
Integer excelStaId = cardExcelImportList.get(0).getStationId();
|
|
Integer excelStaId = cardExcelImportList.get(0).getStationId();
|
|
if(StringUtils.isNotBlank(phoneNumber) && excelStaId !=null){
|
|
if(StringUtils.isNotBlank(phoneNumber) && excelStaId !=null){
|
|
@@ -797,6 +778,12 @@ public class AppUserInfoController {
|
|
String cardType = cardExcelImportList.get(0).getCardType();
|
|
String cardType = cardExcelImportList.get(0).getCardType();
|
|
CustomerElectronicCard c = new CustomerElectronicCard();
|
|
CustomerElectronicCard c = new CustomerElectronicCard();
|
|
c.setStationId(stationId);
|
|
c.setStationId(stationId);
|
|
|
|
+ if(StringUtils.isNotBlank(stationInfos.getCardRuleFlagGroup()) && stationInfos.getCardRuleFlagGroup().equals("1")){
|
|
|
|
+ if(StringUtils.isNotBlank(stationInfos.getCardEnabledFlagGroup()) &&stationInfos.getCouponEnabledFlag().equals("1")){
|
|
|
|
+ stationId = stationInfos.getGroupId();
|
|
|
|
+ c.setStationId(stationId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
c.setMobilePhone(phoneNumber);
|
|
c.setMobilePhone(phoneNumber);
|
|
c.setCardOilsType(cardType);
|
|
c.setCardOilsType(cardType);
|
|
CustomerElectronicCard electronicCardInfo = electronicMembershipCardService.getElectronicCardInfo(c);
|
|
CustomerElectronicCard electronicCardInfo = electronicMembershipCardService.getElectronicCardInfo(c);
|
|
@@ -815,6 +802,12 @@ public class AppUserInfoController {
|
|
if(!"0".equals(integral)){
|
|
if(!"0".equals(integral)){
|
|
CustomerPoints cusp = new CustomerPoints();
|
|
CustomerPoints cusp = new CustomerPoints();
|
|
cusp.setStationId(stationId);
|
|
cusp.setStationId(stationId);
|
|
|
|
+ if(StringUtils.isNotBlank(stationInfos.getIntegralRuleFlagGroup()) && stationInfos.getIntegralRuleFlagGroup().equals("1")){
|
|
|
|
+ if(StringUtils.isNotBlank(stationInfos.getIntegralFlagGroup()) &&stationInfos.getIntegralFlagGroup().equals("1")){
|
|
|
|
+ stationId = stationInfos.getGroupId();
|
|
|
|
+ cusp.setStationId(stationId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
cusp.setUnionId(unionId);
|
|
cusp.setUnionId(unionId);
|
|
CustomerPoints customerPointsInfo = customerPointsService.getCustomerPointsInfo(cusp);
|
|
CustomerPoints customerPointsInfo = customerPointsService.getCustomerPointsInfo(cusp);
|
|
if(customerPointsInfo !=null){
|
|
if(customerPointsInfo !=null){
|
|
@@ -848,6 +841,8 @@ public class AppUserInfoController {
|
|
}
|
|
}
|
|
//******* 3、删除该条用户信息 ********/
|
|
//******* 3、删除该条用户信息 ********/
|
|
CardExcelImport cardExcelImport = cardExcelImportList.get(0);
|
|
CardExcelImport cardExcelImport = cardExcelImportList.get(0);
|
|
|
|
+ cardExcelImport.setImportFlag("1");
|
|
|
|
+ cardExcelImport.setImportDate(new Date());
|
|
cardExcelImportService.deleteCardExcelImportByExcelId(cardExcelImport);
|
|
cardExcelImportService.deleteCardExcelImportByExcelId(cardExcelImport);
|
|
}
|
|
}
|
|
}
|
|
}
|