Commit bdfadee3ac0d357e26178fc01a9c473ec4c958ec
1 parent
39fe1af8
update...
Showing
5 changed files
with
42 additions
and
16 deletions
src/main/java/com/bsth/data/led_http/LedHttpPushHandler.java
| ... | ... | @@ -4,7 +4,6 @@ import com.bsth.data.real_park.CarParkRealHandler; |
| 4 | 4 | import com.bsth.data.utils.HttpClientUtils_tms; |
| 5 | 5 | import com.bsth.entity.ac.CarInOutEntity; |
| 6 | 6 | import com.bsth.entity.berth.RegionBerth; |
| 7 | -import com.bsth.entity.real.RealCarPark; | |
| 8 | 7 | import com.bsth.service.berth.BerthService; |
| 9 | 8 | import com.bsth.util.ConfigUtil; |
| 10 | 9 | import org.slf4j.Logger; |
| ... | ... | @@ -66,8 +65,8 @@ public class LedHttpPushHandler { |
| 66 | 65 | dataUrlLinked.add(url); |
| 67 | 66 | } |
| 68 | 67 | |
| 69 | - public static void busIn(RealCarPark rcp) { | |
| 70 | - String params = "?cph=" + rcp.getNbbm() + "&park=" + rcp.getBerthName(); | |
| 68 | + public static void busIn(String cph, String berthName) { | |
| 69 | + String params = "?cph=" + cph + "&park=" + berthName; | |
| 71 | 70 | String url = baseUrl + "jcPlan" + params; |
| 72 | 71 | |
| 73 | 72 | dataUrlLinked.add(url); | ... | ... |
src/main/java/com/bsth/data/real_park/CarParkRealHandler.java
| ... | ... | @@ -120,6 +120,12 @@ public class CarParkRealHandler { |
| 120 | 120 | if (StringUtils.isEmpty(nbbm)) |
| 121 | 121 | return; |
| 122 | 122 | |
| 123 | + Bus bus = BusDataBuffer.findOne(nbbm); | |
| 124 | + if(!bus.isSfdc()){ | |
| 125 | + LedHttpPushHandler.busIn(bus.getCarPlate(), "柴油泊位区");//柴油车 | |
| 126 | + return; | |
| 127 | + } | |
| 128 | + | |
| 123 | 129 | RealCarPark rcp = new RealCarPark(); |
| 124 | 130 | |
| 125 | 131 | RegionBerth b; |
| ... | ... | @@ -138,16 +144,12 @@ public class CarParkRealHandler { |
| 138 | 144 | return; |
| 139 | 145 | } |
| 140 | 146 | |
| 147 | + rcp.setPlateNo(bus.getCarPlate()); | |
| 141 | 148 | rcp.setBerthName(b.getName()); |
| 142 | 149 | rcp.setNbbm(nbbm); |
| 143 | 150 | rcp.setInTime(System.currentTimeMillis()); |
| 144 | 151 | rcp.setType(0); |
| 145 | 152 | |
| 146 | - //车牌号 | |
| 147 | - Bus bus = BusDataBuffer.findOne(nbbm); | |
| 148 | - if(null != bus) | |
| 149 | - rcp.setPlateNo(bus.getCarPlate()); | |
| 150 | - | |
| 151 | 153 | //车辆已经在场内 |
| 152 | 154 | if(!busRcps.containsKey(nbbm) || StringUtils.isNotEmpty(busRcps.get(nbbm).getBerthName())){ |
| 153 | 155 | //电量信息 |
| ... | ... | @@ -160,7 +162,7 @@ public class CarParkRealHandler { |
| 160 | 162 | } |
| 161 | 163 | |
| 162 | 164 | //push led |
| 163 | - LedHttpPushHandler.busIn(rcp); | |
| 165 | + LedHttpPushHandler.busIn(rcp.getPlateNo(), rcp.getBerthName()); | |
| 164 | 166 | } |
| 165 | 167 | |
| 166 | 168 | /** | ... | ... |
src/main/java/com/bsth/service/berth/impl/BerthServiceImpl.java
| ... | ... | @@ -87,12 +87,15 @@ public class BerthServiceImpl extends BaseServiceImpl<RegionBerth, Integer> impl |
| 87 | 87 | RegionBerth b = null; |
| 88 | 88 | |
| 89 | 89 | try { |
| 90 | - b = nextChargeBerth(); | |
| 90 | + /*b = nextChargeBerth(); | |
| 91 | 91 | if (null != b) |
| 92 | 92 | return b; |
| 93 | 93 | |
| 94 | 94 | //最快充电完成枪的空余泊位 |
| 95 | - b = maxElecBerth(); | |
| 95 | + b = maxElecBerth();*/ | |
| 96 | + | |
| 97 | + //获取按顺序排列的下一个泊位 | |
| 98 | + b = nextByOrder(); | |
| 96 | 99 | } catch (Exception e) { |
| 97 | 100 | logger.error("", e); |
| 98 | 101 | } |
| ... | ... | @@ -180,6 +183,28 @@ public class BerthServiceImpl extends BaseServiceImpl<RegionBerth, Integer> impl |
| 180 | 183 | return near; |
| 181 | 184 | } |
| 182 | 185 | |
| 186 | + private RegionBerth nextByOrder(){ | |
| 187 | + //跳过固定泊位 | |
| 188 | + List<RegionBerth> templist = new ArrayList<>(); | |
| 189 | + for(RegionBerth b : berthList){ | |
| 190 | + if(!lockBerthMap.inverse().containsKey(b.getName())) | |
| 191 | + templist.add(b); | |
| 192 | + } | |
| 193 | + | |
| 194 | + Collections.sort(templist, new Comparator<RegionBerth>() { | |
| 195 | + @Override | |
| 196 | + public int compare(RegionBerth b1, RegionBerth b2) { | |
| 197 | + return Integer.parseInt(b1.getOrderNo()) - Integer.parseInt(b2.getOrderNo()); | |
| 198 | + } | |
| 199 | + }); | |
| 200 | + | |
| 201 | + for(RegionBerth b : templist){ | |
| 202 | + if(StringUtils.isEmpty(b.getNbbm())) | |
| 203 | + return b; | |
| 204 | + } | |
| 205 | + return null; | |
| 206 | + } | |
| 207 | + | |
| 183 | 208 | private RegionBerth nearBerthByCp(List<RegionBerth> list) { |
| 184 | 209 | Collections.sort(list, new Comparator<RegionBerth>() { |
| 185 | 210 | @Override | ... | ... |
src/main/resources/static/pages/basic_data/bus/list.html
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | </div> |
| 30 | 30 | <div class="ct_field"> |
| 31 | 31 | <label>卡号: |
| 32 | - <input class="uk-input" name="idRFID" placeholder="卡ID号"> | |
| 32 | + <input class="uk-input" name="idRfid" placeholder="卡ID号"> | |
| 33 | 33 | </label> |
| 34 | 34 | </div> |
| 35 | 35 | <div class="ct_field"> |
| ... | ... | @@ -45,7 +45,7 @@ |
| 45 | 45 | <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> |
| 46 | 46 | </div> |
| 47 | 47 | <div class="ct_field" style="vertical-align: bottom;"> |
| 48 | - <a class="uk-button uk-button-text" id="import_person_excel">导入车辆&车卡信息</a> | |
| 48 | + <a class="uk-button uk-button-text" id="import_person_excel">导入</a> | |
| 49 | 49 | </div> |
| 50 | 50 | </form> |
| 51 | 51 | </div> |
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | <th>车辆自编号</th> |
| 60 | 60 | <th>ID卡号</th> |
| 61 | 61 | <th>卡标签号</th> |
| 62 | - <th>备注</th> | |
| 62 | + <th>是否电车</th> | |
| 63 | 63 | <th>操作</th> |
| 64 | 64 | </tr> |
| 65 | 65 | </thead> |
| ... | ... | @@ -84,7 +84,7 @@ |
| 84 | 84 | <td>{{b.nbbm}}</td> |
| 85 | 85 | <td>{{b.idRfid}}</td> |
| 86 | 86 | <td>{{b.tagRfid}}</td> |
| 87 | - <td>{{b.remark}}</td> | |
| 87 | + <td>{{b.sfdc?"电车":"油车"}}</td> | |
| 88 | 88 | <td><a class="edit_icon" data-nbbm="{{b.nbbm}}" uk-icon="icon: file-edit"></a></td> |
| 89 | 89 | </tr> |
| 90 | 90 | {{/each}} | ... | ... |
src/main/resources/static/pages/basic_data/person_card/list.html
| ... | ... | @@ -61,7 +61,7 @@ |
| 61 | 61 | <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> |
| 62 | 62 | </div> |
| 63 | 63 | <div class="ct_field" style="vertical-align: bottom;"> |
| 64 | - <a class="uk-button uk-button-text" id="import_person_excel">导入卡信息</a> | |
| 64 | + <a class="uk-button uk-button-text" id="import_person_excel">导入</a> | |
| 65 | 65 | </div> |
| 66 | 66 | </form> |
| 67 | 67 | </div> | ... | ... |