diff --git a/fuintAdmin/src/views/EventMarketing/activeDiscount/index.vue b/fuintAdmin/src/views/EventMarketing/activeDiscount/index.vue
index 8baa3e987..a6dce5e34 100644
--- a/fuintAdmin/src/views/EventMarketing/activeDiscount/index.vue
+++ b/fuintAdmin/src/views/EventMarketing/activeDiscount/index.vue
@@ -105,7 +105,7 @@
满 元
- 打 折
+ 打 折
diff --git a/fuintAdmin/src/views/EventMarketing/cardFavorable/index.vue b/fuintAdmin/src/views/EventMarketing/cardFavorable/index.vue
index 0db1a4639..9ef4a8c21 100644
--- a/fuintAdmin/src/views/EventMarketing/cardFavorable/index.vue
+++ b/fuintAdmin/src/views/EventMarketing/cardFavorable/index.vue
@@ -174,12 +174,12 @@
-
-
+
+
-
+
@@ -460,9 +460,6 @@ export default {
checkTime: [
{ required: true, message: '不能为空', trigger: 'change' }
],
- exclusiveFunction: [
- { required: true, message: '不能为空', trigger: 'change' }
- ],
claimRule: [
{ required: true, message: '不能为空', trigger: 'change' }
],
diff --git a/fuintAdmin_zt/src/views/components/Service/payment.vue b/fuintAdmin_zt/src/views/components/Service/payment.vue
index 12248b710..b12eb6f52 100644
--- a/fuintAdmin_zt/src/views/components/Service/payment.vue
+++ b/fuintAdmin_zt/src/views/components/Service/payment.vue
@@ -330,7 +330,7 @@ export default {
if (res.data===1){
this.$modal.msgSuccess("修改成功")
this.getList()
- this.show = false
+ this.dialogVisible = false
}
})
}else {
diff --git a/fuintAdmin_zt/src/views/components/Service/staff.vue b/fuintAdmin_zt/src/views/components/Service/staff.vue
index 99b3dfd6f..cf381e1a0 100644
--- a/fuintAdmin_zt/src/views/components/Service/staff.vue
+++ b/fuintAdmin_zt/src/views/components/Service/staff.vue
@@ -59,38 +59,24 @@
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
+ 油站站长
+ 普通员工
+ 收银员
+
-
-
-
-
-
+
+
+
+
+
@@ -106,25 +92,23 @@
{{ parseTime(scope.row.createTime) }}
-
-
- {{ parseTime(scope.row.updateTime) }}
-
-
+
+
+
+
+
修改
删除
@@ -143,21 +127,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -169,68 +138,22 @@
+
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 核销权限
-
-
-
-
-
-
- 特殊权限
-
-
-
-
@@ -253,48 +176,6 @@
-
-
-
-
-
-
-
- 启用后,当前账户登录POS端后油品收银必选加油员才可进行
下步操作(需系统开启加油选择加油员功能)
- 启用后,当前账户登录POS端后油...
-
-
-
-
-
-
-
-
-
-
- 交易订单显示信息、终端支持:(PC、
POS、小程序)
- 交易订单显示信息、终端支持:(PC...
-
-
-
-
-
@@ -315,182 +196,8 @@
-
-
-
-
-
-
- 多选,已选油枪号的交易将发送模板消息
-
-
-
-
-
-
-
-
-
- 当前账户下可查看交易的时间范围(PC、
POS端)
- 当前账户下可查看交易的时间范...
-
-
-
-
-
-
-
-
-
- 根据需求自行选择模式
-
-
-
-
-
-
-
-
-
- 若无权限,则无法查看交班统计信息和
进行交班操作
- 若无权限,则无法查看交班统计...
-
-
-
-
-
-
-
-
-
- 进行交班处理后是否退出当前账户
-
-
-
-
-
-
-
-
-
-
-
- 全部记录:查看所有员工交班记录,名下
记录:员工自己名下记录(需有交班权限才可查看),
禁用权限:无权限查看交班记录,记录为空
- 全部记录:查看所有员工交班记录...
-
-
-
-
-
-
-
-
-
-
- 交班信息是否显示商户号统计信息,禁
用后当前员工则无商户号统计信息
- 交班信息是否显示商户号统计信...
-
-
-
-
-
-
-
-
-
-
- 交易信息是否可以筛选员工进行查
询,启用后可筛选、则反之
- 交易信息是否可以筛选员工进行...
-
-
-
-
-
-
-
-
-
-
- POS手持机中功能对应操作权限
-
-
-
-
-
-
-
-
- 小程序管理端功能对应操作权限
-
-
-
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java
index df17dc36a..b5c2952a1 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java
@@ -469,6 +469,7 @@ public class FyPayServiceImpl implements FyPayService {
returnParameter.setReservedTransactionId(resMap.get("reserved_transaction_id"));
res.put("data",returnParameter);
+ res.put("resultMsg",resMap.get("result_msg"));
return res;
}else {
throw new Exception("验签失败,请联系管理员!");
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java
index bdba470bc..732bbad6b 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java
@@ -42,7 +42,7 @@ public class OilConfigServiceImpl extends ServiceImpl activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId,paymentActiveDTO.getAmount(),paymentActiveDTO.getOilId(),paymentActiveDTO.getMtUserLevel());
+ //满减
+ List activeFuletVOList = oilOrderMapper.selectActiveFule(storeId,paymentActiveDTO.getAmount(),paymentActiveDTO.getOilId(),paymentActiveDTO.getMtUserLevel());
+ //优惠券
+ paymentActiveDTO.setUserId(userId);
+ List canUserCardFavorableList = cardFavorableRecordMapper.getCanUserCardFavorableList(paymentActiveDTO);
+ //会员等级当前优惠力度最大
+
+ //无限制条件的活动列表
+ List resList =new ArrayList<>();
+ //无限制条件的优惠券的列表
+ ArrayList cardFavorableRecordVOS = new ArrayList<>();
+ //优惠券和折扣活动的组合列表
+ ArrayList cardAndDisPays = new ArrayList<>();
+ //优惠券和满减活动的组合列表
+ ArrayList cardAndComPays = new ArrayList<>();
//折扣
- List activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId,paymentActiveDTO.getAmount());
if (CollectionUtils.isNotEmpty(activeDiscountVOList)){
for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) {
- if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) &&
- activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){
- if (activeDiscountPayVO.getAmount().multiply(activeDiscountPayVO.getDiscount()).compareTo(amount) > 0){
- amount = paymentActiveDTO.getAmount().subtract(((b.subtract(activeDiscountPayVO.getDiscount())).multiply(paymentActiveDTO.getAmount()).multiply(a)));
- paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId());
- paymentActiveVO.setAmount(amount);
- paymentActiveVO.setFavorableAmount((b.subtract(activeDiscountPayVO.getDiscount())).multiply(activeDiscountPayVO.getAmount()).multiply(a));
- }
+ if (activeDiscountPayVO.getParticipationCondition().equals("0")){
+ activeDiscountPayVO.setType("2");
+ activeDiscountPayVO.setActiveDiscount(activeDiscountPayVO.getDiscount());
+ resList.add(activeDiscountPayVO);
}
}
}
//满减
- List activeFuletVOList = oilOrderMapper.selectActiveFule(storeId,paymentActiveDTO.getAmount());
if (CollectionUtils.isNotEmpty(activeFuletVOList)){
for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) {
- if (activeDiscountPayVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) &&
- activeDiscountPayVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){
- //如果满足条件
- if ((paymentActiveDTO.getAmount()).compareTo(activeDiscountPayVO.getAmount()) >= 0){
- fullAmount = paymentActiveDTO.getAmount().subtract(activeDiscountPayVO.getDiscount());
- if (amount.compareTo(fullAmount) > 0){
- amount = paymentActiveDTO.getAmount().subtract(activeDiscountPayVO.getDiscount());
- paymentActiveVO.setActiveId(activeDiscountPayVO.getActiveId());
- paymentActiveVO.setAmount(amount);
- paymentActiveVO.setFavorableAmount(paymentActiveDTO.getAmount().subtract(fullAmount));
- }
- }
+ if (activeDiscountPayVO.getParticipationCondition().equals("0")){
+ activeDiscountPayVO.setActiveDiscount(activeDiscountPayVO.getDiscount());
+ activeDiscountPayVO.setType("1");
+ resList.add(activeDiscountPayVO);
}
}
}
+ //优惠券
+ if (CollectionUtils.isNotEmpty(canUserCardFavorableList)){
+ for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
+ if (StringUtils.isNotEmpty(cardFavorableRecordVO.getExclusiveFunction()) && cardFavorableRecordVO.getExclusiveFunction().equals("0")){
+ cardFavorableRecordVOS.add(cardFavorableRecordVO);
+ }
+ }
+ }
+ //折扣+优惠券
+ for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) {
+ for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
+ if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
+ ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
+ BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1);
+ activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId());
+ double discountAmount = cardFavorableRecordVO.getDiscountAmount();
+ BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount);
+ activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount());
+ BigDecimal discount = activeDiscountPayVO1.getDiscount();
+ activeDiscountPayVO1.setDiscount(bigDecimal.add(discount));
+
+ activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount()));
+ activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName());
+ cardAndDisPays.add(activeDiscountPayVO1);
+ }else if( !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
+ ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
+ BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1);
+ String[] split = cardFavorableRecordVO.getOilType().split(",");
+ if(paymentActiveDTO.getOilId().equals(split)){
+ activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId());
+ double discountAmount = cardFavorableRecordVO.getDiscountAmount();
+ activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount());
+ BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount);
+ BigDecimal discount = activeDiscountPayVO1.getDiscount();
+ activeDiscountPayVO1.setDiscount(bigDecimal.add(discount));
+ activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount()));
+ activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName());
+ cardAndDisPays.add(activeDiscountPayVO1);
+ }
+ }
+ }
+ }
+ //满减+优惠券
+ for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) {
+ for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
+ if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
+ ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
+ BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1);
+ activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId());
+ double discountAmount = cardFavorableRecordVO.getDiscountAmount();
+ activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount());
+ BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount);
+ BigDecimal discount = activeDiscountPayVO1.getDiscount();
+ activeDiscountPayVO1.setDiscount(bigDecimal.add(discount));
+ activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount()));
+ activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName());
+ cardAndComPays.add(activeDiscountPayVO1);
+ }else if (!cardFavorableRecordVO.getExclusiveFunction().equals("0")){
+ ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
+ BeanUtils.copyProperties(activeDiscountPayVO,activeDiscountPayVO1);
+ String[] split = cardFavorableRecordVO.getOilType().split(",");
+ if(paymentActiveDTO.getOilId().equals(split)){
+ activeDiscountPayVO1.setCouponId(cardFavorableRecordVO.getId());
+ double discountAmount = cardFavorableRecordVO.getDiscountAmount();
+ activeDiscountPayVO1.setActiveDiscount(activeDiscountPayVO1.getDiscount());
+ BigDecimal bigDecimal = BigDecimal.valueOf(discountAmount);
+ BigDecimal discount = activeDiscountPayVO1.getDiscount();
+ activeDiscountPayVO1.setDiscount(bigDecimal.add(discount));
+ activeDiscountPayVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount()));
+ activeDiscountPayVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName());
+ cardAndComPays.add(activeDiscountPayVO1);
+ }
+ }
+ }
+
+ }
+ for (ActiveDiscountPayVO activeDiscountPayVO : resList) {
+ double v = activeDiscountPayVO.getDiscount().doubleValue();
+ activeDiscountPayVO.setDiscounts(v);
+ }
+ for (ActiveDiscountPayVO activeDiscountPayVO : cardAndDisPays) {
+ double v = activeDiscountPayVO.getDiscount().doubleValue();
+ activeDiscountPayVO.setDiscounts(v);
+ }
+ for (ActiveDiscountPayVO activeDiscountPayVO : cardAndComPays) {
+ double v = activeDiscountPayVO.getDiscount().doubleValue();
+ activeDiscountPayVO.setDiscounts(v);
+ }
+
+ ArrayList activeDiscountPayVOS = new ArrayList<>();
+ //1.无限制条件的活动和优惠券分别选出一个优惠最大的来
+ //活动
+ if (CollectionUtils.isNotEmpty(resList)){
+ ActiveDiscountPayVO activeDiscountPayVO = resList.stream().max(Comparator.comparingDouble(ActiveDiscountPayVO::getDiscounts)).get();
+ activeDiscountPayVOS.add(activeDiscountPayVO);
+ }
+ //优惠券
+ CardFavorableRecordVO cardFavorableRecordVO = new CardFavorableRecordVO();
+ if (CollectionUtils.isNotEmpty(cardFavorableRecordVOS)){
+ cardFavorableRecordVO = cardFavorableRecordVOS.stream().max(Comparator.comparingDouble(CardFavorableRecordVO::getDiscountAmount)).get();
+ }
+ //2.有限制条件的活动和优惠券组合比较出一个优惠最大的来
+ //满减+优惠券
+ if (CollectionUtils.isNotEmpty(cardAndDisPays)){
+ ActiveDiscountPayVO activeDiscountPayVO1 = cardAndDisPays.stream().max(Comparator.comparingDouble(ActiveDiscountPayVO::getDiscounts)).get();
+ activeDiscountPayVOS.add(activeDiscountPayVO1);
+ }
+ //折扣+优惠券
+ if (CollectionUtils.isNotEmpty(cardAndComPays)){
+ ActiveDiscountPayVO activeDiscountPayVO2 = cardAndComPays.stream().max(Comparator.comparingDouble(ActiveDiscountPayVO::getDiscounts)).get();
+ activeDiscountPayVOS.add(activeDiscountPayVO2);
+ }
+ //3.活动和活动+优惠券的组合比较
+ if (CollectionUtils.isNotEmpty(activeDiscountPayVOS)){
+ ActiveDiscountPayVO activeDiscountPayVO3 = activeDiscountPayVOS.stream().max(Comparator.comparingDouble(ActiveDiscountPayVO::getDiscounts)).get();
+ //4. 3和优惠券比较
+ if(ObjectUtils.isNotEmpty(activeDiscountPayVO3)){
+ finalAmount = activeDiscountPayVO3.getDiscounts();
+ if (ObjectUtils.isNotEmpty(cardFavorableRecordVO) && finalAmount < cardFavorableRecordVO.getDiscountAmount()){
+ PaymentActiveVO paymentActiveVO1 = new PaymentActiveVO();
+ //单用优惠券优惠力度最大
+ paymentActiveVO1.setCardFavorableId(cardFavorableRecordVO.getId());
+ //金额
+ paymentActiveVO1.setCardFavorableAmount(BigDecimal.valueOf(cardFavorableRecordVO.getDiscountAmount()));
+ //优惠券名字
+ paymentActiveVO1.setCardFavorableInfo(cardFavorableRecordVO.getCardFavorableName() + "满"+cardFavorableRecordVO.getSatisfiedAmount() + "减" + cardFavorableRecordVO.getDiscountAmount() + "元");
+ BeanUtils.copyProperties(paymentActiveVO1,paymentActiveVO);
+ //return paymentActiveVO1;
+ }else {
+ PaymentActiveVO paymentActiveVO2 = new PaymentActiveVO();
+ //活动或活动+优惠券优惠力度最大
+ paymentActiveVO2.setActiveId(activeDiscountPayVO3.getActiveId());
+ paymentActiveVO2.setActiveInfo(activeDiscountPayVO3.getActiveName());
+ paymentActiveVO2.setType(activeDiscountPayVO3.getType());
+ paymentActiveVO2.setActiveFavorableAmount(activeDiscountPayVO3.getActiveDiscount());
+
+ paymentActiveVO2.setCardFavorableId(activeDiscountPayVO3.getCouponId());
+ paymentActiveVO2.setCardFavorableInfo(activeDiscountPayVO3.getCardFavorableInfo());
+ paymentActiveVO2.setCardFavorableAmount(activeDiscountPayVO3.getCardFavorableAmount());
+ BeanUtils.copyProperties(paymentActiveVO2,paymentActiveVO);
+ //return paymentActiveVO2;
+ }
+ }
+ }
+ //会员等级优惠
+
+ Integer oilId = paymentActiveDTO.getOilId();
+ double oilPriceById = oilNumberMapper.getOilPriceById(oilId,storeId);
+ BigDecimal bigDecimal1 = BigDecimal.valueOf(oilPriceById);
+ String oilTypebyId = oilNameMapper.getOilTypebyId(oilId);
+
+ String gradeId = ljUserGradeMapper.selectByUserId(paymentActiveDTO.getStoreId(), userId);
+ if (StringUtils.isNotEmpty(gradeId)){
+ LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId);
+ if (ObjectUtils.isNotEmpty(ljUserGrade)){
+ if (oilTypebyId.equals("汽油")){
+ if (ljUserGrade.getGasolineDiscount().equals("无优惠")){
+
+ }else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
+ String gasolineRule = ljUserGrade.getGasolineRule();
+ List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
+ for (JSONObject jsonObject : jsonObjects) {
+ Integer gasolineRule1 = jsonObject.getInteger("gasolineRule1");
+ BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
+ if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
+ //升数
+ BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1,2,RoundingMode.HALF_UP);
+ Integer gasolineRule3 = jsonObject.getInteger("gasolineRule3");
+ BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
+ BigDecimal multiply = divide.multiply(bigDecimal2);
+ paymentActiveVO.setMemberFavorableAmount(multiply);
+ }
+ }
+ }else {
+ String gasolineRule = ljUserGrade.getGasolineRule();
+ List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
+ for (JSONObject jsonObject : jsonObjects) {
+ Integer gasolineRule1 = jsonObject.getInteger("gasolineRule1");
+ BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
+ if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
+ //升数
+ Integer gasolineRule3 = jsonObject.getInteger("gasolineRule2");
+ BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
+ paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
+ }
+ }
+ }
+ }
+ if (oilTypebyId.equals("柴油")){
+ if (ljUserGrade.getGasolineDiscount().equals("无优惠")){
+
+ }else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
+ String gasolineRule = ljUserGrade.getDieselRule();
+ List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
+ for (JSONObject jsonObject : jsonObjects) {
+ Integer gasolineRule1 = jsonObject.getInteger("dieselRule1");
+ BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
+ if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
+ //升数
+ BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1,2,RoundingMode.HALF_UP);
+ Integer gasolineRule3 = jsonObject.getInteger("dieselRule3");
+ BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
+ BigDecimal multiply = divide.multiply(bigDecimal2);
+ paymentActiveVO.setMemberFavorableAmount(multiply);
+ }
+ }
+ }else {
+ String gasolineRule = ljUserGrade.getDieselRule();
+ List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
+ for (JSONObject jsonObject : jsonObjects) {
+ Integer gasolineRule1 = jsonObject.getInteger("dieselRule1");
+ BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
+ if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
+ //升数
+ Integer gasolineRule3 = jsonObject.getInteger("dieselRule3");
+ BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
+ paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
+ }
+ }
+ }
+
+ }
+ if (oilTypebyId.equals("天然气")){
+ if (ljUserGrade.getGasolineDiscount().equals("无优惠")){
+
+ }else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
+ String gasolineRule = ljUserGrade.getNaturalGasRule();
+ List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
+ for (JSONObject jsonObject : jsonObjects) {
+ Integer gasolineRule1 = jsonObject.getInteger("naturalGas1");
+ BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
+ if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
+ //升数
+ BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1,2,RoundingMode.HALF_UP);
+ Integer gasolineRule3 = jsonObject.getInteger("naturalGas3");
+ BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
+ BigDecimal multiply = divide.multiply(bigDecimal2);
+ paymentActiveVO.setMemberFavorableAmount(multiply);
+ }
+ }
+ }else {
+ String gasolineRule = ljUserGrade.getGasolineRule();
+ List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
+ for (JSONObject jsonObject : jsonObjects) {
+ Integer gasolineRule1 = jsonObject.getInteger("naturalGas1");
+ BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
+ if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
+ //升数
+ Integer gasolineRule3 = jsonObject.getInteger("naturalGas3");
+ BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
+ paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
+ }
+ }
+ }
+
+ }
+
+ }
+ }
+ return paymentActiveVO;
+ }
+
+ @Override
+ public void activeConsumption(PaymentActiveDTO paymentActiveDTO) {
//消费有礼
- List activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(storeId, paymentActiveDTO.getAmount());
+ List activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(paymentActiveDTO.getStoreId(), paymentActiveDTO.getAmount());
//连锁店信息
LJUser ljUserVo = userService.queryUserByUserId(TokenUtil.getNowAccountInfo().getId());
- String accountName = TokenUtil.getNowAccountInfo().getAccountName();
Integer storeId1 = paymentActiveDTO.getStoreId();
Integer chainStoreId = iljStoreService.selectStoreByStoreId(storeId1).getChainStoreId();
//用户余额
@@ -519,6 +796,5 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
}
}
- return paymentActiveVO;
}
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/vo/PaymentActiveVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/vo/PaymentActiveVO.java
index cafd9e95d..65c8f2555 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/vo/PaymentActiveVO.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/vo/PaymentActiveVO.java
@@ -9,8 +9,18 @@ import java.math.BigDecimal;
public class PaymentActiveVO implements Serializable {
//活动id
private Integer activeId;
- //应付金额
- private BigDecimal amount;
- //优惠金额
- private BigDecimal favorableAmount;
+ //活动信息
+ private String activeInfo;
+ //1满减2折扣
+ private String type;
+ //活动优惠金额
+ private BigDecimal activeFavorableAmount;
+ //优惠券id
+ private Integer cardFavorableId;
+ //优惠券信息
+ private String cardFavorableInfo;
+ //优惠券金额
+ private BigDecimal cardFavorableAmount;
+ //等级会员优惠金额
+ private BigDecimal memberFavorableAmount;
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java
index 4dca3f2ee..ba70acc03 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/controller/CardFavorableController.java
@@ -121,7 +121,7 @@ public class CardFavorableController extends BaseController {
/**
- *查询我的优惠券接口(小程序端)
+ *查询我的卡券接口(小程序端)
* @param pageNo
* @param pageSize
* @param cardFavorableDTOS
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java
index 8de67897e..ae8809e49 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/CardFavorableRecordMapper.java
@@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.cardFavorable.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fuint.business.marketingActivity.activeExchange.dto.PaymentActiveDTO;
import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -35,5 +36,7 @@ public interface CardFavorableRecordMapper extends BaseMapper selectAllByCondition(Integer id);
IPage selectAllByCondition(@Param("page") Page page, @Param("cardFavorableDTOS") CardFavorableDTOS cardFavorableDTOS);
+
+ List getCanUserCardFavorableList(@Param("paymentActiveDTO") PaymentActiveDTO paymentActiveDTO);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml
index 3439694e2..06348c748 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/mapper/xml/CardFavorableRecordMapper.xml
@@ -116,5 +116,30 @@
+
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java
index 11d4d1a7d..0a83c8762 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java
@@ -19,6 +19,7 @@ import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -84,15 +85,20 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl getCardFavorableList(Page page, CardFavorableRecord cardFavorableRecord) {
+ Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
+ cardFavorableRecord.setStoreId(storeId);
IPage cardFavorableList = cardFavorableRecordMapper.getCardFavorableList(page, cardFavorableRecord);
List records = cardFavorableList.getRecords();
for (CardFavorableRecordVO record : records) {
String oilName = "";
- String[] split = record.getOilType().split(",");
- for (String s : split) {
- oilName += oilNameService.selectOilNameById(Integer.parseInt(s)).getOilName();
+ if (StringUtils.isNotEmpty(record.getOilType())){
+ String[] split = record.getOilType().split(",");
+ for (String s : split) {
+ oilName += oilNameService.selectOilNameById(Integer.parseInt(s)).getOilName();
+ }
+ record.setOilName(oilName);
}
- record.setOilName(oilName);
+
}
cardFavorableList.setRecords(records);
return cardFavorableList;
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java
index ec02bdb8c..4e64e243f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableServiceImpl.java
@@ -17,6 +17,7 @@ import com.fuint.business.store.service.StoreService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -145,9 +146,11 @@ public class CardFavorableServiceImpl extends ServiceImpl {
* @param amount
* @return
*/
- List selectActiveDiscount(@Param("storeId") Integer storeId, @Param("amount") BigDecimal amount);
+ List selectActiveDiscount(@Param("storeId") Integer storeId, @Param("amount") BigDecimal amount,@Param("oilId") Integer oilId,@Param("levelId") Integer levelId);
/**
* 满减
@@ -98,7 +98,7 @@ public interface OilOrderMapper extends BaseMapper {
* @param amount
* @return
*/
- List selectActiveFule(@Param("storeId") Integer storeId, @Param("amount")BigDecimal amount);
+ List selectActiveFule(@Param("storeId") Integer storeId, @Param("amount")BigDecimal amount,@Param("oilId") Integer oilId,@Param("levelId") Integer levelId);
/**
* 消费有礼
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
index 22d53c9db..3a586f7ab 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml
@@ -352,14 +352,22 @@
ad.NAME activeName,
ad.diesel_user_level adaptUser,
ad.adapt_oil oilId,
- adc.amount amount,
- adc.discount discount
+ ad.limit_acount as limitAcount,
+ ad.participation_condition,
+ (case ad.store_id when ${storeId} then adc.amount * (1-(adc.discount * 0.1))
+ end) as discount
FROM
active_discount ad
- LEFT JOIN active_discount_child adc ON ad.id = adc.active_discount_id
- where ad.store_id = #{storeId}
- and adc.amount <= #{amount}
- and ad.status = 0
+ LEFT JOIN active_discount_child adc ON ad.id = adc.active_discount_id
+ WHERE
+ ad.store_id = #{storeId}
+ AND adc.amount #{amount}
+ and now() BETWEEN ad.active_start_time
+ AND ad.active_end_time
+ AND ad.STATUS = 0
+ AND concat(',',ad.adapt_oil,',') like concat('%',#{oilId},'%')
+ AND concat(',',ad.diesel_user_level,',') like concat('%',#{levelId},'%')
+ GROUP BY ad.id
+
@@ -34,4 +37,4 @@
-
\ No newline at end of file
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNumberMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNumberMapper.xml
index 79768a021..08727631a 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNumberMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/petrolStationManagement/mapper/xml/OilNumberMapper.xml
@@ -145,4 +145,8 @@
onu.store_id = #{storeId} and onu.state = '启用'
+
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserGradeMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserGradeMapper.java
index 9ba8f9a59..e9b107495 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserGradeMapper.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/LJUserGradeMapper.java
@@ -18,4 +18,8 @@ public interface LJUserGradeMapper extends BaseMapper {
* @return
*/
public IPage selectUserGradeList(Page page, @Param("userGrade") LJUserGrade userGrade);
+
+ String selectByUserId(@Param("storeId") Integer storeId, @Param("userId") Integer userId);
+
+ LJUserGrade selectAllByGradeId(String gradeId);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserGradeMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserGradeMapper.xml
index 594a7ec80..705ab712d 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserGradeMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserGradeMapper.xml
@@ -12,4 +12,12 @@
order by grade
-
\ No newline at end of file
+
+
+
+
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml
index 10e30bc12..0b09afe52 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/mapper/xml/LJUserMapper.xml
@@ -141,7 +141,7 @@
-
\ No newline at end of file
+
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java
index 48d524a50..788431292 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/controller/AlipayController.java
@@ -45,9 +45,12 @@ public class AlipayController extends BaseController {
* @return
*/
@PostMapping("/getUserid")
- public ResponseObject getUserId(@RequestBody Map map,HttpServletRequest request) throws AlipayApiException {
- String authCode = map.get("authCode");
+ public ResponseObject getUserId(@RequestBody Map map,HttpServletRequest request) throws Exception {
logger.info("支付宝授权登录参数:{}", map);
+ String authCode = map.get("authCode");
+ String encryptedData = map.get("encryptedData");
+// alipayService.getUserMobile(encryptedData);
+
String storeId = map.get("storeId");
if ("".equals(storeId)) return getFailureResult(0, "支付宝登录失败");
// 根据storeId查找对应的连锁店id
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/AlipayService1.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/AlipayService1.java
index 7c6b71f2c..70b2df95c 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/AlipayService1.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/AlipayService1.java
@@ -4,5 +4,13 @@ import com.alipay.api.AlipayApiException;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
public interface AlipayService1 {
+ /**
+ * 获取用户支付宝userId
+ * @param code
+ * @return
+ * @throws AlipayApiException
+ */
public AlipaySystemOauthTokenResponse getAlipayProfile(String code) throws AlipayApiException;
+
+ void getUserMobile(String encryptedData) throws Exception;
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/impl/AlipayServiceImpl1.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/impl/AlipayServiceImpl1.java
index cd92c3209..6dfa53e59 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/impl/AlipayServiceImpl1.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/AlipayApi/service/impl/AlipayServiceImpl1.java
@@ -1,8 +1,14 @@
package com.fuint.module.AlipayApi.service.impl;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.alibaba.fastjson.parser.Feature;
+import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayConfig;
import com.alipay.api.DefaultAlipayClient;
+import com.alipay.api.internal.util.AlipayEncrypt;
+import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.request.AlipayUserInfoShareRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
@@ -14,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;
+import java.util.Map;
+
@Service
public class AlipayServiceImpl1 implements AlipayService1 {
private static final Logger logger = LoggerFactory.getLogger(AlipayServiceImpl1.class);
@@ -59,4 +67,56 @@ public class AlipayServiceImpl1 implements AlipayService1 {
return null;
}
+
+ @Override
+ public void getUserMobile(String encryptedData) throws Exception {
+
+//1. 获取验签和解密所需要的参数
+ Map openapiResult = JSON.parseObject(encryptedData,
+ new TypeReference