package com.stylefeng.guns.modular.system.controller; import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.utils.GoogleMap.GoogleMapUtil; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** * 控制器 * * @author fengshuonan * @Date 2023-01-30 16:34:16 */ @Controller @Api(tags = "卡车公司规则") @RequestMapping("/api/tCompanyService") public class TCompanyServiceController extends BaseController { @Autowired private ITCompanyServiceService tCompanyServiceService; @Autowired private ITCompanyService tCompanyService; @Autowired private ITCompanyFeeSettingService itCompanyFeeSettingService; @Autowired private ITPortService itPortService; @Autowired private IWarehouseService warehouseService; @Autowired private GoogleMapUtil googleMapUtil; /** * 获取列表 */ /*@ApiOperation(value = "卡车公司列表",notes="卡车公司列表") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), @ApiImplicitParam(name = "pageNumber", value = "pageNumber", required = true, dataType = "int",paramType = "query"), @ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "int",paramType = "query"), @ApiImplicitParam(name = "name", value = "名称/id", required = false, dataType = "String"), @ApiImplicitParam(name = "account", value = "account", required = true, dataType = "String"), }) @GetMapping(value = "/list") @ResponseBody public Object list(int pageNumber,int pageSize,String name,String account) { Page tCompanyVoPage = new Page<>(pageNumber, pageSize); return tCompanyService.selectList1(tCompanyVoPage,name,account); } @ApiOperation(value = "卡车公司审核列表",notes="卡车公司审核列表") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), @ApiImplicitParam(name = "pageNumber", value = "pageNumber", required = true, dataType = "int",paramType = "query"), @ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "int",paramType = "query"), @ApiImplicitParam(name = "name", value = "名称/id", required = false, dataType = "String"), @ApiImplicitParam(name = "account", value = "account", required = false, dataType = "String"), @ApiImplicitParam(name = "state", value = "state", required = false, dataType = "int"), }) @GetMapping(value = "/listCheck") @ResponseBody public Object listCheck(int pageNumber,int pageSize,String name,String account,Integer state) { Page tCompanyVoPage = new Page<>(pageNumber, pageSize); tCompanyVoPage.setRecords(tCompanyService.selectList2(tCompanyVoPage,name,account,state)); return new SuccessTip(tCompanyVoPage); }*/ /** * 新增 */ /*@ApiOperation(value = "新增卡车公司",notes="新增卡车公司") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), }) @PostMapping(value = "/add") @ResponseBody public Object add(TCompany tCompany) { tCompany.setStatus(1); tCompanyService.insert(tCompany); return SUCCESS_TIP; }*/ /** * 删除 */ /*@ApiOperation(value = "删除卡车公司",notes="删除卡车公司") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), @ApiImplicitParam(name = "tCompanyId", value = "卡车公司id", required = true, dataType = "int"), }) @DeleteMapping(value = "/delete") @ResponseBody public Object delete(@RequestParam Integer tCompanyId) { TCompany tCompany = tCompanyService.selectById(tCompanyId); tCompany.setRemove(1); tCompanyService.updateById(tCompany); return SUCCESS_TIP; } @ApiOperation(value = "冻结卡车公司",notes="冻结卡车公司") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), @ApiImplicitParam(name = "tCompanyId", value = "卡车公司id", required = true, dataType = "int"), @ApiImplicitParam(name = "type", value = "1解冻 2冻结", required = true, dataType = "int"), }) @DeleteMapping(value = "/freeze") @ResponseBody public Object freeze(@RequestParam Integer tCompanyId,Integer type) { TCompany tCompany = tCompanyService.selectById(tCompanyId); if(type==1){ tCompany.setStatus(1); }else if(type==2){ tCompany.setStatus(3); } tCompanyService.updateById(tCompany); return SUCCESS_TIP; }*/ /*@ApiOperation(value = "审核卡车公司",notes="审核卡车公司") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), @ApiImplicitParam(name = "tCompanyId", value = "卡车公司id", required = true, dataType = "int"), @ApiImplicitParam(name = "type", value = "1通过 2拒绝", required = true, dataType = "int"), @ApiImplicitParam(name = "remark", value = "拒绝原因/通过填时间(2023-01-31 17:49:08)", required = true, dataType = "String"), }) @DeleteMapping(value = "/audit") @ResponseBody public Object audit(@RequestParam Integer tCompanyId,Integer type,String remark) { TCompany tCompany = tCompanyService.selectById(tCompanyId); if(type==1){ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { Date parse = simpleDateFormat.parse(remark); tCompany.setExpirationTime(parse); } catch (ParseException e) { e.printStackTrace(); return new ErrorTip(5010, "时间格式错误!"); } tCompany.setStatus(1); }else if(type==2){ tCompany.setStatus(2); tCompany.setRemark(remark); } tCompanyService.updateById(tCompany); return SUCCESS_TIP; } public static void main(String[] args) throws ParseException { String s = HttpRequest.sendGet("https://mobile.fmcsa.dot.gov/qc/services/carriers/name/greyhound", "webKey=59ed4972942476ba86e3272d892ef1628cf86003"); System.out.println(s); }*/ /** * 修改 */ /*@ApiOperation(value = "修改卡车公司",notes="修改卡车公司") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), }) @PostMapping(value = "/update") @ResponseBody public Object update(TCompany tCompany) { tCompanyService.updateById(tCompany); return SUCCESS_TIP; }*/ /** * 详情 */ /*@ApiOperation(value = "详情-卡车公司",notes="详情-卡车公司") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), @ApiImplicitParam(name = "tCompanyId", value = "卡车公司id", required = true, dataType = "int"), }) @GetMapping(value = "/detail/{tCompanyId}") @ResponseBody public Object detail(@PathVariable("tCompanyId") Integer tCompanyId) { return tCompanyService.selectById(tCompanyId); } @ApiOperation(value = "根据卡车公司id获取卡车公司费用设置",notes="根据卡车公司id获取卡车公司费用设置") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), @ApiImplicitParam(name = "tCompanyId", value = "卡车公司id", required = true, dataType = "int"), }) @GetMapping(value = "/getCompanySetting/{tCompanyId}") @ResponseBody public Object getCompanySetting(@PathVariable("tCompanyId") Integer tCompanyId) { return itCompanyFeeSettingService.selectOne(new EntityWrapper().eq("company_id",tCompanyId)); } @ApiOperation(value = "卡车公司服务修改设置",notes="卡车公司服务修改设置") @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), }) @GetMapping(value = "/updateSetting") @ResponseBody public Object updateSetting(TCompanySettingDto dto) { TCompany tCompany = tCompanyService.selectById(dto.getId()); tCompany.setClass9(dto.getClass9()); tCompany.setClass8(dto.getClass8()); tCompany.setClass7(dto.getClass7()); tCompany.setClass6(dto.getClass6()); tCompany.setClass5(dto.getClass5()); tCompany.setClass4(dto.getClass4()); tCompany.setClass3(dto.getClass3()); tCompany.setClass2(dto.getClass2()); tCompany.setClass1(dto.getClass1()); tCompany.setDg(dto.getDg()); tCompany.setFr(dto.getFr()); tCompany.setTk(dto.getTk()); tCompany.setOt(dto.getOt()); tCompany.setRh(dto.getRh()); tCompany.setRf(dto.getRf()); tCompany.setHc(dto.getHc()); tCompany.setHq(dto.getHq()); tCompany.setGp(dto.getGp()); tCompany.setLanguage(dto.getLanguage()); tCompany.setEld(dto.getEld()); tCompany.setTwic(dto.getTwic()); tCompany.setPrivateChassis(dto.getPrivateChassis()); tCompany.setIsoTankDrayage(dto.getIsoTankDrayage()); tCompany.setTankEndorsedDrayage(dto.getTankEndorsedDrayage()); tCompany.setOpenTopDrayage(dto.getOpenTopDrayage()); tCompany.setReeferDrayage(dto.getReeferDrayage()); tCompany.setDryContainerDrayage(dto.getDryContainerDrayage()); tCompany.setRailRampDrayage(dto.getRailRampDrayage()); tCompany.setOceanPortDrayage(dto.getOceanPortDrayage()); tCompany.setContainerSizes(dto.getContainerSizes()); tCompany.setChains(dto.getChains()); tCompany.setTransloadService(dto.getTransloadService()); tCompany.setAmazon(dto.getAmazon()); tCompany.setTsa(dto.getTsa()); tCompany.setResidentialDelivery(dto.getResidentialDelivery()); tCompany.setHouseholdGoods(dto.getHouseholdGoods()); tCompany.setLiquor(dto.getLiquor()); tCompany.setOverweightPermit(dto.getOverweightPermit()); tCompany.setHAZMAT(dto.getHAZMAT()); return tCompanyService.updateById(tCompany); }*/ }