From e03732d651f34a014b0be113adc5cbe0789357d0 Mon Sep 17 00:00:00 2001 From: 13233904609 <13233904609@163.cm> Date: Wed, 31 Jul 2024 07:27:45 +0800 Subject: [PATCH] 1111 --- fuintAdmin/src/main.js | 7 +- fuintAdmin/src/utils/request.js | 43 ++++- fuintAdmin/src/views/order/index.vue | 77 +++++++- .../com/fuint/common/enums/OrderModeEnum.java | 30 ++++ .../com/fuint/common/enums/OrderTypeEnum.java | 14 ++ .../com/fuint/common/enums/PayTypeEnum.java | 30 ++++ .../common/excelDto/UserOrderExcelDto.java | 74 ++++++++ .../fuint/common/service/OrderService.java | 18 ++ .../common/service/impl/OrderServiceImpl.java | 167 +++++++++++++++++- .../controller/BackendOrderController.java | 64 +++---- .../template/订单导入模板.xlsx | Bin 0 -> 9001 bytes 11 files changed, 473 insertions(+), 51 deletions(-) create mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/common/excelDto/UserOrderExcelDto.java create mode 100644 fuintBackend/fuint-application/src/main/resources/template/订单导入模板.xlsx diff --git a/fuintAdmin/src/main.js b/fuintAdmin/src/main.js index 43b4aa1..828b5b9 100644 --- a/fuintAdmin/src/main.js +++ b/fuintAdmin/src/main.js @@ -12,7 +12,7 @@ import store from './store' import router from './router' import directive from './directive' // directive import plugins from './plugins' // plugins -import { download } from '@/utils/request' +import { download,download1,download2 } from '@/utils/request' import './assets/icons' // icon import './permission' // permission control @@ -42,14 +42,19 @@ import Print from 'vue-print-nb' import TreeSelect from '@/components/TreeSelect' // 会员选择组件 import UserSelect from '@/components/UserSelect' +import { selectDictLabel, selectDictLabels} from "@/utils/ruoyi"; // 全局方法挂载 Vue.prototype.getConfigKey = getConfigKey +Vue.prototype.selectDictLabel = selectDictLabel +Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.parseTime = parseTime Vue.prototype.resetForm = resetForm Vue.prototype.addDateRange = addDateRange Vue.prototype.getName = getName Vue.prototype.download = download +Vue.prototype.download1 = download1 +Vue.prototype.download2 = download2 Vue.prototype.handleTree = handleTree // 全局组件挂载 diff --git a/fuintAdmin/src/utils/request.js b/fuintAdmin/src/utils/request.js index 178388b..8836f6a 100644 --- a/fuintAdmin/src/utils/request.js +++ b/fuintAdmin/src/utils/request.js @@ -1,14 +1,15 @@ import axios from 'axios' -import { Notification, MessageBox, Message } from 'element-ui' +import { Notification, MessageBox, Message, Loading } from 'element-ui' import store from '@/store' import { getToken } from '@/utils/auth' import errorCode from '@/utils/errorCode' import { tansParams } from "@/utils/fuint"; import cache from '@/plugins/cache' - +import request from '@/utils/request' +import { blobValidate } from "@/utils/ruoyi"; // 是否显示重新登录 export let isRelogin = { show: false }; - +let downloadLoadingInstance; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' // 创建axios实例 const service = axios.create({ @@ -135,6 +136,42 @@ export function download(url, params) { window.open(url, '_blank') } +// 通用下载方法 +export function download1(url, params) { + return request({ + url: url + '?token='+ getToken() + '&'+ param(params), + method: 'get' + }) + // url = process.env.VUE_APP_BASE_API + url + '?token='+ getToken() + '&'+ param(params) + // window.open(url, '_blank') +} +// 通用下载方法 +export function download2(url, params, filename, config) { + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, params, { + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob', + ...config + }).then(async (data) => { + const isBlob = blobValidate(data); + if (isBlob) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close(); + }) +} + // 组织参数 export function param(data) { let url = '' diff --git a/fuintAdmin/src/views/order/index.vue b/fuintAdmin/src/views/order/index.vue index aa1a7a5..d10a9bc 100644 --- a/fuintAdmin/src/views/order/index.vue +++ b/fuintAdmin/src/views/order/index.vue @@ -91,6 +91,13 @@ 查询 重置 + 导入 @@ -387,6 +394,32 @@ + + + + +
将文件拖到此处,或点击上传
+
+ 仅允许导入xls、xlsx格式文件。 + 下载模板 +
+
+ +
@@ -395,6 +428,7 @@ import { getName } from "@/utils/fuint"; import { getOrderList, updateOrderStatus, getOrderInfo, saveOrder, deleteOrder, verifyOrder, delivered } from "@/api/order"; import { doRefund } from "@/api/refund"; import orderPrintDialog from '../cashier/components/orderPrintDialog' +import { getToken } from "@/utils/auth"; export default { name: "OrderIndex", components: { @@ -486,7 +520,22 @@ export default { { required: true, message: "退款金额不能为空", trigger: "blur" }, { pattern: /((^[1-9]\d*)|^0)(\.\d{0,2}){0,1}$/, message: `请输入正确的退款金额`, trigger: 'blur' } ] - } + }, + // 用户导入参数 + upload: { + // 是否显示弹出层(用户导入) + open: false, + // 弹出层标题(用户导入) + title: "", + // 是否禁用上传 + isUploading: false, + // 是否更新已经存在的用户数据 + updateSupport: 0, + // 设置上传的请求头部 + headers: { 'Access-Token': getToken() }, + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/backendApi/order/importData" + }, }; }, created() { @@ -768,6 +817,32 @@ export default { break; } }, + /** 导入按钮操作 */ + handleImport() { + this.upload.title = "用户导入"; + this.upload.open = true; + }, + /** 下载模板操作 */ + importTemplate() { + this.download2('/backendApi/order/exportTemplate', { + }, `订单模板${new Date().getTime()}.xlsx`) + }, + // 文件上传中处理 + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + // 文件上传成功处理 + handleFileSuccess(response, file, fileList) { + this.upload.open = false; + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert("
" + response.msg + "
", "导入结果", { dangerouslyUseHTMLString: true }); + this.getList(); + }, + // 提交上传文件 + submitFileForm() { + this.$refs.upload.submit(); + } } }; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/OrderModeEnum.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/OrderModeEnum.java index 03a8286..18d09e1 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/OrderModeEnum.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/OrderModeEnum.java @@ -34,4 +34,34 @@ public enum OrderModeEnum { public void setValue(String value) { this.value = value; } + + /** + * 根据key获取value + * + * @param key + * @return + */ + public static String getName(String key) { + final OrderModeEnum[] values = OrderModeEnum.values(); + for (OrderModeEnum value : values) { + if (key.equals(value.getKey())) { + return value.getValue(); + } + } + return null; + } + /** + * 根据value获取key + * + * @return + */ + public static String getKeyName(String value) { + final OrderModeEnum[] values = OrderModeEnum.values(); + for (OrderModeEnum order : values) { + if (value.equals(order.getValue())) { + return order.getKey(); + } + } + return null; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/OrderTypeEnum.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/OrderTypeEnum.java index cff5bcb..ff22559 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/OrderTypeEnum.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/OrderTypeEnum.java @@ -53,4 +53,18 @@ public enum OrderTypeEnum { } return null; } + /** + * 根据value获取key + * + * @return + */ + public static String getKeyName(String value) { + final OrderTypeEnum[] values = OrderTypeEnum.values(); + for (OrderTypeEnum order : values) { + if (value.equals(order.getValue())) { + return order.getKey(); + } + } + return null; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/PayTypeEnum.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/PayTypeEnum.java index 5215143..e4c068d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/PayTypeEnum.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/PayTypeEnum.java @@ -37,4 +37,34 @@ public enum PayTypeEnum { public void setValue(String value) { this.value = value; } + + /** + * 根据key获取value + * + * @param key + * @return + */ + public static String getName(String key) { + final PayTypeEnum[] values = PayTypeEnum.values(); + for (PayTypeEnum value : values) { + if (key.equals(value.getKey())) { + return value.getValue(); + } + } + return null; + } + /** + * 根据value获取key + * + * @return + */ + public static String getKeyName(String value) { + final PayTypeEnum[] values = PayTypeEnum.values(); + for (PayTypeEnum order : values) { + if (value.equals(order.getValue())) { + return order.getKey(); + } + } + return null; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/excelDto/UserOrderExcelDto.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/excelDto/UserOrderExcelDto.java new file mode 100644 index 0000000..6b7d07d --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/excelDto/UserOrderExcelDto.java @@ -0,0 +1,74 @@ +package com.fuint.common.excelDto; + +import com.fuint.common.dto.*; +import com.fuint.repository.model.MtRefund; +import com.fuint.repository.model.MtStore; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 会员订单实体类 + * + * Created by FSQ + * CopyRight https://www.fuint.cn + */ +@Getter +@Setter +public class UserOrderExcelDto implements Serializable { + + @ApiModelProperty("订单类型") + private String type; + + @ApiModelProperty("支付类型") + private String payType; + + @ApiModelProperty("订单模式") + private String orderMode; + + @ApiModelProperty("订单号") + private String orderSn; + + @ApiModelProperty("所属商户") + private String merchantName; + + @ApiModelProperty("所属店铺") + private String storeName; + + @ApiModelProperty("用户手机号") + private String userName; + + @ApiModelProperty("是否游客") + private String isVisitor; + + @ApiModelProperty("订单金额") + private BigDecimal amount; + + @ApiModelProperty("支付金额") + private BigDecimal payAmount; + + @ApiModelProperty("使用积分数量") + private Integer usePoint; + + @ApiModelProperty("积分金额") + private BigDecimal pointAmount; + + @ApiModelProperty("折扣金额") + private BigDecimal discount; + + @ApiModelProperty("配送费用") + private BigDecimal deliveryFee; + + @ApiModelProperty("支付时间") + private Date payTime; + + @ApiModelProperty("操作员工") + private String staffName; + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/OrderService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/OrderService.java index 740613e..9473837 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/OrderService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/OrderService.java @@ -9,6 +9,8 @@ import com.fuint.framework.exception.BusinessCheckException; import com.fuint.framework.pagination.PaginationResponse; import com.fuint.repository.model.MtCart; import com.fuint.repository.model.MtOrder; +import org.springframework.web.multipart.MultipartFile; + import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.Date; @@ -239,4 +241,20 @@ public interface OrderService extends IService { * @return * */ List getTobeCommissionOrderList(String dateTime) throws BusinessCheckException; + + /** + * 保存文件 + * + * @param file excel文件 + * @param request 操作者 + * */ + String saveExcelFile(MultipartFile file, HttpServletRequest request) throws Exception; + + /** + * 导入发券列表 + * + * @param file excel文件 + * @param operator 操作者 + * */ + String importSendCoupon(MultipartFile file, String operator, String filePath) throws BusinessCheckException; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java index 4b9bcf5..ac0b79c 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/OrderServiceImpl.java @@ -1,5 +1,6 @@ package com.fuint.common.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -7,13 +8,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.common.Constants; import com.fuint.common.dto.*; import com.fuint.common.enums.*; +import com.fuint.common.excelDto.UserOrderExcelDto; import com.fuint.common.param.OrderListParam; import com.fuint.common.param.SettlementParam; import com.fuint.common.service.*; -import com.fuint.common.util.CommonUtil; -import com.fuint.common.util.DateUtil; -import com.fuint.common.util.SeqUtil; -import com.fuint.common.util.TokenUtil; +import com.fuint.common.util.*; import com.fuint.framework.annoation.OperationServiceLog; import com.fuint.framework.exception.BusinessCheckException; import com.fuint.framework.pagination.PaginationResponse; @@ -30,14 +29,20 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.context.annotation.Lazy; +import org.springframework.core.env.Environment; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ResourceUtils; +import org.springframework.web.multipart.MultipartFile; import weixin.popular.util.JsonUtil; import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.io.IOException; import java.math.BigDecimal; import java.util.*; +import java.util.regex.Pattern; import java.util.stream.Collectors; /** @@ -169,6 +174,11 @@ public class OrderServiceImpl extends ServiceImpl implem * */ private PaymentService paymentService; + /** + * 系统环境变量 + * */ + private Environment env; + /** * 获取用户订单列表 * @param orderListParam @@ -2116,4 +2126,153 @@ public class OrderServiceImpl extends ServiceImpl implem public List getTobeCommissionOrderList(String dateTime) { return mtOrderMapper.getTobeCommissionOrderList(dateTime); } + + /** + * 保存文件 + * + * @param file excel文件 + * @param request + * */ + public String saveExcelFile(MultipartFile file, HttpServletRequest request) throws Exception { + String fileName = file.getOriginalFilename(); + + String imageName = fileName.substring(fileName.lastIndexOf(".")); + String pathRoot = env.getProperty("images.root"); + if (pathRoot == null || StringUtil.isEmpty(pathRoot)) { + pathRoot = ResourceUtils.getURL("classpath:").getPath(); + } + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + + String filePath = "/static/uploadFiles/"+ DateUtil.formatDate(new Date(), "yyyyMMdd")+"/"; + String path = filePath + uuid + imageName; + + try { + File tempFile = new File(pathRoot + path); + if (!tempFile.getParentFile().exists()) { + tempFile.getParentFile().mkdirs(); + } + CommonUtil.saveMultipartFile(file, pathRoot + path); + } catch (Exception e) { + //empty + } + + return path; + } + + /** + * 导入订单列表 + * + * @param file excel文件 + * @param operator 操作者 + * */ + @Override + @Transactional(rollbackFor = Exception.class) + @OperationServiceLog(description = "导入订单列表") + public String importSendCoupon(MultipartFile file, String operator, String filePath) throws BusinessCheckException { + String originalFileName = file.getOriginalFilename(); + boolean isExcel2003 = XlsUtil.isExcel2003(originalFileName); + boolean isExcel2007 = XlsUtil.isExcel2007(originalFileName); + + if (!isExcel2003 && !isExcel2007) { + logger.error("importSendCouponController->uploadFile:{}", "文件类型不正确"); + throw new BusinessCheckException("文件类型不正确"); + } + + List> content = new ArrayList<>(); + try { + content = XlsUtil.readExcelContent(file.getInputStream(), isExcel2003, 1, null, null, null); + } catch (IOException e) { + logger.error("CouponGroupServiceImpl->parseExcelContent{}", e); + throw new BusinessCheckException("导入失败"+e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + } + + StringBuffer errorMsg = new StringBuffer(); + StringBuffer errorMsgNoGroup = new StringBuffer(); + StringBuffer errorMsgNoNum = new StringBuffer(); + StringBuffer errorMsgNoRegister = new StringBuffer(); + + List rows = new ArrayList<>(); + + for (int i = 0; i < content.size(); i++) { + List groupIdArr = new ArrayList<>(); + List numArr = new ArrayList<>(); + + List rowContent = content.get(i); + MtOrder order = new MtOrder(); + String type = rowContent.get(0); + if(StringUtil.isNotEmpty(type)){ + String keyName = OrderTypeEnum.getKeyName(type); + if(StringUtil.isNotEmpty(keyName)){ + type = keyName; + } + } + order.setType(type); + String payType = rowContent.get(1); + if(StringUtil.isNotEmpty(payType)){ + String keyName = PayTypeEnum.getKeyName(payType); + if(StringUtil.isNotEmpty(keyName)){ + payType = keyName; + } + } + order.setPayType(payType); + String orderMode = rowContent.get(2); + if(StringUtil.isNotEmpty(orderMode)){ + String keyName = OrderModeEnum.getKeyName(orderMode); + if(StringUtil.isNotEmpty(keyName)){ + orderMode = keyName; + } + } + order.setOrderMode(orderMode); + String orderSn = rowContent.get(3); + order.setOrderSn(orderSn); + String merchantName = rowContent.get(4); +// order.setMerchantId(); + String storeName = rowContent.get(5); + if(StringUtil.isNotEmpty(storeName)){ + StoreDto storeDto = storeService.queryStoreByName(storeName); + if(ObjectUtil.isNotEmpty(storeDto)){ + order.setStoreId(storeDto.getId()); + } + } + String userName = rowContent.get(6); + String isVisitor = rowContent.get(7); + order.setIsVisitor(isVisitor); + String amount = rowContent.get(8); + if(StringUtil.isNotEmpty(amount)){ + order.setAmount(new BigDecimal(amount)); + } + String payAmount = rowContent.get(9); + if(StringUtil.isNotEmpty(payAmount)){ + order.setPayAmount(new BigDecimal(payAmount)); + } + String usePoint = rowContent.get(10); + if(StringUtil.isNotEmpty(usePoint)){ + order.setUsePoint(Integer.valueOf(usePoint)); + } + String pointAmount = rowContent.get(11); + if(StringUtil.isNotEmpty(pointAmount)){ + order.setPointAmount(new BigDecimal(pointAmount)); + } + String discount = rowContent.get(12); + if(StringUtil.isNotEmpty(discount)){ + order.setDiscount(new BigDecimal(discount)); + } + String deliveryFee = rowContent.get(13); + if(StringUtil.isNotEmpty(deliveryFee)){ + order.setDeliveryFee(new BigDecimal(deliveryFee)); + } + String payTime = rowContent.get(14); + String staffName = rowContent.get(15); +// order.setStaffId(); + mtOrderMapper.insert(order); + } + + + // 导入批次 + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + + return uuid; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendOrderController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendOrderController.java index a4b6835..d591330 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendOrderController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendOrderController.java @@ -585,7 +585,7 @@ public class BackendOrderController extends BaseController { * @throws BusinessCheckException */ @ApiOperation(value = "导出模板文件") - @RequestMapping(value = "/exportTemplate", method = RequestMethod.GET) + @RequestMapping(value = "/exportTemplate", method = RequestMethod.POST) @CrossOrigin public void exportTemplate(HttpServletRequest request, HttpServletResponse response) throws BusinessCheckException { ClassLoader classLoader = this.getClass().getClassLoader(); @@ -594,9 +594,9 @@ public class BackendOrderController extends BaseController { ExcelExportDto excelExportDto = new ExcelExportDto(); excelExportDto.setSrcPath(srcTemplateFilePath); - excelExportDto.setSrcTemplateFileName("template" + File.separator + "importTemplate.xlsx"); + excelExportDto.setSrcTemplateFileName("template" + File.separator + "订单导入模板.xlsx"); - String filename = "订单模板" + ".xlsx"; + String filename = "订单导入模板" + ".xlsx"; try { OutputStream out = response.getOutputStream(); XlsUtil.setXlsHeader(request, response, filename); @@ -608,45 +608,25 @@ public class BackendOrderController extends BaseController { } } + /** + * 上传文件 + * + * @param request + * @throws + */ + @ApiOperation(value = "上传文件") + @RequestMapping(value = "/importData", method = RequestMethod.POST, produces = "text/html;charset=UTF-8") + @CrossOrigin + public ResponseObject uploadFile(HttpServletRequest request, @RequestParam("file") MultipartFile file) throws Exception { + String token = request.getHeader("Access-Token"); + AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token); + if (accountInfo == null) { + return getFailureResult(1001, "请先登录"); + } -// @PreAuthorize("@ss.hasPermi('system:user:import')") -// @PostMapping("/importData") -// public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception -// { -// ExcelUtil util = new ExcelUtil(SysUser.class); -// List userList = util.importExcel(file.getInputStream()); -// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); -// String operName = loginUser.getUsername(); -// String message = userService.importUser(userList, updateSupport, operName); -// return AjaxResult.success(message); -// } -// -// @GetMapping("/importTemplate") -// public AjaxResult importTemplate() -// { -// ExcelUtil util = new ExcelUtil(SysUser.class); -// return util.importTemplateExcel("用户数据"); -// } - -// /** -// * 上传文件 -// * -// * @param request -// * @throws -// */ -// @ApiOperation(value = "上传文件") -// @RequestMapping(value = "/upload/", method = RequestMethod.POST, produces = "text/html;charset=UTF-8") -// @CrossOrigin -// public ResponseObject uploadFile(HttpServletRequest request, @RequestParam("fileInput") MultipartFile file) throws Exception { -// String token = request.getHeader("Access-Token"); -// AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token); -// if (accountInfo == null) { -// return getFailureResult(1001, "请先登录"); -// } -// -// String filePath = couponGroupService.saveExcelFile(file, request); -// String uuid = couponGroupService.importSendCoupon(file, accountInfo.getAccountName(), filePath); -// return getSuccessResult(uuid); -// } + String filePath = orderService.saveExcelFile(file, request); + String uuid = orderService.importSendCoupon(file, accountInfo.getAccountName(), filePath); + return getSuccessResult(uuid); + } } diff --git a/fuintBackend/fuint-application/src/main/resources/template/订单导入模板.xlsx b/fuintBackend/fuint-application/src/main/resources/template/订单导入模板.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..8b93e0381b0569231c484868183b85fcaaa0ee09 GIT binary patch literal 9001 zcmeHNg;yN;(j9zo_Yfpl(7_#oTkzl(+}&M*LlRtq4IVT=a00>I3GRU)gS*2wo44=n zZg#)F;Ju!6x_eIdtuy_rx>a|oT3H?r9uI&B00IC2N`Ub}rlkQ401yig0N?_Eu)5+7 z_O533u77*DRSXq>A?V4=>7lO{)<j!7R5}{Q}6f zAKZ(>pd#GXmC#dSqMK!9^_UfTizSwWZ_QJMGrH)*emrbhZEsf>9MRLPiWVKz*QRbj z%EQ{-yGQetkT~91NBaX z5v@e$BVXS_`>LYGGB)o(@g&yzIPN!VtLHujr|ZnJ@X=I0iv;cl1T8=Y@b z*MabqOB={E6M|ts`vn(11PvBXdM|oJvjguP^1FdtilvCMS7q^MD}vrn=moKeYB!iEF-an!JIMmpnFm^bIdx^z2 zj}@1oijoW_o80z1xnCHUDrrti^uPcBGr=9H{1<`>s2bRQ6gISN)yXAPh{=%Y$y#IT z83dC;hL*O=XP>C_z!;Po8~vE63Au_URZ zV=)>yf3^{gQyafJ(~yzWplN977Plx}C2S|Z1;O8^wAEY|N2$@&>ZQX4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