From 02fecd88de1beaf80de66e07a0568da471dfd751 Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Fri, 29 Jan 2021 20:28:17 +0800 Subject: [PATCH] Merge branch 'api' into hive2.0 --- zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html | 23 +++++++---------------- zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml | 1 + zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java | 15 +++++++++++++++ zq-erp/src/main/resources/config/test/application.properties | 10 +++------- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java index ffe1a96..55f0ffd 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java @@ -22,6 +22,7 @@ import com.matrix.system.hive.dao.SysOrderItemDao; import com.matrix.system.hive.dao.SysShopInfoDao; import com.matrix.core.tools.DateUtil; +import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.pojo.ShoppingCarItem; import com.matrix.system.hive.pojo.ShoppingCarItemsVo; import com.matrix.system.hive.service.*; @@ -151,10 +152,24 @@ @ResponseBody @Transactional(rollbackFor = Exception.class) public AjaxResult refundOrder(@RequestBody SysOrder sysOrder) { + //储值卡订单不能通过退款渠道退款 + if(CollectionUtils.isNotEmpty(sysOrder.getItems())){ + List<SysOrderItem> orderItem = orderItemService.findByOrderId(sysOrder.getItems().get(0).getOrderId()); + if(orderItem.size()==1){ + if(orderItem.get(0).getShoppingGoods().getCode().equals("vipCzk")){ + return AjaxResult.buildFailInstance("充值订单请直接冲负数金额退款!"); + } + } + } + + + SysUsers user = getMe(); sysOrder.setShopId(user.getShopId()); sysOrder.setStatu(Dictionary.ORDER_STATU_TK); sysOrder.setOrderTime(new Date()); + + //校验订单是否满足结算调价,新订单则保存订单,已有订单则删除后更新 sysOrder = orderService.checkAndSaveOrder(sysOrder); orderService.refundOrderMoney(sysOrder); diff --git a/zq-erp/src/main/resources/config/test/application.properties b/zq-erp/src/main/resources/config/test/application.properties index ddd637e..a4f5857 100644 --- a/zq-erp/src/main/resources/config/test/application.properties +++ b/zq-erp/src/main/resources/config/test/application.properties @@ -4,13 +4,9 @@ #线上测试环境 -#spring.datasource.username=ct_test -#spring.datasource.password=123456 -#spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 - -spring.datasource.username=chuhuan -spring.datasource.password=chuhuan -spring.datasource.url=jdbc:mysql://175.6.132.141:3306/hive_v2_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 +spring.datasource.username=ct_test +spring.datasource.password=123456 +spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml index 62c25ce..c2a59fc 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml @@ -475,6 +475,7 @@ MAX(pay_time) payTime, GROUP_CONCAT(DISTINCT t2.shop_short_name) shopName from sys_order t1 + left join sys_order_item b on t1.id=b.ORDER_ID and goods_id!=5583 left join sys_shop_info t2 on t1.SHOP_ID=t2.ID where VIP_ID=#{vipId} and STATU='已付款'; </select> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html index e2eeca7..12f1b8c 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html @@ -62,7 +62,7 @@ <el-row type="flex" align="middle" style="padding: 0 0 10px 0;"> <el-col :span="5" style="text-align: center;">充值金额</el-col> <el-col :span="10" style="text-align: center; line-height: 50px;"> - <el-input v-model="rechargeMoney" @change="changeRechargeMoney" placeholder="0.1元起充"></el-input> + <el-input type="number" v-model="rechargeMoney" @change="changeRechargeMoney" placeholder="可充负数退款"></el-input> </el-col> </el-row> @@ -168,7 +168,7 @@ data : { cardInfo : "", loginUser : "", - rechargeMoney : "", + rechargeMoney : 0, payMethods: [{ value: '现金支付', img: '/images/pay/cash.png', @@ -251,11 +251,6 @@ return; } - if (_this.rechargeMoney < 0.1) { - this.$message.warning("0.1元起充"); - return; - } - if (_this.payMoneys.length > 0) { let flows = [] var total = 0; @@ -266,10 +261,11 @@ this.$message.warning("请输入" + item.type + "的付款金额"); return false; } - flow.amount = item.money; - total += item.money; + flow.amount = parseFloat(item.money); + total += parseFloat(item.money); flows.push(flow); }) + debugger if (total != _this.rechargeMoney) { this.$message.warning("付款金额应等于充值金额"); return false; @@ -347,10 +343,7 @@ return; } - if (rechargeMoney < 0.1) { - this.$message.warning("0.1元起充"); - return; - } + if (item.type != '储值卡') { this.$nextTick(function () { if (item.isActive) { @@ -373,9 +366,7 @@ for(var i = 0; i < payMoneys.length; i++) { hasAmount += parseFloat(payMoneys[i].money); } - if (_this.rechargeMoney - hasAmount > 0) { - Vue.set(item, 'money', _this.rechargeMoney - hasAmount); - } + Vue.set(item, 'money', _this.rechargeMoney - hasAmount); _this.payMoneys.push(item); } }); -- Gitblit v1.9.1