Bläddra i källkod

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

yanite 3 år sedan
förälder
incheckning
b0704f57bd

+ 0 - 11
cms/src/main/java/com/ym/mec/cms/controller/queryinfo/NewsInformationQueryInfo.java

@@ -25,9 +25,6 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@ApiModelProperty(value = "备注", required = false)
 	private String memo;
 	
-	@ApiModelProperty(value = "租客编号", required = false)
-	private Integer tenantId;
-	
 	@ApiModelProperty(value = "声部编号", required = false)
 	private Integer subjectId;
 	
@@ -93,14 +90,6 @@ public class NewsInformationQueryInfo extends QueryInfo {
 		this.memo = memo;
 	}
 
-	public Integer getTenantId() {
-		return tenantId;
-	}
-
-	public void setTenantId(Integer tenantId) {
-		this.tenantId = tenantId;
-	}
-
 	public String getClientName() {
 		return clientName;
 	}

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantProductInfo.java

@@ -18,6 +18,11 @@ import java.util.Date;
  */
 @ApiModel(value = "机构产品设置表")
 public class TenantProductInfo implements Serializable {
+
+    public static final String MONTH = "MONTH";
+
+    public static final String YEAR = "YEAR";
+
     @TableId(value = "id_", type = IdType.AUTO)
     @ApiModelProperty(value = "主键")
     private Integer id;

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

@@ -24,6 +24,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageUtil;
 import com.ym.mec.common.page.WrapperUtil;
 import com.ym.mec.common.service.IdGeneratorService;
+import com.ym.mec.thirdparty.yqpay.DateUtils;
 import com.ym.mec.thirdparty.yqpay.Msg;
 import org.apache.commons.collections.CollectionUtils;
 import org.joda.time.LocalDate;
@@ -317,6 +318,17 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         assetsInfo.setFrozenAmount(BigDecimal.ZERO);
         assetsInfo.setCreatedTime(new Date());
         assetsInfoService.save(assetsInfo);
+        //修改有效期
+        Date expiryDate;
+        if (TenantProductInfo.MONTH.equals(productInfo.getExpiryUnit())) {
+            expiryDate = DateUtils.addMonths(new Date(), productInfo.getExpiryCount());
+        } else if (TenantProductInfo.YEAR.equals(productInfo.getExpiryUnit())) {
+            expiryDate = DateUtils.addYears(new Date(), productInfo.getExpiryCount());
+        } else {
+            throw new BizException("产品信息异常!开通失败!");
+        }
+        productInfo.setExpiryDate(expiryDate);
+        tenantProductInfoService.updateById(productInfo);
         //释放锁
         bucket.delete();
     }