Commit 70c7c00c96983558ee7a695f9c6321cfd31472e5

Authored by 廖磊
1 parent 88d90ee1

加油人员不符过滤赛选

时刻表分析过滤赛选
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
... ... @@ -53,13 +53,15 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements
53 53 String sql=" select * from ("
54 54 + "select *,CONCAT(nbbm,jsy) as nj "
55 55 + " from bsth_c_ylxxb where yyrq='"+rq+"' "
56   - + " and gsdm ='"+gsdm+"') x where x.nj not in ("
  56 + + " and gsdm ='"+gsdm+"' and jylx ='0') x where x.nj not in ("
57 57 + " select CONCAT(nbbm,jsy) from bsth_c_ylb "
58   - + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"'"
  58 + + " where rq='"+rq+"'"
59 59 + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"')"
60 60 + " and x.nbbm in (select nbbm from bsth_c_ylb "
61   - + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"'"
62   - + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"')";
  61 + + " where rq='"+rq+"'"
  62 + + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"') "
  63 + + " and x.nbbm not in (select nbbm from bsth_c_ylxxb"
  64 + + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx ='1')";
63 65  
64 66  
65 67 /*String sql= "select v.*,u.jsy as ldgh from "
... ... @@ -175,9 +177,11 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements
175 177 Integer id =jsonObject.getInteger("id");
176 178 String jsy =jsonObject.getString("jsy");
177 179 Ylxxb ylxxb=repository.findOne(id);
178   - ylxxb.setJsy(jsy);
179   - ylxxb.setJylx(1);
180   - repository.save(ylxxb);
  180 + if(!ylxxb.getJsy().equals(jsy)){
  181 + ylxxb.setJsy(jsy);
  182 + ylxxb.setJylx(1);
  183 + repository.save(ylxxb);
  184 + }
181 185 }
182 186 newMap.put("status", ResponseCode.SUCCESS);
183 187 }catch(Exception e){
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -934,9 +934,9 @@ public class ReportServiceImpl implements ReportService{
934 934 ists=false;
935 935 }
936 936 }else{
937   - if(temp>fcsjT){
938   - temp=fcsjT+bcsj;
939   - }
  937 +// if(temp>fcsjT){
  938 +// temp=fcsjT;
  939 +// }
940 940 if(bcType.equals("in") || bcType.equals("out")){
941 941 temp = fcsjT+bcsj;
942 942 lpname=m.get("lp").toString();
... ... @@ -981,7 +981,7 @@ public class ReportServiceImpl implements ReportService{
981 981 if(ists){
982 982 if(lpname.equals(m.get("lp").toString())){
983 983 if(dir==0){
984   - if(fcsjT>= minSj && fcsjT <= 6*60+30)
  984 + if(fcsjT_>= minSj && fcsjT_ <= 6*60+30)
985 985 tzsxZq +=fcsjT-temp;
986 986 else
987 987 tzsxZgf +=fcsjT-temp;
... ... @@ -1193,13 +1193,25 @@ public class ReportServiceImpl implements ReportService{
1193 1193 zcj += i;
1194 1194 }
1195 1195 Map<String, Object> tempMap = new HashMap<String, Object>();
  1196 + double sxtszq=0.0;
  1197 + double sxsjzq=0.0;
  1198 + if(sxcountZqbc>0){
  1199 + sxtszq=Arith.div(tzsxZq, sxcountZqbc, 1);
  1200 + sxsjzq=Arith.div(yysxZq, sxcountZqbc,1);
  1201 + }
  1202 +
  1203 + double xxtszq=0.0;
  1204 + double xxsjzq=0.0;
  1205 + if(xxcountZqbc>0){
  1206 + xxtszq=Arith.div(tzxxZq, xxcountZqbc, 1);
  1207 + xxsjzq=Arith.div(yyxxZq, xxcountZqbc,1);
  1208 + }
1196 1209 tempMap.put("sjd", "(首)——6:30");
1197   - tempMap.put("sxsj", sxcountZqbc != 0 ? yysxZq / sxcountZqbc : "0");
1198   - tempMap.put("xxsj", xxcountZqbc != 0 ? yyxxZq / xxcountZqbc : "0");
1199   - tempMap.put("sxtssj", sxcountZqbc!= 0 ? tzsxZq / sxcountZqbc : "0");
1200   - tempMap.put("xxtssj", xxcountZqbc != 0 ? tzxxZq / xxcountZqbc : "0");
1201   - tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
1202   - + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1210 + tempMap.put("sxsj", sxsjzq);
  1211 + tempMap.put("xxsj", xxsjzq);
  1212 + tempMap.put("sxtssj", sxtszq);
  1213 + tempMap.put("xxtssj", xxtszq);
  1214 + tempMap.put("fqsj", Arith.add(Arith.add(sxtszq, sxsjzq), Arith.add(xxtszq, xxsjzq)));
1203 1215 tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
1204 1216 tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
1205 1217 newList.add(tempMap);
... ... @@ -1234,15 +1246,28 @@ public class ReportServiceImpl implements ReportService{
1234 1246 for(int i : cjs){
1235 1247 zcj += i;
1236 1248 }
  1249 + double sxtszgf=0.0;
  1250 + double sxsjzgf=0.0;
  1251 + if(sxcountZgfbc>0){
  1252 + sxtszgf=Arith.div(tzsxZgf, sxcountZgfbc, 1);
  1253 + sxsjzgf =Arith.div(yysxZgf, sxcountZgfbc, 1);
  1254 + }
  1255 +
  1256 + double xxtszgf=0.0;
  1257 + double xxsjzgf=0.0;
  1258 + if(xxcountZgfbc>0){
  1259 + xxtszgf=Arith.div(tzxxZgf, xxcountZgfbc, 1);
  1260 + xxsjzgf=Arith.div(yyxxZgf, xxcountZgfbc,1);
  1261 + }
  1262 +
1237 1263  
1238 1264 tempMap = new HashMap<String, Object>();
1239 1265 tempMap.put("sjd", "6:31——8:30");
1240   - tempMap.put("sxsj", sxcountZgfbc != 0 ? yysxZgf / sxcountZgfbc : "0");
1241   - tempMap.put("xxsj", xxcountZgfbc != 0 ? yyxxZgf / xxcountZgfbc : "0");
1242   - tempMap.put("sxtssj", sxcountZgfbc!= 0 ? tzsxZgf / sxcountZgfbc : "0");
1243   - tempMap.put("xxtssj", xxcountZgfbc != 0 ? tzxxZgf / xxcountZgfbc : "0");
1244   - tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
1245   - + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1266 + tempMap.put("sxsj", sxsjzgf);
  1267 + tempMap.put("xxsj", xxsjzgf);
  1268 + tempMap.put("sxtssj", sxtszgf);
  1269 + tempMap.put("xxtssj", xxtszgf);
  1270 + tempMap.put("fqsj", Arith.add(Arith.add(sxtszgf, sxsjzgf), Arith.add(xxtszgf, xxsjzgf)));
1246 1271 tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
1247 1272 tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
1248 1273 newList.add(tempMap);
... ... @@ -1276,15 +1301,26 @@ public class ReportServiceImpl implements ReportService{
1276 1301 for(int i : cjs){
1277 1302 zcj += i;
1278 1303 }
  1304 + double sxtzsjzw=0.0;
  1305 + double sxsjsjzw=0.0;
  1306 + if(sxcountZwbc>0){
  1307 + sxtzsjzw=Arith.div(tzsxZw, sxcountZwbc, 1);
  1308 + sxsjsjzw=Arith.div(yysxZw, sxcountZwbc,1);
  1309 + }
1279 1310  
  1311 + double xxtzsjzw=0.0;
  1312 + double xxsjsjzw=0.0;
  1313 + if(xxcountZwbc>0){
  1314 + xxtzsjzw=Arith.div(tzxxZw, xxcountZwbc,1);
  1315 + xxsjsjzw=Arith.div(yyxxZw, xxcountZwbc, 1);
  1316 + }
1280 1317 tempMap = new HashMap<String, Object>();
1281 1318 tempMap.put("sjd", "8:31——16:00");
1282   - tempMap.put("sxsj", sxcountZwbc != 0 ? yysxZw / sxcountZwbc : "0");
1283   - tempMap.put("xxsj", xxcountZwbc != 0 ? yyxxZw / xxcountZwbc : "0");
1284   - tempMap.put("sxtssj", sxcountZwbc!= 0 ? tzsxZw / sxcountZwbc : "0");
1285   - tempMap.put("xxtssj", xxcountZwbc != 0 ? tzxxZw / xxcountZwbc : "0");
1286   - tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
1287   - + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1319 + tempMap.put("sxsj", sxsjsjzw);
  1320 + tempMap.put("xxsj", xxsjsjzw);
  1321 + tempMap.put("sxtssj", sxtzsjzw);
  1322 + tempMap.put("xxtssj", xxtzsjzw);
  1323 + tempMap.put("fqsj", Arith.add(Arith.add(sxtzsjzw, sxsjsjzw), Arith.add(xxtzsjzw, xxsjsjzw)));
1288 1324 tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
1289 1325 tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
1290 1326 newList.add(tempMap);
... ... @@ -1319,14 +1355,27 @@ public class ReportServiceImpl implements ReportService{
1319 1355 zcj += i;
1320 1356 }
1321 1357  
  1358 + double sxtzsjwgf=0.0;
  1359 + double sxsjsjwgf=0.0;
  1360 + if(sxcountWgfbc>0){
  1361 + sxtzsjwgf=Arith.div(tzsxWgf, sxcountWgfbc, 1);
  1362 + sxsjsjwgf=Arith.div(yysxWgf, sxcountWgfbc,1);
  1363 + }
  1364 +
  1365 + double xxtzsjwgf=0.0;
  1366 + double xxsjsjwgf=0.0;
  1367 + if(xxcountWgfbc>0){
  1368 + xxtzsjwgf=Arith.div(tzxxWgf, xxcountWgfbc, 1);
  1369 + xxsjsjwgf=Arith.div(yyxxWgf, xxcountWgfbc,1);
  1370 + }
  1371 +
1322 1372 tempMap = new HashMap<String, Object>();
1323 1373 tempMap.put("sjd", "16:01——18:00");
1324   - tempMap.put("sxsj", sxcountWgfbc != 0 ? yysxWgf / sxcountWgfbc : "0");
1325   - tempMap.put("xxsj", xxcountWgfbc != 0 ? yyxxWgf / xxcountWgfbc : "0");
1326   - tempMap.put("sxtssj", sxcountWgfbc!= 0 ? tzsxWgf / sxcountWgfbc : "0");
1327   - tempMap.put("xxtssj", xxcountWgfbc != 0 ? tzxxWgf / xxcountWgfbc : "0");
1328   - tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
1329   - + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1374 + tempMap.put("sxsj", sxsjsjwgf);
  1375 + tempMap.put("xxsj", xxsjsjwgf);
  1376 + tempMap.put("sxtssj", sxtzsjwgf);
  1377 + tempMap.put("xxtssj", xxtzsjwgf);
  1378 + tempMap.put("fqsj", Arith.add(Arith.add(sxsjsjwgf, sxtzsjwgf), Arith.add(xxsjsjwgf, xxtzsjwgf)));
1330 1379 tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
1331 1380 tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
1332 1381 newList.add(tempMap);
... ... @@ -1361,15 +1410,26 @@ public class ReportServiceImpl implements ReportService{
1361 1410 for(int i : cjs){
1362 1411 zcj += i;
1363 1412 }
  1413 + double sxtzsjwh=0.0;
  1414 + double sxsjsjwh=0.0;
  1415 + if(sxcountWhbc>0){
  1416 + sxtzsjwh=Arith.div(tzsxWh,sxcountWhbc,1);
  1417 + sxsjsjwh=Arith.div(yysxWh, sxcountWhbc,1);
  1418 + }
1364 1419  
  1420 + double xxtzsjwh=0.0;
  1421 + double xxsjsjwh=0.0;
  1422 + if(xxcountWhbc>0){
  1423 + xxtzsjwh=Arith.div(tzxxWh, xxcountWhbc,1);
  1424 + xxsjsjwh=Arith.div(yyxxWh, xxcountWhbc, 1);
  1425 + }
1365 1426 tempMap = new HashMap<String, Object>();
1366 1427 tempMap.put("sjd", "18:01——(末)");
1367   - tempMap.put("sxsj", sxcountWhbc != 0 ? yysxWh / sxcountWhbc : "0");
1368   - tempMap.put("xxsj", xxcountWhbc != 0 ? yyxxWh / xxcountWhbc : "0");
1369   - tempMap.put("sxtssj", sxcountWhbc!= 0 ? tzsxWh / sxcountWhbc : "0");
1370   - tempMap.put("xxtssj", xxcountWhbc != 0 ? tzxxWh / xxcountWhbc : "0");
1371   - tempMap.put("fqsj", Integer.valueOf(tempMap.get("sxsj").toString()) + Integer.valueOf(tempMap.get("xxsj").toString())
1372   - + Integer.valueOf(tempMap.get("sxtssj").toString()) + Integer.valueOf(tempMap.get("xxtssj").toString()));
  1428 + tempMap.put("sxsj", sxsjsjwh);
  1429 + tempMap.put("xxsj", xxsjsjwh);
  1430 + tempMap.put("sxtssj", sxtzsjwh);
  1431 + tempMap.put("xxtssj", xxtzsjwh);
  1432 + tempMap.put("fqsj", Arith.add(Arith.add(sxsjsjwh, sxtzsjwh), Arith.add(xxsjsjwh,xxtzsjwh)));
1373 1433 tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
1374 1434 tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
1375 1435 newList.add(tempMap);
... ...