| @@ -117,6 +117,8 @@ public class TtCoupon extends TenantEntity { | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="merchantName") | |||
| private String merchantName; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="merchantPic") | |||
| private String merchantPic; | |||
| @io.swagger.annotations.ApiModelProperty(value="业态",name="businessId") | |||
| private Long businessId; | |||
| @@ -32,6 +32,8 @@ public class TtOrder extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private String productPic; | |||
| @TableField(exist = false) | |||
| private Long authorId; | |||
| @TableField(exist = false) | |||
| private String author; | |||
| @TableField(exist = false) | |||
| private String authorPic; | |||
| @@ -64,4 +66,12 @@ public class TtOrder extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private String paymentStr; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-起始时间",name="startdate") | |||
| private Date startdate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="enddate") | |||
| private Date enddate; | |||
| } | |||
| @@ -16,51 +16,4 @@ public interface TtOrderMapper extends CommonMapper<TtOrder, Long> { | |||
| List<TtOrder> findList(TtOrder record); | |||
| Integer countList(WxOrder wxOrder); | |||
| int countCouponConditionType1(WxOrder wxOrder); | |||
| List<WxOrder> findListOfUnpaidOrderByDate(Map dateMap); | |||
| List<WxOrder> findListOfUnpaidPressOrderByDate(Map dateMap); | |||
| List<WxOrder> findListOfCompleteUnPaidPressOrderByDate(Map dateMap); | |||
| List<WxOrder> findListOfUnpaidGroupOrderByDate(Map dateMap); | |||
| List<WxOrderCouponVo> findListOfCUser(WxOrder wxOrder); | |||
| List<WxOrderCouponVo> selectDetailOfCUser(WxOrder wxOrder); | |||
| /** B端收银台(收款码支付) */ | |||
| Map dayMicroPayAmountList(Map dateMap); | |||
| List<WxOrderPayVo> findListOfMicroPayOrderByDate(Map dateMap); | |||
| List<WxOrderPayExpVo> findListOfExpMicroPayOrderByDate(Map dateMap); | |||
| List<MarkingSceneDataVo> queryForSceneRepotyHistory(HashMap<String,Object> params); | |||
| List<WxOrderReportVo> listOrderReportByDate(HashMap<String,Object> params); | |||
| List<WxOrderReportVo> listMicroPayOrderReportByDateAndMerchant(HashMap<String,Object> params); | |||
| List<WxMerchantMicroPayVo> findListOfMerchantMicroPayOrderByDate(@Param("wxOrderReportDto") WxOrderReportDto wxOrderReportDto, @Param("tenantEntitys")List<TenantEntity> tenantEntitys); | |||
| List<WxOrder> findListOrder(WxOrderQueryVo record); | |||
| Long queryOrderForMerchantCount(Map<String,Object> params); | |||
| Long queryOrderForSum(Map<String,Object> params); | |||
| Long queryOrderForCount(Map<String, Object> params); | |||
| /**砍价*/ | |||
| List<WxOrderCouponPressVo> 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); | |||
| } | |||
| @@ -0,0 +1,18 @@ | |||
| package com.iformall.service.tt; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.tt.TtOrder; | |||
| public interface TtOrderService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<TtOrder> listAsPage(TtOrder record, Integer pageIndex, Integer pageSize); | |||
| } | |||
| @@ -37,6 +37,7 @@ | |||
| <result column="popularity" jdbcType="INTEGER" property="popularity"/> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> | |||
| <result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/> | |||
| <result column="merchant_pic" jdbcType="VARCHAR" property="merchantPic"/> | |||
| <result column="business_id" jdbcType="BIGINT" property="businessId"/> | |||
| <result column="business_name" jdbcType="VARCHAR" property="businessName"/> | |||
| </resultMap> | |||
| @@ -47,7 +48,7 @@ | |||
| `sale_price`, `orig_price`, `is_preview`, `preview_duration`, `detail`, `false_sell_count`, | |||
| `dy_title`, `inventory`, `remark`, `status`, `create_date`, `update_date`, | |||
| `see_count`, `sell_count`, `assess_count`, `collect_count`, `is_del`, | |||
| `column_id`, `popularity`, `merchant_id`, `merchant_name`, `business_id`, `business_name` | |||
| `column_id`, `popularity`, `merchant_id`, `merchant_name`,`merchant_pic`, `business_id`, `business_name` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -88,8 +89,11 @@ | |||
| and `status` = #{status} | |||
| </if> | |||
| <if test=" null != startdate and null!=enddate"> | |||
| and `create_date` between #{startdate} and #{enddate} | |||
| <if test="startdate != null"> | |||
| and `create_date` >= #{startdate} | |||
| </if> | |||
| <if test="enddate != null"> | |||
| and `create_date` <= #{enddate} | |||
| </if> | |||
| <if test=" null != businessId "> | |||
| @@ -9,6 +9,7 @@ import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.tt.TtOrder; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxOrderCouponPressVo; | |||
| import com.iformall.domain.vo.WxOrderCouponVo; | |||
| @@ -18,6 +19,7 @@ import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.service.WxOrderService; | |||
| import com.iformall.service.tt.TtOrderService; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.RedisLock; | |||
| import io.swagger.annotations.Api; | |||
| @@ -39,13 +41,16 @@ import java.util.Map; | |||
| @RequestMapping("/api/order/") | |||
| @Api(description = "订单相关接口") | |||
| public class TtOrderController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxCouponChannelService wxCouponChannelService; | |||
| private TtOrderService ttOrderService; | |||
| WxOrderService wxOrderService; | |||
| @Autowired | |||
| private WxOrderService wxOrderService; | |||
| private WxCouponChannelService wxCouponChannelService; | |||
| @Autowired | |||
| private WxCouponService wxCouponService; | |||
| @@ -60,6 +65,27 @@ public class TtOrderController extends BaseController { | |||
| @Autowired | |||
| RedisLock redisLock; | |||
| @ApiOperation("分页订单列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData list(@ModelAttribute TtOrder order, Integer pageNum, Integer pageSize) { | |||
| // c端用户应该只能看到自己的订单 | |||
| if (order == null){ | |||
| order = new TtOrder(); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| order.setCUserId(memberId); | |||
| return new ResultData(ttOrderService.listAsPage(order, pageNum, pageSize)); | |||
| } | |||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||
| @PostMapping("save") | |||
| public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { | |||
| @@ -128,43 +154,7 @@ public class TtOrderController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("分页订单列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData list(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | |||
| // c端用户应该只能看到自己的订单 | |||
| if (wxOrder == null){ | |||
| wxOrder = new WxOrder(); | |||
| } | |||
| Long memberId; | |||
| try { | |||
| memberId = getMemberId(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxOrder.setCUserId(memberId); | |||
| wxOrder.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| final PageInfo<WxOrderCouponVo> page = wxOrderService.listCUserVoAsPage(wxOrder, pageNum, pageSize); | |||
| Date now = new Date(); | |||
| page.getList().stream().forEach(oc->{ | |||
| if (oc.getValidStartDate() != null && oc.getValidEndDate() != null ) { | |||
| if (oc.getValidStartDate().getTime() > now.getTime()) { | |||
| oc.setValidStatus(EnumCouponOrderValidStatus.PREPARED.getCode()); | |||
| } else if (oc.getValidEndDate().getTime() < now.getTime()) { | |||
| oc.setValidStatus(EnumCouponOrderValidStatus.ENDED.getCode()); | |||
| } else { | |||
| oc.setValidStatus(EnumCouponChannelActivityStatus.STARTED.getCode()); | |||
| } | |||
| } | |||
| }); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("订单详情接口") | |||
| @GetMapping("detail") | |||