Commit 72edb1279352a0c5dedc1343542d38d53f4ad34a

Authored by 徐烜
2 parents 45829904 b880f6cd

Merge branch 'minhang' into pudong

src/main/java/com/bsth/entity/oil/Ylxxb.java
... ... @@ -45,6 +45,9 @@ public class Ylxxb {
45 45 @Transient
46 46 private String fgsname;
47 47  
  48 + @Transient
  49 + private Double zjzl;
  50 +
48 51  
49 52 public Integer getId() {
50 53 return id;
... ... @@ -184,5 +187,13 @@ public class Ylxxb {
184 187 public void setFgsname(String fgsname) {
185 188 this.fgsname = fgsname;
186 189 }
  190 + public Double getZjzl() {
  191 + return zjzl;
  192 + }
  193 + public void setZjzl(Double zjzl) {
  194 + this.zjzl = zjzl;
  195 + }
  196 +
  197 +
187 198  
188 199 }
... ...
src/main/java/com/bsth/repository/oil/YlxxbRepository.java
... ... @@ -20,7 +20,7 @@ public interface YlxxbRepository extends BaseRepository<Ylxxb, Integer>{
20 20 @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nylx=?2 and gsdm like %?3%",nativeQuery=true)
21 21 List<Ylxxb> obtainYlxx(String rq,int nylx,String gsdm);
22 22  
23   - @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and ssgs=?2",nativeQuery=true)
  23 + @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and gsdm=?2",nativeQuery=true)
24 24 List<Ylxxb> checkYlxx(String rq,String gs);
25 25  
26 26 @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nbbm =?2 and jylx=1",nativeQuery=true)
... ...
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
... ... @@ -31,6 +31,7 @@ import com.bsth.repository.oil.CwjyRepository;
31 31 import com.bsth.repository.oil.YlxxbRepository;
32 32 import com.bsth.service.impl.BaseServiceImpl;
33 33 import com.bsth.service.oil.CwjyService;
  34 +import com.bsth.util.Arith;
34 35 import com.bsth.util.PageHelper;
35 36 import com.bsth.util.PageObject;
36 37  
... ... @@ -314,7 +315,19 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
314 315 return t;
315 316 }
316 317 });
317   -
  318 + List<Ylxxb> list= ylxxbRepository.checkYlxx(rq, gsdm);
  319 + for (int i = 0; i < yList.size(); i++) {
  320 + Ylxxb t=yList.get(i);
  321 + Double zjzl=0.0;
  322 + for (int j = 0; j < list.size(); j++) {
  323 + Ylxxb y=list.get(j);
  324 + if(t.getNbbm().equals(y.getNbbm())){
  325 + zjzl=Arith.add(zjzl, y.getJzl());
  326 + }
  327 +
  328 + }
  329 + t.setZjzl(zjzl);
  330 + }
