|
@@ -15,7 +15,6 @@ import com.ruoyi.file.service.IFilesStorageService;
|
15
|
15
|
import com.ruoyi.file.service.IFilesTopicService;
|
16
|
16
|
import org.springframework.beans.factory.annotation.Autowired;
|
17
|
17
|
import org.springframework.beans.factory.annotation.Value;
|
18
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
19
|
18
|
import org.springframework.web.bind.annotation.*;
|
20
|
19
|
import org.springframework.web.multipart.MultipartFile;
|
21
|
20
|
|
|
@@ -43,13 +42,12 @@ public class FilesProjectController extends BaseController {
|
43
|
42
|
@Autowired
|
44
|
43
|
private IFilesStorageService filesStorageService;
|
45
|
44
|
|
46
|
|
- @Value("${ruoyi.profile}")
|
|
45
|
+ @Value("${cmc.profile}")
|
47
|
46
|
private String profile;
|
48
|
47
|
|
49
|
48
|
/**
|
50
|
49
|
* 查询项目管理列表
|
51
|
50
|
*/
|
52
|
|
- @PreAuthorize("@ss.hasPermi('file:project:list')")
|
53
|
51
|
@GetMapping("/list")
|
54
|
52
|
public TableDataInfo list(FilesProject filesProject) {
|
55
|
53
|
List<FilesProject> list = filesProjectService.selectFilesProjectList(filesProject);
|
|
@@ -71,7 +69,6 @@ public class FilesProjectController extends BaseController {
|
71
|
69
|
/**
|
72
|
70
|
* 导出项目管理列表
|
73
|
71
|
*/
|
74
|
|
- @PreAuthorize("@ss.hasPermi('file:project:export')")
|
75
|
72
|
@Log(title = "项目管理", businessType = BusinessType.EXPORT)
|
76
|
73
|
@PostMapping("/export")
|
77
|
74
|
public void export(HttpServletResponse response, FilesProject filesProject) {
|
|
@@ -83,7 +80,6 @@ public class FilesProjectController extends BaseController {
|
83
|
80
|
/**
|
84
|
81
|
* 导出选中项目管理列表
|
85
|
82
|
*/
|
86
|
|
- @PreAuthorize("@ss.hasPermi('file:project:export')")
|
87
|
83
|
@Log(title = "成果表", businessType = BusinessType.EXPORT)
|
88
|
84
|
@PostMapping("/exportBatch/{ids}")
|
89
|
85
|
public void exportBatch(HttpServletResponse response, FilesProject filesProject, @PathVariable("ids") String[] ids)
|
|
@@ -108,7 +104,6 @@ public class FilesProjectController extends BaseController {
|
108
|
104
|
/**
|
109
|
105
|
* 获取项目管理详细信息
|
110
|
106
|
*/
|
111
|
|
- @PreAuthorize("@ss.hasPermi('file:project:query')")
|
112
|
107
|
@GetMapping(value = "/{id}")
|
113
|
108
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
114
|
109
|
return AjaxResult.success(filesProjectService.selectFilesProjectById(id));
|
|
@@ -117,7 +112,6 @@ public class FilesProjectController extends BaseController {
|
117
|
112
|
/**
|
118
|
113
|
* 获取专题对应项目列表
|
119
|
114
|
*/
|
120
|
|
- @PreAuthorize("@ss.hasPermi('file:project:query')")
|
121
|
115
|
@GetMapping("/topicName")
|
122
|
116
|
public AjaxResult getProjectByTopic(String topicName) {
|
123
|
117
|
FilesTopic filesTopic = new FilesTopic();
|
|
@@ -131,29 +125,11 @@ public class FilesProjectController extends BaseController {
|
131
|
125
|
/**
|
132
|
126
|
* 上传项目excel文件
|
133
|
127
|
*/
|
134
|
|
- @PreAuthorize("@ss.hasPermi('file:project:add')")
|
135
|
128
|
@PostMapping("/uploadSheet")
|
136
|
129
|
public AjaxResult uploadProjectSheet(MultipartFile file) throws Exception {
|
137
|
130
|
if (file.isEmpty()) {
|
138
|
131
|
return AjaxResult.error("文件内容为空!");
|
139
|
132
|
} else {
|
140
|
|
-// File profilePath = new File(profile);
|
141
|
|
-// if (!profilePath.exists())//若此目录不存在,则创建之
|
142
|
|
-// profilePath.mkdirs();
|
143
|
|
-// File transferFile = new File(profilePath + "\\" + file.getOriginalFilename());
|
144
|
|
-// file.transferTo(transferFile);
|
145
|
|
-// InputStream in = new FileInputStream(transferFile);
|
146
|
|
-// XSSFSheet sheetAt = null;
|
147
|
|
-// HSSFSheet sheetAt1 = null;
|
148
|
|
-// int rowNumber = 0;
|
149
|
|
-// boolean xlsx = Objects.requireNonNull(file.getOriginalFilename()).endsWith("xlsx");
|
150
|
|
-// if (file.getOriginalFilename() != null && file.getOriginalFilename().endsWith("xlsx")) {
|
151
|
|
-// sheetAt = new XSSFWorkbook(in).getSheetAt(0);
|
152
|
|
-// rowNumber = sheetAt.getLastRowNum();
|
153
|
|
-// } else if (file.getOriginalFilename() != null && file.getOriginalFilename().endsWith("xls")) {
|
154
|
|
-// sheetAt1 = new HSSFWorkbook(in).getSheetAt(0);
|
155
|
|
-// rowNumber = sheetAt1.getLastRowNum();
|
156
|
|
-// }
|
157
|
133
|
ExcelUtil<FilesProject> util = new ExcelUtil<FilesProject>(FilesProject.class);
|
158
|
134
|
List<FilesProject> filesProjectList = util.importExcel(file.getInputStream());
|
159
|
135
|
List<String> IdList = new ArrayList<>();
|
|
@@ -169,46 +145,6 @@ public class FilesProjectController extends BaseController {
|
169
|
145
|
else
|
170
|
146
|
filesProjectService.insertFilesProject(fileProject);
|
171
|
147
|
}
|
172
|
|
-// FilesProject filesProject = new FilesProject();
|
173
|
|
-// for (int i = 0; i < rowNumber - 1; ) {
|
174
|
|
-// i++;
|
175
|
|
-// filesProject.setId(new SnowFlake().generateId());
|
176
|
|
-// filesProject.setProjectNumber(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(0)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(0)));
|
177
|
|
-// filesProject.setProjectName(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(1)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(1)));
|
178
|
|
-// filesProject.setCurrentProgress(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(2)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(2)));
|
179
|
|
-// filesProject.setProjectSource(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(3)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(3)));
|
180
|
|
-// filesProject.setPartyA(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(4)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(4)));
|
181
|
|
-// filesProject.setContactPerson(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(5)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(5)));
|
182
|
|
-// filesProject.setTelephone(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(6)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(6)));
|
183
|
|
-// filesProject.setContractCode(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(7)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(7)));
|
184
|
|
-// filesProject.setContractNumber(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(8)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(8)));
|
185
|
|
-// filesProject.setProjectType(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(9)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(9)));
|
186
|
|
-// filesProject.setExpectedPrice(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(10)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(10)));
|
187
|
|
-// filesProject.setProjectLevel(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(11)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(11)));
|
188
|
|
-// filesProject.setTechnicalDirector(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(12)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(12)));
|
189
|
|
-// filesProject.setTechinicalDesigner(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(13)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(13)));
|
190
|
|
-// filesProject.setQualityInspector(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(14)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(14)));
|
191
|
|
-// filesProject.setUndertakingSector(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(15)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(15)));
|
192
|
|
-// filesProject.setProjectLeader(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(16)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(16)));
|
193
|
|
-// filesProject.setFund(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(17)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(17)));
|
194
|
|
-// filesProject.setApprovalDate(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(18)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(18)));
|
195
|
|
-// filesProject.setApproachTime(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(19)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(19)));
|
196
|
|
-// filesProject.setWithdrawalTime(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(20)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(20)));
|
197
|
|
-// filesProject.setRequiredCompletionDate(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(21)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(21)));
|
198
|
|
-// filesProject.setSubmissionDate(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(22)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(22)));
|
199
|
|
-// filesProject.setLicensePlateNumber(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(23)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(23)));
|
200
|
|
-// filesProject.setMileage(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(24)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(24)));
|
201
|
|
-// filesProject.setFuelExpense(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(25)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(25)));
|
202
|
|
-// filesProject.setMainEquipment(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(26)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(26)));
|
203
|
|
-// filesProject.setProjectParticipants(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(27)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(27)));
|
204
|
|
-// filesProject.setCurrentProcessing(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(28)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(28)));
|
205
|
|
-// filesProject.setCurrentHandler(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(29)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(29)));
|
206
|
|
-// filesProject.setProjectRegistrant(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(30)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(30)));
|
207
|
|
-// filesProject.setRegistrationDate(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(31)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(31)));
|
208
|
|
-// filesProject.setLeadingSector(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(32)) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(32)));
|
209
|
|
-// filesProject.setYear(xlsx ? ExcelUtils.getString(sheetAt.getRow(i).getCell(33)).substring(0,4) : ExcelUtils.getString(sheetAt1.getRow(i).getCell(33)).substring(0,4));
|
210
|
|
-// filesProjectService.insertFilesProject(filesProject);
|
211
|
|
-// }
|
212
|
148
|
return AjaxResult.success("上传成功");
|
213
|
149
|
}
|
214
|
150
|
}
|
|
@@ -216,7 +152,6 @@ public class FilesProjectController extends BaseController {
|
216
|
152
|
/**
|
217
|
153
|
* 新增项目管理
|
218
|
154
|
*/
|
219
|
|
- @PreAuthorize("@ss.hasPermi('file:project:add')")
|
220
|
155
|
@Log(title = "项目管理", businessType = BusinessType.INSERT)
|
221
|
156
|
@PostMapping
|
222
|
157
|
public AjaxResult add(FilesProject filesProject, @RequestParam(value = "kmlfile",required = false) MultipartFile uploadProjectKmlFile, @RequestParam(value = "cpfile",required = false) MultipartFile uploadCpKmlFile) throws IOException {
|
|
@@ -297,7 +232,6 @@ public class FilesProjectController extends BaseController {
|
297
|
232
|
/**
|
298
|
233
|
* 修改项目管理
|
299
|
234
|
*/
|
300
|
|
- @PreAuthorize("@ss.hasPermi('file:project:edit')")
|
301
|
235
|
@Log(title = "项目管理", businessType = BusinessType.UPDATE)
|
302
|
236
|
@PostMapping("/edit")
|
303
|
237
|
public AjaxResult edit(FilesProject filesProject, @RequestParam(value = "kmlfile",required = false) MultipartFile uploadProjectKmlFile, @RequestParam(value = "cpfile",required = false) MultipartFile uploadCpKmlFile) throws IOException {
|
|
@@ -312,7 +246,6 @@ public class FilesProjectController extends BaseController {
|
312
|
246
|
/**
|
313
|
247
|
* 删除项目管理
|
314
|
248
|
*/
|
315
|
|
- @PreAuthorize("@ss.hasPermi('file:project:remove')")
|
316
|
249
|
@Log(title = "项目管理", businessType = BusinessType.DELETE)
|
317
|
250
|
@DeleteMapping("/{ids}")
|
318
|
251
|
public AjaxResult remove(@PathVariable String[] ids) {
|
|
@@ -321,7 +254,6 @@ public class FilesProjectController extends BaseController {
|
321
|
254
|
/**
|
322
|
255
|
* 根据项目编号查询项目信息
|
323
|
256
|
*/
|
324
|
|
- @PreAuthorize("@ss.hasPermi('file:project:query')")
|
325
|
257
|
@GetMapping("/query/{projectNumbers}")
|
326
|
258
|
public AjaxResult getInfoByProjectNumber(@PathVariable String[] projectNumbers){
|
327
|
259
|
return AjaxResult.success(filesProjectService.selectFilesProjectByNumbers(projectNumbers));
|