| | |
| | | private ConvenientElevatingPointDAO convenientElevatingPointDAO; |
| | | @Resource |
| | | private ComShopFlowerEvaluateDAO comShopFlowerEvaluateDAO; |
| | | @Resource |
| | | private ComShopFlowerRefundOrderDAO comShopFlowerRefundOrderDAO; |
| | | |
| | | |
| | | @Value("${hcMin.app.isTest}") |
| | |
| | | shopOrderDO.setOrderNo(orderNo); |
| | | shopOrderDO.setStoreId(storeId); |
| | | shopOrderDO.setUserId(userId); |
| | | //TODO |
| | | shopOrderDO.setStatus(ComShopFlowerOrderDO.status.dfk); |
| | | shopOrderDO.setPayStatus(ComShopFlowerOrderDO.payStatus.no); |
| | | shopOrderDO.setReceiverId(orderCreateDTO.getReceiverId()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R selectCountByDeliveryType(Integer deliveryType) { |
| | | List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountByDeliveryType(deliveryType); |
| | | public R selectCountByDeliveryType(Integer deliveryType,Long storeId) { |
| | | //1.等待配送 2.配送中 3.待收货 4.待评价 5.已完成 6.已取消 7.已退款 8.总订单 |
| | | String[] statusStr = {"ddps","psz","dsh","dpj","ywc","yqx","ytk"}; |
| | | List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountByDeliveryType(deliveryType,storeId); |
| | | Map<Integer, Integer> collect = comShopOrderCountVOS.stream().collect(Collectors.toMap(ComShopOrderCountVO::getStatus, ComShopOrderCountVO::getAmount)); |
| | | ComShopOrderCountVO comShopOrderCountVO = new ComShopOrderCountVO(); |
| | | comShopOrderCountVO.setStatus(8); |
| | | comShopOrderCountVO.setAmount(0); |
| | | for (int i = 1; i < 8; i++) { |
| | | Map<String,Integer> retMap = new HashMap<>(); |
| | | int amountTotal = 0; |
| | | for (int i = 0; i < statusStr.length; i++) { |
| | | if (collect.containsKey(i)) { |
| | | Integer amount = collect.get(i); |
| | | comShopOrderCountVO.setAmount(amount + comShopOrderCountVO.getAmount()); |
| | | amountTotal = amountTotal + amount; |
| | | retMap.put(statusStr[i],amount); |
| | | }else { |
| | | collect.put(i,0); |
| | | retMap.put(statusStr[i],0); |
| | | } |
| | | } |
| | | collect.put(comShopOrderCountVO.getStatus(),comShopOrderCountVO.getAmount()); |
| | | retMap.put("zdd",amountTotal); |
| | | |
| | | return R.ok(collect); |
| | | return R.ok(retMap); |
| | | } |
| | | |
| | | @Override |
| | | public R selectCountByStoreId(Long storeId){ |
| | | Map<String,Object> retMap = new HashMap<>(); |
| | | //查询我的店铺订单量 |
| | | List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS = this.baseMapper.selectCountByStoreId(storeId, null); |
| | | Map<String, Integer> zddlMap = comShopOrderStoreIdCountVOS.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCount)); |
| | | retMap.put("zddl",zddlMap); |
| | | //查询我的店铺拼单订单 |
| | | List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS1 = this.baseMapper.selectCountByStoreId(storeId, ComShopFlowerOrderDO.deliveryType.store); |
| | | Map<String, Integer> pdddMap = comShopOrderStoreIdCountVOS1.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCount)); |
| | | retMap.put("pddd",pdddMap); |
| | | //查询我的店铺快递订单 |
| | | List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS2 = this.baseMapper.selectCountByStoreId(storeId, ComShopFlowerOrderDO.deliveryType.express); |
| | | Map<String, Integer> kdddMap = comShopOrderStoreIdCountVOS2.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCount)); |
| | | retMap.put("kddd",kdddMap); |
| | | |
| | | //拼单订单各状态 |
| | | R r = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.store,storeId); |
| | | retMap.put("pdddStatus",r.getData()); |
| | | |
| | | //快递订单各状态 |
| | | R r1 = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.express,storeId); |
| | | retMap.put("kdddStatus",r1.getData()); |
| | | //营业额 |
| | | List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS3 = this.baseMapper.selectSumAmountByStoreId(storeId); |
| | | Map<String, Integer> yyeMap = comShopOrderStoreIdCountVOS3.stream().collect(Collectors.toMap(ComShopOrderStoreIdCountVO::getCountName, ComShopOrderStoreIdCountVO::getCount)); |
| | | retMap.put("yye",yyeMap); |
| | | //在售商品 |
| | | Integer countSale = comShopFlowerGoodsDAO.selectCountSaleByStoreId(storeId); |
| | | retMap.put("countSale",countSale); |
| | | //退款申请 |
| | | Integer refundOrder = comShopFlowerRefundOrderDAO.selectCountByStoreId(storeId); |
| | | retMap.put("refundOrder",refundOrder); |
| | | |
| | | return R.ok(retMap); |
| | | } |
| | | |
| | | |