Commit 25725d9b authored by zhaji's avatar zhaji

"feature-zhaJi:优化商险删除,查询的校验"

parent 0beec024
......@@ -76,8 +76,8 @@ public class TInsuranceEnclosureController {
/**
* 删除商险附件
*
* @param id
* @return
* @param id 商险id
* @return R
* @Author zhaji
* @Date 2022-08-23
**/
......
......@@ -107,6 +107,9 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos
*/
@Override
public R getInsuranceEnclosureUrl(String id) {
if(Common.isEmpty(id)){
return R.failed("附件id为空");
}
TInsuranceEnclosure insuranceEnclosure = getById(id);
if (null == insuranceEnclosure) {
return R.failed("无对应附件信息");
......@@ -126,11 +129,14 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos
*/
@Override
public R deleteInsuranceEnclosure(String id) {
if(Common.isEmpty(id)){
return R.failed("附件id为空");
}
TInsuranceEnclosure insuranceEnclosure = getById(id);
if (null == insuranceEnclosure) {
return R.failed("无对应附件信息");
}
try {
TInsuranceEnclosure insuranceEnclosure = getById(id);
if (null == insuranceEnclosure) {
return R.failed("无对应附件信息");
}
if (removeById(id)) {
ossUtil.deleteObject(null, insuranceEnclosure.getEnclosureAddress());
return R.ok("删除成功!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment