Selaa lähdekoodia

Merge branch 'zx_saas_rm_yqpay_0326' of http://git.dayaedu.com/yonge/mec into dev

zouxuan 2 kuukautta sitten
vanhempi
commit
8e3705dee9

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudTeacherOrderDao.java

@@ -92,7 +92,8 @@ public interface CloudTeacherOrderDao extends BaseDAO<Long, CloudTeacherOrder> {
 
     int updateOrderId(@Param("cloudTeacherOrderId")Integer cloudTeacherOrderId,
                       @Param("amount") BigDecimal amount,
-                      @Param("platformOrderId")Integer platformOrderId);
+                      @Param("platformOrderId")Integer platformOrderId,
+                      @Param("sendSmsFlag")Boolean sendSmsFlag);
 
     int findRecordCount(Map<String, Object> params);
 

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CloudTeacherStudent.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.ym.mec.biz.dal.enums.PeriodEnum;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -80,4 +81,7 @@ public class CloudTeacherStudent {
     private String cancelReason;
 
     private Date createTime;
+
+    @ApiModelProperty(value = "是否发送激活短信")
+    private Boolean sendSmsFlag;
 }

+ 6 - 113
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantOrderRecord.java

@@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -19,6 +20,7 @@ import java.util.Date;
  * @author hgw
  * @since 2021-12-20 10:08:28
  */
