点位清单-导入导出

This commit is contained in:
2025-11-05 14:58:05 +08:00
parent 3598cb2d66
commit c2682f38a8
9 changed files with 329 additions and 24 deletions

View File

@ -0,0 +1,65 @@
package com.xzzn.web.controller.ems;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xzzn.common.annotation.Log;
import com.xzzn.common.core.controller.BaseController;
import com.xzzn.common.core.domain.AjaxResult;
import com.xzzn.common.enums.BusinessType;
import com.xzzn.ems.domain.EmsPointMatch;
import com.xzzn.ems.service.IEmsPointMatchService;
import com.xzzn.common.utils.poi.ExcelUtil;
import org.springframework.web.multipart.MultipartFile;
/**
* 点位匹配Controller
*
* @author xzzn
* @date 2025-11-04
*/
@RestController
@RequestMapping("/ems/pointMatch")
public class EmsPointMatchController extends BaseController
{
@Autowired
private IEmsPointMatchService emsPointMatchService;
/**
* 导出点位匹配列表
*/
@PreAuthorize("@ss.hasPermi('system:match:export')")
@Log(title = "点位匹配", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EmsPointMatch emsPointMatch)
{
List<EmsPointMatch> list = emsPointMatchService.selectEmsPointMatchList(emsPointMatch);
ExcelUtil<EmsPointMatch> util = new ExcelUtil<EmsPointMatch>(EmsPointMatch.class);
util.exportExcel(response, list, "点位匹配数据");
}
/**
* 上传点位清单
* @param file
* @param updateSupport
* @return
* @throws Exception
*/
@PreAuthorize("@ss.hasPermi('system:user:import')")
@Log(title = "点位匹配", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<EmsPointMatch> util = new ExcelUtil<EmsPointMatch>(EmsPointMatch.class);
List<EmsPointMatch> pointMatcheList = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = emsPointMatchService.importPoint(pointMatcheList, updateSupport, operName);
return success(message);
}
}