From b9ffabebaa3350a170a516e89329e541da9aff4a Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 11 May 2021 10:45:06 +0800 Subject: [PATCH 1/3] tt --- .../java/com/iformall/domain/po/TtCoupon.java | 145 ++++++++++++++++++ .../com/iformall/mapper/TtCouponMapper.java | 38 +++++ .../main/resources/mapper/TtCouponMapper.xml | 140 +++++++++++++++++ .../src/main/resources/application.yml | 2 +- 4 files changed, 324 insertions(+), 1 deletion(-) create mode 100644 mallinkService/src/main/java/com/iformall/domain/po/TtCoupon.java create mode 100644 mallinkService/src/main/java/com/iformall/mapper/TtCouponMapper.java create mode 100644 mallinkService/src/main/resources/mapper/TtCouponMapper.xml diff --git a/mallinkService/src/main/java/com/iformall/domain/po/TtCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/TtCoupon.java new file mode 100644 index 000000000..73b1b889f --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/TtCoupon.java @@ -0,0 +1,145 @@ +package com.iformall.domain.po; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.common.SortColumn; +import com.iformall.domain.po.base.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@TableName(value = "tt_coupon") +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class TtCoupon extends TenantEntity { + + protected Long id; + + @TableField(exist = false) + protected List types; + + @TableField(exist = false) + @SortColumn(column = "sale_price") + private String salePriceStr; + + @TableField(exist = false) + @SortColumn(column = "orig_price") + private String origPriceStr; + + @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; + + @io.swagger.annotations.ApiModelProperty(value="1:专栏2:单课程3:子课程",name="type") + private Integer type; + @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") + private String coverImg; + @io.swagger.annotations.ApiModelProperty(value="多封面图",name="coverPicture") + private String coverPicture; + @io.swagger.annotations.ApiModelProperty(value="详情多图",name="detailPicture") + private String detailPicture; + @io.swagger.annotations.ApiModelProperty(value="课程名称",name="title") + @Excel(name="名称",width = 20,orderNum = "1") + private String title; + @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") + private String subTitle; + + @io.swagger.annotations.ApiModelProperty(value="",name="videoId") + private String videoId; + @io.swagger.annotations.ApiModelProperty(value="视频时长(分钟)",name="videoTime") + private Integer videoTime; + + @io.swagger.annotations.ApiModelProperty(value="富文本内容",name="html") + private String html; + + @io.swagger.annotations.ApiModelProperty(value="是否横屏",name="isLandscape") + private Integer isLandscape; + @io.swagger.annotations.ApiModelProperty(value="是否付费",name="isPayment") + private Integer isPayment; + + @io.swagger.annotations.ApiModelProperty(value="售价",name="salePrice") + @Excel(name="售价(分)",width = 20,orderNum = "3") + private Integer salePrice; + @io.swagger.annotations.ApiModelProperty(value="原价",name="origPrice") + private Integer origPrice; + + @io.swagger.annotations.ApiModelProperty(value="是否可预览",name="isPreview") + private Integer isPreview; + @io.swagger.annotations.ApiModelProperty(value="预览时长",name="previewDuration") + private Integer previewDuration; + @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") + private String detail; + @io.swagger.annotations.ApiModelProperty(value="虚拟售出数",name="falseSellCount") + private Integer falseSellCount; + @io.swagger.annotations.ApiModelProperty(value="抖音关联标题",name="dyTitle") + private String dyTitle; + @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") + private Integer inventory; + @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") + private String remark; + @io.swagger.annotations.ApiModelProperty(value="状态",name="status") + private Integer status; + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") + private Date createDate; + @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") + private Date updateDate; + + @io.swagger.annotations.ApiModelProperty(value="浏览数",name="seeCount") + private Integer seeCount; + @io.swagger.annotations.ApiModelProperty(value="购买数",name="sellCount") + private Integer sellCount; + @io.swagger.annotations.ApiModelProperty(value="评价数",name="assessCount") + private Integer assessCount; + @io.swagger.annotations.ApiModelProperty(value="收藏数",name="collectCount") + private Integer collectCount; + + @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") + private Integer isDel; + + + @io.swagger.annotations.ApiModelProperty(value = "专栏id(type=3时本表id)", name = "columnId") + private Long columnId; + + @io.swagger.annotations.ApiModelProperty(value="人气",name="popularity") + private Integer popularity; + + @io.swagger.annotations.ApiModelProperty(value="作者",name="merchantId") + private Long merchantId; + @io.swagger.annotations.ApiModelProperty(value="",name="merchantName") + private String merchantName; + + @io.swagger.annotations.ApiModelProperty(value="业态",name="businessId") + private Long businessId; + @io.swagger.annotations.ApiModelProperty(value="",name="businessName") + private String businessName; + + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "columnCoupons") + private List columnCoupons; + + + public String getSalePriceStr() { + if(salePrice!=null) { + salePriceStr = new BigDecimal(salePrice).divide(new BigDecimal(100)).toString(); + } + return salePriceStr; + } + + public String getOrigPriceStr() { + if(origPrice!=null) { + origPriceStr = new BigDecimal(origPrice).divide(new BigDecimal(100)).toString(); + } + return origPriceStr; + } + +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/TtCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/TtCouponMapper.java new file mode 100644 index 000000000..468b69679 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/TtCouponMapper.java @@ -0,0 +1,38 @@ +package com.iformall.mapper; + +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.TtCoupon; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TtCouponMapper extends CommonMapper { + + List findList(TtCoupon coupon); + + TtCoupon selectById(Long id); + + int deleteById(Long id); + + /** + * 浏览数+1 + * @param id + * @return + */ + int addSeeCount(Long id); + + /** + * 购买数+1 + * @param id + * @return + */ + int addSellCount(Long id); + + /** + * 购买数-1 + * @param id + * @return + */ + int reduceSellCount(Long id); + +} diff --git a/mallinkService/src/main/resources/mapper/TtCouponMapper.xml b/mallinkService/src/main/resources/mapper/TtCouponMapper.xml new file mode 100644 index 000000000..4ac9d7cb8 --- /dev/null +++ b/mallinkService/src/main/resources/mapper/TtCouponMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + `id`, `tenant_id`, `parent_tenant_id`, `type`, `cover_img`, `cover_picture`, `detail_picture`, + `title`, `sub_title`, `video_id`, `video_time`, `html`, `is_landscape`, `is_payment`, + `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` + + + + where `is_del` = 0 + + + and `id` = #{id} + + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + and `type` = #{type} + + + + and `title` like concat('%', #{title},'%') + + + + and `is_landscape` = #{isLandscape} + + + + and `is_payment` = #{isPayment} + + + + and `is_preview` = #{isPreview} + + + + and `status` = #{status} + + + + and `create_date` between #{startdate} and #{enddate} + + + + and `business_id` = #{businessId} + + + + and `merchant_id` = #{merchantId} + + + + and id in + + #{idItem} + + + + order by ${sortColumns} + + + + + + + + update tt_coupon set is_del = 1, update_date=now() where id = #{id} + + + + update tt_coupon SET see_count = see_count+1, update_date=now() where id = #{id} + + + + update tt_coupon SET sell_count = sell_count+1, false_sell_count = false_sell_count+1, update_date=now() where id = #{id} + + + + update tt_coupon SET sell_count = sell_count-1, update_date=now() where id = #{id} + + + diff --git a/mallinkTTAdmin/src/main/resources/application.yml b/mallinkTTAdmin/src/main/resources/application.yml index ac85a1ef9..5343e86a1 100644 --- a/mallinkTTAdmin/src/main/resources/application.yml +++ b/mallinkTTAdmin/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 9001 + port: 9002 servlet: context-path: / From ba34a491673f8b9a7ea65f777514a2a5227063a3 Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 11 May 2021 11:15:00 +0800 Subject: [PATCH 2/3] tt --- .../iformall/service/impl/WxBusinessCircleOrderServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessCircleOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessCircleOrderServiceImpl.java index b827c4347..8a2164feb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessCircleOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessCircleOrderServiceImpl.java @@ -25,7 +25,7 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe private final Logger logger = LoggerFactory.getLogger(this.getClass()); - private static final String WX_CIRCLE_KEY = "CIRCLE:WX:"; + private final String WX_CIRCLE_KEY = "CIRCLE:WX:"; @Autowired RedisLock redisLock; From 60c8e0bedc1e14e5606e37c627a53f22e76bca53 Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 11 May 2021 12:10:07 +0800 Subject: [PATCH 3/3] tt --- .../com/iformall/service/impl/WxCallBackServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCallBackServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCallBackServiceImpl.java index 48ce4ab32..1fa8674e3 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCallBackServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCallBackServiceImpl.java @@ -4,6 +4,7 @@ import com.github.binarywang.wxpay.bean.businesscircle.PointsNotifyRequest; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; import com.iformall.domain.po.WxBusinessCircleOrder; +import com.iformall.mapper.WxBusinessCircleOrderMapper; import com.iformall.service.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,7 +26,7 @@ public class WxCallBackServiceImpl implements WxCallBackService { WxPayAccountService wxPayAccountService; @Autowired - WxBusinessCircleOrderService wxBusinessCircleOrderService; + WxBusinessCircleOrderMapper wxBusinessCircleOrderMapper; /** * @@ -46,7 +47,8 @@ public class WxCallBackServiceImpl implements WxCallBackService { try { String result = wxPayService.getBusinessCircleService().notifyPoints(request); logger.info("微信商圈同步积分请求结果----"+result); - wxBusinessCircleOrderService.updateIsPointsNotify(record); + record.setUpdateTime(new Date()); + wxBusinessCircleOrderMapper.updateIsPointsNotify(record); } catch (WxPayException e) { e.printStackTrace(); }