Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/upstream/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaozhanwei committed Apr 1, 2020
2 parents 70d6360 + db30721 commit 94e8bb1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.*;
Expand Down Expand Up @@ -102,7 +103,11 @@ public static void genExcelFile(String content,String title,String xlsFilePath){

for (int i = 0; i < headerList.size(); i++) {
sheet.setColumnWidth(i, headerList.get(i).length() * 800);
}

File file = new File(xlsFilePath);
if (!file.exists()) {
file.mkdirs();
}

//setting file output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,14 @@ public void testGenExcelFile() {
ExcelUtils.genExcelFile(incorrectContent1, title, xlsFilePath);

}

/**
* Test GenExcelFile (check directory)
*/
@Test
public void testGenExcelFileByCheckDir() {
ExcelUtils.genExcelFile("[{\"a\": \"a\"},{\"a\": \"a\"}]", "t", "/tmp/xls");
File file = new File("/tmp/xls" + Constants.SINGLE_SLASH + "t" + Constants.EXCEL_SUFFIX_XLS);
file.delete();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ public Result createResource(@ApiIgnore @RequestAttribute(value = Constants.SESS
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType ="Int", example = "100"),
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType ="ResourceType"),
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType ="String"),
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType ="String"),
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true,dataType = "MultipartFile")
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType ="String")
})
@PostMapping(value = "/update")
public Result updateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
Expand Down
6 changes: 5 additions & 1 deletion sql/upgrade/1.2.2_schema/mysql/dolphinscheduler_dml.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*/
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
SET FOREIGN_KEY_CHECKS=0;
UPDATE t_ds_resources SET pid=-1,is_directory=false WHERE pid IS NULL;
UPDATE t_ds_resources SET full_name = concat('/',alias) WHERE pid=-1 and full_name IS NULL;

0 comments on commit 94e8bb1

Please sign in to comment.