|
@@ -52,6 +52,7 @@ import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
|
import org.springblade.core.tool.utils.*;
|
|
|
import org.springblade.manager.bean.TableInfo;
|
|
|
+import org.springblade.manager.dto.AddBussFileSortDTO;
|
|
|
import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.enums.ExecuteType;
|
|
|
import org.springblade.manager.mapper.ExcelTabMapper;
|
|
@@ -1728,14 +1729,6 @@ public class ExcelTabController extends BladeController {
|
|
|
public R addBussFile(@RequestParam("files") MultipartFile[] files, Long pkeyId, String nodeId, String contractId, String projectId, String classify) {
|
|
|
List<TableFile>list=new ArrayList<>();
|
|
|
for (int i = 0; i < files.length; i++) {
|
|
|
- String sql1 = "SELECT sort FROM m_table_file WHERE tab_id = ? AND classify = ? AND contract_id = ? ORDER BY sort DESC LIMIT 1";
|
|
|
- Integer sortValue;
|
|
|
- try {
|
|
|
- sortValue=jdbcTemplate.queryForObject(sql1, Integer.class, nodeId, classify, contractId);
|
|
|
- sortValue=sortValue+1;
|
|
|
- }catch (Exception e){
|
|
|
- sortValue=0;
|
|
|
- }
|
|
|
R<BladeFile> bladeFile = iossClient.addFileInfo(files[i]);
|
|
|
BladeFile bladeFile1 = bladeFile.getData();
|
|
|
TableFile tableFile = new TableFile();
|
|
@@ -1766,7 +1759,6 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
tableFile.setStatus("finished");
|
|
|
- tableFile.setSort(sortValue+i);
|
|
|
list.add(tableFile);
|
|
|
}
|
|
|
|
|
@@ -4432,14 +4424,6 @@ public class ExcelTabController extends BladeController {
|
|
|
public R addBussFile(Integer classify,Long contractId,@RequestParam("files") MultipartFile[] files, String nodeId, Integer type,BladeUser b) {
|
|
|
List<TableFile> fileList = new ArrayList<>();
|
|
|
if (files != null && files.length >= 1) {
|
|
|
- String sql1 = "SELECT sort FROM m_table_file WHERE tab_id = ? AND type = ? AND classify = ? AND contract_id = ? ORDER BY sort DESC LIMIT 1";
|
|
|
- Integer sortValue;
|
|
|
- try {
|
|
|
- sortValue=jdbcTemplate.queryForObject(sql1, Integer.class, nodeId, type, classify, contractId);
|
|
|
- sortValue=sortValue+1;
|
|
|
- }catch (Exception e){
|
|
|
- sortValue=0;
|
|
|
- }
|
|
|
for (int i = 0; i < files.length; i++) {
|
|
|
|
|
|
R<BladeFile> bladeFile = iossClient.addFileInfo(files[i]);
|
|
@@ -4459,7 +4443,6 @@ public class ExcelTabController extends BladeController {
|
|
|
tableFile.setIsDeleted(0);
|
|
|
tableFile.setExtension(fileExtension);
|
|
|
tableFile.setClassify(classify);
|
|
|
- tableFile.setSort(sortValue+i);
|
|
|
fileList.add(tableFile);
|
|
|
}
|
|
|
tableFileService.saveOrUpdateBatch(fileList);
|
|
@@ -4531,6 +4514,22 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/add-bussfile-node-sort")
|
|
|
+ public R addBussFileNodeSort(@RequestBody AddBussFileSortDTO dto){
|
|
|
+ List<TableFile> tableFileList = tableFileService.list(new LambdaQueryWrapper<>(TableFile.class).eq(TableFile::getClassify, dto.getClassify()).eq(TableFile::getContractId, dto.getContractId()).eq(TableFile::getTabId, dto.getNodeId()).eq(TableFile::getType, dto.getType()));
|
|
|
+ if(dto.getList().length>0&&!tableFileList.isEmpty()){
|
|
|
+ for (TableFile file : tableFileList) {
|
|
|
+ for (int i = 0; i < dto.getList().length; i++) {
|
|
|
+ if(dto.getList()[i].equals(file.getName())){
|
|
|
+ file.setSort(i);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.status(tableFileService.updateBatchById(tableFileList));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@PostMapping("/save_nodeId")
|
|
|
@ApiOperationSupport(order = 72)
|