From 9e403cd413cf7e47520e79d779e64f53b9b0dd1e Mon Sep 17 00:00:00 2001 From: wangh <9483> Date: Tue, 2 Jan 2024 11:21:12 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9+=E4=B8=AD=E6=B3=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fuintAdmin/src/permission.js | 4 +- fuintAdmin/src/utils/request.js | 2 +- .../src/views/indexcomponents/topindex.vue | 24 +- fuintAdmin/src/views/integral/gift/index.vue | 130 ++--- fuintAdmin_zt/package.json | 3 +- fuintAdmin_zt/src/router/index.js | 2 +- fuintAdmin_zt/src/store/index.js | 9 + fuintAdmin_zt/src/store/modules/token.js | 1 + fuintAdmin_zt/src/utils/auth.js | 5 + fuintAdmin_zt/src/views/Service/index.vue | 5 +- fuintAdmin_zt/src/views/Site/index.vue | 26 +- .../src/views/components/Service/index.vue | 100 ++-- .../src/views/components/Service/staff.vue | 4 +- .../fuyou/service/impl/FyPayServiceImpl.java | 3 +- .../impl/IntegralOrdersServiceImpl.java | 5 + .../mapper/xml/CardValueRecordMapper.xml | 20 +- .../service/impl/LJStaffServiceImpl.java | 3 + .../order/mapper/AllOrderInfoMapper.java | 7 + .../order/mapper/xml/AllOrderInfoMapper.xml | 15 + .../order/mapper/xml/LJOrderMapper.xml | 12 +- .../order/mapper/xml/OilOrderMapper.xml | 27 +- .../service/impl/OilOrderServiceImpl.java | 2 + .../entity/OilGun.java | 3 + .../entity/OilInventory.java | 3 + .../entity/OilInventoryOrder.java | 3 + .../entity/OilPurchase.java | 3 + .../entity/OilPurchaseOrder.java | 3 + .../entity/OilSuppliers.java | 3 + .../entity/OilTank.java | 3 + .../entity/OilTracking.java | 3 + .../controller/BackendStoreController.java | 16 +- .../business/store/mapper/MtStoreMapper.java | 14 + .../store/mapper/xml/ExportExcelService.xml | 24 + .../business/store/service/StoreService.java | 5 + .../store/service/impl/StoreServiceImpl.java | 94 ++++ .../business/store/task/QuartzConfig.java | 67 +++ .../fuint/business/store/task/streamTask.java | 29 ++ .../userManager/mapper/xml/LJUserMapper.xml | 5 +- .../service/LJUserGradeService.java | 6 + .../service/UserBalanceService.java | 3 + .../service/impl/LJUserGradeServiceImpl.java | 9 + .../service/impl/LJUserServiceImpl.java | 7 +- .../service/impl/UserBalanceServiceImpl.java | 33 ++ .../system/dept/mapper/SysDeptMapper.java | 15 + .../system/dept/mapper/xml/SysDeptMapper.xml | 26 +- .../controller/BackendAccountController.java | 8 +- .../src/main/resources/application.properties | 4 +- .../src/test/java/UserSeriviceTest.java | 21 + fuintCashierWeb/.env.development | Bin 287 -> 288 bytes gasStation-uni/package-lock.json | 457 +----------------- gasStation-uni/pages/index/index.vue | 30 +- .../pagesHome/PointsMall/PointsMall.vue | 40 +- .../pagesHome/goodsDetails/goodsDetails.vue | 65 +-- gasStation-uni/pagesHome/order/order.vue | 28 +- gasStation-uni/pagesLogin/login/login.vue | 68 +-- 55 files changed, 800 insertions(+), 707 deletions(-) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/store/task/QuartzConfig.java create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/store/task/streamTask.java diff --git a/fuintAdmin/src/permission.js b/fuintAdmin/src/permission.js index 924ff0389..bcf0ca28d 100644 --- a/fuintAdmin/src/permission.js +++ b/fuintAdmin/src/permission.js @@ -6,7 +6,7 @@ import 'nprogress/nprogress.css' import {getToken, removeToken, setToken} from '@/utils/auth' import { isRelogin } from '@/utils/request' import { loginVerificationApi } from '@/api/login' -// import BigNumber from 'bignumber.js'; +import BigNumber from 'bignumber.js'; NProgress.configure({ showSpinner: false }) @@ -34,8 +34,6 @@ router.beforeEach(async (to, from, next) => { next({ path: '/' }) NProgress.done() }else { - console.log("111113",store.getters.roles) - if (store.getters.roles.length === 0) { console.log("111114") isRelogin.show = true diff --git a/fuintAdmin/src/utils/request.js b/fuintAdmin/src/utils/request.js index 178388b01..f62ff5e7b 100644 --- a/fuintAdmin/src/utils/request.js +++ b/fuintAdmin/src/utils/request.js @@ -50,7 +50,7 @@ service.interceptors.request.use(config => { const s_data = sessionObj.data; // 请求数据 const s_time = sessionObj.time; // 请求时间 const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 - if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url && s_url!='backendApi/store/loginVerification') { const message = '数据正在处理,请耐心等待'; console.warn(`[${s_url}]: ` + message) return Promise.reject(new Error(message)) diff --git a/fuintAdmin/src/views/indexcomponents/topindex.vue b/fuintAdmin/src/views/indexcomponents/topindex.vue index ebbbe0728..3df985c28 100644 --- a/fuintAdmin/src/views/indexcomponents/topindex.vue +++ b/fuintAdmin/src/views/indexcomponents/topindex.vue @@ -25,12 +25,12 @@ {{ this.statisticsData.today_sum_chain }} - +
{{ this.statisticsData.today_sum_chain }}
- +
环比
@@ -52,7 +52,7 @@ {{ this.statisticsData.week_sum_chain?this.statisticsData.week_sum_chain:0 }} - +
{{ this.statisticsData.week_sum_chain?this.statisticsData.week_sum_chain:0 }} @@ -70,18 +70,18 @@ 本月流水总额
- {{this.statisticsData.this_month_sum}} + {{this.statisticsData.this_month_sum?this.statisticsData.this_month_sum:0}}
- +
{{ this.statisticsData.month_sum_chain?this.statisticsData.month_sum_chain:0 }}
- +
{{ this.statisticsData.month_sum_chain?this.statisticsData.month_sum_chain:0 }} @@ -111,7 +111,7 @@ {{ this.statisticsData.today_count_chain?this.statisticsData.today_count_chain:0 }}
- +
{{ this.statisticsData.today_count_chain?this.statisticsData.today_count_chain:0 }} @@ -143,7 +143,7 @@ {{ this.statisticsData.week_count_chain?this.statisticsData.week_count_chain:0 }}
- +
{{ this.statisticsData.week_count_chain?this.statisticsData.week_count_chain:0 }} @@ -169,14 +169,14 @@
--> - +
{{ this.statisticsData.month_count_chain?this.statisticsData.month_count_chain:0 }}
- +
{{ this.statisticsData.month_count_chain?this.statisticsData.month_count_chain:0 }} @@ -218,7 +218,7 @@ export default { this_week_sum: 0.0, week_count_chain: 0.0, week_sum_chain: 0.0, - + } } }, @@ -233,7 +233,7 @@ export default { this.statisticsData = res.data this.loading = false } - + }) } } diff --git a/fuintAdmin/src/views/integral/gift/index.vue b/fuintAdmin/src/views/integral/gift/index.vue index 7f0f7eff4..b5f5725a3 100644 --- a/fuintAdmin/src/views/integral/gift/index.vue +++ b/fuintAdmin/src/views/integral/gift/index.vue @@ -1,6 +1,6 @@ - + @@ -287,7 +287,7 @@ v-for="item in rolelist" :key="item.id" :label="item.name" - :value="item.id" + :value="item.id" > @@ -661,7 +661,7 @@ //树形页操作 //新增树 append(data) { - console.log('新增',data) + console.log('新增树',data) // 清除表单 this.cleanRuleForm() this.activeName = 'info' @@ -682,6 +682,9 @@ leader_phone:'', // parentName:'请先选择父级节点', deptName: '', + turnoverLimit: '', + turnoverType: "1", + turnoverTime: '', } }, // 新增数据 @@ -691,8 +694,15 @@ // _this.ruleForm.deptType = '1' // 点击树获取部门信息 Userlist(id).then(res=>{ - this.parentName = res.data.parentName - this.ruleForm.parentId = res.data.parentId + console.log("新增树的返回",res) + if (res.data.deptType === "3") { + this.parentName = res.data.parentName + this.ruleForm.parentId = res.data.parentId + } else { + this.parentName = res.data.deptName + this.ruleForm.parentId = res.data.deptId + } + }) }, @@ -783,7 +793,7 @@ this.form.deptType = this.Thetree[0].deptType console.log("this.Thetree",this.Thetree[0]) } - + }); this.loading = true; // this.addDateRange(this.queryParams, this.dateRange) @@ -947,7 +957,7 @@ accountStatus:1 } }, - + /** 修改按钮操作 */ handleUpdate(row) { console.log('修改用户信息',row) @@ -956,7 +966,7 @@ app.reset(); app.open = true; app.form = row - + app.form.roleIds = Number(app.form.roleIds); app.form.password1 = row.password diff --git a/fuintAdmin_zt/src/views/components/Service/index.vue b/fuintAdmin_zt/src/views/components/Service/index.vue index 19bfcdaf3..7621ad70f 100644 --- a/fuintAdmin_zt/src/views/components/Service/index.vue +++ b/fuintAdmin_zt/src/views/components/Service/index.vue @@ -11,9 +11,8 @@
- - - + +
@@ -61,16 +60,25 @@
+
-
+
营业执照 - +
+ + + +
-
+
门头照 - +
+ + + +
- + @@ -114,11 +122,11 @@ - + - - + + @@ -134,13 +142,13 @@ placeholder="选择日期"> - + - - + + @@ -166,10 +174,10 @@ - - - + + + @@ -219,7 +227,7 @@ - + @@ -267,7 +275,7 @@ return{ dataForm:{coverImage:''}, // 上传地址 - uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload', + uploadAction: 'http://192.168.0.178:8008/backendApi/file/upload', uploadHeader: { 'Access-Token' : getToken() }, // 隐藏上传 hideUpload: false, @@ -278,7 +286,7 @@ url:'http://localhost:8008/static/uploadImages/20231103/ffbbe7d3ee1441fdaf706802fa0f176a.png'} ], imagePath: process.env.VUE_APP_SERVER_URL, - + // 多文件上传 uploadImages: [], dialogImageUrl: "", @@ -310,7 +318,7 @@ doorstepPhoto:[], }, - + squareUrl: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png", dialogFormVisible: false, @@ -332,7 +340,7 @@ desc: '' }, formLabelWidth: '120px', - + rules: { name: [ @@ -353,6 +361,9 @@ }, computed: { + uploadAction(){ + + }, fullImagePath() { return this.imagePath + this.from.logo; } @@ -395,7 +406,7 @@ if(this.id){ Storedetails(this.id).then(res=>{ // console.log("hello1",res.data) - if (res.code == 200) { + if (res.code == 200) { // this.from = {} @@ -422,8 +433,8 @@ this.uploadImages.push(newImage); }) } - - } + + } this.$forceUpdate(); } @@ -436,10 +447,18 @@ enterThePetrolStation() { - singleSignOnApi(this.id).then(res=>{ - window.open('http://localhost:82/index?entrance='+this.id) - // '_blank'); + if (this.from.status == 'jy') { + this.$message('该油站已被禁用'); + return + } + singleSignOnApi(this.id).then(res=>{ + if (res.code == 200) { + let url = + // let url = process.env.VUE_APP_SERVER_URL + console.log("url",url) + window.open( 'http://localhost:81/index?entrance='+this.id) + } }) // 在token+入 }, @@ -447,6 +466,7 @@ // 上传封面 handleUploadSuccessLogo(file) { + console.log("1231231231231") this.from.logo = file.data.fileName; }, handleUploadSuccessLicence(file) { @@ -498,7 +518,7 @@ // Check if the number of files exceeds 3 if (this.uploadImages.length >= 3) { - this.$message.warning('You can only upload up to three images.'); + this.$message.warning('最多只可以上传三张'); return false; // Cancel upload } return true; // Continue with the upload @@ -560,17 +580,17 @@ .bottom-box2{ - width: 1400px; + /* width: 1400px; */ /* position: absolute; bottom: 0px; */ - margin-top: 30px; - margin-bottom: 30px; - height: 350px; + /* margin-top: 30px; */ + /* margin-bottom: 30px; */ + /* height: 350px; */ background: rgb(255, 255, 255); /* background-color: #006cff; */ display: flex; /* align-items: center; */ - justify-content: center; + justify-content: left; } .bottom-box{ @@ -595,11 +615,11 @@ /* 上传头像 */ .list-img{ - width: 100px; - height: 100px; + width: 98px; + height: 98px; } - + .d-dialog >>> .el-upload--picture-card { width: 100px; height: 100px; @@ -630,8 +650,8 @@ /* //去掉过渡动画,不然删除操作的时候,布局会闪一下。 */ -/deep/ .el-upload-list__item { +/* /deep/ .el-upload-list__item { transition: none !important -} - \ No newline at end of file +} */ + diff --git a/fuintAdmin_zt/src/views/components/Service/staff.vue b/fuintAdmin_zt/src/views/components/Service/staff.vue index 785c41989..98a7dcfd0 100644 --- a/fuintAdmin_zt/src/views/components/Service/staff.vue +++ b/fuintAdmin_zt/src/views/components/Service/staff.vue @@ -588,7 +588,7 @@ defaultSort: {prop: 'createTime', order: 'descending'}, // 表单参数 form: { - id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'', + id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:this.id, auditedStatus:'', auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl', merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx', transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:'' @@ -763,7 +763,7 @@ this.appletPrem = ''; this.writeOff = [] this.form = { - id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'A', + id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:this.id, auditedStatus:'A', auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl', merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx', transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:'' 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 94c8c01c2..4c1de1a05 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 @@ -332,7 +332,8 @@ public class FyPayServiceImpl implements FyPayService { Map res = new HashMap<>(); try { // 查询商户配置信息 - MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId()); +// MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId()); + MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16); // 查询用户信息 LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java index ad3ec3d9a..b38a9da34 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java @@ -233,6 +233,10 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { * @param orderNo * @return */ + + + // todo 判断积分商城兑换类型 根据类型在进行处理 + @Override public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) { @@ -298,6 +302,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService { } + @Override public Map integralOrdersProcessingUni(IntegralOrdersRequest integralOrdersList) { double epsilon = 1e-10; // 阈值 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml index 693630a00..da729b010 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml @@ -163,9 +163,18 @@ CROSS JOIN (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) c ) date_range LEFT JOIN + ( + SELECT + DATE(create_time) AS create_time, + recharge_balance + FROM + card_value_record + WHERE + store_id = #{storeId} + ) card_value_record ON DATE(card_value_record.create_time) = date_range.date WHERE - date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE() + (date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()) GROUP BY date_range.date ORDER BY @@ -187,6 +196,15 @@ CROSS JOIN (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) c ) date_range LEFT JOIN + ( + SELECT + DATE(create_time) AS create_time, + recharge_balance + FROM + card_fuel_record + WHERE + store_id = #{storeId} + ) card_fuel_record ON DATE(card_fuel_record.create_time) = date_range.date WHERE date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE() diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index 8943a9d69..38921c7d9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -116,6 +116,9 @@ public class LJStaffServiceImpl extends ServiceImpl impl public int insertStaff(LJStaff staff) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); Integer storeId = nowAccountInfo.getStoreId(); + if (ObjectUtil.isNotEmpty(staff.getStoreId())) { + storeId = staff.getStoreId(); + } staff.setStoreId(storeId); if (StringUtils.isNotEmpty(staff.getRefundPassword())){ this.entryptPassword(staff); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java index 033f7e338..80d98ed87 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java @@ -2,6 +2,13 @@ package com.fuint.business.order.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.fuint.business.order.entity.AllOrderInfo; +import com.fuint.business.store.entity.MtStore; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.List; public interface AllOrderInfoMapper extends BaseMapper { + // 根据storeId List查询总流水 + BigDecimal allStream(@Param("list") List mtStoreList); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml new file mode 100644 index 000000000..778467da9 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml index 0e4bacb33..8a8e810f9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/LJOrderMapper.xml @@ -134,10 +134,19 @@ CROSS JOIN (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) c ) date_range LEFT JOIN - mt_order ON DATE(mt_order.create_time) = date_range.date + ( + SELECT + DATE(create_time) AS order_date, + pay_amount + FROM + mt_order + WHERE + store_id = #{storeId} + ) mt_order ON date_range.date = mt_order.order_date WHERE (date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()) + GROUP BY date_range.date @@ -146,3 +155,4 @@ + 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 b3eb4d687..eeab45c4d 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 @@ -204,11 +204,17 @@ CROSS JOIN (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) c ) date_range LEFT JOIN - oil_order ON DATE(oil_order.create_time) = date_range.date + ( + SELECT + DATE(create_time) AS order_date, + pay_amount + FROM + oil_order + WHERE + store_id = #{storeId} + ) oil_order ON date_range.date = oil_order.order_date WHERE - store_id = #{storeId} - and - (date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()) + date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE() GROUP BY date_range.date ORDER BY @@ -271,20 +277,21 @@ - + select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money, + mub.second_card,mub.fixing_level + FROM mt_user mu + LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id mu.id = #{id} and mub.chain_store_id =#{chainStoreId} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java index 1347a9474..844c133d3 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserGradeService.java @@ -66,6 +66,12 @@ public interface LJUserGradeService extends IService { */ public LJUserGrade selectUserGradeByStoreId(int storeId); + /** + * 根据chainStoreId查询会员最低等级信息 + * @param chainStoreId + * @return + */ + LJUserGrade selectUserGradeByChainStoreId(int chainStoreId); /** * 根据id删除会员等级信息 * @param id diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/UserBalanceService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/UserBalanceService.java index a3bd65370..5fa3c3af8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/UserBalanceService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/UserBalanceService.java @@ -54,4 +54,7 @@ public interface UserBalanceService extends IService { */ UserBalance getUserBalance(); + int initBalance(Integer userId , Integer chainStoreId); + + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java index 3d599e355..6fe720dd9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserGradeServiceImpl.java @@ -116,6 +116,15 @@ public class LJUserGradeServiceImpl extends ServiceImpl(); + queryWrapper.eq("chain_store_id",chainStoreId); + queryWrapper.orderByAsc("grade"); + List list = baseMapper.selectList(queryWrapper); + return list.get(0); + } + @Override public void deleteUserGradeById(Integer id) { baseMapper.deleteById(id); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java index 3ea478f84..96a1c9992 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java @@ -130,12 +130,17 @@ public class LJUserServiceImpl extends ServiceImpl impleme return baseMapper.selectUserById(id); } - + @Resource + UserBalanceService userBalanceService; @Override public LJUserVo getByUniApp(Integer chainStoreId) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); LJUserVo ljUserVo = baseMapper.selectUserByIdUni(nowAccountInfo.getId(), chainStoreId); + if (ObjectUtil.isEmpty(ljUserVo)) { + userBalanceService.initBalance(nowAccountInfo.getId(), chainStoreId); + ljUserVo = baseMapper.selectUserByIdUni(nowAccountInfo.getId(), chainStoreId); + } return ljUserVo; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java index d328c971e..4970dc129 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java @@ -1,19 +1,29 @@ package com.fuint.business.userManager.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.userManager.entity.LJUserGrade; import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.mapper.UserBalanceMapper; +import com.fuint.business.userManager.service.LJUserGradeService; import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import org.springframework.stereotype.Service; +import javax.annotation.Resource; + /** * 会员储值卡信息 业务层 */ @Service public class UserBalanceServiceImpl extends ServiceImpl implements UserBalanceService { + + + @Resource + LJUserGradeService ljUserGradeService; + @Override public int insertUserBalance(UserBalance balance) { int row = baseMapper.insert(balance); @@ -72,4 +82,27 @@ public class UserBalanceServiceImpl extends ServiceImpl */ public int updateDeptChildren(@Param("depts") List depts); + + /** + * 查询所有过期 + */ + SysDept selectStatusByTurnoverTime(Long deptId); + + /** + * 查询是否过期 直接将过期的部门设置为未启用 + */ + int updateStatusByTurnoverTime(); + + int updateStatusById(Long deptId); + + int updateStatusByList(@Param("sysDeptsList") List sysDeptsList); + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml index 4b92d91f4..7fac84122 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml @@ -71,7 +71,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_dept set ancestors = + + + + + update sys_dept set status = 'jy' where turnover_time > NOW() and turnoverType = 2 + + + update sys_dept set status = 'jy' where deptId = #{deptId} + + + + + update sys_dept set status = 'jy' where deptId = #{deptId} + + dept_id IN + + #{list.deptId} + + + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/user/controller/BackendAccountController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/user/controller/BackendAccountController.java index 932f7368d..19b55a2c9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/user/controller/BackendAccountController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/user/controller/BackendAccountController.java @@ -1,7 +1,9 @@ package com.fuint.system.user.controller; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.store.mapper.MtStoreMapper; import com.fuint.common.dto.AccountDto; @@ -24,6 +26,7 @@ import com.fuint.business.store.entity.MtStore; import com.fuint.repository.model.TAccount; import com.fuint.system.role.entity.TDuty; import com.fuint.utils.StringUtil; +import com.thoughtworks.xstream.mapper.LambdaMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -220,7 +223,9 @@ public class BackendAccountController extends BaseController { MtStore mtStore = new MtStore(); if ("3".equals(deptType)) { // 查出storeId - mtStore = mtStoreMapper.selectById(Integer.parseInt(deptId)); + LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(MtStore::getContractDeptId,deptId); + mtStore = mtStoreMapper.selectOne(lambdaQueryWrapper); } @@ -264,6 +269,7 @@ public class BackendAccountController extends BaseController { tAccount.setPassword(password); tAccount.setIsActive(1); tAccount.setLocked(0); + if (ObjectUtil.isEmpty(mtStore)) mtStore.setId(0); tAccount.setStoreId(mtStore.getId()); tAccount.setMerchantId(Integer.parseInt(merchantId)); tAccount.setStaffId(Integer.parseInt(staffId)); diff --git a/fuintBackend/fuint-application/src/main/resources/application.properties b/fuintBackend/fuint-application/src/main/resources/application.properties index 3ad9552f4..8879d863b 100644 --- a/fuintBackend/fuint-application/src/main/resources/application.properties +++ b/fuintBackend/fuint-application/src/main/resources/application.properties @@ -1,8 +1,8 @@ # \u57FA\u672C\u914D\u7F6E -server.port=8080 +server.port=8008 env.profile=dev #env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/ -env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/ +env.properties.path=D:/code/oilSystem/fuintBackend/configure/ # \u6570\u636E\u5E93\u914D\u7F6E diff --git a/fuintBackend/fuint-application/src/test/java/UserSeriviceTest.java b/fuintBackend/fuint-application/src/test/java/UserSeriviceTest.java index c891c1fc4..face0a75d 100644 --- a/fuintBackend/fuint-application/src/test/java/UserSeriviceTest.java +++ b/fuintBackend/fuint-application/src/test/java/UserSeriviceTest.java @@ -1,3 +1,4 @@ +import com.fuint.business.store.service.StoreService; import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -18,6 +19,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.io.UnsupportedEncodingException; import java.util.List; @@ -153,4 +155,23 @@ public class UserSeriviceTest { System.out.printf("Consumer Started.%n"); } + + + + + + + @Resource + StoreService storeService; + @Test + public void test2() { + // 将流水上限和时间上限的部门全部设置为不可用 + storeService.flowflowConfiguration(); + // 将过期油站设置为不可用 + storeService.petrolStationsAreExpired(); + } + + + + } diff --git a/fuintCashierWeb/.env.development b/fuintCashierWeb/.env.development index 36c6ea233824c551f3c4a5046d836cfd50b76a79..30cb55dba20c9b496e75cbbb6370a3705d2e5ac9 100644 GIT binary patch delta 34 fcmbQww18;?8>5tgo}sygm4$(Ug*q1lGT;ILaCrn+ delta 33 ecmZ3$G@oe$8>6J5o|%<}fq{j-Iu`>n-~s?>u>>6e diff --git a/gasStation-uni/package-lock.json b/gasStation-uni/package-lock.json index 6da8dc93b..3e8281a93 100644 --- a/gasStation-uni/package-lock.json +++ b/gasStation-uni/package-lock.json @@ -1,458 +1,6 @@ { - "name": "gasStation-uni", - "lockfileVersion": 2, "requires": true, - "packages": { - "": { - "dependencies": { - "@dcloudio/uni-ui": "^1.4.28", - "bignumber.js": "^9.1.2", - "crypto-js": "^4.2.0", - "uview-ui": "^2.0.36" - }, - "devDependencies": { - "sass": "^1.69.5", - "sass-loader": "^10.5.0" - } - }, - "node_modules/@dcloudio/uni-ui": { - "version": "1.4.28", - "resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.4.28.tgz", - "integrity": "sha512-e/lSbvR79KH9+d3D4ueNbvD6szigjO/5IyjBNmiTqaj0PTS324fBV3L6f3s1qpkYonM4rdOl000hVOcAg6Gh/A==" - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "engines": { - "node": "*" - } - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/crypto-js": { - "version": "4.2.0", - "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz", - "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" - }, - "node_modules/emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/immutable": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.4.tgz", - "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/klona": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", - "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/sass": { - "version": "1.69.5", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz", - "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==", - "dev": true, - "dependencies": { - "chokidar": ">=3.0.0 <4.0.0", - "immutable": "^4.0.0", - "source-map-js": ">=0.6.2 <2.0.0" - }, - "bin": { - "sass": "sass.js" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/sass-loader": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.5.0.tgz", - "integrity": "sha512-VsU71W7VR6SChMJZUqtrfLeMSA8ns7QTHbnA7cfevtjb3c392mX93lr0Dmr4uU1ch5uIbEmfmHjdrDYcXXkQ7w==", - "dev": true, - "dependencies": { - "klona": "^2.0.4", - "loader-utils": "^2.0.0", - "neo-async": "^2.6.2", - "schema-utils": "^3.0.0", - "semver": "^7.3.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "peerDependencies": { - "fibers": ">= 3.1.0", - "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", - "sass": "^1.3.0", - "webpack": "^4.36.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "fibers": { - "optional": true - }, - "node-sass": { - "optional": true - }, - "sass": { - "optional": true - } - } - }, - "node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/uview-ui": { - "version": "2.0.36", - "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz", - "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==", - "engines": { - "HBuilderX": "^3.1.0" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - }, + "lockfileVersion": 1, "dependencies": { "@dcloudio/uni-ui": { "version": "1.4.28", @@ -481,8 +29,7 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} + "dev": true }, "anymatch": { "version": "3.1.3", diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index d446c871d..85df1e83a 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -6,16 +6,15 @@ - + - + 出行服务 优惠加油 @@ -183,10 +182,10 @@ }, onLoad(query) { const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容 - if (q == undefined) { + if (query.q) { let str = q.split("?")[1]; let arr = str.split("&"); - let storeId = ""; + let storeId = "12"; let staffId = ""; arr.forEach(item => { if (item.includes("storeId")) { @@ -199,6 +198,13 @@ uni.setStorageSync("inviteStaffId", staffId) this.storeId = uni.getStorageSync("storeId") this.staffId = uni.getStorageSync("inviteStaffId") + } else { + + let storeId = "12"; + + uni.setStorageSync("storeId", storeId) + this.storeId = uni.getStorageSync("storeId") + } // this.isExistStoreId(); @@ -215,16 +221,16 @@ }, methods: { // 跳转banner图对应的页面 - goPage(url){ + goPage(url) { uni.navigateTo({ - url:url, + url: url, }) }, // 获取首页轮播图信息 - getIndexBanner(){ - if (uni.getStorageSync("storeId")){ + getIndexBanner() { + if (uni.getStorageSync("storeId")) { request({ - url: 'business/indexBanner/list/'+uni.getStorageSync("storeId"), + url: 'business/indexBanner/list/' + uni.getStorageSync("storeId"), method: 'get', }).then(res => { console.log(res) @@ -299,7 +305,7 @@ uni.getSetting({ success(res) { - console.log(res,111) + console.log(res, 111) if (!res.authSetting['scope.userLocation']) { uni.authorize({ scope: 'scope.userLocation', diff --git a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue index 93cf11ad1..456e62ed9 100644 --- a/gasStation-uni/pagesHome/PointsMall/PointsMall.vue +++ b/gasStation-uni/pagesHome/PointsMall/PointsMall.vue @@ -86,7 +86,6 @@ + ¥{{item.exchangeAmount}} - @@ -94,16 +93,18 @@ - 立即兑换 + 库存不足 + 积分不足 + 立即兑换 - - - - @@ -207,13 +208,27 @@ }, godetails(data) { - uni.$on('un', function() { - uni.$emit('goodsInfo', data) + if (data.remainingInventory == 0) { + uni.showToast({ + title: "该商品库存不足!", + icon: "none" + }) + } else if (data.remainingInventory > this.myPoints && ( + data.exchangeMethod == '积分' || + data.exchangeMethod == '积分+金额')) { + uni.showToast({ + title: "您的账户积分不足!", + icon: "none" + }) + } else { + uni.$on('un', function() { + uni.$emit('goodsInfo', data) + }) + uni.navigateTo({ + url: '/pagesHome/goodsDetails/goodsDetails', + }) + } - }) - uni.navigateTo({ - url: '/pagesHome/goodsDetails/goodsDetails', - }) }, goback() { uni.navigateBack() @@ -434,6 +449,7 @@ width: 100%; margin: 10px auto; color: #1678ff; + // color: #a2a2a2; font-weight: bold; } diff --git a/gasStation-uni/pagesHome/goodsDetails/goodsDetails.vue b/gasStation-uni/pagesHome/goodsDetails/goodsDetails.vue index 75569184a..9f7b6a0e1 100644 --- a/gasStation-uni/pagesHome/goodsDetails/goodsDetails.vue +++ b/gasStation-uni/pagesHome/goodsDetails/goodsDetails.vue @@ -28,17 +28,25 @@ 商品详情 - + + + + + + - - - 立即兑换 - - - + + + + + 立即兑换 + + + + @@ -56,9 +64,6 @@ } }, - components: { - - }, onLoad() { }, @@ -72,22 +77,17 @@ uni.$emit('un') }, - methods: { change() {}, click() {}, + // 配送信息 dataProcessing() { this.giftImages = [] if (this.goodsInfo.giftImages != null && this.goodsInfo.giftImages != undefined) { const myGiftImages = JSON.parse(this.goodsInfo.giftImages); myGiftImages.forEach(res => { - if (res.fileName == undefined || res.fileName == null) { - this.giftImages.push(res.url) - } else { - let url = this.baseUrl + res.fileName - this.giftImages.push(url); - } - + let url = this.baseUrl + res + this.giftImages.push(url); }) } if (this.goodsInfo.deliveryMethod != null && this.goodsInfo.deliveryMethod != undefined) { @@ -97,13 +97,12 @@ } else { this.deliveryMethod = '无配送信息' } - - }, + // 立即兑换 goorder() { // 先判断积分是否足够兑换 request({ - url: '/business/userManager/user/getByUniApp', + url: 'business/userManager/user/getByUniApp', method: 'get', params: { chainStoreId: uni.getStorageSync('chainStoreId') @@ -111,29 +110,41 @@ }).then((res) => { if (res.code == 200 && res.data) { this.myPoints = res.data.points - if (res.data.points) { + console.log("this.goodsInfo1", this.goodsInfo) + console.log("this.goodsInfo1", res.data) + if (res.data.points != undefined) { + if (!this.goodsInfo.exchangePoints) { uni.navigateTo({ url: '/pagesHome/order/order' }) - } else if (res.data.points >= this.goodsInfo.exchangePoints) { - uni.navigateTo({ - url: '/pagesHome/order/order' - }) - } else { + } else if (res.data.points < this.goodsInfo.exchangePoints && ( + this.goodsInfo.exchangeMethod == '积分' || + this.goodsInfo.exchangeMethod == '积分+金额')) { // 积分不足 uni.showToast({ icon: 'none', title: "积分不足" }) + } else { + uni.navigateTo({ + url: '/pagesHome/order/order' + }) } } + } else { + // 错误处理 + uni.showToast({ + icon: 'none', + title: "积分不足" + }) } }) }, + // 返回 goback() { uni.navigateBack() } diff --git a/gasStation-uni/pagesHome/order/order.vue b/gasStation-uni/pagesHome/order/order.vue index b036d73a7..8b309f22a 100644 --- a/gasStation-uni/pagesHome/order/order.vue +++ b/gasStation-uni/pagesHome/order/order.vue @@ -138,9 +138,8 @@ address: '' }, paymentType: '', - // chainStoreId: uni.getStorageSync('chainStoreId'), storeId: uni.getStorageSync('storeId'), - chainStoreId: 1, + chainStoreId: uni.getStorageSync('chainStoreId'), tapList: [{ text: '到店自提' }, @@ -197,7 +196,7 @@ - // // 创建订单并 付款 + // 创建订单并 付款 async choose() { let _this = this let integralOrdersList = [] @@ -227,7 +226,8 @@ storeId: _this.storeId, }, }).then(res => { - if (res.data.code === "error") { + // if (res.data.code === "error") { + if (res.data.code === "success") { console.log(res) let payProvider = "wxpay" _this.orderInfo = JSON.parse(res.data.data.reservedPayInfo); @@ -348,11 +348,6 @@ if (this.goodsInfo.exchangePoints) { allPoints = new BigNumber(this.goodsInfo.exchangePoints) } - - // 数量 - // if (this.value < 1) { - // this.value = 1 - // } let value = new BigNumber(this.value) allPoints = allPoints.times(value) @@ -365,21 +360,18 @@ allAmout = 0 } this.allAmout = Number(allAmout).toFixed(2); - } - - // 计算加钱购 if (this.goodsInfo.exchangeMethod === '积分+加钱购') { // 积分相减 - let data = this.shoppingCart[0]; // + // let data = this.shoppingCart[0]; // // 计算加钱购商品一共多少积分 - let markPurchases = new BigNumber(data.markPurchases); - let exchangePoints = allPoints.multipliedBy(new BigNumber(data.exchangePoints)); + // let markPurchases = new BigNumber(data.markPurchases); + // let exchangePoints = allPoints.multipliedBy(new BigNumber(data.exchangePoints)); // 拿到总的积分 - this.member.points = this.member.points ? this.member.points : 0 + this.myPoints = this.myPoints ? this.member.points : 0 let points = this.myPoints - allPoints; // 使用 toNumber() 获取 BigNumber 的数值 // 以及分等一多少 @@ -389,8 +381,8 @@ points = Math.abs(points); - allAmout = points * this.goodsInfo.moneyRatio; // 直接使用 JavaScript 中的乘法 - this.allAmout = allAmout.toFixed(2); + this.allAmout = points * this.goodsInfo.moneyRatio.toFixed(2); // 直接使用 JavaScript 中的乘法 + // this.allAmout = allAmout.toFixed(2); // this.allAmout = Number(allAmout).toFixed(2); } else { diff --git a/gasStation-uni/pagesLogin/login/login.vue b/gasStation-uni/pagesLogin/login/login.vue index 3ebd4ab39..3d0faf193 100644 --- a/gasStation-uni/pagesLogin/login/login.vue +++ b/gasStation-uni/pagesLogin/login/login.vue @@ -37,7 +37,7 @@ title: '', qindex: false, baseUrl: this.$baseUrl, - appltType:uni.getStorageSync("appltType"), + appltType: uni.getStorageSync("appltType"), } }, onLoad() { @@ -57,40 +57,40 @@ // return; // } console.log(e) - + let _this = this; my.getAuthCode({ - scopes: 'auth_base', - success: res => { - const authCode = res.authCode; - console.log(res) - request({ - url: "clientApi/sign/alipayLogin/getUserid", - method: 'post', - data: { - authCode:authCode, - storeId:0, - staffId:"", - phone:"18457621459", - }, - }).then((resp)=>{ - console.log(resp) - if (resp.code == 200) { - - uni.setStorageSync('App-Token', resp.data.token); - uni.setStorageSync('chainStoreId', resp.data.chainStoreId); - - uni.navigateTo({ - url: '/pages/index/index' - }) - } - console.log("swq", uni.getStorageSync( - 'App-Token')); - }) - }, - fail: err => { - console.log('my.getAuthCode 调用失败', err) - } + scopes: 'auth_base', + success: res => { + const authCode = res.authCode; + console.log(res) + request({ + url: "clientApi/sign/alipayLogin/getUserid", + method: 'post', + data: { + authCode: authCode, + storeId: 0, + staffId: "", + phone: "18457621459", + }, + }).then((resp) => { + console.log(resp) + if (resp.code == 200) { + + uni.setStorageSync('App-Token', resp.data.token); + uni.setStorageSync('chainStoreId', resp.data.chainStoreId); + + uni.navigateTo({ + url: '/pages/index/index' + }) + } + console.log("swq", uni.getStorageSync( + 'App-Token')); + }) + }, + fail: err => { + console.log('my.getAuthCode 调用失败', err) + } }); }, wxlogin() {}, @@ -126,7 +126,7 @@ encryptedIv: e.detail.iv, encryptedData: e.detail.encryptedData, userInfo: { - storeId: 0, + storeId: 12, staffId: "", phone: '18457621459' },