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,7 +4,6 @@ import com.bsth.data.real_park.CarParkRealHandler; | ||
| 4 | import com.bsth.data.utils.HttpClientUtils_tms; | 4 | import com.bsth.data.utils.HttpClientUtils_tms; |
| 5 | import com.bsth.entity.ac.CarInOutEntity; | 5 | import com.bsth.entity.ac.CarInOutEntity; |
| 6 | import com.bsth.entity.berth.RegionBerth; | 6 | import com.bsth.entity.berth.RegionBerth; |
| 7 | -import com.bsth.entity.real.RealCarPark; | ||
| 8 | import com.bsth.service.berth.BerthService; | 7 | import com.bsth.service.berth.BerthService; |
| 9 | import com.bsth.util.ConfigUtil; | 8 | import com.bsth.util.ConfigUtil; |
| 10 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| @@ -66,8 +65,8 @@ public class LedHttpPushHandler { | @@ -66,8 +65,8 @@ public class LedHttpPushHandler { | ||
| 66 | dataUrlLinked.add(url); | 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 | String url = baseUrl + "jcPlan" + params; | 70 | String url = baseUrl + "jcPlan" + params; |
| 72 | 71 | ||
| 73 | dataUrlLinked.add(url); | 72 | dataUrlLinked.add(url); |
src/main/java/com/bsth/data/real_park/CarParkRealHandler.java
| @@ -120,6 +120,12 @@ public class CarParkRealHandler { | @@ -120,6 +120,12 @@ public class CarParkRealHandler { | ||
| 120 | if (StringUtils.isEmpty(nbbm)) | 120 | if (StringUtils.isEmpty(nbbm)) |
| 121 | return; | 121 | return; |
| 122 | 122 | ||
| 123 | + Bus bus = BusDataBuffer.findOne(nbbm); | ||
| 124 | + if(!bus.isSfdc()){ | ||
| 125 | + LedHttpPushHandler.busIn(bus.getCarPlate(), "柴油泊位区");//柴油车 | ||
| 126 | + return; | ||
| 127 | + } | ||
| 128 | + | ||
| 123 | RealCarPark rcp = new RealCarPark(); | 129 | RealCarPark rcp = new RealCarPark(); |
| 124 | 130 | ||
| 125 | RegionBerth b; | 131 | RegionBerth b; |
| @@ -138,16 +144,12 @@ public class CarParkRealHandler { | @@ -138,16 +144,12 @@ public class CarParkRealHandler { | ||
| 138 | return; | 144 | return; |
| 139 | } | 145 | } |
| 140 | 146 | ||
| 147 | + rcp.setPlateNo(bus.getCarPlate()); | ||
| 141 | rcp.setBerthName(b.getName()); | 148 | rcp.setBerthName(b.getName()); |
| 142 | rcp.setNbbm(nbbm); | 149 | rcp.setNbbm(nbbm); |
| 143 | rcp.setInTime(System.currentTimeMillis()); | 150 | rcp.setInTime(System.currentTimeMillis()); |
| 144 | rcp.setType(0); | 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 | if(!busRcps.containsKey(nbbm) || StringUtils.isNotEmpty(busRcps.get(nbbm).getBerthName())){ | 154 | if(!busRcps.containsKey(nbbm) || StringUtils.isNotEmpty(busRcps.get(nbbm).getBerthName())){ |
| 153 | //电量信息 | 155 | //电量信息 |
| @@ -160,7 +162,7 @@ public class CarParkRealHandler { | @@ -160,7 +162,7 @@ public class CarParkRealHandler { | ||
| 160 | } | 162 | } |
| 161 | 163 | ||
| 162 | //push led | 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,12 +87,15 @@ public class BerthServiceImpl extends BaseServiceImpl<RegionBerth, Integer> impl | ||
| 87 | RegionBerth b = null; | 87 | RegionBerth b = null; |
| 88 | 88 | ||
| 89 | try { | 89 | try { |
| 90 | - b = nextChargeBerth(); | 90 | + /*b = nextChargeBerth(); |
| 91 | if (null != b) | 91 | if (null != b) |
| 92 | return b; | 92 | return b; |
| 93 | 93 | ||
| 94 | //最快充电完成枪的空余泊位 | 94 | //最快充电完成枪的空余泊位 |
| 95 | - b = maxElecBerth(); | 95 | + b = maxElecBerth();*/ |
| 96 | + | ||
| 97 | + //获取按顺序排列的下一个泊位 | ||
| 98 | + b = nextByOrder(); | ||
| 96 | } catch (Exception e) { | 99 | } catch (Exception e) { |
| 97 | logger.error("", e); | 100 | logger.error("", e); |
| 98 | } | 101 | } |
| @@ -180,6 +183,28 @@ public class BerthServiceImpl extends BaseServiceImpl<RegionBerth, Integer> impl | @@ -180,6 +183,28 @@ public class BerthServiceImpl extends BaseServiceImpl<RegionBerth, Integer> impl | ||
| 180 | return near; | 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 | private RegionBerth nearBerthByCp(List<RegionBerth> list) { | 208 | private RegionBerth nearBerthByCp(List<RegionBerth> list) { |
| 184 | Collections.sort(list, new Comparator<RegionBerth>() { | 209 | Collections.sort(list, new Comparator<RegionBerth>() { |
| 185 | @Override | 210 | @Override |
src/main/resources/static/pages/basic_data/bus/list.html
| @@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
| 29 | </div> | 29 | </div> |
| 30 | <div class="ct_field"> | 30 | <div class="ct_field"> |
| 31 | <label>卡号: | 31 | <label>卡号: |
| 32 | - <input class="uk-input" name="idRFID" placeholder="卡ID号"> | 32 | + <input class="uk-input" name="idRfid" placeholder="卡ID号"> |
| 33 | </label> | 33 | </label> |
| 34 | </div> | 34 | </div> |
| 35 | <div class="ct_field"> | 35 | <div class="ct_field"> |
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> | 45 | <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> |
| 46 | </div> | 46 | </div> |
| 47 | <div class="ct_field" style="vertical-align: bottom;"> | 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 | </div> | 49 | </div> |
| 50 | </form> | 50 | </form> |
| 51 | </div> | 51 | </div> |
| @@ -59,7 +59,7 @@ | @@ -59,7 +59,7 @@ | ||
| 59 | <th>车辆自编号</th> | 59 | <th>车辆自编号</th> |
| 60 | <th>ID卡号</th> | 60 | <th>ID卡号</th> |
| 61 | <th>卡标签号</th> | 61 | <th>卡标签号</th> |
| 62 | - <th>备注</th> | 62 | + <th>是否电车</th> |
| 63 | <th>操作</th> | 63 | <th>操作</th> |
| 64 | </tr> | 64 | </tr> |
| 65 | </thead> | 65 | </thead> |
| @@ -84,7 +84,7 @@ | @@ -84,7 +84,7 @@ | ||
| 84 | <td>{{b.nbbm}}</td> | 84 | <td>{{b.nbbm}}</td> |
| 85 | <td>{{b.idRfid}}</td> | 85 | <td>{{b.idRfid}}</td> |
| 86 | <td>{{b.tagRfid}}</td> | 86 | <td>{{b.tagRfid}}</td> |
| 87 | - <td>{{b.remark}}</td> | 87 | + <td>{{b.sfdc?"电车":"油车"}}</td> |
| 88 | <td><a class="edit_icon" data-nbbm="{{b.nbbm}}" uk-icon="icon: file-edit"></a></td> | 88 | <td><a class="edit_icon" data-nbbm="{{b.nbbm}}" uk-icon="icon: file-edit"></a></td> |
| 89 | </tr> | 89 | </tr> |
| 90 | {{/each}} | 90 | {{/each}} |
src/main/resources/static/pages/basic_data/person_card/list.html
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 61 | <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> | 61 | <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> |
| 62 | </div> | 62 | </div> |
| 63 | <div class="ct_field" style="vertical-align: bottom;"> | 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 | </div> | 65 | </div> |
| 66 | </form> | 66 | </form> |
| 67 | </div> | 67 | </div> |