no
DESKTOP-71BH0QO\L、ming
2021-04-21 5e1a53e2b2d3e530da9b79bcc69ec53ae60781e1
no
1个文件已修改
30 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/ShopApi.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/ShopApi.java
@@ -222,19 +222,8 @@
    public R export(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO) {
        ClazzUtils.setIfStringIsEmpty(comShopOrderExportDTO);
        String url = excelUrl;
        String uuid = UUID.randomUUID().toString().replace("-", "");
        //String name=uuid+".xlsx";
        String ftpUrl = "/mnt/data/web/excel/";
        R<ShopStoreVO> storeR = communityService.getUserStoreInfo(getUserId());
        if (!R.isOk(storeR)) {
            return R.fail("用户不是商家");
        }
        ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()), ShopStoreVO.class);
        Long userId = this.getUserId();
        comShopOrderExportDTO.setUserId(userId);
        R r = communityService.shopOrderExportData(comShopOrderExportDTO);
        if (R.isOk(r)) {
            List<ExcelShopOrderDTO> excelShopOrderDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopOrderDTO.class);
@@ -244,7 +233,7 @@
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                String name = shopStoreVO.getName() + "商城订单-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx";
                String name =  "商城订单-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx";
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
@@ -254,7 +243,7 @@
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ExcelShopOrderDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet(shopStoreVO.getName() + "订单").build();
                        WriteSheet writeSheet = EasyExcel.writerSheet( "商家订单").build();
                        excelWriter.write(excelShopOrderDTO, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
@@ -314,19 +303,8 @@
    public R export(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO) {
        ClazzUtils.setIfStringIsEmpty(comShopFundsExportDTO);
        String url = excelUrl;
        String uuid = UUID.randomUUID().toString().replace("-", "");
        //String name=uuid+".xlsx";
        String ftpUrl = "/mnt/data/web/excel/";
        R<ShopStoreVO> storeR = communityService.getUserStoreInfo(getUserId());
        if (!R.isOk(storeR)) {
            return R.fail("用户不是商家");
        }
        ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()), ShopStoreVO.class);
        Long userId = this.getUserId();
        comShopFundsExportDTO.setUserId(userId);
        R r = communityService.shopOrderFundsExportData(comShopFundsExportDTO);
        if (R.isOk(r)) {
            List<ExcelShopFundsDTO> excelShopFundsDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopFundsDTO.class);
@@ -336,7 +314,7 @@
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                String name = shopStoreVO.getName() + "-商家资金流水-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx";
                String name = "商家资金流水-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx";
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
@@ -346,7 +324,7 @@
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ExcelShopFundsDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet(shopStoreVO.getName() + "订单").build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("订单").build();
                        excelWriter.write(excelShopFundsDTO, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);