318 331 return yList;
319 332 }
320 333  
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
... ... @@ -529,11 +529,8 @@ public class CulateMileageServiceImpl implements CulateMileageService{
529 529 if(!scheduleRealInfo.isSflj()){
530 530 if (scheduleRealInfo.getBcType().equals("in")
531 531 || scheduleRealInfo.getBcType().equals("out")|| scheduleRealInfo.getBcType().equals("ldks")) {
532   - double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
533   - if(jhlcOrig-scheduleRealInfo.getJhlc()>0){
  532 + if(!scheduleRealInfo.isSflj()){
534 533 jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
535   - }else{
536   - jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
537 534 }
538 535 }
539 536 }
... ...
src/main/resources/fatso/handle_real_ctl.js
... ... @@ -17,7 +17,7 @@ var pName = &#39;bsth_control&#39;
17 17 , path = process.cwd()
18 18 //根目录
19 19 , root = path.substr(0, path.indexOf(separator + 'src'+separator+'main'))
20   - , workspace = root.substr(0, root.indexOf(separator + pName))
  20 + , workspace = root.substr(0, root.lastIndexOf(separator + pName))
21 21 //临时目录
22 22 , dest = (workspace + separator + pName + '@fatso_copy')//.replace(/\//g, '\\')
23 23 , _static = separator + 'src'+separator+'main'+separator+'resources'+separator+'static';
... ...
src/main/resources/fatso/start.js
... ... @@ -22,7 +22,7 @@ var excludes = [&#39;scheduleApp&#39;, &#39;trafficManage&#39;, &#39;control&#39;]
22 22 ,path = process.cwd()
23 23 //根目录
24 24 ,root = path.substr(0, path.indexOf(separator + 'src'+separator+'main'))
25   - ,workspace = root.substr(0, root.indexOf(separator + pName))
  25 + ,workspace = root.substr(0, root.lastIndexOf(separator + pName))
26 26 //临时目录
27 27 ,dest = (workspace + separator + pName+'@fatso_copy')
28 28 ,_static = separator + 'src'+separator+'main'+separator+'resources'+separator+'static'
... ...
src/main/resources/static/pages/base/timesmodel/gantt.html
... ... @@ -71,6 +71,11 @@
71 71 </a>
72 72 </li>
73 73 <li>
  74 + <a href="javascript:" class="tool-action editlp">
  75 + <i class="fa fa-pencil"></i>&nbsp;修改路牌
  76 + </a>
  77 + </li>
  78 + <li>
74 79 <a href="javascript:" class="tool-action addlp">
75 80 <i class="fa fa-plus"></i>&nbsp;添加路牌
76 81 </a>
... ...
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
... ... @@ -58,7 +58,7 @@ var BaseFun = function() {
58 58 var array = new Array();
59 59 if(len>0) {
60 60 for(var y = 0; y<len; y++) {
61   - array.push({lp:null,lpNo:y+1,lpName:y+1,lpType:'普通路牌'});//添加一个路牌对象
  61 + array.push({lp:null,lpNo:y+1, parent :y+1, lpName:y+1,lpType:'普通路牌'});//添加一个路牌对象
62 62 };
63 63 }
64 64 return array;
... ... @@ -348,8 +348,16 @@ var BaseFun = function() {
348 348 // 遍历班次数.
349 349 for(var i =0 ; i <jsonArray.length; i++) {
350 350 // 判断当期遍历的班次是否属于当前的路牌.
351   - if(jsonArray[i].lpNo == lpNo)
  351 + if(jsonArray[i].lpNo == lpNo) {
  352 + jsonArray[i].lpName = bxrclist[x].type + '_' + lpNo ;
352 353 lpbc.push(jsonArray[i]);
  354 + }
  355 +
  356 + }
  357 + for(var l = 0 ; l <cara.length;l++ ) {
  358 + if(cara[l].lpNo == lpNo) {
  359 + cara[l].lpName = bxrclist[x].type + '_' + lpNo ;
  360 + }
353 361 }
354 362 // 按照发车序号顺序排序.
355 363 lpbc.sort(function(a,b){return b.fcno-a.fcno});
... ... @@ -376,8 +384,10 @@ var BaseFun = function() {
376 384 // 遍历班次数.
377 385 for(var x =0 ; x <jar.length; x++) {
378 386 // 判断当期遍历的班次是否属于当前的路牌.
379   - if(jar[x].lpNo == lpNo_)
  387 + if(jar[x].lpNo == lpNo_) {
  388 + delete jar[x].fcint;
380 389 lpbc_.push(jar[x]);
  390 + }
381 391 }
382 392 // 按照发车序号顺序排序.
383 393 lpbc_.sort(function(a,b){return a.fcno-b.fcno});
... ... @@ -521,7 +531,7 @@ var BaseFun = function() {
521 531 var fcno = 0,dxfno = 0,stas = false;
522 532 for(var b = 0 ; b < bc.length;b++) {
523 533 var fxdm = baseF.dirDmToIndex(bc[b].xlDir);
524   - var car = {'lp':bc[b].lp, 'lpNo':bc[b].lpNo, 'lpName':bc[b].lpName, 'lpType':bc[b].lpType};
  534 + var car = {'lp':bc[b].lp, 'lpNo':bc[b].lpNo, 'lpName':bc[b].lpName, 'lpType':bc[b].lpType };
525 535 if(b==0) {
526 536 var dqbcfcsj = baseF.getDateTime(bc[b].fcsj);
527 537 result.push(baseF.getbcObj(
... ...
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
... ... @@ -245,17 +245,46 @@ $(&#39;.aboutread&#39;).on(&#39;click&#39;,function() {
245 245 layer.closeAll();
246 246 // 执行选择框关闭函数.
247 247 RelationshipGraph.gClose();
248   - // 执行均匀发车间隙函数.
  248 + // 执行调整班次函数.
249 249 RelationshipGraph.aboutread();
250 250 });
251 251 }else {
252   - // 执行均匀发车间隙函数
  252 + // 执行调整班次函数
253 253 RelationshipGraph.aboutread();
254 254 }
255 255 });
256 256 /************************************************************************************************************************************************/
257 257  
258 258 /**
  259 + * @description : (TODO) 修改路牌点击事件
  260 + *
  261 + * @status OK.
  262 + ************************************************************************************************************************************************/
  263 +$('.editlp').on('click',function() {
  264 + // 判断选择框是否存在.
  265 + if(RelationshipGraph.getFlagIndex()>0) {
  266 + // 关闭所有提示弹出层.
  267 + layer.closeAll();
  268 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【修改路牌】!', {
  269 + btn : [ '确认提示并提交', '取消' ]
  270 + },function () {
  271 + // 关闭所有提示弹出层.
  272 + layer.closeAll();
  273 + // 执行选择框关闭函数.
  274 + RelationshipGraph.gClose();
  275 + // 执行修改路牌函数.
  276 + RelationshipGraph.editlpEvents();
  277 + });
  278 + }else {
  279 + // 执行修改路牌函数
  280 + RelationshipGraph.editlpEvents();
  281 + }
  282 +});
  283 +/************************************************************************************************************************************************/
  284 +
  285 +
  286 +
  287 +/**
259 288 * @description : (TODO) 监听保存数据事件.
260 289 *
261 290 * @status OK.
... ... @@ -438,7 +467,7 @@ var createTooltip = function createTooltip(self) {
438 467 count = keys.length,
439 468 rows = [];
440 469 var showKeys = self.configuration.showKeys;
441   - var hiddenKeys = ['_PRIVATE_' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR','lpNo','lpName','lp','lpType',
  470 + var hiddenKeys = ['_PRIVATE_' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR','lpNo','parent','lp','lpType',
442 471 'jhlc','tcc','ttinfo','xl','isfb','qdz','zdz','isSwitchXl','bz','bcs',/*'fcno'*/];
443 472 while (count--) {
444 473 var element = keys[count];
... ... @@ -459,7 +488,7 @@ var createTooltip = function createTooltip(self) {
459 488 changeKey = '停息时间:';
460 489 else if(element=='xlDir')
461 490 changeKey = '行驶方向:';
462   - else if(element=='parent')
  491 + else if(element=='lpName')
463 492 changeKey = '当前路牌:';
464 493 else if(element=='bcType')
465 494 changeKey = '班次类型:';
... ... @@ -607,7 +636,6 @@ var RelationshipGraph = function () {
607 636 .attr('height', this.configuration.height + this.configuration.heightMargin)
608 637 .attr('style', 'display: block')
609 638 .append('g').attr("class", "gantt-chart");
610   -
611 639 // 创建时间线性区域
612 640 var x = d3.time
613 641 .scale()
... ... @@ -1197,6 +1225,7 @@ var RelationshipGraph = function () {
1197 1225 $_GlobalGraph.configuration.taskTypes.push({'lp':null,'lpName':len+1,'lpNo':len+1,'lpType':'普通路牌'});
1198 1226 // 添加路牌编码
1199 1227 $_GlobalGraph.configuration.lpNoA.push(len+1);
  1228 + $_GlobalGraph.configuration.lpNameA.push(len+1);
1200 1229 // 修改图形高度
1201 1230 $_GlobalGraph.configuration.height = $_GlobalGraph.configuration.lpNoA.length*60 + 240;
1202 1231 // 修改初始化图形时间轴开始时间
... ... @@ -1374,6 +1403,15 @@ var RelationshipGraph = function () {
1374 1403 }
1375 1404  
1376 1405 }, {
  1406 + key : 'editlpEvents',
  1407 + value : function() {
  1408 + // 弹出层mobal页面
  1409 + $.get('/pages/base/timesmodel/editlp.html', function(m){
  1410 + $(pjaxContainer).append(m);
  1411 + $('#editlp_mobal').trigger('editlpMobal.show',[$_GlobalGraph,BaseFun]);
  1412 + });
  1413 + }
  1414 + }, {
1377 1415 key : 'checkAdd',
1378 1416 value : function checkAdd() {
1379 1417 var xl = $_GlobalGraph.configuration.dataMap.map.lineName.split('_');
... ... @@ -1520,7 +1558,8 @@ var RelationshipGraph = function () {
1520 1558 * */
1521 1559 key : 'setYValue',
1522 1560 value : function setYValue(obj) {
1523   - return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY;
  1561 + /*return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY;*/
  1562 + return $_GlobalGraph.configuration.y(obj.lpName) + $_GlobalGraph.configuration.offsetY;
1524 1563 }
1525 1564 }, {
1526 1565 /**
... ... @@ -1747,7 +1786,8 @@ var RelationshipGraph = function () {
1747 1786 * */
1748 1787 key : 'setCirclecyV',
1749 1788 value : function setCirclecyV(obj) {
1750   - return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 12;
  1789 + /*return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 12;*/
  1790 + return $_GlobalGraph.configuration.y(obj.lpName) + $_GlobalGraph.configuration.offsetY + 12;
1751 1791 }
1752 1792 }, {
1753 1793 /**
... ... @@ -1902,7 +1942,9 @@ var RelationshipGraph = function () {
1902 1942 * */
1903 1943 key : 'setText04YV',
1904 1944 value : function setText04YV(obj) {
1905   - return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 16;
  1945 + /*return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 16;*/
  1946 + return $_GlobalGraph.configuration.y(obj.lpName) +$_GlobalGraph.configuration.offsetY + 16;
  1947 +
1906 1948 }
1907 1949 }, {
1908 1950 /**
... ...
src/main/resources/static/pages/base/timesmodel/js/gantt.js
... ... @@ -378,7 +378,7 @@
378 378 ra.push(arr[i].lpNo);
379 379 name.push(arr[i].lpName);
380 380 }
381   - return {'lpNoA':ra,'lpNameA':name};
  381 + return {'lpNoA':ra,'lpNameA':name,};
382 382 }
383 383 /**
384 384 * @description : (TODO) 获取甘特图参数配置信息.
... ...
src/main/resources/static/pages/oil/jyglList.html
... ... @@ -69,7 +69,7 @@
69 69 <th width="3%">油价</th>
70 70 <th width="4%">路单工号</th>
71 71 <th width="4%">备注</th>
72   - <th width="10%">操作</th>
  72 + <th width="10%">总加注量</th>
73 73 </tr>
74 74 <tr role="row" class="filter">
75 75 <td></td>
... ... @@ -160,7 +160,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
160 160 type="text" value="{{obj.bz}}" style=" width:45px" />
161 161 </td>
162 162 <td>
163   - <!--<a class="btn btn-sm blue btn-outline" onclick="editCyjy('{{obj.nbbm}}')" data-pjax><i class="fa fa-edit"></i> 编辑</a>-->
  163 + {{obj.zjzl}}
164 164 </td>
165 165 </tr>
166 166 {{/each}}
... ... @@ -200,7 +200,6 @@ $(function(){
200 200 params['fgsbm']=$("#jyglListFgsdmId").val();
201 201 params['rq']=$("#rq").val();
202 202 var i = layer.load(2);
203   - console.log(params);
204 203 $post('/cwjy/savejzl', params, function(){
205 204 layer.close(i);
206 205 var cells = $('tr.filter')[0].cells
... ... @@ -316,7 +315,7 @@ $(function(){
316 315 params['page'] = page;
317 316 params['rq']=$("#rq").val();
318 317  
319   - var i = 2;
  318 + var i = layer.load(2);;
320 319 /* var jyglGsdm=$("#jyglListGsdmId").val();
321 320 var jyglFgsdm=$("#jyglListFgsdmId").val();
322 321 if(jyglGsdm=="" || jyglGsdm==null){
... ... @@ -340,7 +339,6 @@ $(function(){
340 339 $.each(data, function(i, obj) {
341 340 obj.yyrq = $("#rq").val();
342 341 });
343   - console.log(data)
344 342 var bodyHtm = template('jygl_list_temp', {list: data});
345 343 $('#datatable_cwjy tbody').html(bodyHtm);
346 344 iCheckChange();
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -229,7 +229,9 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
229 229 onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')">
230 230 </td>
231 231 <td>
232   - {{obj.yh}}
  232 +
  233 + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_yh"
  234 + type="text" value="{{obj.yh}}" style=" width:50px" disabled="true" readOnly="true" />
233 235 </td>
234 236 <td>
235 237 <select data-id="{{obj.id}}" class="in_carpark_rylx" style=" width:80px" >
... ... @@ -319,7 +321,6 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
319 321 }
320 322 });
321 323  
322   -
323 324 //保存
324 325 $("#saveButton").on('click',function(){
325 326 var ylArray = [];
... ... @@ -627,9 +628,83 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
627 628 });
628 629 // startOptJzylLink($('#ll_oil_list .in_carpark_jzyl'));
629 630 // startOptShylLink($('#ll_oil_list .in_carpark_shyl'));
  631 + $('input').on('input propertychange',function(){
  632 + var id=$(this).data('id');
  633 + var jzl =$('.in_carpark_jzl[data-id='+id+']', '#ll_oil_list').html();
  634 + if(jzl=="" || jzl ==null){
  635 + jzl=0;
  636 + }
  637 + var czyl=$('.in_carpark_czyl[data-id='+id+']', '#ll_oil_list').val();
  638 + if(czyl=="" || czyl==null){
  639 + czyl=0;
  640 + }
  641 + var jzyl=$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').val();
  642 + if(jzyl=="" || jzyl==null){
  643 + jzyl=0;
  644 + }
  645 +
  646 + var sh = $('.in_carpark_shyl[data-id='+id+']', '#ll_oil_list').val();
  647 + if(sh=="" || sh==null){
  648 + sh=0;
  649 + }
  650 + var addNum=accAdd(jzl,czyl);
  651 + var subNum=accAdd(jzyl,sh);
  652 + var sub=numSubtr(addNum*1000,subNum*1000);
  653 + var subValue=0;
  654 + if(sub/1000>=0){
  655 + subValue=sub/1000;
  656 + }
  657 + $('.in_carpark_yh[data-id='+id+']', '#ll_oil_list').val(subValue);
  658 +
  659 + });
630 660 });
631 661 }
  662 +
  663 + //页面计算防止精度丢失
  664 + var accAdd = function (a, b) {
  665 + var c, d, e;
  666 + try {
  667 + c = a.toString().split(".")[1].length;
  668 + } catch (f) {
  669 + c = 0;
  670 + }
  671 + try {
  672 + d = b.toString().split(".")[1].length;
  673 + } catch (f) {
  674 + d = 0;
  675 + }
  676 + return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e;
  677 + };
632 678  
  679 + var numSubtr = function (a, b) {
  680 + var c, d, e;
  681 + try {
  682 + c = a.toString().split(".")[1].length;
  683 + } catch (f) {
  684 + c = 0;
  685 + }
  686 + try {
  687 + d = b.toString().split(".")[1].length;
  688 + } catch (f) {
  689 + d = 0;
  690 + }
  691 + return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e;
  692 + };
  693 +
  694 + function mul(a, b) {
  695 + var c = 0,
  696 + d = a.toString(),
  697 + e = b.toString();
  698 + try {
  699 + c += d.split(".")[1].length;
  700 + } catch (f) {
  701 + }
  702 + try {
  703 + c += e.split(".")[1].length;
  704 + } catch (f) {
  705 + }
  706 + return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c);
  707 + }
633 708 //改变状态
634 709 function startOptJzylLink(es) {
635 710 es.editable({
... ...