提交 004bd526 authored 作者: luojie's avatar luojie

修改优惠券BUG,修改订单列表

上级 61b68f3e
......@@ -109,6 +109,15 @@ public class TbCfCouponController {
List<TbCfCouponEntity> list = tbCfCouponService.queryList(params);
return R.ok().put("list", list);
}
/**
* 查询可以发放的优惠券列表
*/
@RequestMapping("/queryAllCoupon")
@ResponseBody
public R queryAllCoupon(@RequestParam Map<String, Object> params) {
List<TbCfCouponEntity> list = tbCfCouponService.queryLists(params);
return R.ok().put("list", list);
}
/**
*
......
package com.platform.controller.api;
import net.sf.json.JSONObject;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
//转换时间,正式版删除!!!!!!
public class Test {
public static void main(String[] args) throws Exception {
String res = "2019-11-01";
String res1 = "2019-11-25";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = simpleDateFormat.parse(res);
Date date1 = simpleDateFormat.parse(res1);
long it = date.getTime()/1000;
long it1 = date1.getTime()/1000;
String s = String.valueOf(it);
String s1 = String.valueOf(it1);
System.out.println(s);
System.out.println(s1);
}
/* public static void main(String[] args) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.format(getStartTime()));
System.out.println(sdf.format(getEndTime()));
}
private static Date getStartTime() {
Calendar todayStart = Calendar.getInstance();
todayStart.set(Calendar.HOUR_OF_DAY, 0);
todayStart.set(Calendar.MINUTE, 0);
todayStart.set(Calendar.SECOND, 0);
todayStart.set(Calendar.MILLISECOND, 0);
return todayStart.getTime();
}
private static Date getEndTime() {
Calendar todayEnd = Calendar.getInstance();
todayEnd.set(Calendar.HOUR_OF_DAY, 23);
todayEnd.set(Calendar.MINUTE, 59);
todayEnd.set(Calendar.SECOND, 59);
todayEnd.set(Calendar.MILLISECOND, 999);
return todayEnd.getTime();
}
@org.junit.jupiter.api.Test
public void test() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// tbCfOrderService.updateExpressStatuss(list);
}
*/
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ package com.platform.dao;
import com.platform.vo.CouponTakeVo;
import java.util.List;
import java.util.Map;
/**
* 优惠券表Dao
......@@ -22,4 +23,6 @@ public interface TbCfCouponDao extends BaseDao<TbCfCouponEntity> {
List<CouponTakeVo> getCouponTakeList(String couponId);
List<CouponIssueVo> getCouponIssueList(String couponId);
List<TbCfCouponEntity> queryLists(Map<String, Object> map);
}
......@@ -80,4 +80,11 @@ public interface TbCfCouponService {
* @return
*/
List<CouponIssueVo> getCouponIssueList(String couponId);
/**
* 查询可以发放的优惠券
* @param map
* @return
*/
List<TbCfCouponEntity> queryLists(Map<String, Object> map);
}
......@@ -73,4 +73,9 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
public List<CouponIssueVo> getCouponIssueList(String couponId) { return tbCfCouponDao.getCouponIssueList(couponId);
}
@Override
public List<TbCfCouponEntity> queryLists(Map<String, Object> map) {
return tbCfCouponDao.queryLists(map);
}
}
......@@ -95,6 +95,48 @@
limit #{offset}, #{limit}
</if>
</select>
<!--发放优惠券列表-->
<select id="queryLists" resultType="com.platform.entity.TbCfCouponEntity">
select
a.coupon_id,
a.coupon_category_id ,
b.coupon_category_name ,
a.coupon_use,
a.coupon_title,
a.coupon_icon,
a.with_station_id,
a.with_amount,
a.deduct_amount,
a.quato,
a.take_count,
a.used_count,
a.start_time,
a.end_time,
a.valid_start_time,
a.valid_end_time,
a.status,
a.create_user_id,
a.create_time,
a.update_user_id,
a.update_time,
a.coupon_vaild
from tb_cf_coupon a LEFT JOIN tb_cf_coupon_category b on a.coupon_category_id =b.coupon_category_id
WHERE 1=1 and a.coupon_vaild=0
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by coupon_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_coupon
WHERE 1=1
......
......@@ -40,7 +40,7 @@
left join tb_cf_platform_order p on p.order_id=o.order_id
left join tb_cf_finance f on f.order_id=o.order_id
left join sys_user s on s.user_id=p.user_id
WHERE 1=1
WHERE 1=1 and f.pay_way_code!='null'
<if test="name != null and name.trim() != ''">
AND o.order_no LIKE concat('%',#{name},'%')
</if>
......@@ -79,7 +79,7 @@
left join tb_cf_platform_order p on p.order_id=o.order_id
left join tb_cf_finance f on f.order_id=o.order_id
left join sys_user s on s.user_id=p.user_id
WHERE 1=1
WHERE 1=1 and f.pay_way_code!='null'
<if test="name != null and name.trim() != ''">
AND o.order_no LIKE concat('%',#{name},'%')
</if>
......@@ -105,239 +105,8 @@
left join tb_cf_platform_order p on p.order_id=o.order_id
left join tb_cf_finance f on f.order_id=o.order_id
left join sys_user s on s.user_id=p.user_id
WHERE 1=1
WHERE 1=1 and f.pay_way_code!='null'
</select>
<!--<select id="queryObject" resultType="com.platform.entity.TbCfOrderEntity">
select
`order_id`,
`order_no`,
`order_name`,
`order_time`,
`update_time`,
`deal_time`,
`close_time`,
`order_status`,
`user_id`,
`user_name`,
`delivery_address_id`,
`delivery_address`,
`delivery_name`,
`delivery_phone`,
`items_price`,
`total_price`,
`reality_pay`,
`delivery_flag`,
`delivery_time`,
`express_cost`,
`coupon_id`,
`coupon_title`,
`coupon_price`,
`tax`,
`fee`,
`pay_id`,
`pay_status`,
`enable_flag`,
`descripition_name`
from tb_cf_order
where order_id = #{id}
</select>
<select id="queryOrderDetail" resultType="com.platform.entity.TbCfOrderEntity">
select
`order_id`,
`user_id`,
`deal_time`,
`express_cost`,
`coupon_title`,
`coupon_price`,
`tax`,
`fee`,
`pay_id`
from tb_cf_order
where order_id = #{orderId}
</select>
<select id="queryList" resultType="com.platform.entity.TbCfOrderEntity">
select
`order_id`,
`order_no`,
`order_name`,
`order_time`,
`update_time`,
`deal_time`,
`close_time`,
`order_status`,
`user_id`,
`user_name`,
`delivery_address_id`,
`delivery_address`,
`delivery_name`,
`delivery_phone`,
`items_price`,
`total_price`,
`reality_pay`,
`delivery_flag`,
`delivery_time`,
`express_cost`,
`coupon_id`,
`coupon_title`,
`coupon_price`,
`tax`,
`fee`,
`pay_id`,
`pay_status`,
`enable_flag`,
`descripition_name`
from tb_cf_order
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND order_id LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by order_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_order
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND order_id LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfOrderEntity">
insert into tb_cf_order(
`order_id`,
`order_no`,
`order_name`,
`order_time`,
`update_time`,
`deal_time`,
`close_time`,
`order_status`,
`user_id`,
`user_name`,
`delivery_address_id`,
`delivery_address`,
`delivery_name`,
`delivery_phone`,
`items_price`,
`total_price`,
`reality_pay`,
`delivery_flag`,
`delivery_time`,
`express_cost`,
`coupon_id`,
`coupon_title`,
`coupon_price`,
`tax`,
`fee`,
`pay_id`,
`pay_status`,
`enable_flag`,
`descripition_name`)
values(
#{orderId},
#{orderNo},
#{orderName},
#{orderTime},
#{updateTime},
#{dealTime},
#{closeTime},
#{orderStatus},
#{userId},
#{userName},
#{deliveryAddressId},
#{deliveryAddress},
#{deliveryName},
#{deliveryPhone},
#{itemsPrice},
#{totalPrice},
#{realityPay},
#{deliveryFlag},
#{deliveryTime},
#{expressCost},
#{couponId},
#{couponTitle},
#{couponPrice},
#{tax},
#{fee},
#{payId},
#{payStatus},
#{enableFlag},
#{descripition_name}
)
</insert>
<update id="update" parameterType="com.platform.entity.TbCfOrderEntity">
update tb_cf_order
<set>
<if test="orderNo != null">`order_no` = #{orderNo}, </if>
<if test="orderName != null">`order_name` = #{orderName}, </if>
<if test="orderTime != null">`order_time` = #{orderTime}, </if>
<if test="updateTime != null">`update_time` = #{updateTime}, </if>
<if test="dealTime != null">`deal_time` = #{dealTime}, </if>
<if test="closeTime != null">`close_time` = #{closeTime}, </if>
<if test="orderStatus != null">`order_status` = #{orderStatus}, </if>
<if test="userId != null">`user_id` = #{userId}, </if>
<if test="userName != null">`user_name` = #{userName}, </if>
<if test="deliveryAddressId != null">`delivery_address_id` = #{deliveryAddressId}, </if>
<if test="deliveryAddress != null">`delivery_address` = #{deliveryAddress}, </if>
<if test="deliveryName != null">`delivery_name` = #{deliveryName}, </if>
<if test="deliveryPhone != null">`delivery_phone` = #{deliveryPhone}, </if>
<if test="itemsPrice != null">`items_price` = #{itemsPrice}, </if>
<if test="totalPrice != null">`total_price` = #{totalPrice}, </if>
<if test="realityPay != null">`reality_pay` = #{realityPay}, </if>
<if test="deliveryFlag != null">`delivery_flag` = #{deliveryFlag}, </if>
<if test="deliveryTime != null">`delivery_time` = #{deliveryTime}, </if>
<if test="expressCost != null">`express_cost` = #{expressCost}, </if>
<if test="couponId != null">`coupon_id` = #{couponId}, </if>
<if test="couponTitle != null">`coupon_title` = #{couponTitle}, </if>
<if test="couponPrice != null">`coupon_price` = #{couponPrice}, </if>
<if test="tax != null">`tax` = #{tax}, </if>
<if test="fee != null">`fee` = #{fee}, </if>
<if test="payId != null">`pay_id` = #{payId}, </if>
<if test="payStatus != null">`pay_status` = #{payStatus},</if>
<if test="enableFlag != null">`enable_flag` = #{enableFlag},</if>
<if test="descripitionName != null">`descripition_name` = #{descripitionName}</if>
</set>
where order_id = #{orderId}
</update>
<update id="updateDescripitionName" parameterType="com.platform.entity.TbCfOrderEntity">
update tb_cf_order
set `descripition_name` = #{descripitionName}
where order_id = #{orderId}
</update>
<delete id="delete">
delete from tb_cf_order where order_id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_order where order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
</delete>
&lt;!&ndash;根据订单id,获取订单内商品详情&ndash;&gt;
<select id="getOrderItemList" resultType="com.platform.entity.TbCfItemDetailEntity">
select t2.* from tb_cf_item_order_r t1,tb_cf_item_detail t2 where t1.order_id=#{orderId}
and t1.enable_flag=1 and t2.item_id=t1.item_id
</select>
<update id="updateDeliveryTime" parameterType="com.platform.entity.TbCfOrderEntity">
update tb_cf_order
<set>
<if test="deliveryTime != null">`delivery_time` = #{deliveryTime}, </if>
</set>
where order_id = #{orderId} and delivery_time is null
</update>-->
</mapper>
\ No newline at end of file
......@@ -166,7 +166,7 @@
<Card v-show="!showEdit" style="width:100vw;height: 100vh;position: absolute;top: 0;left: 0;">
<p slot="title">{{title}}</p>
<i-form ref="formValidate1" :model="tbCfCoupon" :rules="ruleValidate" :label-width="80">
<Form-item prop="couponId" >
<Form-item label="优惠券名称:" prop="couponId" >
<!--<i-input v-model="tbCfCoupon.couponCategory" placeholder="优惠券类型"/>-->
<i-select placeholder="请选择优惠券" v-model="tbCfCoupon.couponId" >
<i-option
......@@ -175,7 +175,7 @@
</i-option>
</i-select>
</Form-item>
<Form-item prop="userStatus">
<Form-item label="用户选择:" prop="userStatus">
<!-- <i-input v-model="tbCfCoupon.couponCategory" placeholder="优惠券类型"/>-->
<i-select placeholder="用户选择" v-model="tbCfCoupon.userStatus" >
<i-option
......@@ -183,15 +183,13 @@
:value="el.value">{{el.label}}</i-option>
</i-select>
</Form-item>
<Form-item prop="userLevel">
<Form-item label="用户等级:" prop="userLevel">
<!-- <i-input v-model="tbCfCoupon.couponCategory" placeholder="优惠券类型"/>-->
<template>
<i-select placeholder="用户等级选择" v-model="tbCfCoupon.userLevel">
<i-option
v-for="(el,i) in userLevelOptions" :key = 'i'
:value="el.value">{{el.label}}</i-option>
</i-select>
</template>
</Form-item>
<Form-item>
<!-- <i-button type="primary" @click="handleSubmit1()">提交</i-button>-->
......
......@@ -536,6 +536,22 @@ statusFormat = function (cellvalue) {
return cellvalue == 0 ? '正常' : '已删除';
};
/**
* 是否为注册就送优惠券
* @param cellvalue
* @returns {string}
*/
validFormat = function (cellvalue) {
let returnStr = "未知"
if (!!cellvalue||cellvalue == '0') {
if (cellvalue == '0') {
returnStr = "否";
} else if (cellvalue == '1') {
returnStr = "是";
}
}
return returnStr;
};
/**
* 订单状态翻译 (0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭)
* @param cellvalue
......@@ -588,9 +604,7 @@ deliveryFlagFormat = function (cellvalue) {
returnStr = "已代购";
} else if (cellvalue == '20') {
returnStr = "已到达中国仓";
} else if (cellvalue == '30') {
returnStr = "正运往非洲";
} else if (cellvalue == '40') {
}else if (cellvalue == '40') {
returnStr = "已到达非洲仓";
}else if (cellvalue == '50') {
returnStr = "买家已签收";
......@@ -598,6 +612,25 @@ deliveryFlagFormat = function (cellvalue) {
}
return returnStr;
}
/**
* 支付方式翻译
* @param cellvalue
*/
payWayCodeFormat = function (cellvalue){
let returnStr="未支付"
if(!!cellvalue||cellvalue=='0'){
if(cellvalue=='0'){
returnStr="未支付";
}else if(cellvalue=='stipe'){
returnStr="stipe";
}else if(cellvalue=='paypal'){
returnStr="paypal";
}else if(cellvalue=='flutterwave'){
returnStr="flutterwave";
}
}
return returnStr;
};
/**
* 用户类型翻译
* @param cellvalue
......
......@@ -4,13 +4,13 @@ $(function () {
colModel: [
{label: 'couponId', name: 'couponId', index: 'coupon_id', key: true, hidden: true},
{label: '优惠券类型Id ', name: 'couponCategoryId', index: 'couponCategoryId', width: 80 ,hidden:true},
{label: '优惠券类型 ', name: 'couponCategoryName', index: 'couponCategoryName', width: 80 },
{label: '优惠券类型 ', name: 'couponCategoryName', index: 'couponCategoryName', width: 70 },
{label: '可用于类目', name: 'couponUse', index: 'coupon_use', width: 80, hidden: true},
{label: '优惠券标题', name: 'couponTitle', index: 'coupon_title', width: 80},
{label: '优惠券图片地址', name: 'couponIcon', index: 'coupon_icon', width: 80},
{label: '优惠券图片地址', name: 'couponIcon', index: 'coupon_icon', width: 70},
{label: '那些站点可以使用', name: 'withStationId', index: 'with_station_id', width: 80, hidden: true},
{label: '满多少金额可以使用', name: 'withAmount', index: 'with_amount', width: 80},
{label: '抵扣金额', name: 'deductAmount', index: 'deduct_amount', width: 80},
{label: '抵扣金额', name: 'deductAmount', index: 'deduct_amount', width: 50},
{label: '发券数量', name: 'quato', index: 'quato', width: 80},
{label: '已领取数量', name: 'takeCount', index: 'take_count', width: 80, hidden: true},
{label: '已使用数量', name: 'usedCount', index: 'used_count', width: 80, hidden: true},
......@@ -18,12 +18,12 @@ $(function () {
{label: '发放结束时间', name: 'endTime', index: 'end_time', width: 80},
{label: '有效开始时间', name: 'validStartTime', index: 'valid_start_time', width: 80},
{label: '有效结束时间', name: 'validEndTime', index: 'valid_end_time', width: 80},
{label: '有效标志', name: 'status', index: 'status', width: 80,formatter:stateFormat},
{label: '有效标志', name: 'status', index: 'status', width: 50,formatter:stateFormat},
{label: '创建人', name: 'createUserId', index: 'create_user_id', width: 80, hidden: true},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80},
{label: '修改人', name: 'updateUserId', index: 'update_user_id', width: 80, hidden: true},
{label: '修改时间', name: 'updateTime', index: 'update_time', width: 80, hidden: true},
{label: '是否为注册就送优惠券', name: 'couponVaild', index: 'coupon_vaild', width: 80, hidden: true}]
{label: '是否为注册即送优惠券', name: 'couponVaild', index: 'coupon_vaild', width: 90,formatter:validFormat}]
});
});
$(function () {
......@@ -291,6 +291,7 @@ let vm = new Vue({
edit: function(){
this.showEdit=false
vm.title = "设置优惠券发放";
vm.reload();
vm.tbCfCoupon = {};
},
......@@ -383,13 +384,12 @@ let vm = new Vue({
}
},
created(){
debugger
var that = this
$.get('../tbcfcoupon/queryAll',function (res) {
let that = this
$.get('../tbcfcoupon/queryAllCoupon',function (res) {
console.log(res.list)
that.Coupon = res.list;
})
var ta = this
let ta = this
$.get('../tbcfcouponcategory/queryAll',function (res1) {
console.log(res1.list)
ta.CouponCategory=res1.list;
......
......@@ -12,20 +12,20 @@ $(function () {
{label: '用户id', name: 'userId', index: 'user_id', width: 120},
{label: '订单号', name: 'orderNo', index: 'order_no', width: 80},
{label: '下单时间', name: 'orderTime', index: 'order_time', width: 70},
{label: '金额',name: 'realityPay', index: 'reality_pay', width: 45},
{label: '金额',name: 'realityPay', index: 'reality_pay', width: 55,formatter: "currency",formatoptions: { prefix:"$"}},
// formatter: "currency",formatoptions: {thousandsSeparator:",",decimalSeparator:".",decimalPlaces:"2", prefix:"$"}}, //在金额前加上$,加上后,页合计无法正常显示。
{label: '商品', name: 'itemTitle', index: 'item_title', width: 90},
{label: '商品数量', name: 'itemNum', index: 'item_num', width: 30},
{label: '收货地址', name: 'deliveryAddress', index: 'delivery_address', width: 100},
{label: '快递单号', name: 'pExpressNumber', index: 'p_express_number', width: 80,sortable:false},
{label: '支付方式', name: 'payWayCode', index: 'pay_way_code', width: 35},
{label: '支付方式', name: 'payWayCode', index: 'pay_way_code', width: 35,payWayCodeFormat},
{label: '物流状态', name: 'deliveryFlag', index: 'delivery_flag', width: 40,formatter:deliveryFlagFormat},
{label: '代购人', name: 'userName', index: 'user_name', width: 40},
{label: '总金额', name: 'totalPay', index: 'totalPay', width: 40,hidden:true}
/* , editable:true,edittype:'select',editoptions:{value:{
0:'等待处理', 10:'已经代购', 20:'正在配送', 30:'已到达中国仓', 40:'正运往非洲',50:'买家已签收'}*/
],
footerrow: true,
/*footerrow: true,
gridComplete:function(){
// 页合计
let rowNum = parseInt($(this).getGridParam('records'),10);
......@@ -37,13 +37,13 @@ $(function () {
$(this).footerData("set", {
"orderTime": "<font color='red'>页合计<font>",
"realityPay": "<font color='red'>"+"$" + realityPay.toFixed(2) + "<font>",
/* "itemNum": "<font color='red'>总合计<font>",
"deliveryAddress": "<font color='red'>"+"$" + totalPay.toFixed(2) + "<font>",*/
/!* "itemNum": "<font color='red'>总合计<font>",
"deliveryAddress": "<font color='red'>"+"$" + totalPay.toFixed(2) + "<font>",*!/
});
} else {
$(".ui-jqgrid-sdiv").hide();
}
}
}*/
});
});
......@@ -62,9 +62,6 @@ let vm = new Vue({
},{
value: '20',
label: '已到达中国仓'
},{
value: '30',
label: '正运往非洲'
},{
value: '40',
label: '已到达非洲仓'
......@@ -73,6 +70,9 @@ let vm = new Vue({
label: '买家已签收'
}],
payWayCodeOptions:[{
value:'0',
label:'未支付',
},{
value:'stripe',
label:'stripe',
},{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论