package com.matrix.system.shopXcx.action; 
 | 
  
 | 
  
 | 
import com.google.gson.Gson; 
 | 
import com.matrix.core.anotations.RemoveRequestToken; 
 | 
import com.matrix.core.anotations.SaveRequestToken; 
 | 
import com.matrix.core.constance.MatrixConstance; 
 | 
import com.matrix.core.constance.SystemErrorCode; 
 | 
import com.matrix.core.constance.SystemMessageCode; 
 | 
import com.matrix.core.exception.GlobleException; 
 | 
import com.matrix.core.pojo.AjaxResult; 
 | 
import com.matrix.core.pojo.PaginationVO; 
 | 
import com.matrix.core.tools.*; 
 | 
import com.matrix.core.tools.excl.ExcelSheetPO; 
 | 
import com.matrix.core.tools.excl.ExcelUtil; 
 | 
import com.matrix.core.tools.excl.ExcelVersion; 
 | 
import com.matrix.system.common.bean.SysUsers; 
 | 
import com.matrix.system.common.constance.AppConstance; 
 | 
import com.matrix.system.constance.Dictionary; 
 | 
import com.matrix.system.hive.action.BaseController; 
 | 
import com.matrix.system.hive.action.util.QueryUtil; 
 | 
import com.matrix.system.hive.bean.SysShopInfo; 
 | 
import com.matrix.system.hive.dao.SysShopInfoDao; 
 | 
import com.matrix.system.shopXcx.bean.*; 
 | 
import com.matrix.system.shopXcx.dao.*; 
 | 
import com.matrix.system.shopXcx.dto.DiscountExplain; 
 | 
import com.matrix.system.shopXcx.pojo.ShopOrderQueryPOJO; 
 | 
import com.matrix.system.shopXcx.shopEnum.OrderStatusEnum; 
 | 
import org.apache.commons.collections.CollectionUtils; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
import org.springframework.stereotype.Controller; 
 | 
import org.springframework.transaction.annotation.Transactional; 
 | 
import org.springframework.web.bind.annotation.RequestMapping; 
 | 
import org.springframework.web.bind.annotation.ResponseBody; 
 | 
import org.springframework.web.servlet.ModelAndView; 
 | 
  
 | 
import javax.servlet.http.HttpServletResponse; 
 | 
import java.io.IOException; 
 | 
import java.io.OutputStream; 
 | 
import java.math.BigDecimal; 
 | 
import java.text.SimpleDateFormat; 
 | 
import java.util.*; 
 | 
  
 | 
/** 
 | 
 * @author jyy 
 | 
 * @description 订单表 
 | 
 * @date 2019-06-10 10:58 
 | 
 */ 
 | 
@Controller 
 | 
@RequestMapping(value = "admin/shopOrder") 
 | 
public class ShopOrderAction extends BaseController { 
 | 
  
 | 
    @Autowired 
 | 
    private ShopOrderDao shopOrderDao; 
 | 
    @Autowired 
 | 
    private ShopDeliveryInfoDao shopDeliveryInfoDao; 
 | 
    @Autowired 
 | 
    private ShopOrderDetailsDao orderDetailsDao; 
 | 
    @Autowired 
 | 
    private WxWithdrawApplyDao wxWithdrawApplyDao; 
 | 
    @Autowired 
 | 
    private WxApplyOrderRelateDao wxApplyOrderRelateDao; 
 | 
    @Autowired 
 | 
    private SysShopInfoDao sysShopInfoDao; 
 | 
  
 | 
    //记录编辑前的值Before_Edit_Value 
 | 
    public static final String BEV = "ShopOrder_BEV"; 
 | 
  
 | 
  
