Commit 25725d9b authored by zhaji's avatar zhaji

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

parent 0beec024
...@@ -76,8 +76,8 @@ public class TInsuranceEnclosureController { ...@@ -76,8 +76,8 @@ public class TInsuranceEnclosureController {
/** /**
* 删除商险附件 * 删除商险附件
* *
* @param id * @param id 商险id
* @return * @return R
* @Author zhaji * @Author zhaji
* @Date 2022-08-23 * @Date 2022-08-23
**/ **/
......
...@@ -107,6 +107,9 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos ...@@ -107,6 +107,9 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos
*/ */
@Override @Override
public R getInsuranceEnclosureUrl(String id) { public R getInsuranceEnclosureUrl(String id) {
if(Common.isEmpty(id)){
return R.failed("附件id为空");
}
TInsuranceEnclosure insuranceEnclosure = getById(id); TInsuranceEnclosure insuranceEnclosure = getById(id);
if (null == insuranceEnclosure) { if (null == insuranceEnclosure) {
return R.failed("无对应附件信息"); return R.failed("无对应附件信息");
...@@ -126,11 +129,14 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos ...@@ -126,11 +129,14 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos
*/ */
@Override @Override
public R deleteInsuranceEnclosure(String id) { public R deleteInsuranceEnclosure(String id) {
try { if(Common.isEmpty(id)){
return R.failed("附件id为空");
}
TInsuranceEnclosure insuranceEnclosure = getById(id); TInsuranceEnclosure insuranceEnclosure = getById(id);
if (null == insuranceEnclosure) { if (null == insuranceEnclosure) {
return R.failed("无对应附件信息"); return R.failed("无对应附件信息");
} }
try {
if (removeById(id)) { if (removeById(id)) {
ossUtil.deleteObject(null, insuranceEnclosure.getEnclosureAddress()); ossUtil.deleteObject(null, insuranceEnclosure.getEnclosureAddress());
return R.ok("删除成功!"); 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