Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

dongke 1 год назад
Родитель
Сommit
c763bbb23d
21 измененных файлов с 71 добавлено и 5 удалено
  1. 2 0
      src/main/java/com/dk/oauth/mapper/integral/CouponSendMapper.xml
  2. 10 3
      src/main/java/com/dk/oauth/mapper/integral/CouponUseMapper.xml
  3. 7 0
      src/main/java/com/dk/oauth/model/VO/integral/CouponReceiveVO.java
  4. 8 0
      src/main/java/com/dk/oauth/model/VO/integral/CouponUseVO.java
  5. 1 0
      src/main/java/com/dk/oauth/model/pojo/integral/CouponReceive.java
  6. 1 0
      src/main/java/com/dk/oauth/model/pojo/integral/CouponSend.java
  7. 8 1
      src/main/java/com/dk/oauth/model/pojo/integral/CouponUse.java
  8. 1 0
      src/main/java/com/dk/oauth/model/pojo/integral/Integral.java
  9. 1 0
      src/main/java/com/dk/oauth/model/pojo/integral/IntegralItem.java
  10. 1 0
      src/main/java/com/dk/oauth/model/pojo/integral/IntegralShare.java
  11. 1 0
      src/main/java/com/dk/oauth/model/pojo/integral/SignRecord.java
  12. 8 0
      src/main/java/com/dk/oauth/model/query/integral/CouponUseQuery.java
  13. 2 0
      src/main/java/com/dk/oauth/model/query/integral/IntegralItemQuery.java
  14. 1 0
      src/main/java/com/dk/oauth/model/query/integral/IntegralQuery.java
  15. 2 0
      src/main/java/com/dk/oauth/model/query/integral/IntegralShareQuery.java
  16. 2 0
      src/main/java/com/dk/oauth/model/query/integral/SignRecordQuery.java
  17. 3 0
      src/main/java/com/dk/oauth/model/response/integral/CouponSendResponse.java
  18. 7 0
      src/main/java/com/dk/oauth/model/response/integral/CouponUseResponse.java
  19. 1 0
      src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java
  20. 3 1
      src/main/java/com/dk/oauth/service/integral/CouponReceiveService.java
  21. 1 0
      src/main/java/com/dk/oauth/service/integral/SignRecordService.java

+ 2 - 0
src/main/java/com/dk/oauth/mapper/integral/CouponSendMapper.xml

@@ -36,6 +36,7 @@
         <result column="user_num" property="userNum"/>
         <result column="flg_valid" property="flgValid"/>
         <result column="cp_name" property="cpName"/>
+        <result column="nowDate" property="nowDate"/>
         <result column="coupon_name" property="couponName"/>
         <result column="send_staff" property="sendStaff"/>
         <result column="coupon_receive_count" property="couponReceiveCount"/>
@@ -105,6 +106,7 @@
         <include refid="Base_Column_List_Response"/>
         ,tac.cp_name
         ,tmc.coupon_name
+        ,NOW() as "nowDate"
         ,(select count(tmcr.send_id) from dkic_a.t_mst_coupon_receive tmcr where tmcr.send_id = tmcs.send_id ) coupon_receive_count
         FROM dkic_a.t_mst_coupon_send tmcs
         left join dkic_a.t_a_company tac on tac.cp_id = tmcs.cp_id

+ 10 - 3
src/main/java/com/dk/oauth/mapper/integral/CouponUseMapper.xml

@@ -6,12 +6,12 @@
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
         use_id, cp_id, send_id, coupon_id, use_valid_days, receive_date, use_date, coupon_status, receive_user,
-        flg_valid,use_staff
+        flg_valid,use_staff,discount
     </sql>
     <!-- 通用查询列Response -->
     <sql id="Base_Column_List_Response">
         tmcu.use_id, tmcu.cp_id, tmcu.send_id, tmcu.coupon_id, tmcu.use_valid_days, tmcu.receive_date, tmcu.use_date,
-        tmcu.coupon_status, tmcu.receive_user, tmcu.flg_valid,tmcu.use_staff
+        tmcu.coupon_status, tmcu.receive_user, tmcu.flg_valid,tmcu.use_staff,tmcu.discount
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -27,6 +27,7 @@
         <result column="receive_user" property="receiveUser" typeHandler="UuidTypeHandler"/>
         <result column="flg_valid" property="flgValid"/>
         <result column="use_staff" property="useStaff"/>
+        <result column="discount" property="discount"/>
 
     </resultMap>
     <!-- 通用查询映射结果Response -->
@@ -44,6 +45,8 @@
         <result column="coupon_status" property="couponStatus"/>
         <result column="receive_user" property="receiveUser" typeHandler="UuidTypeHandler"/>
         <result column="flg_valid" property="flgValid"/>
+        <result column="staff_name" property="useCouponUser"/>
+        <result column="trade_type" property="tradeType" />
     </resultMap>
 
 
