|
|
@ -10,8 +10,11 @@ import com.fuint.common.param.OrderListParam;
|
|
|
|
import com.fuint.common.service.*;
|
|
|
|
import com.fuint.common.service.*;
|
|
|
|
import com.fuint.common.util.DateUtil;
|
|
|
|
import com.fuint.common.util.DateUtil;
|
|
|
|
import com.fuint.common.util.TokenUtil;
|
|
|
|
import com.fuint.common.util.TokenUtil;
|
|
|
|
|
|
|
|
import com.fuint.common.util.XlsUtil;
|
|
|
|
|
|
|
|
import com.fuint.framework.dto.ExcelExportDto;
|
|
|
|
import com.fuint.framework.exception.BusinessCheckException;
|
|
|
|
import com.fuint.framework.exception.BusinessCheckException;
|
|
|
|
import com.fuint.framework.pagination.PaginationResponse;
|
|
|
|
import com.fuint.framework.pagination.PaginationResponse;
|
|
|
|
|
|
|
|
import com.fuint.framework.service.ExportService;
|
|
|
|
import com.fuint.framework.web.BaseController;
|
|
|
|
import com.fuint.framework.web.BaseController;
|
|
|
|
import com.fuint.framework.web.ResponseObject;
|
|
|
|
import com.fuint.framework.web.ResponseObject;
|
|
|
|
import com.fuint.repository.mapper.MtOrderGoodsMapper;
|
|
|
|
import com.fuint.repository.mapper.MtOrderGoodsMapper;
|
|
|
@ -21,12 +24,20 @@ import com.fuint.utils.TimeUtils;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
|
|
|
import lombok.extern.java.Log;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
import java.net.URL;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -77,6 +88,13 @@ public class BackendOrderController extends BaseController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private SettingService settingService;
|
|
|
|
private SettingService settingService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 导出服务接口
|
|
|
|
|
|
|
|
* */
|
|
|
|
|
|
|
|
private ExportService exportService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(BackendCouponGroupController.class);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 订单列表查询
|
|
|
|
* 订单列表查询
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -559,5 +577,76 @@ public class BackendOrderController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 导出模板文件
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param request
|
|
|
|
|
|
|
|
* @param response
|
|
|
|
|
|
|
|
* @throws BusinessCheckException
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation(value = "导出模板文件")
|
|
|
|
|
|
|
|
@RequestMapping(value = "/exportTemplate", method = RequestMethod.GET)
|
|
|
|
|
|
|
|
@CrossOrigin
|
|
|
|
|
|
|
|
public void exportTemplate(HttpServletRequest request, HttpServletResponse response) throws BusinessCheckException {
|
|
|
|
|
|
|
|
ClassLoader classLoader = this.getClass().getClassLoader();
|
|
|
|
|
|
|
|
URL url = classLoader.getResource("");
|
|
|
|
|
|
|
|
String srcTemplateFilePath = url.getPath();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExcelExportDto excelExportDto = new ExcelExportDto();
|
|
|
|
|
|
|
|
excelExportDto.setSrcPath(srcTemplateFilePath);
|
|
|
|
|
|
|
|
excelExportDto.setSrcTemplateFileName("template" + File.separator + "importTemplate.xlsx");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String filename = "订单模板" + ".xlsx";
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
OutputStream out = response.getOutputStream();
|
|
|
|
|
|
|
|
XlsUtil.setXlsHeader(request, response, filename);
|
|
|
|
|
|
|
|
excelExportDto.setOut(out);
|
|
|
|
|
|
|
|
exportService.exportLocalFile(excelExportDto);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
logger.error("导出出错", e);
|
|
|
|
|
|
|
|
throw new BusinessCheckException("导出出错");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('system:user:import')")
|
|
|
|
|
|
|
|
// @PostMapping("/importData")
|
|
|
|
|
|
|
|
// public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
|
|
|
|
|
|
|
// List<SysUser> 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<SysUser> util = new ExcelUtil<SysUser>(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);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|