| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.matrix.component.asyncmessage.AsyncMessageManager; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysCompanyDao; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | |
| | | import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.ModelMap; |
| | |
| | | @Autowired |
| | | private AsyncMessageManager asyncMessageManager; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | | @Autowired |
| | | private OperationLogService operationLogService; |
| | | |
| | | |
| | | /** |
| | | * 计算订单金额 |
| | |
| | | SysCompanyDao companyDao; |
| | | |
| | | /** |
| | | * 收款 |
| | | * 打印订单 |
| | | */ |
| | | @RequestMapping(value = "/printOrder") |
| | | public @ResponseBody |
| | | ModelAndView printOrder(SysOrder order) throws GlobleException { |
| | | ModelAndView mv = new ModelAndView("admin/hive/beautySalon/print-order"); |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | SysUsers user = getMe(); |
| | | String comRegisterCode = companyDao.selectById(user.getCompanyId()).getComRegisterCode(); |
| | | if (StringUtils.isNotBlank(comRegisterCode)) { |
| | | mv.addObject("page", comRegisterCode); |
| | |
| | | */ |
| | | @RequestMapping(value = "/updateOrderTime") |
| | | public @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | AjaxResult updateOrderTime(SysOrder sysOrder) { |
| | | |
| | | sysOrderDao.updateOrderTime(sysOrder.getPayTime(), sysOrder.getId()); |
| | |
| | | //更新收款流水时间 |
| | | sysOrderFlowDao.updateTimeByOrderId(sysOrder.getId(), sysOrder.getPayTime()); |
| | | |
| | | //保存单据日志 |
| | | sysOrder= sysOrderDao.selectById(sysOrder.getId()); |
| | | operationLogService.saveOperation(sysOrder.getCompanyId(), sysOrder.getShopId(),getMe().getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.ORDER_UPDATE_TIME, |
| | | sysOrder.getId(), |
| | | sysOrder.getOrderNo(), |
| | | sysOrder.getVipId(), |
| | | "更新参数: "+JSON.toJSONString(sysOrder)); |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); |
| | | } |
| | |
| | | @RequestMapping(value = "/exportExcel") |
| | | public void report(ModelMap model, HttpServletRequest request, HttpServletResponse response, |
| | | SysOrder sysOrder) throws Exception { |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | sysOrder.setShopId(sysUsers.getShopId()); |
| | | sysOrder.setShopId(getMe().getShopId()); |
| | | doExportOrder(response, sysOrder); |
| | | return; |
| | | |
| | |
| | | public void erpExportExcel(ModelMap model, HttpServletRequest request, HttpServletResponse response, |
| | | SysOrder sysOrder) throws Exception { |
| | | doExportOrder(response, sysOrder); |
| | | |
| | | return; |
| | | |
| | | } |
| | |
| | | * @throws IOException |
| | | */ |
| | | private void doExportOrder(HttpServletResponse response, SysOrder sysOrder) throws IOException { |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(getMe().getCompanyId(), getMe().getShopId(),getMe().getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.EXPORT, |
| | | String.format("导出参数:%s" , JSON.toJSONString(sysOrder))); |
| | | |
| | | List<ExcelSheetPO> res = new ArrayList<>(); |
| | | ExcelSheetPO orderSheet = new ExcelSheetPO(); |
| | | String title = "订单记录"; |
| | | orderSheet.setSheetName(title); |
| | | orderSheet.setTitle(title); |
| | | String[] header = {"订单号", "客户姓名", "客户手机", "下单时间", "订单总价", "折后价", "现金付款", "卡付款", "顾问姓名", "所属门店", "订单状态"}; |
| | | String[] header = {"订单号", "客户姓名", "客户手机", "下单时间", "订单总价", "折后价", "现金付款", "卡付款", "顾问姓名", "收银员", "所属门店", "订单状态"}; |
| | | orderSheet.setHeaders(header); |
| | | //门店只能查询本店自己的订单 |
| | | List<SysOrder> dataList = orderService.findInPage(sysOrder, null); |
| | |
| | | temp.add(item.getCashPay()); |
| | | temp.add(item.getCardPay()); |
| | | temp.add(item.getStaffName()); |
| | | temp.add(item.getCashierName()); |
| | | temp.add(item.getShopName()); |
| | | temp.add(item.getStatu()); |
| | | list.add(temp); |