+
@@ -806,7 +806,6 @@
@@ -1413,12 +1412,15 @@ export default {
confirm1(){
this.$refs["form"].validate(valid => {
if (valid) {
+ this.form2.userId = this.id
giftCardExchange(this.form2).then(res => {
if (res.data.id == '' || res.data.id == null) {
this.$message.error('兑换失败!');
} else {
this.$message.success('兑换成功!');
this.openRecharge = false
+ this.form2.number = ''
+ this.form2.cardPassword = ''
}
})
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/LJGoodsController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/LJGoodsController.java
index bbbeb1606..5597d49b8 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/LJGoodsController.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/controller/LJGoodsController.java
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.convenienceSore.dto.LJGoodsDto;
import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.service.LJGoodsService;
+import com.fuint.business.convenienceSore.vo.LjGoodsVo;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
@@ -47,6 +48,12 @@ public class LJGoodsController extends BaseController {
return getSuccessResult(goods);
}
+ @GetMapping("/queryGoodsVoList")
+ public ResponseObject queryGoodsVoList(LJGoods goods){
+ List ljGoodsVos = goodsService.selectGoodsVoList(goods);
+ return getSuccessResult(ljGoodsVos);
+ }
+
/**
* 根据id查询商品信息
* @param id
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/LJGoodsMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/LJGoodsMapper.java
index 2bd163758..5e38c0a6f 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/LJGoodsMapper.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/LJGoodsMapper.java
@@ -4,9 +4,12 @@ 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.convenienceSore.entity.LJGoods;
+import com.fuint.business.convenienceSore.vo.LjGoodsVo;
import com.fuint.business.userManager.entity.LJUser;
import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
public interface LJGoodsMapper extends BaseMapper {
/**
* 根据条件分页查询会员信息
@@ -21,4 +24,10 @@ public interface LJGoodsMapper extends BaseMapper {
int subtractGoodesStockByLock(@Param("id") Integer id, @Param("stock") Integer stock);
+
+ /**
+ * 查询所有商品列表信息
+ * @return
+ */
+ public List selectGoodsVoList(@Param("goods") LJGoods goods);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/LJGoodsMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/LJGoodsMapper.xml
index 9e7ec919f..7cf7299de 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/LJGoodsMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/LJGoodsMapper.xml
@@ -37,10 +37,26 @@
or shelf_number like concat('%', #{goods.remark}, '%')
)
- order by sort
+
+ order by sort
+
+
+
update mt_goods set
stock = stock - #{stock}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/LJGoodsService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/LJGoodsService.java
index 6ee84f8e1..5d196b4d5 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/LJGoodsService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/LJGoodsService.java
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.convenienceSore.dto.LJGoodsDto;
import com.fuint.business.convenienceSore.entity.LJGoods;
+import com.fuint.business.convenienceSore.vo.LjGoodsVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -27,6 +28,12 @@ public interface LJGoodsService extends IService {
*/
public List selectGoodsList();
+ /**
+ * 查询所有商品列表信息
+ * @return
+ */
+ public List selectGoodsVoList(LJGoods goods);
+
/**
* 根据id查询商品信息
* @param id
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/LJGoodsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/LJGoodsServiceImpl.java
index b6f7566ed..4c93cda98 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/LJGoodsServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/LJGoodsServiceImpl.java
@@ -16,6 +16,7 @@ import com.fuint.business.convenienceSore.mapper.LJGoodsMapper;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.convenienceSore.service.StockStatisticService;
import com.fuint.business.convenienceSore.service.StockTrackService;
+import com.fuint.business.convenienceSore.vo.LjGoodsVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.RedisLock;
import com.fuint.common.util.StringUtils;
@@ -71,6 +72,13 @@ public class LJGoodsServiceImpl extends ServiceImpl impl
return list;
}
+ @Override
+ public List selectGoodsVoList(LJGoods goods) {
+ AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
+ goods.setStoreId(nowAccountInfo.getStoreId());
+ return baseMapper.selectGoodsVoList(goods);
+ }
+
/**
* 根据id查询商品信息
* @param id
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/LjGoodsVo.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/LjGoodsVo.java
new file mode 100644
index 000000000..e0b4c6b0c
--- /dev/null
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/LjGoodsVo.java
@@ -0,0 +1,12 @@
+package com.fuint.business.convenienceSore.vo;
+
+import com.fuint.business.convenienceSore.entity.LJGoods;
+import lombok.Data;
+
+@Data
+public class LjGoodsVo extends LJGoods {
+// 分类名称
+ private String cvsGoodName;
+// 供应商名称
+ private String supplierName;
+}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/GrowthValueChangeService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/GrowthValueChangeService.java
index f89113fc0..cb40677a6 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/GrowthValueChangeService.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/GrowthValueChangeService.java
@@ -34,4 +34,11 @@ public interface GrowthValueChangeService {
* @return
*/
public int updateGrowthValueChange(GrowthValueChange growthValueChange);
+
+ /**
+ * 退款时成长值记录变化
+ * @param orderNo
+ * @return
+ */
+ void refundGrowthValueChange(String orderNo,Integer userId,Integer storeId);
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
index 4c4bf2670..719f5327b 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java
@@ -145,6 +145,9 @@ public class AllOrderInfoServiceImpl extends ServiceImpl map) {
@@ -219,6 +222,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl implements GrowthValueChangeService {
+ @Autowired
+ private ILJStoreService storeService;
+ @Autowired
+ private LJUserService userService;
+
@Override
public IPage selectGrowthValueChangeList(Page page, GrowthValueChangeVo growthValueChange) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@@ -34,4 +46,34 @@ public class GrowthValueChangeServiceImpl extends ServiceImpl();
+ queryWrapper.eq("order_no",orderNo);
+ queryWrapper.eq("change_type","1");
+ queryWrapper.eq("user_id",userId);
+ queryWrapper.eq("store_id",storeId);
+ LJStore store = storeService.selectStoreByStoreId(storeId);
+ GrowthValueChange growthValueChange = baseMapper.selectOne(queryWrapper);
+ if (ObjectUtil.isNotEmpty(growthValueChange)){
+ GrowthValueChange growthValueChange1 = new GrowthValueChange();
+ growthValueChange1.setUserId(userId);
+ growthValueChange1.setStoreId(storeId);
+ growthValueChange1.setChainStoreId(store.getChainStoreId());
+ growthValueChange1.setFromType("订单退款");
+ growthValueChange1.setChangeType("0");
+ growthValueChange1.setGrowthValue(-growthValueChange.getGrowthValue());
+ growthValueChange1.setAfterTheChange(growthValueChange.getAfterTheChange()-growthValueChange.getGrowthValue());
+ growthValueChange1.setOrderNo(orderNo);
+ LJUserVo userVo = userService.selectUserById(userId, storeId);
+ if (ObjectUtil.isNotEmpty(userVo)){
+ this.insertGrowthValueChange(growthValueChange1);
+ userVo.setGrowthValue(growthValueChange.getAfterTheChange()+growthValueChange.getGrowthValue());
+ userService.updateUser(userVo);
+ }
+
+ }
+ }
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java
index 0d2ac70f4..f6003072c 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java
@@ -1227,7 +1227,7 @@ public class OilOrderServiceImpl extends ServiceImpl i
*/
@Override
public void addOilTrack(JSONObject oilOrder,Integer storeId){
- OilTank oilTank = oilTankService.queryById(Integer.valueOf(oilOrder.get("tankId").toString()));
+// OilTank oilTank = oilTankService.queryById(Integer.valueOf(oilOrder.get("tankId").toString()));
// 添加库存跟踪信息
OilTracking oilTracking = new OilTracking();
oilTracking.setDocument("油品出售");
@@ -1244,9 +1244,10 @@ public class OilOrderServiceImpl extends ServiceImpl i
oilTrackingService.insert(oilTracking);
// 修改油罐容量
- Double storedQuantity = oilTank.getStoredQuantity();
- oilTank.setStoredQuantity(storedQuantity-Double.parseDouble(oilOrder.get("liters").toString()));
- oilTankService.update(oilTank);
+// Double storedQuantity = oilTank.getStoredQuantity();
+// oilTank.setStoredQuantity(storedQuantity-Double.parseDouble(oilOrder.get("liters").toString()));
+// oilTankService.update(oilTank);
+ oilTankService.subtractStoredQuantityByLock(Integer.valueOf(oilOrder.get("tankId").toString()),oilNum);
}
/**
@@ -1274,8 +1275,7 @@ public class OilOrderServiceImpl extends ServiceImpl i
oilTracking.setTankId(oilOrder.getTankId());
oilTrackingService.insert(oilTracking);
- oilTank.setStoredQuantity(storedQuantity-oilOrder.getOilNum());
- oilTankService.update(oilTank);
+ oilTankService.subtractStoredQuantityByLock(oilOrder.getTankId(),oilOrder.getOilNum());
}
@Override
diff --git a/fuintCashierWeb/src/api/cashier/giftCard/giftcard.js b/fuintCashierWeb/src/api/cashier/giftCard/giftcard.js
new file mode 100644
index 000000000..359c122a7
--- /dev/null
+++ b/fuintCashierWeb/src/api/cashier/giftCard/giftcard.js
@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 测试支付接口
+export function giftCardExchange(query) {
+ return request({
+ url: '/business/marketingActivity/cardGift/exchange',
+ method: 'get',
+ data:query
+ })
+}
diff --git a/fuintCashierWeb/src/views/details/index.vue b/fuintCashierWeb/src/views/details/index.vue
index 6df97a480..408fc8ad7 100644
--- a/fuintCashierWeb/src/views/details/index.vue
+++ b/fuintCashierWeb/src/views/details/index.vue
@@ -366,6 +366,28 @@
取 消
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确认充值
+ 取 消
+
+
@@ -585,7 +607,7 @@
-
+
@@ -670,7 +692,7 @@
-
+
@@ -779,8 +801,9 @@
@@ -829,6 +852,7 @@ import {ljStoreInfo} from "@/api/cashier/user/store";
import {getUserGradeInfo} from "@/api/cashier/usergrade";
import {getDicts} from "@/api/dict/data";
import {getSysConfig} from "@/api/cashier/user/sysconfig";
+import {giftCardExchange} from "@/api/cashier/giftCard/giftcard";
export default {
components: {
@@ -962,6 +986,7 @@ export default {
form: {},
refuelMoney:0,
form1: {},
+ form2: {},
cardChildPhones: '',
// 加油总金额
allAmount:0,
@@ -998,6 +1023,11 @@ export default {
fixingLevel: [{required: true, message: "请选择认证信息", trigger: "blur"}],
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
+ },
+ // 表单校验
+ rules1: {
+ number: [{required: true, message: "请输入卡号", trigger: "blur"}],
+ cardPassword: [{required: true, message: "请输入卡密", trigger: "blur"}],
}
}
},
@@ -1088,7 +1118,7 @@ export default {
submitSubCard(){
this.$refs["form1"].validate(valid => {
if (valid) {
- this.form1.cardChildPhones = this.cardChildPhones
+ // this.form1.cardChildPhones = this.cardChildPhones
if (this.form1.id) {
editCardValueChild(this.form1).then(res => {
if (res.data==1){
@@ -1259,6 +1289,22 @@ export default {
})
}
},
+ confirm1(){
+ this.$refs["form"].validate(valid => {
+ if (valid) {
+ giftCardExchange(this.form2).then(res => {
+ if (res.data.id == '' || res.data.id == null) {
+ this.$message.error('兑换失败!');
+ } else {
+ this.$message.success('兑换成功!');
+ this.openRecharge = false
+ this.form2.number = ''
+ this.form2.cardPassword = ''
+ }
+ })
+ }
+ })
+ },
// 存油卡查询
async getCardFuelDieselList() {
let quy = {