Commit 6b86b2dd by 吕明尚

Merge branch 'dev' into test

parents 1a865a0a 2d780206
......@@ -41,7 +41,7 @@ public class SOrderController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('system:order:list')")
@GetMapping("/list")
public TableDataInfoVo list(SOrder sOrder)
public TableDataInfoVo list(SOrderVo sOrder)
{
startPage();
List<SOrder> list = sOrderService.selectSOrderList(sOrder);
......@@ -71,7 +71,7 @@ public class SOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('system:order:export')")
@Log(title = "订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SOrder sOrder)
public void export(HttpServletResponse response, SOrderVo sOrder)
{
List<SOrderVo> list = sOrderService.exportList(sOrder);
ExcelUtil<SOrderVo> util = new ExcelUtil<SOrderVo>(SOrderVo.class);
......
......@@ -119,6 +119,12 @@ public class SOrderVo
@Excel(name = "使用余额")
private BigDecimal balance;
@Excel(name = "充值金额")
private BigDecimal rechargeAmount;
@Excel(name = "赠送金额")
private BigDecimal giftAmount;
@ApiModelProperty(value = "优惠比例")
@Excel(name = "优惠比例")
private BigDecimal discountRatio;
......@@ -276,4 +282,27 @@ public class SOrderVo
//是否可以申请退款
@ApiModelProperty(name = "是否可以申请退款")
private Boolean isRefund;
@Excel(name = "次卡ID")
private Long secondaryCardId;
@Excel(name = "月卡ID")
private Long monthlyCardId;
@Excel(name = "历史订单号")
private String historicalOrderNo;
/**
* 支付开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@TableField(select = false)
private Date startPayTime;
/**
* 支付结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@TableField(select = false)
private Date endPayTime;
}
......@@ -2,6 +2,7 @@ package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.SOrder;
import share.system.domain.vo.SOrderVo;
import java.util.HashMap;
import java.util.List;
......@@ -28,7 +29,7 @@ public interface SOrderMapper extends BaseMapper<SOrder>
* @param sOrder 订单
* @return 订单集合
*/
public List<SOrder> selectSOrderList(SOrder sOrder);
public List<SOrder> selectSOrderList(SOrderVo sOrder);
/**
* 新增订单
......@@ -72,7 +73,7 @@ public interface SOrderMapper extends BaseMapper<SOrder>
List<SOrder> selectSOrderByStoreIdAndMaxTime(SOrder order);
HashMap<String, Object> sumPrice(SOrder sOrder);
HashMap<String, Object> sumPrice(SOrderVo sOrder);
List<Long> couponIds(SOrder sOrder);
List<Long> couponIds(SOrderVo sOrder);
}
......@@ -39,7 +39,7 @@ public interface ISOrderService extends IService<SOrder>
* @param sOrder 订单
* @return 订单集合
*/
public List<SOrder> selectSOrderList(SOrder sOrder);
public List<SOrder> selectSOrderList(SOrderVo sOrder);
/**
* 查询订单列表
......@@ -193,7 +193,7 @@ public interface ISOrderService extends IService<SOrder>
int modifyOrder(SOrderDto sOrderDto);
TableDataInfoVo pageList(TableDataInfo dataTable, SOrder sOrder);
TableDataInfoVo pageList(TableDataInfo dataTable, SOrderVo sOrder);
/**
* 订单退款(人工退款)
......@@ -209,7 +209,7 @@ public interface ISOrderService extends IService<SOrder>
Boolean changeRoom(SOrderDto dto);
List<SOrderVo> exportList(SOrder sOrder);
List<SOrderVo> exportList(SOrderVo sOrder);
List<SOrder> selectSOrderByMaxTime(SOrder orderQuery);
......@@ -217,7 +217,7 @@ public interface ISOrderService extends IService<SOrder>
OrderStatisticsResponse statistics(OrderStatisticsRequest request);
List<Long> couponIds(SOrder sOrder);
List<Long> couponIds(SOrderVo sOrder);
List<OrderVo> statisticsOrderList(OrderStatisticsRequest request);
}
......@@ -218,7 +218,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
* @return 订单
*/
@Override
public List<SOrder> selectSOrderList(SOrder sOrder) {
public List<SOrder> selectSOrderList(SOrderVo sOrder) {
return baseMapper.selectSOrderList(sOrder);
}
......@@ -380,7 +380,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
@Override
public TableDataInfoVo pageList(TableDataInfo dataTable, SOrder sOrder) {
public TableDataInfoVo pageList(TableDataInfo dataTable, SOrderVo sOrder) {
List<SOrder> list = (List<SOrder>) dataTable.getRows();
TableDataInfoVo tableDataInfo = new TableDataInfoVo();
tableDataInfo.setCode(HttpStatus.SUCCESS);
......@@ -785,7 +785,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
@Override
public List<SOrderVo> exportList(SOrder sOrder) {
public List<SOrderVo> exportList(SOrderVo sOrder) {
List<SOrder> sOrders = selectSOrderList(sOrder);
List<SOrderVo> sOrderVos = convertDosToVos(sOrders);
List<SaobeiApiLog> saobeiApiLogs = saobeiApiLogService.list();
......@@ -3469,7 +3469,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
@Override
public List<Long> couponIds(SOrder sOrder) {
public List<Long> couponIds(SOrderVo sOrder) {
return baseMapper.couponIds(sOrder);
}
......
......@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.SConsumer;
import share.system.domain.SecondaryCardLog;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SecondaryCardLogVo;
import share.system.mapper.SecondaryCardLogMapper;
import share.system.service.SecondaryCardLogService;
......@@ -43,8 +41,6 @@ public class SecondaryCardLogServiceImpl extends ServiceImpl<SecondaryCardLogMap
*/
@Override
public List<SecondaryCardLogVo> selectSecondaryCardLogList(SecondaryCardLogVo secondaryCardLog) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
secondaryCardLog.setConsumerId(user.getId());
return secondaryCardLogMapper.selectSecondaryCardLogList(secondaryCardLog);
}
......
......@@ -97,114 +97,115 @@
from s_order
</sql>
<select id="selectSOrderList" parameterType="SOrder" resultMap="SOrderResult">
select id,
order_no,
out_trade_no,
historical_order_no,
order_type,
pay_type,
pay_status,
store_id,
room_id,
consumer_id,
consumer_name,
consumer_phone,
pack_id,
pack_price,
coupon_id,
coupon_price,
secondary_card_id,
monthly_card_id,
total_price,
pay_price,
duration,
balance,
recharge_amount,
gift_amount,
discount_ratio,
pay_time,
time_long,
pre_start_date,
pre_end_date,
start_date,
end_date,
status,
refund_status,
refund_reason,
refund_reason_time,
refund_price,
is_delete,
create_by,
create_time,
update_by,
update_time,
arrival_time,
remark
from s_order
where pay_status = 1
and is_delete = 0
<if test="orderNo != null and orderNo != ''">and order_no = #{orderNo}</if>
<if test="historicalOrderNo != null and historicalOrderNo != ''">and historical_order_no =
<select id="selectSOrderList" parameterType="SOrderVo" resultMap="SOrderResult">
select s.id,
s.order_no,
s.out_trade_no,
s.historical_order_no,
s.order_type,
s.pay_type,
s.pay_status,
s.store_id,
s.room_id,
s.consumer_id,
s.consumer_name,
s.consumer_phone,
s.pack_id,
s.pack_price,
s.coupon_id,
s.coupon_price,
s.secondary_card_id,
s.monthly_card_id,
s.total_price,
s.pay_price,
s.duration,
s.balance,
s.recharge_amount,
s.gift_amount,
s.discount_ratio,
s.pay_time,
s.time_long,
s.pre_start_date,
s.pre_end_date,
s.start_date,
s.end_date,
s.status,
s.refund_status,
s.refund_reason,
s.refund_reason_time,
s.refund_price,
s.is_delete,
s.create_by,
s.create_time,
s.update_by,
s.update_time,
s.arrival_time,
s.remark
from s_order s join s_consumer_coupon c on s.coupon_id = c.id
where s.pay_status = 1
and s.is_delete = 0
<if test="couponName !=null and couponName!= ''">and c.name = #{couponName}</if>
<if test="orderNo != null and orderNo != ''">and s.order_no = #{orderNo}</if>
<if test="historicalOrderNo != null and historicalOrderNo != ''">and s.historical_order_no =
#{historicalOrderNo}
</if>
<if test="outTradeNo != null and outTradeNo != ''">and out_trade_no = #{outTradeNo}</if>
<if test="orderType != null and orderType != ''">and order_type = #{orderType}</if>
<if test="payType != null and payType != ''">and pay_type = #{payType}</if>
<if test="outTradeNo != null and outTradeNo != ''">and s.out_trade_no = #{outTradeNo}</if>
<if test="orderType != null and orderType != ''">and s.order_type = #{orderType}</if>
<if test="payType != null and payType != ''">and s.pay_type = #{payType}</if>
<!-- <if test="payStatus != null and payStatus != ''">and pay_status = #{payStatus}</if>-->
<if test="storeId != null and storeId != ''">and store_id = #{storeId}</if>
<if test="roomId != null and roomId != ''">and room_id = #{roomId}</if>
<if test="consumerId != null and consumerId != ''">and consumer_id = #{consumerId}</if>
<if test="consumerName != null and consumerName != ''">and consumer_name = #{consumerName}</if>
<if test="consumerPhone != null and consumerPhone != ''">and consumer_phone = #{consumerPhone}</if>
<if test="packId != null and packId != ''">and pack_id = #{packId}</if>
<if test="packPrice != null and packPrice != ''">and pack_price = #{packPrice}</if>
<if test="couponId != null and couponId != ''">and coupon_id = #{couponId}</if>
<if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if>
<if test="secondaryCardId != null and secondaryCardId != ''">and secondary_card_id = #{secondaryCardId}</if>
<if test="monthlyCardId != null and monthlyCardId != ''">and monthly_card_id = #{monthlyCardId}</if>
<if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and duration = #{duration}</if>
<if test="balance != null and balance != ''">and balance = #{balance}</if>
<if test="rechargeAmount != null and rechargeAmount != ''">and recharge_amount = #{rechargeAmount}</if>
<if test="giftAmount != null and giftAmount !=''">and gift_amount = #{giftAmount}</if>
<if test="discountRatio != null and discountRatio != ''">and discount_ratio = #{discountRatio}</if>
<if test="storeId != null and storeId != ''">and s.store_id = #{storeId}</if>
<if test="roomId != null and roomId != ''">and s.room_id = #{roomId}</if>
<if test="consumerId != null and consumerId != ''">and s.consumer_id = #{consumerId}</if>
<if test="consumerName != null and consumerName != ''">and s.consumer_name = #{consumerName}</if>
<if test="consumerPhone != null and consumerPhone != ''">and s.consumer_phone = #{consumerPhone}</if>
<if test="packId != null and packId != ''">and s.pack_id = #{packId}</if>
<if test="packPrice != null and packPrice != ''">and s.pack_price = #{packPrice}</if>
<if test="couponId != null and couponId != ''">and s.coupon_id = #{couponId}</if>
<if test="couponPrice != null and couponPrice != ''">and s.coupon_price = #{couponPrice}</if>
<if test="secondaryCardId != null and secondaryCardId != ''">and s.secondary_card_id = #{secondaryCardId}</if>
<if test="monthlyCardId != null and monthlyCardId != ''">and s.monthly_card_id = #{monthlyCardId}</if>
<if test="totalPrice != null and totalPrice != ''">and s.total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and s.pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and s.duration = #{duration}</if>
<if test="balance != null and balance != ''">and s.balance = #{balance}</if>
<if test="rechargeAmount != null and rechargeAmount != ''">and s.recharge_amount = #{rechargeAmount}</if>
<if test="giftAmount != null and giftAmount !=''">and s.gift_amount = #{giftAmount}</if>
<if test="discountRatio != null and discountRatio != ''">and s.discount_ratio = #{discountRatio}</if>
<if test="startPayTime != null">
and DATE_FORMAT(pay_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startPayTime}, '%Y-%m-%d')
and DATE_FORMAT(s.pay_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startPayTime}, '%Y-%m-%d')
</if>
<if test="endPayTime != null">
and DATE_FORMAT(pay_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{endPayTime}, '%Y-%m-%d')
and DATE_FORMAT(s.pay_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{endPayTime}, '%Y-%m-%d')
</if>
<if test="payTime != null and payTime != ''">and pay_time = #{payTime}</if>
<if test="timeLong != null and timeLong != ''">and time_long = #{timeLong}</if>
<if test="payTime != null and payTime != ''">and s.pay_time = #{payTime}</if>
<if test="timeLong != null and timeLong != ''">and s.time_long = #{timeLong}</if>
<if test="preStartDate != null">
and DATE_FORMAT(pre_start_date, '%Y-%m-%d') &gt;= DATE_FORMAT(#{preStartDate}, '%Y-%m-%d')
and DATE_FORMAT(s.pre_start_date, '%Y-%m-%d') &gt;= DATE_FORMAT(#{preStartDate}, '%Y-%m-%d')
</if>
<if test="preEndDate != null">
and DATE_FORMAT(pre_start_date, '%Y-%m-%d') &lt;= DATE_FORMAT(#{preEndDate}, '%Y-%m-%d')
and DATE_FORMAT(s.pre_start_date, '%Y-%m-%d') &lt;= DATE_FORMAT(#{preEndDate}, '%Y-%m-%d')
</if>
<if test="startDate != null">
and DATE_FORMAT(create_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
and DATE_FORMAT(s.create_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
</if>
<if test="endDate != null">
and DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
and DATE_FORMAT(s.create_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</if>
<if test="status != null and status != '' or status==0">and status = #{status}</if>
<if test="refundStatus != null and refundStatus != ''">and refund_status = #{refundStatus}</if>
<if test="refundReason != null and refundReason != ''">and refund_reason = #{refundReason}</if>
<if test="refundReasonTime != null">and refund_reason_time =
<if test="status != null and status != '' or status==0">and s.status = #{status}</if>
<if test="refundStatus != null and refundStatus != ''">and s.refund_status = #{refundStatus}</if>
<if test="refundReason != null and refundReason != ''">and s.refund_reason = #{refundReason}</if>
<if test="refundReasonTime != null">and s.efund_reason_time =
#{refundReasonTime}
</if>
<if test="refundPrice != null and refundPrice != ''">and refund_price = #{refundPrice}</if>
<if test="isDelete != null and isDelete != ''">and is_delete = #{isDelete}</if>
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
<if test="arrivalTime != null and arrivalTime != ''">and arrival_time = #{arrivalTime}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
ORDER BY id DESC
<if test="refundPrice != null and refundPrice != ''">and s.refund_price = #{refundPrice}</if>
<if test="isDelete != null and isDelete != ''">and s.is_delete = #{isDelete}</if>
<if test="createBy != null and createBy != ''">and s.create_by = #{createBy}</if>
<if test="createTime != null and createTime != ''">and s.create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and s.update_by = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''">and s.update_time = #{updateTime}</if>
<if test="arrivalTime != null and arrivalTime != ''">and s.arrival_time = #{arrivalTime}</if>
<if test="remark != null and remark != ''">and s.remark = #{remark}</if>
ORDER BY s.id DESC
</select>
<select id="selectSOrderById" parameterType="Long" resultMap="SOrderResult">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment