Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH
This commit is contained in:
+1
-2
@@ -236,7 +236,6 @@ public class AuthDummyInventoryInfoEOController extends JeroController<AuthDummy
|
||||
@ApiOperation(value="认证虚拟清单调取认证虚拟清单添加数据", notes="认证虚拟清单调取认证虚拟清单添加数据")
|
||||
@PostMapping(value = "/acquireAdd")
|
||||
public Result<?> acquireAdd(@RequestBody JSONObject json) {
|
||||
this.authDummyInventoryInfoEOService.acquireAdd(json);
|
||||
return Result.OK("调取成功!");
|
||||
return this.authDummyInventoryInfoEOService.acquireAdd(json);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.authDummy.entity.AuthDummyInventoryInfoEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.project.entity.ProjectCertificationInventoryEO;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -141,5 +142,7 @@ public interface IAuthDummyInventoryInfoEOService extends IService<AuthDummyInve
|
||||
*/
|
||||
void disposeDataToEn(List<AuthDummyInventoryInfoEO> infoListCopy);
|
||||
|
||||
void acquireAdd(JSONObject json);
|
||||
Result<?> acquireAdd(JSONObject json);
|
||||
|
||||
List<AuthDummyInventoryInfoEO> dataUniqueCheck(List<AuthDummyInventoryInfoEO> addList, String cut, List<String> result, String authDummyInventoryBaseId);
|
||||
}
|
||||
|
||||
+99
-25
@@ -1074,33 +1074,43 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
|
||||
@Override
|
||||
public Result<?> batchAdd(JSONObject json) {
|
||||
String serialNumber = json.getString("serialNumber");
|
||||
String cut = json.getString("cut");
|
||||
String wvtaId = json.getString("wvtaId");
|
||||
String dutyTerritory = json.getString("dutyTerritory");
|
||||
String bussDocumentLibraryId = json.getString("bussDocumentLibraryId");
|
||||
String authDummyInventoryBaseId = json.getString("authDummyInventoryBaseId");
|
||||
|
||||
List<String> result = new ArrayList<>();
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
result.add("添加成功!");
|
||||
}else {
|
||||
result.add("Successfully added!");
|
||||
}
|
||||
|
||||
List<AuthDummyInventoryInfoEO> authDummyInventoryInfoEOList = new ArrayList<>();
|
||||
JSONArray dataList = json.getJSONArray("dataList");
|
||||
AuthDummyInventoryInfoEO authDummyInventoryInfoEO = null;
|
||||
for (Object data : dataList) {
|
||||
authDummyInventoryInfoEO = JSONObject.parseObject(JSONObject.toJSONString(data), AuthDummyInventoryInfoEO.class);
|
||||
authDummyInventoryInfoEO.setSerialNumber(serialNumber);
|
||||
authDummyInventoryInfoEO.setWvtaId(wvtaId);
|
||||
authDummyInventoryInfoEO.setBussDocumentLibraryId(bussDocumentLibraryId);
|
||||
authDummyInventoryInfoEO.setDutyTerritory(dutyTerritory);
|
||||
authDummyInventoryInfoEO.setAuthDummyInventoryBaseId(authDummyInventoryBaseId);
|
||||
authDummyInventoryInfoEOList.add(authDummyInventoryInfoEO);
|
||||
}
|
||||
|
||||
List<AuthDummyInventoryInfoEO> saveDataList = this.dataUniqueCheck(authDummyInventoryInfoEOList, cut, result, authDummyInventoryBaseId);
|
||||
|
||||
try {
|
||||
String serialNumber = json.getString("serialNumber");
|
||||
String wvtaId = json.getString("wvtaId");
|
||||
String dutyTerritory = json.getString("dutyTerritory");
|
||||
String bussDocumentLibraryId = json.getString("bussDocumentLibraryId");
|
||||
String authDummyInventoryBaseId = json.getString("authDummyInventoryBaseId");
|
||||
|
||||
List<AuthDummyInventoryInfoEO> authDummyInventoryInfoEOList = new ArrayList<>();
|
||||
JSONArray dataList = json.getJSONArray("dataList");
|
||||
AuthDummyInventoryInfoEO authDummyInventoryInfoEO = null;
|
||||
for (Object data : dataList) {
|
||||
authDummyInventoryInfoEO = JSONObject.parseObject(JSONObject.toJSONString(data), AuthDummyInventoryInfoEO.class);
|
||||
authDummyInventoryInfoEO.setSerialNumber(serialNumber);
|
||||
authDummyInventoryInfoEO.setWvtaId(wvtaId);
|
||||
authDummyInventoryInfoEO.setBussDocumentLibraryId(bussDocumentLibraryId);
|
||||
authDummyInventoryInfoEO.setDutyTerritory(dutyTerritory);
|
||||
authDummyInventoryInfoEO.setAuthDummyInventoryBaseId(authDummyInventoryBaseId);
|
||||
authDummyInventoryInfoEOList.add(authDummyInventoryInfoEO);
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(authDummyInventoryInfoEOList)){
|
||||
this.saveBatch(authDummyInventoryInfoEOList);
|
||||
if(CollectionUtils.isNotEmpty(saveDataList)){
|
||||
this.saveBatch(saveDataList);
|
||||
|
||||
//更新log
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String username = sysUser.getUsername();
|
||||
String serialNumber1 = authDummyInventoryInfoEOList.stream().map(e->e.getSerialNumber()).collect(Collectors.joining(","));
|
||||
String serialNumber1 = saveDataList.stream().map(e->e.getSerialNumber()).collect(Collectors.joining(","));
|
||||
String contentLog = username+"向清单中添加了“"+serialNumber1+"”";
|
||||
String enContentLog = username+" added “"+serialNumber1+"” to the list.";
|
||||
authDummyLogService.updateLog(contentLog, authDummyInventoryInfoEO.getAuthDummyInventoryBaseId(),CutEnum.CN.getValue());
|
||||
@@ -1109,7 +1119,7 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
}catch (Exception ex){
|
||||
throw new JeroBootException("添加失败!");
|
||||
}
|
||||
return Result.OK("添加成功!");
|
||||
return Result.OK(result);
|
||||
}
|
||||
private String fieldConvert(String field){
|
||||
if (field == null) return null;
|
||||
@@ -1533,10 +1543,16 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acquireAdd(JSONObject json) {
|
||||
public Result<?> acquireAdd(JSONObject json) {
|
||||
String authDummyInventoryBaseId = json.getString("authDummyInventoryBaseId");
|
||||
String ids = json.getString("ids");
|
||||
String cut = json.getString("cut");
|
||||
List<String> result = new ArrayList<>();
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
result.add("调取成功!");
|
||||
}else {
|
||||
result.add("Successfully retrieved!");
|
||||
}
|
||||
|
||||
//检查虚拟清单是否存在
|
||||
QueryWrapper<AuthDummyInventoryBaseEO> baseQueryWrap = new QueryWrapper<>();
|
||||
@@ -1558,7 +1574,10 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
authDummyInventoryInfoEOTemp.setUpdateTime(new Date());
|
||||
addList.add(authDummyInventoryInfoEOTemp);
|
||||
}
|
||||
this.saveBatch(addList);
|
||||
|
||||
List<AuthDummyInventoryInfoEO> saveDataList = this.dataUniqueCheck(addList, cut, result, authDummyInventoryBaseId);
|
||||
|
||||
this.saveBatch(saveDataList);
|
||||
|
||||
//更新log
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
@@ -1576,5 +1595,60 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
throw new JeroBootException("The virtual list does not exist, and adding failed.");
|
||||
}
|
||||
}
|
||||
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AuthDummyInventoryInfoEO> dataUniqueCheck(List<AuthDummyInventoryInfoEO> addList, String cut, List<String> result, String authDummyInventoryBaseId) {
|
||||
List<AuthDummyInventoryInfoEO> adiiSaveList = new ArrayList<>();
|
||||
|
||||
QueryWrapper<AuthDummyInventoryInfoEO> pciQueryWrap = new QueryWrapper<>();
|
||||
pciQueryWrap.lambda().eq(AuthDummyInventoryInfoEO::getAuthDummyInventoryBaseId,authDummyInventoryBaseId);
|
||||
List<AuthDummyInventoryInfoEO> allDataList = this.list(pciQueryWrap);
|
||||
|
||||
// 重复数据数组
|
||||
List<AuthDummyInventoryInfoEO> duplicateDataList = allDataList.stream().filter(data -> {
|
||||
boolean flag = false;
|
||||
for (AuthDummyInventoryInfoEO aiiEo : addList) {
|
||||
boolean categoryFlag = StringUtils.equals(aiiEo.getCategory(), data.getCategory());
|
||||
boolean inspectionItemFlag = StringUtils.equals(aiiEo.getInspectionItem(), data.getInspectionItem());
|
||||
boolean configItemFlag = StringUtils.equals(aiiEo.getConfigItem(), data.getConfigItem());
|
||||
boolean serialNumberFlag = StringUtils.equals(aiiEo.getSerialNumber(), data.getSerialNumber());
|
||||
boolean dutyTerritoryFlag = StringUtils.equals(aiiEo.getDutyTerritory(), data.getDutyTerritory());
|
||||
// 类别+检验项目+配置项+编号+责任领域 作为唯一检验
|
||||
if(categoryFlag && inspectionItemFlag && configItemFlag && serialNumberFlag && dutyTerritoryFlag){
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(duplicateDataList)){
|
||||
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
|
||||
result.add("您所选的数据中包含当前项目中已包含的条目信息,已为您过滤添加。");
|
||||
}else {
|
||||
result.add("The data you have selected contains item information already included in the current project, which has been filtered and added for you.");
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤重复的数据
|
||||
adiiSaveList = addList.stream().filter(aiiEo -> {
|
||||
boolean flag = true;
|
||||
for (AuthDummyInventoryInfoEO allData : allDataList) {
|
||||
boolean categoryFlag = StringUtils.equals(aiiEo.getCategory(), allData.getCategory());
|
||||
boolean inspectionItemFlag = StringUtils.equals(aiiEo.getInspectionItem(), allData.getInspectionItem());
|
||||
boolean configItemFlag = StringUtils.equals(aiiEo.getConfigItem(), allData.getConfigItem());
|
||||
boolean serialNumberFlag = StringUtils.equals(aiiEo.getSerialNumber(), allData.getSerialNumber());
|
||||
boolean dutyTerritoryFlag = StringUtils.equals(aiiEo.getDutyTerritory(), allData.getDutyTerritory());
|
||||
// 类别+检验项目+配置项+编号+责任领域 作为唯一检验
|
||||
if(categoryFlag && inspectionItemFlag && configItemFlag && serialNumberFlag && dutyTerritoryFlag){
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return adiiSaveList;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
|
||||
cpxh = cpxh.replace("%", "\\%");
|
||||
queryWrapper.like(OtaBaSjList::getCpxh, cpxh);
|
||||
}
|
||||
|
||||
queryWrapper.orderByDesc(OtaBaSjList::getCreateTime);
|
||||
IPage<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
+1
@@ -69,6 +69,7 @@ public class OtaBaSjGgnrfs implements Serializable {
|
||||
/**升级目的*/
|
||||
@Excel(name = "升级目的", width = 15)
|
||||
@ApiModelProperty(value = "升级目的")
|
||||
@Dict(dicCode = "uipgrade_purpose")
|
||||
private java.lang.String sjmd;
|
||||
|
||||
/**由于软件升级活动而导致的车辆功能的任何变化*/
|
||||
|
||||
+120
-39
@@ -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,109 +23,188 @@ 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_sjxtbh")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ota_ba_sj_sjxtbh对象", description="升级备案-本次升级的系统名称与参数变化")
|
||||
@ApiModel(value = "ota_ba_sj_sjxtbh对象", description = "升级备案-本次升级的系统名称与参数变化")
|
||||
public class OtaBaSjSjxtbh 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 xtmc;
|
||||
|
||||
/**升级前已变更《公告》参数的对应调整*/
|
||||
@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 sjkzqmc;
|
||||
|
||||
/**适配的硬件版本*/
|
||||
@Excel(name = "适配的硬件版本", width = 15)
|
||||
/**
|
||||
* 适配的硬件版本
|
||||
*/
|
||||
@Excel(name = "适配的硬件版本", width = 15)
|
||||
@ApiModelProperty(value = "适配的硬件版本")
|
||||
private java.lang.String yjbb;
|
||||
|
||||
/**软件版本号升级前*/
|
||||
@Excel(name = "软件版本号升级前", width = 15)
|
||||
/**
|
||||
* 软件版本号升级前
|
||||
*/
|
||||
@Excel(name = "软件版本号升级前", width = 15)
|
||||
@ApiModelProperty(value = "软件版本号升级前")
|
||||
private java.lang.String sjqrjbb;
|
||||
|
||||
/**软件版本号升级后*/
|
||||
@Excel(name = "软件版本号升级后", width = 15)
|
||||
/**
|
||||
* 软件版本号升级后
|
||||
*/
|
||||
@Excel(name = "软件版本号升级后", width = 15)
|
||||
@ApiModelProperty(value = "软件版本号升级后")
|
||||
private java.lang.String sjhrjbb;
|
||||
|
||||
/**操作系统版本号升级前*/
|
||||
@Excel(name = "操作系统版本号升级前", width = 15)
|
||||
/**
|
||||
* 操作系统版本号升级前
|
||||
*/
|
||||
@Excel(name = "操作系统版本号升级前", width = 15)
|
||||
@ApiModelProperty(value = "操作系统版本号升级前")
|
||||
private java.lang.String sjqczxt;
|
||||
|
||||
/**操作系统版本号升级后*/
|
||||
@Excel(name = "操作系统版本号升级后", width = 15)
|
||||
/**
|
||||
* 操作系统版本号升级后
|
||||
*/
|
||||
@Excel(name = "操作系统版本号升级后", width = 15)
|
||||
@ApiModelProperty(value = "操作系统版本号升级后")
|
||||
private java.lang.String sjhczxt;
|
||||
|
||||
/**升级包完整性验证数据*/
|
||||
@Excel(name = "升级包完整性验证数据", width = 15)
|
||||
/**
|
||||
* 升级包完整性验证数据
|
||||
*/
|
||||
@Excel(name = "升级包完整性验证数据", width = 15)
|
||||
@ApiModelProperty(value = "升级包完整性验证数据")
|
||||
private java.lang.String sjbyzsj;
|
||||
|
||||
/**升级包大小*/
|
||||
@Excel(name = "升级包大小", width = 15)
|
||||
/**
|
||||
* 升级包大小
|
||||
*/
|
||||
@Excel(name = "升级包大小", width = 15)
|
||||
@ApiModelProperty(value = "升级包大小")
|
||||
private java.lang.String sjbdx;
|
||||
|
||||
/**是否差分升级*/
|
||||
@Excel(name = "是否差分升级", width = 15)
|
||||
/**
|
||||
* 是否差分升级
|
||||
*/
|
||||
@Excel(name = "是否差分升级", width = 15)
|
||||
@ApiModelProperty(value = "是否差分升级")
|
||||
private java.lang.String sfcfsj;
|
||||
|
||||
public boolean isNull() {
|
||||
if (StringUtils.isNotEmpty(xtmc)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjqbgcs)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjhbgcs)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjkzqmc)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(yjbb)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjqrjbb)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjhrjbb)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjqczxt)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjhczxt)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjbyzsj)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sjbdx)) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sfcfsj)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+28
-1
@@ -80,6 +80,9 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
||||
String otaId = (String) json.get("otaId");
|
||||
if (StringUtils.isNotEmpty(otaId)) {
|
||||
oldList = getByOtaId(otaId);
|
||||
if (ObjectUtils.isEmpty(oldList)) {
|
||||
oldList = setDefault(otaId);
|
||||
}
|
||||
deleteByOtaId(otaId);
|
||||
JSONArray list = json.getJSONArray("list");
|
||||
for (Object obj : list) {
|
||||
@@ -177,12 +180,32 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
||||
return list();
|
||||
}
|
||||
|
||||
public List<OtaBaCxKsjjsmccs> setDefault(String otaId) {
|
||||
Date now = new Date();
|
||||
List<OtaBaCxKsjjsmccs> res = new ArrayList<>();
|
||||
String[] titles = {"前向碰撞预警(FCW)", "车道偏离预警(LDW)", "百区监测(BSD)", "驾驶员疲劳监测(DFM)",
|
||||
"自动紧急制动(AEB)", "自适应巡航控制(ACC)", "车道保持辅助(LKA)", "智能泊车辅助(IPA)", "交通拥堵辅助(TJA)"};
|
||||
for (String t : titles) {
|
||||
OtaBaCxKsjjsmccs cs = new OtaBaCxKsjjsmccs();
|
||||
cs.setOtaId(otaId);
|
||||
cs.setGnmc(t);
|
||||
cs.setCreateTime(now);
|
||||
cs.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
res.add(cs);
|
||||
}
|
||||
saveBatch(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryByOtaId(String otaId, String otaIdT) {
|
||||
List<OtaBaCxKsjjsmccs> res = this.getByOtaId(otaId);
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
res = getByOtaId(otaIdT);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
res = setDefault(otaId);
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("list", res);
|
||||
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||
@@ -273,7 +296,11 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
||||
break;
|
||||
} else {
|
||||
mssc.setOtaId(otaId);
|
||||
mssc.setGnmc(ImportFileUtil.getCellValue(cell, wb));
|
||||
String gnmc = ImportFileUtil.getCellValue(cell, wb);
|
||||
if (StringUtils.isEmpty(gnmc)) {
|
||||
continue;
|
||||
}
|
||||
mssc.setGnmc(gnmc);
|
||||
cell = row.getCell(1);
|
||||
mssc.setPzqk(ImportFileUtil.getCellValueYesOrNo(cell, wb));
|
||||
cell = row.getCell(2);
|
||||
|
||||
+28
-1
@@ -81,6 +81,9 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
||||
String otaId = (String) json.get("otaId");
|
||||
if (StringUtils.isNotEmpty(otaId)) {
|
||||
oldList = getByOtaId(otaId);
|
||||
if (ObjectUtils.isEmpty(oldList)) {
|
||||
oldList = setDefault(otaId);
|
||||
}
|
||||
deleteByOtaId(otaId);
|
||||
JSONArray list = json.getJSONArray("list");
|
||||
for (Object obj : list) {
|
||||
@@ -245,12 +248,32 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
||||
return list();
|
||||
}
|
||||
|
||||
|
||||
public List<OtaBaCxKsjxtmccs> setDefault(String otaId) {
|
||||
Date now = new Date();
|
||||
List<OtaBaCxKsjxtmccs> res = new ArrayList<>();
|
||||
String[] titles = {"动力系统", "传动系统", "转向系统", "制动系统", "车身系统", "车载能源系统"};
|
||||
for (String t : titles) {
|
||||
OtaBaCxKsjxtmccs cs = new OtaBaCxKsjxtmccs();
|
||||
cs.setOtaId(otaId);
|
||||
cs.setXtlb(t);
|
||||
cs.setCreateTime(now);
|
||||
cs.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
res.add(cs);
|
||||
}
|
||||
saveBatch(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryByOtaId(String otaId, String otaIdT) {
|
||||
List<OtaBaCxKsjxtmccs> res = getByOtaId(otaId);
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
res = getByOtaId(otaIdT);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
res = setDefault(otaId);
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("list", res);
|
||||
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
|
||||
@@ -339,7 +362,11 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
|
||||
break;
|
||||
} else {
|
||||
mssc.setOtaId(otaId);
|
||||
mssc.setXtlb(ImportFileUtil.getCellValue(cell, wb));
|
||||
String xtlb = ImportFileUtil.getCellValue(cell, wb);
|
||||
if (StringUtils.isEmpty(xtlb)) {
|
||||
continue;
|
||||
}
|
||||
mssc.setXtlb(xtlb);
|
||||
cell = row.getCell(1);
|
||||
mssc.setSfksj(ImportFileUtil.getCellValueYesOrNo(cell, wb));
|
||||
cell = row.getCell(2);
|
||||
|
||||
+57
-8
@@ -6,14 +6,17 @@ import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.ota.entity.OtaBaCxTxjl;
|
||||
import com.jero.modules.ota.entity.OtaBaSjGgnrfs;
|
||||
import com.jero.modules.ota.entity.OtaBaSjSjyxpg;
|
||||
import com.jero.modules.ota.enums.OtaModuleEnum;
|
||||
import com.jero.modules.ota.mapper.OtaBaSjGgnrfsMapper;
|
||||
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
||||
import com.jero.modules.ota.service.IOtaBaSjGgnrfsService;
|
||||
import com.jero.modules.ota.service.IOtaBaSjSjyxpgService;
|
||||
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.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -24,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Description: 升级备案-用户告知内容及方式
|
||||
@@ -49,6 +53,10 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
|
||||
@Autowired
|
||||
private IOSSFileService ossFileService;
|
||||
|
||||
@Autowired
|
||||
private IOtaBaSjSjyxpgService otaBaSjSjyxpgService;
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -59,7 +67,7 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
|
||||
public void add(OtaBaSjGgnrfs otaBaSjGgnrfs) {
|
||||
Date now = new Date();
|
||||
if (null != otaBaSjGgnrfs) {
|
||||
OtaBaSjGgnrfs otaBaSjGgnrfsOld = this.getByOtaId(otaBaSjGgnrfs.getOtaId());
|
||||
OtaBaSjGgnrfs otaBaSjGgnrfsOld = this.queryByOtaId(otaBaSjGgnrfs.getOtaId(), "");
|
||||
String oldFjStr = "";
|
||||
if (null != otaBaSjGgnrfsOld) {
|
||||
otaBaSjGgnrfs.setId(otaBaSjGgnrfsOld.getId());
|
||||
@@ -68,13 +76,12 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
|
||||
otaBaSjGgnrfs.setCreateTime(now);
|
||||
}
|
||||
otaBaSjGgnrfs.setUpdateTime(now);
|
||||
saveOrUpdate(otaBaSjGgnrfs);
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
if (ObjectUtils.isEmpty(otaBaSjGgnrfsOld)) {
|
||||
otaBaSjGgnrfsOld = new OtaBaSjGgnrfs();
|
||||
}
|
||||
saveOrUpdate(otaBaSjGgnrfs);
|
||||
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjGgnrfs.getOtaId(), OtaModuleEnum.SJ_YHGZNRFS, otaBaSjGgnrfsOld, otaBaSjGgnrfs, sysDictService);
|
||||
|
||||
reList.addAll(cu.comparisonRecord(otaBaSjGgnrfs.getOtaId(), otaBaSjGgnrfs.getXgwj(), oldFjStr, OtaModuleEnum.SJ_YHGZNRFS, "附件", ossFileService));
|
||||
otaBaCxTxjlService.saveBatch(reList);
|
||||
}
|
||||
@@ -142,6 +149,28 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
|
||||
if (ObjectUtils.isEmpty(res)) {
|
||||
res = getByOtaId(otaIdT);
|
||||
}
|
||||
if (ObjectUtils.isEmpty(res)) {
|
||||
res = new OtaBaSjGgnrfs();
|
||||
res.setOtaId(otaId);
|
||||
}
|
||||
if (StringUtils.isEmpty(res.getSjky())) {
|
||||
res.setSjky("车辆解闭锁功能可用,但不可驾驶");
|
||||
}
|
||||
if (StringUtils.isEmpty(res.getSjbkygn())) {
|
||||
res.setSjbkygn("除解闭锁均不可用");
|
||||
}
|
||||
if (null == res.getSjsfcg()) {
|
||||
res.setSjsfcg(1);
|
||||
}
|
||||
if (null == res.getGzbg()) {
|
||||
res.setGzbg(1);
|
||||
}
|
||||
if (null == res.getGzscnr()) {
|
||||
res.setGzscnr(1);
|
||||
}
|
||||
if (StringUtils.isEmpty(res.getGzyhfs())) {
|
||||
res.setGzyhfs("1,3");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -168,18 +197,38 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, 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")) {
|
||||
// upFile = f;
|
||||
// }
|
||||
}
|
||||
if (null == upFile || null == attFile) {
|
||||
if (null == attFile) {
|
||||
throw new JeroBootException("请上传正确的文件");
|
||||
}
|
||||
OtaBaSjGgnrfs fs = parseFile(attFile, otaId, cut);
|
||||
add(fs);
|
||||
}
|
||||
|
||||
private OtaBaSjGgnrfs parseFile(File attFile, String otaId, String cut) throws Exception {
|
||||
OtaBaSjGgnrfs fs = new OtaBaSjGgnrfs();
|
||||
fs.setOtaId(otaId);
|
||||
OtaBaSjSjyxpg pg = otaBaSjSjyxpgService.queryByOtaId(otaId, "");
|
||||
if (StringUtils.isNotEmpty(pg.getSjmd())) {
|
||||
fs.setSjmd(pg.getSjmd());
|
||||
}
|
||||
StringBuilder attStr1 = new StringBuilder();
|
||||
File[] attFiles1 = attFile.listFiles();
|
||||
for (int i = 0; i < attFiles1.length; i++) {
|
||||
if (!attFiles1[i].isDirectory() && (attFiles1[i].getName().contains(".doc") || attFiles1[i].getName().contains(".docx") || attFiles1[i].getName().contains(".pdf"))) {
|
||||
if (i >= attFiles1.length - 1) {
|
||||
attStr1.append(ImportFileUtil.uploadFiles(attFiles1[i], ossFileService));
|
||||
} else {
|
||||
attStr1.append(ImportFileUtil.uploadFiles(attFiles1[i], ossFileService)).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
fs.setXgwj(attStr1.toString());
|
||||
return fs;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-2
@@ -90,9 +90,12 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
|
||||
otaBaSjListService.editById(otaBaSjList);
|
||||
}
|
||||
otaBaSjSjmbcx.setUpdateTime(now);
|
||||
saveOrUpdate(otaBaSjSjmbcx);
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjmbcx.getOtaId(), OtaModuleEnum.SJ_SJMBCX, otaBaSjSjmbcxOld, otaBaSjSjmbcx, sysDictService);
|
||||
if (StringUtils.isEmpty(otaBaSjSjmbcx.getQymc())) {
|
||||
otaBaSjSjmbcx.setQymc("安徽江淮汽车集团股份有限公司");
|
||||
}
|
||||
saveOrUpdate(otaBaSjSjmbcx);
|
||||
otaBaCxTxjlService.saveBatch(reList);
|
||||
return otaBaSjSjmbcx;
|
||||
}
|
||||
@@ -188,7 +191,7 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
|
||||
public OtaBaSjSjmbcx parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
|
||||
File upFile = null;
|
||||
for (File f : upLoadFiles) {
|
||||
if (f.getName().equals("车型基本信息.xlsx")) {
|
||||
if (f.getName().equals("升级目标车型.xlsx")) {
|
||||
upFile = f;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -239,7 +239,6 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
||||
int rows = s.getPhysicalNumberOfRows();
|
||||
for (int i = 4; i < rows; i++) {
|
||||
OtaBaSjSjxtbh xtbh = new OtaBaSjSjxtbh();
|
||||
xtbh.setOtaId(otaId);
|
||||
Row row = s.getRow(i);
|
||||
Cell cell = row.getCell(2);
|
||||
String kzq = ImportFileUtil.getCellValue(cell, wb);
|
||||
@@ -250,7 +249,6 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
||||
xtbh.setXtmc(gnxt);
|
||||
}
|
||||
}
|
||||
|
||||
cell = row.getCell(0);
|
||||
xtbh.setSjqbgcs(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(1);
|
||||
@@ -271,6 +269,9 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
||||
xtbh.setSjbdx(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(10);
|
||||
xtbh.setSfcfsj(ImportFileUtil.getCellValue(cell, wb));
|
||||
if (xtbh.isNull()) {
|
||||
break;
|
||||
}
|
||||
xtbh.setCreateTime(now);
|
||||
xtbh.setUpdateTime(now);
|
||||
xtbh.setOtaId(otaId);
|
||||
|
||||
+80
-7
@@ -16,8 +16,6 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -76,7 +74,7 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
||||
String newZmcl = otaBaSjSjyxpg.getClfj();
|
||||
String oldZmcl = "";
|
||||
|
||||
OtaBaSjSjyxpg otaBaSjSjyxpgOld = this.getByOtaId(otaBaSjSjyxpg.getOtaId());
|
||||
OtaBaSjSjyxpg otaBaSjSjyxpgOld = this.queryByOtaId(otaBaSjSjyxpg.getOtaId(),"");
|
||||
if (null != otaBaSjSjyxpgOld) {
|
||||
otaBaSjSjyxpg.setId(otaBaSjSjyxpgOld.getId());
|
||||
oldYzcl = otaBaSjSjyxpgOld.getBgfj();
|
||||
@@ -85,7 +83,6 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
||||
otaBaSjSjyxpg.setCreateTime(now);
|
||||
}
|
||||
otaBaSjSjyxpg.setUpdateTime(now);
|
||||
saveOrUpdate(otaBaSjSjyxpg);
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
if (ObjectUtils.isEmpty(otaBaSjSjyxpgOld)) {
|
||||
otaBaSjSjyxpgOld = new OtaBaSjSjyxpg();
|
||||
@@ -93,6 +90,8 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
||||
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), OtaModuleEnum.SJ_SJYXPG, otaBaSjSjyxpgOld, otaBaSjSjyxpg, sysDictService);
|
||||
reList.addAll(cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), newYzcl, oldYzcl, OtaModuleEnum.SJ_SJMBCL, "验证材料", ossFileService));
|
||||
reList.addAll(cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), newZmcl, oldZmcl, OtaModuleEnum.SJ_SJMBCL, "证明材料", ossFileService));
|
||||
|
||||
saveOrUpdate(otaBaSjSjyxpg);
|
||||
otaBaCxTxjlService.saveBatch(reList);
|
||||
}
|
||||
}
|
||||
@@ -159,6 +158,35 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
||||
if (ObjectUtils.isEmpty(res)) {
|
||||
res = getByOtaId(otaIdT);
|
||||
}
|
||||
if (ObjectUtils.isEmpty(res)) {
|
||||
res = new OtaBaSjSjyxpg();
|
||||
res.setOtaId(otaId);
|
||||
}
|
||||
if (null == res.getFhgd()) {
|
||||
res.setFhgd(2);
|
||||
}
|
||||
if (null == res.getZdjsxg()) {
|
||||
res.setZdjsxg(1);
|
||||
}
|
||||
if (null == res.getZxsj()) {
|
||||
res.setZxsj(2);
|
||||
}
|
||||
if (StringUtils.isEmpty(res.getAqjz())) {
|
||||
res.setAqjz("2");
|
||||
}
|
||||
if (null == res.getSfyxaq()) {
|
||||
res.setSfyxaq(2);
|
||||
}
|
||||
|
||||
if (null == res.getYhqr()) {
|
||||
res.setYhqr(1);
|
||||
}
|
||||
if (StringUtils.isEmpty(res.getSjbcs())) {
|
||||
res.setSjbcs("3,4");
|
||||
}
|
||||
if (null == res.getAqkkx()) {
|
||||
res.setAqkkx(1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -183,7 +211,7 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
||||
return sjyxpg;
|
||||
}
|
||||
|
||||
private OtaBaSjSjyxpg parseFile(File upFile, String cut) throws Exception {
|
||||
private OtaBaSjSjyxpg parseFile(File upFile, File attFile1, File attFile2, String cut) throws Exception {
|
||||
OtaBaSjSjyxpg sjyxpg = new OtaBaSjSjyxpg();
|
||||
InputStream is = new FileInputStream(upFile);
|
||||
XWPFDocument doc = new XWPFDocument(is);
|
||||
@@ -201,21 +229,66 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
||||
}
|
||||
sjyxpg.setSjmd(sb.toString());
|
||||
}
|
||||
StringBuilder attStr1 = new StringBuilder();
|
||||
File[] attFiles1 = attFile1.listFiles();
|
||||
for (int i = 0; i < attFiles1.length; i++) {
|
||||
if (!attFiles1[i].isDirectory() && (attFiles1[i].getName().contains(".doc") || attFiles1[i].getName().contains(".docx") || attFiles1[i].getName().contains(".pdf"))) {
|
||||
if (i >= attFiles1.length - 1) {
|
||||
attStr1.append(ImportFileUtil.uploadFiles(attFiles1[i], ossFileService));
|
||||
} else {
|
||||
attStr1.append(ImportFileUtil.uploadFiles(attFiles1[i], ossFileService)).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
sjyxpg.setBgfj(attStr1.toString());
|
||||
StringBuilder attStr2 = new StringBuilder();
|
||||
File[] attFiles2 = attFile2.listFiles();
|
||||
for (int i = 0; i < attFiles2.length; i++) {
|
||||
if (!attFiles2[i].isDirectory() && (attFiles2[i].getName().contains(".doc") || attFiles2[i].getName().contains(".docx") || attFiles2[i].getName().contains(".pdf"))) {
|
||||
if (i >= attFiles2.length - 1) {
|
||||
attStr2.append(ImportFileUtil.uploadFiles(attFiles2[i], ossFileService));
|
||||
} else {
|
||||
attStr2.append(ImportFileUtil.uploadFiles(attFiles2[i], ossFileService)).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
sjyxpg.setClfj(attStr2.toString());
|
||||
return sjyxpg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OtaBaSjSjyxpg parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
|
||||
File upFile = null;
|
||||
File attFile = null;
|
||||
File attFile1 = null;
|
||||
File attFile2 = null;
|
||||
for (File f : upLoadFiles) {
|
||||
if (f.getName().equals("升级影响评估.docx")) {
|
||||
upFile = f;
|
||||
}
|
||||
if (f.isDirectory() && f.getName().equals("升级影响评估")) {
|
||||
attFile = f;
|
||||
}
|
||||
}
|
||||
if (null == upFile) {
|
||||
|
||||
if (null == upFile || null == attFile) {
|
||||
throw new JeroBootException("请上传正确的文件");
|
||||
}
|
||||
OtaBaSjSjyxpg sjyxpg = parseFile(upFile, cut);
|
||||
|
||||
for (File f : attFile.listFiles()) {
|
||||
if (f.isDirectory() && f.getName().equals("测试报告")) {
|
||||
attFile1 = f;
|
||||
}
|
||||
if (f.isDirectory() && f.getName().equals("硬件版本号附件")) {
|
||||
attFile2 = f;
|
||||
}
|
||||
}
|
||||
if (null == attFile1 || null == attFile2) {
|
||||
throw new JeroBootException("请上传正确的文件");
|
||||
}
|
||||
|
||||
|
||||
OtaBaSjSjyxpg sjyxpg = parseFile(upFile, attFile1, attFile2, cut);
|
||||
sjyxpg.setOtaId(otaId);
|
||||
add(sjyxpg);
|
||||
return sjyxpg;
|
||||
|
||||
+9
@@ -294,6 +294,15 @@ public class ImportFileUtil {
|
||||
return res;
|
||||
}
|
||||
|
||||
public static String uploadFiles(File attFile, IOSSFileService ossFileService) throws Exception {
|
||||
String res = "";
|
||||
OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(attFile), "", null, null);
|
||||
if (ObjectUtils.isNotEmpty(ossFile)) {
|
||||
res = ossFile.getId();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService) throws Exception {
|
||||
String res = "";
|
||||
for (int i = 0; i < strs.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user