挖坑不填坑,菊花塞电灯系列之一个工作N年的老鸟业务代码中for下N个IF(真实项目)...

本文主要是介绍挖坑不填坑,菊花塞电灯系列之一个工作N年的老鸟业务代码中for下N个IF(真实项目)...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

        import java.util.Scanner;
import org.junit.Test;/**** @Author 槑哥* 一个工作好几年的代码* */public class CarInfo {public CarInfoOutPut queryAllCatMonitor(Long orderId) throws ParseException {/**获取运单基本信息**/CarMonitorOutPut car = dao.getCar(orderId);CarTankRecent carTankRecent;CarInfoOutPut carInfoOutPut = new CarInfoOutPut();if(null!=car){carTankRecent = carService.getCarTankRecent(car.getTractorPlate());/**车速**/if(carTankRecent!=null){car.setSpeed(carTankRecent.getMph());}else{car.setSpeed(0D);}List<TaskInformationOutPut> list=new ArrayList<TaskInformationOutPut>();List<LoadTaskInformationOutPut> queryALLTask = dao.queryALLTask(orderId);for (LoadTaskInformationOutPut loadTaskInformationOutPut : queryALLTask) {if(loadTaskInformationOutPut.getType()==0){TaskInformationOutPut one = new TaskInformationOutPut();TaskInformationOutPut two = new TaskInformationOutPut();TaskInformationOutPut three = new TaskInformationOutPut();TaskInformationOutPut four = new TaskInformationOutPut();loadTaskInformationOutPut.getArriveTime();if(null!=loadTaskInformationOutPut.getArriveTime()){one.setTaskInfo("已经到达");one.setTaskType("装液");one.setSignType("到达");one.setTagName("装液信息");one.setTime(loadTaskInformationOutPut.getArriveTime());one.setCustomerName(loadTaskInformationOutPut.getCustomerName());one.setLng(loadTaskInformationOutPut.getLng());one.setLat(loadTaskInformationOutPut.getLat());car.setState("已经到达,前往下一个任务点");list.add(one);}if(loadTaskInformationOutPut.getLoadTime()!=null){two.setTaskInfo("开始装液");two.setTaskType("装液");two.setSignType("装液");two.setTagName("装液信息");two.setTime(loadTaskInformationOutPut.getLoadTime());two.setCustomerName(loadTaskInformationOutPut.getCustomerName());two.setLng(loadTaskInformationOutPut.getLng());two.setLat(loadTaskInformationOutPut.getLat());car.setState("开始装液,前往下一个任务点");list.add(two);}if(loadTaskInformationOutPut.getLeaveTime()!=null){three.setTaskInfo("完成装液");three.setTaskType("装液");three.setSignType("离开");three.setTagName("装液信息");three.setTime(loadTaskInformationOutPut.getLeaveTime());three.setCustomerName(loadTaskInformationOutPut.getCustomerName());three.setLng(loadTaskInformationOutPut.getLng());three.setLat(loadTaskInformationOutPut.getLat());car.setState("完成装液,前往下一个任务点");list.add(three);}if(loadTaskInformationOutPut.getReceiptTime()!=null&&loadTaskInformationOutPut.getPumpUrl()!=null){four.setTaskInfo("装液回单");four.setTaskType("装液");four.setSignType("装液回单");four.setTagName("回单信息");four.setTime(loadTaskInformationOutPut.getReceiptTime());four.setPumpUrl(loadTaskInformationOutPut.getPumpUrl());four.setLoadWeigth(loadTaskInformationOutPut.getLoadWeigth());four.setCustomerName(loadTaskInformationOutPut.getCustomerName());four.setLng(loadTaskInformationOutPut.getLng());four.setLat(loadTaskInformationOutPut.getLat());car.setState("装液回单,前往下一个任务点");list.add(four);}}if(loadTaskInformationOutPut.getType()==1){TaskInformationOutPut one = new TaskInformationOutPut();TaskInformationOutPut two = new TaskInformationOutPut();TaskInformationOutPut three = new TaskInformationOutPut();TaskInformationOutPut four = new TaskInformationOutPut();if(loadTaskInformationOutPut.getArriveTime()!=null){one.setTaskInfo("已经到达");one.setTaskType("卸液");one.setSignType("到达");one.setTagName("卸液信息");one.setTime(loadTaskInformationOutPut.getArriveTime());one.setCustomerName(loadTaskInformationOutPut.getCustomerName());one.setLng(loadTaskInformationOutPut.getLng());one.setLat(loadTaskInformationOutPut.getLat());car.setState("到达卸液地点,前往下一个任务点");list.add(one);}if(loadTaskInformationOutPut.getLoadTime()!=null){two.setTaskInfo("开始卸液");two.setTaskType("卸液");two.setSignType("卸液");two.setTagName("卸液信息");two.setTime(loadTaskInformationOutPut.getLoadTime());two.setCustomerName(loadTaskInformationOutPut.getCustomerName());two.setLng(loadTaskInformationOutPut.getLng());two.setLat(loadTaskInformationOutPut.getLat());list.add(two);car.setState("开始卸液,前往下一个任务点");}if(loadTaskInformationOutPut.getLeaveTime()!=null){three.setTaskInfo("完成卸液");three.setTaskType("卸液");three.setSignType("离开");three.setTagName("卸液信息");three.setTime(loadTaskInformationOutPut.getLeaveTime());three.setCustomerName(loadTaskInformationOutPut.getCustomerName());three.setLng(loadTaskInformationOutPut.getLng());three.setLat(loadTaskInformationOutPut.getLat());list.add(three);car.setState("完成卸液,前往下一个任务点");}if(loadTaskInformationOutPut.getReceiptTime()!=null&&loadTaskInformationOutPut.getPumpUrl()!=null){four.setTaskInfo("卸液回单");four.setTaskType("卸液");four.setSignType("卸液回单");four.setTagName("回单信息");four.setPumpUrl(loadTaskInformationOutPut.getPumpUrl());four.setLoadWeigth(loadTaskInformationOutPut.getLoadWeigth());four.setTime(loadTaskInformationOutPut.getReceiptTime());four.setCustomerName(loadTaskInformationOutPut.getCustomerName());four.setLng(loadTaskInformationOutPut.getLng());four.setLat(loadTaskInformationOutPut.getLat());list.add(four);car.setState("完成卸液,前往下一个任务点");}}if(loadTaskInformationOutPut.getType()==2){TaskInformationOutPut one = new TaskInformationOutPut();TaskInformationOutPut two = new TaskInformationOutPut();TaskInformationOutPut three = new TaskInformationOutPut();TaskInformationOutPut four = new TaskInformationOutPut();if(loadTaskInformationOutPut.getLoadTime()!=null){one.setTaskInfo("已经到达");one.setTaskType("倒液");one.setSignType("到达");one.setTagName("倒液信息");one.setTime(loadTaskInformationOutPut.getArriveTime());one.setCustomerName(loadTaskInformationOutPut.getCustomerName());one.setLng(loadTaskInformationOutPut.getLng());one.setLat(loadTaskInformationOutPut.getLat());list.add(one);car.setState("到达倒液地点,前往下一个任务点");}if(loadTaskInformationOutPut.getLoadTime()!=null){two.setTaskInfo("开始倒液");two.setTaskType("倒液");two.setSignType("倒液");two.setTagName("倒液信息");two.setTime(loadTaskInformationOutPut.getLoadTime());two.setCustomerName(loadTaskInformationOutPut.getCustomerName());two.setLng(loadTaskInformationOutPut.getLng());two.setLat(loadTaskInformationOutPut.getLat());list.add(two);car.setState("开始倒液,前往下一个任务点");}if(loadTaskInformationOutPut.getLeaveTime()!=null){three.setTaskInfo("完成倒液");three.setTaskType("倒液");three.setSignType("离开");three.setTagName("倒液信息");three.setTime(loadTaskInformationOutPut.getLeaveTime());three.setCustomerName(loadTaskInformationOutPut.getCustomerName());three.setLng(loadTaskInformationOutPut.getLng());three.setLat(loadTaskInformationOutPut.getLat());list.add(three);car.setState("完成倒液,前往下一个任务点");}if(loadTaskInformationOutPut.getReceiptTime()!=null&&loadTaskInformationOutPut.getPumpUrl()!=null){four.setTaskInfo("倒液回单");four.setTaskType("倒液");four.setSignType("倒液回单");four.setTagName("回单信息");four.setPumpUrl(loadTaskInformationOutPut.getPumpUrl());four.setLoadWeigth(loadTaskInformationOutPut.getLoadWeigth());four.setTime(loadTaskInformationOutPut.getReceiptTime());four.setCustomerName(loadTaskInformationOutPut.getCustomerName());four.setLng(loadTaskInformationOutPut.getLng());four.setLat(loadTaskInformationOutPut.getLat());list.add(four);car.setState("倒液回单,准备返程");}}}carInfoOutPut.setCar(car);carInfoOutPut.setTask(list);}return carInfoOutPut;}}

