|
|
@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.common.module.utils.ExportExcelUtils;
|
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
|
import cn.com.ctop.finance.payment.entity.FinancePaymentRechargeApplication;
|
|
|
+import cn.com.ctop.finance.payment.service.IFinancePaymentRechargeAccountService;
|
|
|
import cn.com.ctop.finance.payment.service.IFinancePaymentRechargeApplicationService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -37,6 +38,9 @@ import java.util.Map;
|
|
|
public class FinancePaymentRechargeApplicationController {
|
|
|
@Autowired
|
|
|
private IFinancePaymentRechargeApplicationService financePaymentRechargeApplicationService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFinancePaymentRechargeAccountService rechargeAccountService;
|
|
|
@Autowired
|
|
|
private ISysRoleService sysRoleService;
|
|
|
|
|
|
@@ -152,7 +156,16 @@ public class FinancePaymentRechargeApplicationController {
|
|
|
@GetMapping(value = "/delete")
|
|
|
public Result<?> delete(@RequestParam(name = "id") String id) {
|
|
|
try {
|
|
|
- financePaymentRechargeApplicationService.removeById(id);
|
|
|
+ FinancePaymentRechargeApplication application = financePaymentRechargeApplicationService.getById(id);
|
|
|
+ if (Check.isNull(application)) {
|
|
|
+ return Result.error("未找到对应实体");
|
|
|
+ }
|
|
|
+ if ("1".equals(application.getAuditStatus()) || "2.".equals(application.getAuditStatus())) {
|
|
|
+ financePaymentRechargeApplicationService.removeById(id);
|
|
|
+ rechargeAccountService.delByRechargeId(Long.valueOf(id));
|
|
|
+ } else {
|
|
|
+ return Result.error("当前状态不允许删除!");
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
log.error("删除失败", e.getMessage());
|
|
|
return Result.error("删除失败!");
|