This commit is contained in:
Lemon
2023-08-22 11:12:29 +08:00
parent ee65b75e18
commit f7eed5ed50
5 changed files with 83 additions and 11 deletions

View File

@@ -10,12 +10,10 @@ import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.OrderPileOccupy;
import com.jsowell.pile.dto.GenerateOccupyOrderDTO;
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
import com.jsowell.pile.service.IPileBillingTemplateService;
import com.jsowell.pile.service.OrderPileOccupyService;
import com.jsowell.pile.vo.uniapp.OccupyOrderDetailVO;
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
import com.jsowell.pile.vo.web.BillingTemplateVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -108,4 +106,33 @@ public class OccupyOrderController extends BaseController {
logger.info("查询占桩订单详情页 result:{}", response);
return response;
}
/**
* 查询用户是否有未支付的占桩订单
* https://api.jsowellcloud.com/uniapp/occupyOrder/getUnPayOccupyOrder
* @param request
* @return
*/
@GetMapping("/getUnPayOccupyOrder")
public RestApiResponse<?> getUnPayOccupyOrder(HttpServletRequest request) {
String memberId = getMemberIdByAuthorization(request);
if (StringUtils.isBlank(memberId)) {
throw new BusinessException(ReturnCodeEnum.CODE_TOKEN_ERROR);
}
RestApiResponse<?> response = null;
logger.info("查询用户: {} 是否有未支付的占桩订单", memberId);
try {
OrderPileOccupy orderPileOccupy = orderPileOccupyService.queryUnPayOrderByMemberId(memberId);
if (orderPileOccupy != null) {
response = new RestApiResponse<>(ImmutableMap.of("occupyOrder", orderPileOccupy.getOccupyCode()));
}
} catch (Exception e) {
logger.error("查询用户: {} 是否有未支付的占桩订单 error,", memberId);
response = new RestApiResponse<>(e);
}
logger.info("查询用户: {} 是否有未支付的占桩订单 result:{}", memberId, response);
return response;
}
}