|
@@ -6,6 +6,7 @@ import com.charging.chargingparking.dto.MessageResult;
|
|
|
import com.charging.chargingparking.dto.PojoUtils;
|
|
|
import com.charging.chargingparking.entity.ParkingInfo;
|
|
|
import com.charging.chargingparking.entity.ParkingMember;
|
|
|
+import com.charging.chargingparking.entity.ParkingPay;
|
|
|
import com.charging.chargingparking.entity.ParkingRecord;
|
|
|
import com.charging.chargingparking.modules.common.dto.Sort;
|
|
|
import com.charging.chargingparking.service.ParkingInfoService;
|
|
@@ -13,6 +14,8 @@ import com.charging.chargingparking.service.ParkingRecordService;
|
|
|
import com.charging.chargingparking.utils.StringUtils;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -31,6 +34,8 @@ import java.util.Map;
|
|
|
@RequestMapping("/backParkingRecord")
|
|
|
public class BackParkingRecordController {
|
|
|
|
|
|
+ private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
+
|
|
|
@Autowired
|
|
|
private ParkingInfoService parkingInfoService;
|
|
|
|
|
@@ -76,6 +81,35 @@ public class BackParkingRecordController {
|
|
|
return messageResult;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value="获取信息")
|
|
|
+ @GetMapping("edit/{id}")
|
|
|
+ public MessageResult<ParkingRecord> edit(@PathVariable("id") String id){
|
|
|
+ MessageResult<ParkingRecord> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ ParkingRecord parkingRecordInfo = parkingRecordService.getById(id);
|
|
|
+ ParkingInfo parkingInfo = parkingInfoService.getById(parkingRecordInfo.getParkId());
|
|
|
+ if (parkingInfo != null) {
|
|
|
+ parkingRecordInfo.setParkName(parkingInfo.getParkingName());
|
|
|
+ }
|
|
|
+ if (parkingRecordInfo != null) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(parkingRecordInfo);
|
|
|
+ } else {
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage("数据库不存在该记录!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+
|
|
|
+ msgResult.setResult(false);
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "列表")
|
|
|
@RequestMapping(value = "pageList", method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
@@ -145,14 +179,14 @@ public class BackParkingRecordController {
|
|
|
}
|
|
|
|
|
|
com.github.pagehelper.Page<ParkingRecord> page = parkingRecordService.pageSearch(searchParams, pageIndex, pageSize, sortList);
|
|
|
-
|
|
|
+/*
|
|
|
for (ParkingRecord parkingMember : page) {
|
|
|
ParkingInfo parkingInfo = parkingInfoService.getById(parkingMember.getParkId());
|
|
|
if (parkingInfo != null) {
|
|
|
parkingMember.setParkName(parkingInfo.getParkingName());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+*/
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|