Commit eed6c571a3892347ff3429c4722116a2128b4cd4
1 parent
07ae3e61
油量 电量 消耗 不排除损耗
Showing
6 changed files
with
47 additions
and
63 deletions
src/main/java/com/bsth/controller/oil/DlbController.java
| ... | ... | @@ -21,6 +21,7 @@ import com.bsth.controller.BaseController; |
| 21 | 21 | import com.bsth.entity.oil.Dlb; |
| 22 | 22 | import com.bsth.entity.oil.Ylb; |
| 23 | 23 | import com.bsth.service.oil.DlbService; |
| 24 | +import com.bsth.util.Arith; | |
| 24 | 25 | import com.bsth.util.ReportUtils; |
| 25 | 26 | import com.google.common.base.Splitter; |
| 26 | 27 | |
| ... | ... | @@ -164,10 +165,10 @@ public class DlbController extends BaseController<Dlb, Integer>{ |
| 164 | 165 | String shyy ="无"; |
| 165 | 166 | if(y.getShyy()!=null){ |
| 166 | 167 | shyy=y.getShyy(); |
| 167 | - if(shyy.equals("1")){shyy="票务用油";} | |
| 168 | - else if(shyy.equals("2")){shyy="保养用油";} | |
| 169 | - else if(shyy.equals("3")){shyy="报废车用油";} | |
| 170 | - else if(shyy.equals("4")){shyy="其它用油";} | |
| 168 | + if(shyy.equals("1")){shyy="票务用电";} | |
| 169 | + else if(shyy.equals("2")){shyy="保养用电";} | |
| 170 | + else if(shyy.equals("3")){shyy="报废车用电";} | |
| 171 | + else if(shyy.equals("4")){shyy="其它用电";} | |
| 171 | 172 | else if(shyy.equals("5")){shyy="人保部";} |
| 172 | 173 | else if(shyy.equals("6")){shyy="车队";} |
| 173 | 174 | else if(shyy.equals("7")){shyy="车间(高保)";} |
| ... | ... | @@ -180,6 +181,7 @@ public class DlbController extends BaseController<Dlb, Integer>{ |
| 180 | 181 | m.put("zlc", y.getZlc()<=0?"0":y.getZlc()); |
| 181 | 182 | m.put("rdlx", ""); |
| 182 | 183 | m.put("bglyh", y.getBglyh()); |
| 184 | + m.put("zdh", Arith.add(y.getSh(), y.getHd())); | |
| 183 | 185 | resList.add(m); |
| 184 | 186 | } |
| 185 | 187 | try { | ... | ... |
src/main/java/com/bsth/controller/oil/YlbController.java
| ... | ... | @@ -27,6 +27,7 @@ import com.bsth.entity.oil.Ylb; |
| 27 | 27 | import com.bsth.entity.sys.SysUser; |
| 28 | 28 | import com.bsth.security.util.SecurityUtils; |
| 29 | 29 | import com.bsth.service.oil.YlbService; |
| 30 | +import com.bsth.util.Arith; | |
| 30 | 31 | import com.bsth.util.ReportUtils; |
| 31 | 32 | import com.google.common.base.Splitter; |
| 32 | 33 | |
| ... | ... | @@ -273,6 +274,7 @@ public class YlbController extends BaseController<Ylb, Integer>{ |
| 273 | 274 | m.put("sh", y.getSh()<=0?"0":y.getSh()); |
| 274 | 275 | m.put("zlc", y.getZlc()<=0?"0":y.getZlc()); |
| 275 | 276 | m.put("bglyh", y.getBglyh()); |
| 277 | + m.put("zyh", Arith.add(y.getSh(), y.getYh())); | |
| 276 | 278 | resList.add(m); |
| 277 | 279 | } |
| 278 | 280 | try { | ... | ... |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| ... | ... | @@ -273,18 +273,18 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - Map<String, Double> shMap=new HashMap<String,Double>(); | |
| 277 | - for (int i = 0; i < dlList.size(); i++) { | |
| 278 | - Dlb dlb=dlList.get(i); | |
| 279 | - String cl=dlb.getNbbm(); | |
| 280 | - if(shMap.get(cl)==null){ | |
| 281 | - shMap.put(cl, dlb.getSh()); | |
| 282 | - }else{ | |
| 283 | - double sh=shMap.get(cl); | |
| 284 | - shMap.remove(cl); | |
| 285 | - shMap.put(cl, Arith.add(sh, dlb.getSh())); | |
| 286 | - } | |
| 287 | - } | |
| 276 | +// Map<String, Double> shMap=new HashMap<String,Double>(); | |
| 277 | +// for (int i = 0; i < dlList.size(); i++) { | |
| 278 | +// Dlb dlb=dlList.get(i); | |
| 279 | +// String cl=dlb.getNbbm(); | |
| 280 | +// if(shMap.get(cl)==null){ | |
| 281 | +// shMap.put(cl, dlb.getSh()); | |
| 282 | +// }else{ | |
| 283 | +// double sh=shMap.get(cl); | |
| 284 | +// shMap.remove(cl); | |
| 285 | +// shMap.put(cl, Arith.add(sh, dlb.getSh())); | |
| 286 | +// } | |
| 287 | +// } | |
| 288 | 288 | List<Jdl> jdlList=jdlRepository.JdlList(rq); |
| 289 | 289 | String sxtj=map2.get("sxtj").toString(); |
| 290 | 290 | if(sxtj.equals("0")){ |
| ... | ... | @@ -357,13 +357,13 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 357 | 357 | zjzl = Arith.add(zjzl,jdl.getJdl()); |
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | - double clsh=0.0; | |
| 361 | - if(shMap.get(map_.get("clZbh").toString())==null){ | |
| 362 | - clsh=0.0; | |
| 363 | - }else{ | |
| 364 | - clsh=shMap.get(map_.get("clZbh").toString()); | |
| 365 | - } | |
| 366 | - zjzl =Arith.sub(zjzl, clsh); | |
| 360 | +// double clsh=0.0; | |
| 361 | +// if(shMap.get(map_.get("clZbh").toString())==null){ | |
| 362 | +// clsh=0.0; | |
| 363 | +// }else{ | |
| 364 | +// clsh=shMap.get(map_.get("clZbh").toString()); | |
| 365 | +// } | |
| 366 | +// zjzl =Arith.sub(zjzl, clsh); | |
| 367 | 367 | Double nextJzyl = 0.0; |
| 368 | 368 | for (int i = 0; i < listpb.size(); i++) { |
| 369 | 369 | Map<String, Object> map = listpb.get(i); |
| ... | ... | @@ -465,7 +465,6 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS |
| 465 | 465 | t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); |
| 466 | 466 | t.setRq(sdf.parse(rq)); |
| 467 | 467 | t.setLp(map.get("lpName").toString()); |
| 468 | - t.setCdl(Arith.add(t.getCdl(), t.getSh())); | |
| 469 | 468 | if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ |
| 470 | 469 | if(type.equals("add")){ |
| 471 | 470 | t.setCreatetime(date); | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -528,16 +528,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 528 | 528 | List<Ylb> ylbList =new ArrayList<Ylb>(); |
| 529 | 529 | List<Ylb> ylbLists =new ArrayList<Ylb>(); |
| 530 | 530 | List<Ylb> iterator2=new ArrayList<Ylb>(); |
| 531 | -// if(xlbm.equals("")){ | |
| 532 | - ylbLists=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 533 | -// repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 534 | - iterator2=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx"); | |
| 535 | -// repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx"); | |
| 536 | -// }else{ | |
| 537 | -// ylbLists=repository.obtainYl_eq(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 538 | -// iterator2=repository.obtainYl_eq(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx"); | |
| 539 | -// } | |
| 540 | - | |
| 531 | + ylbLists=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx"); | |
| 532 | + iterator2=this.listOrderBy(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx"); | |
| 541 | 533 | // 从排班表中计算出行驶的总里程 |
| 542 | 534 | |
| 543 | 535 | String sxtj=map.get("sxtj").toString(); |
| ... | ... | @@ -594,7 +586,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 594 | 586 | zlc = Arith.add(zlc, Double.valueOf(sumList.get(j)[1].toString())); |
| 595 | 587 | zsh = Arith.add(zsh, Double.valueOf(sumList.get(j)[2].toString())); |
| 596 | 588 | } |
| 597 | - jzl = Arith.sub(jzl, zsh); | |
| 589 | +// jzl = Arith.sub(jzl, zsh); | |
| 598 | 590 | // 保留两位小数 |
| 599 | 591 | DecimalFormat df = new DecimalFormat("#.00"); |
| 600 | 592 | Double zyl = 0.0; |
| ... | ... | @@ -622,7 +614,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 622 | 614 | if(zlc>0 ){ |
| 623 | 615 | yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); |
| 624 | 616 | } |
| 625 | - nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()), t.getCzyl()),yh); | |
| 617 | + nextJzyl =Arith.sub( Arith.add(t.getJzl(), t.getCzyl()),yh); | |
| 618 | +// nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()), t.getCzyl()),yh); | |
| 626 | 619 | //把进场油量的小数和整数分别取出 |
| 627 | 620 | // int ylxs=(int) nextJzyl; 10.6--11 10.3--10 |
| 628 | 621 | if(zlc>0 && t.getZlc()>0){ |
| ... | ... | @@ -643,7 +636,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 643 | 636 | if(zlc>0){ |
| 644 | 637 | yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); |
| 645 | 638 | } |
| 646 | - nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()),nextJzyl),yh); | |
| 639 | + nextJzyl =Arith.sub( Arith.add(t.getJzl(),nextJzyl),yh); | |
| 640 | +// nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()),nextJzyl),yh); | |
| 647 | 641 | if(zlc>0 && t.getZlc()>0){ |
| 648 | 642 | long l=0l; |
| 649 | 643 | double ylxs=0.0; |
| ... | ... | @@ -1159,26 +1153,11 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1159 | 1153 | Integer id =jsonObject.getInteger("id"); |
| 1160 | 1154 | String nbbm =jsonObject.getString("nbbm"); |
| 1161 | 1155 | String rq=jsonObject.getString("rq"); |
| 1162 | - double yh = Arith.sub(Arith.add(czyl, jzl), Arith.add(jzyl, sh)); | |
| 1156 | + double yh = Arith.sub(Arith.add(czyl, jzl),sh); | |
| 1163 | 1157 | if(yh<0){ |
| 1164 | 1158 | yh=0.0; |
| 1165 | 1159 | } |
| 1166 | - /*t.setJzyl(jzyl); | |
| 1167 | - t.setSh(sh); | |
| 1168 | - t.setShyy(shyy); | |
| 1169 | - t.setNs(ns); | |
| 1170 | - t.setRylx(rylx); | |
| 1171 | - t.setId(jsonObject.getInteger("id"));*/ | |
| 1172 | 1160 | repository.ylbUpdate(id, czyl, jzyl, yh, sh, shyy, ns, rylx,yhlx); |
| 1173 | - /*for (int z = 0; z < cylList.size(); z++) { | |
| 1174 | - Cyl cyl = cylList.get(z); | |
| 1175 | - if (nbbm.equals(cyl.getNbbm())) { | |
| 1176 | - cyl.setCyl(jzyl); | |
| 1177 | - cyl.setUpdatetime(sdf.parse(rq)); | |
| 1178 | - break; | |
| 1179 | - } | |
| 1180 | - cylRepository.save(cyl); | |
| 1181 | - }*/ | |
| 1182 | 1161 | } |
| 1183 | 1162 | // List<Map<String, Object>> list=(List<Map<String, Object>>) map.get("ylbList"); |
| 1184 | 1163 | |
| ... | ... | @@ -1232,12 +1211,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1232 | 1211 | } |
| 1233 | 1212 | // jzl = Arith.sub(jzl, zsh); |
| 1234 | 1213 | //新的 损耗不等于 旧的损耗 总损耗从新算 |
| 1235 | - if(Arith.sub(ylb.getSh(),sh )!=0){ | |
| 1214 | + /*if(Arith.sub(ylb.getSh(),sh )!=0){ | |
| 1236 | 1215 | zsh =Arith.add(Arith.sub(zsh, ylb.getSh()), sh); |
| 1237 | 1216 | jzl =Arith.sub(jzl, zsh); |
| 1238 | 1217 | }else{ |
| 1239 | 1218 | jzl =Arith.sub(jzl, zsh); |
| 1240 | - } | |
| 1219 | + }*/ | |
| 1241 | 1220 | map.put("nbbm_eq", nbbm_eq); |
| 1242 | 1221 | map.put("rq_eq", rq_eq); |
| 1243 | 1222 | |
| ... | ... | @@ -1264,7 +1243,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1264 | 1243 | if (zlc > 0 && t.getZlc() > 0) { |
| 1265 | 1244 | yh = Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); |
| 1266 | 1245 | } |
| 1267 | - nextJzyl =Arith.sub(Arith.add(t.getJzl(), t.getCzyl()), Arith.add(yh, t.getSh())); | |
| 1246 | + nextJzyl =Arith.sub(Arith.add(t.getJzl(), t.getCzyl()), yh); | |
| 1247 | +// nextJzyl =Arith.sub(Arith.add(t.getJzl(), t.getCzyl()), Arith.add(yh, t.getSh())); | |
| 1268 | 1248 | if(zlc>0 && t.getZlc() > 0){ |
| 1269 | 1249 | long l=Math.round(nextJzyl); |
| 1270 | 1250 | double ylxs=l*100/100; |
| ... | ... | @@ -1287,7 +1267,8 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 1287 | 1267 | if (t.getZlc() >= 0) { |
| 1288 | 1268 | yh= Double.parseDouble(df.format(zyl * (t.getZlc() / zlc))); |
| 1289 | 1269 | } |
| 1290 | - nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh())); | |
| 1270 | +// nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh())); | |
| 1271 | + nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), yh); | |
| 1291 | 1272 | if(zlc>0 && t.getZlc() >0){ |
| 1292 | 1273 | long l=0l; |
| 1293 | 1274 | double ylxs=0.0; | ... | ... |
src/main/resources/static/pages/electricity/list/list.html
| ... | ... | @@ -534,7 +534,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 534 | 534 | $("#sumSh").html(returns.sh); |
| 535 | 535 | }); |
| 536 | 536 | |
| 537 | - $('input').on('input propertychange',function(){ | |
| 537 | + /* $('input').on('input propertychange',function(){ | |
| 538 | 538 | var id=$(this).data('id'); |
| 539 | 539 | var cdl =$('.in_carpark_cdl[data-id='+id+']', '#dl_oil_list').html(); |
| 540 | 540 | if(cdl=="" || cdl ==null){ |
| ... | ... | @@ -552,7 +552,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 552 | 552 | } |
| 553 | 553 | $('.in_carpark_hd[data-id='+id+']', '#dl_oil_list').val(subValue); |
| 554 | 554 | |
| 555 | - }); | |
| 555 | + }); */ | |
| 556 | 556 | }); |
| 557 | 557 | } |
| 558 | 558 | ... | ... |
src/main/resources/static/pages/oil/list_ph.html
| ... | ... | @@ -327,7 +327,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 327 | 327 | //var id = 15; |
| 328 | 328 | //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list') |
| 329 | 329 | |
| 330 | - $(".checkYl").on('click', function () { | |
| 330 | + $("#checkYl").on('click', function () { | |
| 331 | 331 | //console.log("核对加注量"); |
| 332 | 332 | if ($("#rq").val() != "") { |
| 333 | 333 | var params=getParamsList(); |
| ... | ... | @@ -342,7 +342,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 342 | 342 | }) |
| 343 | 343 | |
| 344 | 344 | //进场等于出场 |
| 345 | - $(".outAndIn").on('click', function () { | |
| 345 | + $("#outAndIn").on('click', function () { | |
| 346 | 346 | // console.log("进场油量等于出场油量"); |
| 347 | 347 | if ($("#rq").val() != "") { |
| 348 | 348 | var params=getParamsList(); |
| ... | ... | @@ -726,7 +726,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 726 | 726 | sh=0; |
| 727 | 727 | } |
| 728 | 728 | var addNum=accAdd(jzl,czyl); |
| 729 | - var subNum=accAdd(jzyl,sh); | |
| 729 | + var subNum=jzyl; | |
| 730 | 730 | var sub=numSubtr(addNum*1000,subNum*1000); |
| 731 | 731 | var subValue=0; |
| 732 | 732 | if(sub/1000>=0){ |
| ... | ... | @@ -859,7 +859,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | //删除 |
| 862 | - $('#removeButton').on('click', function () { | |
| 862 | + $('.removeButton').on('click', function () { | |
| 863 | 863 | var idArray = []; |
| 864 | 864 | var x=0; |
| 865 | 865 | $('input.icheck:checked').each(function(){ | ... | ... |