diff --git a/fuintAdmin/src/api/convenienceStore/ljgoods.js b/fuintAdmin/src/api/convenienceStore/ljgoods.js index 4d0d97194..0ff8f1d6c 100644 --- a/fuintAdmin/src/api/convenienceStore/ljgoods.js +++ b/fuintAdmin/src/api/convenienceStore/ljgoods.js @@ -9,6 +9,15 @@ export function listLJGoods(query) { }) } +// 查询商品列表 +export function queryGoodsVoList(query) { + return request({ + url: '/business/convenience/goods/queryGoodsVoList', + method: 'get', + params: query + }) +} + // 查询商品详细 export function getLJGoods(id) { return request({ diff --git a/fuintAdmin/src/views/convenienceStore/goodsFile.vue b/fuintAdmin/src/views/convenienceStore/goodsFile.vue index fd4e00d30..a47eb53d5 100644 --- a/fuintAdmin/src/views/convenienceStore/goodsFile.vue +++ b/fuintAdmin/src/views/convenienceStore/goodsFile.vue @@ -7,10 +7,18 @@ - + + + + + + + - - - - - - - - - + + + + + + + diff --git a/fuintAdmin/src/views/convenienceStore/index.vue b/fuintAdmin/src/views/convenienceStore/index.vue index 98edd5470..eefb9b2d0 100644 --- a/fuintAdmin/src/views/convenienceStore/index.vue +++ b/fuintAdmin/src/views/convenienceStore/index.vue @@ -3,11 +3,11 @@ - - + + - + 添加分类 - - + >添加品类 + + - - + + + + + + + + - + @@ -96,7 +130,7 @@ - + @@ -119,17 +153,17 @@ - - - 无上级 - - - - - + + + + + + + + + + + @@ -148,10 +182,10 @@ - + - - + + @@ -159,7 +193,7 @@ - + @@ -192,6 +226,7 @@ import { import {delUser, getUser} from "@/api/staff/user/user"; import {getAccount, getAccountList} from "@/api/system/account"; import {addFixingLevel, updateFixingLevel} from "@/api/staff/user/fixinglevel"; +import {queryGoodsVoList} from "@/api/convenienceStore/ljgoods"; export default { dicts:['zhzt'], data() { @@ -207,6 +242,7 @@ export default { total: 0, // 表格数据 list: [], + goodsList: [], //是否修改一二级菜单 isShow:false, // 默认排序 @@ -259,7 +295,7 @@ export default { //校验规则 rules: { name: [ - { required: true, message: '请输入分类名称', trigger: 'blur' }, + { required: true, message: '请输入品类名称', trigger: 'blur' }, ], }, @@ -291,7 +327,7 @@ export default { handleAdd() { this.reset() this.open = true; - this.title = "新增分类"; + this.title = "新增品类"; }, //获取父类 getFirstMenu(){ @@ -310,7 +346,7 @@ export default { dooSubmit(){ this.$refs['form'].validate(valid => { if (valid) { - //新增一级分类 + //新增一级品类 if(this.form.pid == '' || this.form.pid == undefined ){ this.form.pid = 0 } @@ -357,6 +393,20 @@ export default { this.loading = false; }); }, + onExpand(row, expandedRows){ + this.$message.success(row) +// 判断当前展开行 + if (expandedRows.find(ele => ele === row)) { + // debugger + this.curElementId = row.id // 获取当前行ID + this.getGoodsList(curElementId) // 获取列表 + } + }, + getGoodsList(cvsGoodsId){ + queryGoodsVoList({cvsGoodId:cvsGoodsId}).then(res => { + this.goodsList = res.data + }) + }, // 取消查询 resetForm(){ this.goodsQueryForm.name = '' @@ -373,21 +423,21 @@ export default { if (this.form.id) { updateCevGood(this.form).then(response => { if (response.data==1){ - this.$modal.msgSuccess("分类更新成功"); + this.$modal.msgSuccess("品类更新成功"); this.open = false; this.getList(); this.getFirstMenu(); }else { - this.$modal.msgError("分类名称已存在,修改失败"); + this.$modal.msgError("品类名称已存在,修改失败"); } }); } else { insertCvsGoods(this.form).then(response => { if (response.data == -1){ - this.$modal.msgError("分类名称已存在,添加失败"); + this.$modal.msgError("品类名称已存在,添加失败"); }else { - this.$modal.msgSuccess("分类添加成功"); + this.$modal.msgSuccess("品类添加成功"); this.open = false; this.getList(); this.getFirstMenu(); @@ -409,13 +459,13 @@ export default { selectParentById(id).then(response => { this.form = response.data; this.open = true; - this.title = "编辑分类"; + this.title = "编辑品类"; }); }, // 删除按钮操作 handleDelete(row) { const name = row.name - this.$modal.confirm('确定删除"' + name + '"的分类信息?').then(function() { + this.$modal.confirm('确定删除"' + name + '"的品类信息?').then(function() { // return deleteMember(row.id); return deleteBYId(row.id); }).then(() => { diff --git a/fuintAdmin/src/views/member/userInfo.vue b/fuintAdmin/src/views/member/userInfo.vue index f0455cf1f..088e5576a 100644 --- a/fuintAdmin/src/views/member/userInfo.vue +++ b/fuintAdmin/src/views/member/userInfo.vue @@ -365,7 +365,7 @@ 取 消 - + @@ -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 @@
- + - + @@ -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 = {