2023-08-18 10:15:56 +08:00
|
|
|
package com.jsowell.api.uniapp;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
|
|
import com.jsowell.common.annotation.Anonymous;
|
|
|
|
|
import com.jsowell.common.core.controller.BaseController;
|
|
|
|
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
|
|
|
|
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.service.OrderPileOccupyService;
|
|
|
|
|
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 占桩订单controller
|
2023-08-18 09:27:22 +08:00
|
|
|
*
|
2023-08-18 10:15:56 +08:00
|
|
|
* @author Lemon
|
2023-08-18 09:27:22 +08:00
|
|
|
* @Date 2023/8/18 8:55
|
2023-08-18 10:15:56 +08:00
|
|
|
*/
|
|
|
|
|
@Anonymous
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/uniapp/occupyOrder")
|
|
|
|
|
public class OccupyOrderController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private OrderPileOccupyService orderPileOccupyService;
|
|
|
|
|
|
|
|
|
|
/**
|
2023-08-18 11:40:23 +08:00
|
|
|
* todo 查询站点占桩费率
|
2023-08-18 10:15:56 +08:00
|
|
|
* @param stationId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/getStationOccupyFee/{stationId}")
|
|
|
|
|
public RestApiResponse<?> getStationOccupyFee(@PathVariable("stationId") String stationId) {
|
|
|
|
|
logger.info("查询站点占桩费率 params:{}", stationId);
|
|
|
|
|
RestApiResponse<?> response = null;
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("查询站点占桩费率 error,", e);
|
|
|
|
|
response = new RestApiResponse<>(e);
|
|
|
|
|
}
|
|
|
|
|
logger.info("查询站点占桩费率 result:{}", response);
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-18 11:40:23 +08:00
|
|
|
/**
|
|
|
|
|
* 查询占桩订单列表页
|
|
|
|
|
* https://api.jsowellcloud.com/uniapp/occupyOrder/getOccupyOrderInfo
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2023-08-18 10:15:56 +08:00
|
|
|
@GetMapping("/getOccupyOrderInfo")
|
|
|
|
|
public RestApiResponse<?> getOccupyOrderInfo(HttpServletRequest request) {
|
|
|
|
|
// 获取memberId
|
|
|
|
|
String memberId = getMemberIdByAuthorization(request);
|
|
|
|
|
if (StringUtils.isEmpty(memberId)) {
|
|
|
|
|
throw new BusinessException(ReturnCodeEnum.CODE_TOKEN_ERROR);
|
|
|
|
|
}
|
|
|
|
|
logger.info("查询占桩订单列表页 memberId:{}", memberId);
|
|
|
|
|
RestApiResponse<?> response = null;
|
|
|
|
|
try {
|
|
|
|
|
List<OrderPileOccupyVO> orderInfoList = orderPileOccupyService.getOccupyOrderInfo(memberId);
|
|
|
|
|
response = new RestApiResponse<>(orderInfoList);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("查询占桩订单列表页 error, ", e);
|
|
|
|
|
response = new RestApiResponse<>(e);
|
|
|
|
|
}
|
|
|
|
|
logger.info("查询占桩订单列表页 result:{}", response);
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-08-18 16:17:28 +08:00
|
|
|
/**
|
|
|
|
|
* 查询占桩订单详情页
|
|
|
|
|
* https://api.jsowellcloud.com/uniapp/occupyOrder/getOccupyOrderDetail/{occupyCode}
|
|
|
|
|
* @param occupyCode
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/getOccupyOrderDetail/{occupyCode}")
|
|
|
|
|
public RestApiResponse<?> getOccupyOrderDetail(@PathVariable("occupyCode") String occupyCode) {
|
|
|
|
|
logger.info("查询占桩订单详情页 param:{}", occupyCode);
|
|
|
|
|
RestApiResponse<?> response = null;
|
|
|
|
|
try {
|
|
|
|
|
orderPileOccupyService.getOccupyOrderDetail(occupyCode);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("查询占桩订单详情页 error,", e);
|
|
|
|
|
response = new RestApiResponse<>(e);
|
|
|
|
|
}
|
|
|
|
|
logger.info("查询占桩订单详情页 result:{}", response);
|
|
|
|
|
return response;
|
|
|
|
|
}
|
2023-08-18 09:27:22 +08:00
|
|
|
}
|