diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxListController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxListController.java index 76babb51b..35cba9c8e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxListController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxListController.java @@ -215,7 +215,11 @@ public class OtaBaCxListController extends JeroController { - @Autowired - private IOtaBaCxLsjlService otaBaCxLsjlService; - - /** - * 分页列表查询 - * - * @param otaBaCxLsjl - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @AutoLog(value = "车型备案-历史记录-分页列表查询") - @ApiOperation(value="车型备案-历史记录-分页列表查询", notes="车型备案-历史记录-分页列表查询") - @GetMapping(value = "/page") - public Result queryPageList(OtaBaCxLsjl otaBaCxLsjl, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxLsjl, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = otaBaCxLsjlService.page(page, queryWrapper); - return Result.OK(pageList); - } + @Autowired + private IOtaBaCxLsjlService otaBaCxLsjlService; /** - * 列表查询 - * - * @return - */ - @AutoLog(value = "车型备案-历史记录-列表查询") - @ApiOperation(value="车型备案-历史记录-列表查询", notes="车型备案-历史记录-列表查询") - @GetMapping(value = "/list") - public Result> queryList() { - List list = otaBaCxLsjlService.queryList(); + * 分页列表查询 + * + * @param otaBaCxLsjl + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "车型备案-历史记录-分页列表查询") + @ApiOperation(value = "车型备案-历史记录-分页列表查询", notes = "车型备案-历史记录-分页列表查询") + @GetMapping(value = "/page") + public Result queryPageList(OtaBaCxLsjl otaBaCxLsjl, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxLsjl, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); + Page page = new Page(pageNo, pageSize); + IPage pageList = otaBaCxLsjlService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "车型备案-历史记录-列表查询") + @ApiOperation(value = "车型备案-历史记录-列表查询", notes = "车型备案-历史记录-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List list = otaBaCxLsjlService.list(); return Result.OK(list); - } - - /** - * 添加 - * - * @param otaBaCxLsjl - * @return - */ - @AutoLog(value = "车型备案-历史记录-添加") - @ApiOperation(value="车型备案-历史记录-添加", notes="车型备案-历史记录-添加") - @PostMapping(value = "/add") - public Result add(@Validated @RequestBody OtaBaCxLsjl otaBaCxLsjl) { - otaBaCxLsjlService.add(otaBaCxLsjl); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param otaBaCxLsjl - * @return - */ - @AutoLog(value = "车型备案-历史记录-编辑") - @ApiOperation(value="车型备案-历史记录-编辑", notes="车型备案-历史记录-编辑") - @PutMapping(value = "/edit") - public Result edit(@Validated @RequestBody OtaBaCxLsjl otaBaCxLsjl) { - otaBaCxLsjlService.editById(otaBaCxLsjl); - 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) { - otaBaCxLsjlService.deleteById(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.otaBaCxLsjlService.deleteByIds(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) { - OtaBaCxLsjl otaBaCxLsjl = otaBaCxLsjlService.queryById(id); - if(otaBaCxLsjl==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(otaBaCxLsjl); - } - - /** - * 通过otaId查询 - * - * @param otaId - * @return - */ - @AutoLog(value = "车型备案-历史记录-通过otaId查询") - @ApiOperation(value="车型备案-历史记录-通过otaId查询", notes="车型备案-历史记录-通过otaId查询") - @GetMapping(value = "/queryByOtaId") - public Result queryByOtaId(@RequestParam(name="otaId",required=true) String otaId) { - List otaBaCxLsjlList = otaBaCxLsjlService.queryByOtaId(otaId); - if(otaBaCxLsjlList==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(otaBaCxLsjlList); - } + } /** - * 导出excel - * - * @param request - * @param otaBaCxLsjl - */ + * 添加 + * + * @param otaBaCxLsjl + * @return + */ + @AutoLog(value = "车型备案-历史记录-添加") + @ApiOperation(value = "车型备案-历史记录-添加", notes = "车型备案-历史记录-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody OtaBaCxLsjl otaBaCxLsjl) { + otaBaCxLsjlService.add(otaBaCxLsjl); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param otaBaCxLsjl + * @return + */ + @AutoLog(value = "车型备案-历史记录-编辑") + @ApiOperation(value = "车型备案-历史记录-编辑", notes = "车型备案-历史记录-编辑") + @PutMapping(value = "/edit") + public Result edit(@Validated @RequestBody OtaBaCxLsjl otaBaCxLsjl) { + otaBaCxLsjlService.editById(otaBaCxLsjl); + 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) { + otaBaCxLsjlService.deleteById(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.otaBaCxLsjlService.deleteByIds(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) { + OtaBaCxLsjl otaBaCxLsjl = otaBaCxLsjlService.queryById(id); + if (otaBaCxLsjl == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(otaBaCxLsjl); + } + + /** + * 通过otaId查询 + * + * @param otaId + * @return + */ + @AutoLog(value = "车型备案-历史记录-通过otaId查询") + @ApiOperation(value = "车型备案-历史记录-通过otaId查询", notes = "车型备案-历史记录-通过otaId查询") + @GetMapping(value = "/queryByOtaId") + public Result queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId) { + List otaBaCxLsjlList = otaBaCxLsjlService.queryByOtaId(otaId); + if (otaBaCxLsjlList == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(otaBaCxLsjlList); + } + + /** + * 导出excel + * + * @param request + * @param otaBaCxLsjl + */ @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, OtaBaCxLsjl otaBaCxLsjl) { return super.exportXls(request, otaBaCxLsjl, OtaBaCxLsjl.class, "车型备案-历史记录"); } /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, OtaBaCxLsjl.class); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxTxjlController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxTxjlController.java index 39a914252..0f395f100 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxTxjlController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxTxjlController.java @@ -53,6 +53,7 @@ public class OtaBaCxTxjlController extends JeroController queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxTxjl, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); Page page = new Page(pageNo, pageSize); IPage pageList = otaBaCxTxjlService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java index b46297dca..c35f95389 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java @@ -54,6 +54,7 @@ public class OtaBaSjListController extends JeroController queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); Page page = new Page(pageNo, pageSize); IPage pageList = otaBaSjListService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjLsjlController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjLsjlController.java index a4f8a0dbc..e8d5cf35b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjLsjlController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjLsjlController.java @@ -53,6 +53,7 @@ public class OtaBaSjLsjlController extends JeroController queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjLsjl, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); Page page = new Page(pageNo, pageSize); IPage pageList = otaBaSjLsjlService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxAqcsService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxAqcsService.java index 10614ff9d..30fbd0593 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxAqcsService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxAqcsService.java @@ -71,4 +71,6 @@ public interface IOtaBaCxAqcsService extends IService { OtaBaCxAqcs importData(MultipartFile file, String otaId, String cut) throws Exception; OtaBaCxAqcs parseFileList(List upLoadFiles, String otaId, String cut) throws Exception; + + void exportData(File file, File attFile, String otaId, String cut) throws Exception; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxJbxxService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxJbxxService.java index 4920bce97..edaeaa803 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxJbxxService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxJbxxService.java @@ -71,4 +71,6 @@ public interface IOtaBaCxJbxxService extends IService { OtaBaCxJbxx importData(MultipartFile file, String otaId, String cut) throws Exception; OtaBaCxJbxx parseFileList(List upLoadFiles, String otaId, String cut) throws Exception; + + void exportData(File file, String otaId, String cut) throws Exception; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxJsfzbacsService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxJsfzbacsService.java index eae2540f8..96b487e1f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxJsfzbacsService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxJsfzbacsService.java @@ -71,4 +71,6 @@ public interface IOtaBaCxJsfzbacsService extends IService { void importData(MultipartFile file, String otaId, String cut) throws Exception; void parseFileList(List upLoadFiles, String otaId, String cut) throws Exception; + + void exportData(File file, String otaId, String cut) throws Exception; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxKsjjsmccsService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxKsjjsmccsService.java index 414f5cfad..b38a10abb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxKsjjsmccsService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxKsjjsmccsService.java @@ -71,4 +71,6 @@ public interface IOtaBaCxKsjjsmccsService extends IService { void importData(MultipartFile file, String otaId, String cut) throws Exception; void parseFileList(List upLoadFiles, String otaId, String cut) throws Exception; + + void exportData(File file, File attFile, String otaId, String cut) throws Exception; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxKsjxtmccsService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxKsjxtmccsService.java index 8fda6c543..3a5133cd0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxKsjxtmccsService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxKsjxtmccsService.java @@ -71,4 +71,6 @@ public interface IOtaBaCxKsjxtmccsService extends IService { void importData(MultipartFile file, String otaId, String cut) throws Exception; void parseFileList(List upLoadFiles, String otaId, String cut) throws Exception; + + void exportData(File file, File attFile, String otaId, String cut) throws Exception; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxListService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxListService.java index 1e87985e8..2d6663673 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxListService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxListService.java @@ -11,65 +11,65 @@ import java.util.List; /** * @Description: 车型及功能备案列表 * @Author: jero-boot - * @Date: 2023-03-17 + * @Date: 2023-03-17 * @Version: V1.0 */ public interface IOtaBaCxListService extends IService { - /** - * 保存 - * - * @param otaBaCxList - * @return - */ + /** + * 保存 + * + * @param otaBaCxList + * @return + */ void add(OtaBaCxList otaBaCxList); - /** - * 更新 - * - * @param otaBaCxList - * @return - */ + /** + * 更新 + * + * @param otaBaCxList + * @return + */ void editById(OtaBaCxList otaBaCxList); - /** - * 通过id删除 - * - * @param id - * @return - */ + /** + * 通过id删除 + * + * @param id + * @return + */ void deleteById(String id); - /** - * 批量删除 - * - * @param ids - * @return - */ + /** + * 批量删除 + * + * @param ids + * @return + */ void deleteByIds(List ids); - /** - * 通过id查询 - * - * @param id - * @return - */ + /** + * 通过id查询 + * + * @param id + * @return + */ OtaBaCxList queryById(String id); /** - * 列表查询 - */ + * 列表查询 + */ List queryList(); - /** - * 备案维护 - */ - void batchRecord(String ids, String bazt, String batjsj, String bz, String cut); + /** + * 备案维护 + */ + void batchRecord(String ids, String bazt, String batjsj, String bz, String cut); void exportTemplate(HttpServletResponse response, HttpServletRequest request); void importData(MultipartFile file, String cut) throws Exception; - void exportData(String otaId, HttpServletResponse response, HttpServletRequest request); + void exportData(String otaId, HttpServletResponse response, HttpServletRequest request) throws Exception; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxZxsjyqService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxZxsjyqService.java index e049a150e..f8e6cb910 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxZxsjyqService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxZxsjyqService.java @@ -72,4 +72,6 @@ public interface IOtaBaCxZxsjyqService extends IService { OtaBaCxZxsjyq importData(MultipartFile file, String otaId, String cut) throws Exception; OtaBaCxZxsjyq parseFileList(List upLoadFiles, String otaId, String cut) throws Exception; + + void exportData(File file, File attFile,String otaId, String cut) throws Exception; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxAqcsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxAqcsServiceImpl.java index 832a0a33a..1cdd57027 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxAqcsServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxAqcsServiceImpl.java @@ -3,6 +3,7 @@ package com.jero.modules.ota.service.impl; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.jero.common.exception.JeroBootException; +import com.jero.common.util.oss.CosBootUtil; import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.service.IOSSFileService; import com.jero.modules.ota.entity.*; @@ -24,6 +25,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.io.File; +import java.io.InputStream; import java.util.List; import java.util.Date; @@ -86,7 +88,7 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl reList = cu.comparisonRecord(otaBaCxAqcsOld.getOtaId(), OtaModuleEnum.CX_AQCS, otaBaCxAqcsOld, otaBaCxAqcs, sysDictService); + List reList = cu.comparisonRecord(otaBaCxAqcs.getOtaId(), OtaModuleEnum.CX_AQCS, otaBaCxAqcsOld, otaBaCxAqcs, sysDictService); otaBaCxTxjlService.saveBatch(reList); } } @@ -233,4 +235,49 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl attList = JSONArray.parseArray(attStr, AttachmentEO.class); + if (ObjectUtils.isNotEmpty(attList)) { + for (AttachmentEO aeo : attList) { + List ossFileList = ossFileService.getFileInfos(aeo.getId()); + for (OSSFile ossFile : ossFileList) { + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (b) { + InputStream download = CosBootUtil.download(filePath); + ImportFileUtil.writeToLocal(attFile.getCanonicalPath() + "/" + ossFile.getFileName(), download); + sb.append(ossFile.getFileName()).append(","); + } + } + } + } + cell.setCellValue(sb.toString()); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJbxxServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJbxxServiceImpl.java index 28562bfea..282f53525 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJbxxServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxJbxxServiceImpl.java @@ -236,5 +236,48 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl upLoadFiles, String otaId, String cut) throws Exception { File upFile = null; @@ -326,7 +327,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl sjmkList = OtaBaCxSjmkService.queryByOtaId(otaId); + int startRow = 63; + for (OtaBaCxSjmk sjmk : sjmkList) { + row = s.getRow(startRow); + cell = row.createCell(0); + cell.setCellValue(sjmk.getBjmc()); + cell = row.createCell(1); + cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(sjmk.getPzqk())); + cell = row.createCell(2); + cell.setCellValue(sjmk.getKzqmc()); + cell = row.createCell(3); + cell.setCellValue(sjmk.getYjggxh()); + cell = row.createCell(4); + cell.setCellValue(sjmk.getYjscqy()); + cell = row.createCell(5); + cell.setCellValue(sjmk.getRjbb()); + cell = row.createCell(6); + cell.setCellValue(sjmk.getRjkfqy()); + cell = row.createCell(7); + cell.setCellValue(sjmk.getBzwz()); + startRow++; + } + + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjjsmccsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjjsmccsServiceImpl.java index bf494f628..9c3d2722e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjjsmccsServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjjsmccsServiceImpl.java @@ -5,6 +5,9 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.jero.common.exception.JeroBootException; +import com.jero.common.util.oss.CosBootUtil; +import com.jero.modules.oss.entity.OSSFile; +import com.jero.modules.oss.service.IOSSFileService; import com.jero.modules.ota.entity.*; import com.jero.modules.ota.enums.OtaModuleEnum; import com.jero.modules.ota.enums.OtaTitleEnum; @@ -26,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.io.File; +import java.io.InputStream; import java.lang.reflect.Field; import java.util.*; @@ -60,6 +64,9 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl oldList = getByOtaId(otaId); - List mccsList = parseFile(upFile, otaId, cut); + List mccsList = parseFile(upFile, attFile, otaId, cut); ComparisonUtil cu = new ComparisonUtil(); List reList = cu.comparisonListRecord(otaId, OtaModuleEnum.CX_KZXSJDJSFZGNMCYCS, OtaTitleEnum.GNMC.getName(), oldList, mccsList, sysDictService); deleteByOtaId(otaId); @@ -238,7 +245,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl parseFile(File upFile, String otaId, String cut) throws Exception { + private List parseFile(File upFile, File attFile, String otaId, String cut) throws Exception { Date now = new Date(); List mccsList = new ArrayList<>(); Workbook wb = ImportFileUtil.readExcel(upFile); @@ -253,7 +260,10 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl mccsList = this.getByOtaId(otaId); + Workbook wb = ImportFileUtil.readExcel(file); + Sheet s = wb.getSheetAt(0); + int startRow = 3; + for (OtaBaCxKsjjsmccs mccs : mccsList) { + Row row = s.getRow(startRow); + Cell cell = row.createCell(0); + cell.setCellValue(mccs.getGnmc()); + cell = row.createCell(1); + cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(mccs.getPzqk())); + cell = row.createCell(2); + cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(mccs.getSfksj())); + cell = row.createCell(3); + cell.setCellValue(mccs.getJszdhjb()); + cell = row.createCell(4); + cell.setCellValue(mccs.getSjggcs()); + cell = row.createCell(5); + cell.setCellValue(mccs.getGnms()); + cell = row.createCell(6); + cell.setCellValue(mccs.getSytj()); + cell = row.createCell(7); + cell.setCellValue(mccs.getKzqmc()); + cell = row.createCell(8); + cell.setCellValue(mccs.getKzqscqy()); + cell = row.createCell(9); + cell.setCellValue(mccs.getKzqxh()); + cell = row.createCell(10); + cell.setCellValue(mccs.getYjbbxx()); + cell = row.createCell(11); + cell.setCellValue(mccs.getRjkfqy()); + cell = row.createCell(12); + cell.setCellValue(mccs.getCzxtbbh()); + cell = row.createCell(13); + cell.setCellValue(mccs.getCsyzsj()); + } + Row row = s.getRow(startRow); + Cell cell = row.createCell(0); + cell.setCellValue("证明材料"); + cell = row.getCell(1); + OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId); + if (ObjectUtils.isNotEmpty(otaBaCxList)) { + StringBuilder sb = new StringBuilder(); + String fj = otaBaCxList.getZxsjjsfj(); + if (StringUtils.isNotEmpty(fj)) { + String[] strs = fj.split(","); + for (String str : strs) { + List ossFileList = ossFileService.getFileInfos(str); + for (OSSFile ossFile : ossFileList) { + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (b) { + InputStream download = CosBootUtil.download(filePath); + ImportFileUtil.writeToLocal(attFile.getCanonicalPath() + "/" + ossFile.getFileName(), download); + sb.append(ossFile.getFileName()).append(","); + } + } + } + cell.setCellValue(sb.toString()); + } + } + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjxtmccsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjxtmccsServiceImpl.java index 518cca7f6..f4f3d2c04 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjxtmccsServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxKsjxtmccsServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.jero.common.exception.JeroBootException; +import com.jero.common.util.oss.CosBootUtil; import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.service.IOSSFileService; import com.jero.modules.ota.entity.*; @@ -28,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.io.File; +import java.io.InputStream; import java.lang.reflect.Field; import java.util.*; @@ -254,6 +256,8 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl mccsList = this.getByOtaId(otaId); + Workbook wb = ImportFileUtil.readExcel(file); + Sheet s = wb.getSheetAt(0); + + int startRow = 3; + for (OtaBaCxKsjxtmccs mccs : mccsList) { + Row row = s.getRow(startRow); + Cell cell = row.createCell(0); + cell.setCellValue(mccs.getXtlb()); + + cell = row.createCell(1); + cell.setCellValue(ImportFileUtil.getCellValueYesOrNo(mccs.getSfksj())); + + cell = row.createCell(2); + cell.setCellValue(mccs.getSjbgcs()); + cell = row.createCell(3); + StringBuilder sb = new StringBuilder(); + String tptStr = mccs.getTpt(); + if (StringUtils.isNotEmpty(tptStr)) { + String[] strs = tptStr.split(","); + for (String str : strs) { + List ossFileList = ossFileService.getFileInfos(str); + for (OSSFile ossFile : ossFileList) { + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (b) { + InputStream download = CosBootUtil.download(filePath); + ImportFileUtil.writeToLocal(attFile.getCanonicalPath() + "/" + ossFile.getFileName(), download); + sb.append(ossFile.getFileName()).append(","); + } + } + } + cell.setCellValue(sb.toString()); + } + cell = row.createCell(4); + cell.setCellValue(mccs.getKzqmc()); + cell = row.createCell(5); + cell.setCellValue(mccs.getAqwzxdj()); + cell = row.createCell(6); + cell.setCellValue(mccs.getKzqscqy()); + cell = row.createCell(7); + cell.setCellValue(mccs.getKzqxh()); + cell = row.createCell(8); + cell.setCellValue(mccs.getYjbbxx()); + cell = row.createCell(9); + cell.setCellValue(mccs.getCsrjbbh()); + cell = row.createCell(10); + cell.setCellValue(mccs.getCsrjbwzsj()); + cell = row.createCell(11); + cell.setCellValue(mccs.getSjsfyx()); + cell = row.createCell(12); + cell.setCellValue(mccs.getCzxtlx()); + cell = row.createCell(13); + cell.setCellValue(mccs.getCzxtscqy()); + cell = row.createCell(14); + cell.setCellValue(mccs.getCzxtbbh()); + startRow++; + } + Row row = s.getRow(startRow); + Cell cell = row.createCell(0); + cell.setCellValue("证明材料"); + cell = row.getCell(1); + OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId); + if (ObjectUtils.isNotEmpty(otaBaCxList)) { + StringBuilder sb = new StringBuilder(); + String fj = otaBaCxList.getZxsjxtfj(); + if (StringUtils.isNotEmpty(fj)) { + String[] strs = fj.split(","); + for (String str : strs) { + List ossFileList = ossFileService.getFileInfos(str); + for (OSSFile ossFile : ossFileList) { + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (b) { + InputStream download = CosBootUtil.download(filePath); + ImportFileUtil.writeToLocal(attFile.getCanonicalPath() + "/" + ossFile.getFileName(), download); + sb.append(ossFile.getFileName()).append(","); + } + } + } + cell.setCellValue(sb.toString()); + } + } + } + +} \ No newline at end of file diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxListServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxListServiceImpl.java index 708a8693b..130bdb9b5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxListServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxListServiceImpl.java @@ -10,6 +10,7 @@ import com.jero.modules.ota.mapper.OtaBaCxListMapper; import com.jero.modules.ota.service.*; import com.jero.modules.ota.utils.ImportFileUtil; import com.jero.modules.system.util.StringUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.ibatis.logging.Log; import org.apache.ibatis.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -19,10 +20,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; +import java.io.*; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @@ -187,28 +185,37 @@ public class OtaBaCxListServiceImpl extends ServiceImpl queryByOtaId(String otaId) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(OtaBaCxLsjl::getOtaId, otaId); + queryWrapper.orderByDesc(OtaBaCxLsjl::getCreateTime); List res = this.list(queryWrapper); return res; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxZxsjyqServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxZxsjyqServiceImpl.java index 7de1d1d65..1fcbbaf32 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxZxsjyqServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxZxsjyqServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.exception.JeroBootException; +import com.jero.common.util.oss.CosBootUtil; import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.service.IOSSFileService; import com.jero.modules.ota.entity.AttachmentEO; @@ -16,6 +17,8 @@ import com.jero.modules.ota.service.IOtaBaCxZxsjyqService; import com.jero.modules.ota.utils.ComparisonUtil; import com.jero.modules.ota.utils.ImportFileUtil; import com.jero.modules.system.service.ISysDictService; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Cell; @@ -30,6 +33,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; +import java.io.InputStream; import java.util.Date; import java.util.List; @@ -250,4 +254,62 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl attList = JSONArray.parseArray(attStr, AttachmentEO.class); + if (ObjectUtils.isNotEmpty(attList)) { + for (AttachmentEO aeo : attList) { + List ossFileList = ossFileService.getFileInfos(aeo.getId()); + for (OSSFile ossFile : ossFileList) { + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (b) { + InputStream download = CosBootUtil.download(filePath); + ImportFileUtil.writeToLocal(attFile.getCanonicalPath() + "/" + ossFile.getFileName(), download); + sb.append(ossFile.getFileName()).append(","); + } + } + } + } + cell.setCellValue(sb.toString()); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ComparisonUtil.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ComparisonUtil.java index b2c244750..f50ccfbed 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ComparisonUtil.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ComparisonUtil.java @@ -70,7 +70,7 @@ public class ComparisonUtil { Object newVal = field.get(newObj); String newStr = ""; if (ObjectUtils.isNotEmpty(newVal) && !field.getName().equals(tableField.getName())) { - newStr = newVal.toString(); + newStr = parseDictText(ote, field, newObj, sysDictService); content = tableField.get(newObj).toString() + "-" + title + "由'空'改为'" + newStr + "'"; resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content)); } @@ -86,6 +86,7 @@ public class ComparisonUtil { } } for (T oldObj : oldList) { + boolean flag = true; if (ObjectUtils.isNotEmpty(oldObj)) { Field idField = oldObj.getClass().getDeclaredField("id"); idField.setAccessible(true); @@ -94,19 +95,22 @@ public class ComparisonUtil { if (ObjectUtils.isNotEmpty(newObj)) { Object newId = idField.get(newObj); if (ObjectUtils.isNotEmpty(newId) && oldId.equals(newId.toString())) { + flag = false; break; } } } - Field tableTitleField = oldObj.getClass().getDeclaredField(tableTitle); - tableTitleField.setAccessible(true); - Object tableTitleObj = tableTitleField.get(oldObj); - String tableTitleObjStr = "空"; - if (ObjectUtils.isNotEmpty(tableTitleObj)) { - tableTitleObjStr = tableTitleObj.toString(); + if (flag) { + Field tableTitleField = oldObj.getClass().getDeclaredField(tableTitle); + tableTitleField.setAccessible(true); + Object tableTitleObj = tableTitleField.get(oldObj); + String tableTitleObjStr = "空"; + if (ObjectUtils.isNotEmpty(tableTitleObj)) { + tableTitleObjStr = tableTitleObj.toString(); + } + String content = "删除了'" + tableTitleObjStr + "'"; + resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content)); } - String content = "删除了'" + tableTitleObjStr + "'"; - resList.add(new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content)); } } } catch (IllegalAccessException | NoSuchFieldException e) { @@ -136,7 +140,7 @@ public class ComparisonUtil { Object newVal = field.get(newClazz); String newTitleStr = "空"; if (ObjectUtils.isNotEmpty(newVal)) { - Field tableField = newVal.getClass().getDeclaredField(tableTitle); + Field tableField = newClazz.getClass().getDeclaredField(tableTitle); tableField.setAccessible(true); Object newTitleVal = tableField.get(newVal); if (ObjectUtils.isNotEmpty(newTitleVal)) { diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ImportFileUtil.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ImportFileUtil.java index 20d21a7bb..13c24ace0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ImportFileUtil.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/utils/ImportFileUtil.java @@ -12,15 +12,22 @@ import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.DataFormatter; +import org.apache.poi.ss.usermodel.FormulaEvaluator; +import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.mock.web.MockMultipartFile; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.*; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; public class ImportFileUtil { @@ -52,8 +59,7 @@ public class ImportFileUtil { } - public static List importZip(MultipartFile file, String cut, String uploadPath) throws Exception { - List fileList = new ArrayList<>(); + public static File copyZip(MultipartFile file, String cut, String uploadPath) throws Exception { int pos = file.getOriginalFilename().lastIndexOf("."); String str = file.getOriginalFilename().substring(pos + 1).toLowerCase(); String filenameorg = file.getOriginalFilename().substring(0, pos); @@ -77,7 +83,12 @@ public class ImportFileUtil { if (str.equals("zip")) { zipEntryName = FileUnZip.unZipFiles(path + File.separator + file.getOriginalFilename(), path); } - File fileNew = new File(path); + return new File(path); + } + + public static List importZip(MultipartFile file, String cut, String uploadPath) throws Exception { + List fileList = new ArrayList<>(); + File fileNew = ImportFileUtil.copyZip(file, cut, uploadPath); for (File file1 : fileNew.listFiles()) { if (file1.getName().contains(".xls") || file1.getName().contains(".xlsx") || file1.isDirectory() || file1.getName().contains(".docx") || file1.getName().contains(".doc")) { @@ -112,7 +123,6 @@ public class ImportFileUtil { } public static Workbook readExcel(File file) { - Workbook wb = null; if (file == null) { return null; } @@ -121,9 +131,9 @@ public class ImportFileUtil { try { is = new FileInputStream(file); if (".xls".equals(extString)) { - return wb = new HSSFWorkbook(is); + return new HSSFWorkbook(is); } else if (".xlsx".equals(extString)) { - return wb = new XSSFWorkbook(is); + return new XSSFWorkbook(is); } is.close(); } catch (FileNotFoundException e) { @@ -133,7 +143,7 @@ public class ImportFileUtil { } finally { IOUtils.closeQuietly(is); } - return wb; + return null; } public static String getCellValue(Cell cell, Workbook workbook) throws Exception { @@ -147,6 +157,15 @@ public class ImportFileUtil { return ""; } + public static Integer getCellValueYesOrNoInt(Cell cell, Workbook workbook) throws Exception { + Integer res = null; + String str = getCellValueYesOrNo(cell, workbook); + if (StringUtils.isNotEmpty(str)) { + res = Integer.parseInt(str); + } + return res; + } + public static String getCellValueYesOrNo(Cell cell, Workbook workbook) throws Exception { String res = ""; String str = getCellValue(cell, workbook); @@ -160,6 +179,30 @@ public class ImportFileUtil { return res; } + public static String getCellValueYesOrNoInt(Integer val) throws Exception { + String res = ""; + if (ObjectUtils.isNotEmpty(val)) { + if (val.equals(1)) { + res = "是"; + } else if (val.equals(2)) { + res = "否"; + } + } + return res; + } + + public static String getCellValueYesOrNo(String str) throws Exception { + String res = ""; + if (StringUtils.isNotEmpty(str)) { + if (str.equals("1")) { + res = "是"; + } else if (str.equals("2")) { + res = "否"; + } + } + return res; + } + public static String getCellValueDict(Cell cell, Workbook wb, String dictType, ISysDictService sysDictService, String cut) throws Exception { String res = ""; String str = ImportFileUtil.getCellValue(cell, wb); @@ -193,6 +236,34 @@ public class ImportFileUtil { return null; } + public static File findFoder(File file, String fileName) throws Exception { + // 获取此地址中的所有文件以及文件夹(File[] list) + File[] listFiles = file.listFiles();// 获取此地址中的所有文件以及文件夹(File[] list) + for (File file1 : listFiles) {// 遍历数组 + // 判断当前的File对象是否为文件夹 + if (file1.isDirectory()) { + String name = file1.getName(); + if (name.equals(fileName)) { + return file1; + } + } + } + return null; + } + + public static File findFile(List file, String fileName) throws Exception { + for (File file1 : file) {// 遍历数组 + // 判断当前的File对象是否为文件夹 + if (!file1.isDirectory()) { + String name = file1.getName(); + if (name.equals(fileName)) { + return file1; + } + } + } + return null; + } + public static MultipartFile createMfileByFile(File file) { MultipartFile mFile = null; try { @@ -209,13 +280,15 @@ public class ImportFileUtil { public static List uploadFiles1(File attFile, String[] strs, IOSSFileService ossFileService) throws Exception { List res = new ArrayList<>(); for (int i = 0; i < strs.length; i++) { - File file = ImportFileUtil.findFile(attFile, strs[i]); - if (null == file) { - throw new JeroBootException("找不到文件:" + strs[i]); - } - OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); - if (ObjectUtils.isNotEmpty(ossFile)) { - res.add(ossFile); + if (StringUtils.isNotEmpty(strs[i])) { + File file = ImportFileUtil.findFile(attFile, strs[i]); + if (null == file) { + throw new JeroBootException("找不到文件:" + strs[i]); + } + OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); + if (ObjectUtils.isNotEmpty(ossFile)) { + res.add(ossFile); + } } } return res; @@ -224,20 +297,168 @@ public class ImportFileUtil { public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService) throws Exception { String res = ""; for (int i = 0; i < strs.length; i++) { - File file = ImportFileUtil.findFile(attFile, strs[i]); - if (null == file) { - throw new JeroBootException("找不到文件:" + strs[i]); - } - OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); - if (ObjectUtils.isNotEmpty(ossFile)) { - if (i >= strs.length - 1) { - res += ossFile.getId(); - } else { - res += ossFile.getId() + ","; + if (StringUtils.isNotEmpty(strs[i])) { + File file = ImportFileUtil.findFile(attFile, strs[i]); + if (null == file) { + throw new JeroBootException("找不到文件:" + strs[i]); + } + OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null); + if (ObjectUtils.isNotEmpty(ossFile)) { + if (i >= strs.length - 1) { + res += ossFile.getId(); + } else { + res += ossFile.getId() + ","; + } } } } return res; } + private static final int BUFFER_SIZE = 2 * 1024; + + /** + * 压缩成ZIP 方法1 + * + * @param srcDir 压缩文件夹路径 + * @param out 压缩文件输出流 + * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构; + * false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败) + * @throws RuntimeException 压缩失败会抛出运行时异常 + */ + public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure) + throws RuntimeException { + + long start = System.currentTimeMillis(); + ZipOutputStream zos = null; + try { + zos = new ZipOutputStream(out); + File sourceFile = new File(srcDir); + compress(sourceFile, zos, sourceFile.getName(), KeepDirStructure); + long end = System.currentTimeMillis(); + System.out.println("压缩完成,耗时:" + (end - start) + " ms"); + } catch (Exception e) { + throw new RuntimeException("zip error from ZipUtils", e); + } finally { + if (zos != null) { + try { + zos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + } + + /** + * 压缩成ZIP 方法2 + * + * @param srcFiles 需要压缩的文件列表 + * @param out 压缩文件输出流 + * @throws RuntimeException 压缩失败会抛出运行时异常 + */ + public static void toZip(List srcFiles, OutputStream out) throws RuntimeException { + long start = System.currentTimeMillis(); + ZipOutputStream zos = null; + try { + zos = new ZipOutputStream(out); + for (File srcFile : srcFiles) { + byte[] buf = new byte[BUFFER_SIZE]; + zos.putNextEntry(new ZipEntry(srcFile.getName())); + int len; + FileInputStream in = new FileInputStream(srcFile); + while ((len = in.read(buf)) != -1) { + zos.write(buf, 0, len); + } + zos.closeEntry(); + in.close(); + } + long end = System.currentTimeMillis(); + System.out.println("压缩完成,耗时:" + (end - start) + " ms"); + } catch (Exception e) { + throw new RuntimeException("zip error from ZipUtils", e); + } finally { + if (zos != null) { + try { + zos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + /** + * 递归压缩方法 + * + * @param sourceFile 源文件 + * @param zos zip输出流 + * @param name 压缩后的名称 + * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构; + * false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败) + * @throws Exception + */ + private static void compress(File sourceFile, ZipOutputStream zos, String name, + boolean KeepDirStructure) throws Exception { + byte[] buf = new byte[BUFFER_SIZE]; + if (sourceFile.isFile()) { + // 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字 + zos.putNextEntry(new ZipEntry(name)); + // copy文件到zip输出流中 + int len; + FileInputStream in = new FileInputStream(sourceFile); + while ((len = in.read(buf)) != -1) { + zos.write(buf, 0, len); + } + // Complete the entry + zos.closeEntry(); + in.close(); + } else { + File[] listFiles = sourceFile.listFiles(); + if (listFiles == null || listFiles.length == 0) { + // 需要保留原来的文件结构时,需要对空文件夹进行处理 + if (KeepDirStructure) { + // 空文件夹的处理 + zos.putNextEntry(new ZipEntry(name + "/")); + // 没有文件,不需要文件的copy + zos.closeEntry(); + } + + } else { + for (File file : listFiles) { + // 判断是否需要保留原来的文件结构 + if (KeepDirStructure) { + // 注意:file.getName()前面需要带上父文件夹的名字加一斜杠, + // 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了 + compress(file, zos, name + "/" + file.getName(), KeepDirStructure); + } else { + compress(file, zos, file.getName(), KeepDirStructure); + } + + } + } + } + } + + /** + * 将InputStream写入本地文件 + * + * @param input 输入流 + * @throws IOException IOException + */ + public static void writeToLocal(String path, InputStream input) + throws IOException { + int index; + byte[] bytes = new byte[1024]; + FileOutputStream downloadFile = new FileOutputStream(path); + while ((index = input.read(bytes)) != -1) { + downloadFile.write(bytes, 0, index); + downloadFile.flush(); + } + input.close(); + downloadFile.close(); + + } } + diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index eddd0a7a9..c838f6ab1 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1721,5 +1721,6 @@ module.exports = { cantTransferToYourself:"Can't transfer to yourself", theDataYouInitiate:'The data you selected does not meet the process initiation criteria. Please recheck and initiate', dataWithProcessReleasedCannotBeReset:'Data with a process status of list to be released cannot be reset', + reasonForReturnOfDesignCompliance:'Reason for return of design compliance', noteone:'Note: CSV format is supported. The value is within 20M and the number is 1 to 10', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 456f5bb73..e7f0d6b48 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1824,4 +1824,5 @@ module.exports = { noteone:'注:支持CSV格式,大小20M以内,数量1-10个', theDataYouInitiate:'您所选的数据,均不符合流程发起条件,请重新检查后发起', dataWithProcessReleasedCannotBeReset:'流程状态为清单待发布的数据不能被重置', + reasonForReturnOfDesignCompliance:'设计符合性退回原因', } \ No newline at end of file diff --git a/jero-web/src/views/otamanagement/vehicleinformation/components/recordparameters.vue b/jero-web/src/views/otamanagement/vehicleinformation/components/recordparameters.vue index f72635bab..077f9fd9d 100644 --- a/jero-web/src/views/otamanagement/vehicleinformation/components/recordparameters.vue +++ b/jero-web/src/views/otamanagement/vehicleinformation/components/recordparameters.vue @@ -49,7 +49,7 @@   {{$t('positioningandnavigationsystem')}} - +   {{$t('vehiclesatellitepositioningequipment')}} @@ -69,7 +69,7 @@   {{$t('vehiclecommunicationsystem')}} - +   {{$t('signalingdevices')}} @@ -307,7 +307,7 @@ export default { fillincontent:this.$t('yesisselected'), }, { - key: 'jgldBzwz', + key: 'jgldBzwz', val:'', componentname: this.$t('networksecurityrequirements'), configuration: this.$t('ineffectiveupgrades'), @@ -887,7 +887,7 @@ export default { }) this.dataSourceList=res.result.kzq } - + this.dataSource.forEach(item=>{ for(let key in res.result.bj){ if(item.key==key){ @@ -895,7 +895,7 @@ export default { } } }) - + // res.result.bj.forEach(item=>{ // if(Number(item) !=NaN){ @@ -905,7 +905,7 @@ export default { this.query=res.result.bj } }) - + }, click(value){ this.fileList = value @@ -1060,6 +1060,7 @@ button{ display: inline-block; float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 100%; height: 200px; line-height: 200px; @@ -1068,6 +1069,7 @@ button{ display: inline-block; float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 100%; height: 100px; line-height: 100px; @@ -1076,6 +1078,7 @@ button{ display: inline-block; float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 100%; height: 50px; line-height: 50px; @@ -1084,6 +1087,7 @@ button{ display: inline-block; float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 100%; height: 250px; line-height: 250px; @@ -1092,6 +1096,7 @@ button{ display: inline-block; float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 100%; height: 150px; line-height: 150px; @@ -1099,55 +1104,73 @@ button{ .text-box{ display: inline-block; float: left; - border: #e8e8e8 solid 1px; + /*border: #e8e8e8 solid 1px;*/ width: 100%; height: 400px; - line-height: 400px; + line-height: 20px; } .text-box-two{ display: inline-block; float: left; - border: #e8e8e8 solid 1px; + /*border: #e8e8e8 solid 1px;*/ width: 100%; height: 450px; - line-height: 450px; + line-height: 20px; } .text-text{ - display: inline-block; + /*display: inline-block;*/ float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 50%; height: 400px; - line-height: 400px; + line-height: 20px; + display: flex; + justify-content: left; + align-items: center; } .text-text-two{ - display: inline-block; + /*display: inline-block;*/ float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 50%; height: 200px; - line-height: 200px; + padding: 10px; + line-height: 20px; + display: flex; + justify-content: left; + align-items: center; } .text-text-three{ - display: inline-block; + /*display: inline-block;*/ float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 50%; height: 100px; - line-height: 100px; + line-height: 20px; + display: flex; + justify-content: left; + align-items: center; } .text-text-five{ - display: inline-block; + /*display: inline-block;*/ float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 50%; height: 50px; line-height: 50px; + display: flex; + justify-content: left; + align-items: center; } .text-box-three{ display: inline-block; float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 100%; height: 250px; line-height: 250px; @@ -1155,15 +1178,16 @@ button{ .text-box-four{ display: inline-block; float: left; - border: #e8e8e8 solid 1px; + /*border: #e8e8e8 solid 1px;*/ width: 100%; height: 600px; line-height: 600px; } .four-text-text{ - display: inline-block; + /*display: inline-block;*/ float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 50%; height: 600px; line-height: 20px; @@ -1172,17 +1196,23 @@ button{ align-items: center; } .four-text{ - display: inline-block; + /*display: inline-block;*/ float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 50%; height: 150px; - line-height: 150px; + display: flex; + line-height: 20px; + justify-content: left; + align-items: center; + padding: 10px; } .text-box-five{ display: inline-block; float: left; border: #e8e8e8 solid 1px; + border-right: none; width: 100%; height: 100px; line-height: 100px; @@ -1190,7 +1220,7 @@ button{ span{ /* overflow: hidden; /*超出部分隐藏*/ /* text-overflow: ellipsis; 超出部分省略号表示 */ - white-space: wrap; + white-space: normal; /* word-wrap: normal; */ } .item-input{ diff --git a/jero-web/src/views/projectManagement/components/certificationList/components/transferListvirtal.vue b/jero-web/src/views/projectManagement/components/certificationList/components/transferListvirtal.vue index a23a71c49..e9c82a9db 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/components/transferListvirtal.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/components/transferListvirtal.vue @@ -33,8 +33,8 @@ - - + + {{$t('query')}} {{$t('reset')}} @@ -52,18 +52,18 @@ :loading="loading"> - - - - - - - - - - - - + + + + + + + + + + + +
@@ -74,241 +74,256 @@ \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/listEditModel.vue b/jero-web/src/views/projectManagement/components/listEditModel.vue index 888cc6781..3367d51f6 100644 --- a/jero-web/src/views/projectManagement/components/listEditModel.vue +++ b/jero-web/src/views/projectManagement/components/listEditModel.vue @@ -782,95 +782,95 @@
- - - +
+ {{$t('listConfirmationRejectionReason')}} +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + +
+
+ {{$t('rejectedBy')}} +
+
+ {{item.createBy ? item.createBy : '--'}} +
+
+
+ +
+
+ {{$t('rejectionTime')}} +
+
+ {{item.rejectTime ? item.rejectTime : '--'}} +
+
+
+
+ + +
+
+ {{$t('rejectReason')}} +
+
+ {{item.rejectCause ? item.rejectCause : '--'}} +
+
+
+
+
- - - +
+ {{$t('taskConfirmationRejectionReason')}} +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + +
+
+ {{$t('rejectedBy')}} +
+
+ {{item.createBy ? item.createBy : '--'}} +
+
+
+ +
+
+ {{$t('rejectionTime')}} +
+
+ {{item.rejectTime ? item.rejectTime : '--'}} +
+
+
+
+ + +
+
+ {{$t('rejectReason')}} +
+
+ {{item.rejectCause ? item.rejectCause : '--'}} +
+
+
+
+