挖坑不填坑,菊花塞电灯系列之一个工作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

相关文章

Spring Security 从入门到进阶系列教程

Spring Security 入门系列 《保护 Web 应用的安全》 《Spring-Security-入门(一):登录与退出》 《Spring-Security-入门(二):基于数据库验证》 《Spring-Security-入门(三):密码加密》 《Spring-Security-入门(四):自定义-Filter》 《Spring-Security-入门(五):在 Sprin

这15个Vue指令,让你的项目开发爽到爆

1. V-Hotkey 仓库地址: github.com/Dafrok/v-ho… Demo: 戳这里 https://dafrok.github.io/v-hotkey 安装: npm install --save v-hotkey 这个指令可以给组件绑定一个或多个快捷键。你想要通过按下 Escape 键后隐藏某个组件,按住 Control 和回车键再显示它吗?小菜一碟: <template

如何用Docker运行Django项目

本章教程,介绍如何用Docker创建一个Django,并运行能够访问。 一、拉取镜像 这里我们使用python3.11版本的docker镜像 docker pull python:3.11 二、运行容器 这里我们将容器内部的8080端口,映射到宿主机的80端口上。 docker run -itd --name python311 -p

活用c4d官方开发文档查询代码

当你问AI助手比如豆包,如何用python禁止掉xpresso标签时候,它会提示到 这时候要用到两个东西。https://developers.maxon.net/论坛搜索和开发文档 比如这里我就在官方找到正确的id描述 然后我就把参数标签换过来

poj 1258 Agri-Net(最小生成树模板代码)

感觉用这题来当模板更适合。 题意就是给你邻接矩阵求最小生成树啦。~ prim代码:效率很高。172k...0ms。 #include<stdio.h>#include<algorithm>using namespace std;const int MaxN = 101;const int INF = 0x3f3f3f3f;int g[MaxN][MaxN];int n

科研绘图系列:R语言扩展物种堆积图(Extended Stacked Barplot)

介绍 R语言的扩展物种堆积图是一种数据可视化工具,它不仅展示了物种的堆积结果,还整合了不同样本分组之间的差异性分析结果。这种图形表示方法能够直观地比较不同物种在各个分组中的显著性差异,为研究者提供了一种有效的数据解读方式。 加载R包 knitr::opts_chunk$set(warning = F, message = F)library(tidyverse)library(phyl

在cscode中通过maven创建java项目

在cscode中创建java项目 可以通过博客完成maven的导入 建立maven项目 使用快捷键 Ctrl + Shift + P 建立一个 Maven 项目 1 Ctrl + Shift + P 打开输入框2 输入 "> java create"3 选择 maven4 选择 No Archetype5 输入 域名6 输入项目名称7 建立一个文件目录存放项目,文件名一般为项目名8 确定

业务中14个需要进行A/B测试的时刻[信息图]

在本指南中,我们将全面了解有关 A/B测试 的所有内容。 我们将介绍不同类型的A/B测试,如何有效地规划和启动测试,如何评估测试是否成功,您应该关注哪些指标,多年来我们发现的常见错误等等。 什么是A/B测试? A/B测试(有时称为“分割测试”)是一种实验类型,其中您创建两种或多种内容变体——如登录页面、电子邮件或广告——并将它们显示给不同的受众群体,以查看哪一种效果最好。 本质上,A/B测

【生成模型系列(初级)】嵌入(Embedding)方程——自然语言处理的数学灵魂【通俗理解】

【通俗理解】嵌入(Embedding)方程——自然语言处理的数学灵魂 关键词提炼 #嵌入方程 #自然语言处理 #词向量 #机器学习 #神经网络 #向量空间模型 #Siri #Google翻译 #AlexNet 第一节:嵌入方程的类比与核心概念【尽可能通俗】 嵌入方程可以被看作是自然语言处理中的“翻译机”,它将文本中的单词或短语转换成计算机能够理解的数学形式,即向量。 正如翻译机将一种语言

计算机毕业设计 大学志愿填报系统 Java+SpringBoot+Vue 前后端分离 文档报告 代码讲解 安装调试

🍊作者:计算机编程-吉哥 🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。 🍊心愿:点赞 👍 收藏 ⭐评论 📝 🍅 文末获取源码联系 👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~Java毕业设计项目~热门选题推荐《1000套》 目录 1.技术选型 2.开发工具 3.功能