Commit ad66430c7aee391face97da14f42ef6dde550f1f
1 parent
ef1bfdae
行车路单添加当班调派 车牌号 油电导出格式
Showing
9 changed files
with
86 additions
and
37 deletions
src/main/java/com/bsth/controller/oil/DlbController.java
| ... | ... | @@ -143,12 +143,16 @@ public class DlbController extends BaseController<Dlb, Integer>{ |
| 143 | 143 | Map<String, Object> m = new HashMap<String, Object>(); |
| 144 | 144 | m.put("rq", y.getRq()); |
| 145 | 145 | m.put("gsname",y.getGsname() ); |
| 146 | + m.put("fgsname", y.getFgsname()); | |
| 146 | 147 | m.put("xlname", y.getXlname()); |
| 147 | 148 | m.put("nbbm", y.getNbbm()); |
| 148 | 149 | m.put("jsy", y.getJsy()); |
| 150 | + m.put("name", y.getName()); | |
| 149 | 151 | m.put("cdl", y.getCdl()); |
| 150 | 152 | m.put("czcd", y.getCzcd()+"%"); |
| 151 | 153 | m.put("jzcd", y.getJzcd()+"%"); |
| 154 | + m.put("czlc", y.getCzlc()); | |
| 155 | + m.put("jzlc", y.getJzlc()); | |
| 152 | 156 | m.put("hd", y.getHd()); |
| 153 | 157 | String shyy ="无"; |
| 154 | 158 | if(y.getShyy()!=null){ |
| ... | ... | @@ -162,9 +166,11 @@ public class DlbController extends BaseController<Dlb, Integer>{ |
| 162 | 166 | else if(shyy.equals("8")){shyy="车间(小修)";} |
| 163 | 167 | else{shyy ="无";} |
| 164 | 168 | } |
| 169 | + m.put("ns", y.getNs()); | |
| 165 | 170 | m.put("shyy", shyy); |
| 166 | 171 | m.put("sh", y.getSh()); |
| 167 | 172 | m.put("zlc", y.getZlc()); |
| 173 | + m.put("rdlx", ""); | |
| 168 | 174 | m.put("bglyh", y.getBglyh()); |
| 169 | 175 | resList.add(m); |
| 170 | 176 | } | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -39,6 +39,9 @@ public class BasicData implements CommandLineRunner { |
| 39 | 39 | |
| 40 | 40 | //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) |
| 41 | 41 | public static Map<String, String> nbbm2CompanyCodeMap; |
| 42 | + | |
| 43 | + //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:牌照号) | |
| 44 | + public static Map<String, String> nbbmCompanyPlateMap; | |
| 42 | 45 | |
| 43 | 46 | //站点编码和名称对照,包括停车场 (K: lineCode_updown_stationCode ,V:站点名称) |
| 44 | 47 | public static Map<String, String> stationCode2NameMap; |
| ... | ... | @@ -195,16 +198,22 @@ public class BasicData implements CommandLineRunner { |
| 195 | 198 | BiMap<String, String> deviceId2Nbbm = HashBiMap.create(); |
| 196 | 199 | //车辆和公司代码对照 |
| 197 | 200 | Map<String, String> nbbm2CompanyCode = new HashMap<>(); |
| 201 | + | |
| 202 | + //车辆自编号和拍照号对照 | |
| 203 | + Map<String, String> nbbmCompanyPlate = new HashMap<>(); | |
| 204 | + | |
| 198 | 205 | Iterator<Cars> carIterator = carsRepository.findAll().iterator(); |
| 199 | 206 | Cars car; |
| 200 | 207 | while (carIterator.hasNext()) { |
| 201 | 208 | car = carIterator.next(); |
| 202 | 209 | deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode()); |
| 203 | 210 | nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode()); |
| 211 | + nbbmCompanyPlate.put(car.getInsideCode(), car.getCarPlate()); | |
| 204 | 212 | } |
| 205 | 213 | |
| 206 | 214 | deviceId2NbbmMap = deviceId2Nbbm; |
| 207 | 215 | nbbm2CompanyCodeMap = nbbm2CompanyCode; |
| 216 | + nbbmCompanyPlateMap =nbbmCompanyPlate; | |
| 208 | 217 | } |
| 209 | 218 | |
| 210 | 219 | /** | ... | ... |
src/main/java/com/bsth/entity/oil/Dlb.java
| ... | ... | @@ -57,7 +57,8 @@ public class Dlb { |
| 57 | 57 | private int nylx; |
| 58 | 58 | //进场顺序(根据最先出场和最后进场来关联车辆的存电量) |
| 59 | 59 | private int jcsx; |
| 60 | - | |
| 60 | + @Transient | |
| 61 | + private String name; | |
| 61 | 62 | @Transient |
| 62 | 63 | private String bglyh; |
| 63 | 64 | |
| ... | ... | @@ -67,6 +68,9 @@ public class Dlb { |
| 67 | 68 | @Transient |
| 68 | 69 | private String gsname; |
| 69 | 70 | |
| 71 | + @Transient | |
| 72 | + private String fgsname; | |
| 73 | + | |
| 70 | 74 | |
| 71 | 75 | |
| 72 | 76 | |
| ... | ... | @@ -354,6 +358,20 @@ public class Dlb { |
| 354 | 358 | public void setGsname(String gsname) { |
| 355 | 359 | this.gsname = gsname; |
| 356 | 360 | } |
| 361 | + | |
| 362 | + public String getName() { | |
| 363 | + return BasicData.allPerson.get(this.ssgsdm+"-"+this.jsy); | |
| 364 | + } | |
| 365 | + | |
| 366 | + public void setName(String name) { | |
| 367 | + this.name = name; | |
| 368 | + } | |
| 357 | 369 | |
| 358 | - | |
| 370 | + public String getFgsname() { | |
| 371 | + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm); | |
| 372 | + } | |
| 373 | + | |
| 374 | + public void setFgsname(String fgsname) { | |
| 375 | + this.fgsname = fgsname; | |
| 376 | + } | |
| 359 | 377 | } | ... | ... |
src/main/java/com/bsth/entity/oil/Ylb.java
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -22,6 +22,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 22 | 22 | List<ScheduleRealInfo> findByLines(List<String> lines); |
| 23 | 23 | |
| 24 | 24 | |
| 25 | + @Query(value="select s from ScheduleRealInfo s where s.id = ?1 ") | |
| 26 | + ScheduleRealInfo scheduleById(Long id); | |
| 27 | + | |
| 25 | 28 | @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and bc_type not in ('in','out') order by (lpName+1),clZbh,realExecDate,dfsj") |
| 26 | 29 | List<ScheduleRealInfo> scheduleDailyQp(String line,String date); |
| 27 | 30 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -801,37 +801,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 801 | 801 | DecimalFormat format = new DecimalFormat("0.00"); |
| 802 | 802 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 803 | 803 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| 804 | - | |
| 805 | - Map<String, Object> map; | |
| 804 | + //计算里程和班次数,并放入Map里 | |
| 805 | + Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); | |
| 806 | +// map=new HashMap<String,Object>(); | |
| 807 | + Map<String, Object> maps; | |
| 806 | 808 | for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { |
| 807 | - map = new HashMap<String, Object>(); | |
| 809 | + maps = new HashMap<String, Object>(); | |
| 808 | 810 | try { |
| 809 | 811 | scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); |
| 810 | 812 | scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); |
| 811 | - map = rru.getMapValue(scheduleRealInfo); | |
| 813 | + maps = rru.getMapValue(scheduleRealInfo); | |
| 812 | 814 | String zdsj = scheduleRealInfo.getZdsj(); |
| 813 | 815 | String zdsjActual = scheduleRealInfo.getZdsjActual(); |
| 814 | 816 | if (zdsj != null && zdsjActual != null && |
| 815 | 817 | !zdsj.equals(zdsjActual)) { |
| 816 | 818 | if (zdsj.compareTo(zdsjActual) > 0) { |
| 817 | - map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 818 | - map.put("slow", ""); | |
| 819 | + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 820 | + maps.put("slow", ""); | |
| 819 | 821 | } else { |
| 820 | - map.put("fast", ""); | |
| 821 | - map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 822 | + maps.put("fast", ""); | |
| 823 | + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 822 | 824 | } |
| 823 | 825 | } else { |
| 824 | - map.put("fast", ""); | |
| 825 | - map.put("slow", ""); | |
| 826 | + maps.put("fast", ""); | |
| 827 | + maps.put("slow", ""); | |
| 826 | 828 | } |
| 827 | - listMap.add(map); | |
| 829 | + listMap.add(maps); | |
| 828 | 830 | } catch (Exception e) { |
| 829 | 831 | e.printStackTrace(); |
| 830 | 832 | } |
| 831 | 833 | } |
| 832 | 834 | |
| 833 | - //计算里程和班次数,并放入Map里 | |
| 834 | - map = new HashMap<String, Object>(); | |
| 835 | + | |
| 835 | 836 | map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); |
| 836 | 837 | map.put("remMileage",culateMieageService.culateLbgl(lists)); |
| 837 | 838 | map.put("addMileage", culateMieageService.culateLjgl(lists)); |
| ... | ... | @@ -849,7 +850,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 849 | 850 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 850 | 851 | |
| 851 | 852 | list.add(listMap.iterator()); |
| 852 | - ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0), map}, path + "mould/waybill_minhang.xls", | |
| 853 | + ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0),map}, path + "mould/waybill_minhang.xls", | |
| 853 | 854 | path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); |
| 854 | 855 | return scheduleRealInfos; |
| 855 | 856 | } |
| ... | ... | @@ -3767,7 +3768,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3767 | 3768 | // TODO Auto-generated method stub |
| 3768 | 3769 | Map<String, Object> map = new HashMap<String, Object>(); |
| 3769 | 3770 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 3770 | - ScheduleRealInfo s = scheduleRealInfoRepository.findOne(id); | |
| 3771 | + ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id); | |
| 3771 | 3772 | String xlbm = s.getXlBm(); |
| 3772 | 3773 | String fcrq = s.getScheduleDateStr(); |
| 3773 | 3774 | List<Ylxxb> listYlxxb = ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq); |
| ... | ... | @@ -3793,20 +3794,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3793 | 3794 | map.put("jcyl", jcyl); |
| 3794 | 3795 | map.put("xlName", s.getXlName()); |
| 3795 | 3796 | map.put("clZbh", s.getClZbh()); |
| 3797 | + map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh())); | |
| 3796 | 3798 | map.put("fcsjActual", s.getFcsjActual()); |
| 3797 | 3799 | map.put("zdzName", s.getZdzName()); |
| 3798 | 3800 | map.put("scheduleDate", s.getScheduleDateStr()); |
| 3799 | 3801 | map.put("lpName", s.getLpName()); |
| 3800 | 3802 | String zdp = "", zwdp = "", wdp = ""; |
| 3801 | 3803 | String zdpT = "", zwdpT = "", wdpT = ""; |
| 3802 | - | |
| 3804 | + String dbdp=""; | |
| 3803 | 3805 | List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59"); |
| 3804 | 3806 | try { |
| 3805 | 3807 | Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime(); |
| 3806 | 3808 | Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime(); |
| 3807 | 3809 | Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime(); |
| 3808 | 3810 | for (int i = 0; i < list.size(); i++) { |
| 3809 | - DutyEmployee t = list.get(i); | |
| 3811 | + DutyEmployee t = list.get(i); | |
| 3812 | + if(!(dbdp.indexOf(",")>0)){ | |
| 3813 | + if(!(dbdp.length()>0)){ | |
| 3814 | + dbdp =t.getuName(); | |
| 3815 | + }else{ | |
| 3816 | + dbdp +=","+t.getuName(); | |
| 3817 | + } | |
| 3818 | + } | |
| 3810 | 3819 | Long ts = t.getTs(); |
| 3811 | 3820 | if (ts > fcsj1 && ts < fcsj2) { |
| 3812 | 3821 | if (zdp.indexOf(t.getuName()) == -1) { |
| ... | ... | @@ -3842,6 +3851,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3842 | 3851 | map.put("zdpT", zdpT); |
| 3843 | 3852 | map.put("zwdpT", zwdpT); |
| 3844 | 3853 | map.put("wdpT", wdpT); |
| 3854 | + map.put("dbdp", dbdp); | |
| 3845 | 3855 | return map; |
| 3846 | 3856 | } |
| 3847 | 3857 | |
| ... | ... | @@ -4139,37 +4149,36 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4139 | 4149 | DecimalFormat format = new DecimalFormat("0.00"); |
| 4140 | 4150 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 4141 | 4151 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| 4142 | - | |
| 4143 | - Map<String, Object> map; | |
| 4152 | + Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); | |
| 4153 | + Map<String, Object> maps; | |
| 4144 | 4154 | for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { |
| 4145 | - map = new HashMap<String, Object>(); | |
| 4155 | + maps = new HashMap<String, Object>(); | |
| 4146 | 4156 | try { |
| 4147 | 4157 | scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName()); |
| 4148 | 4158 | scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName()); |
| 4149 | - map = rru.getMapValue(scheduleRealInfo); | |
| 4159 | + maps = rru.getMapValue(scheduleRealInfo); | |
| 4150 | 4160 | String zdsj = scheduleRealInfo.getZdsj(); |
| 4151 | 4161 | String zdsjActual = scheduleRealInfo.getZdsjActual(); |
| 4152 | 4162 | if (zdsj != null && zdsjActual != null && |
| 4153 | 4163 | !zdsj.equals(zdsjActual)) { |
| 4154 | 4164 | if (zdsj.compareTo(zdsjActual) > 0) { |
| 4155 | - map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4156 | - map.put("slow", ""); | |
| 4165 | + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4166 | + maps.put("slow", ""); | |
| 4157 | 4167 | } else { |
| 4158 | - map.put("fast", ""); | |
| 4159 | - map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4168 | + maps.put("fast", ""); | |
| 4169 | + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual)); | |
| 4160 | 4170 | } |
| 4161 | 4171 | } else { |
| 4162 | - map.put("fast", ""); | |
| 4163 | - map.put("slow", ""); | |
| 4172 | + maps.put("fast", ""); | |
| 4173 | + maps.put("slow", ""); | |
| 4164 | 4174 | } |
| 4165 | - listMap.add(map); | |
| 4175 | + listMap.add(maps); | |
| 4166 | 4176 | } catch (Exception e) { |
| 4167 | 4177 | e.printStackTrace(); |
| 4168 | 4178 | } |
| 4169 | 4179 | } |
| 4170 | 4180 | |
| 4171 | 4181 | //计算里程和班次数,并放入Map里 |
| 4172 | - map = new HashMap<String, Object>(); | |
| 4173 | 4182 | map.put("jhlc", Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); |
| 4174 | 4183 | map.put("remMileage",culateMieageService.culateLbgl(lists)); |
| 4175 | 4184 | map.put("addMileage", culateMieageService.culateLjgl(lists)); |
| ... | ... | @@ -4187,7 +4196,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4187 | 4196 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 4188 | 4197 | |
| 4189 | 4198 | list.add(listMap.iterator()); |
| 4190 | - ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0), map}, path + "mould/waybill_minhang.xls", | |
| 4199 | + ee.excelReplace(list, new Object[]{map}, path + "mould/waybill_minhang.xls", | |
| 4191 | 4200 | path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); |
| 4192 | 4201 | return scheduleRealInfos; |
| 4193 | 4202 | } |
| ... | ... | @@ -4219,9 +4228,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4219 | 4228 | String jName = list.get(0); |
| 4220 | 4229 | String clZbh = list.get(1); |
| 4221 | 4230 | String lpName = list.get(2); |
| 4231 | + String jGh =list.get(3); | |
| 4222 | 4232 | for (int i = 0; i < lists_line.size(); i++) { |
| 4223 | 4233 | ScheduleRealInfo s=lists_line.get(i); |
| 4224 | - if(s.getjName().equals(jName) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){ | |
| 4234 | + if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){ | |
| 4225 | 4235 | newList.add(s); |
| 4226 | 4236 | } |
| 4227 | 4237 | } | ... | ... |
src/main/resources/static/pages/forms/mould/listDl.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/waybill_minhang.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -305,6 +305,9 @@ |
| 305 | 305 | param[index] = new Array(); |
| 306 | 306 | $(this).children().each(function(i){ |
| 307 | 307 | param[index][i] = $(this).text().split("\\")[0]; |
| 308 | + if(i==0){ | |
| 309 | + param[index][3] = $(this).text().split("\\")[1]; | |
| 310 | + } | |
| 308 | 311 | }); |
| 309 | 312 | }); |
| 310 | 313 | $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){ |
| ... | ... | @@ -361,11 +364,11 @@ |
| 361 | 364 | <td colspan="14">行车路单</td> |
| 362 | 365 | </tr> |
| 363 | 366 | <tr> |
| 364 | - <td colspan="14">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}} 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派: 日期:{{scheduleDate}}</td> | |
| 367 | + <td colspan="14">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}}({{plate}}) 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派:{{dbdp}} 日期:{{scheduleDate}}</td> | |
| 365 | 368 | </tr> |
| 366 | 369 | <tr> |
| 367 | - <td colspan="2">出场存油 {{ccyl}};升</td> | |
| 368 | - <td colspan="2">加注油量 {{jzl}}升</td> | |
| 370 | + <td colspan="2">出场存油 {{ccyl}}升</td> | |
| 371 | + <td colspan="2">加注量 {{jzl}}升</td> | |
| 369 | 372 | <td colspan="2">进场存油 {{jcyl}}升</td> |
| 370 | 373 | <td colspan="4">加注机油 升</td> |
| 371 | 374 | <td colspan="4">本日耗油 {{yh}}升</td> | ... | ... |