| | |
| | | tOrder.setInvoiceNumber(s2); |
| | | tOrder.setCompanyId(company.getId()); |
| | | tOrder.setCreateTime(new Date()); |
| | | if("0".equals(demandDto.getWarehouse())){ |
| | | tOrder.seteAddress(demandDto.getEAddress()); |
| | | }else { |
| | | TWarehouse tWarehouse = warehouseService.selectOne(new EntityWrapper<TWarehouse>().eq("company_id", company.getId()).eq("code", demandDto.getWarehouse()).eq("port_id",ratesId)); |
| | | tOrder.seteAddress(tWarehouse.getAddress()); |
| | | } |
| | | tOrder.setOrderType(1); |
| | | orderService.insert(tOrder); |
| | | tOrders.add(tOrder); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "需求列表",notes="需求列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | |
| | | @ApiImplicitParam(name = "address", value = "address", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "pageNumber", value = "pageNumber", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "portId", value = "portId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "companyId", value = "companyId", required = true, dataType = "int"), |
| | | }) |
| | | @GetMapping(value = "/getWarehouse") |
| | | @ResponseBody |
| | | public Object getWarehouse( String address,int pageNumber,int pageSize) { |
| | | public Object getWarehouse( String address,int pageNumber,int pageSize,int portId,int companyId) { |
| | | TRates tRates1 = ratesService.selectOne(new EntityWrapper<TRates>().eq("metro_id", portId).eq("type", 2).eq("company_id", companyId)); |
| | | int ratesId=0; |
| | | if(tRates1!=null){ |
| | | ratesId=tRates1.getId(); |
| | | }else { |
| | | // 找出city |
| | | TPort tPort = portService.selectById(portId); |
| | | TCountry tCountry = countryService.selectById(tPort.getCity()); |
| | | // 是否是符合的港区 |
| | | tRates1 = ratesService.selectOne(new EntityWrapper<TRates>().eq("metro_id", tCountry.getId()).eq("type", 1).eq("company_id", companyId)); |
| | | if(tRates1!=null){ |
| | | ratesId=tRates1.getId(); |
| | | }else { |
| | | ratesId=-1; |
| | | } |
| | | // ratesId=tCountry.getId(); |
| | | } |
| | | |
| | | Page<TWarehouse> tWarehousePage = new Page<>(pageNumber, pageSize); |
| | | |
| | | EntityWrapper<TWarehouse> tWarehouseEntityWrapper = new EntityWrapper<>(); |
| | | tWarehouseEntityWrapper.eq("company_id",0); |
| | | tWarehouseEntityWrapper.eq("company_id",companyId); |
| | | tWarehouseEntityWrapper.eq("port_id",ratesId); |
| | | if(Objects.nonNull(address)){ |
| | | tWarehouseEntityWrapper.like("address",address); |
| | | } |
| | |
| | | EntityWrapper<TDriver> wrapper = new EntityWrapper<>(); |
| | | Page<TDriver> tDriverPage = new Page<>(pageNumber, pageSize); |
| | | wrapper.eq("remove", 0); |
| | | wrapper.eq("is_carriers",1); |
| | | wrapper.eq("company_id",id); |
| | | if (ToolUtil.isNotEmpty(name)) { |
| | | wrapper.like("driver_name", name).or().like("account", name); |
| | |
| | | @GetMapping(value = "/exportQuickBook") |
| | | @ResponseBody |
| | | public Object exportQuickBooks(){ |
| | | List<Map<String,Object>> orders = orderService.queryAllOrderDatas(); |
| | | redisUtil.setStrValue(INVOICE_DATA,orders.toString()); |
| | | redisUtil.setStrValue("quick","3"); |
| | | try { |
| | | View view = InvoicesDataUploadUtil.connectToQuickBooks(); |
| | | log.info("view:{}",view); |
| | | } catch (InvalidRequestException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return new com.stylefeng.guns.core.base.tips.SuccessTip(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "应付款票据quickBooks--bill",notes="应付款票据quickBooks--bill") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | @GetMapping(value = "/exportQuickBookBill") |
| | | @ResponseBody |
| | | public Object exportQuickBookBill(){ |
| | | redisUtil.setStrValue("quick","4"); |
| | | try { |
| | | View view = InvoicesDataUploadUtil.connectToQuickBooks(); |
| | | log.info("view:{}",view); |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyFeeSettingService; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyServiceService; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.utils.tips.ErrorTip; |
| | | import com.stylefeng.guns.modular.system.utils.tips.SuccessTip; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @Autowired |
| | | private ITCompanyServiceService itCompanyServiceService; |
| | | |
| | | @Autowired |
| | | private TPowerUnitsService powerUnitsService; |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | |
| | | |
| | |
| | | BeanUtil.copyProperties(company,tCompanyDto); |
| | | List<TCompanyService> companyServiceList = itCompanyServiceService.selectList(new EntityWrapper<TCompanyService>().eq("company_id", tCompanyId).eq("type",0)); |
| | | tCompanyDto.setList(companyServiceList); |
| | | int i = powerUnitsService.selectCount(new EntityWrapper<TPowerUnits>().eq("company_id", tCompanyId).eq("type", 1)); |
| | | tCompanyDto.setPowerUnits(i); |
| | | int e = powerUnitsService.selectCount(new EntityWrapper<TPowerUnits>().eq("company_id", tCompanyId).eq("type", 2)); |
| | | tCompanyDto.setChassises(e); |
| | | int d = driverService.selectCount(new EntityWrapper<TDriver>().eq("company_id", tCompanyId)); |
| | | tCompanyDto.setDrivers(d); |
| | | return new SuccessTip(tCompanyDto); |
| | | } |
| | | |
| | |
| | | |
| | | private Integer work; |
| | | private List<TCompanyService> list; |
| | | |
| | | |
| | | private Integer drivers; |
| | | |
| | | private Integer chassises; |
| | | private Integer powerUnits; |
| | | } |
| | |
| | | |
| | | private String note; |
| | | |
| | | @TableField("admin_invoice") |
| | | private Integer adminInvoice; |
| | | |
| | | public Integer getAdminInvoice() { |
| | | return adminInvoice; |
| | | } |
| | | |
| | | public void setAdminInvoice(Integer adminInvoice) { |
| | | this.adminInvoice = adminInvoice; |
| | | } |
| | | |
| | | public Integer getAdminBill() { |
| | | return adminBill; |
| | | } |
| | | |
| | | public void setAdminBill(Integer adminBill) { |
| | | this.adminBill = adminBill; |
| | | } |
| | | |
| | | public Integer getCompanyInvoice() { |
| | | return companyInvoice; |
| | | } |
| | | |
| | | public void setCompanyInvoice(Integer companyInvoice) { |
| | | this.companyInvoice = companyInvoice; |
| | | } |
| | | |
| | | public Integer getCompanyBill() { |
| | | return companyBill; |
| | | } |
| | | |
| | | public void setCompanyBill(Integer companyBill) { |
| | | this.companyBill = companyBill; |
| | | } |
| | | |
| | | @TableField("admin_bill") |
| | | private Integer adminBill; |
| | | @TableField("company_invoice") |
| | | private Integer companyInvoice; |
| | | @TableField("company_bill") |
| | | private Integer companyBill; |
| | | |
| | | public Date getOrderOkTime() { |
| | | return orderOkTime; |
| | | } |
| | |
| | | @TableField("purchase_amount") |
| | | private String purchaseAmount; |
| | | @TableField("purchase_dae") |
| | | private String purchaseDae; |
| | | private Date purchaseDae; |
| | | @TableField("sola_date") |
| | | private Date solaDate; |
| | | @TableField("factory_price") |
| | |
| | | private Integer edit; |
| | | |
| | | |
| | | public String getHeadImg() { |
| | | return headImg; |
| | | } |
| | | |
| | | public void setHeadImg(String headImg) { |
| | | this.headImg = headImg; |
| | | } |
| | | |
| | | private String headImg; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | |
| | | Integer groupId = tUser.getGroupId(); |
| | | if(groupId!=null) { |
| | | TGroup tGroup = tGroupMapper.selectById(groupId); |
| | | if(tGroup!=null) { |
| | | orderInfo.setSalesGroup(tGroup.getName()); |
| | | Integer salesId = tGroup.getSalesId(); |
| | | User user = userMapper.selectById(salesId); |
| | | orderInfo.setSales(user.getName()); |
| | | } |
| | | } |
| | | // 获取码头id 获取码头地址 pickup信息 |
| | | Integer portId = tOrder.getPort(); |
| | | TPort tPort = portMapper.selectById(portId); |
| | |
| | | public class InvoicesDataUploadUtil { |
| | | |
| | | // private static final String redirectUrl = "http://cca19.com:8010/gunsApi/oauth2redirect"; |
| | | private static final String redirectUrl = "http://cca19.com:8010/gunsApi/oauth2redirectOfCar"; |
| | | private static final String redirectUrl = "http://cca19.com:8010/gunsApi/oauth2redirect"; |
| | | |
| | | private static final String createInvoiceUrl = "https://sandbox-quickbooks.api.intuit.com"; |
| | | |