| | |
| | | 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:"; |
| | | |
| | | |
| | | /** |
| | | * 获取列表 |
| | |
| | | @ApiImplicitParam(name = "name", value = "powerUnitNumber", required = false, dataType = "String",paramType = "query"), |
| | | @ApiImplicitParam(name = "pageNumber", value = "pageNumber", required = true, dataType = "int",paramType = "query"), |
| | | @ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "int",paramType = "query"), |
| | | @ApiImplicitParam(name = "companyId", value = "companyId", required = true, dataType = "int",paramType = "query"), |
| | | }) |
| | | @GetMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String time,String name,int pageNumber,int pageSize) { |
| | | public Object list(String time,String name,int pageNumber,int pageSize,int companyId) { |
| | | Page<TCarriers> tCarriersPage = new Page<>(pageNumber, pageSize); |
| | | String sTime=null; |
| | | String eTime=null; |
| | | EntityWrapper<TCarriers> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("company_id",companyId); |
| | | wrapper.eq("remove",0); |
| | | if(ToolUtil.isNotEmpty(name)){ |
| | | wrapper.like("company_name",name).or().like("account",name); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @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....."), |