Commit 41e5778dd1b7a434a559956cccf3c4d8b3d42407
1 parent
aeceea9a
场外加油添加线路条件
调度日报修改 加油人员不符修改后盖板JYLX
Showing
12 changed files
with
103 additions
and
25 deletions
src/main/java/com/bsth/controller/oil/CwjyController.java
| ... | ... | @@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestParam; |
| 13 | 13 | import org.springframework.web.bind.annotation.RestController; |
| 14 | 14 | |
| 15 | 15 | import com.bsth.controller.BaseController; |
| 16 | +import com.bsth.data.BasicData; | |
| 17 | +import com.bsth.entity.Line; | |
| 16 | 18 | import com.bsth.entity.oil.Cwjy; |
| 17 | 19 | import com.bsth.entity.oil.Ylxxb; |
| 18 | 20 | import com.bsth.entity.sys.SysUser; |
| ... | ... | @@ -30,12 +32,15 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ |
| 30 | 32 | SysUser sysUser = SecurityUtils.getCurrentUser(); |
| 31 | 33 | t.setCreateDate(new Date()); |
| 32 | 34 | t.setXgr(sysUser.getUserName()); |
| 35 | + t.setNbbm(t.getNbbm().trim().toUpperCase()); | |
| 36 | + Line line=BasicData.nbbm2LineMap.get(t.getNbbm()); | |
| 37 | + t.setLine(line == null?"" : line.getLineCode()); | |
| 33 | 38 | return service.save(t); |
| 34 | 39 | } |
| 35 | 40 | |
| 36 | 41 | @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET) |
| 37 | 42 | public int checkNbbm(Cwjy t){ |
| 38 | - return service.checkNbbm(t.getNbbm().trim()); | |
| 43 | + return service.checkNbbm(t); | |
| 39 | 44 | } |
| 40 | 45 | |
| 41 | 46 | @RequestMapping(value = "/queryList",method = RequestMethod.GET) | ... | ... |
src/main/java/com/bsth/entity/oil/Cwjy.java
| ... | ... | @@ -26,6 +26,11 @@ public class Cwjy { |
| 26 | 26 | private String xgr; |
| 27 | 27 | |
| 28 | 28 | private Date createDate; |
| 29 | + | |
| 30 | + private String line; | |
| 31 | + | |
| 32 | + @Transient | |
| 33 | + private String linename; | |
| 29 | 34 | |
| 30 | 35 | @Transient |
| 31 | 36 | private String gsname; |
| ... | ... | @@ -95,6 +100,24 @@ public class Cwjy { |
| 95 | 100 | public void setFgsname(String fgsname) { |
| 96 | 101 | this.fgsname = fgsname; |
| 97 | 102 | } |
| 103 | + | |
| 104 | + public String getLine() { | |
| 105 | + return line; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public void setLine(String line) { | |
| 109 | + this.line = line; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public String getLinename() { | |
| 113 | + return BasicData.lineCode2NameMap.get(this.line); | |
| 114 | + } | |
| 115 | + | |
| 116 | + public void setLinename(String linename) { | |
| 117 | + this.linename = linename; | |
| 118 | + } | |
| 119 | + | |
| 120 | + | |
| 98 | 121 | |
| 99 | 122 | |
| 100 | 123 | } | ... | ... |
src/main/java/com/bsth/entity/oil/Ylxxb.java
| ... | ... | @@ -44,7 +44,8 @@ public class Ylxxb { |
| 44 | 44 | private String gsname; |
| 45 | 45 | @Transient |
| 46 | 46 | private String fgsname; |
| 47 | - | |
| 47 | + @Transient | |
| 48 | + private String linename; | |
| 48 | 49 | @Transient |
| 49 | 50 | private Double zjzl; |
| 50 | 51 | |
| ... | ... | @@ -193,6 +194,12 @@ public class Ylxxb { |
| 193 | 194 | public void setZjzl(Double zjzl) { |
| 194 | 195 | this.zjzl = zjzl; |
| 195 | 196 | } |
| 197 | + public String getLinename() { | |
| 198 | + return linename; | |
| 199 | + } | |
| 200 | + public void setLinename(String linename) { | |
| 201 | + this.linename = linename; | |
| 202 | + } | |
| 196 | 203 | |
| 197 | 204 | |
| 198 | 205 | ... | ... |
src/main/java/com/bsth/repository/oil/CwjyRepository.java
| ... | ... | @@ -30,5 +30,8 @@ public interface CwjyRepository extends BaseRepository<Cwjy, Integer>{ |
| 30 | 30 | @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3%",nativeQuery=true) |
| 31 | 31 | List<Cwjy> selectAll(String nbbm,String gsdm,String fgsdm); |
| 32 | 32 | |
| 33 | + @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3% and line =?4",nativeQuery=true) | |
| 34 | + List<Cwjy> selectAll_s(String nbbm,String gsdm,String fgsdm,String line); | |
| 35 | + | |
| 33 | 36 | |
| 34 | 37 | } | ... | ... |
src/main/java/com/bsth/service/oil/CwjyService.java
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
| ... | ... | @@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; |
| 24 | 24 | import com.alibaba.fastjson.JSONArray; |
| 25 | 25 | import com.alibaba.fastjson.JSONObject; |
| 26 | 26 | import com.bsth.common.ResponseCode; |
| 27 | +import com.bsth.data.BasicData; | |
| 27 | 28 | import com.bsth.entity.oil.Cwjy; |
| 28 | 29 | import com.bsth.entity.oil.Cyl; |
| 29 | 30 | import com.bsth.entity.oil.Ylb; |
| ... | ... | @@ -281,6 +282,7 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 281 | 282 | String gsdm=map.get("gsdm_like").toString(); |
| 282 | 283 | |
| 283 | 284 | String fgsdm=map.get("fgsdm_like").toString(); |
| 285 | + String line =map.get("line_like").toString().trim(); | |
| 284 | 286 | /*String sql="SELECT a.gsdm as gsdm,a.fgsdm as fgsdm,a.nbbm as nbbm," |
| 285 | 287 | + "b.jyggh as jyggh,b.jzl as jzl ,b.stationid as stationid,b.jsy as jsy," |
| 286 | 288 | + "b.nylx as nylx,b.yj as yj,b.bz as bz,b.id as id ,c.jsy as ldgh FROM bsth_c_cwjy a "+ |
| ... | ... | @@ -318,7 +320,13 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 318 | 320 | return t; |
| 319 | 321 | } |
| 320 | 322 | }); |
| 321 | - List<Cwjy> cwList=repository.selectAll(nbbm, gsdm, fgsdm); | |
| 323 | + List<Cwjy> cwList=null; | |
| 324 | + if(line.equals("")){ | |
| 325 | + cwList = repository.selectAll(nbbm, gsdm, fgsdm); | |
| 326 | + }else{ | |
| 327 | + cwList = repository.selectAll_s(nbbm, gsdm, fgsdm, line); | |
| 328 | + } | |
| 329 | + | |
| 322 | 330 | String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE " |
| 323 | 331 | + " to_days(rq) = to_days('"+rq+"') AND ssgsdm = '"+gsdm+"' AND " |
| 324 | 332 | + " fgsdm = '"+fgsdm+"' GROUP BY nbbm"; |
| ... | ... | @@ -338,9 +346,6 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 338 | 346 | Ylxxb y=null; |
| 339 | 347 | for (int i = 0; i < cwList.size(); i++) { |
| 340 | 348 | Cwjy cwjy=cwList.get(i); |
| 341 | - if(cwjy.getNbbm().equals("W7B-092")){ | |
| 342 | - System.out.println(); | |
| 343 | - } | |
| 344 | 349 | y=new Ylxxb(); |
| 345 | 350 | y.setNylx(0); |
| 346 | 351 | y.setId(0); |
| ... | ... | @@ -348,6 +353,7 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 348 | 353 | y.setGsdm(cwjy.getGsdm()); |
| 349 | 354 | y.setFgsdm(cwjy.getFgsdm()); |
| 350 | 355 | y.setNbbm(cwjy.getNbbm()); |
| 356 | + y.setLinename(cwjy.getLinename()); | |
| 351 | 357 | for (int j = 0; j < yList.size(); j++) { |
| 352 | 358 | Ylxxb ylxxb=yList.get(j); |
| 353 | 359 | if(y.getNbbm().equals(ylxxb.getNbbm())){ |
| ... | ... | @@ -379,9 +385,10 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 379 | 385 | } |
| 380 | 386 | |
| 381 | 387 | @Override |
| 382 | - public int checkNbbm(String nbbm) { | |
| 388 | + public int checkNbbm(Cwjy t) { | |
| 383 | 389 | // TODO Auto-generated method stub |
| 384 | - String sql="select count(*) from bsth_c_cwjy where nbbm ='"+nbbm+"'"; | |
| 390 | + String sql="select count(*) from bsth_c_cwjy where nbbm ='"+t.getNbbm()+"'" | |
| 391 | + + " and gsdm ='"+t.getFgsdm()+"' and fgsdm ='"+t.getFgsdm()+"'"; | |
| 385 | 392 | int cs=jdbcTemplate.queryForObject(sql, Integer.class); |
| 386 | 393 | |
| 387 | 394 | return cs; | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -384,6 +384,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 384 | 384 | for (int i = 0; i < ylxxList.size(); i++) { |
| 385 | 385 | Ylxxb ylxxb = ylxxList.get(i); |
| 386 | 386 | if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) |
| 387 | + && map.get("jGh").toString().equals(ylxxb.getJsy()) | |
| 387 | 388 | && ylxxb.getJylx()==1) { |
| 388 | 389 | if(ylxxb.getJzl()>0){ |
| 389 | 390 | fage2=true; | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| ... | ... | @@ -176,6 +176,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 176 | 176 | String jsy =jsonObject.getString("jsy"); |
| 177 | 177 | Ylxxb ylxxb=repository.findOne(id); |
| 178 | 178 | ylxxb.setJsy(jsy); |
| 179 | + ylxxb.setJylx(1); | |
| 179 | 180 | repository.save(ylxxb); |
| 180 | 181 | } |
| 181 | 182 | newMap.put("status", ResponseCode.SUCCESS); | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -2737,7 +2737,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2737 | 2737 | if (a == 2) { |
| 2738 | 2738 | x = b + 1; |
| 2739 | 2739 | y = x * 2; |
| 2740 | - } else if (b == 1) { | |
| 2740 | + } else if (a == 1) { | |
| 2741 | 2741 | x = b + 1; |
| 2742 | 2742 | y = x * 2 - 1; |
| 2743 | 2743 | } else { |
| ... | ... | @@ -4068,7 +4068,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4068 | 4068 | if((zdsj_-zdsjActual_)>0){ |
| 4069 | 4069 | zdsjk =String.valueOf(zdsj_-zdsjActual_); |
| 4070 | 4070 | }else{ |
| 4071 | - zdsjm =String.valueOf(zdsj_-zdsjActual_); | |
| 4071 | + zdsjm =String.valueOf(zdsjActual_-zdsj_); | |
| 4072 | 4072 | } |
| 4073 | 4073 | } |
| 4074 | 4074 | tempMap.put("zdsjk" + x, zdsjk); |
| ... | ... | @@ -4095,7 +4095,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4095 | 4095 | if((zdsj_-fcsjActural_)>0){ |
| 4096 | 4096 | fcsjk =String.valueOf(zdsj_-fcsjActural_); |
| 4097 | 4097 | }else{ |
| 4098 | - fcsjm =String.valueOf(zdsj_-fcsjActural_); | |
| 4098 | + fcsjm =String.valueOf(fcsjActural_-zdsj_); | |
| 4099 | 4099 | } |
| 4100 | 4100 | } |
| 4101 | 4101 | tempMap.put("fcsjk" + x, fcsjk); | ... | ... |
src/main/resources/static/pages/oil/jyglList.html
| ... | ... | @@ -58,15 +58,15 @@ |
| 58 | 58 | <tr role="row" class="heading"> |
| 59 | 59 | <th width="2%">#</th> |
| 60 | 60 | <th width="10%">日期</th> |
| 61 | - <th width="10%">公司</th> | |
| 62 | - <th width="10%">分公司</th> | |
| 61 | + <th width="8%">公司</th> | |
| 62 | + <th width="8%">分公司</th> | |
| 63 | + <th width="8%">线路</th> | |
| 63 | 64 | <th width="8%">车辆</th> |
| 64 | 65 | <th width="14%">驾驶员</th> |
| 65 | 66 | <th width="5%">加注量</th> |
| 66 | 67 | <th width="4%">加油站</th> |
| 67 | 68 | <th width="3%">加油类型</th> |
| 68 | 69 | <th width="5%">加油工工号</th> |
| 69 | - <th width="3%">油价</th> | |
| 70 | 70 | <th width="4%">路单工号</th> |
| 71 | 71 | <th width="4%">备注</th> |
| 72 | 72 | <th width="10%">操作</th> |
| ... | ... | @@ -83,6 +83,9 @@ |
| 83 | 83 | <select class="form-control" name="fgsdm_like" id="jyglListFgsdmId" ></select> |
| 84 | 84 | </td> |
| 85 | 85 | <td> |
| 86 | + <select class="form-control" name="line_like" id="line" style="width: 120px;"></select> | |
| 87 | + </td> | |
| 88 | + <td> | |
| 86 | 89 | <input type="text" class="form-control form-filter input-sm" name="nbbh" id="nbbh"> |
| 87 | 90 | </td> |
| 88 | 91 | <td></td> |
| ... | ... | @@ -92,7 +95,6 @@ |
| 92 | 95 | <td></td> |
| 93 | 96 | <td></td> |
| 94 | 97 | <td></td> |
| 95 | - <td></td> | |
| 96 | 98 | <td> |
| 97 | 99 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 98 | 100 | <i class="fa fa-search"></i> 搜索</button> |
| ... | ... | @@ -124,6 +126,7 @@ |
| 124 | 126 | <td> |
| 125 | 127 | {{obj.fgsname}} |
| 126 | 128 | </td> |
| 129 | + <td>{{obj.linename}}</td> | |
| 127 | 130 | <td> |
| 128 | 131 | {{obj.nbbm}} |
| 129 | 132 | </td> |
| ... | ... | @@ -153,7 +156,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 153 | 156 | <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_jyggh" |
| 154 | 157 | type="text" value="{{obj.jyggh}}" style=" width:45px" /> |
| 155 | 158 | </td> |
| 156 | - <td></td> | |
| 159 | + | |
| 157 | 160 | <td>{{obj.ldgh}}</td> |
| 158 | 161 | <td> |
| 159 | 162 | <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_bz" |
| ... | ... | @@ -234,6 +237,27 @@ $(function(){ |
| 234 | 237 | }); |
| 235 | 238 | |
| 236 | 239 | |
| 240 | + | |
| 241 | + $.get('/report/lineList',function(xlList){ | |
| 242 | + var data = []; | |
| 243 | + data.push({id: " ", text: "全部线路"}); | |
| 244 | + $.get('/user/companyData', function(result){ | |
| 245 | + for(var i = 0; i < result.length; i++){ | |
| 246 | + var companyCode = result[i].companyCode; | |
| 247 | + var children = result[i].children; | |
| 248 | + for(var j = 0; j < children.length; j++){ | |
| 249 | + var code = children[j].code; | |
| 250 | + for(var k=0;k < xlList.length;k++ ){ | |
| 251 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | |
| 252 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | |
| 253 | + } | |
| 254 | + } | |
| 255 | + } | |
| 256 | + } | |
| 257 | + initPinYinSelect2('#line',data,''); | |
| 258 | + | |
| 259 | + }); | |
| 260 | + }); | |
| 237 | 261 | // var gsqx=""; |
| 238 | 262 | // var fgsqx=""; |
| 239 | 263 | ... | ... |
src/main/resources/static/pages/oil/jyszAdd.html
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | <label class="col-md-3 control-label">内部编码</label> |
| 34 | 34 | <div class="col-md-9"> |
| 35 | 35 | <!-- <select class="form-control input-medium " name="nbbm" id="nbbm" ></select> --> |
| 36 | - <input type="text" class="form-control input-medium" name="nbbm" > | |
| 36 | + <input type="text" class="form-control" name="nbbm" style="width: 180px"> | |
| 37 | 37 | </div> |
| 38 | 38 | </div> |
| 39 | 39 | </div> |
| ... | ... | @@ -87,6 +87,8 @@ $(function(){ |
| 87 | 87 | $('#fgsdm').html(options); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + | |
| 91 | + | |
| 90 | 92 | //提交 |
| 91 | 93 | $('#addJyszModuleButton').on('click', function() { |
| 92 | 94 | form.submit(); |
| ... | ... | @@ -98,7 +100,7 @@ $(function(){ |
| 98 | 100 | focusInvalid : false, |
| 99 | 101 | rules : { |
| 100 | 102 | nbbm : { |
| 101 | - minlength : 2, | |
| 103 | + minlength : 4, | |
| 102 | 104 | required : true, |
| 103 | 105 | maxlength : 10 |
| 104 | 106 | } |
| ... | ... | @@ -125,7 +127,7 @@ $(function(){ |
| 125 | 127 | error.hide(); |
| 126 | 128 | $get('/cwjy/checkNbbm',params,function(result){ |
| 127 | 129 | if(result>0){ |
| 128 | - layer.msg('该车辆已经添加.'); | |
| 130 | + layer.msg('分公司该车辆已经添加.'); | |
| 129 | 131 | }else{ |
| 130 | 132 | $post('/cwjy', params, function(result){ |
| 131 | 133 | layer.msg('新增加油设置成功.'); | ... | ... |
src/main/resources/static/pages/oil/jyszList.html
| ... | ... | @@ -21,8 +21,9 @@ |
| 21 | 21 | </div> |
| 22 | 22 | <div class="actions"> |
| 23 | 23 | <!-- <a class="btn btn-circle blue" href="jyszAdd.html" data-pjax><i class="fa fa-plus"></i> 添加</a> --> |
| 24 | - <button type="button" class="btn btn-circle blue" id="addJysz"><i class="fa fa-trash"></i> 添加</button> | |
| 25 | -<!-- <button type="button" class="btn btn-circle blue" onclick="refreshJsTree()"><i class="fa fa-trash"></i>刷新</button> --> | |
| 24 | + <button type="button" class="btn btn-circle blue" id="addJysz"><i class="fa fa-plus"></i> 添加</button> | |
| 25 | +<!-- | |
| 26 | + <button type="button" class="btn btn-circle blue" onclick="refreshJsTree()"><i class="fa fa-trash"></i>刷新</button> --> | |
| 26 | 27 | |
| 27 | 28 | <!-- <div class="btn-group"> |
| 28 | 29 | <a class="btn red btn-outline btn-circle" href="javascript:;" |
| ... | ... | @@ -60,8 +61,9 @@ |
| 60 | 61 | <th width="15%">公司</th> |
| 61 | 62 | <th width="13%">分公司</th> |
| 62 | 63 | <th width="10%">车辆</th> |
| 64 | + <th width="10%">线路</th> | |
| 63 | 65 | <th width="10%">修改人</th> |
| 64 | - <th width="20%">日期</th> | |
| 66 | + <th width="10%">日期</th> | |
| 65 | 67 | <th width="19%">操作</th> |
| 66 | 68 | </tr> |
| 67 | 69 | <tr role="row" class="filter"> |
| ... | ... | @@ -77,6 +79,8 @@ |
| 77 | 79 | </td> |
| 78 | 80 | <td> |
| 79 | 81 | </td> |
| 82 | + <td> | |
| 83 | + </td> | |
| 80 | 84 | <td></td> |
| 81 | 85 | <td> |
| 82 | 86 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| ... | ... | @@ -107,6 +111,7 @@ |
| 107 | 111 | <td>{{obj.gsname}}</td> |
| 108 | 112 | <td>{{obj.fgsname}}</td> |
| 109 | 113 | <td>{{obj.nbbm}}</td> |
| 114 | + <td>{{obj.linename}}</td> | |
| 110 | 115 | <td>{{obj.xgr}}</td> |
| 111 | 116 | <td>{{obj.createDate}}</td> |
| 112 | 117 | <td> |
| ... | ... | @@ -236,6 +241,7 @@ $(function(){ |
| 236 | 241 | $.each(data.content, function(i, obj) { |
| 237 | 242 | obj.createDate = moment(obj.createDate).format("YYYY-MM-DD"); |
| 238 | 243 | }); |
| 244 | + console.log(data.content); | |
| 239 | 245 | var bodyHtm = template('jysz_list_temp', {list: data.content}); |
| 240 | 246 | |
| 241 | 247 | $('#datatable_jysz tbody').html(bodyHtm) |
| ... | ... | @@ -288,7 +294,7 @@ $(function(){ |
| 288 | 294 | for(var j = 0, item; item = items[j++];){ |
| 289 | 295 | name = $(item).attr('name'); |
| 290 | 296 | if(name){ |
| 291 | - params[name] = $(item).val(); | |
| 297 | + params[name] = $(item).val().replace(/(^\s*)|(\s*$)/g, ""); | |
| 292 | 298 | } |
| 293 | 299 | } |
| 294 | 300 | }); |
| ... | ... | @@ -315,7 +321,6 @@ $(function(){ |
| 315 | 321 | $.get('jyszAdd.html', function(m){$(pjaxContainer).append(m);}); |
| 316 | 322 | }); |
| 317 | 323 | |
| 318 | - | |
| 319 | 324 | }); |
| 320 | 325 | |
| 321 | 326 | ... | ... |