+@Data
 @ApiModel(value = "tenant_order_record-机构付款记录表")
 public class TenantOrderRecord implements Serializable {
     @TableId(value = "id_", type = IdType.AUTO)
@@ -80,6 +82,10 @@ public class TenantOrderRecord implements Serializable {
     @ApiModelProperty(value = "订单创建时间")
     private Date createdTime;
 
+    @ApiModelProperty(value = "是否发送激活短信")
+    @TableField("send_sms_flag_")
+    private Boolean sendSmsFlag;
+
     public DealStatusEnum getEnumOrderState() {
         switch (orderState) {
             case 0:
@@ -93,118 +99,5 @@ public class TenantOrderRecord implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getTenantId() {
-        return tenantId;
-    }
-
-    public void setTenantId(Integer tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    public String getTransNo() {
-        return transNo;
-    }
-
-    public void setTransNo(String transNo) {
-        this.transNo = transNo;
-    }
-
-    public String getOrderType() {
-        return orderType;
-    }
-
-    public void setOrderType(String orderType) {
-        this.orderType = orderType;
-    }
-
-    public String getPaymentChannel() {
-        return paymentChannel;
-    }
-
-    public void setPaymentChannel(String paymentChannel) {
-        this.paymentChannel = paymentChannel;
-    }
-
-    public String getPayChannel() {
-        return payChannel;
-    }
-
-    public void setPayChannel(String payChannel) {
-        this.payChannel = payChannel;
-    }
-
-    public BigDecimal getExpectAmount() {
-        return expectAmount;
-    }
-
-    public void setExpectAmount(BigDecimal expectAmount) {
-        this.expectAmount = expectAmount;
-    }
-
-    public BigDecimal getActualAmount() {
-        return actualAmount;
-    }
-
-    public void setActualAmount(BigDecimal actualAmount) {
-        this.actualAmount = actualAmount;
-    }
-
-    public String getMerNos() {
-        return merNos;
-    }
-
-    public void setMerNos(String merNos) {
-        this.merNos = merNos;
-    }
-
-    public Integer getOrderState() {
-        return orderState;
-    }
-
-    public void setOrderState(Integer orderState) {
-        this.orderState = orderState;
-    }
-
-    public Date getPayDate() {
-        return payDate;
-    }
-
-    public void setPayDate(Date payDate) {
-        this.payDate = payDate;
-    }
-
-    public Date getPayTime() {
-        return payTime;
-    }
-
-    public void setPayTime(Date payTime) {
-        this.payTime = payTime;
-    }
-
-    public Date getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Date createdTime) {
-        this.createdTime = createdTime;
-    }
-
-
 }
 

+ 5 - 103
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/TenantOrderRecordVo.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.vo;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -12,6 +13,7 @@ import java.util.Date;
  * @author hgw
  * Created by 2021-12-21
  */
+@Data
 public class TenantOrderRecordVo implements Serializable {
 
     @ApiModelProperty(value = "机构名称")
@@ -68,107 +70,7 @@ public class TenantOrderRecordVo implements Serializable {
     @ApiModelProperty(value = "订单创建时间")
     private Date createdTime;
 
-    public String getTenantName() {
-        return tenantName;
-    }
-
-    public void setTenantName(String tenantName) {
-        this.tenantName = tenantName;
-    }
-
-    public Integer getTenantId() {
-        return tenantId;
-    }
-
-    public void setTenantId(Integer tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    public String getTransNo() {
-        return transNo;
-    }
-
-    public void setTransNo(String transNo) {
-        this.transNo = transNo;
-    }
-
-    public String getOrderType() {
-        return orderType;
-    }
-
-    public void setOrderType(String orderType) {
-        this.orderType = orderType;
-    }
-
-    public String getPaymentChannel() {
-        return paymentChannel;
-    }
-
-    public void setPaymentChannel(String paymentChannel) {
-        this.paymentChannel = paymentChannel;
-    }
-
-    public String getPayChannel() {
-        return payChannel;
-    }
-
-    public void setPayChannel(String payChannel) {
-        this.payChannel = payChannel;
-    }
-
-    public BigDecimal getExpectAmount() {
-        return expectAmount;
-    }
-
-    public void setExpectAmount(BigDecimal expectAmount) {
-        this.expectAmount = expectAmount;
-    }
-
-    public BigDecimal getActualAmount() {
-        return actualAmount;
-    }
-
-    public void setActualAmount(BigDecimal actualAmount) {
-        this.actualAmount = actualAmount;
-    }
-
-    public Integer getOrderState() {
-        return orderState;
-    }
-
-    public void setOrderState(Integer orderState) {
-        this.orderState = orderState;
-    }
-
-    public Date getPayDate() {
-        return payDate;
-    }
-
-    public void setPayDate(Date payDate) {
-        this.payDate = payDate;
-    }
-
-    public Date getPayTime() {
-        return payTime;
-    }
-
-    public void setPayTime(Date payTime) {
-        this.payTime = payTime;
-    }
-
-    public Date getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Date createdTime) {
-        this.createdTime = createdTime;
-    }
+    @ApiModelProperty(value = "是否发送激活短信")
+    @TableField("send_sms_flag_")
+    private Boolean sendSmsFlag;
 }

+ 7 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudTeacherOrderServiceImpl.java

@@ -257,7 +257,7 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
         payMap.put("orderNo", orderNo);
         TenantOrderRecord record = tenantInfoService.createOrderRecord(tenantId, payAmount, orderNo, tenantEnum, orderState, WrapperUtil.toStr(payMap, "routingMerNos"));
         for (CloudTeacherStudent cts : cloudTeacherStudents) {
-            if (cloudTeacherOrderDao.updateOrderId(cts.getCloudTeacherOrderId(), cts.getAmount(), record.getId()) <= 0) {
+            if (cloudTeacherOrderDao.updateOrderId(cts.getCloudTeacherOrderId(), cts.getAmount(), record.getId(),cts.getSendSmsFlag()) <= 0) {
                 throw new Exception("更新订单失败");
             }
         }
@@ -272,11 +272,15 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
     @Override
     public int sendSms(TenantOrderRecord record) {
         List<Mapper> orderUsers = cloudTeacherOrderDao.findUserNameByOrderId(record.getId());
-        Map<Integer, String> userPhones = new HashMap<>();
+        if (CollectionUtils.isEmpty(orderUsers)) {
+            return 0;
+        }
         for (Mapper mapper : orderUsers) {
+            Map<Integer, String> userPhones = new HashMap<>(1);
             userPhones.put((Integer) mapper.getKey(), mapper.getValue().toString());
+            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.CLOUD_TEACHER_ORDER_SUCCESS,
+                    userPhones, null, 0, null, null,mapper.getType());
         }
-        sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.CLOUD_TEACHER_ORDER_SUCCESS, userPhones, null, 0, null, null);
         return 0;
     }
 

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/CloudTeacherOrderMapper.xml

@@ -134,11 +134,13 @@
     <resultMap type="com.ym.mec.biz.dal.dto.Mapper" id="mapper">
         <result column="userId" property="key"/>
         <result column="phone" property="value"/>
+        <result column="type" property="type"/>
     </resultMap>
     <select id="findUserNameByOrderId" resultMap="mapper">
-        select su.id_ as userId, su.phone_ as phone from cloud_teacher_order cto
+        select su.id_ as userId, su.phone_ as phone,mrs.name_ type from cloud_teacher_order cto
+        left join member_rank_setting mrs ON mrs.id_ = cto.level_
         left join sys_user su on cto.student_id_ = su.id_
-        where platform_order_id_ = #{platformOrderId} and su.del_flag_ = '0'
+        where platform_order_id_ = #{platformOrderId} and su.del_flag_ = '0' and cto.send_sms_flag_ = 1
     </select>
 
     <update id="updateOrderStatusOK">
@@ -156,6 +158,11 @@
     <update id="updateOrderId">
         update cloud_teacher_order
         set platform_order_id_ = #{platformOrderId} , pay_amount_ = #{amount}
+        <set>
+            <if test="sendSmsFlag != null">
+                ,send_sms_flag_ = #{sendSmsFlag}
+            </if>
+        </set>
         where id_ = #{cloudTeacherOrderId}
     </update>
 

+ 7 - 4
mec-biz/src/main/resources/config/mybatis/TenantOrderRecordMapper.xml

@@ -16,11 +16,13 @@
         <result column="pay_date_" jdbcType="TIMESTAMP" property="payDate"/>
         <result column="pay_time_" jdbcType="TIMESTAMP" property="payTime"/>
         <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
+        <result column="send_sms_flag_" property="sendSmsFlag"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id_
-        , tenant_id_, order_no_, trans_no_, order_type_, payment_channel_, pay_channel_, expect_amount, actual_amount, mer_nos_, order_state_, pay_date_, pay_time_, created_time_
+        , tenant_id_, order_no_, trans_no_, order_type_, payment_channel_, pay_channel_,
+        expect_amount, actual_amount, mer_nos_, order_state_, pay_date_, pay_time_, created_time_,send_sms_flag_
     </sql>
     
     <select id="getLockedById" resultMap="BaseResultMap">
@@ -30,12 +32,12 @@
     <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
             parameterType="com.ym.mec.biz.dal.entity.TenantOrderRecord">
         insert into tenant_order_record(tenant_id_, order_no_, trans_no_, order_type_, payment_channel_, pay_channel_,
-        expect_amount, actual_amount, mer_nos_,order_state_, pay_date_, pay_time_, created_time_)
+        expect_amount, actual_amount, mer_nos_,order_state_, pay_date_, pay_time_, created_time_,send_sms_flag_)
         values
         <foreach collection="entities" item="entity" separator=",">
             (#{entity.tenantId}, #{entity.orderNo}, #{entity.transNo}, #{entity.orderType}, #{entity.paymentChannel},
             #{entity.payChannel}, #{entity.expectAmount}, #{entity.actualAmount}, #{entity.merNos},#{entity.orderState},
-            #{entity.payDate}, #{entity.payTime}, #{entity.createdTime})
+            #{entity.payDate}, #{entity.payTime}, #{entity.createdTime},#{entity.sendSmsFlag})
         </foreach>
     </insert>
 
@@ -54,7 +56,8 @@
             a.order_state_ as orderState,
             a.pay_date_ as payDate,
             a.pay_time_ as payTime,
-            a.created_time_ as createdTime
+            a.created_time_ as createdTime,
+            a.send_sms_flag_ as sendSmsFlag
         FROM
             tenant_order_record AS a
                 LEFT JOIN tenant_info AS b