| | |
| | | package com.stylefeng.guns.modular.system.controller; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TCarriers; |
| | | import com.stylefeng.guns.modular.system.service.TCarriersService; |
| | | import com.stylefeng.guns.modular.system.utils.CargoQueryInteraceUtil; |
| | | import com.stylefeng.guns.modular.system.utils.InsertCargoDetailsWarpper; |
| | | import com.stylefeng.guns.modular.system.utils.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.utils.WoUtil; |
| | | import com.stylefeng.guns.modular.system.utils.tips.ErrorTip; |
| | | import com.stylefeng.guns.modular.system.utils.tips.SuccessTip; |
| | |
| | | |
| | | @Autowired |
| | | private TCarriersService carriersService; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | private String CARGO_LIST = "cargo_list:"; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "卡车公司-添加承运商",notes="卡车公司-添加承运商") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | |
| | | } |
| | | |
| | | |
| | | // 根据输入框的输入信息,调用第三方接口获取数据 |
| | | @ApiOperation(value = "查询卡车公司",notes="查询卡车公司") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | @PostMapping(value = "/query") |
| | | @ResponseBody |
| | | public Object queryCargoData(String MCNumber,String USdot){ |
| | | if(ToolUtil.isEmpty(MCNumber)&&ToolUtil.isEmpty(USdot)){ |
| | | return new SuccessTip(); |
| | | } |
| | | String value = ""; |
| | | InsertCargoDetailsWarpper insertCargoDetailsWarpper = new InsertCargoDetailsWarpper(); |
| | | try { |
| | | |
| | | InsertCargoDetailsWarpper data = CargoQueryInteraceUtil.getData(MCNumber,USdot); |
| | | value = JSON.toJSONString(data); |
| | | JSONObject o = JSONObject.parseObject(value); |
| | | if (ToolUtil.isNotEmpty(o)){ |
| | | insertCargoDetailsWarpper.setUSDot(o.get("uSDot").toString()); |
| | | insertCargoDetailsWarpper.setAddress(o.get("address").toString()); |
| | | insertCargoDetailsWarpper.setDrivers(o.get("drivers").toString().equals("null")?"0":o.get("drivers").toString()); |
| | | insertCargoDetailsWarpper.setCompanyName(o.get("companyName").toString()); |
| | | insertCargoDetailsWarpper.setPowerUnits(o.get("powerUnits").toString()); |
| | | insertCargoDetailsWarpper.setInspection(o.get("inspection").toString()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | return new SuccessTip(insertCargoDetailsWarpper); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "卡车公司-承运商详情",notes="卡车公司-承运商详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |