|
@@ -599,37 +599,8 @@ public class PayController {
|
|
|
//获取该油站的优惠方式
|
|
|
String discountPlanType = stationService.getStationDiscountWay(infoMap.get("stationId").toString());
|
|
|
logger.info("油站优惠方式:"+discountPlanType);
|
|
|
- //满减
|
|
|
- if(discountPlanType !=null && discountPlanType.equals("2")){
|
|
|
- List<Map> customerMarkertPlanList = customerGradeServices.getCustomerMarkertPlanList(infoMap);
|
|
|
- logger.info("该站满减信息:"+ customerMarkertPlanList);
|
|
|
- if(customerMarkertPlanList !=null && customerMarkertPlanList.size() >0){
|
|
|
- for(Map m: customerMarkertPlanList){
|
|
|
- if(Double.valueOf(customerManage.getAmt().toString()) >= Double.valueOf(m.get("discountAmt").toString())){
|
|
|
- //customerManage.setGrade(m.get("grade").toString()); //存入等级名称
|
|
|
- //customerManage.setMemberGrade(m.get("id").toString()); //存入等级ID
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- logger.info("满减信息是否存入客户表:"+ "满减ID:"+ customerManage.getMemberGrade()+ "满减名称: "+customerManage.getGrade());
|
|
|
- }
|
|
|
- }else if(discountPlanType !=null && discountPlanType.equals("3")){
|
|
|
- //立减
|
|
|
- List<Map> customerMarkertPlanList = customerGradeServices.getCustomerMarkertPlanList(infoMap);
|
|
|
- logger.info("该站满减信息:"+ customerMarkertPlanList);
|
|
|
- if(customerMarkertPlanList !=null && customerMarkertPlanList.size() >0){
|
|
|
- for(Map m: customerMarkertPlanList){
|
|
|
- if(Double.valueOf(customerManage.getAmt().toString()) >= Double.valueOf(m.get("discountAmt").toString())){
|
|
|
- //customerManage.setGrade(m.get("grade").toString()); //存入等级名称
|
|
|
- //customerManage.setMemberGrade(m.get("id").toString()); //存入等级ID
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- logger.info("立减信息是否存入客户表:"+ "立减ID:"+ customerManage.getMemberGrade()+ "立减名称: "+customerManage.getGrade());
|
|
|
- }
|
|
|
- }else if(discountPlanType !=null && discountPlanType.equals("1")){
|
|
|
- //直降
|
|
|
+ if(discountPlanType !=null && discountPlanType.equals("1")){
|
|
|
+ //直降时存入等级名称和等级ID
|
|
|
List<Map> customerGradeInfo = customerGradeServices.getCustomerGradeList(infoMap); //直降
|
|
|
logger.info("该站直降等级信息:"+ customerGradeInfo);
|
|
|
for (Map m: customerGradeInfo){
|
|
@@ -646,49 +617,14 @@ public class PayController {
|
|
|
}else{
|
|
|
//该客户不存在时插入
|
|
|
String discountPlanType = stationService.getStationDiscountWay(infoMap.get("stationId").toString());
|
|
|
- //满减
|
|
|
- if(discountPlanType !=null && discountPlanType.equals("2")){
|
|
|
- List<Map> customerMarkertPlanList = customerGradeServices.getCustomerMarkertPlanList(infoMap);
|
|
|
- logger.info("该站满减信息:"+ customerMarkertPlanList);
|
|
|
- if(customerMarkertPlanList !=null && customerMarkertPlanList.size() >0){
|
|
|
- for(Map m: customerMarkertPlanList){
|
|
|
- if(Double.valueOf(customerManage.getAmt().toString()) >= Double.valueOf(m.get("discountAmt").toString())){
|
|
|
- //customerManage.setGrade(m.get("grade").toString()); //存入等级名称
|
|
|
- //customerManage.setMemberGrade(m.get("id").toString()); //存入等级ID
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- logger.info("满减信息是否存入客户表:"+ "满减ID:"+ customerManage.getMemberGrade()+ "满减名称: "+customerManage.getGrade());
|
|
|
- }
|
|
|
- }else if(discountPlanType !=null && discountPlanType.equals("3")){
|
|
|
- //立减
|
|
|
- List<Map> customerMarkertPlanList = customerGradeServices.getCustomerMarkertPlanList(infoMap);
|
|
|
- logger.info("该站立减信息:"+ customerMarkertPlanList);
|
|
|
- if(customerMarkertPlanList !=null && customerMarkertPlanList.size() >0){
|
|
|
- for(Map m: customerMarkertPlanList){
|
|
|
- if(Double.valueOf(customerManage.getAmt().toString()) >= Double.valueOf(m.get("discountAmt").toString())){
|
|
|
- //customerManage.setGrade(m.get("grade").toString()); //存入等级名称
|
|
|
- //customerManage.setMemberGrade(m.get("id").toString()); //存入等级ID
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- logger.info("立减信息是否存入客户表:"+ "立减ID:"+ customerManage.getMemberGrade()+ "立减名称: "+customerManage.getGrade());
|
|
|
- }
|
|
|
- }else if(discountPlanType !=null && discountPlanType.equals("1")){
|
|
|
- //直降
|
|
|
+ if(discountPlanType !=null && discountPlanType.equals("1")){
|
|
|
+ //直降时存入等级名称和等级ID
|
|
|
List<Map> customerGradeInfo = customerGradeServices.getCustomerGradeList(infoMap); //直降
|
|
|
logger.info("该站直降等级信息:"+ customerGradeInfo);
|
|
|
if(customerGradeInfo !=null && customerGradeInfo.size() >0){
|
|
|
customerManage.setGrade(customerGradeInfo.get(0).get("grade").toString()); //存入等级名称
|
|
|
customerManage.setMemberGrade(customerGradeInfo.get(0).get("id").toString()); //存入等级ID
|
|
|
}
|
|
|
-// for (Map m: customerGradeInfo){
|
|
|
-// if(Double.valueOf(customerManage.getAmt().toString()) >= Double.valueOf(m.get("memberConditStart").toString()) && Double.valueOf(customerManage.getAmt().toString()) < Double.valueOf(m.get("memberConditEnd").toString())){
|
|
|
-// customerManage.setGrade(m.get("grade").toString()); //存入等级名称
|
|
|
-// customerManage.setMemberGrade(m.get("id").toString()); //存入等级ID
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
logger.info("直降等级信息是否存入客户表:"+ "直降ID:"+ customerManage.getMemberGrade()+ "直降名称: "+customerManage.getGrade());
|
|
|
}
|
|
|
customerManage.setAmt(BigDecimal.valueOf((Double) infoMap.get("amt"))); //存入金额
|