소스 검색

Merge branch 'feature/1204-tenant' into develop-new

yuanliang 1 년 전
부모
커밋
a8999f1fc7

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/tenant/vo/TenantActivationCodeVo.java

@@ -113,6 +113,9 @@ public class TenantActivationCodeVo {
         @ApiModelProperty("创建时间")
         private Date createTime;
 
+        @ApiModelProperty("发放时间")
+        private Date sendTime;
+
 
         public String jsonString() {
             return JSON.toJSONString(this);

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/TenantActivationCode.java

@@ -72,4 +72,8 @@ public class TenantActivationCode implements Serializable {
 	@TableField(value = "create_time_")
     private Date createTime;
 
+    @ApiModelProperty("发放时间")
+	@TableField(value = "send_time_")
+    private Date sendTime;
+
 }

+ 10 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantActivationCodeServiceImpl.java

@@ -158,6 +158,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
             boolean update = this.lambdaUpdate()
                     .set(TenantActivationCode::getSendStatus, EActivationCode.SEND.getCode())
                     .set(TenantActivationCode::getActivationPhone, idPhoneMap.get(studentId))
+                    .set(TenantActivationCode::getSendTime, new Date())
                     .eq(TenantActivationCode::getActivationStatus, false)
                     .eq(TenantActivationCode::getId, tenantActivationCodes.get(i).getId())
                     .update();
@@ -341,12 +342,19 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
         boolean update = this.lambdaUpdate()
                 .set(TenantActivationCode::getSendStatus, EActivationCode.WAIT)
                 .set(TenantActivationCode::getActivationPhone, "")
+                .set(TenantActivationCode::getSendTime, null)
                 .eq(TenantActivationCode::getId, activationCode.getId())
                 .eq(TenantActivationCode::getActivationStatus, false)
                 .eq(TenantActivationCode::getSendStatus, EActivationCode.SEND)
                 .update();
         if (!update) {
-            throw new BizException("激活码已经激活");
+            TenantActivationCode code = this.getById(activationCode.getId());
+            if (EActivationCode.WAIT.equals(code.getSendStatus())) {
+                throw new BizException("激活码已撤回");
+            }
+            if (Boolean.TRUE.equals(code.getActivationStatus())) {
+                throw new BizException("激活码已经激活");
+            }
         }
         com.yonge.cooleshow.auth.api.entity.SysUser sysUser = sysUserService.findUserByPhone(activationCode.getActivationPhone());
         if (sysUser != null) {
@@ -406,6 +414,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
         for (int i = 0; i < studentIdList.size(); i++) {
             TenantActivationCode tenantActivationCode = activationCodes.get(i);
             tenantActivationCode.setSendStatus(EActivationCode.SEND);
+            tenantActivationCode.setSendTime(new Date());
             tenantActivationCode.setActivationPhone(mapPhoneById.getOrDefault(studentIdList.get(i), ""));
             updates.add(tenantActivationCode);
         }

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantActivationCodeWrapper.java

@@ -151,6 +151,9 @@ public class TenantActivationCodeWrapper {
         @ApiModelProperty("购买数量")
         private Integer  purchaseQuantity;
 
+        @ApiModelProperty("发放时间")
+        private Date sendTime;
+
         public String jsonString() {
             return JSON.toJSONString(this);
         }

+ 0 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumPurchaseWrapper.java

@@ -41,9 +41,6 @@ public class TenantAlbumPurchaseWrapper {
         @ApiModelProperty("机构ID")
         private Long tenantId;
 
-        @ApiModelProperty(value = "排序规则,激活数排序:升序:active_quantity_ asc,逆序:active_quantity_ desc")
-        private String orderBy;
-
 
         @ApiModelProperty("采购状态 WAIT_PAY 待支付   PAID 已付款 CLOSE 已关闭")
         private String purchaseStatus;

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantInfoWrapper.java

@@ -49,6 +49,9 @@ public class TenantInfoWrapper {
         @ApiModelProperty("地区街道编码")
         private Integer regionCode;
 
+        @ApiModelProperty("启用/停用")
+        private Boolean enableFlag;
+
         public String getKeyword() {
             return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
         }

+ 1 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantActivationCodeMapper.xml

@@ -15,6 +15,7 @@
         , t.activation_user_id_ AS activationUserId
         , t.update_time_ AS updateTime
         , t.create_time_ AS createTime
+        , t.send_time_ AS sendTime
     </sql>
 
     <select id="selectPage"

+ 1 - 8
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantAlbumPurchaseMapper.xml

@@ -58,14 +58,7 @@
                 AND #{param.purchaseEndTime} >= t.create_time_
             </if>
         </where>
-        <choose>
-            <when test="param.orderBy != null and param.orderBy.trim() != ''">
-                order by #{param.orderBy}
-            </when>
-            <otherwise>
-                order by t.id_ desc
-            </otherwise>
-        </choose>
+        order by t.create_time_ desc
     </select>
     
 </mapper>

+ 3 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/TenantInfoMapper.xml

@@ -105,6 +105,9 @@
             <if test="param.regionCode != null">
                 and t.region_code_ = #{param.regionCode}
             </if>
+            <if test="param.enableFlag != null">
+                and t.enable_flag_ = #{param.enableFlag}
+            </if>
         </where>
         order by t.create_time_ desc
 	</select>