bug修改
This commit is contained in:
parent
eac375458b
commit
61d8947fd1
@ -72,7 +72,7 @@
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="box">
|
||||
<span class="font-chinese">支付总额
|
||||
<span class="font-chinese">支付总额
|
||||
<el-tooltip class="item" effect="dark" content="实际支付订单详细信息请在增值订单页面查看
|
||||
" placement="top-start">
|
||||
<i class="el-icon-info"></i>
|
||||
@ -119,7 +119,7 @@
|
||||
type="text"
|
||||
@click="handleDetail(scope.row)"
|
||||
>订单详情</el-button>
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -177,17 +177,23 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
async created() {
|
||||
await this.getList();
|
||||
this.$forceUpdate();
|
||||
|
||||
this.getStatistics();
|
||||
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
|
||||
async getList(){
|
||||
await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
|
||||
this.dataList = res.data.records
|
||||
this.total = res.data.total
|
||||
console.log("this.dataList ",this.dataList )
|
||||
|
||||
})
|
||||
|
||||
this.$forceUpdate()
|
||||
},
|
||||
getStatistics() {
|
||||
getStatisticsApi().then(res=>{
|
||||
|
@ -140,7 +140,7 @@
|
||||
>订单详情</el-button>
|
||||
|
||||
<template v-if="scope.row.orderStatus=='待支付' ||scope.row.orderStatus=='待处理' || scope.row.orderStatus=='待发货'">
|
||||
<el-button
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row,true)"
|
||||
@ -149,7 +149,7 @@
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row,false)"
|
||||
@ -174,7 +174,7 @@
|
||||
</el-dialog>
|
||||
<el-dialog title="处理兑换结果" :visible.sync="openOutcome" width="650px" append-to-body :close-on-click-modal="false">
|
||||
<Outcome v-if="outComeFlag" :dataForm = "dataForm" :flagOrderStart="flagOrderStart" @send-data="handleDataFromChild"></Outcome>
|
||||
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
@ -224,16 +224,18 @@ export default {
|
||||
activeName: '0',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
async created() {
|
||||
await this.getList();
|
||||
this.getStatistics();
|
||||
this.$forceUpdate();
|
||||
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
|
||||
async getList(){
|
||||
await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
|
||||
this.dataList = res.data.records
|
||||
this.total = res.data.total
|
||||
|
||||
console.log("这是一个好东西",this.dataList)
|
||||
})
|
||||
},
|
||||
|
||||
@ -270,8 +272,8 @@ export default {
|
||||
mobile:'',
|
||||
shippingType: '',
|
||||
orderStatus:'',
|
||||
pageNo:null,
|
||||
pageSize:null
|
||||
pageNo:1,
|
||||
pageSize:10
|
||||
},
|
||||
this.dateRange = []
|
||||
this.getList()
|
||||
@ -285,7 +287,8 @@ export default {
|
||||
},
|
||||
|
||||
handleClick(tab, event) {
|
||||
this.resetQuery2()
|
||||
// this.resetQuery2()
|
||||
this.resetQuery()
|
||||
this.queryParams.orderStatus = tab.name
|
||||
console.log(tab.name);
|
||||
this.getList();
|
||||
@ -294,10 +297,9 @@ export default {
|
||||
this.outComeFlag = false
|
||||
this.openOutcome = false
|
||||
this.dataForm = {}
|
||||
console.log('Received data in parent:', data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -516,6 +516,7 @@ import {
|
||||
},
|
||||
|
||||
handleChange(value) {
|
||||
console.log("this.oilNumber",this.oilNumber);
|
||||
console.log(value);
|
||||
},
|
||||
// 获取数据
|
||||
@ -524,7 +525,6 @@ import {
|
||||
try {
|
||||
const response = await getOilNumberList();
|
||||
this.oilNumberList2 = response.data.records;
|
||||
console.log("this.oilNumberList2",this.oilNumberList2)
|
||||
await this.getAllOilList();
|
||||
resolve();
|
||||
} catch (error) {
|
||||
@ -573,11 +573,10 @@ import {
|
||||
}
|
||||
},
|
||||
|
||||
// 编辑时使用
|
||||
|
||||
// 编辑时使用
|
||||
async oilTypeMethods(data) {
|
||||
if (data === 1) {
|
||||
console.log("123123",data)
|
||||
|
||||
// this.oilNumber = {}
|
||||
this.dialogFormVisible = true
|
||||
this.res()
|
||||
@ -595,6 +594,7 @@ import {
|
||||
this.getOilTypeList("pricingUnitCN"),
|
||||
this.getOilTypeList("pricingUnitEN"),
|
||||
]);
|
||||
|
||||
this.receivingUnitList = [];
|
||||
var cla1 = {
|
||||
label : "英文简称",
|
||||
@ -641,7 +641,6 @@ import {
|
||||
},
|
||||
// 选择油品类型之后触发
|
||||
oilTypeClick(data) {
|
||||
console.log("selectedValue",data)
|
||||
// 清除油品名称
|
||||
// this.oilNumber.oilName = ''
|
||||
// this.oilNumber.oilNameT = ''
|
||||
@ -661,14 +660,12 @@ import {
|
||||
|
||||
// 打开修改窗口
|
||||
openOilNumberEdit(item) {
|
||||
console.log("item", item);
|
||||
this.oilNumber = {};
|
||||
|
||||
let oil = item.allOil.split(' ');
|
||||
console.log("oil[1];",item)
|
||||
|
||||
item.oilNameT = oil[1];
|
||||
item.oilName = oil[1];
|
||||
console.log("oilNameT",item)
|
||||
// item.oilNameT = oil[1];
|
||||
// item.oilName = oil[1];
|
||||
|
||||
this.oilNumber = item;
|
||||
this.$set(this.oilNumber,'oilNameT',oil[1])
|
||||
@ -700,7 +697,6 @@ import {
|
||||
|
||||
// 修改
|
||||
async updateOilNumberin(){
|
||||
console.log
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
var this_ = this
|
||||
@ -724,6 +720,7 @@ import {
|
||||
|
||||
// 查询数组字典类型
|
||||
async getOilTypeList(data) {
|
||||
|
||||
var this_ = this
|
||||
await dictSelect(data).then( response => {
|
||||
var list = response.data
|
||||
@ -736,7 +733,6 @@ import {
|
||||
}else {
|
||||
this_.oilNameList = list;
|
||||
}
|
||||
console.log("this_.oilTypeList",this_.oilTypeList)
|
||||
});
|
||||
},
|
||||
|
||||
@ -789,8 +785,6 @@ import {
|
||||
|
||||
// 添加youjia1
|
||||
insertOilPresePrices(){
|
||||
// console.log(typeof oilPresetPrices.presetOilPrices);
|
||||
console.log("typeof oilPresetPrices.presetOilPrices",this.oilPresetPrices);
|
||||
this.$refs["priForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.dialogFormPricesAdd = false
|
||||
@ -817,7 +811,6 @@ import {
|
||||
// 新增油价预设
|
||||
oilTypeClickByPrice() {
|
||||
var count = this.oilPresetPrices.numberId;
|
||||
console.log("this.selectOilTypeByPrice",this.selectOilTypeByPrice)
|
||||
this.selectOilTypeByPrice.forEach((oil) => {
|
||||
if (oil.numberId == parseInt(count)) {
|
||||
this.oilPresetPrices.currentPetrolPrices = oil.oilPrice;
|
||||
|
@ -19,7 +19,7 @@
|
||||
<el-form-item label="油罐名称" prop="tankName">
|
||||
<el-input
|
||||
v-model="queryParams.tankName"
|
||||
placeholder="请输入姓名"
|
||||
placeholder="请输入油罐名称"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<!-- <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>-->
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@ -278,6 +278,25 @@ export default {
|
||||
this.drawer=true
|
||||
},
|
||||
|
||||
// 搜索框重置
|
||||
resetQuery() {
|
||||
this.res()
|
||||
|
||||
this.getList()
|
||||
},
|
||||
|
||||
res() {
|
||||
// 查询参数
|
||||
this.queryParams= {
|
||||
numberId:'',
|
||||
status:'',
|
||||
tankName: '',
|
||||
page:null,
|
||||
pageSize:null
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
handleClose(done) {
|
||||
done();
|
||||
// this.$confirm('确认关闭?')
|
||||
|
@ -175,5 +175,39 @@ public class IntegralOrdersController extends BaseController {
|
||||
return getSuccessResult(this.integralOrdersService.integralOrdersProcessingUni(integralOrdersList));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否领取到同一件商品领取了几件
|
||||
* @param giftId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("enquiryForCollection")
|
||||
public ResponseObject enquiryForCollection(Integer giftId, Integer userId) {
|
||||
return getSuccessResult(this.integralOrdersService.enquiryForCollection(giftId, userId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否已达到领取上限
|
||||
* @param giftId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("checkTheRedemptionLimit")
|
||||
public ResponseObject checkTheRedemptionLimit(Integer giftId) {
|
||||
return getSuccessResult(this.integralOrdersService.checkTheRedemptionLimit(giftId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否已达到领取上限22
|
||||
* @param giftId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("checkTheRedemptionLimit2")
|
||||
public ResponseObject checkTheRedemptionLimit2(Integer giftId) {
|
||||
return getSuccessResult(this.integralOrdersService.checkTheRedemptionLimit(giftId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,7 @@ public class IntegralOrders extends BaseEntity {
|
||||
* 店铺ID
|
||||
*/
|
||||
private Integer storeId;
|
||||
private Integer chainStoreId;
|
||||
/**
|
||||
* 快递公司
|
||||
*/
|
||||
|
@ -98,6 +98,10 @@ public interface IntegralOrdersMapper {
|
||||
|
||||
List<IntegralOrders> getListByOrderNo(@Param("orderNumber") String orderNumber,@Param("storeId") Integer storeId);
|
||||
|
||||
List<IntegralOrders> getListByOrderNo2(@Param("orderNumber") String orderNumber);
|
||||
|
||||
List<IntegralOrders> enquiryForCollection(@Param("giftId") Integer giftId,@Param("userId") Integer userId);
|
||||
|
||||
|
||||
int editPayStatus(@Param("orderNumber") String orderNumber,@Param("payStates") String payStates, @Param("storeId") Integer storeId );
|
||||
// int editPayStatus(@Param("orderNumber") String orderNumber,@Param("payStates") String payStates, @Param("storeId") Integer storeId );
|
||||
|
@ -21,6 +21,7 @@
|
||||
<result property="courierCompanies" column="courier_companies" jdbcType="VARCHAR"/>
|
||||
<result property="theTrackingNumber" column="the_tracking_number" jdbcType="VARCHAR"/>
|
||||
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
|
||||
<result property="chainStoreId" column="chain_store_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
@ -194,7 +195,7 @@
|
||||
<if test="integralOrders.params.endTime != null and integralOrders.params.endTime != ''">
|
||||
and date_format(io.create_time,'%y%m%d') <= date_format(#{integralOrders.params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="integralOrders.orderStatus != null and integralOrders.orderStatus != '' ">
|
||||
<if test="integralOrders.orderStatus != null and integralOrders.orderStatus != '' and integralOrders.orderStatus != 0 ">
|
||||
and (
|
||||
(#{integralOrders.orderStatus} = 1 and (io.order_status = '待处理' or io.order_status = '待发货' or io.order_status = '已发货')) or
|
||||
(#{integralOrders.orderStatus} = 2 and (io.order_status = '已完成' )) or
|
||||
@ -306,10 +307,10 @@
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by,staff_id,payment_type)
|
||||
insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by,staff_id,payment_type,chain_store_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId}, #{entity.orderNumber}, #{entity.giftId}, #{entity.shippingType}, #{entity.paidInfo}, #{entity.amount}, #{entity.integral}, #{entity.comeOn}, #{entity.exchangeQuantity}, #{entity.orderStatus}, #{entity.status}, #{entity.orderType}, #{entity.processingResult}, #{entity.notes}, #{entity.storeId}, NOW(), NOW(), #{entity.createBy}, #{entity.updateBy},#{entity.staffId},#{entity.paymentType})
|
||||
(#{entity.userId}, #{entity.orderNumber}, #{entity.giftId}, #{entity.shippingType}, #{entity.paidInfo}, #{entity.amount}, #{entity.integral}, #{entity.comeOn}, #{entity.exchangeQuantity}, #{entity.orderStatus}, #{entity.status}, #{entity.orderType}, #{entity.processingResult}, #{entity.notes}, #{entity.storeId}, NOW(), NOW(), #{entity.createBy}, #{entity.updateBy},#{entity.staffId},#{entity.paymentType},#{entity.chainStoreId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@ -418,6 +419,14 @@
|
||||
select * from integral_orders where order_number = #{orderNumber} and store_id = #{storeId}
|
||||
</select>
|
||||
|
||||
<select id="getListByOrderNo2" resultType="com.fuint.business.integral.entity.IntegralOrders">
|
||||
select * from integral_orders where order_number = #{orderNumber}
|
||||
</select>
|
||||
|
||||
<select id="enquiryForCollection" resultType="com.fuint.business.integral.entity.IntegralOrders">
|
||||
select * from integral_orders where gift_id = #{giftId} and user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<update id="editPayStatus">
|
||||
update integral_orders set status = #{payStates} where order_number = #{orderNumber}
|
||||
<if test="storeId != -1">
|
||||
|
@ -75,5 +75,20 @@ public interface IntegralOrdersService {
|
||||
|
||||
Map<String, Object> integralOrdersProcessingUni(IntegralOrdersRequest integralOrdersList);
|
||||
|
||||
/**
|
||||
* 查询是否领取到同一件商品领取了几件
|
||||
* @param giftId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
String enquiryForCollection(Integer giftId, Integer userId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否已达到领取上限
|
||||
* @param giftId
|
||||
* @return
|
||||
*/
|
||||
Boolean checkTheRedemptionLimit(Integer giftId);
|
||||
|
||||
}
|
||||
|
@ -5,13 +5,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.mapper.IntegralGiftMapper;
|
||||
import com.fuint.business.integral.service.IntegralGiftService;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (IntegralGift)表服务实现类
|
||||
@ -19,11 +23,13 @@ import javax.annotation.Resource;
|
||||
* @author makejava
|
||||
* @since 2023-11-02 14:18:52
|
||||
*/
|
||||
@Service("integralGiftService")
|
||||
@Service
|
||||
public class IntegralGiftServiceImpl implements IntegralGiftService {
|
||||
@Resource
|
||||
private IntegralGiftMapper integralGiftDao;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IntegralOrdersService integralOrdersService;
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -52,9 +58,15 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<IntegralGiftVO> queryByPageByStoreId(@Param("page") Page page, @Param("integralGiftCategory") IntegralGift integralGift) {
|
||||
return integralGiftDao.queryAllByLimit(page, integralGift);
|
||||
IPage<IntegralGiftVO> integralGiftVOIPage = integralGiftDao.queryAllByLimit(page, integralGift);
|
||||
List<IntegralGiftVO> records = integralGiftVOIPage.getRecords();
|
||||
for (IntegralGiftVO record : records) {
|
||||
record.setIfRedemptionIsOnline(integralOrdersService.checkTheRedemptionLimit(record.getId()));
|
||||
}
|
||||
return integralGiftVOIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.integral.service.impl;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.api.fuyou.entity.MerchantConfig;
|
||||
@ -12,12 +13,14 @@ import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralOrders;
|
||||
import com.fuint.business.integral.mapper.IntegralOrdersMapper;
|
||||
import com.fuint.business.integral.service.IntegralDetailService;
|
||||
import com.fuint.business.integral.service.IntegralGiftService;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import com.fuint.business.integral.vo.IntegralOrdersRequest;
|
||||
import com.fuint.business.integral.vo.IntegralOrdersVO;
|
||||
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.LJUserMapper;
|
||||
@ -25,6 +28,7 @@ import com.fuint.business.userManager.service.UserBalanceService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -43,7 +47,7 @@ import java.util.*;
|
||||
* @author makejava
|
||||
* @since 2023-11-07 13:59:23
|
||||
*/
|
||||
@Service("integralOrdersService")
|
||||
@Service
|
||||
public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
@Resource
|
||||
private IntegralOrdersMapper integralOrdersDao;
|
||||
@ -57,6 +61,9 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
private UserBalanceService userBalanceService;
|
||||
@Resource
|
||||
IntegralDetailService integralDetailService;
|
||||
@Resource
|
||||
IntegralGiftService integralGiftService;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -72,7 +79,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralOrders 筛选条件
|
||||
* @param page 分页对象
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
@ -89,6 +96,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
integralOrders.setUserId(nowAccountInfo.getId());
|
||||
return integralOrdersDao.queryByPageUni(page, integralOrders);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
@ -102,7 +110,6 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改数据 receiving_information
|
||||
*
|
||||
@ -142,6 +149,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
|
||||
/**
|
||||
* 插入订单状态 并进行支付
|
||||
*
|
||||
* @param integralOrdersList
|
||||
* @return
|
||||
*/
|
||||
@ -158,28 +166,28 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
|
||||
}
|
||||
// 首先判断是否足够积分
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(integralOrdersList.getIntegralOrdersList().get(0).getUserId(),nowAccountInfo.getChainStoreId());
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(integralOrdersList.getIntegralOrdersList().get(0).getUserId(), nowAccountInfo.getChainStoreId());
|
||||
if (ljUserVos.getPoints() < integralOrdersList.getAllPoints()) {
|
||||
integralOrdersList.getIntegralOrdersList().get(0).setStatus("un");
|
||||
return integralOrdersList.getIntegralOrdersList().get(0);
|
||||
}
|
||||
// 插入订单
|
||||
List<IntegralOrders> integralOrdersList1 = integralOrdersList.getIntegralOrdersList();
|
||||
if (integralOrdersList1.size()<0) return null;
|
||||
if (integralOrdersList1.size() < 0) return null;
|
||||
|
||||
|
||||
String status = "unpaid";
|
||||
// 添加储存充值
|
||||
if ("CASH".equals(integralOrdersList.getPaymentType()) || integralOrdersList.getAllAmout() <= epsilon) {
|
||||
status = "paid";
|
||||
}else {
|
||||
} else {
|
||||
status = "unpaid";
|
||||
}
|
||||
// 根据日期生成支付编号
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
String orderNo = "2345"+timestamp+randomString;
|
||||
String randomString = UUID.randomUUID().toString().replace("-", "").substring(0, 6);
|
||||
String orderNo = "2345" + timestamp + randomString;
|
||||
|
||||
// 生成订单编号
|
||||
for (IntegralOrders integralOrders : integralOrdersList1) {
|
||||
@ -190,6 +198,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
|
||||
integralOrders.setOrderNumber(orderNo);
|
||||
integralOrders.setStatus(status);
|
||||
integralOrders.setOrderType("1"); // 设置交易类型
|
||||
}
|
||||
integralOrdersDao.insertBatch(integralOrdersList.getIntegralOrdersList());
|
||||
|
||||
@ -197,31 +206,31 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
|
||||
if (!ObjectUtil.isEmpty(integralOrdersList.getAllAmout())
|
||||
&& integralOrdersList.getAllAmout() > epsilon
|
||||
&& "unpaid".equals(status)){
|
||||
&& "unpaid".equals(status)) {
|
||||
flag = true;
|
||||
}
|
||||
if (flag) {
|
||||
// Integer allAmount = (int) (integralOrdersList.getAllAmout()*100);
|
||||
System.out.println("金额"+(int) (integralOrdersList.getAllAmout()*100));
|
||||
Integer allAmount = (int) (0.01*100);
|
||||
System.out.println("金额" + (int) (integralOrdersList.getAllAmout() * 100));
|
||||
Integer allAmount = (int) (0.01 * 100);
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
|
||||
// 处理支付需要的数据
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("authCode",integralOrdersList.getAuthCode());
|
||||
map.put("allAmount",allAmount.toString());
|
||||
map.put("orderNo",orderNo);
|
||||
map.put("payType",integralOrdersList.getPaymentType());
|
||||
map.put("insCd",merchantConfig.getInsCd());
|
||||
map.put("mchntCd",merchantConfig.getMchntCd());
|
||||
map.put("goodsDes",merchantConfig.getMerchantName());
|
||||
map.put("publicKey",merchantConfig.getPublicKey());
|
||||
map.put("privateKey",merchantConfig.getPrivateKey());
|
||||
map.put("type","IOS");
|
||||
map.put("storeId",nowAccountInfo.getStoreId().toString());
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("authCode", integralOrdersList.getAuthCode());
|
||||
map.put("allAmount", allAmount.toString());
|
||||
map.put("orderNo", orderNo);
|
||||
map.put("payType", integralOrdersList.getPaymentType());
|
||||
map.put("insCd", merchantConfig.getInsCd());
|
||||
map.put("mchntCd", merchantConfig.getMchntCd());
|
||||
map.put("goodsDes", merchantConfig.getMerchantName());
|
||||
map.put("publicKey", merchantConfig.getPublicKey());
|
||||
map.put("privateKey", merchantConfig.getPrivateKey());
|
||||
map.put("type", "IOS");
|
||||
map.put("storeId", nowAccountInfo.getStoreId().toString());
|
||||
// 调用支付接口
|
||||
try {
|
||||
fyPayService.pay(map);
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -230,46 +239,68 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
|
||||
/**
|
||||
* 查询订单状态并添加记录
|
||||
*
|
||||
* @param orderNo
|
||||
* @return
|
||||
*/
|
||||
|
||||
|
||||
// @Resource
|
||||
// IntegralGiftService integralGiftService;
|
||||
@Resource
|
||||
CardExchangeRecordService cardExchangeRecordService;
|
||||
// todo 判断积分商城兑换类型 根据类型在进行处理
|
||||
|
||||
@Override
|
||||
public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) {
|
||||
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// 查询订单信息
|
||||
List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo(orderNo, nowAccountInfo.getStoreId());
|
||||
if ("paid".equals(listByOrderNo.get(0).getStatus())){
|
||||
// List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo, nowAccountInfo.getStoreId());
|
||||
List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo);
|
||||
if ("paid".equals(listByOrderNo.get(0).getStatus())) {
|
||||
BigDecimal totalPoints = new BigDecimal(0);
|
||||
|
||||
for (IntegralOrders integralOrders : listByOrderNo) {
|
||||
totalPoints = totalPoints.add(new BigDecimal(integralOrders.getIntegral()));
|
||||
// 加兑换卷和优惠券判断
|
||||
IntegralGift integralGift = integralGiftService.queryById(integralOrders.getGiftId());
|
||||
if (integralGift.getGiftType().equals("兑换券")) {
|
||||
// 兑换卷处理
|
||||
integralGift.getVoucherId();
|
||||
// cardExchangeRecordService
|
||||
// 兑换券:CardExchangeRecordService的addCardExchangeRecord方法 传参:
|
||||
}
|
||||
|
||||
if (integralGift.getGiftType().equals("优惠券")) {
|
||||
// 优惠卷处理
|
||||
integralGift.getCouponId();
|
||||
}
|
||||
|
||||
}
|
||||
// 查询用户信息
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById(listByOrderNo.get(0).getUserId());
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(listByOrderNo.get(0).getUserId(), listByOrderNo.get(0).getChainStoreId());
|
||||
|
||||
// 用户积分余额变动
|
||||
if (totalPoints.doubleValue()>0) {
|
||||
UserBalance userBalance = balanceCalculation(ljUserVos,totalPoints.doubleValue());
|
||||
if (totalPoints.doubleValue() > 0) {
|
||||
UserBalance userBalance = balanceCalculation(ljUserVos, totalPoints.doubleValue());
|
||||
userBalance.setChainStoreId(listByOrderNo.get(0).getChainStoreId());
|
||||
userBalanceService.updateUserBalance(userBalance);
|
||||
}
|
||||
// 积分表变动
|
||||
if (totalPoints.doubleValue()>0) {
|
||||
IntegralDetail integralDetail = changesInPoints(totalPoints.doubleValue(),ljUserVos);
|
||||
integralDetailService.insert(integralDetail);
|
||||
if (totalPoints.doubleValue() > 0) {
|
||||
IntegralDetail integralDetail = changesInPoints(totalPoints.doubleValue(), ljUserVos);
|
||||
integralDetail.setStoreId(listByOrderNo.get(0).getStoreId());
|
||||
integralDetail.setChainStoreId(listByOrderNo.get(0).getChainStoreId());
|
||||
integralDetailService.insert2(integralDetail);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return listByOrderNo.get(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//用户余额表计算
|
||||
private UserBalance balanceCalculation(LJUserVo ljUserVos,Double totalPoints) {
|
||||
private UserBalance balanceCalculation(LJUserVo ljUserVos, Double totalPoints) {
|
||||
if (ObjectUtil.isEmpty(ljUserVos.getPoints())) ljUserVos.setPoints(0);
|
||||
// 减去积分
|
||||
BigDecimal bigPoints = new BigDecimal(ljUserVos.getPoints());
|
||||
@ -281,8 +312,9 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
|
||||
return userBalance;
|
||||
}
|
||||
|
||||
// 积分变动
|
||||
private IntegralDetail changesInPoints(Double totalPoints,LJUserVo ljUserVos) {
|
||||
private IntegralDetail changesInPoints(Double totalPoints, LJUserVo ljUserVos) {
|
||||
IntegralDetail integralDetail = new IntegralDetail();
|
||||
integralDetail.setUserId(ljUserVos.getId());
|
||||
integralDetail.setPointsChange(-totalPoints);
|
||||
@ -298,53 +330,59 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
@Override
|
||||
public int editPayStatus(String orderNumber, String payStates, Integer storeId) {
|
||||
|
||||
return integralOrdersDao.editPayStatus(orderNumber,payStates,storeId);
|
||||
return integralOrdersDao.editPayStatus(orderNumber, payStates, storeId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> integralOrdersProcessingUni(IntegralOrdersRequest integralOrdersList) {
|
||||
double epsilon = 1e-10; // 阈值
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
Map<String, Object> applet = null;
|
||||
Map<String, Object> applet = new HashMap<>();
|
||||
|
||||
// 首先判断是否足够积分
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(nowAccountInfo.getId(),integralOrdersList.getChainStoreId());
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(nowAccountInfo.getId(), integralOrdersList.getChainStoreId());
|
||||
if (ljUserVos.getPoints() < integralOrdersList.getAllPoints()) {
|
||||
integralOrdersList.getIntegralOrdersList().get(0).setStatus("un");
|
||||
applet.put("code","error");
|
||||
applet.put("code", "error");
|
||||
applet.put("msg", "积分不足");
|
||||
return applet;
|
||||
}
|
||||
|
||||
// 判断是否达到最高的商品领取上线
|
||||
//1根据商品id查询
|
||||
// enquiryForCollection();
|
||||
//2.
|
||||
|
||||
// 插入订单
|
||||
List<IntegralOrders> integralOrdersList1 = integralOrdersList.getIntegralOrdersList();
|
||||
if (integralOrdersList1.size()<0) return null;
|
||||
if (integralOrdersList1.size() < 0) return null;
|
||||
|
||||
String status = "unpaid";
|
||||
// 添加储存充值
|
||||
if ("CASH".equals(integralOrdersList.getPaymentType()) || integralOrdersList.getAllAmout() <= epsilon) {
|
||||
status = "paid";
|
||||
}else {
|
||||
status = "unpaid";
|
||||
}
|
||||
|
||||
// 根据日期生成支付编号
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
String orderNo = timestamp+randomString;
|
||||
String randomString = UUID.randomUUID().toString().replace("-", "").substring(0, 6);
|
||||
int hash = HashUtil.additiveHash(integralOrdersList.getStoreId().toString(), 3);
|
||||
String orderNo = timestamp + randomString + '-' + hash;
|
||||
|
||||
// 生成订单编号
|
||||
for (IntegralOrders integralOrders : integralOrdersList1) {
|
||||
integralOrders.setStoreId(nowAccountInfo.getStoreId());
|
||||
// integralOrders.setStoreId(nowAccountInfo.getStoreId());
|
||||
if (ObjectUtil.isNotEmpty(nowAccountInfo.getStaffId())) {
|
||||
integralOrders.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
}
|
||||
|
||||
integralOrders.setOrderNumber(orderNo);
|
||||
integralOrders.setStatus(status);
|
||||
integralOrders.setUserId(nowAccountInfo.getId());
|
||||
integralOrders.setOrderStatus("待处理");
|
||||
integralOrders.setOrderType("0");
|
||||
}
|
||||
integralOrdersDao.insertBatch(integralOrdersList.getIntegralOrdersList());
|
||||
|
||||
@ -352,38 +390,89 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
|
||||
if (!ObjectUtil.isEmpty(integralOrdersList.getAllAmout())
|
||||
&& integralOrdersList.getAllAmout() > epsilon
|
||||
&& "unpaid".equals(status)){
|
||||
&& "unpaid".equals(status)) {
|
||||
flag = true;
|
||||
}
|
||||
// Map<String, Object> applet = null;
|
||||
|
||||
// 支付
|
||||
if (flag) {
|
||||
// 调用支付接口
|
||||
// 判断是否开启支付规则
|
||||
// 调用支付接口
|
||||
// 判断是否开启支付规则
|
||||
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen();
|
||||
// if (list.size() > 0) {
|
||||
// oilConfigService.oilRule();
|
||||
// }
|
||||
// 处理支付需要的数据
|
||||
// if (list.size() > 0) {
|
||||
// oilConfigService.oilRule();
|
||||
// }
|
||||
// 处理支付需要的数据
|
||||
ReceiveParameter receiveParameter = new ReceiveParameter();
|
||||
receiveParameter.setOrderNo(orderNo);
|
||||
receiveParameter.setType("积分订单");
|
||||
receiveParameter.setType("4");
|
||||
receiveParameter.setContent("积分订单");
|
||||
receiveParameter.setGoodsMoney(integralOrdersList.getAllAmout());
|
||||
receiveParameter.setStoreId(integralOrdersList.getStoreId());
|
||||
receiveParameter.setPayType(integralOrdersList.getPaymentType());
|
||||
receiveParameter.setUserId(nowAccountInfo.getId());
|
||||
// 调用支付接口
|
||||
// 调用支付接口
|
||||
try {
|
||||
applet = fyPayService.applet(receiveParameter);
|
||||
applet.put("orderNo",orderNo);
|
||||
applet.put("orderNo", orderNo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
// 订单直接处理
|
||||
checkTheStatusOfYourPaymentByIntegral(orderNo);
|
||||
applet.put("orderNo", orderNo);
|
||||
applet.put("code", "paid");
|
||||
applet.put("msg", "直接支付");
|
||||
}
|
||||
|
||||
return applet;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否领取到同一件商品领取了几件
|
||||
*
|
||||
* @param giftId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String enquiryForCollection(Integer giftId, Integer userId) {
|
||||
if (ObjectUtil.isEmpty(userId)) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
|
||||
userId = nowAccountInfo.getId();
|
||||
}
|
||||
List<IntegralOrders> integralOrders = integralOrdersDao.enquiryForCollection(giftId, userId);
|
||||
BigDecimal bigDecimal = new BigDecimal("0");
|
||||
for (IntegralOrders integralOrder : integralOrders) {
|
||||
// bigDecimal = bigDecimal.add(new BigDecimal("1"));
|
||||
if (ObjectUtil.isNotEmpty(integralOrder.getExchangeQuantity())) {
|
||||
bigDecimal = bigDecimal.add(new BigDecimal(integralOrder.getExchangeQuantity()));
|
||||
}
|
||||
}
|
||||
return bigDecimal.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean checkTheRedemptionLimit(Integer giftId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
IntegralGift integralGift = integralGiftService.queryById(giftId);
|
||||
|
||||
String num = enquiryForCollection(giftId, nowAccountInfo.getId());
|
||||
boolean flag = false;
|
||||
if (ObjectUtil.isNotEmpty(integralGift)) {
|
||||
Integer limit = integralGift.getExchangeTimes();
|
||||
Integer numInt = Integer.parseInt(num);
|
||||
// 达到库存上限反会true
|
||||
flag = numInt.compareTo(limit) > 0;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ public class IntegralGiftVO extends IntegralGift {
|
||||
// 分类名称
|
||||
private String categoryName;
|
||||
private String goodsName;
|
||||
private Boolean ifRedemptionIsOnline;
|
||||
// 商品
|
||||
// 优惠卷
|
||||
}
|
||||
|
@ -358,28 +358,28 @@
|
||||
<select id="fuelStream" resultType="java.util.Map">
|
||||
SELECT
|
||||
-- 当天的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_fuel_record WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_fuel_record WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_sum,
|
||||
|
||||
-- 当周的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_fuel_record WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_fuel_record WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_sum,
|
||||
|
||||
-- 当月的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_fuel_record WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_fuel_record WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_sum,
|
||||
|
||||
-- 昨天的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_fuel_record WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_fuel_record WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_sum,
|
||||
|
||||
-- 上周的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_fuel_record WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_fuel_record WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_sum,
|
||||
|
||||
-- 上个月的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_sum;
|
||||
CAST((SELECT COUNT(*) FROM card_fuel_record WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_fuel_record WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_sum;
|
||||
</select>
|
||||
|
||||
<select id="queryByPageApplet"
|
||||
|
@ -126,28 +126,28 @@
|
||||
<select id="cardStream" resultType="java.util.Map">
|
||||
SELECT
|
||||
-- 当天的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = CURDATE() and store_id = #{storeId}) AS CHAR) AS today_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_value_record WHERE DATE(create_time) = CURDATE() and store_id = #{storeId}) AS CHAR) AS today_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_value_record WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_sum,
|
||||
|
||||
-- 当周的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_value_record WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_value_record WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_sum,
|
||||
|
||||
-- 当月的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_value_record WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_value_record WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_sum,
|
||||
|
||||
-- 昨天的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_value_record WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_value_record WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_sum,
|
||||
|
||||
-- 上周的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_sum,
|
||||
CAST((SELECT COUNT(*) FROM card_value_record WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_value_record WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_sum,
|
||||
|
||||
-- 上个月的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_sum;
|
||||
CAST((SELECT COUNT(*) FROM card_value_record WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_count,
|
||||
CAST((SELECT SUM(recharge_balance) FROM card_value_record WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_sum;
|
||||
</select>
|
||||
|
||||
<select id="prepaidCardSales" resultType="java.util.Map">
|
||||
|
@ -98,28 +98,28 @@
|
||||
<select id="goodsStream" resultType="java.util.Map">
|
||||
SELECT
|
||||
-- 当天的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_sum,
|
||||
CAST((SELECT COUNT(*) FROM mt_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM mt_order WHERE DATE(create_time) = CURDATE()and store_id = #{storeId}) AS CHAR) AS today_sum,
|
||||
|
||||
-- 当周的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_sum,
|
||||
CAST((SELECT COUNT(*) FROM mt_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM mt_order WHERE WEEK(create_time) = WEEK(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_week_sum,
|
||||
|
||||
-- 当月的数据和条数
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_sum,
|
||||
CAST((SELECT COUNT(*) FROM mt_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM mt_order WHERE MONTH(create_time) = MONTH(CURDATE())and store_id = #{storeId}) AS CHAR) AS this_month_sum,
|
||||
|
||||
-- 昨天的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_sum,
|
||||
CAST((SELECT COUNT(*) FROM mt_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM mt_order WHERE DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)and store_id = #{storeId}) AS CHAR) AS yesterday_sum,
|
||||
|
||||
-- 上周的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_sum,
|
||||
CAST((SELECT COUNT(*) FROM mt_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM mt_order WHERE WEEK(create_time) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK))and store_id = #{storeId}) AS CHAR) AS last_week_sum,
|
||||
|
||||
-- 上个月的数据
|
||||
CAST((SELECT COUNT(*) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM oil_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_sum;
|
||||
CAST((SELECT COUNT(*) FROM mt_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_count,
|
||||
CAST((SELECT SUM(pay_amount) FROM mt_order WHERE MONTH(create_time) = MONTH(DATE_SUB(CURDATE(), INTERVAL 1 MONTH))and store_id = #{storeId}) AS CHAR) AS last_month_sum;
|
||||
</select>
|
||||
<select id="merchandiseSales" resultType="java.util.Map">
|
||||
|
||||
|
@ -98,6 +98,7 @@
|
||||
id, tank_name, oil_number, tank_volume, lower_warning, oil_density, stored_quantity, total_price, discounted_price, status, remarks, store_id, number_id, create_time, update_time, create_by, update_by, inventory_statistics, unit
|
||||
from oil_tank
|
||||
<where>
|
||||
status = '启用'
|
||||
<if test="oilTank.id != null">
|
||||
and id = #{oilTank.id}
|
||||
</if>
|
||||
@ -125,9 +126,6 @@
|
||||
<if test="oilTank.discountedPrice != null">
|
||||
and discounted_price = #{oilTank.discountedPrice}
|
||||
</if>
|
||||
<if test="oilTank.status != null and oilTank.status != ''">
|
||||
and status = #{oilTank.status}
|
||||
</if>
|
||||
<if test="oilTank.remarks != null and oilTank.remarks != ''">
|
||||
and remarks = #{oilTank.remarks}
|
||||
</if>
|
||||
|
@ -17,7 +17,7 @@ import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (OilTracking)表服务实现类
|
||||
*
|
||||
* 库存统计
|
||||
* @author makejava
|
||||
* @since 2023-10-25 11:55:13
|
||||
*/
|
||||
@ -52,7 +52,7 @@ public class OilTrackingServiceImpl implements OilTrackingService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* 新增数据 (新增记录)
|
||||
*
|
||||
* @param oilTracking 实例对象
|
||||
* @return 实例对象
|
||||
|
@ -3,7 +3,7 @@ module.exports = {
|
||||
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
||||
// baseUrl: 'http://192.168.0.196:8081/',
|
||||
// baseUrl: 'http://192.168.1.4:8080/',
|
||||
baseUrl: 'http://localhost:8008/',
|
||||
baseUrl: 'http://192.168.0.178:8008/',
|
||||
|
||||
// baseUrl: 'http://192.168.1.5:8002/cdJdc',
|
||||
|
||||
|
@ -99,6 +99,7 @@
|
||||
item.exchangeMethod == '积分' ||
|
||||
item.exchangeMethod == '积分+金额' ) &&
|
||||
item.remainingInventory>myPoints" style="color: darkgray;">积分不足</text>
|
||||
<text v-else-if="item.ifRedemptionIsOnline" style="color: darkgray;">达到兑换上限</text>
|
||||
<text v-else>立即兑换</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -125,6 +126,7 @@
|
||||
storeId: uni.getStorageSync('storeId'),
|
||||
query: {
|
||||
storeId: uni.getStorageSync('storeId'),
|
||||
status: '启用',
|
||||
categoryId: '',
|
||||
giftName: '',
|
||||
deliveryMethod: '',
|
||||
@ -171,8 +173,8 @@
|
||||
})
|
||||
},
|
||||
// 获取积分商城列表
|
||||
getIntegralGiftList() {
|
||||
request({
|
||||
async getIntegralGiftList() {
|
||||
await request({
|
||||
url: 'business/integral/integralGift/queryByPageByStoreId',
|
||||
method: 'get',
|
||||
params: this.query
|
||||
@ -207,7 +209,10 @@
|
||||
|
||||
},
|
||||
|
||||
godetails(data) {
|
||||
async godetails(data) {
|
||||
|
||||
let flag = await this.checkTheRedemptionLimit(data.giftId)
|
||||
|
||||
if (data.remainingInventory == 0) {
|
||||
uni.showToast({
|
||||
title: "该商品库存不足!",
|
||||
@ -220,6 +225,11 @@
|
||||
title: "您的账户积分不足!",
|
||||
icon: "none"
|
||||
})
|
||||
} else if (data.ifRedemptionIsOnline) {
|
||||
uni.showToast({
|
||||
title: "已达到兑换上限!",
|
||||
icon: "none"
|
||||
})
|
||||
} else {
|
||||
uni.$on('un', function() {
|
||||
uni.$emit('goodsInfo', data)
|
||||
@ -249,6 +259,7 @@
|
||||
},
|
||||
// 根据storeId查询店铺信息
|
||||
getInfoByStoreId() {
|
||||
|
||||
request({
|
||||
url: '/business/storeInformation/store/storeInfoUni',
|
||||
method: 'get',
|
||||
@ -260,6 +271,25 @@
|
||||
this.storeName = res.data.name
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 查询该商品是否达到个人的兑换上限
|
||||
checkTheRedemptionLimit(giftId) {
|
||||
console.log("giftId", giftId)
|
||||
request({
|
||||
url: 'business/integral/integralOrders/checkTheRedemptionLimit',
|
||||
method: 'get',
|
||||
params: {
|
||||
giftId: giftId
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
return res.data
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
|
@ -21,7 +21,8 @@
|
||||
|
||||
</view>
|
||||
<view class="dt-box">
|
||||
<view class=""><u-tag :text='deliveryMethod' type="error" shape="circle"></u-tag></view>
|
||||
<view class="" v-if="deliveryMethod"><u-tag :text='deliveryMethod' type="error"
|
||||
shape="circle"></u-tag></view>
|
||||
<view class="hui-time">市场价:{{goodsInfo.market}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -42,16 +42,16 @@
|
||||
<text>确认收货</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-bottom" v-if="actinput == 2 ">
|
||||
<!-- <view class="goods-bottom" v-if="actinput == 2 ">
|
||||
<view class="sh-anniu" @click="refund()">
|
||||
<text>点击退款</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-bottom" v-if="actinput == 3 ">
|
||||
</view> -->
|
||||
<!-- <view class="goods-bottom" v-if="actinput == 3 ">
|
||||
<view class="sh-anniu" @click="payment()">
|
||||
<text>去付款</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<u-empty v-if="arrList.length == 0" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
|
||||
@ -86,12 +86,12 @@
|
||||
{
|
||||
title: '已完成'
|
||||
},
|
||||
{
|
||||
title: '已退款'
|
||||
},
|
||||
{
|
||||
title: '待支付'
|
||||
},
|
||||
// {
|
||||
// title: '已退款'
|
||||
// },
|
||||
// {
|
||||
// title: '待支付'
|
||||
// },
|
||||
|
||||
|
||||
],
|
||||
|
@ -85,6 +85,14 @@
|
||||
style="font-weight: bold;font-size: 20px;">¥{{allAmout}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="shippingType == '物流配送' && goodsInfo.expressShippingFee == '统一运费' && goodsInfo.shippingFeeAmount && goodsInfo.shippingFeeAmount>0"
|
||||
class="endbox">
|
||||
<view style="color: #666666;font-size: 14px;">统一运费: </view>
|
||||
<view style="color: red;"> <text
|
||||
style="font-weight: bold;font-size: 18px;">¥{{goodsInfo.shippingFeeAmount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="beizhu">
|
||||
@ -136,6 +144,7 @@
|
||||
addrInfo: {
|
||||
address: ''
|
||||
},
|
||||
shippingType: '',
|
||||
paymentType: '',
|
||||
storeId: uni.getStorageSync('storeId'),
|
||||
chainStoreId: uni.getStorageSync('chainStoreId'),
|
||||
@ -176,25 +185,20 @@
|
||||
if (this.addrInfo.address == '' || this.addrInfo == null) {
|
||||
this.getAddr()
|
||||
}
|
||||
|
||||
this.transferIndex(0)
|
||||
// 根据storeId查询店铺信息
|
||||
this.getInfoByStoreId()
|
||||
// 查询剩余积分
|
||||
this.getUserInfoList()
|
||||
|
||||
|
||||
this.transferIndex(0)
|
||||
|
||||
// 根据storeId查询店铺信息
|
||||
this.getInfoByStoreId()
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
methods: {
|
||||
|
||||
|
||||
|
||||
|
||||
// 创建订单并 付款
|
||||
async choose() {
|
||||
let _this = this
|
||||
@ -203,12 +207,14 @@
|
||||
let integralOrders = {
|
||||
giftId: this.goodsInfo.id,
|
||||
amount: _this.allAmout,
|
||||
integral: _this.myPoints,
|
||||
|
||||
integral: _this.allPoints,
|
||||
storeId: _this.storeId,
|
||||
chainStoreId: _this.chainStoreId,
|
||||
exchangeQuantity: _this.value,
|
||||
orderType: 1,
|
||||
paymentType: _this.paymentType,
|
||||
shippingType: _this.shippingType,
|
||||
|
||||
paymentType: _this.paymentType
|
||||
}
|
||||
integralOrdersList.push(integralOrders)
|
||||
request({
|
||||
@ -220,13 +226,17 @@
|
||||
// paymentType: _this.paymentType,
|
||||
paymentType: "WECHAT",
|
||||
allAmout: _this.allAmout,
|
||||
allPoints: _this.myPoints,
|
||||
allPoints: _this.allPoints,
|
||||
chainStoreId: _this.chainStoreId,
|
||||
storeId: _this.storeId,
|
||||
},
|
||||
}).then(res => {
|
||||
// if (res.data.code === "error") {
|
||||
if (res.data.code === "success") {
|
||||
if (_this.allAmout == 0) {
|
||||
uni.reLaunch({
|
||||
url: '/pagesRefuel/orderSuccess/index'
|
||||
})
|
||||
} else if (res.data.code === "success") {
|
||||
console.log(res)
|
||||
let payProvider = "wxpay"
|
||||
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
||||
@ -280,16 +290,40 @@
|
||||
}
|
||||
|
||||
},
|
||||
valChange(e) {
|
||||
|
||||
|
||||
// remaining_inventory
|
||||
console.log('当前值为: ' + e.value)
|
||||
console.log('当前值为123: ' + this.goodsInfo.remainingInventory)
|
||||
|
||||
async valChange(e) {
|
||||
// 判断是否达到领取上限
|
||||
// let flag = await this.checkTheRedemptionLimit(this.goodsInfo.id)
|
||||
let flag = await this.enquiryForCollection(this.goodsInfo.id)
|
||||
let num = e.value + Number(flag)
|
||||
console.log("123123", num);
|
||||
//判断库存
|
||||
if (e.value >= this.goodsInfo.remainingInventory && this.goodsInfo.remainingInventory != -
|
||||
if (num > this.goodsInfo.exchangeTimes) {
|
||||
uni.showToast({
|
||||
title: "已达到兑换上限!",
|
||||
icon: "none"
|
||||
})
|
||||
|
||||
|
||||
console.log("exchangeTimes", this.goodsInfo.exchangeTimes)
|
||||
console.log("flag", flag)
|
||||
e.value = this.goodsInfo.exchangeTimes - flag
|
||||
this.value = this.goodsInfo.exchangeTimes - flag
|
||||
|
||||
|
||||
this.flag = true
|
||||
this.allData()
|
||||
|
||||
return
|
||||
|
||||
} else if (e.value >= this.goodsInfo.remainingInventory && this
|
||||
.goodsInfo.remainingInventory != -
|
||||
1) { // -1为无限库存
|
||||
|
||||
uni.showToast({
|
||||
title: "库存不足!",
|
||||
icon: "none"
|
||||
})
|
||||
|
||||
e.value = this.goodsInfo.remainingInventory
|
||||
this.value = this.goodsInfo.remainingInventory
|
||||
this.flag = true
|
||||
@ -306,9 +340,10 @@
|
||||
const deliveryData = JSON.parse(this.goodsInfo.deliveryMethod);
|
||||
console.log("deliveryData", deliveryData)
|
||||
if (deliveryData.length >= 2) {
|
||||
this.shippingType = deliveryData[index]
|
||||
this.qhindex = index
|
||||
} else if (deliveryData[0] == '门店自提') {
|
||||
console.log("index", index)
|
||||
this.shippingType = "门店自提"
|
||||
|
||||
if (index == 1) {
|
||||
uni.showToast({
|
||||
@ -319,6 +354,7 @@
|
||||
this.qhindex = 0
|
||||
|
||||
} else if (deliveryData[0] == '物流配送') {
|
||||
this.shippingType = "物流配送"
|
||||
this.qhindex = 1
|
||||
if (index == 0) {
|
||||
uni.showToast({
|
||||
@ -328,7 +364,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.allData()
|
||||
},
|
||||
goAdd() {
|
||||
uni.navigateTo({
|
||||
@ -340,9 +376,29 @@
|
||||
},
|
||||
// 金额计算
|
||||
allData() {
|
||||
|
||||
this.allPoints = 0
|
||||
this.allAmout = 0
|
||||
|
||||
|
||||
console.log("this.shippingType", this.shippingType)
|
||||
if (this.shippingType == "物流配送" &&
|
||||
this.goodsInfo.expressShippingFee == '统一运费' && this.goodsInfo
|
||||
.shippingFeeAmount &&
|
||||
this.goodsInfo.shippingFeeAmount >
|
||||
0
|
||||
|
||||
) {
|
||||
|
||||
console.log("11111111")
|
||||
|
||||
this.allAmout = this.goodsInfo.shippingFeeAmount
|
||||
}
|
||||
console.log("allAmout", this.allAmout)
|
||||
console.log("shippingFeeAmount", this.goodsInfo
|
||||
.shippingFeeAmount)
|
||||
|
||||
|
||||
|
||||
let allPoints = new BigNumber(0)
|
||||
|
||||
if (this.goodsInfo.exchangePoints) {
|
||||
@ -359,34 +415,28 @@
|
||||
if (this.goodsInfo.exchangePoints < 0) {
|
||||
allAmout = 0
|
||||
}
|
||||
this.allAmout = Number(allAmout).toFixed(2);
|
||||
let all = allAmout.plus(this.allAmout)
|
||||
this.allAmout = Number(all).toFixed(2);
|
||||
}
|
||||
// 计算加钱购
|
||||
|
||||
if (this.goodsInfo.exchangeMethod === '积分+加钱购') {
|
||||
// 积分相减
|
||||
|
||||
// let data = this.shoppingCart[0]; //
|
||||
// 计算加钱购商品一共多少积分
|
||||
// let markPurchases = new BigNumber(data.markPurchases);
|
||||
// let exchangePoints = allPoints.multipliedBy(new BigNumber(data.exchangePoints));
|
||||
if (this.goodsInfo.exchangeMethod === '积分+加钱购') {
|
||||
// 拿到总的积分
|
||||
this.myPoints = this.myPoints ? this.myPoints : 0
|
||||
let points = this.myPoints - allPoints; // 使用 toNumber() 获取 BigNumber 的数值
|
||||
console.log("myPoints", this.myPoints)
|
||||
console.log("points", points)
|
||||
|
||||
// 以及分等一多少
|
||||
if (points <= 0) {
|
||||
|
||||
// 计算需要的金额
|
||||
points = Math.abs(points);
|
||||
|
||||
|
||||
this.allAmout = points * this.goodsInfo.moneyRatio.toFixed(2); // 直接使用 JavaScript 中的乘法
|
||||
let sum = points * this.goodsInfo.moneyRatio.toFixed(2); // 直接使用 JavaScript 中的乘法
|
||||
this.allAmout = this.allAmout + sum
|
||||
this.allPoints = this.myPoints;
|
||||
} else {
|
||||
this.allAmout = 0
|
||||
this.allPoints = allPoints;
|
||||
// this.allAmout = 0
|
||||
this.allPoints = Number(allPoints).toFixed(2);
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -458,6 +508,39 @@
|
||||
this.storeAddress = res.data.address
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查询该商品是否达到个人的兑换上限
|
||||
async checkTheRedemptionLimit(giftId) {
|
||||
let flag = false;
|
||||
await request({
|
||||
url: 'business/integral/integralOrders/checkTheRedemptionLimit',
|
||||
method: 'get',
|
||||
params: {
|
||||
giftId: giftId
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
flag = res.data
|
||||
}
|
||||
})
|
||||
return flag
|
||||
},
|
||||
// 查询该商品是否达到个人的兑换上限
|
||||
async enquiryForCollection(giftId) {
|
||||
let flag = 0;
|
||||
await request({
|
||||
url: 'business/integral/integralOrders/enquiryForCollection',
|
||||
method: 'get',
|
||||
params: {
|
||||
giftId: giftId
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
flag = res.data
|
||||
}
|
||||
})
|
||||
return flag
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user