@@ -99,11 +102,15 @@
         SELECT
         <include refid="Base_Column_List_Response"/>
         ,tmc.coupon_name
-        ,tmc.discount
+        ,tmcu.discount
         ,tac.cp_name
+        ,tct.staff_name
+        ,sys.f_get_name_i18n(tdk.kind_name_i18n, #{i18n}) as "trade_type"
         FROM dkic_a.t_mst_coupon_use tmcu
         left join dkic_a.t_mst_coupon tmc on tmc.coupon_id = tmcu.coupon_id
         left join dkic_a.t_a_company tac on tac.cp_id = tmcu.cp_id
+        left join dkic_a.t_cp_trade tct on tct.coupon_use_id = tmcu.use_id
+        left join sys.t_data_kind tdk ON tct.trade_type = tdk.kind_code
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}

+ 7 - 0
src/main/java/com/dk/oauth/model/VO/integral/CouponReceiveVO.java

@@ -16,6 +16,7 @@ import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
@@ -115,6 +116,12 @@ public class CouponReceiveVO  {
     @ApiModelProperty(value = "发出的员工")
     private String staffName;
 
+    /**
+     * 折扣
+     */
+    @ApiModelProperty(value = "折扣")
+    private BigDecimal discount;
+
 
     private static final long serialVersionUID = 1L;
 

+ 8 - 0
src/main/java/com/dk/oauth/model/VO/integral/CouponUseVO.java

@@ -19,6 +19,7 @@ import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 
@@ -131,6 +132,13 @@ public class CouponUseVO{
     @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
     private Boolean flgValid;
 
+    /**
+     * 折扣
+     */
+    @Excel(name = "折扣")
+    @ApiModelProperty(value = "折扣")
+    private BigDecimal discount;
+
 
     /*
      * 相关属性

+ 1 - 0
src/main/java/com/dk/oauth/model/pojo/integral/CouponReceive.java

@@ -50,6 +50,7 @@ public class CouponReceive extends PageInfo<CouponReceive> implements Serializab
      * 公司ID
      */
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 1 - 0
src/main/java/com/dk/oauth/model/pojo/integral/CouponSend.java

@@ -45,6 +45,7 @@ public class CouponSend extends PageInfo<CouponSend> implements Serializable {
      * 公司ID
      */
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 8 - 1
src/main/java/com/dk/oauth/model/pojo/integral/CouponUse.java

@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.alibaba.fastjson.JSONObject;
 
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.util.List;
 import java.time.LocalDateTime;
@@ -51,6 +52,7 @@ public class CouponUse extends PageInfo<CouponUse> implements Serializable {
      * 公司ID
      */
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 
@@ -130,7 +132,12 @@ public class CouponUse extends PageInfo<CouponUse> implements Serializable {
     @ApiModelProperty(value = "积分")
     private Integer integral;
 
-
+    /**
+     * 折扣
+     */
+    @Excel(name = "折扣")
+    @ApiModelProperty(value = "折扣")
+    private BigDecimal discount;
 
     /**
      * 有效标识 (1:正常 0:停用)

+ 1 - 0
src/main/java/com/dk/oauth/model/pojo/integral/Integral.java

@@ -41,6 +41,7 @@ public class Integral extends PageInfo<Integral> implements Serializable {
      */
 //    @TableId(value = "cp_id", type = IdType.AUTO)
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 1 - 0
src/main/java/com/dk/oauth/model/pojo/integral/IntegralItem.java

@@ -67,6 +67,7 @@ public class IntegralItem extends PageInfo<IntegralItem> implements Serializable
      */
     @Excel(name = "公司ID")
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 1 - 0
src/main/java/com/dk/oauth/model/pojo/integral/IntegralShare.java

@@ -51,6 +51,7 @@ public class IntegralShare extends PageInfo<IntegralShare> implements Serializab
      * 公司ID
      */
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 1 - 0
src/main/java/com/dk/oauth/model/pojo/integral/SignRecord.java

@@ -61,6 +61,7 @@ public class SignRecord extends PageInfo<SignRecord> implements Serializable {
      */
     @Excel(name = "公司ID")
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 8 - 0
src/main/java/com/dk/oauth/model/query/integral/CouponUseQuery.java

@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 
@@ -141,6 +142,13 @@ public class CouponUseQuery extends PageInfo<CouponUseQuery>  {
     @ApiModelProperty(value = "优惠券名称")
     private String couponName;
 
+    /**
+     * 折扣
+     */
+    @Excel(name = "折扣")
+    @ApiModelProperty(value = "折扣")
+    private BigDecimal discount;
+
 
     private static final long serialVersionUID = 1L;
 

+ 2 - 0
src/main/java/com/dk/oauth/model/query/integral/IntegralItemQuery.java

@@ -1,6 +1,7 @@
 package com.dk.oauth.model.query.integral;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
@@ -60,6 +61,7 @@ public class IntegralItemQuery extends PageInfo<IntegralItemQuery>  {
      */
     @Excel(name = "公司ID")
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 1 - 0
src/main/java/com/dk/oauth/model/query/integral/IntegralQuery.java

@@ -1,6 +1,7 @@
 package com.dk.oauth.model.query.integral;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
 import com.dk.common.model.pojo.PageInfo;

+ 2 - 0
src/main/java/com/dk/oauth/model/query/integral/IntegralShareQuery.java

@@ -1,6 +1,7 @@
 package com.dk.oauth.model.query.integral;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
@@ -43,6 +44,7 @@ public class IntegralShareQuery extends PageInfo<IntegralShareQuery>  {
      * 公司ID
      */
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 2 - 0
src/main/java/com/dk/oauth/model/query/integral/SignRecordQuery.java

@@ -1,6 +1,7 @@
 package com.dk.oauth.model.query.integral;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.dk.common.infrastructure.handler.TimestampTypeHandler;
 import com.dk.common.infrastructure.handler.UuidTypeHandler;
@@ -45,6 +46,7 @@ public class SignRecordQuery extends PageInfo<SignRecordQuery>{
      */
     @Excel(name = "公司ID")
     @ApiModelProperty(value = "公司ID")
+    @TableField(fill = FieldFill.INSERT)
     private Integer cpId;
 
 

+ 3 - 0
src/main/java/com/dk/oauth/model/response/integral/CouponSendResponse.java

@@ -130,6 +130,9 @@ public class CouponSendResponse {
     @ApiModelProperty(value = "优惠券名称")
     private String couponName;
 
+    @Excel(name = "当前时间")
+    @ApiModelProperty(value = "当前时间")
+    private String nowDate;
 
 
     private static final long serialVersionUID = 1L;

+ 7 - 0
src/main/java/com/dk/oauth/model/response/integral/CouponUseResponse.java

@@ -151,6 +151,13 @@ public class CouponUseResponse {
     @ApiModelProperty(value = "优惠券名称")
     private String couponName;
 
+    @Excel(name = "优惠劵使用者")
+    @ApiModelProperty(value = "优惠劵使用者")
+    private String useCouponUser;
+
+    @Excel(name = "优惠劵使用类型")
+    @ApiModelProperty(value = "优惠劵使用类型")
+    private String tradeType;
     /**
      * 折扣
      */

+ 1 - 0
src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

@@ -279,6 +279,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
 
         //  来源公司Id 分享的截止日期时间 是否超过 当前的日期时间 说明过期了,过期不加积分 240724
         log.info("邀请分享的记录:原公司id:{},截止日期:{},当前时间:{},", companyVO.getCpIdFrom(), companyVO.getShareEndDate(), LocalDateTime.now());
+        log.info("邀请分享的记录:公司记录:{}", companyVO);
         if (companyVO.getCpIdFrom() != null && companyVO.getShareEndDate() != null
                 && companyVO.getShareEndDate().compareTo(LocalDateTime.now()) > 0) {
             // 积分策略 share_reg_integral	 分享注册积分

+ 3 - 1
src/main/java/com/dk/oauth/service/integral/CouponReceiveService.java

@@ -87,7 +87,7 @@ public class CouponReceiveService extends BaseService<CouponReceive> {
         // 限制助力链接发出本人不可给自己助力  2024/08/01 刘尧
         UserLogin userLogin = userMapper.selectById(couponReceiveVO.getUserIdForm());
 
-        if (userLogin.getUserWxid().equals(couponReceiveVO.getUserWxid())) {
+        if (userLogin != null && userLogin.getUserWxid().equals(couponReceiveVO.getUserWxid())) {
             //助力链接发出者不能为自己助力
             throw new BaseBusinessException(ErrorCodeEnum.USER_POWER_OWN.getCode(), ErrorCodeEnum.USER_POWER_OWN.getMessage());
         }
@@ -152,6 +152,8 @@ public class CouponReceiveService extends BaseService<CouponReceive> {
                     couponUse.setReceiveUser(couponReceiveVO.getReceiveUser());
                     //  使用员工-发出的员工是同一个字段
                     couponUse.setUseStaff(couponReceiveVO.getStaffName());
+                    //   折扣
+                    couponUse.setDiscount(couponReceiveVO.getDiscount());
                     couponUseMapper.insert(couponUse);
                     //endregion
 

+ 1 - 0
src/main/java/com/dk/oauth/service/integral/SignRecordService.java

@@ -87,6 +87,7 @@ public class SignRecordService extends BaseService<SignRecord> {
         IntegralTacticResponse integralTactic = integralTacticResponses.get(0);
         // 更新签到表
         SignRecordQuery signRecordQuery = new SignRecordQuery();
+        signRecordQuery.setCpId(signRecordVO.getCpId());
         signRecordQuery.setUserId(signRecordVO.getUserId());
         signRecordQuery.setFlgValid(true);
         List<SignRecordResponse> signRecordResponses = signRecordMapper.selectByCond(signRecordQuery);