From ee7686bb705901f7f4e3bdf7d12ed3571052db90 Mon Sep 17 00:00:00 2001 From: xhxu Date: Thu, 13 May 2021 15:16:58 +0800 Subject: [PATCH] tt --- .../com/iformall/domain/po/tt/TtOrder.java | 67 ++ .../com/iformall/mapper/TtOrderMapper.java | 66 ++ .../main/resources/mapper/TtOrderMapper.xml | 992 ++++++++++++++++++ .../controller/TtOrderController.java | 2 - 4 files changed, 1125 insertions(+), 2 deletions(-) create mode 100644 mallinkService/src/main/java/com/iformall/domain/po/tt/TtOrder.java create mode 100644 mallinkService/src/main/java/com/iformall/mapper/TtOrderMapper.java create mode 100644 mallinkService/src/main/resources/mapper/TtOrderMapper.xml diff --git a/mallinkService/src/main/java/com/iformall/domain/po/tt/TtOrder.java b/mallinkService/src/main/java/com/iformall/domain/po/tt/TtOrder.java new file mode 100644 index 000000000..c607c9aae --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/tt/TtOrder.java @@ -0,0 +1,67 @@ +package com.iformall.domain.po.tt; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.math.BigDecimal; +import java.util.Date; + +@TableName(value = "tt_order") +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class TtOrder extends TenantEntity { + + protected Long id; + + @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") + private Long cUserId; + @TableField(exist = false) + private String nickName; + @TableField(exist = false) + private String phone; + @io.swagger.annotations.ApiModelProperty(value="产品ID(couponId)",name="productId") + private Long productId; + @TableField(exist = false) + private String productTitle; + @TableField(exist = false) + private String productPic; + @TableField(exist = false) + private String author; + @TableField(exist = false) + private String authorPic; + @io.swagger.annotations.ApiModelProperty(value="支付类型(1:支付宝,2:微信)",name="type") + private Integer type; + @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") + private Integer paymentType; + + @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") + private Integer payment; + @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") + private Date paymentTime; + + @Excel(name = "订单状态", width = 20, orderNum = "9", replace = {"待付款_0", "已支付_1", "已取消_2", "待退款_3", "已退款_4", "退款失败_5", " _-1"}) + @io.swagger.annotations.ApiModelProperty(value="\"待付款_0\", \"已支付_1\", \"已取消_2\", \"待退款_3\", \"已退款_4\", \"退款失败_5\", \" _-1\"",name="orderStatus") + private Integer orderStatus; + + @Excel(name = "订单日期", width = 20, orderNum = "7", format = "yyyy-MM-dd") + @io.swagger.annotations.ApiModelProperty(value="创建时间/砍价开始时间",name="createDate") + private Date createDate; + @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") + private Date updateDate; + + + public String getPaymentStr() { + return payment != null ? new BigDecimal(payment).divide(new BigDecimal(100)).toPlainString() : paymentStr; + } + + @Excel(name = "订单金额(元)", width = 20, orderNum = "6") + @TableField(exist = false) + private String paymentStr; + +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/TtOrderMapper.java b/mallinkService/src/main/java/com/iformall/mapper/TtOrderMapper.java new file mode 100644 index 000000000..d10c6995c --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/TtOrderMapper.java @@ -0,0 +1,66 @@ +package com.iformall.mapper; + +import com.iformall.common.CommonMapper; +import com.iformall.domain.dto.WxOrderReportDto; +import com.iformall.domain.po.WxOrder; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.po.tt.TtOrder; +import com.iformall.domain.vo.*; +import org.apache.ibatis.annotations.Param; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface TtOrderMapper extends CommonMapper { + + List findList(TtOrder record); + + Integer countList(WxOrder wxOrder); + int countCouponConditionType1(WxOrder wxOrder); + + List findListOfUnpaidOrderByDate(Map dateMap); + + List findListOfUnpaidPressOrderByDate(Map dateMap); + List findListOfCompleteUnPaidPressOrderByDate(Map dateMap); + + List findListOfUnpaidGroupOrderByDate(Map dateMap); + + List findListOfCUser(WxOrder wxOrder); + List selectDetailOfCUser(WxOrder wxOrder); + + /** B端收银台(收款码支付) */ + Map dayMicroPayAmountList(Map dateMap); + List findListOfMicroPayOrderByDate(Map dateMap); + List findListOfExpMicroPayOrderByDate(Map dateMap); + + List queryForSceneRepotyHistory(HashMap params); + + List listOrderReportByDate(HashMap params); + + List listMicroPayOrderReportByDateAndMerchant(HashMap params); + + List findListOfMerchantMicroPayOrderByDate(@Param("wxOrderReportDto") WxOrderReportDto wxOrderReportDto, @Param("tenantEntitys")List tenantEntitys); + + List findListOrder(WxOrderQueryVo record); + + Long queryOrderForMerchantCount(Map params); + + Long queryOrderForSum(Map params); + + Long queryOrderForCount(Map params); + + /**砍价*/ + List findListOfPress(WxOrder wxOrder); + WxOrderCouponPressVo selectDetailOfPress(WxOrder wxOrder); + void updateStatusByPressCouponId(WxOrder wxOrder); + + void updateStatusByOrderGroupId(WxOrder order); + + void updateOrderGroupStatusByCouponId(WxOrder updateOrder); + + void updateOrderGroupStatusByCouponChannelId(WxOrder updateOrder); + + void updateOrderStatusForGroup(@Param("tenantId")String tenantId); + +} diff --git a/mallinkService/src/main/resources/mapper/TtOrderMapper.xml b/mallinkService/src/main/resources/mapper/TtOrderMapper.xml new file mode 100644 index 000000000..549109966 --- /dev/null +++ b/mallinkService/src/main/resources/mapper/TtOrderMapper.xml @@ -0,0 +1,992 @@ + + + + + + + + + + + + + + + + + + + + + `id`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`, + `press_end_date`,`press_current_num`,`press_current_value`,`order_group_id`,`form_id`,`total_payment` + + + + where 1 = 1 + + + and `id` = #{id} + + + + and `order_number` = #{orderNumber} + + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + and `c_user_id` = #{cUserId} + + + + and `coupon_channel_id` = #{couponChannelId} + + + + and `product_id` = #{productId} + + + + and `type` = #{type} + + + + and `payment_type` = #{paymentType} + + + + and `payment` = #{payment} + + + + and `payment_time` = #{paymentTime} + + + + and `order_status` = #{orderStatus} + + + + and `create_date` = #{createDate} + + + + and `update_date` = #{updateDate} + + + + and `detail` like concat('%', #{detail},'%') + + + + and `press_end_date` = #{pressEndDate} + + + + and `press_current_num` = #{pressCurrentNum} + + + + and `press_current_value` = #{pressCurrentValue} + + + + and `order_group_id` = #{orderGroupId} + + + + and `form_id` = #{formId} + + + + and `order_status` in + + #{sItem} + + + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + + + + + + + + + + + + + + + + + + o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, + c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date, + co.id as coupon_order_id,co.coupon_order_status,c.support_transfer,c.subsidy_num + + + + update wx_order set order_status=#{orderStatus} + where product_id=#{productId} + and press_end_date is not null and order_status in (6,7) + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + + update wx_order set order_status=#{orderStatus},update_date=#{updateDate} + where product_id=#{productId} and order_status in(10,15) + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + + update wx_order set order_status=#{orderStatus},update_date=#{updateDate} + where coupon_channel_id=#{couponChannelId} and order_status in(10,15) + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, + c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + o.`id`,o.`order_number`,o.`tenant_id`,o.`parent_tenant_id`,o.`c_user_id`,o.`coupon_channel_id`,o.`product_id`,o.`type`, + o.`payment_type`,o.`payment`,o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,o.`detail`, + m.name as merchant_name, bu.name, bu.phone as bphone, + cubi.phone, cubi.nick_name, cubi.name c_user_name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + o.`id`,o.`order_number`,o.`tenant_id`,o.`c_user_id`,o.`coupon_channel_id`,o.`product_id`,o.`type`, + o.`payment_type`,o.`payment`,o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,o.`detail`, + m.name as merchant_name, bu.name, bu.phone as bphone, + cubi.phone, cubi.nick_name, cubi.name c_user_name, + po.id as pay_order_id, po.transaction_id + + + + + + + + + + + + + + + + + + + + + + wm.id as id, + wm.tenant_id as tenant_id, + wm.parent_tenant_id as parent_tenant_id, + wm.name as merchant_name, + wm.link_phone as merchant_phone, + mo.xTime as report_date, + (case when mo.amount > 0 then mo.amount else 0 end) trade_amt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status, + o.create_date,o.update_date,o.press_end_date,o.press_current_num,o.press_current_value, + c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.press_limit_num + + + + o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status, + o.create_date,o.update_date,o.press_end_date,o.press_current_num,o.press_current_value, + c.type as coupon_type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.detail,c.remark,c.press_limit_num, + co.id as coupon_order_id,co.coupon_order_status + + + + + + + + update wx_order set order_status=#{orderStatus} + where order_group_id=#{orderGroupId} and order_status=10 + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + + update wx_order set order_status=12 where `type`=0 and tenant_id = #{tenantId} and order_status in(10,15) and now()>press_end_date + + + diff --git a/mallinkTTCApi/src/main/java/com/iformall/controller/TtOrderController.java b/mallinkTTCApi/src/main/java/com/iformall/controller/TtOrderController.java index 01d1d26c2..1d3cc36a6 100644 --- a/mallinkTTCApi/src/main/java/com/iformall/controller/TtOrderController.java +++ b/mallinkTTCApi/src/main/java/com/iformall/controller/TtOrderController.java @@ -76,8 +76,6 @@ public class TtOrderController extends BaseController { @ApiOperation(value = "取消订单", notes = "{\"orderId\":\"string\"}") @PostMapping("cancel") public ResultData cancelOrder(@RequestBody Map paramMap) { - //Assert.notNull(wxOrders.getName(), "角色名不能为空"); - //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); String orderIdStr = paramMap.get("orderId"); if (StringUtils.isBlank(orderIdStr) || orderIdStr.equalsIgnoreCase(Constant.UNDEFINED)) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");