|
@@ -2,6 +2,7 @@ package cn.com.ty.lift.enterprise.oa.controller;
|
|
|
|
|
|
import cn.com.ty.lift.common.utils.AliyunOSSUtil;
|
|
|
import cn.com.ty.lift.enterprise.common.Conf;
|
|
|
+import cn.com.ty.lift.enterprise.common.RestResult;
|
|
|
import cn.com.ty.lift.enterprise.oa.entity.LiftCertificate;
|
|
|
import cn.com.ty.lift.enterprise.oa.service.LiftCertificateService;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
@@ -53,7 +54,7 @@ public class LiftCertificateController {
|
|
|
LiftCertificate entity = liftCertificateService.getById(id);
|
|
|
|
|
|
|
|
|
- return RestResponse.ok(entity);
|
|
|
+ return RestResult.okData(entity);
|
|
|
}
|
|
|
|
|
|
@PostMapping("list")
|
|
@@ -67,9 +68,9 @@ public class LiftCertificateController {
|
|
|
}
|
|
|
IPage<LiftCertificate> results = liftCertificateService.selectByTypeCondition(pageNum, pageSize, certificateType, name, status);
|
|
|
if (results == null) {
|
|
|
- return RestResponse.error("查询异常");
|
|
|
+ return RestResult.errException();
|
|
|
}
|
|
|
- return RestResponse.ok(results);
|
|
|
+ return RestResult.okData(results);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -81,13 +82,13 @@ public class LiftCertificateController {
|
|
|
@PostMapping("modify")
|
|
|
public RestResponse<Boolean> modify(LiftCertificate entity) {
|
|
|
if (null == entity) {
|
|
|
- return RestResponse.error("参数有误");
|
|
|
+ return RestResult.errParam();
|
|
|
}
|
|
|
boolean result = liftCertificateService.updateById(entity);
|
|
|
if (result) {
|
|
|
- return RestResponse.ok(result);
|
|
|
+ return RestResult.okData(result);
|
|
|
}
|
|
|
- return RestResponse.error("更新失败");
|
|
|
+ return RestResult.errException();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -101,7 +102,7 @@ public class LiftCertificateController {
|
|
|
//0:无证,1:待审核,2:审核未通过,3:审核通过,4:超期
|
|
|
int status = pass ? 3 : 2;
|
|
|
int result = liftCertificateService.updateAudit(id, status);
|
|
|
- return RestResponse.ok(result);
|
|
|
+ return RestResult.okData(result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -113,16 +114,16 @@ public class LiftCertificateController {
|
|
|
@PostMapping("add")
|
|
|
public RestResponse<Object> add(MultipartFile[] files,LiftCertificate entity) throws Exception{
|
|
|
if(null == files || files.length == 0){
|
|
|
- return RestResponse.error("请上传操作证图片");
|
|
|
+ return RestResult.err("请上传操作证图片");
|
|
|
}
|
|
|
|
|
|
if (null == entity) {
|
|
|
- return RestResponse.error("参数有误");
|
|
|
+ return RestResult.errParam();
|
|
|
}
|
|
|
for (int i = 0;i < files.length; i++){
|
|
|
MultipartFile file = files[i];
|
|
|
if(file.isEmpty()){
|
|
|
- return RestResponse.error("请上传操作证图片");
|
|
|
+ return RestResult.err("请上传操作证图片");
|
|
|
}
|
|
|
String originalFilename = file.getOriginalFilename();
|
|
|
String suffix = originalFilename.substring(originalFilename.indexOf("."));
|
|
@@ -137,7 +138,7 @@ public class LiftCertificateController {
|
|
|
}
|
|
|
|
|
|
boolean result = liftCertificateService.save(entity);
|
|
|
- return RestResponse.ok(result);
|
|
|
+ return RestResult.okData(result);
|
|
|
|
|
|
}
|
|
|
}
|