|  |  |  | 
|---|
|  |  |  | import cc.mrbird.febs.common.enumerates.OrderStatusEnum; | 
|---|
|  |  |  | import cc.mrbird.febs.common.exception.FebsException; | 
|---|
|  |  |  | import cc.mrbird.febs.common.utils.FebsUtil; | 
|---|
|  |  |  | import cc.mrbird.febs.common.utils.RedisUtils; | 
|---|
|  |  |  | import cc.mrbird.febs.common.utils.SpringContextHolder; | 
|---|
|  |  |  | import cc.mrbird.febs.common.utils.excl.ExcelSheetPO; | 
|---|
|  |  |  | import cc.mrbird.febs.common.utils.excl.ExcelUtil; | 
|---|
|  |  |  | 
|---|
|  |  |  | import cc.mrbird.febs.mall.mapper.*; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.service.IAdminMallGoodsService; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.service.IAdminMallOrderService; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.service.IApiMallTeamLeaderService; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.service.MallInvoiceService; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.vo.AdminAddAddressTreeVo; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.vo.AdminMallOrderRefundAddressVo; | 
|---|
|  |  |  | import cc.mrbird.febs.pay.model.OrderStateDto; | 
|---|
|  |  |  | 
|---|
|  |  |  | private final MallTeamLeaderMapper mallTeamLeaderMapper; | 
|---|
|  |  |  | private final MallMemberMapper mallMemberMapper; | 
|---|
|  |  |  | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; | 
|---|
|  |  |  | private final RedisUtils redisUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final IApiMallTeamLeaderService apiMallTeamLeaderService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单列表-发货", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse deliverGoods(@Valid DeliverGoodsDto deliverGoodsDto) { | 
|---|
|  |  |  | return adminMallOrderService.deliverGoods(deliverGoodsDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单列表-修改物流编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("deliverGoodsUpdate") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单列表-修改物流编号", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse deliverGoodsUpdate(@Valid DeliverGoodsDto deliverGoodsDto) { | 
|---|
|  |  |  | return adminMallOrderService.deliverGoodsUpdate(deliverGoodsDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单退款-拒绝", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse disagreeRefund(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return adminMallOrderService.disagreeRefund(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 退款操作 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping(value = "/refundOperation") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单退款", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse refundOperation(ApiLeaderRefundOrderDto apiLeaderRefundOrderDto) { | 
|---|
|  |  |  | return apiMallTeamLeaderService.leaderRefundOrder(apiLeaderRefundOrderDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | orderSheet.setSheetName(title); | 
|---|
|  |  |  | orderSheet.setTitle(title); | 
|---|
|  |  |  | //        String[] header = {"订单编号", "订单金额", "下单时间", "配送方式", "收货姓名", "收货电话", "收货地址", "商品名称", "订单状态", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | String[] header = {"订单编号", "订单金额", "下单时间", "配送方式", "收货姓名", "收货电话", "收货地址", "商品名称", "订单状态", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | //        String[] header = {"订单编号", "订单金额", "下单时间", "配送方式", "收货姓名", "收货电话", "收货地址", "商品详情", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | //        String[] header = {"订单编号", "收货姓名", "收货电话", "收货地址", "商品详情", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | String[] header = {"订单编号", "收货姓名", "收货电话", "收货地址", "商品详情", "备注", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | orderSheet.setHeaders(header); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | QueryRequest request = new QueryRequest(); | 
|---|
|  |  |  | 
|---|
|  |  |  | for (MallOrderInfo item : dataList) { | 
|---|
|  |  |  | List<Object> temp = new ArrayList<>(); | 
|---|
|  |  |  | temp.add(item.getOrderNo()); | 
|---|
|  |  |  | temp.add(item.getAmount()); | 
|---|
|  |  |  | temp.add(DateUtil.format(item.getOrderTime(), "yyyy-MM-dd HH:mm:ss")); | 
|---|
|  |  |  | temp.add("快递配送"); | 
|---|
|  |  |  | //                temp.add(item.getAmount()); | 
|---|
|  |  |  | //                temp.add(DateUtil.format(item.getOrderTime(), "yyyy-MM-dd HH:mm:ss")); | 
|---|
|  |  |  | //                temp.add("快递配送"); | 
|---|
|  |  |  | temp.add(item.getName()); | 
|---|
|  |  |  | temp.add(item.getPhone()); | 
|---|
|  |  |  | temp.add(item.getAddress()); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (MallOrderItem itemItem : item.getItems()) { | 
|---|
|  |  |  | if (StrUtil.isNotBlank(sb)) { | 
|---|
|  |  |  | sb.append(";" + itemItem.getGoodsName() + "*" + itemItem.getCnt()); | 
|---|
|  |  |  | sb.append(";" + itemItem.getGoodsName()+"-"+itemItem.getSkuName() + "*" + itemItem.getCnt()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | sb.append(itemItem.getGoodsName() + "*" + itemItem.getCnt()); | 
|---|
|  |  |  | sb.append(itemItem.getGoodsName()+"-"+itemItem.getSkuName() + "*" + itemItem.getCnt()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | temp.add(sb.toString()); | 
|---|
|  |  |  | 
|---|
|  |  |  | temp.add(""); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | temp.add(item.getStatus()); | 
|---|
|  |  |  | temp.add(item.getRemark()); | 
|---|
|  |  |  | //                temp.add(item.getStatus()); | 
|---|
|  |  |  | list.add(temp); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String fileName = file.getOriginalFilename(); | 
|---|
|  |  |  | String dirPath = "/home/javaweb/webresource/qianAYi/"; | 
|---|
|  |  |  | String dirPath = "/home/javaweb/webresource/blnka/"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | File saveFile = new File(new File(dirPath).getAbsolutePath() + File.separator + fileName); | 
|---|
|  |  |  | if (!saveFile.exists()) { | 
|---|
|  |  |  | 
|---|
|  |  |  | if (parentId == null) { | 
|---|
|  |  |  | ViewMallOrderController.orderIdsStr = ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | long[] longs = StrUtil.splitToLong(ViewMallOrderController.orderIdsStr, ','); | 
|---|
|  |  |  | String existToken = redisUtils.getString("ADMIN_GOODS_CNT"); | 
|---|
|  |  |  | long[] longs = StrUtil.splitToLong(existToken, ','); | 
|---|
|  |  |  | mallOrderItem.setOrderIdsStr(longs); | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(adminMallOrderService.goodsStatistics(mallOrderItem,request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final MallInvoiceService mallInvoiceService; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 发票列表 | 
|---|
|  |  |  | * @param mallInvoiceDto | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("invoiceList") | 
|---|
|  |  |  | public FebsResponse invoiceList(AdminMallInvoiceDto mallInvoiceDto, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(mallInvoiceService.getInvoiceList(mallInvoiceDto, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 发票列表-订单子表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping(value = "/invoiceItemList") | 
|---|
|  |  |  | public FebsResponse invoiceItemList() { | 
|---|
|  |  |  | return new FebsResponse().success().data(mallInvoiceService.invoiceItemList()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 发票列表-上传发票 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("addInvoiceUrl") | 
|---|
|  |  |  | @ControllerEndpoint(operation = " 发票列表-上传发票", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse addInvoiceUrl(@Valid MallInvoice mallInvoice) { | 
|---|
|  |  |  | return mallInvoiceService.addInvoiceUrl(mallInvoice); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 发票列表-更新抬头 | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("updateInvoiceDetail/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "发票列表-更新抬头", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse updateInvoiceDetail(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return mallInvoiceService.updateInvoiceDetail(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 发票列表-更新订单状态 | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("updateOrderDetail/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "发票列表-更新订单状态", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse updateOrderDetail(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return mallInvoiceService.updateOrderDetail(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|