浏览代码

app版本管理

master
huminghao 2 天前
父节点
当前提交
28f3fe1b7e

+ 2
- 1
gly-base-core/src/main/java/cn/com/taiji/core/entity/comm/CommonAppVersion.java 查看文件

package cn.com.taiji.core.entity.comm; package cn.com.taiji.core.entity.comm;


import cn.com.taiji.common.entity.StringPropertyUUIDEntity; import cn.com.taiji.common.entity.StringPropertyUUIDEntity;
import cn.com.taiji.core.entity.AbstractStringPropertyUUIDEntity;
import cn.com.taiji.core.entity.dict.EnableStatus; import cn.com.taiji.core.entity.dict.EnableStatus;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.hibernate.annotations.Where;


import javax.persistence.*; import javax.persistence.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Getter @Getter
@Entity @Entity
@Table(name = "COMM_APP_VERSION") @Table(name = "COMM_APP_VERSION")
@Where(clause = "DELETED = 0")
public class CommonAppVersion extends StringPropertyUUIDEntity { public class CommonAppVersion extends StringPropertyUUIDEntity {


@Column(name = "RELEASE_TIME") @Column(name = "RELEASE_TIME")

+ 2
- 0
gly-base-core/src/main/java/cn/com/taiji/core/entity/managew/NoticeFlash.java 查看文件

import cn.com.taiji.core.entity.dict.operation.TriggerType; import cn.com.taiji.core.entity.dict.operation.TriggerType;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.hibernate.annotations.Where;


import java.time.LocalDateTime; import java.time.LocalDateTime;
import javax.persistence.*; import javax.persistence.*;
@Getter @Getter
@Setter @Setter
@Table(name = "MANAGEW_NOTICE_FLASH") @Table(name = "MANAGEW_NOTICE_FLASH")
@Where(clause = "DELETED = 0")
public class NoticeFlash extends AbstractStringPropertyUUIDEntity { public class NoticeFlash extends AbstractStringPropertyUUIDEntity {


@Column(name = "TITLE") @Column(name = "TITLE")

+ 1
- 1
gly-base-core/src/main/java/cn/com/taiji/core/repo/request/operation/AppVersionPageRequest.java 查看文件



@Override @Override
public HqlBuilder toSelectHql() { public HqlBuilder toSelectHql() {
HqlBuilder hql = new HqlBuilder("from " + CommonAppVersion.class.getName() + " where 1=1 and deleted = 0");
HqlBuilder hql = new HqlBuilder("from " + CommonAppVersion.class.getName() + " where 1=1");
hql.append(" and version like :version ", like(version)); hql.append(" and version like :version ", like(version));
hql.append(" and status = :status ", status); hql.append(" and status = :status ", status);
hql.append(" and releaseTime >= :startTime ", startTime); hql.append(" and releaseTime >= :startTime ", startTime);

+ 2
- 1
zhywpt-app-managew/src/main/java/cn/com/taiji/managew/dto/operation/appVersion/AppVersionUpdateStatusRequestDTO.java 查看文件

import lombok.Setter; import lombok.Setter;


import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;


@Setter @Setter
@Getter @Getter
private String id; private String id;


@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
@NotBlank(message = "状态不能为空")
@NotNull(message = "状态不能为空")
private EnableStatus status; private EnableStatus status;





+ 6
- 4
zhywpt-app-managew/src/main/java/cn/com/taiji/managew/manager/operation/AppVersionManagerImpl.java 查看文件

if (appVersion == null){ if (appVersion == null){
throw new ManagerException("未获取到该版本数据"); throw new ManagerException("未获取到该版本数据");
} }
CommonAppVersion version = appVersionRepo.findByVersion(dto.getVersion());
if (version != null){
throw new ManagerException("当前版本已存在");
if (appVersion.getVersion() != dto.getVersion()){
CommonAppVersion version = appVersionRepo.findByVersion(dto.getVersion());
if (version != null){
throw new ManagerException("当前版本已存在");
}
} }
BeanTools.copyProperties(dto, appVersion); BeanTools.copyProperties(dto, appVersion);
appVersion.setUpdateTime(LocalDateTime.now()); appVersion.setUpdateTime(LocalDateTime.now());
if (appVersion.getStatus() == EnableStatus.ENABLE){ if (appVersion.getStatus() == EnableStatus.ENABLE){
throw new ManagerException("该版本启用状态,不能删除"); throw new ManagerException("该版本启用状态,不能删除");
} }
appVersion.setDeleted(false);
appVersion.setDeleted(true);
appVersionRepo.persist(appVersion); appVersionRepo.persist(appVersion);
//日志 //日志
persistOperateLog(OperateType.APP_VERSION_DELETE, appVersion.getId(), dto.getOrderSource(), findOpenIdByToken(dto.getAccessToken()), "APP版本删除"); persistOperateLog(OperateType.APP_VERSION_DELETE, appVersion.getId(), dto.getOrderSource(), findOpenIdByToken(dto.getAccessToken()), "APP版本删除");

正在加载...
取消
保存