Commit 97a0b72f2068032fa5741e400c18c885086b1ebe

Authored by 廖磊
1 parent b2d1f7ee

路单加注量去掉默认值

src/main/java/com/bsth/repository/CarsRepository.java
... ... @@ -15,4 +15,7 @@ public interface CarsRepository extends BaseRepository<Cars, Integer>{
15 15  
16 16 @Query(value="select s from Cars s")
17 17 List<Cars> findCars();
  18 +
  19 + @Query(value="select s from Cars s where s.insideCode=?1")
  20 + List<Cars> findCarsByCode(String insideCode);
18 21 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -41,6 +41,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo;
41 41 import com.bsth.entity.sys.DutyEmployee;
42 42 import com.bsth.entity.sys.SysUser;
43 43 import com.bsth.repository.CarDeviceRepository;
  44 +import com.bsth.repository.CarsRepository;
44 45 import com.bsth.repository.LineRepository;
45 46 import com.bsth.repository.oil.DlbRepository;
46 47 import com.bsth.repository.oil.YlbRepository;
... ... @@ -159,6 +160,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
159 160 @Autowired
160 161 CarDeviceRepository carDeviceRepository;
161 162  
  163 + @Autowired
  164 + CarsRepository carsRepository;
162 165 Logger logger = LoggerFactory.getLogger(this.getClass());
163 166  
164 167 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
... ... @@ -3879,134 +3882,138 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3879 3882 }
3880 3883  
3881 3884 @Override
3882   - public Map<String, Object> MapById(Long id) {
3883   - // TODO Auto-generated method stub
3884   - Map<String, Object> map = new HashMap<String, Object>();
3885   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
3886   - ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id);
3887   - String xlbm = s.getXlBm();
3888   - String fcrq = s.getScheduleDateStr();
3889   -
3890   - int type=0;
3891   - Double ccyl = 0.0;
3892   - Double jcyl = 0.0;
3893   - Double yh = 0.0;
3894   - Double jzl = 0.0;
3895   - Double zlc=0.0;
3896   - List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
3897   - List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
3898   - if(listYlb.size()>0){
3899   - type=0;
3900   - for (int i = 0; i < listYlb.size(); i++) {
3901   - Ylb y = listYlb.get(i);
3902   - if(y.getLp()==null){
3903   - ccyl=Arith.add(ccyl, y.getCzyl());
3904   - jcyl=Arith.add(jcyl, y.getJzyl());
3905   - yh =Arith.add(yh ,y.getYh());
3906   - jzl =Arith.add(jzl, y.getJzl());
3907   - zlc =Arith.add(zlc, y.getZlc());
3908   - }else{
3909   - if(y.getLp().equals(s.getLpName())){
3910   - ccyl=Arith.add(ccyl, y.getCzyl());
3911   - jcyl=Arith.add(jcyl, y.getJzyl());
3912   - yh =Arith.add(yh ,y.getYh());
3913   - jzl =Arith.add(jzl, y.getJzl());
3914   - zlc =Arith.add(zlc, y.getZlc());
3915   - }
3916   - }
3917   -
3918   - }
3919   - }else{
3920   - type=1;
3921   - for (int i = 0; i < listDlb.size(); i++) {
3922   - Dlb d=listDlb.get(i);
3923   - if(d.getLp()==null){
3924   - ccyl=Arith.add(ccyl, d.getCzcd());
3925   - jcyl=Arith.add(jcyl, d.getJzcd());
3926   - yh =Arith.add(yh ,d.getHd());
3927   - jzl =Arith.add(jzl, d.getCdl());
3928   - zlc =Arith.add(zlc, d.getZlc());
3929   - }else{
3930   - if(d.getLp().equals(s.getLpName())){
3931   - ccyl=Arith.add(ccyl, d.getCzcd());
3932   - jcyl=Arith.add(jcyl, d.getJzcd());
3933   - yh =Arith.add(yh ,d.getHd());
3934   - jzl =Arith.add(jzl, d.getCdl());
3935   - zlc =Arith.add(zlc, d.getZlc());
  3885 + public Map<String, Object> MapById(Long id) {
  3886 + // TODO Auto-generated method stub
  3887 + Map<String, Object> map = new HashMap<String, Object>();
  3888 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3889 + ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id);
  3890 + String xlbm = s.getXlBm();
  3891 + String fcrq = s.getScheduleDateStr();
  3892 +
  3893 + int type = 2;
  3894 + Double ccyl = 0.0;
  3895 + Double jcyl = 0.0;
  3896 + Double yh = 0.0;
  3897 + Double jzl = 0.0;
  3898 + Double zlc = 0.0;
  3899 + List<Cars> listCars = carsRepository.findCarsByCode(s.getClZbh());
  3900 + if (listCars.size() > 0) {
  3901 + if(listCars.get(0).getSfdc()!=null){
  3902 + if (listCars.get(0).getSfdc()) {
  3903 + List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
  3904 + type = 1;
  3905 + for (int i = 0; i < listDlb.size(); i++) {
  3906 + Dlb d = listDlb.get(i);
  3907 + if (d.getLp() == null) {
  3908 + ccyl = Arith.add(ccyl, d.getCzcd());
  3909 + jcyl = Arith.add(jcyl, d.getJzcd());
  3910 + yh = Arith.add(yh, d.getHd());
  3911 + jzl = Arith.add(jzl, d.getCdl());
  3912 + zlc = Arith.add(zlc, d.getZlc());
  3913 + } else {
  3914 + if (d.getLp().equals(s.getLpName())) {
  3915 + ccyl = Arith.add(ccyl, d.getCzcd());
  3916 + jcyl = Arith.add(jcyl, d.getJzcd());
  3917 + yh = Arith.add(yh, d.getHd());
  3918 + jzl = Arith.add(jzl, d.getCdl());
  3919 + zlc = Arith.add(zlc, d.getZlc());
  3920 + }
  3921 + }
  3922 +
  3923 + }
  3924 + } else {
  3925 + List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
  3926 + type = 0;
  3927 + for (int i = 0; i < listYlb.size(); i++) {
  3928 + Ylb y = listYlb.get(i);
  3929 + if (y.getLp() == null) {
  3930 + ccyl = Arith.add(ccyl, y.getCzyl());
  3931 + jcyl = Arith.add(jcyl, y.getJzyl());
  3932 + yh = Arith.add(yh, y.getYh());
  3933 + jzl = Arith.add(jzl, y.getJzl());
  3934 + zlc = Arith.add(zlc, y.getZlc());
  3935 + } else {
  3936 + if (y.getLp().equals(s.getLpName())) {
  3937 + ccyl = Arith.add(ccyl, y.getCzyl());
  3938 + jcyl = Arith.add(jcyl, y.getJzyl());
  3939 + yh = Arith.add(yh, y.getYh());
  3940 + jzl = Arith.add(jzl, y.getJzl());
  3941 + zlc = Arith.add(zlc, y.getZlc());
  3942 + }
  3943 + }
3936 3944 }
3937 3945 }
3938   -
3939 3946 }
3940   - }
3941   -
3942   - map.put("jzl", jzl);
3943   - map.put("yh", yh);
3944   - map.put("ccyl", ccyl);
3945   - map.put("jcyl", jcyl);
3946   - map.put("type", type);
3947   - map.put("zlc", zlc);
3948   - map.put("xlName", s.getXlName());
3949   - map.put("clZbh", s.getClZbh());
3950   - map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));
3951   - map.put("fcsjActual", s.getFcsjActual());
3952   - map.put("zdzName", s.getZdzName());
3953   - map.put("scheduleDate", s.getScheduleDateStr());
3954   - map.put("lpName", s.getLpName());
3955   - String zdp = "", zwdp = "", wdp = "";
3956   - String zdpT = "", zwdpT = "", wdpT = "";
3957   - String dbdp="";
3958   - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
3959   - try {
3960   - Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
3961   - Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
3962   - Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
3963   - for (int i = 0; i < list.size(); i++) {
3964   - DutyEmployee t = list.get(i);
3965   - if(dbdp.indexOf(t.getuName()) == -1){
3966   - if(!(dbdp.length()>0)){
3967   - dbdp =t.getuName();
3968   - }else{
3969   - dbdp +=","+t.getuName();
3970   - }
3971   - }
3972   - Long ts = t.getTs();
3973   - if (ts > fcsj1 && ts < fcsj2) {
3974   - if (zdp.indexOf(t.getuName()) == -1) {
3975   - if (!(zdp.length() > 0)) {
3976   - zdpT = t.getuName() + "...";
3977   - }
3978   - zdp += t.getuName() + ",";
  3947 + }
3979 3948  
3980   - }
3981   - } else if (ts > fcsj2 && ts < fcsj3) {
3982   - if (zwdp.indexOf(t.getuName()) == -1) {
3983   - if (!(zwdp.length() > 0)) {
3984   - zwdpT = t.getuName() + "...";
3985   - }
3986   - zwdp += t.getuName() + ",";
3987   - }
3988   - } else {
3989   - if (wdp.indexOf(t.getuName()) == -1) {
3990   - if (!(wdp.length() > 0)) {
3991   - wdpT = t.getuName() + "...";
3992   - }
3993   - wdp += t.getuName() + ",";
3994   - }
3995   - }
3996   - }
3997   - } catch (ParseException e) {
3998   - // TODO Auto-generated catch block
3999   - e.printStackTrace();
4000   - }
4001   - map.put("zdp", zdp);
4002   - map.put("zwdp", zwdp);
4003   - map.put("wdp", wdp);
4004   - map.put("zdpT", zdpT);
4005   - map.put("zwdpT", zwdpT);
4006   - map.put("wdpT", wdpT);
4007   - map.put("dbdp", dbdp);
4008   - return map;
4009   - }
  3949 + map.put("jzl", jzl);
  3950 + map.put("yh", yh);
  3951 + map.put("ccyl", ccyl);
  3952 + map.put("jcyl", jcyl);
  3953 + map.put("type", type);
  3954 + map.put("zlc", zlc);
  3955 + map.put("xlName", s.getXlName());
  3956 + map.put("clZbh", s.getClZbh());
  3957 + map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));
  3958 + map.put("fcsjActual", s.getFcsjActual());
  3959 + map.put("zdzName", s.getZdzName());
  3960 + map.put("scheduleDate", s.getScheduleDateStr());
  3961 + map.put("lpName", s.getLpName());
  3962 + String zdp = "", zwdp = "", wdp = "";
  3963 + String zdpT = "", zwdpT = "", wdpT = "";
  3964 + String dbdp = "";
  3965 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
  3966 + try {
  3967 + Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
  3968 + Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
  3969 + Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
  3970 + for (int i = 0; i < list.size(); i++) {
  3971 + DutyEmployee t = list.get(i);
  3972 + if (dbdp.indexOf(t.getuName()) == -1) {
  3973 + if (!(dbdp.length() > 0)) {
  3974 + dbdp = t.getuName();
  3975 + } else {
  3976 + dbdp += "," + t.getuName();
  3977 + }
  3978 + }
  3979 + Long ts = t.getTs();
  3980 + if (ts > fcsj1 && ts < fcsj2) {
  3981 + if (zdp.indexOf(t.getuName()) == -1) {
  3982 + if (!(zdp.length() > 0)) {
  3983 + zdpT = t.getuName() + "...";
  3984 + }
  3985 + zdp += t.getuName() + ",";
  3986 +
  3987 + }
  3988 + } else if (ts > fcsj2 && ts < fcsj3) {
  3989 + if (zwdp.indexOf(t.getuName()) == -1) {
  3990 + if (!(zwdp.length() > 0)) {
  3991 + zwdpT = t.getuName() + "...";
  3992 + }
  3993 + zwdp += t.getuName() + ",";
  3994 + }
  3995 + } else {
  3996 + if (wdp.indexOf(t.getuName()) == -1) {
  3997 + if (!(wdp.length() > 0)) {
  3998 + wdpT = t.getuName() + "...";
  3999 + }
  4000 + wdp += t.getuName() + ",";
  4001 + }
  4002 + }
  4003 + }
  4004 + } catch (ParseException e) {
  4005 + // TODO Auto-generated catch block
  4006 + e.printStackTrace();
  4007 + }
  4008 + map.put("zdp", zdp);
  4009 + map.put("zwdp", zwdp);
  4010 + map.put("wdp", wdp);
  4011 + map.put("zdpT", zdpT);
  4012 + map.put("zwdpT", zwdpT);
  4013 + map.put("wdpT", wdpT);
  4014 + map.put("dbdp", dbdp);
  4015 + return map;
  4016 + }
4010 4017  
4011 4018 @Override
4012 4019 public Map<String, Object> MapByIdQp(Long id) {
... ... @@ -4744,7 +4751,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4744 4751 }
4745 4752 // file.mkdirs(); //创建
4746 4753 List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
4747   -
4748 4754 List<File> files = new ArrayList<File>();
4749 4755 for (List<String> list : lists){
4750 4756 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
... ... @@ -4770,7 +4776,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4770 4776 }
4771 4777 File newFile = files.get(0);
4772 4778 newFile.renameTo(file);
4773   -
4774 4779 // temp.renameTo(new File(path + fileName + "/" + temp.getName()));
4775 4780 // File[] listFiles = file.listFiles();
4776 4781 // ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(path + file.getName() + ".zip")));
... ...