From b3b0ce4096ea3de196d7460edf8e445859b3a6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Thu, 30 Mar 2023 19:38:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91OTA=E5=A4=87=E6=A1=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7-=E8=BD=A6=E8=BE=86=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/ota/entity/OtaBaSjSjfzbh.java | 119 +++++++++++++----- .../impl/OtaBaSjSjfzbhServiceImpl.java | 70 ++++------- 2 files changed, 111 insertions(+), 78 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaBaSjSjfzbh.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaBaSjSjfzbh.java index 6fab9f1b6..db1ef0c21 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaBaSjSjfzbh.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaBaSjSjfzbh.java @@ -3,11 +3,13 @@ package com.jero.modules.ota.entity; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.math.BigDecimal; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.StringUtils; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; import com.jero.common.aspect.annotation.Dict; @@ -21,89 +23,144 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; /** * @Description: 升级备案-本次升级的驾驶辅助功能与参数变化 * @Author: jero-boot - * @Date: 2023-03-17 + * @Date: 2023-03-17 * @Version: V1.0 */ @Data @TableName("ota_ba_sj_sjfzbh") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="ota_ba_sj_sjfzbh对象", description="升级备案-本次升级的驾驶辅助功能与参数变化") +@ApiModel(value = "ota_ba_sj_sjfzbh对象", description = "升级备案-本次升级的驾驶辅助功能与参数变化") public class OtaBaSjSjfzbh implements Serializable { private static final long serialVersionUID = 1L; - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主键") private java.lang.String id; - /**创建人*/ + /** + * 创建人 + */ @ApiModelProperty(value = "创建人") private java.lang.String createBy; - /**创建日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + /** + * 创建日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建日期") private java.util.Date createTime; - /**更新人*/ + /** + * 更新人 + */ @ApiModelProperty(value = "更新人") private java.lang.String updateBy; - /**更新日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + /** + * 更新日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "更新日期") private java.util.Date updateTime; - /**所属部门*/ + /** + * 所属部门 + */ @ApiModelProperty(value = "所属部门") private java.lang.String sysOrgCode; - /**otaId*/ - @Excel(name = "otaId", width = 15) + /** + * otaId + */ + @Excel(name = "otaId", width = 15) @ApiModelProperty(value = "otaId") private java.lang.String otaId; - /**功能名称*/ - @Excel(name = "功能名称", width = 15) + /** + * 功能名称 + */ + @Excel(name = "功能名称", width = 15) @ApiModelProperty(value = "功能名称") private java.lang.String gnmc; - /**升级目的类型*/ - @Excel(name = "升级目的类型", width = 15) + /** + * 升级目的类型 + */ + @Excel(name = "升级目的类型", width = 15) @ApiModelProperty(value = "升级目的类型") private java.lang.String sjmdlx; - /**升级前已变更《公告》参数的对应调整*/ - @Excel(name = "升级前已变更《公告》参数的对应调整", width = 15) + /** + * 升级前已变更《公告》参数的对应调整 + */ + @Excel(name = "升级前已变更《公告》参数的对应调整", width = 15) @ApiModelProperty(value = "升级前已变更《公告》参数的对应调整") private java.lang.String sjqbgcs; - /**升级后已变更《公告》参数的对应调整*/ - @Excel(name = "升级后已变更《公告》参数的对应调整", width = 15) + /** + * 升级后已变更《公告》参数的对应调整 + */ + @Excel(name = "升级后已变更《公告》参数的对应调整", width = 15) @ApiModelProperty(value = "升级后已变更《公告》参数的对应调整") private java.lang.String sjhbgcs; - /**功能变更描述*/ - @Excel(name = "功能变更描述", width = 15) + /** + * 功能变更描述 + */ + @Excel(name = "功能变更描述", width = 15) @ApiModelProperty(value = "功能变更描述") private java.lang.String gnbgms; - /**适用条件变更*/ - @Excel(name = "适用条件变更", width = 15) + /** + * 适用条件变更 + */ + @Excel(name = "适用条件变更", width = 15) @ApiModelProperty(value = "适用条件变更") private java.lang.String sytjbg; - /**升级涉及的电子控制器*/ - @Excel(name = "升级涉及的电子控制器", width = 15) + /** + * 升级涉及的电子控制器 + */ + @Excel(name = "升级涉及的电子控制器", width = 15) @ApiModelProperty(value = "升级涉及的电子控制器") private java.lang.String sjsjkzq; - /**附件*/ - @Excel(name = "附件", width = 15) + /** + * 附件 + */ + @Excel(name = "附件", width = 15) @ApiModelProperty(value = "附件") private java.lang.String fj; + public boolean isNull() { + if (StringUtils.isNotEmpty(gnmc)) { + return false; + } + if (StringUtils.isNotEmpty(sjmdlx)) { + return false; + } + if (StringUtils.isNotEmpty(sjqbgcs)) { + return false; + } + if (StringUtils.isNotEmpty(sjhbgcs)) { + return false; + } + if (StringUtils.isNotEmpty(gnbgms)) { + return false; + } + if (StringUtils.isNotEmpty(sytjbg)) { + return false; + } + if (StringUtils.isNotEmpty(sjsjkzq)) { + return false; + } + return true; + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjfzbhServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjfzbhServiceImpl.java index 506a01738..412d0be77 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjfzbhServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjfzbhServiceImpl.java @@ -107,12 +107,6 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService); saveOrUpdateBatch(newList); - String fj = (String) json.get("fj"); - OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId); - String oldFjStr = otaBaSjList.getSjjsfj(); - otaBaSjList.setSjjsfj(fj); - otaBaSjListService.editById(otaBaSjList); - reList.addAll(cu.comparisonRecord(otaId, fj, oldFjStr, OtaModuleEnum.SJ_SJJSMCBH, "附件", ossFileService)); otaBaCxTxjlService.saveBatch(reList); } @@ -191,10 +185,6 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl upLoadFiles, String otaId, String cut) throws Exception { - File attFile = null; File upFile = null; for (File f : upLoadFiles) { - if (f.isDirectory() && f.getName().equals("本次升级的驾驶辅助功能与参数变化")) { - attFile = f; - } else if (f.getName().equals("本次升级的驾驶辅助功能与参数变化.xlsx")) { + if (f.getName().equals("本次升级的驾驶辅助功能与参数变化.xlsx")) { upFile = f; } } - if (null == upFile || null == attFile) { + if (null == upFile) { throw new JeroBootException("请上传正确的文件"); } @@ -237,7 +224,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl(); } - List newList = parseFile(upFile, attFile, otaId, cut); + List newList = parseFile(upFile, otaId, cut); ComparisonUtil cu = new ComparisonUtil(); List reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService); deleteByOtaId(otaId); @@ -245,7 +232,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl parseFile(File upFile, File attFile, String otaId, String cut) throws Exception { + private List parseFile(File upFile, String otaId, String cut) throws Exception { Date now = new Date(); List fzbhList = new ArrayList<>(); Workbook wb = ImportFileUtil.readExcel(upFile); @@ -256,38 +243,27 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl