Merge branch 'dev-new' into dev-new-rabbitmq

# Conflicts:
#	jsowell-admin/src/test/java/SpringBootTestController.java
This commit is contained in:
Guoqs
2024-11-19 17:13:09 +08:00
12 changed files with 364 additions and 64 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;
@@ -268,7 +272,7 @@ public class PersonPileController extends BaseController {
try {
String memberId = getMemberIdByAuthorization(request);
dto.setMemberId(memberId);
PageResponse chargingRecord = pileService.getChargingRecord(dto);
PageResponse chargingRecord = pileService.getChargingRecordV2(dto);
response = new RestApiResponse<>(chargingRecord);
} catch (BusinessException e) {
logger.error("获取个人桩充电记录 error", e);
@@ -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;
}
}