Forráskód Böngészése

Merge remote-tracking branch 'origin/saas' into saas

zouxuan 3 éve
szülő
commit
38569946b0

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysSuggestion.java

@@ -1,13 +1,16 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.SuggestionType;
+import com.ym.mec.common.entity.BaseEntity;
+
 import io.swagger.annotations.ApiModelProperty;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
  * 对应数据库表(sys_suggestion):
  */
-public class SysSuggestion {
+public class SysSuggestion extends BaseEntity {
 
 	/** 编号 */
 	private Long id;

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/StudentPaymentOrderVo.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.vo;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import org.apache.commons.lang3.StringUtils;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -80,7 +81,7 @@ public class StudentPaymentOrderVo {
         }
 
         public void setGoodsName(String goodsName) {
-            this.goodsName = OrderDetailTypeEnum.valueOf(goodsName).getMsg();
+            this.goodsName = StringUtils.isBlank(goodsName) ? null : OrderDetailTypeEnum.valueOf(goodsName).getMsg();
         }
 
         public BigDecimal getPrice() {

+ 13 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -30,6 +30,7 @@ import com.ym.mec.thirdparty.adapay.Payment;
 import com.ym.mec.thirdparty.yqpay.*;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -826,7 +827,18 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         Optional.ofNullable(orderNo)
                 .map(this::findOrderByOrderNo)
                 .orElseThrow(() -> new BizException("未查询到该订单数据!"));
-        return studentPaymentOrderDao.queryOrderDetail(orderNo);
+        StudentPaymentOrderVo voList = studentPaymentOrderDao.queryOrderDetail(orderNo);
+        if (Objects.nonNull(voList) && CollectionUtils.isNotEmpty(voList.getList())) {
+            List<StudentPaymentOrderVo.StudentPaymentDetailVo> collect = voList.getList().stream()
+                    .filter(d -> Objects.nonNull(d.getGoodsName()))
+                    .collect(Collectors.toList());
+            if (CollectionUtils.isEmpty(collect)) {
+                voList.setList(null);
+            } else {
+                voList.setList(collect);
+            }
+        }
+        return voList;
     }
 
 

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -1054,7 +1054,7 @@
         from student_payment_order as a
                  left join
              student_payment_order_detail as b on a.id_ = b.payment_order_id_
-        where order_no_ = #{orderNo};
+        where order_no_ = #{orderNo}
     </select>
 
 

+ 6 - 4
mec-biz/src/main/resources/config/mybatis/SysSuggestionMapper.xml

@@ -17,6 +17,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="client_type_" property="clientType"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -26,14 +27,14 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="SysSuggestion">
-		SELECT * FROM sys_suggestion ORDER BY id_
+		SELECT * FROM sys_suggestion where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysSuggestion" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO sys_suggestion (mobile_no_,title_,content_,user_id_,create_time_,client_type_,type_,url_)
-        VALUES(#{mobileNo},#{title},#{content},#{userId},now(),#{clientType},#{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{url})
+        INSERT INTO sys_suggestion (mobile_no_,title_,content_,user_id_,create_time_,client_type_,type_,url_,tenant_id_)
+        VALUES(#{mobileNo},#{title},#{content},#{userId},now(),#{clientType},#{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{url},#{tenantId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -62,7 +63,7 @@
                 type_ = #{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} ans tenant_id_ = #{tenantId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
@@ -72,6 +73,7 @@
 
     <sql id="queryCondition">
         <where>
+        	ss.tenant_id_ = #{tenantId}
             <if test="type!=null">
                 AND ss.type_ = #{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>