Merge remote-tracking branch 'origin/master'

This commit is contained in:
@QQNZX 2024-01-19 16:07:23 +08:00
commit f39a17efae
14 changed files with 91 additions and 74 deletions

View File

@ -278,6 +278,9 @@ export default {
isonline:[
{ required: true, message: '不能为空', trigger: 'change' }
],
activeDiscountChildList:[
{ required: true, message: '不能为空', trigger: 'change' }
],
}
};
},

View File

@ -281,6 +281,9 @@ export default {
isonline:[
{ required: true, message: '不能为空', trigger: 'change' }
],
activeDiscountChildList:[
{ required: true, message: '不能为空', trigger: 'change' }
],
}
};
},

View File

@ -144,8 +144,10 @@
<!-- 添加或修改优惠券对话框 -->
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" :label-position="labelPosition" label-width="100px">
<el-form-item label="优惠券名称" prop="name">
<el-input v-model="form.name" placeholder="请输入优惠券名称" />
</el-form-item>
<el-form-item label="卡券类型" prop="type">
<el-radio-group v-model="form.type">
@ -165,15 +167,28 @@
<el-checkbox v-for="(item,index) in oillist" :label=" item.id " :key="index">{{item.oilType}}{{item.oilName}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="满足金额" prop="satisfiedAmount" v-if="form.discountType == 0">
<el-input v-model="form.satisfiedAmount" placeholder="请输入满足金额" />
</el-form-item>
<el-form-item label="优惠金额" prop="discountAmount" v-if="form.discountType == 0">
<el-input v-model="form.discountAmount" placeholder="请输入优惠金额" />
</el-form-item>
<el-form-item label="满足金额" prop="satisfiedAmount" v-if="form.discountType == 1">
<el-input v-model="form.satisfiedAmount" placeholder="请输入满足金额" />
</el-form-item>
<div class="_k">
<el-form-item label="满足金额" prop="satisfiedAmount" v-if="form.discountType == 0">
<el-input v-model="form.satisfiedAmount" placeholder="请输入满足金额" >
<template slot="append"></template>
</el-input>
</el-form-item>
</div>
<div class="_k">
<el-form-item label="优惠金额" prop="discountAmount" v-if="form.discountType == 0">
<el-input v-model="form.discountAmount" placeholder="请输入优惠金额" >
<template slot="append"></template>
</el-input>
</el-form-item>
</div>
<div class="_k">
<el-form-item label="满足金额" prop="satisfiedAmount" v-if="form.discountType == 1">
<el-input v-model="form.satisfiedAmount" placeholder="请输入满足金额" >
<template slot="append"></template>
</el-input>
</el-form-item>
</div>
<el-form-item label="优惠折扣" prop="specialDiscount" v-if="form.discountType == 1">
<el-input-number v-model="form.specialDiscount" :min="0" :max="9.9" placeholder="1 ~ 9.9"/>
</el-form-item>
@ -711,5 +726,9 @@ export default {
align-items: center;
}
._k{
box-sizing: border-box;
width: 300px;
}
</style>

View File

@ -34,7 +34,8 @@ export default {
}
},
created() {
this.userId = this.pUserId;
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
},
methods:{
getList(){

View File

@ -35,7 +35,8 @@ export default {
}
},
created() {
this.userId = this.pUserId;
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
},
methods:{
getList(){

View File

@ -485,7 +485,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
//折扣+优惠券
for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) {
if (activeDiscountPayVO.getParticipationCondition().equals("1")){
if (!activeDiscountPayVO.getParticipationCondition().equals("1")){
for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
if(cardFavorableRecordVO.getExclusiveFunction().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
@ -525,7 +525,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
//满减+优惠券
for (ActiveDiscountPayVO activeDiscountPayVO : activeFuletVOList) {
if (activeDiscountPayVO.getParticipationCondition().equals("1")){
if (!activeDiscountPayVO.getParticipationCondition().equals("1")){
for (CardFavorableRecordVO cardFavorableRecordVO : canUserCardFavorableList) {
if(cardFavorableRecordVO.getType().equals("2") && !cardFavorableRecordVO.getExclusiveFunction().equals("0")){
ActiveDiscountPayVO activeDiscountPayVO1 = new ActiveDiscountPayVO();
@ -637,7 +637,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
BigDecimal bigDecimal1 = BigDecimal.valueOf(oilPriceById);
String oilTypebyId = oilNameMapper.getOilTypebyId(oilId);
String gradeId = ljUserGradeMapper.selectByUserId(paymentActiveDTO.getStoreId(), userId);
String gradeId = paymentActiveDTO.getMtUserLevel().toString();
if (StringUtils.isNotEmpty(gradeId)){
LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId);
if (ObjectUtils.isNotEmpty(ljUserGrade)){
@ -647,31 +647,26 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
for (JSONObject jsonObject : jsonObjects) {
Integer gasolineRule1 = jsonObject.getInteger("gasolineRule1");
BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("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);
BigDecimal gasolineRule3 = jsonObject.getBigDecimal("gasolineRule3");
BigDecimal multiply = divide.multiply(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
}
}else {
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> 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){
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal gasolineRule1 = jsonObject.getBigDecimal("gasolineRule1");
if (paymentActiveDTO.getAmount().compareTo(gasolineRule1)>=0){
//升数
Integer gasolineRule3 = jsonObject.getInteger("gasolineRule2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
}
}
}
}
if (oilTypebyId.equals("柴油")){
@ -680,31 +675,26 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
String gasolineRule = ljUserGrade.getDieselRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
for (JSONObject jsonObject : jsonObjects) {
Integer gasolineRule1 = jsonObject.getInteger("dieselRule1");
BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal =jsonObject.getBigDecimal("dieselRule1");
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 bigDecimal2 = jsonObject.getBigDecimal("dieselRule3");
BigDecimal multiply = divide.multiply(bigDecimal2);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
}
}else {
String gasolineRule = ljUserGrade.getDieselRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
for (JSONObject jsonObject : jsonObjects) {
Integer gasolineRule1 = jsonObject.getInteger("dieselRule1");
BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
//升数
Integer gasolineRule3 = jsonObject.getInteger("dieselRule2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
}
}
}
}
@ -714,35 +704,28 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
String gasolineRule = ljUserGrade.getNaturalGasRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
for (JSONObject jsonObject : jsonObjects) {
Integer gasolineRule1 = jsonObject.getInteger("naturalGas1");
BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
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 bigDecimal2 = jsonObject.getBigDecimal("naturalGas3");
BigDecimal multiply = divide.multiply(bigDecimal2);
paymentActiveVO.setMemberFavorableAmount(multiply);
}
}
}else {
String gasolineRule = ljUserGrade.getGasolineRule();
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
for (JSONObject jsonObject : jsonObjects) {
Integer gasolineRule1 = jsonObject.getInteger("naturalGas1");
BigDecimal bigDecimal = BigDecimal.valueOf(gasolineRule1);
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
//升数
Integer gasolineRule3 = jsonObject.getInteger("naturalGas2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
}
}
}
}
}
}
return paymentActiveVO;

View File

@ -57,7 +57,7 @@ public class CardFavorableRecordController extends BaseController {
@GetMapping("getCardFavorableList")
public ResponseObject getCardFavorableList(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") CardFavorableRecord cardFavorableRecord) {
@Param("cardFavorableRecord") CardFavorableRecord cardFavorableRecord) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.cardFavorableRecordService.getCardFavorableList(page,cardFavorableRecord));
}

View File

@ -43,7 +43,7 @@
left join mt_store ms on ms.id = cfr.store_id
<where>
<if test="cardFavorableRecord.storeId != null">
and cfr.store_id = #{cardFavorableRecord.storeId}
and cf.store_id = #{cardFavorableRecord.storeId}
</if>
<if test="cardFavorableRecord.mtUserId != null">
and cfr.mt_user_id = #{cardFavorableRecord.mtUserId}

View File

@ -218,15 +218,15 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
LJStore store = storeService.selectStoreByStoreId(userGrade.getStoreId());
List<LJUserGrade> ljUserGrades = this.selectUserGradeByChainStoreId(store.getChainStoreId());
for (LJUserGrade ljUserGrade : ljUserGrades) {
if (ljUserGrade.getGrade().equals(userGrade.getGrade()) && ljUserGrade.getId()!=userGrade.getId()){
if (ljUserGrade.getGrade().equals(userGrade.getGrade()) && !ljUserGrade.getId().equals(userGrade.getId())){
row = 2;
flag = true;
}
if (ljUserGrade.getName().equals(userGrade.getName()) && ljUserGrade.getId()!=userGrade.getId()){
if (ljUserGrade.getName().equals(userGrade.getName()) && !ljUserGrade.getId().equals(userGrade.getId())){
row = 3;
flag = true;
}
if (ljUserGrade.getGrowthValue().equals(userGrade.getGrowthValue()) && ljUserGrade.getId()!=userGrade.getId()){
if (ljUserGrade.getGrowthValue().equals(userGrade.getGrowthValue()) && !ljUserGrade.getId().equals(userGrade.getId())){
row = 4;
flag = true;
}

View File

@ -73,8 +73,7 @@ public class AlipayServiceImpl1 implements AlipayService1 {
//1. 获取验签和解密所需要的参数
Map<String, String> openapiResult = JSON.parseObject(encryptedData,
new TypeReference<Map<String, String>>() {
}, Feature.OrderedField);
new TypeReference<Map<String, String>>() {}, Feature.OrderedField);
String signType = "RSA2";
String charset = "UTF-8";
String encryptType = "AES";
@ -90,8 +89,7 @@ public class AlipayServiceImpl1 implements AlipayService1 {
// String signVeriKey = "你的小程序对应的支付宝公钥为扩展考虑建议用appId+signType做密钥存储隔离";
String signVeriKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnwDxxSNpBKL8xjtU3leNBy9mIOMYOr0WgxGbCxTMfhUPka9nr8Hbt0GN+7ylNBmxCYvW8kmge4dCOLUPqseM9+HyF9R1NrWBB3zQPVqnD0mKCYr9cEgtx6/eU7oIK1FqAl0G+jNIT3IKWMSXEX09yPKJWS6zk7+FRzOzn11vShTFjmrqWdrisJgRsQ54PHhPkQz7xFojDRqIunlpICWUVA8GwUg02hm5ZEhxpMHEWoJZ6Dj1wPH2Vh4CpIT/mjtD+SvssCpT0/XOEDPajcMRfgoV8fyyN0JNQDVZdMZgSO4aRHQqhC3X5CBXSuv40hHnwjcDjsPcbVav5BtaPp3wPQIDAQAB";
// String decryptKey = "你的小程序对应的加解密密钥为扩展考虑建议用appId+encryptType做密钥存储隔离"
String decryptKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJJM2nlUCidns6anNtGUiCL+J83kNL1nrr6hNktHkrX9bhR8LiBU3qBX+MkGDY4snlbdz+anGWu8YkcMlfBlAr82AsdIS9UTHh3lg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tgtoXakTy6WjsIiJCwSpA/tP5+PmHGn1AoGASY/VhZmEA3OAFMnX3pH8GOKR9kYqMST0p28LN78/Pm7lIskjAxrUT601CJK7dE/vZnE848Gk2judQC38CnmbrHH6WAZ020NI0HD5XsCabotMIGuItG01YEmWN9JUIC16h8Ss+Vbo/9gEJ1CuIHjJBikM3S1J+lIG3lNH1l7r4MECgYEA2eAV0x55cmjC6VIMk3EAVUFbJ1LY1U9irmI6B5e7k/OVcdRksJfMRJwcquYVSfAk4hDrl7x0Qy36XELGvMe/hx07HxeAOXON8gL1b3UHP1zxvXb90YLHseHn9lssABsXS6Enyv3nrzqUi/uzBvpdDE2SRVS6nUr7Yyui6Yl+UPA="
;
String decryptKey = "5k9tQMrXq1JEpVucLwvO7A==";
//如果是加密的报文则需要在密文的前后添加双引号
if (isDataEncrypted) {
signContent = "\"" + signContent + "\"";

View File

@ -119,8 +119,8 @@
</div>
</el-card>
<el-card :key="childComponentKey">
<template>
<el-card :key="childComponentKey" class="_l">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="加油订单" name="refuelOrder">
<oilOrder :key="childComponentKey" :pUserId="form.id"></oilOrder>
@ -135,7 +135,7 @@
<pointsRecord :key="childComponentKey" :pUserId="form.id"></pointsRecord>
</el-tab-pane>
<el-tab-pane label="卡券列表" name="cardList">
<couponList :key="childComponentKey" :pUserId="form.id"></couponList>
<couponList :key="childComponentKey" :pUserId="id"></couponList>
</el-tab-pane>
<el-tab-pane label="成长值记录" name="growthValue">
<growthValueRecord :key="childComponentKey" :pUserId="form.id"></growthValueRecord>
@ -144,7 +144,7 @@
<!-- <refuelMoneyRecord :pUserId="form.id"></refuelMoneyRecord> -->
<!-- </el-tab-pane> -->
</el-tabs>
</template>
</el-card>
<!-- 会员充值-->
@ -1690,7 +1690,10 @@ export default {
height: 100%;
background: #f6f8f9;
}
._l{
}
.left {
width: 20%;
display: table-cell;

View File

@ -76,9 +76,9 @@ export default {
}
},
created() {
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
this.userId = this.pUserId;
// this.userId = this.$route.query.id;
console.log( "111111",this.userId)
this.getList()
this.getOilName()
},
@ -86,14 +86,18 @@ export default {
getOilNames(list,oilIds){
let name = "";
let oilNames = []
let oilId = oilIds.split(",")
list.forEach(item => {
oilId.forEach(i => {
if (item.oilName == i){
oilNames.push(item.oilNames)
}
if(oilIds){
let oilId = oilIds.split(",")
list.forEach(item => {
oilId.forEach(i => {
if (item.oilName == i){
oilNames.push(item.oilNames)
}
})
})
})
}
let arr = []
for (let i = 0;i<oilNames.length;i++){
if (arr.indexOf(oilNames[i])==-1){
@ -112,13 +116,15 @@ export default {
getList(){
this.loading = true
this.queryParams.userId = this.userId
// this.queryParams.mtUserId = this.userId
getCardFavorableList(this.queryParams).then(res=>{
if (res.code == 200) {
this.list = res.data.records
this.total = res.data.total
this.loading = false
}
})
},

View File

@ -45,7 +45,7 @@ export default {
created() {
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
console.log('1212',this.userId)
this.getList()
},
methods:{

View File

@ -121,7 +121,7 @@
return {
appltType:uni.getStorageSync("appltType"),
value: '',
liters:"",
liters:0,
show: false,
pic: 0,
hindex: 0,