|
@@ -559,53 +559,62 @@ public class StationController {
|
|
|
Gson gson =new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
|
|
|
ResultData resultData = null;
|
|
|
try {
|
|
|
- Map<String, Object> resultMap = new HashMap<>();
|
|
|
-
|
|
|
- //获取油站加油员列表
|
|
|
- HashMap<String, Object> params_1 = new HashMap<>();
|
|
|
- params_1.put("stationId", stationId);
|
|
|
- List<Map> personnalList = payOrderMapper.selectPersonelName(params_1); //使用list原因:一个枪号对应多个加油员场景
|
|
|
- resultMap.put("personnalList", personnalList);
|
|
|
-
|
|
|
- //获取油站图片和公告
|
|
|
- StationInfo stationPic = new StationInfo();
|
|
|
- stationPic.setStationId(stationId);
|
|
|
- StationInfo stationPics = stationService.getStationPicList(stationPic);
|
|
|
- List<String> listPic = new ArrayList<>();
|
|
|
- if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage1())){
|
|
|
- listPic.add(stationPics.getImage1());
|
|
|
- }
|
|
|
- if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage2())){
|
|
|
- listPic.add(stationPics.getImage2());
|
|
|
- }
|
|
|
- if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage3())){
|
|
|
- listPic.add(stationPics.getImage3());
|
|
|
- }
|
|
|
- if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage4())){
|
|
|
- listPic.add(stationPics.getImage4());
|
|
|
- }
|
|
|
- if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage5())){
|
|
|
- listPic.add(stationPics.getImage5());
|
|
|
- }
|
|
|
- resultMap.put("notice", stationPics.getNotice());
|
|
|
- resultMap.put("listPic", listPic);
|
|
|
-
|
|
|
- //获取油枪
|
|
|
- if(personnelId !=null && personnelId !="" && !personnelId.equals("undefined")){
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("personnelId", personnelId);
|
|
|
- params.put("stationId", stationId);
|
|
|
- List<Map<String, Object>> stationOilGunList = stationOilGunService.selectOilGunByPersonalId(params);
|
|
|
- resultMap.put("stationOilGunList", stationOilGunList);
|
|
|
- //resultData=ResultData.success(stationOilGunList);
|
|
|
+ StationInfo staInfo = new StationInfo();
|
|
|
+ staInfo.setStationId(stationId);
|
|
|
+ StationInfo stationInfo = stationService.selectStationInfo(staInfo);
|
|
|
+ if(stationInfo !=null){
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+
|
|
|
+ //获取油站加油员列表
|
|
|
+ HashMap<String, Object> params_1 = new HashMap<>();
|
|
|
+ params_1.put("stationId", stationId);
|
|
|
+ List<Map> personnalList = payOrderMapper.selectPersonelName(params_1); //使用list原因:一个枪号对应多个加油员场景
|
|
|
+ resultMap.put("personnalList", personnalList);
|
|
|
+
|
|
|
+
|
|
|
+ //获取油站图片和公告
|
|
|
+ StationInfo stationPic = new StationInfo();
|
|
|
+ stationPic.setStationId(stationId);
|
|
|
+ StationInfo stationPics = stationService.getStationPicList(stationPic);
|
|
|
+ List<String> listPic = new ArrayList<>();
|
|
|
+ if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage1())){
|
|
|
+ listPic.add(stationPics.getImage1());
|
|
|
+ }
|
|
|
+ if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage2())){
|
|
|
+ listPic.add(stationPics.getImage2());
|
|
|
+ }
|
|
|
+ if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage3())){
|
|
|
+ listPic.add(stationPics.getImage3());
|
|
|
+ }
|
|
|
+ if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage4())){
|
|
|
+ listPic.add(stationPics.getImage4());
|
|
|
+ }
|
|
|
+ if(stationPics != null && StringUtils.isNotBlank(stationPics.getImage5())){
|
|
|
+ listPic.add(stationPics.getImage5());
|
|
|
+ }
|
|
|
+ resultMap.put("notice", stationPics.getNotice());
|
|
|
+ resultMap.put("listPic", listPic);
|
|
|
+
|
|
|
+ //获取油枪
|
|
|
+ if(personnelId !=null && personnelId !="" && !personnelId.equals("undefined")){
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("personnelId", personnelId);
|
|
|
+ params.put("stationId", stationId);
|
|
|
+ List<Map<String, Object>> stationOilGunList = stationOilGunService.selectOilGunByPersonalId(params);
|
|
|
+ resultMap.put("stationOilGunList", stationOilGunList);
|
|
|
+ //resultData=ResultData.success(stationOilGunList);
|
|
|
+ }else {
|
|
|
+ StationOilGun stationOilGun =new StationOilGun();
|
|
|
+ stationOilGun.setStationId(stationId);
|
|
|
+ List<StationOilGun> stationOilGunList = stationOilGunService.stationOilGunList(stationOilGun);
|
|
|
+ resultMap.put("stationOilGunList", stationOilGunList);
|
|
|
+ //resultData=ResultData.success(stationOilGunList);
|
|
|
+ }
|
|
|
+ resultMap.put("isAliPayFlag", stationInfo.getIsAliPayFlag());
|
|
|
+ resultData = ResultData.success(resultMap);
|
|
|
}else {
|
|
|
- StationOilGun stationOilGun =new StationOilGun();
|
|
|
- stationOilGun.setStationId(stationId);
|
|
|
- List<StationOilGun> stationOilGunList = stationOilGunService.stationOilGunList(stationOilGun);
|
|
|
- resultMap.put("stationOilGunList", stationOilGunList);
|
|
|
- //resultData=ResultData.success(stationOilGunList);
|
|
|
+ resultData=ResultData.success(CodeMsg.STATION_NULL_INFO);
|
|
|
}
|
|
|
- resultData = ResultData.success(resultMap);
|
|
|
}catch (Exception e){
|
|
|
resultData=ResultData.success(CodeMsg.SEARCH_FAIL);
|
|
|
e.printStackTrace();
|