art: 设备附件管理,工艺参数,精度参数初始代码添加
| | |
| | | if (fileNameNonSuffix == null) |
| | | return null; |
| | | // è·åæä»¶å å¯åç§° 1 ä¿è¯æä»¶å¯ä¸ ä¸åå¨è¦çé®é¢ 2 ç®å½ä¸ä¿åæä»¶å å¯åç§° å»é¤æä»¶å
³é®ä¿¡æ¯ |
| | | String encodeFileName = SHA256Util.getSHA256Str(fileNameNonSuffix + System.currentTimeMillis()); |
| | | String encodeFileName = SHA256Util.getSHA256Str(fileNameNonSuffix + System.currentTimeMillis()) + "." + suffix; |
| | | Long fileSize = file.getSize(); |
| | | boolean b = uploadFile(file, absolutePath, encodeFileName); |
| | | if (!b) |
| | |
| | | FileUploadResult dto = new FileUploadResult(); |
| | | dto.setFileName(fileNameNonSuffix); |
| | | dto.setFileEncodeName(encodeFileName); |
| | | dto.setFilePath(relativePath); |
| | | dto.setFilePath(relativePath + encodeFileName); |
| | | dto.setFileSize(fileSize); |
| | | dto.setFileSuffix(suffix); |
| | | return dto; |
| | |
| | | public static void deleteFile(String filePath, String fileName) { |
| | | String absolutePath = fileUploadFolder + "/" + filePath + "/"; |
| | | File targetFile = new File(absolutePath, fileName); |
| | | if (null != targetFile && targetFile.isFile()) { |
| | | targetFile.delete(); |
| | | } |
| | | targetFile.deleteOnExit(); |
| | | } |
| | | |
| | | public static void downLoadFile(HttpServletResponse response, String fileName, String filePath, String toFileName) { |
| | |
| | | } |
| | | } |
| | | |
| | | public static void downLoadFile(HttpServletResponse response, String filePath, String toFileName) { |
| | | String absolutePath = fileUploadFolder + filePath; |
| | | File file = new File(absolutePath); |
| | | if (file.exists()) { |
| | | byte[] buffer = new byte[1024]; |
| | | FileInputStream fis = null; |
| | | BufferedInputStream bis = null; |
| | | try { |
| | | response.setHeader("Content-Type", "application/octet-stream;charset=utf-8"); // åè¯æµè§å¨è¾åºå
å®¹ä¸ºæµ |
| | | // response.setHeader("Content-Disposition", "attachment;fileName="+ new |
| | | // String(toFileName.getBytes("UTF-8"),"ISO-8859-1")); |
| | | response.setHeader("Content-Disposition", |
| | | "attachment;fileName=" + URLEncoder.encode(toFileName, "UTF-8")); |
| | | fis = new FileInputStream(file); |
| | | bis = new BufferedInputStream(fis); |
| | | OutputStream os = response.getOutputStream(); |
| | | int i = bis.read(buffer); |
| | | while (i != -1) { |
| | | os.write(buffer, 0, i); |
| | | i = bis.read(buffer); |
| | | } |
| | | os.flush(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (bis != null) { |
| | | try { |
| | | bis.close(); |
| | | } catch (IOException e) { |
| | | } |
| | | } |
| | | if (fis != null) { |
| | | try { |
| | | fis.close(); |
| | | } catch (IOException e) { |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | ExceptionCast.cast("æä»¶ä¸åå¨"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶å·¥å
·ç±» |
| | | * |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.EamPrecisionParameters; |
| | | import org.jeecg.modules.eam.service.IEamPrecisionParametersService; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import com.alibaba.fastjson.JSON; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description: ç²¾åº¦åæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="ç²¾åº¦åæ°ç»´æ¤") |
| | | @RestController |
| | | @RequestMapping("/eam/precisionParameters") |
| | | public class EamPrecisionParametersController extends JeecgController<EamPrecisionParameters, IEamPrecisionParametersService> { |
| | | @Autowired |
| | | private IEamPrecisionParametersService eamPrecisionParametersService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamPrecisionParameters |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç²¾åº¦åæ°ç»´æ¤-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="ç²¾åº¦åæ°ç»´æ¤-å页å表æ¥è¯¢", notes="ç²¾åº¦åæ°ç»´æ¤-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamPrecisionParameters eamPrecisionParameters, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<EamPrecisionParameters> queryWrapper = QueryGenerator.initQueryWrapper(eamPrecisionParameters, req.getParameterMap()); |
| | | Page<EamPrecisionParameters> page = new Page<EamPrecisionParameters>(pageNo, pageSize); |
| | | IPage<EamPrecisionParameters> pageList = eamPrecisionParametersService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param eamPrecisionParameters |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç²¾åº¦åæ°ç»´æ¤-æ·»å ") |
| | | @ApiOperation(value="ç²¾åº¦åæ°ç»´æ¤-æ·»å ", notes="ç²¾åº¦åæ°ç»´æ¤-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamPrecisionParameters eamPrecisionParameters) { |
| | | eamPrecisionParametersService.save(eamPrecisionParameters); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param eamPrecisionParameters |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç²¾åº¦åæ°ç»´æ¤-ç¼è¾") |
| | | @ApiOperation(value="ç²¾åº¦åæ°ç»´æ¤-ç¼è¾", notes="ç²¾åº¦åæ°ç»´æ¤-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamPrecisionParameters eamPrecisionParameters) { |
| | | eamPrecisionParametersService.updateById(eamPrecisionParameters); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç²¾åº¦åæ°ç»´æ¤-éè¿idå é¤") |
| | | @ApiOperation(value="ç²¾åº¦åæ°ç»´æ¤-éè¿idå é¤", notes="ç²¾åº¦åæ°ç»´æ¤-éè¿idå é¤") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
| | | eamPrecisionParametersService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç²¾åº¦åæ°ç»´æ¤-æ¹éå é¤") |
| | | @ApiOperation(value="ç²¾åº¦åæ°ç»´æ¤-æ¹éå é¤", notes="ç²¾åº¦åæ°ç»´æ¤-æ¹éå é¤") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.eamPrecisionParametersService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç²¾åº¦åæ°ç»´æ¤-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="ç²¾åº¦åæ°ç»´æ¤-éè¿idæ¥è¯¢", notes="ç²¾åº¦åæ°ç»´æ¤-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
| | | EamPrecisionParameters eamPrecisionParameters = eamPrecisionParametersService.getById(id); |
| | | return Result.OK(eamPrecisionParameters); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param eamPrecisionParameters |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EamPrecisionParameters eamPrecisionParameters) { |
| | | return super.exportXls(request, eamPrecisionParameters, EamPrecisionParameters.class, "ç²¾åº¦åæ°ç»´æ¤"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, EamPrecisionParameters.class); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.EamProcessParameters; |
| | | import org.jeecg.modules.eam.service.IEamProcessParametersService; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import com.alibaba.fastjson.JSON; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description: å·¥åºåæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="å·¥åºåæ°ç»´æ¤") |
| | | @RestController |
| | | @RequestMapping("/eam/processParameters") |
| | | public class EamProcessParametersController extends JeecgController<EamProcessParameters, IEamProcessParametersService> { |
| | | @Autowired |
| | | private IEamProcessParametersService eamProcessParametersService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamProcessParameters |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å·¥åºåæ°ç»´æ¤-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="å·¥åºåæ°ç»´æ¤-å页å表æ¥è¯¢", notes="å·¥åºåæ°ç»´æ¤-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamProcessParameters eamProcessParameters, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<EamProcessParameters> queryWrapper = QueryGenerator.initQueryWrapper(eamProcessParameters, req.getParameterMap()); |
| | | Page<EamProcessParameters> page = new Page<EamProcessParameters>(pageNo, pageSize); |
| | | IPage<EamProcessParameters> pageList = eamProcessParametersService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param eamProcessParameters |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å·¥åºåæ°ç»´æ¤-æ·»å ") |
| | | @ApiOperation(value="å·¥åºåæ°ç»´æ¤-æ·»å ", notes="å·¥åºåæ°ç»´æ¤-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamProcessParameters eamProcessParameters) { |
| | | eamProcessParametersService.save(eamProcessParameters); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param eamProcessParameters |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å·¥åºåæ°ç»´æ¤-ç¼è¾") |
| | | @ApiOperation(value="å·¥åºåæ°ç»´æ¤-ç¼è¾", notes="å·¥åºåæ°ç»´æ¤-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamProcessParameters eamProcessParameters) { |
| | | eamProcessParametersService.updateById(eamProcessParameters); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å·¥åºåæ°ç»´æ¤-éè¿idå é¤") |
| | | @ApiOperation(value="å·¥åºåæ°ç»´æ¤-éè¿idå é¤", notes="å·¥åºåæ°ç»´æ¤-éè¿idå é¤") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
| | | eamProcessParametersService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å·¥åºåæ°ç»´æ¤-æ¹éå é¤") |
| | | @ApiOperation(value="å·¥åºåæ°ç»´æ¤-æ¹éå é¤", notes="å·¥åºåæ°ç»´æ¤-æ¹éå é¤") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.eamProcessParametersService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å·¥åºåæ°ç»´æ¤-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="å·¥åºåæ°ç»´æ¤-éè¿idæ¥è¯¢", notes="å·¥åºåæ°ç»´æ¤-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
| | | EamProcessParameters eamProcessParameters = eamProcessParametersService.getById(id); |
| | | return Result.OK(eamProcessParameters); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param eamProcessParameters |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EamProcessParameters eamProcessParameters) { |
| | | return super.exportXls(request, eamProcessParameters, EamProcessParameters.class, "å·¥åºåæ°ç»´æ¤"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, EamProcessParameters.class); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.eam.entity.EamSysFiles; |
| | | import org.jeecg.modules.eam.request.EamSysFilesRequest; |
| | | import org.jeecg.modules.eam.service.IEamSysFilesService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤é件管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "设å¤é件管ç") |
| | | @RestController |
| | | @RequestMapping("/eam/sysFiles") |
| | | public class EamSysFilesController extends JeecgController<EamSysFiles, IEamSysFilesService> { |
| | | @Autowired |
| | | private IEamSysFilesService eamSysFilesService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamSysFiles |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤é件管ç-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "设å¤é件管ç-å页å表æ¥è¯¢", notes = "设å¤é件管ç-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamSysFiles eamSysFiles, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<EamSysFiles> queryWrapper = QueryGenerator.initQueryWrapper(eamSysFiles, req.getParameterMap()); |
| | | queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | Page<EamSysFiles> page = new Page<EamSysFiles>(pageNo, pageSize); |
| | | IPage<EamSysFiles> pageList = eamSysFilesService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤é件管ç-æ·»å ") |
| | | @ApiOperation(value = "设å¤é件管ç-æ·»å ", notes = "设å¤é件管ç-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamSysFilesRequest request) { |
| | | boolean b = eamSysFilesService.saveEamSysFiles(request); |
| | | if(!b) { |
| | | return Result.OK("æä½å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param eamSysFiles |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤é件管ç-ç¼è¾") |
| | | @ApiOperation(value = "设å¤é件管ç-ç¼è¾", notes = "设å¤é件管ç-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamSysFiles eamSysFiles) { |
| | | eamSysFilesService.updateById(eamSysFiles); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤é件管ç-éè¿idå é¤") |
| | | @ApiOperation(value = "设å¤é件管ç-éè¿idå é¤", notes = "设å¤é件管ç-éè¿idå é¤") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
| | | EamSysFiles entity = eamSysFilesService.getById(id); |
| | | if(entity != null) { |
| | | entity.setDelFlag(CommonConstant.DEL_FLAG_1); |
| | | eamSysFilesService.updateById(entity); |
| | | } |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤é件管ç-æ¹éå é¤") |
| | | @ApiOperation(value = "设å¤é件管ç-æ¹éå é¤", notes = "设å¤é件管ç-æ¹éå é¤") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | list.forEach(id -> { |
| | | EamSysFiles entity = eamSysFilesService.getById(id); |
| | | if(entity != null) { |
| | | entity.setDelFlag(CommonConstant.DEL_FLAG_1); |
| | | eamSysFilesService.updateById(entity); |
| | | } |
| | | }); |
| | | return Result.OK("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤é件管ç-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "设å¤é件管ç-éè¿idæ¥è¯¢", notes = "设å¤é件管ç-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | EamSysFiles eamSysFiles = eamSysFilesService.getById(id); |
| | | return Result.OK(eamSysFiles); |
| | | } |
| | | |
| | | @PostMapping("/upload") |
| | | public Result<?> uploadFile(HttpServletRequest request, HttpServletResponse response) { |
| | | // è½¬æ¢æå¤é¨årequest |
| | | MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile files = multiRequest.getFile("file"); |
| | | try { |
| | | FileUploadResult sysUpload = eamSysFilesService.uploadFile(files); |
| | | if(sysUpload == null) { |
| | | return Result.error("æä½å¤±è´¥: ä¸ä¼ ç»æä¸ºç©ºï¼"); |
| | | } |
| | | return Result.ok(sysUpload); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | return Result.error("æä½å¤±è´¥:" + e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @GetMapping("/downloadFile") |
| | | public void downloadFile(@RequestParam("id") String id, HttpServletResponse response) { |
| | | eamSysFilesService.downloadFile(response, eamSysFilesService.getById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | /** |
| | | * @Description: ç²¾åº¦åæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("eam_precision_parameters") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="eam_precision_parameters对象", description="ç²¾åº¦åæ°ç»´æ¤") |
| | | public class EamPrecisionParameters implements Serializable { |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /**å建人*/ |
| | | @Excel(name = "å建人", width = 15) |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @Excel(name = "æ´æ°äºº", width = 15) |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¶é´*/ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | /**å 餿 è®°*/ |
| | | @Excel(name = "å 餿 è®°", width = 15) |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | private Integer delFlag; |
| | | /**åæ°ç¼ç */ |
| | | @Excel(name = "åæ°ç¼ç ", width = 15) |
| | | @ApiModelProperty(value = "åæ°ç¼ç ") |
| | | private String parameterCode; |
| | | /**æ£æµé¡¹ç®*/ |
| | | @Excel(name = "æ£æµé¡¹ç®", width = 15) |
| | | @ApiModelProperty(value = "æ£æµé¡¹ç®") |
| | | private String parameterName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | /** |
| | | * @Description: å·¥åºåæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("eam_process_parameters") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="eam_process_parameters对象", description="å·¥åºåæ°ç»´æ¤") |
| | | public class EamProcessParameters implements Serializable { |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /**å建人*/ |
| | | @Excel(name = "å建人", width = 15) |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @Excel(name = "æ´æ°äºº", width = 15) |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¶é´*/ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | /**å 餿 è®°*/ |
| | | @Excel(name = "å 餿 è®°", width = 15) |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | private Integer delFlag; |
| | | /**åæ°ç¼ç */ |
| | | @Excel(name = "åæ°ç¼ç ", width = 15) |
| | | @ApiModelProperty(value = "åæ°ç¼ç ") |
| | | private String parameterCode; |
| | | /**åæ°åç§°*/ |
| | | @Excel(name = "åæ°åç§°", width = 15) |
| | | @ApiModelProperty(value = "åæ°åç§°") |
| | | private String parameterName; |
| | | /**åæ°åç±»*/ |
| | | @Excel(name = "åæ°åç±»", width = 15) |
| | | @ApiModelProperty(value = "åæ°åç±»") |
| | | private String parameterCategory; |
| | | /**计éåä½*/ |
| | | @Excel(name = "计éåä½", width = 15) |
| | | @ApiModelProperty(value = "计éåä½") |
| | | private String parameterUnit; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | /** |
| | | * @Description: 设å¤é件管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("eam_sys_files") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="eam_sys_files对象", description="设å¤é件管ç") |
| | | public class EamSysFiles implements Serializable { |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /**å建人*/ |
| | | @Excel(name = "å建人", width = 15) |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @Excel(name = "æ´æ°äºº", width = 15) |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¶é´*/ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | /**å 餿 è®°*/ |
| | | @Excel(name = "å 餿 è®°", width = 15) |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | private Integer delFlag; |
| | | /**æä»¶å å¯å*/ |
| | | @Excel(name = "æä»¶å å¯å", width = 15) |
| | | @ApiModelProperty(value = "æä»¶å å¯å") |
| | | private String fileEncodeName; |
| | | /**æä»¶åå§åç§°*/ |
| | | @Excel(name = "æä»¶åå§åç§°", width = 15) |
| | | @ApiModelProperty(value = "æä»¶åå§åç§°") |
| | | private String fileName; |
| | | /**æä»¶ä¿åè·¯å¾*/ |
| | | @Excel(name = "æä»¶ä¿åè·¯å¾", width = 15) |
| | | @ApiModelProperty(value = "æä»¶ä¿åè·¯å¾") |
| | | private String filePath; |
| | | /**æä»¶åç¼å*/ |
| | | @Excel(name = "æä»¶åç¼å", width = 15) |
| | | @ApiModelProperty(value = "æä»¶åç¼å") |
| | | private String fileSuffix; |
| | | /**æä»¶å¤§å°*/ |
| | | @Excel(name = "æä»¶å¤§å°", width = 15) |
| | | @ApiModelProperty(value = "æä»¶å¤§å°") |
| | | private Long fileSize; |
| | | /**æè¿°*/ |
| | | @Excel(name = "æè¿°", width = 15) |
| | | @ApiModelProperty(value = "æè¿°") |
| | | private String description; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.EamPrecisionParameters; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @Description: ç²¾åº¦åæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EamPrecisionParametersMapper extends BaseMapper<EamPrecisionParameters> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.EamProcessParameters; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @Description: å·¥åºåæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EamProcessParametersMapper extends BaseMapper<EamProcessParameters> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.eam.entity.EamSysFiles; |
| | | |
| | | /** |
| | | * @Description: 设å¤é件管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EamSysFilesMapper extends BaseMapper<EamSysFiles> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.EamPrecisionParametersMapper"> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.EamProcessParametersMapper"> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.EamSysFilesMapper"> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.request; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤é件管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="请æ±å¯¹è±¡", description="设å¤é件管ç") |
| | | public class EamSysFilesRequest implements Serializable { |
| | | /**æè¿°*/ |
| | | @ApiModelProperty(value = "æè¿°") |
| | | private String description; |
| | | /**ä¸ä¼ æä»¶å¯¹ç³»*/ |
| | | @ApiModelProperty(value = "ä¸ä¼ æä»¶å¯¹ç³»") |
| | | private List<FileUploadResult> fileList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import org.jeecg.modules.eam.entity.EamPrecisionParameters; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * @Description: ç²¾åº¦åæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEamPrecisionParametersService extends IService<EamPrecisionParameters> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import org.jeecg.modules.eam.entity.EamProcessParameters; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * @Description: å·¥åºåæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEamProcessParametersService extends IService<EamProcessParameters> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecg.common.system.base.entity.SysUpload; |
| | | import org.jeecg.modules.eam.entity.EamSysFiles; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.request.EamSysFilesRequest; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤é件管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEamSysFilesService extends IService<EamSysFiles> { |
| | | |
| | | /** |
| | | * ä¸è½½æä»¶ |
| | | * @param response |
| | | * @param byId |
| | | */ |
| | | void downloadFile(HttpServletResponse response, EamSysFiles byId); |
| | | |
| | | /** |
| | | * ä¸ä¼ éä»¶ |
| | | * @param file |
| | | * @return |
| | | */ |
| | | FileUploadResult uploadFile(MultipartFile file); |
| | | |
| | | /** |
| | | * æ¹éæ·»å 设å¤éä»¶ |
| | | * @param request |
| | | */ |
| | | boolean saveEamSysFiles(EamSysFilesRequest request); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import org.jeecg.modules.eam.entity.EamPrecisionParameters; |
| | | import org.jeecg.modules.eam.mapper.EamPrecisionParametersMapper; |
| | | import org.jeecg.modules.eam.service.IEamPrecisionParametersService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | /** |
| | | * @Description: ç²¾åº¦åæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EamPrecisionParametersServiceImpl extends ServiceImpl<EamPrecisionParametersMapper, EamPrecisionParameters> implements IEamPrecisionParametersService { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import org.jeecg.modules.eam.entity.EamProcessParameters; |
| | | import org.jeecg.modules.eam.mapper.EamProcessParametersMapper; |
| | | import org.jeecg.modules.eam.service.IEamProcessParametersService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | /** |
| | | * @Description: å·¥åºåæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EamProcessParametersServiceImpl extends ServiceImpl<EamProcessParametersMapper, EamProcessParameters> implements IEamProcessParametersService { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.util.FileUtil; |
| | | import org.jeecg.modules.eam.entity.EamSysFiles; |
| | | import org.jeecg.modules.eam.mapper.EamSysFilesMapper; |
| | | import org.jeecg.modules.eam.request.EamSysFilesRequest; |
| | | import org.jeecg.modules.eam.service.IEamSysFilesService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤é件管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EamSysFilesServiceImpl extends ServiceImpl<EamSysFilesMapper, EamSysFiles> implements IEamSysFilesService { |
| | | |
| | | @Override |
| | | public void downloadFile(HttpServletResponse response, EamSysFiles entity) { |
| | | FileUtil.downLoadFile(response, entity.getFilePath(), entity.getFileName()); |
| | | } |
| | | |
| | | @Override |
| | | public FileUploadResult uploadFile(MultipartFile file) { |
| | | return FileUtil.uploadFile(file); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveEamSysFiles(EamSysFilesRequest request) { |
| | | if(request == null || CollectionUtil.isEmpty(request.getFileList())){ |
| | | return false; |
| | | } |
| | | List<EamSysFiles> resultList = new ArrayList<>(); |
| | | for (FileUploadResult fileUploadResult : request.getFileList()) { |
| | | EamSysFiles eamSysFiles = new EamSysFiles(); |
| | | eamSysFiles.setFilePath(fileUploadResult.getFilePath()); |
| | | eamSysFiles.setFileName(fileUploadResult.getFileName()); |
| | | eamSysFiles.setFileEncodeName(fileUploadResult.getFileEncodeName()); |
| | | eamSysFiles.setFileSize(fileUploadResult.getFileSize()); |
| | | eamSysFiles.setFileSuffix(fileUploadResult.getFileSuffix()); |
| | | eamSysFiles.setDescription(request.getDescription()); |
| | | eamSysFiles.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | resultList.add(eamSysFiles); |
| | | } |
| | | return this.saveBatch(resultList); |
| | | } |
| | | } |
| | |
| | | <artifactId>lxzn-module-msi</artifactId> |
| | | <version>${jeecgboot.version}</version> |
| | | </dependency> |
| | | <!--EAM 模å--> |
| | | <dependency> |
| | | <groupId>org.jeecgframework.boot</groupId> |
| | | <artifactId>lxzn-module-eam</artifactId> |
| | | <version>${jeecgboot.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |