liujie
2023-05-26 26fa723daeccb1e731ed24034ac66aa5c56c4269
src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderServiceImpl.java
@@ -248,8 +248,12 @@
            }
            // 获取卡车公司收入
            Double companyIncome = this.baseMapper.getCompanyIncome(id, sTime, eTime);
            if(companyIncome==null){
                indexInfo.setAccountsReceivable(new BigDecimal(0));
            }else {
            indexInfo.setAccountsReceivable(new BigDecimal(companyIncome));
                indexInfo.setAccountsReceivable(new BigDecimal(companyIncome));
            }
            // 获取卡车公司支出-》 是否存在承运商  -》算价格
            EntityWrapper<TOrder> wrapper = new EntityWrapper<>();
            wrapper.eq("company_id",id);
@@ -299,7 +303,7 @@
            for (int i = 0; i <12; i++) {
                if(i==0){
                    IndexMonth indexMonth = new IndexMonth();
                    int month = DateUtil.thisMonth();
                    int month = DateUtil.thisMonth()+1;
                    indexMonth.setMonth(month);
                    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);
@@ -307,7 +311,7 @@
                    IndexMonth indexMonth = new IndexMonth();
                    instance.add(Calendar.MONTH, -1);
                    Date time1 = instance.getTime();
                    int month = DateUtil.month(time1);
                    int month = DateUtil.month(time1)+1;
                    indexMonth.setMonth(month);
                    indexMonth.setOrderNumber(this.baseMapper.selectCount(new EntityWrapper<TOrder>().eq("company_id",id).between("pay_time",DateUtil.beginOfMonth(time1),DateUtil.endOfMonth(time1))));
                    indexMonths.add(indexMonth);
@@ -364,7 +368,7 @@
            }
            // 根据订单id 获取价格
            List<TPrice> prices = priceMapper.selectList(new EntityWrapper<TPrice>().eq("order_id", tOrder.getId()));
            List<TPrice> prices = priceMapper.selectList(new EntityWrapper<TPrice>().eq("order_id", tOrder.getId()).eq("status",1));
            ArrayList<TPriceVo> priceVos = new ArrayList<TPriceVo>();
            for (TPrice price : prices) {
@@ -465,10 +469,12 @@
            Integer groupId = tUser.getGroupId();
            if(groupId!=null) {
                TGroup tGroup = tGroupMapper.selectById(groupId);
                orderInfo.setSalesGroup(tGroup.getName());
                Integer salesId = tGroup.getSalesId();
                User user = userMapper.selectById(salesId);
                orderInfo.setSales(user.getName());
                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();
@@ -485,9 +491,11 @@
            if(!"0".equals(warehouse)){
                TWarehouse tWarehouse = wareHouseMapper.selectList(new EntityWrapper<TWarehouse>().eq("company_id", tOrder.getCompanyId()).eq("code", warehouse)).get(0);
                orderInfo.setWareHouse(tWarehouse.getAddress());
                orderInfo.setEndAddress(tWarehouse.getAddress());
            }else {
                // destination信息
                orderInfo.setEndAddress(tOrder.geteAddress());
            }
            // destination信息
            orderInfo.setEndAddress(tOrder.geteAddress());
            orderInfo.setECompanyName(tOrder.geteCompanyName());
            orderInfo.setEContactName(tOrder.geteName());
            orderInfo.setEContactPhone(tOrder.getePhone());
@@ -501,6 +509,7 @@
            ArrayList<String> strings = new ArrayList<>();
            goods.forEach(e->{
                strings.add(e.getContainerNumber());
                orderInfo.setGoodsId(e.getId());
                orderInfo.setBl(e.getBillNumber());
            });
            orderInfo.setContainer(strings);
@@ -533,6 +542,11 @@
            return this.baseMapper.addOrderFile(orderId,url,name);
        }
        @Override
        public List<Map<String, Object>> queryAllOrderDatas() {
            return this.baseMapper.queryAllOrderDatas();
        }
        public static void main(String[] args) throws ParseException {