| | |
| | | package com.stylefeng.guns.modular.system.controller; |
| | | |
| | | import cn.hutool.core.date.DateField; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | |
| | | 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.UserInfoUtil; |
| | | 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; |
| | |
| | | @PostMapping(value = "/addCarriers") |
| | | @ResponseBody |
| | | public Object addCarriers(@RequestBody TCarriers tCarriers) { |
| | | tCarriers.setCompanyId(UserInfoUtil.getId()); |
| | | tCarriers.setCreateTime(new Date()); |
| | | carriersService.insert(tCarriers); |
| | | return new SuccessTip(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "卡车公司-承运商详情",notes="卡车公司-承运商详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "int",paramType = "query"), |
| | | }) |
| | | @PostMapping(value = "/carriersInfo") |
| | | @ResponseBody |
| | | public Object carriersInfo( int id) { |
| | | TCarriers tCarriers = carriersService.selectById(id); |
| | | return new SuccessTip(tCarriers); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "卡车公司-编辑承运商",notes="卡车公司-编辑承运商") |
| | | @ApiImplicitParams({ |
| | |
| | | }) |
| | | @RequestMapping(value = "/exportCarriers", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public Object exportCarriers(HttpServletRequest request, MultipartFile file) { |
| | | public Object exportCarriers(HttpServletRequest request, MultipartFile file,int id) { |
| | | try { |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | |
| | | continue; |
| | | } |
| | | TCarriers tCarriers = new TCarriers(); |
| | | tCarriers.setCompanyId(UserInfoUtil.getId()); |
| | | tCarriers.setCompanyId(id); |
| | | tCarriers.setRemove(0); |
| | | tCarriers.setCompanyName(zero); |
| | | tCarriers.setScacCode(one); |
| | |
| | | tCarriers.setPassword(SecureUtil.md5(seventeen)); |
| | | list.add(tCarriers); |
| | | } |
| | | carriersService.insertBatch(list); |
| | | if(list.size()>0){ |
| | | |
| | | carriersService.insertBatch(list); |
| | | } |
| | | return new SuccessTip(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |