This action will force synchronization from Gitee Community/bullshit-codes, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
package com.demo.service.impl;import java.util.List;import javax.sound.sampled.Line;import com.demo.service.IFeeService;/*** 两年多工作经验的妹子写的代码 需求:物流公司会找各收货点,然后各收货点有不同线路的车辆,每个线路每天发多个班次的车,* 每个班次会带几件货物,每件货物都有服务费,查询某一天一共需要支付多少服务费*/public class FeeServiceImpl implements IFeeService {/*** 方法名和变量名类名都是我乱命名的,英文不行,当时用的是mybatis, 当时钱就是用float类型*/@Overridepublic Float calcServiceFee() {float fee = 0;// 操作数据库,查询所有收货站点,不多,20个左右List<Station> stations = stationDao.findAll();// 遍历所有收货点for (Station station : stations) {// 操作数据库 查询出每个收货站点有多少条路线,平均80条路线List<Line> lines = lineDao.findByStation(station);// 遍历所有路线for (Line line : lines) {// 操作数据库,查询出每条线路当天有几个班次,多的情况是30分钟一个班次,少的情况一天1至2个班次,算上加班车,平均一天13个班次List<Vehicle> vehicles = vehicleDao.findByLineAndTime();// 遍历所有班次for (Vehicle vehicle : vehicles) {// 操作数据库,查询每个班次带了几件货物,每件货物都是一条记录,平均每个班次带30件左右List<Goods> goodsList = goodsDao.findByVehicle();// 遍历所有货物记录for (Goods goods : goodsList) {fee += goods.fee;}}}}return fee;}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。