这篇关于挖坑不填坑,菊花塞电灯系列之一个工作N年的老鸟业务代码中for下N个IF(真实项目)...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/774237

相关文章

使用Java将DOCX文档解析为Markdown文档的代码实现

《使用Java将DOCX文档解析为Markdown文档的代码实现》在现代文档处理中,Markdown(MD)因其简洁的语法和良好的可读性,逐渐成为开发者、技术写作者和内容创作者的首选格式,然而,许多文... 目录引言1. 工具和库介绍2. 安装依赖库3. 使用Apache POI解析DOCX文档4. 将解析

C++使用printf语句实现进制转换的示例代码

《C++使用printf语句实现进制转换的示例代码》在C语言中,printf函数可以直接实现部分进制转换功能,通过格式说明符(formatspecifier)快速输出不同进制的数值,下面给大家分享C+... 目录一、printf 原生支持的进制转换1. 十进制、八进制、十六进制转换2. 显示进制前缀3. 指

Node.js 数据库 CRUD 项目示例详解(完美解决方案)

《Node.js数据库CRUD项目示例详解(完美解决方案)》:本文主要介绍Node.js数据库CRUD项目示例详解(完美解决方案),本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考... 目录项目结构1. 初始化项目2. 配置数据库连接 (config/db.js)3. 创建模型 (models/

springboot项目中常用的工具类和api详解

《springboot项目中常用的工具类和api详解》在SpringBoot项目中,开发者通常会依赖一些工具类和API来简化开发、提高效率,以下是一些常用的工具类及其典型应用场景,涵盖Spring原生... 目录1. Spring Framework 自带工具类(1) StringUtils(2) Coll

使用Python实现全能手机虚拟键盘的示例代码

《使用Python实现全能手机虚拟键盘的示例代码》在数字化办公时代,你是否遇到过这样的场景:会议室投影电脑突然键盘失灵、躺在沙发上想远程控制书房电脑、或者需要给长辈远程协助操作?今天我要分享的Pyth... 目录一、项目概述:不止于键盘的远程控制方案1.1 创新价值1.2 技术栈全景二、需求实现步骤一、需求

Java中Date、LocalDate、LocalDateTime、LocalTime、时间戳之间的相互转换代码

《Java中Date、LocalDate、LocalDateTime、LocalTime、时间戳之间的相互转换代码》:本文主要介绍Java中日期时间转换的多种方法,包括将Date转换为LocalD... 目录一、Date转LocalDateTime二、Date转LocalDate三、LocalDateTim

Go 语言中的select语句详解及工作原理

《Go语言中的select语句详解及工作原理》在Go语言中,select语句是用于处理多个通道(channel)操作的一种控制结构,它类似于switch语句,本文给大家介绍Go语言中的select语... 目录Go 语言中的 select 是做什么的基本功能语法工作原理示例示例 1:监听多个通道示例 2:带

Spring Boot项目部署命令java -jar的各种参数及作用详解

《SpringBoot项目部署命令java-jar的各种参数及作用详解》:本文主要介绍SpringBoot项目部署命令java-jar的各种参数及作用的相关资料,包括设置内存大小、垃圾回收... 目录前言一、基础命令结构二、常见的 Java 命令参数1. 设置内存大小2. 配置垃圾回收器3. 配置线程栈大小

jupyter代码块没有运行图标的解决方案

《jupyter代码块没有运行图标的解决方案》:本文主要介绍jupyter代码块没有运行图标的解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录jupyter代码块没有运行图标的解决1.找到Jupyter notebook的系统配置文件2.这时候一般会搜索到

Spring Boot项目中结合MyBatis实现MySQL的自动主从切换功能

《SpringBoot项目中结合MyBatis实现MySQL的自动主从切换功能》:本文主要介绍SpringBoot项目中结合MyBatis实现MySQL的自动主从切换功能,本文分步骤给大家介绍的... 目录原理解析1. mysql主从复制(Master-Slave Replication)2. 读写分离3.