 | 
    /** 
 | 
     * 导出Excel 
 | 
     */ 
 | 
    @RequestMapping(value = "/exportOrderExcel") 
 | 
    public void exportOrderExcel(ShopOrderQueryPOJO orderQuery, HttpServletResponse res) { 
 | 
        OutputStream os = null; 
 | 
        try { 
 | 
            PaginationVO pageVo = new PaginationVO(); 
 | 
            pageVo.setSort("o.order_time"); 
 | 
            pageVo.setOrder("desc"); 
 | 
            QueryUtil.setQueryLimitCom(orderQuery); 
 | 
            List<ShopOrder> dataList = shopOrderDao.selectInPageByQueryOfExcel(orderQuery, pageVo); 
 | 
            res.setCharacterEncoding("UTF-8"); 
 | 
            res.setHeader("content-type", "application/octet-stream;charset=UTF-8"); 
 | 
            res.setContentType("application/octet-stream;charset=UTF-8"); 
 | 
  
 | 
            Date date = new Date(); 
 | 
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss"); 
 | 
            res.setHeader("Content-Disposition", "attachment;filename=" + 
 | 
                    java.net.URLEncoder.encode("订单列表" + dateFormat.format(date) + ".xlsx".trim(), "UTF-8")); 
 | 
  
 | 
            os = res.getOutputStream(); 
 | 
            ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, disPoseExcelData(dataList), os, true); 
 | 
        } catch (Exception e) { 
 | 
            LogUtil.error("订单导出异常", e); 
 | 
        } finally { 
 | 
            if (os != null) { 
 | 
                try { 
 | 
                    os.close(); 
 | 
                } catch (IOException e) { 
 | 
                    LogUtil.error("关闭资源异常", e); 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
  
 | 
    private List<ExcelSheetPO> disPoseExcelData(List<ShopOrder> orderList) { 
 | 
        List<ExcelSheetPO> res = new ArrayList<>(); 
 | 
        ExcelSheetPO orderSheet = new ExcelSheetPO(); 
 | 
        orderSheet.setSheetName("订单列表"); 
 | 
        orderSheet.setTitle("订单列表"); 
 | 
        String[] header = new String[]{"订单编号", "客户姓名", "客户电话", "收货地址", "下单时间", "订单金额", 
 | 
                "优惠总金额", "优惠说明", "订单状态", "配送方式", "门店名称", "商品名称", "规格", "生产企业", "单价", "购买数量"}; 
 | 
        orderSheet.setHeaders(header); 
 | 
        List<List<Object>> body = new ArrayList<>(); 
 | 
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss"); 
 | 
        for (ShopOrder shopOrder : orderList) { 
 | 
            List<ShopOrderDetails> details = shopOrder.getDetails(); 
 | 
            if (CollectionUtils.isEmpty(details)) { 
 | 
                continue; 
 | 
            } 
 | 
            for (ShopOrderDetails shopOrderDetails : details) { 
 | 
                List<Object> bodyItem = new ArrayList<>(); 
 | 
                //订单编号 
 | 
                bodyItem.add(shopOrder.getOrderNo()); 
 | 
                //客户姓名 
 | 
                bodyItem.add(shopOrder.getUserName()); 
 | 
                //客户电话 
 | 
                bodyItem.add(shopOrder.getUserTel()); 
 | 
                //收货地址 
 | 
                ShopDeliveryInfo deliveryInfo = shopOrder.getDeliveryInfo(); 
 | 
                if (deliveryInfo != null && deliveryInfo.getReceiveAddress() != null) { 
 | 
                    bodyItem.add(deliveryInfo.getReceiveAddress()); 
 | 
                } else { 
 | 
                    bodyItem.add(""); 
 | 
                } 
 | 
                //下单时间 
 | 
                bodyItem.add(dateFormat.format(shopOrder.getOrderTime())); 
 | 
                //购买数量 
 | 
//                bodyItem.add(shopOrder.getPurchaseQuantity()); 
 | 
                //订单金额 
 | 
                bodyItem.add(shopOrder.getOrderMoney()); 
 | 
                //优惠总金额 
 | 
                bodyItem.add(shopOrder.getDiscountAmount()); 
 | 
                //优惠说明 
 | 
                bodyItem.add(shopOrder.getDiscountExplain()); 
 | 
                //订单状态 
 | 
                bodyItem.add(OrderStatusEnum.getNameByCode(shopOrder.getOrderStatus())); 
 | 
                //配送方式 门店 
 | 
                bodyItem.add("物流"); 
 | 
                bodyItem.add(""); 
 | 
  
 | 
                //商品名称 
 | 
                ShopProduct shopProduct = shopOrderDetails.getShopProduct(); 
 | 
                if (shopProduct == null) { 
 | 
                    bodyItem.add(""); 
 | 
                } else { 
 | 
                    bodyItem.add(shopProduct.getTitle()); 
 | 
                } 
 | 
                //规格名称、生产企业、单价 
 | 
                ShopSku shopSku = shopOrderDetails.getShopSku(); 
 | 
                if (shopSku == null) { 
 | 
                    bodyItem.add(""); 
 | 
                    bodyItem.add(shopOrderDetails.getProductionEnterprise()); 
 | 
                    bodyItem.add(""); 
 | 
                } else { 
 | 
                    bodyItem.add(shopSku.getName()); 
 | 
                    bodyItem.add(shopOrderDetails.getProductionEnterprise()); 
 | 
                    bodyItem.add(shopSku.getPrice()); 
 | 
                } 
 | 
                //购买数量 
 | 
                bodyItem.add(shopOrderDetails.getCount()); 
 | 
                body.add(bodyItem); 
 | 
            } 
 | 
        } 
 | 
        orderSheet.setDataList(body); 
 | 
        res.add(orderSheet); 
 | 
        return res; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 列表显示 
 | 
     */ 
 | 
    @RequestMapping(value = "/showList") 
 | 
    public @ResponseBody 
 | 
    AjaxResult showList(ShopOrderQueryPOJO orderQuery, PaginationVO pageVo) { 
 | 
        QueryUtil.setQueryLimitCom(orderQuery); 
 | 
        pageVo.setSort("order_time"); 
 | 
        pageVo.setOrder("desc"); 
 | 
  
 | 
        List<ShopOrder> dataList = shopOrderDao.selectInPageByQuery(orderQuery, pageVo); 
 | 
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, shopOrderDao.selectTotalRecordByQuery(orderQuery)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增 
 | 
     */ 
 | 
    @RemoveRequestToken 
 | 
    @RequestMapping(value = "/addShopOrder") 
 | 
    public @ResponseBody 
 | 
    AjaxResult addShopOrder(ShopOrder shopOrder) { 
 | 
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); 
 | 
        shopOrder.setCreateBy(user.getSuName()); 
 | 
        shopOrder.setUpdateBy(user.getSuName()); 
 | 
        int i = shopOrderDao.insert(shopOrder); 
 | 
        if (i > 0) { 
 | 
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, "订单表"); 
 | 
        } else { 
 | 
            throw new GlobleException(SystemErrorCode.DATA_ADD_FAIL); 
 | 
        } 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改 
 | 
     */ 
 | 
    @RemoveRequestToken 
 | 
    @RequestMapping(value = "/modifyShopOrder") 
 | 
    public @ResponseBody 
 | 
    AjaxResult modifyShopOrder(ShopOrder newShopOrder, String receiveAddr) { 
 | 
        if (StringUtils.isNotBlank(receiveAddr)) { 
 | 
            ShopDeliveryInfo deliveryInfo = shopDeliveryInfoDao.selectByOrderId(newShopOrder.getId()); 
 | 
            if (deliveryInfo != null) { 
 | 
                Integer deliveryId = deliveryInfo.getId(); 
 | 
                Map<String, Object> modifyDeliveryMap = new HashMap<>(); 
 | 
                modifyDeliveryMap.put("id", deliveryId); 
 | 
                modifyDeliveryMap.put("receiveAddress", receiveAddr); 
 | 
                shopDeliveryInfoDao.updateByMap(modifyDeliveryMap); 
 | 
            } 
 | 
        } 
 | 
        ShopOrder oldShopOrder = WebUtil.getSessionAttribute(BEV); 
 | 
        int i = 0; 
 | 
        Map<String, Object> modifyMap = null; 
 | 
        try { 
 | 
            if (!ModelUtils.isModified(oldShopOrder, newShopOrder)) { 
 | 
                i = MatrixConstance.DML_SUCCESSS; 
 | 
            } 
 | 
            modifyMap = ModelUtils.comparePojo2Map(oldShopOrder, newShopOrder); 
 | 
        } catch (Exception e) { 
 | 
            throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newShopOrder); 
 | 
        } 
 | 
        if (modifyMap.size() > 0) { 
 | 
  
 | 
            //修改优惠说明 
 | 
            if (StringUtils.isNotBlank(oldShopOrder.getDiscountExplain())) { 
 | 
                Gson g = new Gson(); 
 | 
                DiscountExplain discountExplain = g.fromJson(oldShopOrder.getDiscountExplain(), DiscountExplain.class); 
 | 
                discountExplain.setPayPrice(newShopOrder.getOrderMoney()); 
 | 
                modifyMap.put("discountExplain", g.toJson(discountExplain)); 
 | 
            } 
 | 
  
 | 
  
 | 
            modifyMap.put("id", oldShopOrder.getId()); 
 | 
            shopOrderDao.updateByMap(modifyMap); 
 | 
        } 
 | 
        i = MatrixConstance.DML_SUCCESSS; 
 | 
        WebUtil.removeSessionAttribute(BEV); 
 | 
  
 | 
        //修改订单明细金额 
 | 
        List<ShopOrderDetails> orderDetails = newShopOrder.getDetails(); 
 | 
        for (ShopOrderDetails orderDetail : orderDetails) { 
 | 
            orderDetailsDao.updateByModel(orderDetail); 
 | 
        } 
 | 
  
 | 
  
 | 
        if (i > 0) { 
 | 
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.UPDATE_SUCCES, "订单表"); 
 | 
        } else { 
 | 
            throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL); 
 | 
        } 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 进入修改界面 
 | 
     */ 
 | 
    @SaveRequestToken 
 | 
    @RequestMapping(value = "/editForm") 
 | 
    public ModelAndView editForm(Integer id) { 
 | 
        ShopOrder shopOrder = new ShopOrder(); 
 | 
        ModelAndView modelAndView = new ModelAndView("admin/shop/shopOrder-form"); 
 | 
        if (id != null) { 
 | 
            shopOrder = shopOrderDao.selectMyOrderById(id); 
 | 
            if (StringUtils.isNotBlank(shopOrder.getDiscountExplain())) { 
 | 
                Gson g = new Gson(); 
 | 
                DiscountExplain discountExplain = g.fromJson(shopOrder.getDiscountExplain(), DiscountExplain.class); 
 | 
                modelAndView.addObject("discountExplain", discountExplain); 
 | 
            } 
 | 
            WebUtil.setSessionAttribute(BEV, shopOrder); 
 | 
        } 
 | 
        modelAndView.addObject("orderInfo", shopOrder); 
 | 
        return modelAndView; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 进入打印页面 
 | 
     */ 
 | 
    @SaveRequestToken 
 | 
    @RequestMapping(value = "/printOrder") 
 | 
    public ModelAndView printOrder(Integer id) { 
 | 
        ModelAndView modelAndView = new ModelAndView("admin/shop/shopOrder-print"); 
 | 
        ShopOrder shopOrder = shopOrderDao.selectMyOrderById(id); 
 | 
  
 | 
        if (StringUtils.isNotBlank(shopOrder.getDiscountExplain())) { 
 | 
            Gson g = new Gson(); 
 | 
            DiscountExplain discountExplain = g.fromJson(shopOrder.getDiscountExplain(), DiscountExplain.class); 
 | 
            modelAndView.addObject("discountExplain", discountExplain); 
 | 
        } 
 | 
  
 | 
        modelAndView.addObject("orderInfo", shopOrder); 
 | 
  
 | 
        return modelAndView; 
 | 
    } 
 | 
  
 | 
  
 | 
    /** 
 | 
     * 进入发货界面 
 | 
     */ 
 | 
    @SaveRequestToken 
 | 
    @RequestMapping(value = "/sendPackage") 
 | 
    public ModelAndView sendPackage(Integer id) { 
 | 
        ShopOrder shopOrder = new ShopOrder(); 
 | 
        ModelAndView modelAndView = new ModelAndView("admin/shop/order-sendPackage-form"); 
 | 
        if (id != null) { 
 | 
            shopOrder = shopOrderDao.selectById(id); 
 | 
            WebUtil.setSessionAttribute(BEV, shopOrder); 
 | 
        } 
 | 
        modelAndView.addObject("obj", shopOrder); 
 | 
        return modelAndView; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 门店发货 
 | 
     * 
 | 
     * @param id 
 | 
     * @return 
 | 
     */ 
 | 
    @Transactional(rollbackFor = Exception.class) 
 | 
    @RequestMapping(value = "/storeSendPackage") 
 | 
    public @ResponseBody 
 | 
    AjaxResult storeSendPackage(Integer id) { 
 | 
        ShopDeliveryInfo shopDeliveryInfo = shopDeliveryInfoDao.selectByOrderId(id); 
 | 
  
 | 
        if (shopDeliveryInfo == null) { 
 | 
            throw new GlobleException("没有找到该订单物流信息"); 
 | 
        } 
 | 
  
 | 
        //更新物流状态 
 | 
        Map<String, Object> deliveryModifyMap = new HashMap<>(); 
 | 
        deliveryModifyMap.put("id", shopDeliveryInfo.getId()); 
 | 
        deliveryModifyMap.put("pickUpStatus", AppConstance.PICK_UP_STATUS_RECEIVE); 
 | 
        shopDeliveryInfoDao.updateByMap(deliveryModifyMap); 
 | 
  
 | 
        //更新订单状态 
 | 
        Map<String, Object> orderModifyMap = new HashMap<>(); 
 | 
        orderModifyMap.put("id", shopDeliveryInfo.getId()); 
 | 
        orderModifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_WAIT_REMARK); 
 | 
        shopOrderDao.updateByMap(orderModifyMap); 
 | 
  
 | 
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "门店发货成功"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除 
 | 
     */ 
 | 
    @RequestMapping(value = "/del") 
 | 
    public @ResponseBody 
 | 
    AjaxResult del(String keys) { 
 | 
        List<String> ids = StringUtils.strToCollToString(keys, ","); 
 | 
        int i = shopOrderDao.deleteByIds(ids); 
 | 
        if (i > 0) { 
 | 
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES, i); 
 | 
        } else { 
 | 
            throw new GlobleException(SystemErrorCode.DATA_DELETE_FAIL); 
 | 
        } 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取订单状态下拉框 
 | 
     */ 
 | 
    @RequestMapping(value = "/getOrderStatusSelectValue") 
 | 
    public @ResponseBody 
 | 
    AjaxResult getOrderStatusSelectValue() { 
 | 
        List<Map<String, Object>> selectValue = OrderStatusEnum.getSelectValue(); 
 | 
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, selectValue); 
 | 
    } 
 | 
  
 | 
  
 | 
    @RequestMapping(value = "/applyMoneyWithOrder") 
 | 
    @ResponseBody 
 | 
    @Transactional 
 | 
    public AjaxResult applyMoneyWithOrder(String keys) { 
 | 
        if (StringUtils.isBlank(keys)) { 
 | 
            return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择订单"); 
 | 
        } 
 | 
        SysUsers sysUsers = getMe(); 
 | 
        List<String> list = StringUtils.strToColl(keys, ","); 
 | 
  
 | 
        List<ShopOrder> data = shopOrderDao.selectOrdersByIds(sysUsers.getShopId(), sysUsers.getCompanyId(), list); 
 | 
        if (CollectionUtils.isNotEmpty(data)) { 
 | 
            StringBuffer orderIds = new StringBuffer(); 
 | 
            BigDecimal applyMoney = BigDecimal.ZERO; 
 | 
  
 | 
            SysShopInfo shopInfo = sysShopInfoDao.selectByIdAndComId(sysUsers.getShopId(), sysUsers.getCompanyId()); 
 | 
            if (shopInfo == null) { 
 | 
                return new AjaxResult(AjaxResult.STATUS_FAIL, "门店不存在"); 
 | 
            } 
 | 
  
 | 
            if (StringUtils.isBlank(shopInfo.getBankNo())) { 
 | 
                return new AjaxResult(AjaxResult.STATUS_FAIL, "请联系管理员添加银行卡号"); 
 | 
            } 
 | 
  
 | 
            for (ShopOrder shopOrder : data) { 
 | 
                if (shopOrder.getStoreId().longValue() != sysUsers.getShopId()) { 
 | 
                    return new AjaxResult(AjaxResult.STATUS_FAIL, "非本店操作人员"); 
 | 
                } 
 | 
  
 | 
                // 判断该订单是否需要发货 
 | 
                if (shopOrder.getOrderType() != null && ShopOrder.ORDER_TYPE_GOODS == shopOrder.getOrderType()) { 
 | 
                    if (ShopOrder.ORDER_STATUS_WAIT_REMARK != shopOrder.getOrderStatus() && ShopOrder.ORDER_STATUS_ALREADY_REMARK != shopOrder.getOrderStatus()) { 
 | 
                        return new AjaxResult(AjaxResult.STATUS_FAIL, "存在订单状态不允许提现"); 
 | 
                    } 
 | 
                } 
 | 
  
 | 
                if (shopOrder.getApplyStatus() != null && ShopOrder.ORDER_APPLY_STATUS_Y == shopOrder.getApplyStatus()) { 
 | 
                    return new AjaxResult(AjaxResult.STATUS_FAIL, "订单中存在已提现的订单"); 
 | 
                } 
 | 
  
 | 
                applyMoney = applyMoney.add(shopOrder.getOrderMoney()); 
 | 
                shopOrder.setApplyStatus(ShopOrder.ORDER_APPLY_STATUS_Y); 
 | 
                orderIds.append("," + shopOrder.getId()); 
 | 
  
 | 
            } 
 | 
            WxWithdrawApply apply = new WxWithdrawApply(); 
 | 
            apply.setApplyStatus(WxWithdrawApply.ORDER_APPLY_STATUS_DOING); 
 | 
            apply.setComId(sysUsers.getCompanyId()); 
 | 
            apply.setShopId(sysUsers.getShopId()); 
 | 
            apply.setApplyMoney(applyMoney); 
 | 
            apply.setApplyNo("T" + DateUtil.dateToString(new Date(), "yyyyMMddHHmmss")); 
 | 
            apply.setBankNo(shopInfo.getBankNo()); 
 | 
            apply.setBankName(shopInfo.getBankName()); 
 | 
            apply.setBankOwnerName(shopInfo.getBankOwnerName()); 
 | 
            apply.setCreateBy(sysUsers.getSuName()); 
 | 
            apply.setUpdateBy(sysUsers.getSuName()); 
 | 
            Integer cnt = wxWithdrawApplyDao.insert(apply); 
 | 
  
 | 
            Long applyId = apply.getId(); 
 | 
            LogUtil.info("申请表id为:{}", applyId); 
 | 
            WxApplyOrderRelate relate = new WxApplyOrderRelate(); 
 | 
            relate.setApplyId(applyId); 
 | 
            relate.setCreateBy(sysUsers.getSuName()); 
 | 
            relate.setUpdateBy(sysUsers.getSuName()); 
 | 
            relate.setOrderIds(orderIds.toString()); 
 | 
  
 | 
            wxApplyOrderRelateDao.insert(relate); 
 | 
             int i = shopOrderDao.updateOrderApplyStatus(data); 
 | 
             if (i > 0) { 
 | 
                 return new AjaxResult(AjaxResult.STATUS_SUCCESS, "申请成功,等待审核"); 
 | 
             } 
 | 
        } 
 | 
  
 | 
        return new AjaxResult(AjaxResult.STATUS_FAIL, "该订单非本店铺订单,不能进行此操作"); 
 | 
    } 
 | 
  
 | 
    @RequestMapping(value = "/findOrderListInPageByApplyId") 
 | 
    @ResponseBody 
 | 
    public AjaxResult findOrderListInPageByApplyId(ShopOrderQueryPOJO orderQuery, PaginationVO pageVO) { 
 | 
        List<ShopOrder> orders = shopOrderDao.selectShopOrderInPageByApplyId(orderQuery.getApplyId(), pageVO); 
 | 
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, orders, shopOrderDao.selectShopOrderTotalByApplyId(orderQuery.getApplyId())); 
 | 
    } 
 | 
} 
 |