优化:续费管理功能
This commit is contained in:
@@ -4,21 +4,18 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.entity.AppUser;
|
||||
import com.gxwebsoft.oa.service.AppService;
|
||||
import com.gxwebsoft.oa.entity.App;
|
||||
import com.gxwebsoft.oa.param.AppParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.entity.App;
|
||||
import com.gxwebsoft.oa.entity.AppUser;
|
||||
import com.gxwebsoft.oa.param.AppParam;
|
||||
import com.gxwebsoft.oa.service.AppService;
|
||||
import com.gxwebsoft.oa.service.AppUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -56,6 +53,10 @@ public class AppController extends BaseController {
|
||||
param.setAppIds(collect);
|
||||
}
|
||||
});
|
||||
// 过滤续费提醒参数
|
||||
if (param.getAppStatus() != null && param.getAppStatus().equals("续费提醒")) {
|
||||
param.setAppStatus(null);
|
||||
}
|
||||
// 使用关联查询
|
||||
return success(appService.pageRel(param));
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.gxwebsoft.oa.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.*;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.oa.entity.App;
|
||||
import com.gxwebsoft.oa.entity.AppRenew;
|
||||
import com.gxwebsoft.oa.param.AppRenewParam;
|
||||
import com.gxwebsoft.oa.service.AppRenewService;
|
||||
import com.gxwebsoft.oa.service.AppService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -24,6 +26,8 @@ import java.util.List;
|
||||
public class AppRenewController extends BaseController {
|
||||
@Resource
|
||||
private AppRenewService appRenewService;
|
||||
@Resource
|
||||
private AppService appService;
|
||||
|
||||
@ApiOperation("分页查询续费管理")
|
||||
@GetMapping("/page")
|
||||
@@ -55,6 +59,13 @@ public class AppRenewController extends BaseController {
|
||||
appRenew.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (appRenewService.save(appRenew)) {
|
||||
// 更新到期时间
|
||||
if (appRenew.getStatus().equals(0)) {
|
||||
App app = appService.getById(appRenew.getAppId());
|
||||
app.setExpirationTime(appRenew.getEndTime());
|
||||
app.setShowExpiration(true);
|
||||
appService.updateById(app);
|
||||
}
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
|
||||
@@ -175,6 +175,9 @@ public class App implements Serializable {
|
||||
@ApiModelProperty(value = "附件3")
|
||||
private String file3;
|
||||
|
||||
@ApiModelProperty(value = "是否在续费提醒显示")
|
||||
private Boolean showExpiration;
|
||||
|
||||
@ApiModelProperty(value = "服务到期时间")
|
||||
private Date expirationTime;
|
||||
|
||||
|
||||
@@ -47,6 +47,12 @@ public class AppRenew implements Serializable {
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Integer companyId;
|
||||
|
||||
@ApiModelProperty(value = "上传附件")
|
||||
private String images;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
private String nickname;
|
||||
|
||||
|
||||
@@ -178,6 +178,9 @@
|
||||
<if test="param.organizationId != null">
|
||||
AND a.organization_id = #{param.organizationId}
|
||||
</if>
|
||||
<if test="param.showExpiration != null">
|
||||
AND a.show_expiration = #{param.showExpiration}
|
||||
</if>
|
||||
<if test="param.tenantCode != null">
|
||||
AND a.tenant_code LIKE CONCAT('%', #{param.tenantCode}, '%')
|
||||
</if>
|
||||
@@ -187,6 +190,13 @@
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.app_name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.app_code LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.company_name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.app_url LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
|
||||
@@ -190,6 +190,10 @@ public class AppParam extends BaseParam {
|
||||
@ApiModelProperty(value = "应用状态")
|
||||
private String appStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否在续费提醒显示")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean showExpiration;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@@ -41,6 +41,9 @@ public class AppRenewParam extends BaseParam {
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(value = "上传附件")
|
||||
private String images;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
Reference in New Issue
Block a user