应用服务审核优化

This commit is contained in:
Wenchao Gong 2021-09-10 22:05:37 +08:00
parent 40d179fc9a
commit 5e7d11092c
8 changed files with 43 additions and 14 deletions

View File

@ -49,16 +49,16 @@ public class IscAppService implements Serializable {
*/ */
private String enabled; private String enabled;
/**
* 申请类型(0申请 1续期)
*/
private String applyType;
/** /**
* 审核状态0待审核 1审核通过 2驳回 * 审核状态0待审核 1审核通过 2驳回
*/ */
private String status; private String status;
/**
* 审核意见
*/
private String auditMind;
/** /**
* 虚拟地址 * 虚拟地址
*/ */

View File

@ -93,6 +93,12 @@ public class IscAppServiceBo extends BaseEntity {
@NotNull(message = "续期时长不能为空", groups = { AddGroup.class }) @NotNull(message = "续期时长不能为空", groups = { AddGroup.class })
private Integer renewalDuration; private Integer renewalDuration;
/**
* 申请类型(0申请 1续期)
*/
@NotBlank(message = "申请类型必填")
private String applyType;
/** /**
* 分页大小 * 分页大小

View File

@ -82,6 +82,12 @@ public class IscAppServiceVo {
@ApiModelProperty("审核状态0待审核 1审核通过 2驳回") @ApiModelProperty("审核状态0待审核 1审核通过 2驳回")
private String status; private String status;
/**
* 审核意见
*/
@ApiModelProperty("审核意见")
private String auditMind;
/** /**
* 虚拟地址 * 虚拟地址
*/ */

View File

@ -159,6 +159,7 @@ public class IscAppServiceApplyServiceImpl extends ServicePlusImpl<IscAppService
IscAppService updateData = null; IscAppService updateData = null;
if(IscConstants.AUDIT_PASS.equals(bo.getStatus())) { if(IscConstants.AUDIT_PASS.equals(bo.getStatus())) {
updateData = genAuditPassData(apply, appService, bo.getStatus()); updateData = genAuditPassData(apply, appService, bo.getStatus());
updateData.setAuditMind(bo.getRemark());
}else{ }else{
//如果 应用服务 状态为不通过 时需要同步状态 //如果 应用服务 状态为不通过 时需要同步状态
updateData = genAuditRejectData(appService, bo); updateData = genAuditRejectData(appService, bo);
@ -243,6 +244,7 @@ public class IscAppServiceApplyServiceImpl extends ServicePlusImpl<IscAppService
if(!IscConstants.AUDIT_PASS.equals(appService.getStatus())) { if(!IscConstants.AUDIT_PASS.equals(appService.getStatus())) {
IscAppService updateData = new IscAppService().setAppServiceId(appService.getAppServiceId()); IscAppService updateData = new IscAppService().setAppServiceId(appService.getAppServiceId());
updateData.setStatus(bo.getStatus()); updateData.setStatus(bo.getStatus());
updateData.setAuditMind(bo.getRemark());
return updateData; return updateData;
} }
return null; return null;

View File

@ -105,7 +105,6 @@ public class IscAppServiceServiceImpl extends ServicePlusImpl<IscAppServiceMappe
IscAppService add = BeanUtil.toBean(bo, IscAppService.class); IscAppService add = BeanUtil.toBean(bo, IscAppService.class);
validEntityBeforeSave(add); validEntityBeforeSave(add);
add.setStatus(IscConstants.AUDIT_WAIT); add.setStatus(IscConstants.AUDIT_WAIT);
add.setApplyType(IscConstants.APPLY_TYPE_APPLY);
add.setUserId(SecurityUtils.getUserId()); add.setUserId(SecurityUtils.getUserId());
boolean result = save(add); boolean result = save(add);
addApplyRecord(bo, IscConstants.APPLY_TYPE_APPLY, add.getAppServiceId()); addApplyRecord(bo, IscConstants.APPLY_TYPE_APPLY, add.getAppServiceId());
@ -120,12 +119,22 @@ public class IscAppServiceServiceImpl extends ServicePlusImpl<IscAppServiceMappe
IscAppService update = new IscAppService().setAppServiceId(bo.getAppServiceId()); IscAppService update = new IscAppService().setAppServiceId(bo.getAppServiceId());
validEntityBeforeSave(update); validEntityBeforeSave(update);
boolean result = true; boolean result = true;
if(!IscConstants.AUDIT_PASS.equals(appService.getStatus())) { boolean changeStatus = !IscConstants.AUDIT_PASS.equals(appService.getStatus());
boolean changeRemark = !IscConstants.APPLY_TYPE_RENEWAL.equals(bo.getApplyType());
if (changeStatus || changeRemark)
{
if (changeStatus)
{
update.setStatus(IscConstants.AUDIT_WAIT); update.setStatus(IscConstants.AUDIT_WAIT);
}
if (changeRemark)
{
update.setRemark(bo.getRemark());
}
result = updateById(update); result = updateById(update);
} }
String applyType = Objects.nonNull(bo.getRenewalDuration()) ? IscConstants.APPLY_TYPE_RENEWAL : String applyType = IscConstants.APPLY_TYPE_RENEWAL.equals(bo.getApplyType())
IscConstants.APPLY_TYPE_MODIFY; ? IscConstants.APPLY_TYPE_RENEWAL : IscConstants.APPLY_TYPE_MODIFY;
addApplyRecord(bo, applyType, bo.getAppServiceId()); addApplyRecord(bo, applyType, bo.getAppServiceId());
return result; return result;
} }
@ -189,8 +198,8 @@ public class IscAppServiceServiceImpl extends ServicePlusImpl<IscAppServiceMappe
entity.setRemark(appService.getRemark()); entity.setRemark(appService.getRemark());
switch (applyType) { switch (applyType) {
case IscConstants.APPLY_TYPE_APPLY: case IscConstants.APPLY_TYPE_APPLY:
entity.setRenewalDuration(appService.getRenewalDuration());
case IscConstants.APPLY_TYPE_MODIFY: case IscConstants.APPLY_TYPE_MODIFY:
entity.setRenewalDuration(appService.getRenewalDuration());
entity.setQuotaDays(appService.getQuotaDays()); entity.setQuotaDays(appService.getQuotaDays());
entity.setQuotaHours(appService.getQuotaHours()); entity.setQuotaHours(appService.getQuotaHours());
entity.setQuotaMinutes(appService.getQuotaMinutes()); entity.setQuotaMinutes(appService.getQuotaMinutes());

View File

@ -10,8 +10,8 @@
<result property="applicationId" column="application_id"/> <result property="applicationId" column="application_id"/>
<result property="userId" column="user_id"/> <result property="userId" column="user_id"/>
<result property="enabled" column="enabled"/> <result property="enabled" column="enabled"/>
<result property="applyType" column="apply_type"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="auditMind" column="audit_mind"/>
<result property="virtualAddr" column="virtual_addr"/> <result property="virtualAddr" column="virtual_addr"/>
<result property="endTime" column="end_time"/> <result property="endTime" column="end_time"/>
<result property="quotaDays" column="quota_days"/> <result property="quotaDays" column="quota_days"/>
@ -23,6 +23,7 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="remark" column="remark"/>
</resultMap> </resultMap>

View File

@ -184,7 +184,7 @@
>{{dict.dictLabel}}</el-radio> >{{dict.dictLabel}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="申请时长" prop="renewalDuration" v-if="this.applyType === 0 || this.applyType === 1"> <el-form-item label="申请时长" prop="renewalDuration" v-if="!(this.form.status == 1 && this.applyType == 2)">
<el-select v-model="form.renewalDuration" placeholder="请选择申请时长" clearable size="small"> <el-select v-model="form.renewalDuration" placeholder="请选择申请时长" clearable size="small">
<el-option key="1" label="1(月)" value="1"/> <el-option key="1" label="1(月)" value="1"/>
<el-option key="3" label="3(月)" value="3"/> <el-option key="3" label="3(月)" value="3"/>
@ -233,6 +233,10 @@
<dict-tag :options="statusOptions" :value="this.form.status"/> <dict-tag :options="statusOptions" :value="this.form.status"/>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" v-if="this.form.status == 2">
<el-col :span="6" class="col-title">审核意见</el-col>
<el-col :span="18" class="col-content">{{this.form.auditMind}}</el-col>
</el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6" class="col-title">启用状态</el-col> <el-col :span="6" class="col-title">启用状态</el-col>
<el-col :span="18" class="col-content"> <el-col :span="18" class="col-content">
@ -467,6 +471,7 @@ export default {
getAppservice(appServiceId).then(response => { getAppservice(appServiceId).then(response => {
this.loading = false; this.loading = false;
this.form = response.data; this.form = response.data;
this.form.remark = undefined;
this.form.status = this.form.status.split(","); this.form.status = this.form.status.split(",");
this.open = true; this.open = true;
this.title = "应用服务续期"; this.title = "应用服务续期";
@ -506,6 +511,7 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.buttonLoading = true; this.buttonLoading = true;
this.form.applyType = this.applyType;
this.form.status = this.form.status.join(","); this.form.status = this.form.status.join(",");
if (this.form.appServiceId != null) { if (this.form.appServiceId != null) {
updateAppservice(this.form).then(response => { updateAppservice(this.form).then(response => {

View File

@ -11,7 +11,6 @@ CREATE TABLE `isc_app_service` (
`application_id` bigint NULL DEFAULT NULL COMMENT '应用ID', `application_id` bigint NULL DEFAULT NULL COMMENT '应用ID',
`user_id` bigint NULL DEFAULT NULL COMMENT '用户ID', `user_id` bigint NULL DEFAULT NULL COMMENT '用户ID',
`enabled` char(1) NOT NULL COMMENT '启用状态0启用 1停用', `enabled` char(1) NOT NULL COMMENT '启用状态0启用 1停用',
`apply_type` char(1) DEFAULT NULL COMMENT '申请类型(0申请 1续期)',
`status` char(1) DEFAULT NULL COMMENT '审核状态0待审核 1审核通过 2驳回', `status` char(1) DEFAULT NULL COMMENT '审核状态0待审核 1审核通过 2驳回',
`virtual_addr` varchar(255) DEFAULT NULL COMMENT '虚拟地址', `virtual_addr` varchar(255) DEFAULT NULL COMMENT '虚拟地址',
`end_time` datetime(0) NULL DEFAULT NULL COMMENT '到期时间', `end_time` datetime(0) NULL DEFAULT NULL COMMENT '到期时间',