开发OTA备案工具-车辆升级
This commit is contained in:
+88
-31
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+23
-47
@@ -107,12 +107,6 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
List<OtaBaCxTxjl> 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<OtaBaSjSjfzbhMapper, O
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("list", res);
|
||||
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId);
|
||||
if (ObjectUtils.isNotEmpty(otaBaSjList) && ObjectUtils.isNotEmpty(otaBaSjList.getSjjsfj())) {
|
||||
json.put("fj", otaBaSjList.getSjjsfj());
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -220,16 +210,13 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
|
||||
|
||||
@Override
|
||||
public void parseFileList(List<File> 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<OtaBaSjSjfzbhMapper, O
|
||||
if (ObjectUtils.isEmpty(oldList)) {
|
||||
oldList = new ArrayList<>();
|
||||
}
|
||||
List<OtaBaSjSjfzbh> newList = parseFile(upFile, attFile, otaId, cut);
|
||||
List<OtaBaSjSjfzbh> newList = parseFile(upFile, otaId, cut);
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
|
||||
deleteByOtaId(otaId);
|
||||
@@ -245,7 +232,7 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
|
||||
otaBaCxTxjlService.saveBatch(reList);
|
||||
}
|
||||
|
||||
private List<OtaBaSjSjfzbh> parseFile(File upFile, File attFile, String otaId, String cut) throws Exception {
|
||||
private List<OtaBaSjSjfzbh> parseFile(File upFile, String otaId, String cut) throws Exception {
|
||||
Date now = new Date();
|
||||
List<OtaBaSjSjfzbh> fzbhList = new ArrayList<>();
|
||||
Workbook wb = ImportFileUtil.readExcel(upFile);
|
||||
@@ -256,38 +243,27 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
|
||||
Cell cell = row.getCell(0);
|
||||
String str = ImportFileUtil.getCellValue(cell, wb);
|
||||
OtaBaSjSjfzbh fzbh = new OtaBaSjSjfzbh();
|
||||
if ("证明材料".equals(str)) {
|
||||
//列表数据数量,在证明材料处结束
|
||||
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId);
|
||||
if (ObjectUtils.isNotEmpty(otaBaSjList)) {
|
||||
cell = row.getCell(1);
|
||||
str = ImportFileUtil.getCellValue(cell, wb);
|
||||
String[] strs = str.split(",");
|
||||
otaBaSjList.setSjjsfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService));
|
||||
otaBaSjListService.editById(otaBaSjList);
|
||||
}
|
||||
cell = row.getCell(0);
|
||||
fzbh.setGnmc(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(1);
|
||||
fzbh.setSjmdlx(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(2);
|
||||
fzbh.setSjqbgcs(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(3);
|
||||
fzbh.setSjhbgcs(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(4);
|
||||
fzbh.setGnbgms(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(5);
|
||||
fzbh.setSytjbg(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(6);
|
||||
fzbh.setSjsjkzq(ImportFileUtil.getCellValue(cell, wb));
|
||||
if (fzbh.isNull()) {
|
||||
break;
|
||||
} else {
|
||||
fzbh.setOtaId(otaId);
|
||||
fzbh.setCreateTime(now);
|
||||
fzbh.setUpdateTime(now);
|
||||
|
||||
cell = row.getCell(0);
|
||||
fzbh.setGnmc(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(1);
|
||||
fzbh.setSjmdlx(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(2);
|
||||
fzbh.setSjqbgcs(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(3);
|
||||
fzbh.setSjhbgcs(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(4);
|
||||
fzbh.setGnbgms(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(5);
|
||||
fzbh.setSytjbg(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(6);
|
||||
fzbh.setSjsjkzq(ImportFileUtil.getCellValue(cell, wb));
|
||||
fzbhList.add(fzbh);
|
||||
}
|
||||
fzbh.setOtaId(otaId);
|
||||
fzbh.setCreateTime(now);
|
||||
fzbh.setUpdateTime(now);
|
||||
fzbhList.add(fzbh);
|
||||
}
|
||||
return fzbhList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user