| | |
| | | package com.stylefeng.guns.modular.system.controller; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.modular.system.enums.FacilityCodeEnum; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.FileNameMap; |
| | | import java.net.URLConnection; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | @Controller |
| | | @Api(tags = "订单") |
| | |
| | | @GetMapping(value = "/getOrderInfo") |
| | | @ResponseBody |
| | | public Object getOrderInfo( Long orderId) { |
| | | OrderInfo orderInfo = orderService.getOrderInfo(orderId); |
| | | HashMap<String, Object> orderInfo = orderService.getOrderInfo(orderId); |
| | | return new SuccessTip(orderInfo); |
| | | } |
| | | |
| | |
| | | if(driverIdOne!=null){ |
| | | driverIds.add(driverIdOne); |
| | | } |
| | | TGoods tGoods = goodsService.selectOne(new EntityWrapper<TGoods>().eq("order_id", tOrder.getId())); |
| | | List<TTransportation> tTransportations = tTransportationService.selectList(new EntityWrapper<TTransportation>().eq("order_id", orderId).in("driver_id", driverIds)); |
| | | TerminaleDataWarpper terminalStatus = TerminalInterfaceAcquisitionUtil.getTerminalStatus("WFHU5080179", FacilityCodeEnum.USLAX.getMsg()); |
| | | TerminaleDataWarpper terminalStatus =new TerminaleDataWarpper(); |
| | | try { |
| | | terminalStatus = TerminalInterfaceAcquisitionUtil.getTerminalStatus(tGoods.getContainerNumber(), FacilityCodeEnum.USLAX.getMsg()); |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | terminalStatus =new TerminaleDataWarpper(); |
| | | } |
| | | |
| | | for (TTransportation tDriver : tTransportations) { |
| | | OrderDriverInfo orderDriverInfo = new OrderDriverInfo(); |
| | | orderDriverInfo.setId(tDriver.getId()); |
| | | orderDriverInfo.setDriverId(tDriver.getDriverId()); |
| | | if(tDriver.getId().equals(sDriverIdOne)&&tDriver.getType()==2){ |
| | | orderDriverInfo.setPickUp(tDriver.getPickDate()); |
| | | } |
| | |
| | | orderDriverInfo.setTPowerUnits(powerUnitsService.selectById(tDriver.getPowerUnit())); |
| | | orderDriverInfo.setChassiess(powerUnitsService.selectById(tDriver.getChassises())); |
| | | |
| | | // TODO 第三方 目前不知道对接那个 |
| | | orderDriverInfo.setAppointmentNumber(terminalStatus.getAppointmentNumber()); |
| | | |
| | | orderDriverInfos.add(orderDriverInfo); |
| | |
| | | BigDecimal subtract = price.getPrice().subtract(multiply); |
| | | priceInfo.setCarrierCost(subtract); |
| | | priceInfo.setSalesProfit(new BigDecimal(commission)); |
| | | priceInfo.setMargin(multiply); |
| | | priceInfo.setMargin(multiply.setScale(2, RoundingMode.HALF_UP)); |
| | | }else { |
| | | priceInfo.setMargin(new BigDecimal(0)); |
| | | priceInfo.setSalesProfit(new BigDecimal(commission)); |
| | |
| | | return new SuccessTip(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "卡车公司--save time",notes="卡车公司--save time") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "orderId", value = "orderId", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(name = "time", value = "time", required = true, dataType = "String"), |
| | | |
| | | }) |
| | | @PostMapping(value = "/updateSaveTime") |
| | | @ResponseBody |
| | | public Object updateSaveTime( Long orderId,String time){ |
| | | TOrder tOrder = orderService.selectById(orderId); |
| | | Date date = DateUtil.parse(time).toJdkDate(); |
| | | tOrder.setShipmentDate(date); |
| | | orderService.updateById(tOrder); |
| | | return new SuccessTip(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "卡车公司--安排司机",notes="卡车公司--安排司机") |
| | |
| | | } |
| | | record.setType(type); |
| | | } |
| | | orderFilePage.setRecords(records); |
| | | TOrder tOrder = orderService.selectById(orderId); |
| | | |
| | | if("9".equals(tOrder.getStatus()) || "18".equals(tOrder.getStatus())){ |
| | | ArrayList<TOrderFile> tOrderFiles = new ArrayList<>(); |
| | | TOrderFile tOrderFile = new TOrderFile(); |
| | | tOrderFile.setName("Bill of lading.pdf"); |
| | | tOrderFile.setId(0); |
| | | tOrderFile.setType("file"); |
| | | tOrderFiles.add(tOrderFile); |
| | | tOrderFiles.addAll(records); |
| | | orderFilePage.setRecords(tOrderFiles); |
| | | }else { |
| | | |
| | | orderFilePage.setRecords(records); |
| | | } |
| | | return new SuccessTip(orderFilePage); |
| | | } |
| | | |