diff --git a/src/main/java/com/gxwebsoft/oa/controller/AppController.java b/src/main/java/com/gxwebsoft/oa/controller/AppController.java index 776a103..b31989c 100644 --- a/src/main/java/com/gxwebsoft/oa/controller/AppController.java +++ b/src/main/java/com/gxwebsoft/oa/controller/AppController.java @@ -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)); } diff --git a/src/main/java/com/gxwebsoft/oa/controller/AppRenewController.java b/src/main/java/com/gxwebsoft/oa/controller/AppRenewController.java index 5076b3b..f52282b 100644 --- a/src/main/java/com/gxwebsoft/oa/controller/AppRenewController.java +++ b/src/main/java/com/gxwebsoft/oa/controller/AppRenewController.java @@ -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("添加失败"); diff --git a/src/main/java/com/gxwebsoft/oa/entity/App.java b/src/main/java/com/gxwebsoft/oa/entity/App.java index 632acbb..5fc204b 100644 --- a/src/main/java/com/gxwebsoft/oa/entity/App.java +++ b/src/main/java/com/gxwebsoft/oa/entity/App.java @@ -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; diff --git a/src/main/java/com/gxwebsoft/oa/entity/AppRenew.java b/src/main/java/com/gxwebsoft/oa/entity/AppRenew.java index 011a03b..4cbf8f4 100644 --- a/src/main/java/com/gxwebsoft/oa/entity/AppRenew.java +++ b/src/main/java/com/gxwebsoft/oa/entity/AppRenew.java @@ -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; diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/AppMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/AppMapper.xml index d67bfd3..b78dace 100644 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/AppMapper.xml +++ b/src/main/java/com/gxwebsoft/oa/mapper/xml/AppMapper.xml @@ -178,6 +178,9 @@ AND a.organization_id = #{param.organizationId} + + AND a.show_expiration = #{param.showExpiration} + AND a.tenant_code LIKE CONCAT('%', #{param.tenantCode}, '%') @@ -187,6 +190,13 @@ AND a.create_time <= #{param.createTimeEnd} + + 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}, '%') + ) + diff --git a/src/main/java/com/gxwebsoft/oa/param/AppParam.java b/src/main/java/com/gxwebsoft/oa/param/AppParam.java index 47e05c5..32a598b 100644 --- a/src/main/java/com/gxwebsoft/oa/param/AppParam.java +++ b/src/main/java/com/gxwebsoft/oa/param/AppParam.java @@ -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; diff --git a/src/main/java/com/gxwebsoft/oa/param/AppRenewParam.java b/src/main/java/com/gxwebsoft/oa/param/AppRenewParam.java index 35de991..dfb5699 100644 --- a/src/main/java/com/gxwebsoft/oa/param/AppRenewParam.java +++ b/src/main/java/com/gxwebsoft/oa/param/AppRenewParam.java @@ -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;