|
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -49,11 +50,27 @@ public class TenantContractTemplateController extends BaseController {
|
|
|
return succeed(tenantContractTemplateService.get(id));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("查询最新启用的协议模板")
|
|
|
+ @GetMapping(value = "/queryLatestContractTemplate")
|
|
|
+ @PreAuthorize("@pcs.hasPermissions('tenantContractTemplate/queryLatestContractTemplate')")
|
|
|
+ public HttpResponseResult<TenantContractTemplate> queryLatestContractTemplate() {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+
|
|
|
+ if (sysUser == null || sysUser.getId() == null) {
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
+ return succeed(tenantContractTemplateService.queryLatestContractTemplate(sysUser.getTenantId(), null, null));
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("新增")
|
|
|
@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@PreAuthorize("@pcs.hasPermissions('tenantContractTemplate/add')")
|
|
|
public Object add(TenantContractTemplate tenantContractTemplate) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+
|
|
|
+ if(sysUser == null || sysUser.getId() == null){
|
|
|
+ return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
|
+ }
|
|
|
|
|
|
tenantContractTemplate.setStatus(false);
|
|
|
tenantContractTemplate.setModifyBy(sysUser.getId());
|