|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import cc.mrbird.febs.common.annotation.ControllerEndpoint; | 
|---|
|  |  |  | import cc.mrbird.febs.common.controller.BaseController; | 
|---|
|  |  |  | import cc.mrbird.febs.common.entity.DeptTree; | 
|---|
|  |  |  | import cc.mrbird.febs.common.entity.FebsResponse; | 
|---|
|  |  |  | import cc.mrbird.febs.common.entity.QueryRequest; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.dto.DeliverGoodsDto; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.dto.MallOrderInfoDto; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallGoods; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallGoodsCategory; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallOrderInfo; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.MallOrderItem; | 
|---|
|  |  |  | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; | 
|---|
|  |  |  | import cc.mrbird.febs.common.enumerates.OrderDeliveryStateEnum; | 
|---|
|  |  |  | 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.common.utils.excl.ExcelVersion; | 
|---|
|  |  |  | import cc.mrbird.febs.common.utils.excl.ResponseHeadUtil; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.dto.*; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.entity.*; | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | import cc.mrbird.febs.pay.service.IXcxPayService; | 
|---|
|  |  |  | import cc.mrbird.febs.pay.util.WechatConfigure; | 
|---|
|  |  |  | import cc.mrbird.febs.system.entity.Dept; | 
|---|
|  |  |  | import cc.mrbird.febs.system.entity.User; | 
|---|
|  |  |  | import cn.hutool.core.collection.CollUtil; | 
|---|
|  |  |  | import cn.hutool.core.date.DateTime; | 
|---|
|  |  |  | import cn.hutool.core.date.DateUtil; | 
|---|
|  |  |  | import cn.hutool.core.util.ObjectUtil; | 
|---|
|  |  |  | import cn.hutool.core.util.StrUtil; | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.collections.CollectionUtils; | 
|---|
|  |  |  | import org.springframework.validation.annotation.Validated; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import org.springframework.web.multipart.MultipartFile; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | import javax.validation.Valid; | 
|---|
|  |  |  | import javax.validation.constraints.NotNull; | 
|---|
|  |  |  | import java.io.*; | 
|---|
|  |  |  | import java.net.URLEncoder; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | 
|---|
|  |  |  | public class AdminMallOrderController extends BaseController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final IAdminMallOrderService adminMallOrderService; | 
|---|
|  |  |  | private final MallOrderInfoMapper mallOrderInfoMapper; | 
|---|
|  |  |  | private final SpringContextHolder springContextHolder; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final IXcxPayService iXcxPayService; | 
|---|
|  |  |  | private final MallTeamLeaderMapper mallTeamLeaderMapper; | 
|---|
|  |  |  | private final MallMemberMapper mallMemberMapper; | 
|---|
|  |  |  | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; | 
|---|
|  |  |  | private final RedisUtils redisUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final IApiMallTeamLeaderService apiMallTeamLeaderService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单多次退款列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param mallRefundEntity | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("orderRefundList") | 
|---|
|  |  |  | public FebsResponse orderRefundList(MallRefundEntity mallRefundEntity, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(adminMallOrderService.getOrderRefundListInPage(mallRefundEntity, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param mallOrderInfo | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("orderList") | 
|---|
|  |  |  | public FebsResponse getOrderList(MallOrderInfoDto mallOrderInfo, QueryRequest request) { | 
|---|
|  |  |  | String startTime = mallOrderInfo.getStartTime(); | 
|---|
|  |  |  | String endTime = mallOrderInfo.getEndTime(); | 
|---|
|  |  |  | if(StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)){ | 
|---|
|  |  |  | DateTime dateStartTime= DateUtil.parseDate(startTime); | 
|---|
|  |  |  | DateTime dateEndTime = DateUtil.parseDate(endTime); | 
|---|
|  |  |  | int compare = DateUtil.compare(dateStartTime, dateEndTime); | 
|---|
|  |  |  | if(compare >= 0){ | 
|---|
|  |  |  | return new FebsResponse().fail().message("请输入正确的开始时间和结束时间"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(adminMallOrderService.getOrderListInPage(mallOrderInfo, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return adminMallOrderService.deliverGoods(deliverGoodsDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单列表-修改物流编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("deliverGoodsUpdate") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单列表-修改物流编号", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse deliverGoodsUpdate(@Valid DeliverGoodsDto deliverGoodsDto) { | 
|---|
|  |  |  | return adminMallOrderService.deliverGoodsUpdate(deliverGoodsDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单列表-取消订单 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("cancelOrder/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单列表-取消订单", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse cancelOrder(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return adminMallOrderService.cancelOrder(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款-列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param mallOrderRefundDto | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("refundList") | 
|---|
|  |  |  | public FebsResponse getRefundList(MallOrderRefundDto mallOrderRefundDto, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(adminMallOrderService.getRefundListInPage(mallOrderRefundDto, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款-详情 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("/seeRefund") | 
|---|
|  |  |  | public FebsResponse seeRefund(QueryRequest request, MallOrderRefund mallOrderRefund, Integer parentId) { | 
|---|
|  |  |  | if (parentId == null) { | 
|---|
|  |  |  | ViewMallOrderController.idFromRefund = 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | mallOrderRefund.setId(ViewMallOrderController.idFromRefund); | 
|---|
|  |  |  | Map<String, Object> dataTable = getDataTable(adminMallOrderService.seeRefund(request, mallOrderRefund)); | 
|---|
|  |  |  | return new FebsResponse().success().data(dataTable); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款-同意 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("agreeRefund/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单退款-同意", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse agreeRefund(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return adminMallOrderService.agreeRefund(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款-拒绝 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("disagreeRefund/{id}") | 
|---|
|  |  |  | @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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款-退款确认 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("refundConfirm/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单退款-退款确认", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse refundConfirm(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return adminMallOrderService.refundConfirm(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款地址-列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param mallOrderRefundAddressDto | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("addressList") | 
|---|
|  |  |  | public FebsResponse addressList(MallOrderRefundAddressDto mallOrderRefundAddressDto, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(adminMallOrderService.getMallOrderRefundAddressInPage(mallOrderRefundAddressDto, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款地址-修改 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("addressUpdate") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单退款地址-修改", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse addressUpdate(@Valid AddressUpdateDto addressUpdateDto) { | 
|---|
|  |  |  | return adminMallOrderService.addressUpdate(addressUpdateDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款地址-删除 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("deleteAddress/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单退款地址-删除", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse deleteAddress(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return adminMallOrderService.deleteAddress(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款地址-新增 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("addAddress") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单退款地址-新增", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse addAddress(@Valid AddAddressDto addAddressDto) { | 
|---|
|  |  |  | return adminMallOrderService.addAddress(addAddressDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款地址-选择 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("addAddress/tree") | 
|---|
|  |  |  | @ControllerEndpoint(exceptionMessage = "获取地址失败") | 
|---|
|  |  |  | public List<AdminAddAddressTreeVo> getRefundAddress() { | 
|---|
|  |  |  | return adminMallOrderService.getRefundAddress(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单退款地址-更新退款记录的地址信息 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("withAddressUpdate") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单退款地址-更新退款记录的地址信息", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse withAddressUpdate(@Valid WithAddressUpdateDto withAddressUpdateDto) { | 
|---|
|  |  |  | return adminMallOrderService.withAddressUpdate(withAddressUpdateDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 商家支付方式-列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param payMethodDto | 
|---|
|  |  |  | * @param request | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("payMethodList") | 
|---|
|  |  |  | public FebsResponse getPayMethodList(PayMethodDto payMethodDto, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(adminMallOrderService.getPayMethodListInPage(payMethodDto, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 商家支付方式-更新 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("payMethodEdit") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "商家支付方式-更新", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse payMethodEdit(@Valid PayMethodEditDto payMethodEditDto) { | 
|---|
|  |  |  | return adminMallOrderService.payMethodEdit(payMethodEditDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("exportOrderList") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单列表", exceptionMessage = "导出失败") | 
|---|
|  |  |  | public FebsResponse exportOrderList(MallOrderInfo mallOrderInfo, HttpServletResponse response) throws IOException { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ExcelSheetPO> res = new ArrayList<>(); | 
|---|
|  |  |  | ExcelSheetPO orderSheet = new ExcelSheetPO(); | 
|---|
|  |  |  | String title = "订单列表"; | 
|---|
|  |  |  | orderSheet.setSheetName(title); | 
|---|
|  |  |  | orderSheet.setTitle(title); | 
|---|
|  |  |  | //        String[] header = {"订单编号", "订单金额", "下单时间", "配送方式", "收货姓名", "收货电话", "收货地址", "商品名称", "订单状态", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | //        String[] header = {"订单编号", "订单金额", "下单时间", "配送方式", "收货姓名", "收货电话", "收货地址", "商品详情", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | //        String[] header = {"订单编号", "收货姓名", "收货电话", "收货地址", "商品详情", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | String[] header = {"订单编号", "收货姓名", "收货电话", "收货地址", "商品详情", "备注", "物流单号", "物流公司", "物流公司码"}; | 
|---|
|  |  |  | orderSheet.setHeaders(header); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | QueryRequest request = new QueryRequest(); | 
|---|
|  |  |  | request.setPageNum(1); | 
|---|
|  |  |  | request.setPageSize(9999); | 
|---|
|  |  |  | List<MallOrderInfo> dataList = new ArrayList<>(); | 
|---|
|  |  |  | String orderIds = mallOrderInfo.getOrderIds(); | 
|---|
|  |  |  | List<String> ids = StrUtil.splitTrim(orderIds, ","); | 
|---|
|  |  |  | for(String id : ids){ | 
|---|
|  |  |  | long orderId = Long.parseLong(id); | 
|---|
|  |  |  | MallOrderInfo mallOrderInfo1 = mallOrderInfoMapper.selectAllOrderInfoByIdAndTakeUniqueCode(orderId,mallOrderInfo.getTakeUniqueCode()); | 
|---|
|  |  |  | if(ObjectUtil.isNotEmpty(mallOrderInfo1)){ | 
|---|
|  |  |  | dataList.add(mallOrderInfo1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        List<MallOrderInfo> dataList = adminMallOrderService.findOrderListInPage(mallOrderInfo, request).getRecords(); | 
|---|
|  |  |  | List<List<Object>> list = new ArrayList<>(); | 
|---|
|  |  |  | if (dataList.size() > 0) { | 
|---|
|  |  |  | 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.getName()); | 
|---|
|  |  |  | temp.add(item.getPhone()); | 
|---|
|  |  |  | temp.add(item.getAddress()); | 
|---|
|  |  |  | if (CollUtil.isNotEmpty(item.getItems())) { | 
|---|
|  |  |  | StringBuilder sb = new StringBuilder(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (MallOrderItem itemItem : item.getItems()) { | 
|---|
|  |  |  | if (StrUtil.isNotBlank(sb)) { | 
|---|
|  |  |  | sb.append(";" + itemItem.getGoodsName()+"-"+itemItem.getSkuName() + "*" + itemItem.getCnt()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | sb.append(itemItem.getGoodsName()+"-"+itemItem.getSkuName() + "*" + itemItem.getCnt()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | temp.add(sb.toString()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp.add(""); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | temp.add(item.getRemark()); | 
|---|
|  |  |  | //                temp.add(item.getStatus()); | 
|---|
|  |  |  | list.add(temp); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderSheet.setDataList(list); | 
|---|
|  |  |  | res.add(orderSheet); | 
|---|
|  |  |  | response = ResponseHeadUtil.setExcelHead(response); | 
|---|
|  |  |  | response.setHeader("Content-Disposition", | 
|---|
|  |  |  | "attachment;filename=" + URLEncoder.encode(title + DateUtil.format(new Date(), "yyyyMMDDHHmmss") + ".xlsx".trim(), "UTF-8")); | 
|---|
|  |  |  | OutputStream os = response.getOutputStream(); | 
|---|
|  |  |  | ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("confirmOrder") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "确认货到达自提点", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse confirmOrder(MallOrderInfo mallOrderInfoDto){ | 
|---|
|  |  |  | String orderIds = mallOrderInfoDto.getOrderIds(); | 
|---|
|  |  |  | List<String> ids = StrUtil.splitTrim(orderIds, ","); | 
|---|
|  |  |  | for(String id : ids){ | 
|---|
|  |  |  | long orderId = Long.parseLong(id); | 
|---|
|  |  |  | MallOrderInfo mallOrderInfo = mallOrderInfoMapper.selectById(orderId); | 
|---|
|  |  |  | if(ObjectUtil.isEmpty(mallOrderInfo)){ | 
|---|
|  |  |  | //                continue; | 
|---|
|  |  |  | return new FebsResponse().fail().message("订单不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Integer status = mallOrderInfo.getStatus() == null ? 0 : mallOrderInfo.getStatus(); | 
|---|
|  |  |  | Integer deliveryState = mallOrderInfo.getDeliveryState() == null ? 0 : mallOrderInfo.getDeliveryState(); | 
|---|
|  |  |  | if(OrderStatusEnum.WAIT_FINISH.getValue() != status || 2 != deliveryState){ | 
|---|
|  |  |  | //                continue; | 
|---|
|  |  |  | return new FebsResponse().fail().message("配送状态不是配送中状态"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | mallOrderInfo.setDeliveryState(OrderDeliveryStateEnum.DELIVERY_FINISH.getValue()); | 
|---|
|  |  |  | mallOrderInfoMapper.updateById(mallOrderInfo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //            OrderStateDto orderStateDto = new OrderStateDto(); | 
|---|
|  |  |  | //            String productNames = getProductNames(mallOrderInfo.getMemberId(), mallOrderInfo.getId()); | 
|---|
|  |  |  | //            orderStateDto.setGoodsName(StrUtil.sub(productNames,0,15)+"..."); | 
|---|
|  |  |  | //            String takeUniqueCode = mallOrderInfo.getTakeUniqueCode(); | 
|---|
|  |  |  | //            MallTeamLeader mallTeamLeader = mallTeamLeaderMapper.selectLeaderByUniqueCode(takeUniqueCode); | 
|---|
|  |  |  | //            orderStateDto.setAddressArea(mallTeamLeader.getAddressArea()); | 
|---|
|  |  |  | //            orderStateDto.setDetailAddress(StrUtil.sub(mallTeamLeader.getDetailAddress(),0,20)+"..."); | 
|---|
|  |  |  | //            orderStateDto.setRemark("果蔬等生鲜,请尽快取货"); | 
|---|
|  |  |  | //            orderStateDto.setLeaderPhone(mallTeamLeader.getPhone()); | 
|---|
|  |  |  | //            orderStateDto.setOpenId(mallMemberMapper.selectById(mallOrderInfo.getMemberId()).getOpenId()); | 
|---|
|  |  |  | //            DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.WX_TEMPLATE_ID_THREE.getType(), DataDictionaryEnum.WX_TEMPLATE_ID_THREE.getCode()); | 
|---|
|  |  |  | //            orderStateDto.setTemplateId(dataDictionaryCustom.getValue()); | 
|---|
|  |  |  | //            iXcxPayService.pushOrderToAddress(orderStateDto); | 
|---|
|  |  |  | //            iXcxPayService.uniformMessageSend(orderStateDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return new FebsResponse().success(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("deliverOrder") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "导出订单列表,系统自动发货", exceptionMessage = "操作失败") | 
|---|
|  |  |  | public FebsResponse deliverOrder(MallOrderInfo mallOrderInfoDto){ | 
|---|
|  |  |  | String orderIds = mallOrderInfoDto.getOrderIds(); | 
|---|
|  |  |  | List<String> ids = StrUtil.splitTrim(orderIds, ","); | 
|---|
|  |  |  | for(String id : ids){ | 
|---|
|  |  |  | long orderId = Long.parseLong(id); | 
|---|
|  |  |  | MallOrderInfo mallOrderInfo = mallOrderInfoMapper.selectByIdAndTakeUniqueCode(orderId,mallOrderInfoDto.getTakeUniqueCode()); | 
|---|
|  |  |  | //            if(ObjectUtil.isEmpty(mallOrderInfo)){ | 
|---|
|  |  |  | //                return new FebsResponse().fail().message("请确认订单是否属于该团长"); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | Integer status = mallOrderInfo.getStatus() == null ? 0 : mallOrderInfo.getStatus(); | 
|---|
|  |  |  | Integer deliveryState = mallOrderInfo.getDeliveryState() == null ? 0 : mallOrderInfo.getDeliveryState(); | 
|---|
|  |  |  | if(OrderStatusEnum.WAIT_SHIPPING.getValue() != status){ | 
|---|
|  |  |  | //                continue; | 
|---|
|  |  |  | return new FebsResponse().fail().message("状态不是待发货"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(1 != deliveryState){ | 
|---|
|  |  |  | //                continue; | 
|---|
|  |  |  | return new FebsResponse().fail().message("配送状态不是待配送"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | adminMallOrderService.updateOrderStateAndDeliveryState(mallOrderInfo.getId(), OrderStatusEnum.WAIT_FINISH.getValue(), OrderDeliveryStateEnum.DELIVERY_ING.getValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return new FebsResponse().success(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据用户ID和订单ID获取所购买商品名称 | 
|---|
|  |  |  | * @return 所含商品名称(多个以","隔开) | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public String getProductNames(Long memberId, Long orderId) { | 
|---|
|  |  |  | MallOrderInfo mallOrderInfo = mallOrderInfoMapper.selectOrderByMemberIdAndId(memberId, orderId); | 
|---|
|  |  |  | List<MallOrderItem> details = mallOrderInfo.getItems(); | 
|---|
|  |  |  | if (CollectionUtils.isEmpty(details)) { | 
|---|
|  |  |  | return ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | StringBuffer productNameBuffer = new StringBuffer(); | 
|---|
|  |  |  | Integer maxLength = 30; | 
|---|
|  |  |  | for (int i = 0; i< details.size(); i++) { | 
|---|
|  |  |  | MallOrderItem mallOrderItem = details.get(i); | 
|---|
|  |  |  | String goodsName = mallOrderItem.getGoodsName(); | 
|---|
|  |  |  | if (goodsName == null) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (i == 0 && goodsName.length() > maxLength) { | 
|---|
|  |  |  | productNameBuffer.append(goodsName.substring(0, maxLength) + "..."); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if ((productNameBuffer.length() + goodsName.length()) > maxLength) { | 
|---|
|  |  |  | productNameBuffer.append("等"); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | productNameBuffer.append(goodsName + ","); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String productNames = productNameBuffer.toString(); | 
|---|
|  |  |  | if (productNames.endsWith(",")) { | 
|---|
|  |  |  | productNames = productNames.substring(0, productNames.length() - 1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (productNames.endsWith(",等")) { | 
|---|
|  |  |  | productNames = productNames.substring(0, productNames.length() - 2) + "等"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return productNames; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("exportOrderListOne") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "订单列表", exceptionMessage = "导出失败") | 
|---|
|  |  |  | public FebsResponse exportOrderListOne(MallOrderInfo mallOrderInfo, HttpServletResponse response) throws IOException { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ExcelSheetPO> res = new ArrayList<>(); | 
|---|
|  |  |  | ExcelSheetPO orderSheet = new ExcelSheetPO(); | 
|---|
|  |  |  | String title = "订单列表"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | orderSheet.setSheetName(title); | 
|---|
|  |  |  | orderSheet.setTitle(title); | 
|---|
|  |  |  | //        String[] header = {"订单编号", "订单详情(商品*数量)", "订单金额", "用户提货码", "配送方式", "用户姓名", "用户电话","用户地址", "团长名称", "团长手机号码", "自提点名称"}; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String[] header = {"订单编号", "订单详情(商品*数量)", "订单金额", "用户提货码", "用户姓名", "用户电话","用户地址", "团长名称", "团长手机号码", "自提点名称"}; | 
|---|
|  |  |  | orderSheet.setHeaders(header); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | QueryRequest request = new QueryRequest(); | 
|---|
|  |  |  | request.setPageNum(1); | 
|---|
|  |  |  | request.setPageSize(9999); | 
|---|
|  |  |  | List<MallOrderInfo> dataList = new ArrayList<>(); | 
|---|
|  |  |  | String orderIds = mallOrderInfo.getOrderIds(); | 
|---|
|  |  |  | List<String> ids = StrUtil.splitTrim(orderIds, ","); | 
|---|
|  |  |  | for(String id : ids){ | 
|---|
|  |  |  | long orderId = Long.parseLong(id); | 
|---|
|  |  |  | MallOrderInfo mallOrderInfo1 = mallOrderInfoMapper.selectAllOrderInfoByIdAndTakeUniqueCode(orderId,mallOrderInfo.getTakeUniqueCode()); | 
|---|
|  |  |  | if(ObjectUtil.isNotEmpty(mallOrderInfo1)){ | 
|---|
|  |  |  | dataList.add(mallOrderInfo1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        List<MallOrderInfo> dataList = adminMallOrderService.findOrderListInPage(mallOrderInfo, request).getRecords(); | 
|---|
|  |  |  | List<List<Object>> list = new ArrayList<>(); | 
|---|
|  |  |  | if (CollUtil.isNotEmpty(dataList)) { | 
|---|
|  |  |  | for (MallOrderInfo item : dataList) { | 
|---|
|  |  |  | List<Object> temp = new ArrayList<>(); | 
|---|
|  |  |  | temp.add(item.getOrderNo()); | 
|---|
|  |  |  | if (CollUtil.isNotEmpty(item.getItems())) { | 
|---|
|  |  |  | StringBuilder sb = new StringBuilder(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (MallOrderItem itemItem : item.getItems()) { | 
|---|
|  |  |  | if (StrUtil.isNotBlank(sb)) { | 
|---|
|  |  |  | sb.append(";" + itemItem.getGoodsName() + "*" + itemItem.getCnt()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | sb.append(itemItem.getGoodsName() + "*" + itemItem.getCnt()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | temp.add(sb.toString()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp.add(""); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | temp.add(item.getAmount()); | 
|---|
|  |  |  | temp.add(item.getTakeCode()); | 
|---|
|  |  |  | //                temp.add("自提"); | 
|---|
|  |  |  | temp.add(item.getName()); | 
|---|
|  |  |  | temp.add(item.getPhone()); | 
|---|
|  |  |  | temp.add(item.getAddress()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | temp.add(item.getLeaderName()); | 
|---|
|  |  |  | temp.add(item.getLeaderPhone()); | 
|---|
|  |  |  | temp.add(item.getAddressArea()); | 
|---|
|  |  |  | list.add(temp); | 
|---|
|  |  |  | //                adminMallOrderService.updateOrderStateAndDeliveryState(item.getId(), OrderStatusEnum.WAIT_FINISH.getValue(), OrderDeliveryStateEnum.DELIVERY_ING.getValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderSheet.setDataList(list); | 
|---|
|  |  |  | res.add(orderSheet); | 
|---|
|  |  |  | response = ResponseHeadUtil.setExcelHead(response); | 
|---|
|  |  |  | MallTeamLeader mallTeamLeader = mallTeamLeaderMapper.selectLeaderByUniqueCode(mallOrderInfo.getTakeUniqueCode()); | 
|---|
|  |  |  | String name = mallTeamLeader.getName(); | 
|---|
|  |  |  | response.setHeader("Content-Disposition", | 
|---|
|  |  |  | "attachment;filename=" + URLEncoder.encode(name+"-"+title + DateUtil.format(new Date(), "yyyyMMDDHHmmss") + ".xlsx".trim(), "UTF-8")); | 
|---|
|  |  |  | OutputStream os = response.getOutputStream(); | 
|---|
|  |  |  | ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true); | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping(value = "/importDeliver") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "导入发货", exceptionMessage = "导入失败") | 
|---|
|  |  |  | public FebsResponse importDeliver(@RequestBody MultipartFile file) throws IOException { | 
|---|
|  |  |  | if (file.isEmpty()) { | 
|---|
|  |  |  | return new FebsResponse().fail(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String fileName = file.getOriginalFilename(); | 
|---|
|  |  |  | String dirPath = "/home/javaweb/webresource/blnka/"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | File saveFile = new File(new File(dirPath).getAbsolutePath() + File.separator + fileName); | 
|---|
|  |  |  | if (!saveFile.exists()) { | 
|---|
|  |  |  | if (!saveFile.getParentFile().exists()) { | 
|---|
|  |  |  | saveFile.getParentFile().mkdirs(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | file.transferTo(saveFile); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ExcelSheetPO> data = ExcelUtil.readExcel(saveFile, null, null); | 
|---|
|  |  |  | if (CollUtil.isEmpty(data)) { | 
|---|
|  |  |  | return new FebsResponse().fail(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<List<Object>> dataList = data.get(0).getDataList(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int expressNoIndex = -1; | 
|---|
|  |  |  | int expressComIndex = -1; | 
|---|
|  |  |  | int expressCodeIndex = -1; | 
|---|
|  |  |  | for (int i = 1; i < dataList.size(); i++) { | 
|---|
|  |  |  | List<Object> objects = dataList.get(i); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String expressNo = ""; | 
|---|
|  |  |  | String expressCode = ""; | 
|---|
|  |  |  | String expressCom = ""; | 
|---|
|  |  |  | for (int j = 0; j < objects.size(); j++) { | 
|---|
|  |  |  | Object obj = objects.get(j); | 
|---|
|  |  |  | if ("物流单号".equals(obj)) { | 
|---|
|  |  |  | expressNoIndex = j; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if ("物流公司".equals(obj)) { | 
|---|
|  |  |  | expressComIndex = j; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if ("物流公司码".equals(obj)) { | 
|---|
|  |  |  | expressCodeIndex = j; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (j == expressNoIndex) { | 
|---|
|  |  |  | expressNo = (String) objects.get(j); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (j == expressComIndex) { | 
|---|
|  |  |  | expressCom = (String) objects.get(j); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (j == expressCodeIndex) { | 
|---|
|  |  |  | expressCode = (String) objects.get(j);; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (StrUtil.isNotBlank(expressNo) && StrUtil.isNotBlank(expressCode) && StrUtil.isNotBlank(expressCom)) { | 
|---|
|  |  |  | String orderNo = (String) objects.get(0); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | DeliverGoodsDto deliverGoods = new DeliverGoodsDto(); | 
|---|
|  |  |  | deliverGoods.setOrderNo(orderNo); | 
|---|
|  |  |  | deliverGoods.setExpressCom(expressCom); | 
|---|
|  |  |  | deliverGoods.setExpressCode(expressCode); | 
|---|
|  |  |  | deliverGoods.setExpressNo(expressNo); | 
|---|
|  |  |  | adminMallOrderService.deliverGoodsByOrderNo(deliverGoods); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return new FebsResponse().success(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 评论列表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("commentList") | 
|---|
|  |  |  | public FebsResponse getCommentList(AdminMallGoodsCommentDto adminMallGoodsCommentDto, QueryRequest request) { | 
|---|
|  |  |  | Map<String, Object> data = getDataTable(adminMallOrderService.getCommentListInPage(adminMallGoodsCommentDto, request)); | 
|---|
|  |  |  | return new FebsResponse().success().data(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 评论列表-显示评论 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("showStateSwitchOn/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "评论列表-显示评论", exceptionMessage = "设置失败") | 
|---|
|  |  |  | public FebsResponse showStateSwitchOn(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return adminMallOrderService.showStateSwitchOn(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 评论列表-不显示评论 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("showStateSwitchOff/{id}") | 
|---|
|  |  |  | @ControllerEndpoint(operation = "评论列表-显示评论", exceptionMessage = "设置失败") | 
|---|
|  |  |  | public FebsResponse showStateSwitchOff(@NotNull(message = "{required}") @PathVariable Long id) { | 
|---|
|  |  |  | return adminMallOrderService.showStateSwitchOff(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单列表-统计商品份数 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("goodsStatistics") | 
|---|
|  |  |  | public FebsResponse goodsStatistics(MallOrderItem mallOrderItem, QueryRequest request, Integer parentId) { | 
|---|
|  |  |  | if (parentId == null) { | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|