|
@@ -1,41 +1,32 @@
|
|
package com.songhua.web.controller.system;
|
|
package com.songhua.web.controller.system;
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
-
|
|
|
|
-import com.songhua.common.core.domain.entity.SysUser;
|
|
|
|
-import com.songhua.system.domain.PzRawDataVo;
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import com.songhua.common.annotation.Log;
|
|
import com.songhua.common.annotation.Log;
|
|
import com.songhua.common.core.controller.BaseController;
|
|
import com.songhua.common.core.controller.BaseController;
|
|
import com.songhua.common.core.domain.AjaxResult;
|
|
import com.songhua.common.core.domain.AjaxResult;
|
|
|
|
+import com.songhua.common.core.page.TableDataInfo;
|
|
import com.songhua.common.enums.BusinessType;
|
|
import com.songhua.common.enums.BusinessType;
|
|
|
|
+import com.songhua.common.utils.poi.ExcelUtil;
|
|
import com.songhua.system.domain.PzRawData;
|
|
import com.songhua.system.domain.PzRawData;
|
|
|
|
+import com.songhua.system.domain.PzRawDataVo;
|
|
import com.songhua.system.service.IPzRawDataService;
|
|
import com.songhua.system.service.IPzRawDataService;
|
|
-import com.songhua.common.utils.poi.ExcelUtil;
|
|
|
|
-import com.songhua.common.core.page.TableDataInfo;
|
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 原始数据导入Controller
|
|
* 原始数据导入Controller
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @author ruoyi
|
|
* @author ruoyi
|
|
* @date 2024-11-04
|
|
* @date 2024-11-04
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/system/data")
|
|
@RequestMapping("/system/data")
|
|
-public class PzRawDataController extends BaseController
|
|
|
|
-{
|
|
|
|
|
|
+public class PzRawDataController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private IPzRawDataService pzRawDataService;
|
|
private IPzRawDataService pzRawDataService;
|
|
|
|
|
|
@@ -44,8 +35,7 @@ public class PzRawDataController extends BaseController
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:data:list')")
|
|
@PreAuthorize("@ss.hasPermi('system:data:list')")
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
- public TableDataInfo list(PzRawData pzRawData)
|
|
|
|
- {
|
|
|
|
|
|
+ public TableDataInfo list(PzRawData pzRawData) {
|
|
startPage();
|
|
startPage();
|
|
List<PzRawDataVo> list = pzRawDataService.selectPzRawDataList(pzRawData);
|
|
List<PzRawDataVo> list = pzRawDataService.selectPzRawDataList(pzRawData);
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
@@ -56,8 +46,7 @@ public class PzRawDataController extends BaseController
|
|
* 导入原始数据列表
|
|
* 导入原始数据列表
|
|
*/
|
|
*/
|
|
@PostMapping("/importData")
|
|
@PostMapping("/importData")
|
|
- public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
|
ExcelUtil<PzRawDataVo> util = new ExcelUtil<PzRawDataVo>(PzRawDataVo.class);
|
|
ExcelUtil<PzRawDataVo> util = new ExcelUtil<PzRawDataVo>(PzRawDataVo.class);
|
|
List<PzRawDataVo> userList = util.importExcel(file.getInputStream());
|
|
List<PzRawDataVo> userList = util.importExcel(file.getInputStream());
|
|
String operName = getUsername();
|
|
String operName = getUsername();
|
|
@@ -70,7 +59,7 @@ public class PzRawDataController extends BaseController
|
|
*/
|
|
*/
|
|
@ApiOperation(value = "导入模板", notes = "导入模板")
|
|
@ApiOperation(value = "导入模板", notes = "导入模板")
|
|
@PostMapping("/importTemplate")
|
|
@PostMapping("/importTemplate")
|
|
- public void importTemplate(HttpServletResponse response){
|
|
|
|
|
|
+ public void importTemplate(HttpServletResponse response) {
|
|
ExcelUtil<PzRawData> util = new ExcelUtil<>(PzRawData.class);
|
|
ExcelUtil<PzRawData> util = new ExcelUtil<>(PzRawData.class);
|
|
util.importTemplateExcel(response, "票务原始数据");
|
|
util.importTemplateExcel(response, "票务原始数据");
|
|
}
|
|
}
|
|
@@ -80,8 +69,7 @@ public class PzRawDataController extends BaseController
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:data:query')")
|
|
@PreAuthorize("@ss.hasPermi('system:data:query')")
|
|
@GetMapping(value = "/{id}")
|
|
@GetMapping(value = "/{id}")
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
return success(pzRawDataService.selectPzRawDataById(id));
|
|
return success(pzRawDataService.selectPzRawDataById(id));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -91,8 +79,7 @@ public class PzRawDataController extends BaseController
|
|
@PreAuthorize("@ss.hasPermi('system:data:add')")
|
|
@PreAuthorize("@ss.hasPermi('system:data:add')")
|
|
@Log(title = "原始数据导入", businessType = BusinessType.INSERT)
|
|
@Log(title = "原始数据导入", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
@PostMapping
|
|
- public AjaxResult add(@RequestBody PzRawData pzRawData)
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult add(@RequestBody PzRawData pzRawData) {
|
|
return toAjax(pzRawDataService.insertPzRawData(pzRawData));
|
|
return toAjax(pzRawDataService.insertPzRawData(pzRawData));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -102,8 +89,7 @@ public class PzRawDataController extends BaseController
|
|
@PreAuthorize("@ss.hasPermi('system:data:edit')")
|
|
@PreAuthorize("@ss.hasPermi('system:data:edit')")
|
|
@Log(title = "原始数据导入", businessType = BusinessType.UPDATE)
|
|
@Log(title = "原始数据导入", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
@PutMapping
|
|
- public AjaxResult edit(@RequestBody PzRawData pzRawData)
|
|
|
|
- {
|
|
|
|
|
|
+ public AjaxResult edit(@RequestBody PzRawData pzRawData) {
|
|
return toAjax(pzRawDataService.updatePzRawData(pzRawData));
|
|
return toAjax(pzRawDataService.updatePzRawData(pzRawData));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -112,10 +98,19 @@ public class PzRawDataController extends BaseController
|
|
*/
|
|
*/
|
|
@PreAuthorize("@ss.hasPermi('system:data:remove')")
|
|
@PreAuthorize("@ss.hasPermi('system:data:remove')")
|
|
@Log(title = "原始数据导入", businessType = BusinessType.DELETE)
|
|
@Log(title = "原始数据导入", businessType = BusinessType.DELETE)
|
|
- @DeleteMapping("/{ids}")
|
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
|
- {
|
|
|
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
return toAjax(pzRawDataService.deletePzRawDataByIds(ids));
|
|
return toAjax(pzRawDataService.deletePzRawDataByIds(ids));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出原始数据导入列表
|
|
|
|
+ */
|
|
|
|
+ @Log(title = "导出原始数据导入列表", businessType = BusinessType.EXPORT)
|
|
|
|
+ @GetMapping("/export")
|
|
|
|
+ public AjaxResult export(PzRawData pzRawData) {
|
|
|
|
+ pzRawDataService.export(pzRawData);
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
+ }
|
|
}
|
|
}
|