Commit d16ef82f964214f21e61eea66516bcae8c49b244

Authored by 潘钊
1 parent ba993fd0

update...

src/main/java/com/bsth/controller/berth/BerthController.java
@@ -17,4 +17,9 @@ public class BerthController extends BaseController<RegionBerth, Integer> { @@ -17,4 +17,9 @@ public class BerthController extends BaseController<RegionBerth, Integer> {
17 @Autowired 17 @Autowired
18 BerthService berthService; 18 BerthService berthService;
19 19
  20 + @RequestMapping("max_order_no")
  21 + public String maxOrderNo() {
  22 + String rs = berthService.maxOrderNo();
  23 + return rs==null?"0":rs;
  24 + }
20 } 25 }
src/main/java/com/bsth/repository/berth/BerthRepository.java
@@ -2,6 +2,7 @@ package com.bsth.repository.berth; @@ -2,6 +2,7 @@ package com.bsth.repository.berth;
2 2
3 import com.bsth.entity.berth.RegionBerth; 3 import com.bsth.entity.berth.RegionBerth;
4 import com.bsth.repository.BaseRepository; 4 import com.bsth.repository.BaseRepository;
  5 +import org.springframework.data.jpa.repository.Query;
5 import org.springframework.stereotype.Repository; 6 import org.springframework.stereotype.Repository;
6 7
7 /** 8 /**
@@ -10,6 +11,6 @@ import org.springframework.stereotype.Repository; @@ -10,6 +11,6 @@ import org.springframework.stereotype.Repository;
10 @Repository 11 @Repository
11 public interface BerthRepository extends BaseRepository<RegionBerth, Integer>{ 12 public interface BerthRepository extends BaseRepository<RegionBerth, Integer>{
12 13
13 -/* @Query("select max(b.orderNo) from RegionBerth b")  
14 - String maxOrderNo();*/ 14 + @Query("select max(b.orderNo) from RegionBerth b")
  15 + String maxOrderNo();
15 } 16 }
src/main/java/com/bsth/service/berth/BerthService.java
@@ -8,7 +8,7 @@ import com.bsth.service.BaseService; @@ -8,7 +8,7 @@ import com.bsth.service.BaseService;
8 */ 8 */
9 public interface BerthService extends BaseService<RegionBerth, Integer>{ 9 public interface BerthService extends BaseService<RegionBerth, Integer>{
10 RegionBerth next(); 10 RegionBerth next();
11 - //String maxOrderNo(); 11 + String maxOrderNo();
12 12
13 //void berthInOut(Bus bus); 13 //void berthInOut(Bus bus);
14 14
src/main/java/com/bsth/service/berth/impl/BerthServiceImpl.java
@@ -27,6 +27,14 @@ public class BerthServiceImpl extends BaseServiceImpl&lt;RegionBerth, Integer&gt; impl @@ -27,6 +27,14 @@ public class BerthServiceImpl extends BaseServiceImpl&lt;RegionBerth, Integer&gt; impl
27 @Autowired 27 @Autowired
28 CarParkRealHandler carParkRealHandler; 28 CarParkRealHandler carParkRealHandler;
29 29
  30 + @Autowired
  31 + BerthRepository berthRepository;
  32 +
  33 + @Override
  34 + public String maxOrderNo() {
  35 + return berthRepository.maxOrderNo();
  36 + }
  37 +
30 /** 38 /**
31 * 充电枪状态 39 * 充电枪状态
32 * -404 空闲 40 * -404 空闲