| | |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderService; |
| | | import com.stylefeng.guns.modular.system.utils.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.utils.UserInfoUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | private TCarriersMapper carriersMapper; |
| | | |
| | | @Override |
| | | public List<ReceivableVo> getReceivable(Page<ReceivableVo> receivableVoPage, String time, String name) { |
| | | public List<ReceivableVo> getReceivable(Page<ReceivableVo> receivableVoPage, String time, String name,int id) { |
| | | //TODO 时间保留 |
| | | List<ReceivableVo> list = this.baseMapper.getReceivable(receivableVoPage,name); |
| | | List<ReceivableVo> list = this.baseMapper.getReceivable(receivableVoPage,name,id); |
| | | |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.setTime(new Date()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ShouldPayVo> getPayList(Page<ShouldPayVo> receivableVoPage, String time, String name) { |
| | | List<ShouldPayVo> list = this.baseMapper.getPayList(receivableVoPage,name); |
| | | public List<ShouldPayVo> getPayList(Page<ShouldPayVo> receivableVoPage, String time, String name,int id) { |
| | | List<ShouldPayVo> list = this.baseMapper.getPayList(receivableVoPage,name,id); |
| | | |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.setTime(new Date()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ReceivablesList> listOfReceivables(Page<ReceivablesList> receivableVoPage, String time, String name, Integer invoicesId, Integer orderId, Integer state) { |
| | | public List<ReceivablesList> listOfReceivables(Page<ReceivablesList> receivableVoPage, String time, String name, Integer invoicesId, Integer orderId, Integer state,Integer id) { |
| | | String sTime=null; |
| | | String eTime =null; |
| | | if(Objects.nonNull(time)){ |
| | | sTime = time.split(" - ")[0]+" 00:00:01"; |
| | | eTime = time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | List<ReceivablesList> receivablesLists = this.baseMapper.listOfReceivables(receivableVoPage, sTime, eTime, name, invoicesId, orderId, state); |
| | | List<ReceivablesList> receivablesLists = this.baseMapper.listOfReceivables(receivableVoPage, sTime, eTime, name, invoicesId, orderId, state,id); |
| | | for (ReceivablesList receivablesList : receivablesLists) { |
| | | Integer id= this.baseMapper.getPayStatus(receivablesList.getOrderId()); |
| | | if(id==null){ |
| | | Integer ids= this.baseMapper.getPayStatus(receivablesList.getOrderId()); |
| | | if(ids==null){ |
| | | receivablesList.setPayStatus(1); |
| | | }else { |
| | | receivablesList.setPayStatus(2); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<PayList> listOfPay(Page<PayList> receivableVoPage, String time, String name, Integer billId, Integer orderId, Integer state) { |
| | | public List<PayList> listOfPay(Page<PayList> receivableVoPage, String time, String name, Integer billId, Integer orderId, Integer state, Integer id) { |
| | | String sTime=null; |
| | | String eTime =null; |
| | | if(Objects.nonNull(time)){ |
| | | sTime = time.split(" - ")[0]+" 00:00:01"; |
| | | eTime = time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | List<PayList> list = this.baseMapper.listOfPay(receivableVoPage, sTime, eTime, name, billId, orderId, state); |
| | | List<PayList> list = this.baseMapper.listOfPay(receivableVoPage, sTime, eTime, name, billId, orderId, state,id); |
| | | return list; |
| | | } |
| | | |
| | |
| | | List<TGoods> orders = tGoodsMapper.selectList(new EntityWrapper<TGoods>().eq("order_id", id)); |
| | | ArrayList<TGoodsVo> tGoodsVos = new ArrayList<>(); |
| | | TCompany tCompany = tCompanyMapper.selectById(info.getCompanyId()); |
| | | List<TBoxSize> tBoxSizes = sizeService.selectList(null); |
| | | |
| | | for (TGoods order : orders) { |
| | | TGoodsVo tGoodsVo = new TGoodsVo(); |
| | |
| | | tGoodsVo.setSize(order.getSize()); |
| | | tGoodsVo.setKg(order.getKg()); |
| | | String size = order.getSize(); |
| | | for (TBoxSize tBoxSize : tBoxSizes) { |
| | | if(size.equals(tBoxSize.getBoxName())){ |
| | | tGoodsVo.setLength(tBoxSize.getBoxLength()); |
| | | tGoodsVo.setWidth(tBoxSize.getBoxWidth()); |
| | | tGoodsVo.setHeight(tBoxSize.getBoxHigh()); |
| | | } |
| | | } |
| | | tGoodsVo.setType(size); |
| | | tGoodsVos.add(tGoodsVo); |
| | | } |
| | | // 付卡车公司钱 |
| | |
| | | private TPowerUnitsMapper powerUnitsMapper; |
| | | |
| | | @Override |
| | | public IndexInfo indexList(String time) { |
| | | public IndexInfo indexList(String time,int id) { |
| | | IndexInfo indexInfo = new IndexInfo(); |
| | | // 卡车公司收入时间 |
| | | String sTime=null; |
| | |
| | | sTime=time.split(" - ")[0]+" 00:00:01"; |
| | | eTime=time.split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | Integer companyId = UserInfoUtil.getId(); |
| | | // 获取卡车公司收入 |
| | | Double companyIncome = this.baseMapper.getCompanyIncome(companyId, sTime, eTime); |
| | | Double companyIncome = this.baseMapper.getCompanyIncome(id, sTime, eTime); |
| | | |
| | | indexInfo.setAccountsReceivable(new BigDecimal(companyIncome)); |
| | | // 获取卡车公司支出-》 是否存在承运商 -》算价格 |
| | | EntityWrapper<TOrder> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("company_id",companyId); |
| | | wrapper.eq("company_id",id); |
| | | wrapper.eq("carriers_pay_status",1); |
| | | if(sTime!=null){ |
| | | wrapper.between("success_time",sTime,eTime); |
| | |
| | | indexInfo.setPlatformRevenue(indexInfo.getAccountsReceivable().subtract(indexInfo.getAccountsPayable())); |
| | | // 所有的信息 |
| | | // 所有司机 |
| | | Integer integer = driverMapper.selectCount(new EntityWrapper<TDriver>().eq("company_id", companyId).eq("remove",0)); |
| | | Integer integer = driverMapper.selectCount(new EntityWrapper<TDriver>().eq("company_id", id).eq("remove",0)); |
| | | indexInfo.setDriver(integer); |
| | | //车头 |
| | | Integer integer1 = powerUnitsMapper.selectCount(new EntityWrapper<TPowerUnits>().eq("company_id", companyId).eq("type", 1)); |
| | | Integer integer1 = powerUnitsMapper.selectCount(new EntityWrapper<TPowerUnits>().eq("company_id", id).eq("type", 1)); |
| | | indexInfo.setPowerUnits(integer1); |
| | | // 车架 |
| | | indexInfo.setChassises(powerUnitsMapper.selectCount(new EntityWrapper<TPowerUnits>().eq("company_id", companyId).eq("type", 2))); |
| | | indexInfo.setChassises(powerUnitsMapper.selectCount(new EntityWrapper<TPowerUnits>().eq("company_id", id).eq("type", 2))); |
| | | // 总订单 |
| | | indexInfo.setOrdersTotal(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",companyId))); |
| | | indexInfo.setOrdersTotal(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",id))); |
| | | // |
| | | indexInfo.setInTransit(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",companyId).eq("status","7"))); |
| | | indexInfo.setDispatching(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",companyId).eq("status","0"))); |
| | | indexInfo.setCanceled(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",companyId).eq("status","16"))); |
| | | indexInfo.setCompleted(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",companyId).eq("status","1"))); |
| | | indexInfo.setInTransit(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",id).eq("status","7"))); |
| | | indexInfo.setDispatching(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",id).eq("status","0"))); |
| | | indexInfo.setCanceled(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",id).eq("status","16"))); |
| | | indexInfo.setCompleted(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",id).eq("status","1"))); |
| | | //获取当前公司的订单数量 根据当前月推算前12个月 |
| | | ArrayList<IndexMonth> indexMonths = new ArrayList<>(); |
| | | //获取当前月份 |
| | |
| | | IndexMonth indexMonth = new IndexMonth(); |
| | | int month = DateUtil.thisMonth(); |
| | | indexMonth.setMonth(month); |
| | | indexMonth.setOrderNumber(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",companyId).between("pay_time",DateUtil.beginOfMonth(new Date()),DateUtil.endOfMonth(new Date())))); |
| | | indexMonth.setOrderNumber(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",id).between("pay_time",DateUtil.beginOfMonth(new Date()),DateUtil.endOfMonth(new Date())))); |
| | | indexMonths.add(indexMonth); |
| | | }else { |
| | | IndexMonth indexMonth = new IndexMonth(); |
| | |
| | | Date time1 = instance.getTime(); |
| | | int month = DateUtil.month(time1); |
| | | indexMonth.setMonth(month); |
| | | indexMonth.setOrderNumber(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",companyId).between("pay_time",DateUtil.beginOfMonth(time1),DateUtil.endOfMonth(time1)))); |
| | | indexMonth.setOrderNumber(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",id).between("pay_time",DateUtil.beginOfMonth(time1),DateUtil.endOfMonth(time1)))); |
| | | indexMonths.add(indexMonth); |
| | | } |
| | | } |
| | |
| | | List<TGoods> orders = tGoodsMapper.selectList(new EntityWrapper<TGoods>().eq("order_id", id)); |
| | | ArrayList<TGoodsVo> tGoodsVos = new ArrayList<>(); |
| | | TCompany tCompany = tCompanyMapper.selectById(info.getCompanyId()); |
| | | List<TBoxSize> tBoxSizes = sizeService.selectList(null); |
| | | for (TGoods order : orders) { |
| | | TGoodsVo tGoodsVo = new TGoodsVo(); |
| | | tGoodsVo.setName(tCompany.getName()); |
| | | tGoodsVo.setSize(order.getSize()); |
| | | tGoodsVo.setKg(order.getKg()); |
| | | String size = order.getSize(); |
| | | for (TBoxSize tBoxSize : tBoxSizes) { |
| | | if(size.equals(tBoxSize.getBoxName())){ |
| | | tGoodsVo.setLength(tBoxSize.getBoxLength()); |
| | | tGoodsVo.setWidth(tBoxSize.getBoxWidth()); |
| | | tGoodsVo.setHeight(tBoxSize.getBoxHigh()); |
| | | } |
| | | } |
| | | tGoodsVo.setSize(size); |
| | | tGoodsVos.add(tGoodsVo); |
| | | } |
| | | |
| | |
| | | sTime=split[0]+" 00:00:01"; |
| | | eTime=split[1]+" 23:59:59"; |
| | | } |
| | | Integer id = UserInfoUtil.getId(); |
| | | Integer id = dto.getCompanyId(); |
| | | List<OrderListVo> list = this.baseMapper.getOrderListOne(orderListVoPage,sTime,eTime,dto.getCustomerName(),dto.getId(),dto.getGroupId(),dto.getSaleId(),dto.getState(),id,dto.getType()); |
| | | for (OrderListVo orderListVo : list) { |
| | | // TODO 对接第三方 看是否能提柜 |