Commit 03f3aa948628e082bd604c0d1631e11d8d8be690

Authored by 廖磊
1 parent cfe601f2

驾驶员请求台账对更换设备号的数据处理

路单数据对更换驾工号的数据处理
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -658,7 +658,7 @@ public class FormsServiceImpl implements FormsService {
658 658 List<Singledata> list_=new ArrayList<Singledata>();
659 659 if(tjtype.equals("jsy")){
660 660 //油统计
661   - String sql="select r.j_gh, r.xl_bm,r.cl_zbh"
  661 + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name"
662 662 + " from bsth_c_s_sp_info_real r where "
663 663 + " r.schedule_date_str = '"+startDate+"'";
664 664 if(xlbm.equals("")){
... ... @@ -667,13 +667,14 @@ public class FormsServiceImpl implements FormsService {
667 667 }else{
668 668 sql += " and r.xl_bm = '"+xlbm+"'";
669 669 }
670   - sql += " group by r.j_gh,r.xl_bm,r.cl_zbh order by r.xl_bm,r.cl_zbh";
  670 + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh";
671 671 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
672 672 @Override
673 673 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
674 674 Singledata sin = new Singledata();
675 675 sin.setxL(arg0.getString("xl_bm"));
676 676 sin.setJsy(arg0.getString("j_gh"));
  677 + sin.setjName(arg0.getString("j_name"));
677 678 sin.setClzbh(arg0.getString("cl_zbh"));
678 679 return sin;
679 680 }
... ... @@ -794,7 +795,7 @@ public class FormsServiceImpl implements FormsService {
794 795 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
795 796 sin.setXlmc(BasicData.lineCode2NameMap.get(line));
796 797 sin.setrQ(startDate);
797   - sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  798 +// sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
798 799 sin.setSgh("");
799 800 sin.setsName("");
800 801 sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
... ... @@ -1381,7 +1382,11 @@ public class FormsServiceImpl implements FormsService {
1381 1382 sin.setClzbh(clzbh);
1382 1383 sin.setJsy(jsy);
1383 1384 sin.setrQ(startDate);
1384   - sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  1385 + if(newList.size()>0){
  1386 + sin.setjName(newList.get(0).getjName());
  1387 + }else{
  1388 + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  1389 + }
1385 1390 sin.setSgh("");
1386 1391 sin.setsName("");
1387 1392 sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
... ... @@ -1459,7 +1464,11 @@ public class FormsServiceImpl implements FormsService {
1459 1464 sin.setClzbh(clzbh);
1460 1465 sin.setJsy(jsy);
1461 1466 sin.setrQ(startDate);
1462   - sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  1467 + if(newList.size()>0){
  1468 + sin.setjName(newList.get(0).getjName());
  1469 + }else{
  1470 + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  1471 + }
1463 1472 sin.setSgh("");
1464 1473 sin.setsName("");
1465 1474 sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -1862,6 +1862,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1862 1862 public List<Map<String, Object>> accountPx(String line, String date,
1863 1863 String code, String xlName, String px) {
1864 1864 // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px);
  1865 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1865 1866 if(!code.trim().equals("")){
1866 1867 code=BasicData.deviceId2NbbmMap.inverse().get(code);
1867 1868 }
... ... @@ -1894,7 +1895,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1894 1895 map = new HashMap<String, Object>();
1895 1896 map.put("num", i++);
1896 1897 map.put("xlName", xlName);
1897   - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2])==null?"":BasicData.deviceId2NbbmMap.get(obj[2]));
  1898 + if(BasicData.deviceId2NbbmMap.get(obj[2])==null){
  1899 + List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
  1900 + try {
  1901 + carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(date + " 00:00:00"));
  1902 + } catch (ParseException e) {
  1903 + // TODO Auto-generated catch block
  1904 + e.printStackTrace();
  1905 + }
  1906 + if(carDeviceList.size()>0){
  1907 + map.put("clZbh", carDeviceList.get(0).getClZbh());
  1908 +
  1909 + }else{
  1910 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1911 + }
  1912 + }else{
  1913 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1914 +
  1915 + }
1898 1916 map.put("company",fgs);
1899 1917 map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
1900 1918 map.put("requestTime", obj[1]);
... ... @@ -1922,6 +1940,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1922 1940 Line l=lineList.get(0);
1923 1941 fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
1924 1942 }
  1943 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1925 1944 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code);
1926 1945 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1927 1946 Map<String, Object> map;
... ... @@ -1931,7 +1950,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1931 1950 map = new HashMap<String, Object>();
1932 1951 map.put("num", i++);
1933 1952 map.put("xlName", xlName);
1934   - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1953 + if(BasicData.deviceId2NbbmMap.get(obj[2])==null){
  1954 + List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
  1955 + try {
  1956 + carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(date + " 00:00:00"));
  1957 + } catch (ParseException e) {
  1958 + // TODO Auto-generated catch block
  1959 + e.printStackTrace();
  1960 + }
  1961 + if(carDeviceList.size()>0){
  1962 + map.put("clZbh", carDeviceList.get(0).getClZbh());
  1963 +
  1964 + }else{
  1965 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1966 + }
  1967 + }else{
  1968 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1969 +
  1970 + }
1935 1971 map.put("company",fgs);
1936 1972 map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
1937 1973 map.put("requestTime", obj[1]);
... ...