保存蓝牙充电记录

This commit is contained in:
Guoqs
2024-11-19 16:20:10 +08:00
parent 4df6a9f53a
commit 54d9a4e91e
4 changed files with 183 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ import com.jsowell.pile.vo.PileReservationInfoVO;
import com.jsowell.pile.vo.uniapp.customer.PersonPileConnectorSumInfoVO;
import com.jsowell.pile.vo.uniapp.customer.PersonPileRealTimeVO;
import com.jsowell.pile.vo.uniapp.customer.PersonalPileInfoVO;
import com.jsowell.service.OrderService;
import com.jsowell.service.PileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -39,6 +40,9 @@ public class PersonPileController extends BaseController {
@Autowired
private PileService pileService;
@Autowired
private OrderService orderService;
@Autowired
private PileMerchantInfoService pileMerchantInfoService;
@@ -482,4 +486,27 @@ public class PersonPileController extends BaseController {
logger.info("根据充电桩查询预约状态params:{}, result:{}", dto, JSON.toJSONString(response));
return response;
}
/**
* 保存蓝牙充电记录
* http://localhost:8080/uniapp/personalPile/saveBluetoothChargingRecord
*/
@PostMapping("/saveBluetoothChargingRecord")
public RestApiResponse<?> saveBluetoothChargingRecord(HttpServletRequest request, @RequestBody BluetoothChargingRecordDTO dto) {
RestApiResponse<?> response = null;
try {
String memberId = getMemberIdByAuthorization(request);
dto.setMemberId(memberId);
orderService.saveBluetoothChargingRecord(dto);
response = new RestApiResponse<>();
} catch (BusinessException e) {
logger.error("保存蓝牙充电记录error, params:{}", dto, e);
response = new RestApiResponse<>(e.getCode(), e.getMessage());
} catch (Exception e) {
logger.error("保存蓝牙充电记录error, params:{}", dto, e);
response = new RestApiResponse<>(ReturnCodeEnum.CODE_QUERY_RESERVATION_STATUS_ERROR);
}
logger.info("保存蓝牙充电记录params:{}, result:{}", dto, JSON.toJSONString(response));
return response;
}
}

View File

@@ -1445,4 +1445,11 @@ public class OrderService {
// }
return true;
}
/**
* 保存蓝牙充电记录
* @param dto
*/
public void saveBluetoothChargingRecord(BluetoothChargingRecordDTO dto) {
}
}