Commit eb331a9522ca8b0f205f48f43012c546c706fa97

Authored by 王通
1 parent 78855ad6

ll行车路单

src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -4141,42 +4141,55 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -4141,42 +4141,55 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
4141 @Override 4141 @Override
4142 public Map<String, Object> findKMBCQp(String clZbh, String date, String line) { 4142 public Map<String, Object> findKMBCQp(String clZbh, String date, String line) {
4143 // TODO Auto-generated method stub 4143 // TODO Auto-generated method stub
4144 - List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill2(clZbh, date, line);  
4145 - DecimalFormat format = new DecimalFormat("0.00");  
4146 -// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);  
4147 -// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);  
4148 - int jhbc = 0, cjbc = 0, ljbc = 0, sjbc = 0;  
4149 - double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0, ljjcclc = 0, jhjcclc = 0;  
4150 - double addMileage = 0, remMileage = 0, addgl = 0, remgl = 0;  
4151 - Map<String, Object> map = new HashMap<String, Object>();  
4152 - jhlc = culateMieageService.culateJhgl(lists);  
4153 - jcclc = culateMieageService.culateJccgl(lists);  
4154 - jhjcclc = culateMieageService.culateJhJccgl(lists);  
4155 - remMileage = culateMieageService.culateLbgl(lists);  
4156 - ksgl = culateMieageService.culateKsgl(lists);  
4157 - yygl = culateMieageService.culateSjgl(lists);  
4158 - jhbc = culateMieageService.culateJhbc(lists, "");  
4159 - addMileage = culateMieageService.culateLjgl(lists);  
4160 - cjbc = culateMieageService.culateLbbc(lists);  
4161 - sjbc = culateMieageService.culateSjbc(lists, "");  
4162 - ljbc = culateMieageService.culateLjbc(lists, "");  
4163 - double zyygl = Arith.add(yygl, addMileage);  
4164 - double zksgl = Arith.add(ksgl, jcclc);  
4165 - map.put("jhlc", Arith.add(jhlc, jhjcclc));  
4166 - map.put("yygljh", jhlc);  
4167 - map.put("ssgl", remMileage);  
4168 - map.put("ksgl", ksgl);  
4169 - map.put("yyglsj", Arith.add(yygl, addMileage));  
4170 - map.put("jcclc", jcclc);  
4171 - map.put("jhbc", jhbc);  
4172 - map.put("ljgl", addMileage);  
4173 - map.put("ssbc", cjbc);  
4174 - map.put("ysgl", Arith.add(yygl, addMileage));  
4175 - map.put("sjbc", sjbc);  
4176 - map.put("zgl", Arith.add(zyygl, zksgl));  
4177 - map.put("ljbc", ljbc); 4144 + List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill2(clZbh, date, line);
  4145 + List<ScheduleRealInfo> lists_sj=new ArrayList<ScheduleRealInfo>();
  4146 + for (int i = 0; i < lists.size(); i++) {
  4147 + ScheduleRealInfo s = lists.get(i);
  4148 + Set<ChildTaskPlan> cts = s.getcTasks();
  4149 + if (cts != null && cts.size() > 0) {
  4150 + lists_sj.add(s);
  4151 + } else {
  4152 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  4153 + lists_sj.add(s);
  4154 + }
  4155 + }
  4156 + }
  4157 + DecimalFormat format = new DecimalFormat("0.00");
  4158 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  4159 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  4160 + int jhbc = 0, cjbc = 0, ljbc = 0, sjbc = 0;
  4161 + double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0, ljjcclc = 0, jhjcclc = 0;
  4162 + double addMileage = 0, remMileage = 0, addgl = 0, remgl = 0;
  4163 + Map<String, Object> map = new HashMap<String, Object>();
  4164 + jhlc = culateMieageService.culateJhgl(lists);
  4165 + jcclc = culateMieageService.culateJccgl(lists);
  4166 + jhjcclc = culateMieageService.culateJhJccgl(lists);
  4167 + remMileage = culateMieageService.culateLbgl(lists);
  4168 + ksgl = culateMieageService.culateKsgl(lists_sj);
  4169 + yygl = culateMieageService.culateSjgl(lists_sj);
  4170 + jhbc = culateMieageService.culateJhbc(lists, "");
  4171 + addMileage = culateMieageService.culateLjgl(lists_sj);
  4172 + cjbc = culateMieageService.culateLbbc(lists);
  4173 + sjbc = culateMieageService.culateSjbc(lists_sj, "");
  4174 + ljbc = culateMieageService.culateLjbc(lists_sj, "");
  4175 + double zyygl = Arith.add(yygl, addMileage);
  4176 + double zksgl = Arith.add(ksgl, jcclc);
  4177 + map.put("jhlc", Arith.add(jhlc, jhjcclc));
  4178 + map.put("yygljh", jhlc);
  4179 + map.put("ssgl", remMileage);
  4180 + map.put("ksgl", ksgl);
  4181 + map.put("yyglsj", Arith.add(yygl, addMileage));
  4182 + map.put("jcclc", jcclc);
  4183 + map.put("jhbc", jhbc);
  4184 + map.put("ljgl", addMileage);
  4185 + map.put("ssbc", cjbc);
  4186 + map.put("ysgl", Arith.add(yygl, addMileage));
  4187 + map.put("sjbc", sjbc);
  4188 + map.put("zgl", Arith.add(zyygl, zksgl));
  4189 + map.put("ljbc", ljbc);
  4190 +
  4191 + return map;
4178 4192
4179 - return map;  
4180 } 4193 }
4181 4194
4182 @Override 4195 @Override
@@ -4214,7 +4227,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4214,7 +4227,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4214 } 4227 }
4215 } else { 4228 } else {
4216 if (s.getStatus() != -1) { 4229 if (s.getStatus() != -1) {
4217 - sjlc = s.getJhlc(); 4230 + if(StringUtils.isNotEmpty(s.getFcsjActual())&&StringUtils.isNotEmpty(s.getZdsjActual())){
  4231 + sjlc = s.getJhlc();
  4232 + }
4218 } 4233 }
4219 } 4234 }
4220 s.setSjlc(format.format(sjlc)); 4235 s.setSjlc(format.format(sjlc));