zyy
2025-12-17 0a87c3811a648e46105687aa1fab02f605f7e5c0
trading-order-admin/src/main/java/com/yami/trading/admin/controller/loan/LoanController.java
@@ -26,6 +26,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.token.TokenService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -222,6 +223,42 @@
   }
   /**
    * 提交还款申请
    * @param request 请求对象
    * @return 申请结果
    */
   @GetMapping("/api/loan!refund.action")
   public ResultObject refund(HttpServletRequest request) {
      ResultObject resultObject = new ResultObject();
      String partyId = SecurityUtils.getCurrentUserId();
      if(null==partyId) {
         resultObject.setCode("1");
         resultObject.setMsg("通过Token获取partyId为空!");
         return resultObject;
      }
      String orderNo=getParamValue(request,resultObject,"orderNo");
      if(null==orderNo) return resultObject;
      try {
         boolean flag = loanService.refundLoanOrder(orderNo, partyId);
         if (flag) {
            resultObject.setMsg("提交成功");
         } else {
            resultObject.setCode("1");
            resultObject.setMsg("提交失败");
         }
      } catch(Throwable e) {
         resultObject.setCode("1");
         resultObject.setMsg("程序错误");
         logger.error("error:", e);
      }
      return resultObject;
   }
   /**
    * 查看借贷申请单列表
    * @param request 请求对象
    * @return 申请单列表