Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH

This commit is contained in:
范强强
2023-03-31 09:10:31 +08:00
66 changed files with 1796 additions and 872 deletions
@@ -658,6 +658,43 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
}
}
}
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEO.getCut())){
for(int k = 0 ;k<rowList.size();k++){
if("".equals(rowList.get("category")) ||
"".equals(rowList.get("inspectionItem")) ||
"".equals(rowList.get("configItem")) ||
"".equals(rowList.get("wvtaId")) ||
"".equals(rowList.get("serialNumber")) ||
"".equals(rowList.get("dutyTerritoryName")) ||
"".equals(rowList.get("deliverableTypeName")) ){
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEO.getCut())){
throw new JeroBootException("请填写必填字段内容,带*的为必填");
}else{
throw new JeroBootException("Please fill in the required fields marked with *");
}
}
}
}else {
for(int k = 0 ;k<rowList.size();k++){
if("".equals(rowList.get("category")) ||
"".equals(rowList.get("inspectionItem")) ||
"".equals(rowList.get("configItem")) ||
"".equals(rowList.get("wvtaId")) ||
"".equals(rowList.get("serialNumber")) ||
"".equals(rowList.get("dutyTerritoryName")) ||
"".equals(rowList.get("deliverableTypeNameEn")) ){
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEO.getCut())){
throw new JeroBootException("请填写必填字段内容,带*的为必填");
}else{
throw new JeroBootException("Please fill in the required fields marked with *");
}
}
}
}
if (i > 1) {
dataList.add(rowList);
}
@@ -797,86 +834,54 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
//WVTA ID
if(StringUtils.isNotBlank(wvtaId)){
if(wvtaId.length() > 100){
if(wvtaId.length() > 300){
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "WVTA ID不能超过100个字符, ";
message = errorMsg + "WVTA ID不能超过300个字符, ";
}else{
message = errorMsg + " The WVTA ID cannot contain more than 100 characters, ";
message = errorMsg + " The WVTA ID cannot contain more than 300 characters, ";
}
msgList.add(message);
}
} else {
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "WVTA ID不能为空, ";
}else{
message = errorMsg + " The WVTA ID cannot null, ";
}
msgList.add(message);
}
//类别
if(StringUtils.isNotBlank(category)){
if(category.length() > 100){
if(category.length() > 300){
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "类别不能超过100个字符, ";
message = errorMsg + "类别不能超过300个字符, ";
}else{
message = errorMsg + " The Category cannot contain more than 100 characters, ";
message = errorMsg + " The Category cannot contain more than 300 characters, ";
}
msgList.add(message);
}
}else {
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "类别不能为空, ";
}else{
message = errorMsg + " The Category cannot null, ";
}
msgList.add(message);
}
//检验项目
if(StringUtils.isNotBlank(inspectionItem)){
if(inspectionItem.length() > 100){
if(inspectionItem.length() > 300){
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "检验项目不能超过100个字符, ";
message = errorMsg + "检验项目不能超过300个字符, ";
}else{
message = errorMsg + " The InspectionItem cannot contain more than 100 characters, ";
message = errorMsg + " The InspectionItem cannot contain more than 300 characters, ";
}
msgList.add(message);
}
}else {
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "检验项目不能为空, ";
}else{
message = errorMsg + " The InspectionItem cannot null, ";
}
msgList.add(message);
}
//配置项
if(StringUtils.isNotBlank(configItem)){
if(configItem.length() > 100){
if(configItem.length() > 300){
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "配置项不能超过100个字符, ";
message = errorMsg + "配置项不能超过300个字符, ";
}else{
message = errorMsg + " The ConfigItem cannot contain more than 100 characters, ";
message = errorMsg + " The ConfigItem cannot contain more than 300 characters, ";
}
msgList.add(message);
}
}else {
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "配置项不能为空, ";
}else{
message = errorMsg + " The ConfigItem cannot null, ";
}
msgList.add(message);
}
//责任领域
if(StringUtils.isNotBlank(dutyTerritory)){
@@ -884,14 +889,6 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
if(StringUtils.isNotBlank(value)){
authDummyInventoryInfoEO.setDutyTerritory(value);
}
}else {
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "责任领域不能为空, ";
}else{
message = errorMsg + " The Responsible Field cannot null, ";
}
msgList.add(message);
}
//交付物类型
if(StringUtils.isNotEmpty(deliverableType)){
@@ -900,14 +897,6 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
String treeId = getTreeId(categoryList, authDummyInventoryInfoEOTemp, treeNameList, value);
authDummyInventoryInfoEO.setDeliverableType(treeId);
}
}else{
String message = "";
if(CutEnum.CN.getValue().equals(authDummyInventoryInfoEOTemp.getCut())){
message = errorMsg + "交付物类型不能为空, ";
}else{
message = errorMsg + " The Deliverable Type cannot null, ";
}
msgList.add(message);
}
}
return msgList;
@@ -1704,8 +1704,20 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO);
}
// 批量更新
paramsConfigDataEOService.saveOrUpdateBatch(newConfigDataEOList);
if(CollectionUtils.isNotEmpty(newConfigDataEOList)){
List<String> paramsCollectManifestIdList = newConfigDataEOList.stream().map(ParamsConfigDataEO::getParamsCollectManifestId).distinct().collect(Collectors.toList());
QueryWrapper<ParamsConfigDataEO> pcdRemoveWrap = new QueryWrapper<>();
pcdRemoveWrap.lambda().in(ParamsConfigDataEO::getParamsCollectManifestId,paramsCollectManifestIdList);
this.paramsConfigDataEOService.remove(pcdRemoveWrap);
newConfigDataEOList.forEach(newConfigDataEO -> {
newConfigDataEO.setId(UUID.randomUUID().toString().replace("-",""));
});
this.paramsConfigDataEOService.saveOrUpdateBatch(newConfigDataEOList);
}
// // 批量更新
// paramsConfigDataEOService.saveOrUpdateBatch(newConfigDataEOList);
if (CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)) {
this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList);
@@ -1793,11 +1793,28 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
// 操作记录
StringBuilder logCnContent = new StringBuilder();
StringBuilder logEnContent = new StringBuilder();
logCnContent.append(loginUser.getUsername()).append("");
logEnContent.append(loginUser.getUsername()).append(" set ");
logCnContent.append(loginUser.getUsername());
logEnContent.append(loginUser.getUsername());
// 删除操作记录
StringBuilder deleteLogCnContent = new StringBuilder();
StringBuilder deleteLogEnContent = new StringBuilder();
deleteLogCnContent.append(loginUser.getUsername());
deleteLogEnContent.append(loginUser.getUsername());
// 添加操作记录
StringBuilder addLogCnContent = new StringBuilder();
StringBuilder addLogEnContent = new StringBuilder();
addLogCnContent.append(loginUser.getUsername());
addLogEnContent.append(loginUser.getUsername());
// 变更标识
boolean changeFlag = false;
// 删除标识
boolean deleteFlag = false;
// 新增标识
boolean addFlag = false;
String configNameCn = "";
String configNameEn = "";
@@ -1824,6 +1841,11 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
// 无法转ParamsConfigDataVO(遍历会出现该异常 LinkedHashMap cannot be cast to ParamsConfigDataVO
// List<Map<String, Object>> configDataVOList = (List<Map<String, Object>>) paramsReportConfigDataMap.get("list");
logCnContent.append("");
logEnContent.append(" set ");
logCnContent.append(paramsReportConfigEO.getConfigName()).append("");
logEnContent.append(paramsReportConfigEO.getConfigName());
Map<String, Object> paramsConfigDataVOMap = (Map<String, Object>) paramsReportConfigDataMap.get("paramsConfigData");
@@ -1831,6 +1853,8 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
String configDataId = paramsConfigDataMap.getKey();
List<Map<String, Object>> configDataVOList = (List<Map<String, Object>>) paramsConfigDataMap.getValue();
if (CollectionUtil.isNotEmpty(configDataVOList)) {
Integer orderNum = (Integer) configDataVOList.get(0).get("orderNum");
@@ -1999,22 +2023,106 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
}
}
QueryWrapper<ParamsReportConfigDataEO> removeConfigDataWrap = new QueryWrapper<>();
removeConfigDataWrap.lambda().eq(ParamsReportConfigDataEO::getParamsConfigId,paramsReportConfigEOId);
removeConfigDataWrap.lambda().eq(ParamsReportConfigDataEO::getParamsCollectManifestId,paramsCollectManifestId);
this.paramsReportConfigDataEOService.remove(removeConfigDataWrap);
paramsReportConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId);
paramsReportConfigDataEO.setParamsConfigId(paramsReportConfigEOId);
newConfigDataEOList.add(paramsReportConfigDataEO);
}
//
// logCnContent.append(paramsReportConfigEO.getConfigName()).append("的");
// logEnContent.append(paramsReportConfigEO.getConfigName());
}
QueryWrapper<ParamsReportConfigDataEO> prcdQueryWrap = new QueryWrapper<>();
prcdQueryWrap.lambda().eq(ParamsReportConfigDataEO::getParamsConfigId,paramsReportConfigEOId);
prcdQueryWrap.lambda().eq(ParamsReportConfigDataEO::getParamsCollectManifestId,paramsCollectManifestId);
List<ParamsReportConfigDataEO> prcdEoList = this.paramsReportConfigDataEOService.list(prcdQueryWrap);
if(CollectionUtils.isNotEmpty(prcdEoList)){
List<String> paramsConfigDataIdList = paramsConfigDataVOMap.entrySet().stream().map(e -> e.getKey()).distinct().collect(Collectors.toList());
logCnContent.append(paramsReportConfigEO.getConfigName()).append("");
logEnContent.append(paramsReportConfigEO.getConfigName());
List<String> newAddPcdDataIdList = paramsConfigDataVOMap.entrySet().stream().map(e -> e.getKey()).filter(e -> {
boolean flag = false;
// 如果key的长度是16位,则是新添加的
if (e.length() == 16) {
flag = true;
}
return flag;
}).distinct().collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(newAddPcdDataIdList)){
StringBuilder dataValueSb = new StringBuilder();
for (String newAddPcdDataId : newAddPcdDataIdList) {
List<Map<String,Object>> configDataVOList = (List<Map<String, Object>>) paramsConfigDataVOMap.get(newAddPcdDataId);
for (Map<String, Object> paramsConfigDataVO : configDataVOList) {
String type = (String) paramsConfigDataVO.get("type");
String dataValue = "";
if(ObjectUtils.isNotEmpty(paramsConfigDataVO.get("dataValue"))){
dataValue = String.valueOf(paramsConfigDataVO.get("dataValue"));
}
// 如果是附件 单独处理
if(StringUtils.equals(type,ConfigDataTypeEnum.FILE.getValue())){
}
dataValueSb.append("\"").append(dataValue).append("\",");
}
}
String dataValue = "";
if(StringUtils.isNotBlank(dataValueSb.toString())){
dataValue = dataValueSb.toString().substring(0,dataValueSb.length()-1);
}
addLogCnContent.append("").append(paramsReportConfigEO.getConfigName()).append("中添加了").append(dataValue).append("");
addLogEnContent.append("").append(paramsReportConfigEO.getConfigName()).append("中添加了").append(dataValue).append(",");
addFlag = true;
}
// 判断有没有被减掉的(删除的)
List<ParamsReportConfigDataEO> deletePrcdEoList = prcdEoList.stream().filter(prcdEo -> {
boolean flag = true;
for (String paramsConfigDataId : paramsConfigDataIdList) {
if(StringUtils.equals(prcdEo.getId(),paramsConfigDataId)){
flag = false;
break;
}
}
return flag;
}).collect(Collectors.toList());
// 如果有被删的数据 增加log记录
if(CollectionUtils.isNotEmpty(deletePrcdEoList)){
StringBuilder dataValueSb = new StringBuilder();
for (ParamsReportConfigDataEO paramsReportConfigDataEO : deletePrcdEoList) {
if(StringUtils.isNotBlank(paramsReportConfigDataEO.getTextData())){
dataValueSb.append("\"").append(paramsReportConfigDataEO.getTextData()).append("\",");
}
if(StringUtils.isNotBlank(paramsReportConfigDataEO.getPullData())){
dataValueSb.append("\"").append(paramsReportConfigDataEO.getPullData()).append("\",");
}
if(StringUtils.isNotBlank(paramsReportConfigDataEO.getFileConnectId())){
dataValueSb.append("\"").append(paramsReportConfigDataEO.getFileConnectId()).append("\",");
}
}
String dataValue = "";
if(StringUtils.isNotBlank(dataValueSb.toString())){
dataValue = dataValueSb.toString().substring(0,dataValueSb.length()-1);
}
deleteLogCnContent.append("").append(paramsReportConfigEO.getConfigName()).append("中删除了").append(dataValue).append("");
deleteLogEnContent.append("").append(paramsReportConfigEO.getConfigName()).append("中删除了").append(dataValue).append(",");
deleteFlag = true;
}
}
QueryWrapper<ParamsReportConfigDataEO> removeConfigDataWrap = new QueryWrapper<>();
removeConfigDataWrap.lambda().eq(ParamsReportConfigDataEO::getParamsConfigId,paramsReportConfigEOId);
removeConfigDataWrap.lambda().eq(ParamsReportConfigDataEO::getParamsCollectManifestId,paramsCollectManifestId);
this.paramsReportConfigDataEOService.remove(removeConfigDataWrap);
//******************这里是当前配置的循环结束了******************
//判断结尾是不是该配置的名字--如果是(说明该配置没有被改变)需要从logCnContent中删除该配置名字
@@ -2037,7 +2145,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
}
}
ParamsReportDetailLogEO insertLogEO = new ParamsReportDetailLogEO();
/*if (logCnContent.toString().endsWith("")) {
String ramarks = "";
if(map.get("remarks") != null){
@@ -2051,6 +2159,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
insertLogEOList.add(insertLogEO);
}*/
if(changeFlag){
ParamsReportDetailLogEO insertLogEO = new ParamsReportDetailLogEO();
String ramarks = "";
if(map.get("remarks") != null){
ramarks = map.get("remarks").toString();
@@ -2066,6 +2175,39 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
insertLogEO.setRemarks(ramarks);
insertLogEOList.add(insertLogEO);
}
if(deleteFlag){
ParamsReportDetailLogEO insertLogEO = new ParamsReportDetailLogEO();
String ramarks = "";
if(map.get("remarks") != null){
ramarks = map.get("remarks").toString();
}
insertLogEO.setLogCnContent(deleteLogCnContent.toString().substring(0, deleteLogCnContent.lastIndexOf("")));
insertLogEO.setLogEnContent(deleteLogEnContent.toString().substring(0, deleteLogEnContent.lastIndexOf(",")));
insertLogEO.setParamsReportId(paramsManifestId);
insertLogEO.setParamsReportDetailId(paramsCollectManifestId);
insertLogEO.setRemarks(ramarks);
insertLogEOList.add(insertLogEO);
}
if(addFlag){
ParamsReportDetailLogEO insertLogEO = new ParamsReportDetailLogEO();
String ramarks = "";
if(map.get("remarks") != null){
ramarks = map.get("remarks").toString();
}
insertLogEO.setLogCnContent(addLogCnContent.toString().substring(0, addLogCnContent.lastIndexOf("")));
insertLogEO.setLogEnContent(addLogEnContent.toString().substring(0, addLogEnContent.lastIndexOf(",")));
insertLogEO.setParamsReportId(paramsManifestId);
insertLogEO.setParamsReportDetailId(paramsCollectManifestId);
insertLogEO.setRemarks(ramarks);
insertLogEOList.add(insertLogEO);
}
}
// 批量更新
@@ -203,16 +203,17 @@ public class OtaBaCxAqcsController extends JeroController<OtaBaCxAqcs, IOtaBaCxA
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
OtaBaCxAqcs res;
StringBuilder errMsg = new StringBuilder();
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
res = this.otaBaCxAqcsService.importData(file, params[0], cut);
res = this.otaBaCxAqcsService.importData(file, params[0], cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK(res);
return Result.error(errMsg.toString());
}
}
@@ -196,16 +196,17 @@ public class OtaBaCxJbxxController extends JeroController<OtaBaCxJbxx, IOtaBaCxJ
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
OtaBaCxJbxx res;
StringBuilder errMsg = new StringBuilder();
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
res = this.otaBaCxJbxxService.importData(file, otaId, cut);
res = this.otaBaCxJbxxService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK(res);
return Result.error(errMsg.toString());
}
}
@@ -199,16 +199,17 @@ public class OtaBaCxJsfzbacsController extends JeroController<OtaBaCxJsfzbacs, I
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
this.otaBaCxJsfzbacsService.importData(file, otaId, cut);
this.otaBaCxJsfzbacsService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK();
return Result.error(errMsg.toString());
}
}
@@ -200,16 +200,17 @@ public class OtaBaCxKsjjsmccsController extends JeroController<OtaBaCxKsjjsmccs,
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
this.otaBaCxKsjjsmccsService.importData(file, otaId, cut);
this.otaBaCxKsjjsmccsService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK();
return Result.error(errMsg.toString());
}
}
@@ -202,16 +202,17 @@ public class OtaBaCxKsjxtmccsController extends JeroController<OtaBaCxKsjxtmccs,
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
this.otaBaCxKsjxtmccsService.importData(file, otaId, cut);
this.otaBaCxKsjxtmccsService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK();
return Result.error(errMsg.toString());
}
}
@@ -87,7 +87,7 @@ public class OtaBaCxListController extends JeroController<OtaBaCxList, IOtaBaCxL
queryWrapper.like(OtaBaCxList::getCpmc, cpmc);
}
String cpxh = req.getParameter("cpmc");
String cpxh = req.getParameter("cpxh");
if (StringUtils.isNotBlank(cpxh)) {
cpxh = cpxh.replace("%", "\\%");
queryWrapper.like(OtaBaCxList::getCpxh, cpxh);
@@ -237,13 +237,15 @@ public class OtaBaCxListController extends JeroController<OtaBaCxList, IOtaBaCxL
// @RequiresPermissions("otaBaCx:importData")
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut) throws Exception {
StringBuilder errMsg = new StringBuilder();
errMsg.append("导入成功! 提示信息:");
try {
this.otaBaCxListService.importData(file, cut);
this.otaBaCxListService.importData(file, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK("导入成功");
return Result.error(errMsg.toString());
}
@ApiOperation(value = "车型及功能备案列表-数据导出")
@@ -197,17 +197,18 @@ public class OtaBaCxZxsjyqController extends JeroController<OtaBaCxZxsjyq, IOtaB
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
OtaBaCxZxsjyq res;
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
res = this.otaBaCxZxsjyqService.importData(file, otaId, cut);
res = this.otaBaCxZxsjyqService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK(res);
return Result.error(errMsg.toString());
}
}
@@ -202,16 +202,17 @@ public class OtaBaSjGgnrfsController extends JeroController<OtaBaSjGgnrfs, IOtaB
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
this.otaBaSjGgnrfsService.importData(file, otaId, cut);
this.otaBaSjGgnrfsService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK();
return Result.error(errMsg.toString());
}
}
@@ -4,6 +4,7 @@ import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.ota.entity.OtaBaSjGnxtwh;
@@ -22,147 +23,155 @@ import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
/**
/**
* @Description: 车型备案-功能系统维护
* @Author: jero-boot
* @Date: 2023-03-28
* @Date: 2023-03-28
* @Version: V1.0
*/
@Api(tags="车型备案-功能系统维护")
@Api(tags = "车型备案-功能系统维护")
@RestController
@RequestMapping("/ota/otaBaSjGnxtwh")
@Slf4j
public class OtaBaSjGnxtwhController extends JeroController<OtaBaSjGnxtwh, IOtaBaSjGnxtwhService> {
@Autowired
private IOtaBaSjGnxtwhService otaBaSjGnxtwhService;
/**
* 分页列表查询
*
* @param otaBaSjGnxtwh
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "车型备案-功能系统维护-分页列表查询")
@ApiOperation(value="车型备案-功能系统维护-分页列表查询", notes="车型备案-功能系统维护-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(OtaBaSjGnxtwh otaBaSjGnxtwh,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaSjGnxtwh> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjGnxtwh, req.getParameterMap());
Page<OtaBaSjGnxtwh> page = new Page<OtaBaSjGnxtwh>(pageNo, pageSize);
queryWrapper.orderByDesc("create_time");
IPage<OtaBaSjGnxtwh> pageList = otaBaSjGnxtwhService.page(page, queryWrapper);
return Result.OK(pageList);
}
@Autowired
private IOtaBaSjGnxtwhService otaBaSjGnxtwhService;
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "车型备案-功能系统维护-列表查询")
@ApiOperation(value="车型备案-功能系统维护-列表查询", notes="车型备案-功能系统维护-列表查询")
@GetMapping(value = "/list")
public Result<List<OtaBaSjGnxtwh>> queryList() {
* 分页列表查询
*
* @param otaBaSjGnxtwh
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "车型备案-功能系统维护-分页列表查询")
@ApiOperation(value = "车型备案-功能系统维护-分页列表查询", notes = "车型备案-功能系统维护-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(OtaBaSjGnxtwh otaBaSjGnxtwh,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaSjGnxtwh> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjGnxtwh, req.getParameterMap());
Page<OtaBaSjGnxtwh> page = new Page<OtaBaSjGnxtwh>(pageNo, pageSize);
queryWrapper.orderByDesc("create_time");
IPage<OtaBaSjGnxtwh> pageList = otaBaSjGnxtwhService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "车型备案-功能系统维护-列表查询")
@ApiOperation(value = "车型备案-功能系统维护-列表查询", notes = "车型备案-功能系统维护-列表查询")
@GetMapping(value = "/list")
public Result<List<OtaBaSjGnxtwh>> queryList() {
List<OtaBaSjGnxtwh> list = otaBaSjGnxtwhService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param otaBaSjGnxtwh
* @return
*/
@AutoLog(value = "车型备案-功能系统维护-添加")
@ApiOperation(value="车型备案-功能系统维护-添加", notes="车型备案-功能系统维护-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OtaBaSjGnxtwh otaBaSjGnxtwh) {
otaBaSjGnxtwhService.add(otaBaSjGnxtwh);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param otaBaSjGnxtwh
* @return
*/
@AutoLog(value = "车型备案-功能系统维护-编辑")
@ApiOperation(value="车型备案-功能系统维护-编辑", notes="车型备案-功能系统维护-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody OtaBaSjGnxtwh otaBaSjGnxtwh) {
otaBaSjGnxtwhService.editById(otaBaSjGnxtwh);
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) {
otaBaSjGnxtwhService.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.otaBaSjGnxtwhService.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) {
OtaBaSjGnxtwh otaBaSjGnxtwh = otaBaSjGnxtwhService.queryById(id);
if(otaBaSjGnxtwh==null) {
return Result.error("未找到对应数据");
}
return Result.OK(otaBaSjGnxtwh);
}
}
/**
* 导出excel
*
* @param request
* @param otaBaSjGnxtwh
*/
* 添加
*
* @param otaBaSjGnxtwh
* @return
*/
@AutoLog(value = "车型备案-功能系统维护-添加")
@ApiOperation(value = "车型备案-功能系统维护-添加", notes = "车型备案-功能系统维护-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OtaBaSjGnxtwh otaBaSjGnxtwh) {
try {
otaBaSjGnxtwhService.add(otaBaSjGnxtwh);
} catch (Exception e) {
return Result.error(e.getMessage());
}
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param otaBaSjGnxtwh
* @return
*/
@AutoLog(value = "车型备案-功能系统维护-编辑")
@ApiOperation(value = "车型备案-功能系统维护-编辑", notes = "车型备案-功能系统维护-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody OtaBaSjGnxtwh otaBaSjGnxtwh) {
try {
otaBaSjGnxtwhService.editById(otaBaSjGnxtwh);
} catch (Exception e) {
return Result.error(e.getMessage());
}
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) {
otaBaSjGnxtwhService.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.otaBaSjGnxtwhService.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) {
OtaBaSjGnxtwh otaBaSjGnxtwh = otaBaSjGnxtwhService.queryById(id);
if (otaBaSjGnxtwh == null) {
return Result.error("未找到对应数据");
}
return Result.OK(otaBaSjGnxtwh);
}
/**
* 导出excel
*
* @param request
* @param otaBaSjGnxtwh
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, OtaBaSjGnxtwh otaBaSjGnxtwh) {
return super.exportXls(request, otaBaSjGnxtwh, OtaBaSjGnxtwh.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, OtaBaSjGnxtwh.class);
@@ -233,13 +233,14 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
// @RequiresPermissions("otaBaCx:importData")
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut) throws Exception {
StringBuilder errMsg = new StringBuilder();
try {
this.otaBaSjListService.importData(file, cut);
this.otaBaSjListService.importData(file, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK("导入成功");
return Result.error(errMsg.toString());
}
@ApiOperation(value = "升级备案-数据导出")
@@ -200,16 +200,17 @@ public class OtaBaSjSjfzbhController extends JeroController<OtaBaSjSjfzbh, IOtaB
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
this.otaBaSjSjfzbhService.importData(file, otaId, cut);
this.otaBaSjSjfzbhService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK();
return Result.error(errMsg.toString());
}
}
@@ -195,16 +195,17 @@ public class OtaBaSjSjmbclController extends JeroController<OtaBaSjSjmbcl, IOtaB
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
OtaBaSjSjmbcl res;
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
res = this.otaBaSjSjmbclService.importData(file, otaId, cut);
res = this.otaBaSjSjmbclService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK(res);
return Result.error(errMsg.toString());
}
}
@@ -196,17 +196,18 @@ public class OtaBaSjSjmbcxController extends JeroController<OtaBaSjSjmbcx, IOtaB
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
OtaBaSjSjmbcx res;
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
res = this.otaBaSjSjmbcxService.importData(file, otaId, cut);
res = this.otaBaSjSjmbcxService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK(res);
return Result.error(errMsg.toString());
}
}
@@ -202,16 +202,17 @@ public class OtaBaSjSjxtbhController extends JeroController<OtaBaSjSjxtbh, IOtaB
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
this.otaBaSjSjxtbhService.importData(file, otaId, cut);
this.otaBaSjSjxtbhService.importData(file, otaId, cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK();
return Result.error(errMsg.toString());
}
}
@@ -201,17 +201,18 @@ public class OtaBaSjSjyxpgController extends JeroController<OtaBaSjSjyxpg, IOtaB
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "cut", required = false) String cut,
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
StringBuilder errMsg = new StringBuilder();
OtaBaSjSjyxpg res;
try {
String[] params = otaId.split("\\?");
otaId = params[0].equals("null") ? "" : params[0];
cut = params[1].replace("cut=", "");
res = this.otaBaSjSjyxpgService.importData(file, params[0], cut);
res = this.otaBaSjSjyxpgService.importData(file, params[0], cut, errMsg);
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.getMessage());
}
return Result.OK(res);
return Result.error(errMsg.toString());
}
}
@@ -102,4 +102,8 @@ public class OtaBaCxAqcs implements Serializable {
@TableField(exist = false)
private List<AttachmentEO> zmclList = new ArrayList<>();
public void addZmcl(AttachmentEO zmcl) {
this.zmclList.add(zmcl);
}
}
@@ -25,107 +25,146 @@ 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_cx_zxsjyq")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="ota_ba_cx_zxsjyq对象", description="车型备案-在线升级要求")
@ApiModel(value = "ota_ba_cx_zxsjyq对象", description = "车型备案-在线升级要求")
public class OtaBaCxZxsjyq 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 bhsjb;
/**保护车辆版本*/
@Excel(name = "保护车辆版本", width = 15)
/**
* 保护车辆版本
*/
@Excel(name = "保护车辆版本", width = 15)
@ApiModelProperty(value = "保护车辆版本")
private java.lang.String bhclbb;
/**车辆更新能力*/
@Excel(name = "车辆更新能力", width = 15)
/**
* 车辆更新能力
*/
@Excel(name = "车辆更新能力", width = 15)
@ApiModelProperty(value = "车辆更新能力")
private java.lang.String clgxnl;
/**车辆升级条件*/
@Excel(name = "车辆升级条件", width = 15)
/**
* 车辆升级条件
*/
@Excel(name = "车辆升级条件", width = 15)
@ApiModelProperty(value = "车辆升级条件")
private java.lang.String clsjtj;
/**车辆升级所需电量*/
@Excel(name = "车辆升级所需电量", width = 15)
/**
* 车辆升级所需电量
*/
@Excel(name = "车辆升级所需电量", width = 15)
@ApiModelProperty(value = "车辆升级所需电量")
private java.lang.String clsjdl;
/**升级保护车辆安全*/
@Excel(name = "升级保护车辆安全", width = 15)
/**
* 升级保护车辆安全
*/
@Excel(name = "升级保护车辆安全", width = 15)
@ApiModelProperty(value = "升级保护车辆安全")
private java.lang.String sjbhaq;
/**升级所满足的安全条件*/
@Excel(name = "升级所满足的安全条件", width = 15)
/**
* 升级所满足的安全条件
*/
@Excel(name = "升级所满足的安全条件", width = 15)
@ApiModelProperty(value = "升级所满足的安全条件")
private java.lang.String sjantj;
/**升级失败安全状态*/
@Excel(name = "升级失败安全状态", width = 15)
/**
* 升级失败安全状态
*/
@Excel(name = "升级失败安全状态", width = 15)
@ApiModelProperty(value = "升级失败安全状态")
private java.lang.String sjsbaq;
/**升级公告*/
@Excel(name = "升级公告", width = 15)
/**
* 升级公告
*/
@Excel(name = "升级公告", width = 15)
@ApiModelProperty(value = "升级公告")
private java.lang.String sjgg;
/**升级结果状态*/
@Excel(name = "升级结果状态", width = 15)
/**
* 升级结果状态
*/
@Excel(name = "升级结果状态", width = 15)
@ApiModelProperty(value = "升级结果状态")
private java.lang.String sjzt;
/**证明材料*/
@Excel(name = "证明材料", width = 15)
/**
* 证明材料
*/
@Excel(name = "证明材料", width = 15)
@ApiModelProperty(value = "证明材料")
private java.lang.String zmcl;
@TableField(exist = false)
private List<AttachmentEO> zmclList = new ArrayList<>();
public void addZmcl(AttachmentEO zmcl) {
this.zmclList.add(zmcl);
}
}
@@ -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;
}
}
@@ -3,215 +3,221 @@ package com.jero.modules.ota.enums;
public enum OtaTitleEnum {
CPDJBH("cpdjbh", "产品登记编号", "0"),
GGPC("ggpc", "公告批次", "0"),
CPSB("cpsb", "产品商标", "0"),
CPMC("cpmc", "产品名称", "0"),
CPXH("cpxh", "产品型号", "0"),
BAZT("bazt", "备案状态", "recordstatus"),
BATJSJ("batjsj", "备案提交时间", "0"),
CJSJ("cjsj", "创建时间", "0"),
BZ("bz", "备注", "0"),
CPDJBH("cpdjbh", "产品登记编号", "0", "Product registration number", 50),
GGPC("ggpc", "公告批次", "0", "Notice batch", 500),
CPSB("cpsb", "产品商标", "0", "Product Trademark", 50),
CPMC("cpmc", "产品名称", "0", "Product Name", 50),
CPXH("cpxh", "产品型号", "0", "Product Model", 50),
BAZT("bazt", "备案状态", "recordstatus", "Record status", 0),
BATJSJ("batjsj", "备案提交时间", "0", "Filing time", 50),
CJSJ("cjsj", "创建时间", "0", "Create Time", 50),
BZ("bz", "备注", "0", "remarks", 500),
CXMB("cxmb", "车型模板", "0"),
// QYMC("qymc", "企业名称", "0"),
DJBH("djbh", "产品登记编号", "0"),
CPLB("cplb", "产品类别", "product_category"),
DLLX1("dllx1", "车辆动力类型", "0"),
DLLX2("dllx2", "车辆动力类型", "0"),
TXZD("txzd", "通信终端", "communication_terminal"),
CDOTASJ("cdotasj", "车端OTA升级管理系统", "0"),
CXMB("cxmb", "车型模板", "0", "Model template", 500),
// QYMC("qymc", "企业名称", "0","enterprise name ",0),
DJBH("djbh", "产品登记编号", "0", "Product Registration Number ", 50),
CPLB("cplb", "产品类别", "product_category", "Product category", 0),
DLLX1("dllx1", "车辆动力类型", "0", "Vehicle Power Type", 50),
DLLX2("dllx2", "车辆动力类型", "0", "Vehicle Power Type", 50),
TXZD("txzd", "通信终端", "communication_terminal", "communication terminal", 0),
CDOTASJ("cdotasj", "车端OTA升级管理系统", "0", "OTA Upgrade Management System", 500),
BHSJB("bhsjb", "激光雷达-应保护升级包的真实性和完整性,以合理地防止其受到损害,并合理地防止无效升级", "2"),
BHCLBB("bhclbb", "激光雷达-应保护车辆上的软件版本(集),防止未经授权的修改", "2"),
CLGXNL("clgxnl", "升级功能要求-车辆应具备更新软件版本(集)的能力,应通过使用电子通信接口,至少用过标准接口(如OBD端口),以标准化的方式易于读取", "2"),
CLSJTJ("clsjtj", "升级功能要求-应确保车辆在执行软件升级之前满足先决条件", "2"),
CLSJDL("clsjdl", "升级功能要求-应确保只有当车辆有充足电量完成升级过程时,才能执行软件升级(包括可能恢复到以前版本或使车辆进入安全状态所需的电量)", "2"),
SJBHAQ("sjbhaq", "升级功能要求-当执行升级可能影响车辆安全时,应在升级执行过程中通过技术手段确保车辆安全", "2"),
SJANTJ("sjantj", "升级功能要求-若升级的执行影响驾驶安全,至少应满足: (a)确保升级执行期间无法驾驶车辆; (b)确保驾驶员不能使用任何可能影响车辆安全或成功执行升级的车辆功能", "2"),
SJSBAQ("sjsbaq", "升级功能要求-车辆能够恢复到以前的可用版本,或确保车辆处于安全状态。", "2"),
SJGG("sjgg", "用户告知要求-在升级执行前,应告知车辆用户升级信息,告知的信息应包括: (a)升级目的; (b)车辆功能升级所实施的任何变更; (c)完成升级执行的预计时间; (d)升级执行期间可能不可用的任何车辆功能; (e)可能帮助车辆用户安全执行升级的任何指导信息。", "2"),
SJZT("sjzt", "用户告知要求-在执行升级后,车辆应: (a)告知车辆用户车辆升级的结果(成功或失败); (b)若升级成功,告知车辆用户已实施的变更,用户手册(如果适用)的任何相关更新。", "2"),
BHSJB("bhsjb", "激光雷达-应保护升级包的真实性和完整性,以合理地防止其受到损害,并合理地防止无效升级", "2", "LiDAR - Shall protect the authenticity and integrity of the upgrade package to reasonably prevent damage to it and reasonably prevent ineffective upgrades", 0),
BHCLBB("bhclbb", "激光雷达-应保护车辆上的软件版本(集),防止未经授权的修改", "2", "Lidar - Software Versions on Vehicles should be protected (set) against unauthorized modifications", 0),
CLGXNL("clgxnl", "升级功能要求-车辆应具备更新软件版本(集)的能力,应通过使用电子通信接口,至少用过标准接口(如OBD端口),以标准化的方式易于读取", "2", "Upgrade function Requirements - The vehicle shall have the ability to update the software version (set) and shall be easily read in a standardized manner by using an electronic communication interface that has at least used a standard interface (such as an OBD port)", 0),
CLSJTJ("clsjtj", "升级功能要求-应确保车辆在执行软件升级之前满足先决条件", "2", "Upgrade function Requirements - should ensure that vehicle meets prerequisites before performing software upgrade", 0),
CLSJDL("clsjdl", "升级功能要求-应确保只有当车辆有充足电量完成升级过程时,才能执行软件升级(包括可能恢复到以前版本或使车辆进入安全状态所需的电量)", "2", "Upgrade Function Requirements - It shall be ensured that software upgrades (including the amount of power that may be required to restore to a previous version or bring the vehicle into a safe condition) are performed only when the vehicle has sufficient power to complete the upgrade process", 0),
SJBHAQ("sjbhaq", "升级功能要求-当执行升级可能影响车辆安全时,应在升级执行过程中通过技术手段确保车辆安全", "2", "Upgrade function Requirements - When performing an upgrade may affect the safety of the vehicle, the safety of the vehicle shall be ensured by technical means during the execution of the upgrade", 0),
SJANTJ("sjantj", "升级功能要求-若升级的执行影响驾驶安全,至少应满足: (a)确保升级执行期间无法驾驶车辆; (b)确保驾驶员不能使用任何可能影响车辆安全或成功执行升级的车辆功能", "2", "", 0),
SJSBAQ("sjsbaq", "升级功能要求-车辆能够恢复到以前的可用版本,或确保车辆处于安全状态。", "2", "Upgrade Function Requirements - If the execution of the upgrade affects driving safety, it shall at least: (a) ensure that the vehicle cannot be driven during the execution of the upgrade; (b) Ensure that the driver cannot use any vehicle feature that may affect the safety of the vehicle or the successful execution of the upgrade", 0),
SJGG("sjgg", "用户告知要求-在升级执行前,应告知车辆用户升级信息,告知的信息应包括: (a)升级目的; (b)车辆功能升级所实施的任何变更; (c)完成升级执行的预计时间; (d)升级执行期间可能不可用的任何车辆功能; (e)可能帮助车辆用户安全执行升级的任何指导信息。", "2", "", 0),
SJZT("sjzt", "用户告知要求-在执行升级后,车辆应: (a)告知车辆用户车辆升级的结果(成功或失败); (b)若升级成功,告知车辆用户已实施的变更,用户手册(如果适用)的任何相关更新。", "2", "Upgrade feature requirements - The ability to restore the vehicle to a previously available version, or to ensure that the vehicle is in a safe condition.", 0),
BHJZ("bhjz", "真实性、完整性保护机制", "protection_mechanism"),
FSXJZ("fsxjz", "防失效保护机制", "fail_safe_mechanism"),
SJSBCS("sjsbcs", "升级失败后车辆安全措施", "upgrade_failure"),
XXAQJZ("xxaqjz", "信息安全机制", "Information_security_mechanism"),
BHJZ("bhjz", "真实性、完整性保护机制", "protection_mechanism", "", 0),
FSXJZ("fsxjz", "防失效保护机制", "fail_safe_mechanism", "", 0),
SJSBCS("sjsbcs", "升级失败后车辆安全措施", "upgrade_failure", "", 0),
XXAQJZ("xxaqjz", "信息安全机制", "Information_security_mechanism", "", 0),
XTLB("xtlb", "系统类别", "0"),
SFKSJ("sfksj", "是否可升级", "2"),
SJBGCS("sjbgcs", "升级可能变更的《公告》技术参数", "0"),
//TPT("tpt", "系统-电子控制器架构拓扑图(附件需含拓扑图介绍)", "0"),
KZQMC("kzqmc", "电子控制器名称", "0"),
AQWZXDJ("aqwzxdj", "电子控制器汽车安全完整性等级(ASIL)", "0"),
KZQSCQY("kzqscqy", "电子控制器生产企业", "0"),
KZQXH("kzqxh", "电子控制器型号", "0"),
YJBBXX("yjbbxx", "硬件版本信息", "0"),
CSRJBBH("csrjbbh", "初始软件版本号", "0"),
CSRJBWZSJ("csrjbwzsj", "初始软件包的完整性验证数据", "0"),
SJSFYX("sjsfyx", "升级是否影响整车安全、节能、环保、防盗等性能", "0"),
CZXTLX("czxtlx", "操作系统类型", "0"),
CZXTSCQY("czxtscqy", "操作系统生产企业", "0"),
CZXTBBH("czxtbbh", "软件版本号", "0"),
XTLB("xtlb", "系统类别", "0", "System class", 50),
SFKSJ("sfksj", "是否可升级", "2", "Whether it can be upgraded", 0),
SJBGCS("sjbgcs", "升级可能变更的《公告》技术参数", "0", "Upgrade Bulletin technical parameters that may change", 500),
//TPT("tpt", "系统-电子控制器架构拓扑图(附件需含拓扑图介绍)", "0","",0),
KZQMC("kzqmc", "电子控制器名称", "0", "Electronic controller name", 50),
AQWZXDJ("aqwzxdj", "电子控制器汽车安全完整性等级(ASIL)", "0", "", 50),
KZQSCQY("kzqscqy", "电子控制器生产企业", "0", "", 50),
KZQXH("kzqxh", "电子控制器型号", "0", "", 50),
YJBBXX("yjbbxx", "硬件版本信息", "0", "", 50),
CSRJBBH("csrjbbh", "初始软件版本号", "0", "", 50),
CSRJBWZSJ("csrjbwzsj", "初始软件包的完整性验证数据", "0", "", 50),
SJSFYX("sjsfyx", "升级是否影响整车安全、节能、环保、防盗等性能", "0", "", 50),
CZXTLX("czxtlx", "操作系统类型", "0", "", 50),
CZXTSCQY("czxtscqy", "操作系统生产企业", "0", "", 50),
CZXTBBH("czxtbbh", "软件版本号", "0", "", 50),
GNMC("gnmc", "功能名称", "0"),
PZQK("pzqk", "配置情况", "2"),
JSZDHJB("jszdhjb", "驾驶自动化级别", "driving_automation_level"),
SJGGCS("sjggcs", "升级可能变更的《公告》技术参数", "0"),
GNMS("gnms", "功能描述", "0"),
SYTJ("sytj", "适用条件(边界条件)", "0"),
RJKFQY("rjkfqy", "软件开发企业", "0"),
CSYZSJ("csyzsj", "初始软件包的完整性验证数据", "0"),
FJ("fj", "附件", "0"),
GNMC("gnmc", "功能名称", "0", "", 50),
PZQK("pzqk", "配置情况", "2", "", 0),
JSZDHJB("jszdhjb", "驾驶自动化级别", "driving_automation_level", "", 0),
SJGGCS("sjggcs", "升级可能变更的《公告》技术参数", "0", "", 500),
GNMS("gnms", "功能描述", "0", "", 500),
SYTJ("sytj", "适用条件(边界条件)", "0", "", 500),
RJKFQY("rjkfqy", "软件开发企业", "0", "", 50),
CSYZSJ("csyzsj", "初始软件包的完整性验证数据", "0", "", 500),
FJ("fj", "附件", "0", "", 0),
WLAQYQ_PZ("jgldPz", "激光雷达-配置", "2"),
WLAQYQ_SL("jgldSl", "激光雷达-数量", "0"),
WLAQYQ_BZWZ("jgldBzwz", "激光雷达-布置位置", "0"),
WLAQYQ_GGXH("jgldGgxh", "激光雷达-规格型号", "0"),
WLAQYQ_SCQY("jgldScqy", "激光雷达-生产企业", "0"),
HMBLD_PZ("hmbldPz", "毫米波雷达-配置", "2"),
HMBLD_SL("hmbldSl", "毫米波雷达-数量", "0"),
HMBLD_BZWZ("hmbldBzwz", "毫米波雷达-布置位置", "0"),
HMBLD_GGXH("hmbldGgxh", "毫米波雷达-规格型号", "0"),
HMBLD_SCQY("hmbldScqy", "毫米波雷达-生产企业", "0"),
CSBLD_PZ("csbldPz", "超声波雷达-配置", "2"),
CSBLD_SL("csbldSl", "超声波雷达-数量", "0"),
CSBLD_BZWZ("csbldBzwz", "超声波雷达-布置位置", "0"),
CSBLD_GGXH("csbldGgxh", "超声波雷达-规格型号", "0"),
CSBLD_SCQY("csbldScqy", "超声波雷达-生产企业", "0"),
SXTHS_PZ("sxthsPz", "摄像头-倒车影像/360(环视)-配置", "2"),
SXTHS_SL("sxthsSl", "摄像头-倒车影像/360(环视)-数量", "0"),
SXTHS_BZWZ("sxthsBzwz", "摄像头-倒车影像/360(环视)-布置位置", "0"),
SXTHS_GGXH("sxthsGgxh", "摄像头-倒车影像/360(环视)-规格型号", "0"),
SXTHS_SCQY("sxthsScqy", "摄像头-倒车影像/360(环视)-生产企业", "0"),
SXTDSD_PZ("sxtdsdPz", "摄像头-单目/双目/多目-配置", "2"),
SXTDSD_SL("sxtdsdSl", "摄像头-单目双目多目-数量", "0"),
SXTDSD_BZWZ("sxtdsdBzwz", "摄像头-单目双多目-布置位置", "0"),
SXTDSD_GGXH("sxtdsdGgxh", "摄像头-单目/双目/多目-规格型号", "0"),
SXTDSD_SCQY("sxtdsdScqy", "摄像头-单目/双目/多目-生产企业", "0"),
JSYJK_PZ("jsyjkPz", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-配置", "2"),
JSYJK_SL("jsyjkSl", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-数量", "0"),
JSYJK_BZWZ("jsyjkBzwz", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-布置位置", "0"),
JSYJK_GGXH("jsyjkGgxh", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-规格型号", "0"),
JSYJK_SCQY("jsyjkScqy", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-生产企业", "0"),
JSYHW_PZ("jsyhwPz", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-配置", "2"),
JSYHW_SL("jsyhwSl", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-数量", "0"),
JSYHW_BZWZ("jsyhwBzwz", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-布置位置", "0"),
JSYHW_GGXH("jsyhwGgxh", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-规格型号", "0"),
JSYHW_SCQY("jsyhwScqy", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-生产企业", "0"),
CZWXDW_PZ("czwxdwPz", "定位及导航系统-车载卫星定位设备(接收卫星信号及辅助定位信号的装置,PPP/GNSS/RTK-配置", "2"),
CZWXDW_GGXH("czwxdwGgxh", "定位及导航系统-车载卫星定位设备(接收卫星信号及辅助定位信号的装置,PPP/GNSS/RTK)-规格型号", "0"),
CZWXDW_SCQY("czwxdwScqy", "定位及导航系统-车载卫星定位设备(接收卫星信号及辅助定位信号的装置,PPP/GNSS/RTK)-生产企业", "0"),
GXDH_PZ("gxdhPz", "定位及导航系统-惯性导航系统-配置", "2"),
GXDH_GGXH("gxdhGgxh", "定位及导航系统-惯性导航系统-规格型号", "0"),
GXDH_SCQY("gxdhScqy", "定位及导航系统-惯性导航系统-生产企业", "0"),
LSJ_PZ("lsjPz", "定位及导航系统-轮速计-配置", "2"),
LSJ_GGXH("lsjGgxh", "定位及导航系统-轮速计-规格型号", "0"),
LSJ_SCQY("lsjScqy", "定位及导航系统-轮速计-生产企业", "0"),
GJDDT_PZ("gjddtPz", "定位及导航系统-高精度地图-配置", "2"),
GJDDT_GGXH("gjddtGgxh", "定位及导航系统-高精度地图-规格型号", "0"),
GJDDT_SCQY("gjddtScqy", "定位及导航系统-高精度地图-生产企业", "0"),
DZWL_PZ("dzwlPz", "定位及导航系统-电子围栏-配置", "2"),
DZWL_DXXGCS("dzwlDxxgcs", "定位及导航系统-电子围栏-定性描述相关场所", "0"),
CZTX_PZ("cztxPz", "车载通信系统-配置", "2"),
CZTX_XTMC("cztxXtmc", "车载通信系统-系统名称", "0"),
CZTX_GGXH("cztxGgxh", "车载通信系统-规格型号", "0"),
CZTX_SCQY("cztxScqy", "车载通信系统-生产企业", "0"),
CZTX_BBH("cztxBbh", "车载通信系统-版本号", "0"),
CZTX_KFQY("cztxKfqy", "车载通信系统-软件开发企业", "0"),
JSFZCZJ_PZ("jsfzczjPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-配置", "2"),
JSFZCZJ_MC("jsfzczjMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-操纵件名称", "0"),
JSFZCZJ_YJXH("jsfzczjYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-硬件规格型号", "0"),
JSFZCZJ_SCQY("jsfzczjScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-生产企业", "0"),
JSFZZSQ_PZ("jsfzzsqPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-配置", "2"),
JSFZZSQ_MC("jsfzzsqMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-指示器/信号装置名称", "0"),
JSFZZSQ_YJXH("jsfzzsqYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-硬件规格型号", "0"),
JSFZZSQ_SCQY("jsfzzsqScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-生产企业", "0"),
FXPTSTS_PZ("fxptstsPz", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-配置", "2"),
FXPTSTS_MC("fxptstsMc", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-指示器/信号装置名称", "0"),
FXPTSTS_YJXH("fxptstsYjxh", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-硬件规格型号", "0"),
FXPTSTS_SCQY("fxptstsScqy", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-生产企业", "0"),
JSYZYLTS_PZ("jsyzyltsPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-配置", "2"),
JSYZYLTS_MC("jsyzyltsMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-指示器/信号装置名称", "0"),
JSYZYLTS_YJXH("jsyzyltsYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-硬件规格型号", "0"),
JSYZYLTS_SCQY("jsyzyltsScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-生产企业", "0"),
DSSAD_PZ("dssadPz", "自动驾驶数据记录系统(DSSAD)-系统配置", "2"),
DSSAD_GGXH("dssadGgxh", "自动驾驶数据记录系统(DSSAD)-规格型号", "0"),
DSSAD_SCQY("dssadScqy", "自动驾驶数据记录系统(DSSAD)-生产企业", "0"),
EDR_PZ("edrPz", "事件数据记录系统(EDR)-配置", "2"),
EDR_GGXH("edrGgxh", "事件数据记录系统(EDR)-规格型号", "0"),
EDR_SCQY("edrScqy", "事件数据记录系统(EDR)-生产企业", "0"),
WLAQYQ_PZ("jgldPz", "激光雷达-配置", "2", "", 0),
WLAQYQ_SL("jgldSl", "激光雷达-数量", "0", "", 50),
WLAQYQ_BZWZ("jgldBzwz", "激光雷达-布置位置", "0", "", 50),
WLAQYQ_GGXH("jgldGgxh", "激光雷达-规格型号", "0", "", 0),
WLAQYQ_SCQY("jgldScqy", "激光雷达-生产企业", "0", "", 50),
HMBLD_PZ("hmbldPz", "毫米波雷达-配置", "2", "", 0),
HMBLD_SL("hmbldSl", "毫米波雷达-数量", "0", "", 50),
HMBLD_BZWZ("hmbldBzwz", "毫米波雷达-布置位置", "0", "", 50),
HMBLD_GGXH("hmbldGgxh", "毫米波雷达-规格型号", "0", "", 50),
HMBLD_SCQY("hmbldScqy", "毫米波雷达-生产企业", "0", "", 50),
CSBLD_PZ("csbldPz", "超声波雷达-配置", "2", "", 0),
CSBLD_SL("csbldSl", "超声波雷达-数量", "0", "", 50),
CSBLD_BZWZ("csbldBzwz", "超声波雷达-布置位置", "0", "", 50),
CSBLD_GGXH("csbldGgxh", "超声波雷达-规格型号", "0", "", 50),
CSBLD_SCQY("csbldScqy", "超声波雷达-生产企业", "0", "", 50),
SXTHS_PZ("sxthsPz", "摄像头-倒车影像/360(环视)-配置", "2", "", 0),
SXTHS_SL("sxthsSl", "摄像头-倒车影像/360(环视)-数量", "0", "", 50),
SXTHS_BZWZ("sxthsBzwz", "摄像头-倒车影像/360(环视)-布置位置", "0", "", 50),
SXTHS_GGXH("sxthsGgxh", "摄像头-倒车影像/360(环视)-规格型号", "0", "", 50),
SXTHS_SCQY("sxthsScqy", "摄像头-倒车影像/360(环视)-生产企业", "0", "", 50),
SXTDSD_PZ("sxtdsdPz", "摄像头-单目/双目/多目-配置", "2", "", 50),
SXTDSD_SL("sxtdsdSl", "摄像头-单目双目多目-数量", "0", "", 50),
SXTDSD_BZWZ("sxtdsdBzwz", "摄像头-单目双多目-布置位置", "0", "", 50),
SXTDSD_GGXH("sxtdsdGgxh", "摄像头-单目/双目/多目-规格型号", "0", "", 50),
SXTDSD_SCQY("sxtdsdScqy", "摄像头-单目/双目/多目-生产企业", "0", "", 50),
JSYJK_PZ("jsyjkPz", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-配置", "2", "", 0),
JSYJK_SL("jsyjkSl", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-数量", "0", "", 50),
JSYJK_BZWZ("jsyjkBzwz", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-布置位置", "0", "", 50),
JSYJK_GGXH("jsyjkGgxh", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-规格型号", "0", "", 50),
JSYJK_SCQY("jsyjkScqy", "驾驶员注意力监测系统DMS-驾驶员监控摄像头-生产企业", "0", "", 50),
JSYHW_PZ("jsyhwPz", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-配置", "2", "", 0),
JSYHW_SL("jsyhwSl", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-数量", "0", "", 50),
JSYHW_BZWZ("jsyhwBzwz", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-布置位置", "0", "", 50),
JSYHW_GGXH("jsyhwGgxh", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-规格型号", "0", "", 50),
JSYHW_SCQY("jsyhwScqy", "驾驶员注意力监测系统DMS-驾驶员监控红外传感器-生产企业", "0", "", 50),
CZWXDW_PZ("czwxdwPz", "定位及导航系统-车载卫星定位设备(接收卫星信号及辅助定位信号的装置,PPP/GNSS/RTK-配置", "2", "", 0),
CZWXDW_GGXH("czwxdwGgxh", "定位及导航系统-车载卫星定位设备(接收卫星信号及辅助定位信号的装置,PPP/GNSS/RTK)-规格型号", "0", "", 50),
CZWXDW_SCQY("czwxdwScqy", "定位及导航系统-车载卫星定位设备(接收卫星信号及辅助定位信号的装置,PPP/GNSS/RTK)-生产企业", "0", "", 50),
GXDH_PZ("gxdhPz", "定位及导航系统-惯性导航系统-配置", "2", "", 0),
GXDH_GGXH("gxdhGgxh", "定位及导航系统-惯性导航系统-规格型号", "0", "", 50),
GXDH_SCQY("gxdhScqy", "定位及导航系统-惯性导航系统-生产企业", "0", "", 50),
LSJ_PZ("lsjPz", "定位及导航系统-轮速计-配置", "2", "", 0),
LSJ_GGXH("lsjGgxh", "定位及导航系统-轮速计-规格型号", "0", "", 50),
LSJ_SCQY("lsjScqy", "定位及导航系统-轮速计-生产企业", "0", "", 50),
GJDDT_PZ("gjddtPz", "定位及导航系统-高精度地图-配置", "2", "", 0),
GJDDT_GGXH("gjddtGgxh", "定位及导航系统-高精度地图-规格型号", "0", "", 50),
GJDDT_SCQY("gjddtScqy", "定位及导航系统-高精度地图-生产企业", "0", "", 50),
DZWL_PZ("dzwlPz", "定位及导航系统-电子围栏-配置", "2", "", 0),
DZWL_DXXGCS("dzwlDxxgcs", "定位及导航系统-电子围栏-定性描述相关场所", "0", "", 50),
CZTX_PZ("cztxPz", "车载通信系统-配置", "2", "", 0),
CZTX_XTMC("cztxXtmc", "车载通信系统-系统名称", "0", "", 50),
CZTX_GGXH("cztxGgxh", "车载通信系统-规格型号", "0", "", 50),
CZTX_SCQY("cztxScqy", "车载通信系统-生产企业", "0", "", 50),
CZTX_BBH("cztxBbh", "车载通信系统-版本号", "0", "", 50),
CZTX_KFQY("cztxKfqy", "车载通信系统-软件开发企业", "0", "", 50),
JSFZCZJ_PZ("jsfzczjPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-配置", "2", "", 0),
JSFZCZJ_MC("jsfzczjMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-操纵件名称", "0", "", 50),
JSFZCZJ_YJXH("jsfzczjYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-硬件规格型号", "0", "", 50),
JSFZCZJ_SCQY("jsfzczjScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-生产企业", "0", "", 50),
JSFZZSQ_PZ("jsfzzsqPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-配置", "2", "", 0),
JSFZZSQ_MC("jsfzzsqMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-指示器/信号装置名称", "0", "", 50),
JSFZZSQ_YJXH("jsfzzsqYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-硬件规格型号", "0", "", 50),
JSFZZSQ_SCQY("jsfzzsqScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-生产企业", "0", "", 50),
FXPTSTS_PZ("fxptstsPz", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-配置", "2", "", 0),
FXPTSTS_MC("fxptstsMc", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-指示器/信号装置名称", "0", "", 50),
FXPTSTS_YJXH("fxptstsYjxh", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-硬件规格型号", "0", "", 50),
FXPTSTS_SCQY("fxptstsScqy", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-生产企业", "0", "", 50),
JSYZYLTS_PZ("jsyzyltsPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-配置", "2", "", 0),
JSYZYLTS_MC("jsyzyltsMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-指示器/信号装置名称", "0", "", 50),
JSYZYLTS_YJXH("jsyzyltsYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-硬件规格型号", "0", "", 50),
JSYZYLTS_SCQY("jsyzyltsScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-生产企业", "0", "", 50),
DSSAD_PZ("dssadPz", "自动驾驶数据记录系统(DSSAD)-系统配置", "2", "", 0),
DSSAD_GGXH("dssadGgxh", "自动驾驶数据记录系统(DSSAD)-规格型号", "0", "", 50),
DSSAD_SCQY("dssadScqy", "自动驾驶数据记录系统(DSSAD)-生产企业", "0", "", 50),
EDR_PZ("edrPz", "事件数据记录系统(EDR)-配置", "2", "", 0),
EDR_GGXH("edrGgxh", "事件数据记录系统(EDR)-规格型号", "0", "", 50),
EDR_SCQY("edrScqy", "事件数据记录系统(EDR)-生产企业", "0", "", 50),
BJMC("bjmc", "部件名称", "0"),
YJGGXH("yjggxh", "硬件规格型号", "0"),
YJSCQY("yjscqy", "硬件生产企业", "0"),
RJBB("rjbb", "软件版本", "0"),
BZWZ("bzwz", "布置位置", "0"),
BJMC("bjmc", "部件名称", "0", "", 50),
YJGGXH("yjggxh", "硬件规格型号", "0", "", 50),
YJSCQY("yjscqy", "硬件生产企业", "0", "", 50),
RJBB("rjbb", "软件版本", "0", "", 50),
BZWZ("bzwz", "布置位置", "0", "", 50),
SJBBHCS("sjbbhcs", "软件版本(集)识别与存储", "0"),
SJBBHCS("sjbbhcs", "软件版本(集)识别与存储", "0", "", 500),
BABH("babh", "备案编号", "0"),
BAPC("bapc", "备案批次", "0"),
ZSL("zsl", "总数量", "0"),
SCRQKS("scrqks", "生产日期开始", "3"),
SCRQJS("scrqjs", "生产日期结束", "3"),
VIN_LIST("vinList", "VIN码清单", "0"),
SJMD("sjmd", "升级目的", "uipgrade_purpose"),
SFBGCS("sfbgcs", "是否变更对应车型的《公告》技术参数", "2"),
JSXNBH("jsxnbh", "是否涉及性能变化", "2"),
FHGD("fhgd", "是否符合国家法律、行政法规、规章规定,以及道路机动车辆公告管理相关国家技术标准及安全技术条件等", "2"),
ZDJSXG("zdjsxg", "是否涉及汽车自动驾驶功能相关升级", "2"),
JRXXG("jrxxg", "兼容性评估相关", "2"),
ZXSJ("zxsj", "如何执行升级", "conditions_upgrades"),
AQJZ("aqjz", "升级失败或中断后,车辆采取的安全机制", "upgrade_failed"),
SFYXAQ("sfyxaq", "升级活动是否影响车辆安全", "2"),
YHQR("yhqr", "升级活动是否提供用户确认选项", "2"),
SJBCS("sjbcs", "升级包测试", "package_test"),
AQKKX("aqkkx", "是否已验证确认在线升级活动的安全性和可靠性", "2"),
// BGFJ("bgfj", "提供变更或扩展后的《公告》批次及证明材料", "0"),
// CLFJ("clfj", "提供证明材料", "0"),
XTMC("xtmc", "系统名称", "0"),
SJQBGCS("sjqbgcs", "升级前已变更《公告》参数的对应调整", "0"),
SJHBGCS("sjhbgcs", "升级后已变更《公告》参数的对应调整", "0"),
SJKZQMC("sjkzqmc", "升级的电子控制器名称", "0"),
YJBB("yjbb", "适配的硬件版本", "0"),
SJQRJBB("sjqrjbb", "软件版本号升级前", "0"),
SJHRJBB("sjhrjbb", "软件版本号升级后", "0"),
SJQCZXT("sjqczxt", "操作系统版本号升级前", "0"),
SJHCZXT("sjhczxt", "操作系统版本号升级后", "0"),
CSRJSJ("csrjsj", "初始软件包的完整性数据", "0"),
SJBYZSJ("sjbyzsj", "升级包完整性验证数据", "0"),
SJBDX("sjbdx", "升级包大小", "0"),
SFCFSJ("sfcfsj", "是否差分升级", "0"),
SJMDLX("sjmdlx", "升级目的类型", "0"),
GNBGMS("gnbgms", "功能变更描述", "0"),
SYTJBG("sytjbg", "适用条件变更", "0"),
SJSJKZQ("sjsjkzq", "升级涉及的电子控制器", "0"),
GXBH("gxbh", "由于软件升级活动而导致的车辆功能的任何变化", "0"),
SJSJ("sjsj", "升级执行预计时间(分钟)", "0"),
SJKY("sjky", "升级执行期问,车辆是否可用", "0"),
SJBKYGN("sjbkygn", "升级执行期间不可用的车辆功能", "0"),
ZDXX("zdxx", "帮助车辆用户安全执行升级的任何指导信息", "0"),
SJSFCG("sjsfcg", "告知用户升级成功或失败", "2"),
GZBG("gzbg", "告知实施的变更", "2"),
GZSCNR("gzscnr", "告知了对用户手册的全部更新内容", "2"),
GZYHFS("gzyhfs", "告知用户方式(可多选)", "user_notification_mode"),
// XGWJ("xgwj", "用户告知相关文件", "0"),
RWMC("rwmc", "任务名称", "0"),
SJFBSJ("sjfbsj", "升级发布时间", "3"),
SJJZSJ("sjjzsj", "升级计划截止时间", "3");
BABH("babh", "备案编号", "0", "", 50),
BAPC("bapc", "备案批次", "0", "", 50),
ZSL("zsl", "总数量", "0", "", 50),
SCRQKS("scrqks", "生产日期开始", "3", "", 0),
SCRQJS("scrqjs", "生产日期结束", "3", "", 0),
VIN_LIST("vinList", "VIN码清单", "0", "", 500),
SJMD("sjmd", "升级目的", "uipgrade_purpose", "", 0),
SFBGCS("sfbgcs", "是否变更对应车型的《公告》技术参数", "2", "", 0),
JSXNBH("jsxnbh", "是否涉及性能变化", "2", "", 0),
FHGD("fhgd", "是否符合国家法律、行政法规、规章规定,以及道路机动车辆公告管理相关国家技术标准及安全技术条件等", "2", "", 0),
ZDJSXG("zdjsxg", "是否涉及汽车自动驾驶功能相关升级", "2", "", 0),
JRXXG("jrxxg", "兼容性评估相关", "2", "", 0),
ZXSJ("zxsj", "如何执行升级", "conditions_upgrades", "", 0),
AQJZ("aqjz", "升级失败或中断后,车辆采取的安全机制", "upgrade_failed", "", 0),
SFYXAQ("sfyxaq", "升级活动是否影响车辆安全", "2", "", 0),
YHQR("yhqr", "升级活动是否提供用户确认选项", "2", "", 0),
SJBCS("sjbcs", "升级包测试", "package_test", "", 0),
AQKKX("aqkkx", "是否已验证确认在线升级活动的安全性和可靠性", "2", "", 0),
// BGFJ("bgfj", "提供变更或扩展后的《公告》批次及证明材料", "0","",0),
// CLFJ("clfj", "提供证明材料", "0","",0),
XTMC("xtmc", "系统名称", "0", "", 50),
SJQBGCS("sjqbgcs", "升级前已变更《公告》参数的对应调整", "0", "", 500),
SJHBGCS("sjhbgcs", "升级后已变更《公告》参数的对应调整", "0", "", 500),
SJKZQMC("sjkzqmc", "升级的电子控制器名称", "0", "", 50),
YJBB("yjbb", "适配的硬件版本", "0", "", 50),
SJQRJBB("sjqrjbb", "软件版本号升级前", "0", "", 50),
SJHRJBB("sjhrjbb", "软件版本号升级后", "0", "", 50),
SJQCZXT("sjqczxt", "操作系统版本号升级前", "0", "", 50),
SJHCZXT("sjhczxt", "操作系统版本号升级后", "0", "", 50),
CSRJSJ("csrjsj", "初始软件包的完整性数据", "0", "", 500),
SJBYZSJ("sjbyzsj", "升级包完整性验证数据", "0", "", 500),
SJBDX("sjbdx", "升级包大小", "0", "", 50),
SFCFSJ("sfcfsj", "是否差分升级", "0", "", 50),
SJMDLX("sjmdlx", "升级目的类型", "0", "", 0),
GNBGMS("gnbgms", "功能变更描述", "0", "", 500),
SYTJBG("sytjbg", "适用条件变更", "0", "", 500),
SJSJKZQ("sjsjkzq", "升级涉及的电子控制器", "0", "", 500),
GXBH("gxbh", "由于软件升级活动而导致的车辆功能的任何变化", "0", "", 500),
SJSJ("sjsj", "升级执行预计时间(分钟)", "0", "", 50),
SJKY("sjky", "升级执行期问,车辆是否可用", "0", "", 50),
SJBKYGN("sjbkygn", "升级执行期间不可用的车辆功能", "0", "", 50),
ZDXX("zdxx", "帮助车辆用户安全执行升级的任何指导信息", "0", "", 500),
SJSFCG("sjsfcg", "告知用户升级成功或失败", "2", "", 0),
GZBG("gzbg", "告知实施的变更", "2", "", 0),
GZSCNR("gzscnr", "告知了对用户手册的全部更新内容", "2", "", 0),
GZYHFS("gzyhfs", "告知用户方式(可多选)", "user_notification_mode", "", 0),
// XGWJ("xgwj", "用户告知相关文件", "0","",0),
RWMC("rwmc", "任务名称", "0", "", 500),
SJFBSJ("sjfbsj", "升级发布时间", "3", "", 0),
SJJZSJ("sjjzsj", "升级计划截止时间", "3", "", 0);
String name;
String value;
//0为不处理。1为数据字典2为处理是否 是1 否2
String type;
String valueEn;
OtaTitleEnum(String name, String value, String type) {
//字段限制长度
int len;
OtaTitleEnum(String name, String value, String type, String valueEn, int len) {
this.name = name;
this.value = value;
this.type = type;
this.valueEn = valueEn;
this.len = len;
}
public String getName() {
@@ -239,6 +245,22 @@ public enum OtaTitleEnum {
this.type = type;
}
public String getValueEn() {
return valueEn;
}
public void setValueEn(String valueEn) {
this.valueEn = valueEn;
}
public int getLen() {
return len;
}
public void setLen(int len) {
this.len = len;
}
public static OtaTitleEnum getOtaTitleEnum(String name) {
for (OtaTitleEnum e : values()) {
if (e.getName().equals(name)) {
@@ -68,9 +68,9 @@ public interface IOtaBaCxAqcsService extends IService<OtaBaCxAqcs> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request);
OtaBaCxAqcs importData(MultipartFile file, String otaId, String cut) throws Exception;
OtaBaCxAqcs importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
OtaBaCxAqcs parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
OtaBaCxAqcs parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, File attFile, String otaId, String cut) throws Exception;
}
@@ -41,6 +41,8 @@ public interface IOtaBaCxJbxxService extends IService<OtaBaCxJbxx> {
*/
void deleteById(String id);
void deleteByOtaId(String id);
/**
* 批量删除
*
@@ -68,9 +70,9 @@ public interface IOtaBaCxJbxxService extends IService<OtaBaCxJbxx> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
OtaBaCxJbxx importData(MultipartFile file, String otaId, String cut) throws Exception;
OtaBaCxJbxx importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
OtaBaCxJbxx parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
OtaBaCxJbxx parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, String otaId, String cut) throws Exception;
}
@@ -68,9 +68,9 @@ public interface IOtaBaCxJsfzbacsService extends IService<OtaBaCxJsfzbacs> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request);
void importData(MultipartFile file, String otaId, String cut) throws Exception;
void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, String otaId, String cut) throws Exception;
}
@@ -68,9 +68,9 @@ public interface IOtaBaCxKsjjsmccsService extends IService<OtaBaCxKsjjsmccs> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request);
void importData(MultipartFile file, String otaId, String cut) throws Exception;
void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, File attFile, String otaId, String cut) throws Exception;
}
@@ -68,9 +68,9 @@ public interface IOtaBaCxKsjxtmccsService extends IService<OtaBaCxKsjxtmccs> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request);
void importData(MultipartFile file, String otaId, String cut) throws Exception;
void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, File attFile, String otaId, String cut) throws Exception;
}
@@ -68,7 +68,7 @@ public interface IOtaBaCxListService extends IService<OtaBaCxList> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request);
void importData(MultipartFile file, String cut) throws Exception;
void importData(MultipartFile file, String cut, StringBuilder errMsg) throws Exception;
void exportData(String otaId, HttpServletResponse response, HttpServletRequest request) throws Exception;
@@ -3,6 +3,7 @@ package com.jero.modules.ota.service;
import com.jero.modules.ota.entity.OtaBaCxQt;
import com.baomidou.mybatisplus.extension.service.IService;
import java.io.File;
import java.util.List;
/**
@@ -61,4 +62,6 @@ public interface IOtaBaCxQtService extends IService<OtaBaCxQt> {
List<OtaBaCxQt> queryList();
OtaBaCxQt queryByOtaId(String otaId, String otaIdT);
void exportData(File file, String otaId, String cut) throws Exception;
}
@@ -69,9 +69,9 @@ public interface IOtaBaCxZxsjyqService extends IService<OtaBaCxZxsjyq> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request);
OtaBaCxZxsjyq importData(MultipartFile file, String otaId, String cut) throws Exception;
OtaBaCxZxsjyq importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
OtaBaCxZxsjyq parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
OtaBaCxZxsjyq parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, File attFile,String otaId, String cut) throws Exception;
}
@@ -12,64 +12,65 @@ import java.util.List;
/**
* @Description: 升级备案-用户告知内容及方式
* @Author: jero-boot
* @Date: 2023-03-17
* @Date: 2023-03-17
* @Version: V1.0
*/
public interface IOtaBaSjGgnrfsService extends IService<OtaBaSjGgnrfs> {
/**
* 保存
*
* @param otaBaSjGgnrfs
* @return
*/
/**
* 保存
*
* @param otaBaSjGgnrfs
* @return
*/
void add(OtaBaSjGgnrfs otaBaSjGgnrfs);
/**
* 更新
*
* @param otaBaSjGgnrfs
* @return
*/
/**
* 更新
*
* @param otaBaSjGgnrfs
* @return
*/
void editById(OtaBaSjGgnrfs otaBaSjGgnrfs);
/**
* 通过id删除
*
* @param id
* @return
*/
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
/**
* 通过id查询
*
* @param id
* @return
*/
OtaBaSjGgnrfs queryById(String id);
/**
* 列表查询
*
* @return
*/
* 列表查询
*
* @return
*/
List<OtaBaSjGgnrfs> queryList();
OtaBaSjGgnrfs queryByOtaId(String otaId, String otaIdT);
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
void importData(MultipartFile file, String otaId, String cut) throws Exception;
void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, String otaId, String cut) throws Exception;}
void exportData(File file, File fsAttFile, String otaId, String cut) throws Exception;
}
@@ -19,7 +19,7 @@ public interface IOtaBaSjGnxtwhService extends IService<OtaBaSjGnxtwh> {
* @param otaBaSjGnxtwh
* @return
*/
void add(OtaBaSjGnxtwh otaBaSjGnxtwh);
void add(OtaBaSjGnxtwh otaBaSjGnxtwh) throws Exception;
/**
* 更新
@@ -27,7 +27,7 @@ public interface IOtaBaSjGnxtwhService extends IService<OtaBaSjGnxtwh> {
* @param otaBaSjGnxtwh
* @return
*/
void editById(OtaBaSjGnxtwh otaBaSjGnxtwh);
void editById(OtaBaSjGnxtwh otaBaSjGnxtwh) throws Exception;
/**
* 通过id删除
@@ -70,7 +70,7 @@ public interface IOtaBaSjListService extends IService<OtaBaSjList> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
void importData(MultipartFile file, String cut) throws Exception;
void importData(MultipartFile file, String cut, StringBuilder errMsg) throws Exception;
void exportData(String otaId, HttpServletResponse response, HttpServletRequest request) throws Exception;
}
@@ -3,6 +3,8 @@ package com.jero.modules.ota.service;
import com.jero.modules.ota.entity.OtaBaCxQt;
import com.jero.modules.ota.entity.OtaBaSjQtsjxx;
import com.baomidou.mybatisplus.extension.service.IService;
import java.io.File;
import java.util.List;
/**
@@ -61,4 +63,6 @@ public interface IOtaBaSjQtsjxxService extends IService<OtaBaSjQtsjxx> {
List<OtaBaSjQtsjxx> queryList();
OtaBaSjQtsjxx queryByOtaId(String otaId, String otaIdT);
void exportData(File file, String otaId, String cut) throws Exception;
}
@@ -69,9 +69,9 @@ public interface IOtaBaSjSjfzbhService extends IService<OtaBaSjSjfzbh> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
void importData(MultipartFile file, String otaId, String cut) throws Exception;
void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, String otaId, String cut) throws Exception;
}
@@ -69,9 +69,9 @@ public interface IOtaBaSjSjmbclService extends IService<OtaBaSjSjmbcl> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
OtaBaSjSjmbcl parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
OtaBaSjSjmbcl parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
OtaBaSjSjmbcl importData(MultipartFile file, String otaId, String cut) throws Exception;
OtaBaSjSjmbcl importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, String otaId, String cut) throws Exception;
void exportData(File file, File mbclAttFile, String otaId, String cut) throws Exception;
}
@@ -70,9 +70,9 @@ public interface IOtaBaSjSjmbcxService extends IService<OtaBaSjSjmbcx> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
OtaBaSjSjmbcx importData(MultipartFile file, String otaId, String cut) throws Exception;
OtaBaSjSjmbcx importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
OtaBaSjSjmbcx parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
OtaBaSjSjmbcx parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, String otaId, String cut) throws Exception;
}
@@ -67,9 +67,9 @@ public interface IOtaBaSjSjxtbhService extends IService<OtaBaSjSjxtbh> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
void importData(MultipartFile file, String otaId, String cut) throws Exception;
void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, String otaId, String cut) throws Exception;
}
@@ -69,9 +69,9 @@ public interface IOtaBaSjSjyxpgService extends IService<OtaBaSjSjyxpg> {
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
OtaBaSjSjyxpg importData(MultipartFile file, String otaId, String cut) throws Exception;
OtaBaSjSjyxpg importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception;
OtaBaSjSjyxpg parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
OtaBaSjSjyxpg parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception;
void exportData(File file, String otaId, String cut) throws Exception;
void exportData(File file, File attFile, File attFile2, String otaId, String cut) throws Exception;
}
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.List;
import java.util.Date;
@@ -78,18 +79,21 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
otaBaCxAqcs.setCreateTime(now);
}
otaBaCxAqcs.setUpdateTime(now);
otaBaCxAqcs.setZmcl("");
if (null != otaBaCxAqcs.getZmclList() && otaBaCxAqcs.getZmclList().size() > 0) {
JSONArray obj = new JSONArray();
for (AttachmentEO aeo : otaBaCxAqcs.getZmclList()) {
obj.add(aeo);
}
otaBaCxAqcs.setZmcl(obj.toString());
}else{
otaBaCxAqcs.setZmcl("");
}
if (ObjectUtils.isNotEmpty(otaBaCxAqcsOld) && StringUtils.isNotEmpty(otaBaCxAqcsOld.getZmcl())) {
List<AttachmentEO> aeoList = JSONArray.parseArray(otaBaCxAqcsOld.getZmcl(), AttachmentEO.class);
otaBaCxAqcsOld.setZmclList(aeoList);
deleteById(otaBaCxAqcsOld.getId());
}
deleteById(otaBaCxAqcs.getId());
saveOrUpdate(otaBaCxAqcs);
ComparisonUtil cu = new ComparisonUtil();
if (ObjectUtils.isEmpty(otaBaCxAqcsOld)) {
@@ -205,14 +209,14 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
}
@Override
public OtaBaCxAqcs importData(MultipartFile file, String otaId, String cut) throws Exception {
public OtaBaCxAqcs importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
OtaBaCxAqcs aqcs = parseFileList(upLoadFiles, otaId, cut);
OtaBaCxAqcs aqcs = parseFileList(upLoadFiles, otaId, cut, errMsg);
return aqcs;
}
@Override
public OtaBaCxAqcs parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public OtaBaCxAqcs parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File attFile = null;
File upFile = null;
for (File f : upLoadFiles) {
@@ -225,13 +229,13 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
if (null == upFile || null == attFile) {
throw new JeroBootException("请上传正确的文件");
}
OtaBaCxAqcs aqcs = parseFile(upFile, attFile, cut);
OtaBaCxAqcs aqcs = parseFile(upFile, attFile, cut, errMsg);
aqcs.setOtaId(otaId);
add(aqcs);
return aqcs;
}
private OtaBaCxAqcs parseFile(File upFile, File attFile, String cut) throws Exception {
private OtaBaCxAqcs parseFile(File upFile, File attFile, String cut, StringBuilder errMsg) throws Exception {
OtaBaCxAqcs aqcs = new OtaBaCxAqcs();
Workbook wb = ImportFileUtil.readExcel(upFile);
Sheet s = wb.getSheetAt(0);
@@ -252,16 +256,22 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
cell = row.getCell(2);
aqcs.setXxaqjz(ImportFileUtil.getCellValueDict(cell, wb, "Information_security_mechanism", sysDictService, cut));
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(aqcs, errMsg, sysDictService, cut);
row = s.getRow(2);
cell = row.getCell(3);
String[] strs = ImportFileUtil.getCellValue(cell, wb).split(",");
List<OSSFile> list = ImportFileUtil.uploadFiles1(attFile, strs, ossFileService);
String attStr = ImportFileUtil.getCellValue(cell, wb);
String[] strs = attStr.split(",");
List<OSSFile> list = ImportFileUtil.uploadFiles1(attFile, strs, ossFileService,errMsg, "证明材料", cut);
JSONArray obj = new JSONArray();
for (OSSFile f : list) {
AttachmentEO aeo = new AttachmentEO();
aeo.setId(f.getId());
aeo.setFileName(f.getFileName());
obj.add(aeo);
aqcs.addZmcl(aeo);
}
aqcs.setZmcl(obj.toString());
return aqcs;
@@ -276,19 +286,20 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
Row row = s.getRow(2);
Cell cell = row.getCell(2);
cell.setCellValue(sysDictService.queryDictItemByValue("protection_mechanism", aqcs.getBhjz(), cut));
cell.setCellValue(ComparisonUtil.queryDictTextByKey("protection_mechanism", aqcs.getBhjz(), sysDictService));
row = s.getRow(3);
cell = row.getCell(2);
cell.setCellValue(sysDictService.queryDictItemByValue("fail_safe_mechanism", aqcs.getFsxjz(), cut));
cell.setCellValue(ComparisonUtil.queryDictTextByKey("fail_safe_mechanism", aqcs.getFsxjz(), sysDictService));
row = s.getRow(4);
cell = row.getCell(2);
cell.setCellValue(sysDictService.queryDictItemByValue("upgrade_failure", aqcs.getSjsbcs(), cut));
cell.setCellValue(ComparisonUtil.queryDictTextByKey("upgrade_failure", aqcs.getSjsbcs(), sysDictService));
row = s.getRow(5);
cell = row.getCell(2);
cell.setCellValue(sysDictService.queryDictItemByValue("Information_security_mechanism", aqcs.getXxaqjz(), cut));
cell.setCellValue(ComparisonUtil.queryDictTextByKey("Information_security_mechanism", aqcs.getXxaqjz(), sysDictService));
row = s.getRow(2);
cell = row.getCell(3);
@@ -311,6 +322,8 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
}
}
cell.setCellValue(sb.toString());
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -117,6 +117,13 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
removeById(id);
}
@Override
public void deleteByOtaId(String id) {
LambdaQueryWrapper<OtaBaCxJbxx> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OtaBaCxJbxx::getOtaId, id);
remove(queryWrapper);
}
/**
* 批量删除
*
@@ -174,14 +181,14 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
}
@Override
public OtaBaCxJbxx importData(MultipartFile file, String otaId, String cut) throws Exception {
public OtaBaCxJbxx importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
OtaBaCxJbxx jbxx = parseFileList(upLoadFiles, otaId, cut);
OtaBaCxJbxx jbxx = parseFileList(upLoadFiles, otaId, cut, errMsg);
return jbxx;
}
@Override
public OtaBaCxJbxx parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public OtaBaCxJbxx parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File upFile = null;
for (File f : upLoadFiles) {
if (f.getName().equals("车型基本信息.xlsx")) {
@@ -189,41 +196,47 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
}
}
if (null == upFile) {
throw new JeroBootException("请上传正确的文件");
throw new JeroBootException("找不到文件:车型基本信息.xlsx");
}
OtaBaCxJbxx jbxx = parseFile(upFile, cut);
OtaBaCxJbxx jbxx = parseFile(upFile, cut, errMsg);
jbxx.setOtaId(otaId);
add(jbxx);
return jbxx;
}
private OtaBaCxJbxx parseFile(File file, String cut) throws Exception {
private OtaBaCxJbxx parseFile(File file, String cut, StringBuilder errMsg) throws Exception {
OtaBaCxJbxx jbxx = new OtaBaCxJbxx();
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
Row row = s.getRow(1);
Row row = s.getRow(2);
Cell cell = row.getCell(1);
jbxx.setQymc(ImportFileUtil.getCellValue(cell, wb));
row = s.getRow(2);
cell = row.getCell(1);
String cpbh = ImportFileUtil.getCellValue(cell, wb);
if (StringUtils.isEmpty(cpbh)) {
throw new JeroBootException("产品编号不能为空");
}
if (cpbh.length() > 50) {
throw new JeroBootException("产品编号字数超过50");
}
jbxx.setDjbh(cpbh);
row = s.getRow(3);
cell = row.getCell(1);
jbxx.setCplb(ImportFileUtil.getCellValue(cell, wb));
row = s.getRow(4);
cell = row.getCell(1);
String ggpc = ImportFileUtil.getCellValue(cell, wb);
if (StringUtils.isEmpty(cpbh)) {
throw new JeroBootException("公告批次不能为空");
if (StringUtils.isNotEmpty(ggpc)) {
List<OtaBaCxJbxx> xxList = this.list();
for (OtaBaCxJbxx xx : xxList) {
if (ggpc.equals(xx.getGgpc())) {
throw new JeroBootException("公告批次重复");
}
}
}
jbxx.setGgpc(ImportFileUtil.getCellValue(cell, wb));
jbxx.setGgpc(ggpc);
row = s.getRow(1);
cell = row.getCell(1);
jbxx.setQymc(ImportFileUtil.getCellValue(cell, wb));
row = s.getRow(3);
cell = row.getCell(1);
jbxx.setCplb(ImportFileUtil.getCellValue(cell, wb));
row = s.getRow(5);
cell = row.getCell(1);
jbxx.setCpsb(ImportFileUtil.getCellValue(cell, wb));
@@ -245,6 +258,9 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
row = s.getRow(11);
cell = row.getCell(1);
jbxx.setCdotasj(ImportFileUtil.getCellValue(cell, wb));
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(jbxx, errMsg, sysDictService, cut);
return jbxx;
}
@@ -286,7 +302,8 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
cell.setCellValue(jbxx.getDllx2());
row = s.getRow(10);
cell = row.getCell(1);
cell.setCellValue(sysDictService.queryDictItemByValue("communication_terminal", jbxx.getTxzd(), cut));
String str = jbxx.getTxzd();
cell.setCellValue(ComparisonUtil.queryDictTextByKey("communication_terminal", str, sysDictService));
row = s.getRow(11);
cell = row.getCell(1);
cell.setCellValue(jbxx.getCdotasj());
@@ -29,6 +29,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.lang.reflect.Field;
import java.util.*;
@@ -72,7 +73,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
ComparisonUtil cu = new ComparisonUtil();
if (ObjectUtils.isEmpty(otaBaCxJsfzbacsOld)) {
otaBaCxJsfzbacsOld = new OtaBaCxJsfzbacs();
}else{
} else {
otaBaCxJsfzbacs.setId(otaBaCxJsfzbacsOld.getId());
}
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaId, OtaModuleEnum.CX_JSFZXTJCBACS, otaBaCxJsfzbacsOld, otaBaCxJsfzbacs, sysDictService);
@@ -238,7 +239,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
}
private OtaBaCxJsfzbacs getByOtaId(String otaId) {
if(StringUtils.isEmpty(otaId)){
if (StringUtils.isEmpty(otaId)) {
return null;
}
LambdaQueryWrapper<OtaBaCxJsfzbacs> queryWrapper = new LambdaQueryWrapper<>();
@@ -252,14 +253,14 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
}
@Override
public void importData(MultipartFile file, String otaId, String cut) throws Exception {
public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
parseFileList(upLoadFiles, otaId, cut);
parseFileList(upLoadFiles, otaId, cut, errMsg);
}
@Override
public void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File upFile = null;
for (File f : upLoadFiles) {
if (f.getName().equals("驾驶辅助系统基础备案参数.xlsx")) {
@@ -269,7 +270,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
if (null == upFile) {
throw new JeroBootException("请上传正确的文件");
}
OtaBaCxJsfzbacs basc = parseFile(upFile, otaId, cut);
OtaBaCxJsfzbacs basc = parseFile(upFile, otaId, cut, errMsg);
Date now = new Date();
basc.setCreateTime(now);
basc.setUpdateTime(now);
@@ -283,7 +284,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
List<OtaBaCxSjmk> oldList = OtaBaCxSjmkService.queryByOtaId(otaId);
OtaBaCxSjmkService.deleteByOtaId(otaId);
List<OtaBaCxSjmk> sjmkList = parseList(upFile, otaId, cut);
List<OtaBaCxSjmk> sjmkList = parseList(upFile, otaId, cut, errMsg);
if (ObjectUtils.isEmpty(oldList)) {
oldList = new ArrayList<>();
}
@@ -293,7 +294,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
}
private List<OtaBaCxSjmk> parseList(File upFile, String otaId, String cut) throws Exception {
private List<OtaBaCxSjmk> parseList(File upFile, String otaId, String cut, StringBuilder errMsg) throws Exception {
Date now = new Date();
List<OtaBaCxSjmk> sjmkList = new ArrayList<>();
Workbook wb = ImportFileUtil.readExcel(upFile);
@@ -325,13 +326,15 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
sjmk.setRjkfqy(ImportFileUtil.getCellValue(cell, wb));
cell = row.getCell(7);
sjmk.setBzwz(ImportFileUtil.getCellValue(cell, wb));
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(sjmk, errMsg, sysDictService, cut);
sjmkList.add(sjmk);
}
}
return sjmkList;
}
private OtaBaCxJsfzbacs parseFile(File upFile, String otaId, String cut) throws Exception {
private OtaBaCxJsfzbacs parseFile(File upFile, String otaId, String cut, StringBuilder errMsg) throws Exception {
Workbook wb = ImportFileUtil.readExcel(upFile);
Sheet s = wb.getSheetAt(0);
OtaBaCxJsfzbacs bass = new OtaBaCxJsfzbacs();
@@ -339,7 +342,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
Row row = s.getRow(2);
Cell cell = row.getCell(2);
bass.setJsfzczjPz(ImportFileUtil.getCellValueYesOrNoInt(cell, wb));
bass.setJgldPz(ImportFileUtil.getCellValueYesOrNoInt(cell, wb));
row = s.getRow(2);
cell = row.getCell(4);
bass.setJgldSl(ImportFileUtil.getCellValue(cell, wb));
@@ -853,7 +856,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
List<OtaBaCxSjmk> sjmkList = OtaBaCxSjmkService.queryByOtaId(otaId);
int startRow = 63;
for (OtaBaCxSjmk sjmk : sjmkList) {
row = s.getRow(startRow);
row = s.createRow(startRow);
cell = row.createCell(0);
cell.setCellValue(sjmk.getBjmc());
cell = row.createCell(1);
@@ -872,6 +875,8 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
cell.setCellValue(sjmk.getBzwz());
startRow++;
}
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.*;
@@ -239,13 +240,13 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
}
@Override
public void importData(MultipartFile file, String otaId, String cut) throws Exception {
public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
parseFileList(upLoadFiles, otaId, cut);
parseFileList(upLoadFiles, otaId, cut, errMsg);
}
@Override
public void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File attFile = null;
File upFile = null;
for (File f : upLoadFiles) {
@@ -263,7 +264,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
if (ObjectUtils.isEmpty(oldList)) {
oldList = new ArrayList<>();
}
List<OtaBaCxKsjjsmccs> mccsList = parseFile(upFile, attFile, otaId, cut);
List<OtaBaCxKsjjsmccs> mccsList = parseFile(upFile, attFile, otaId, cut, errMsg);
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.CX_KZXSJDJSFZGNMCYCS, OtaTitleEnum.GNMC.getName(), oldList, mccsList, sysDictService);
deleteByOtaId(otaId);
@@ -272,7 +273,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
}
private List<OtaBaCxKsjjsmccs> parseFile(File upFile, File attFile, String otaId, String cut) throws Exception {
private List<OtaBaCxKsjjsmccs> parseFile(File upFile, File attFile, String otaId, String cut, StringBuilder errMsg) throws Exception {
Date now = new Date();
List<OtaBaCxKsjjsmccs> mccsList = new ArrayList<>();
Workbook wb = ImportFileUtil.readExcel(upFile);
@@ -290,7 +291,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
cell = row.getCell(1);
str = ImportFileUtil.getCellValue(cell, wb);
String[] strs = str.split(",");
otaBaCxList.setZxsjjsfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService));
otaBaCxList.setZxsjjsfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "证明材料", cut));
otaBaCxListService.editById(otaBaCxList);
}
break;
@@ -328,6 +329,9 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
cell = row.getCell(13);
mssc.setCsyzsj(ImportFileUtil.getCellValue(cell, wb));
mssc.setCreateTime(now);
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(mssc, errMsg, sysDictService, cut);
mccsList.add(mssc);
}
}
@@ -340,7 +344,8 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
int startRow = 3;
for (OtaBaCxKsjjsmccs mccs : mccsList) {
for (int i = 0; i < mccsList.size(); i++) {
OtaBaCxKsjjsmccs mccs = mccsList.get(i);
Row row = s.getRow(startRow);
Cell cell = row.createCell(0);
cell.setCellValue(mccs.getGnmc());
@@ -370,11 +375,12 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
cell.setCellValue(mccs.getCzxtbbh());
cell = row.createCell(13);
cell.setCellValue(mccs.getCsyzsj());
startRow++;
}
Row row = s.getRow(startRow);
Row row = s.createRow(startRow);
Cell cell = row.createCell(0);
cell.setCellValue("证明材料");
cell = row.getCell(1);
cell = row.createCell(1);
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
StringBuilder sb = new StringBuilder();
@@ -396,5 +402,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
cell.setCellValue(sb.toString());
}
}
wb.write(new FileOutputStream(file));
wb.close();
}
}
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.*;
@@ -307,13 +308,13 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
}
@Override
public void importData(MultipartFile file, String otaId, String cut) throws Exception {
public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
parseFileList(upLoadFiles, otaId, cut);
parseFileList(upLoadFiles, otaId, cut, errMsg);
}
@Override
public void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File attFile = null;
File upFile = null;
for (File f : upLoadFiles) {
@@ -330,7 +331,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
if (ObjectUtils.isEmpty(oldList)) {
oldList = new ArrayList<>();
}
List<OtaBaCxKsjxtmccs> mccsList = parseFile(upFile, attFile, otaId, cut);
List<OtaBaCxKsjxtmccs> mccsList = parseFile(upFile, attFile, otaId, cut, errMsg);
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, OtaTitleEnum.XTLB.getName(), oldList, mccsList, sysDictService);
deleteByOtaId(otaId);
@@ -338,7 +339,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
otaBaCxTxjlService.saveBatch(reList);
}
private List<OtaBaCxKsjxtmccs> parseFile(File upFile, File attFile, String otaId, String cut) throws Exception {
private List<OtaBaCxKsjxtmccs> parseFile(File upFile, File attFile, String otaId, String cut, StringBuilder errMsg) throws Exception {
Date now = new Date();
List<OtaBaCxKsjxtmccs> mccsList = new ArrayList<>();
Workbook wb = ImportFileUtil.readExcel(upFile);
@@ -356,7 +357,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
cell = row.getCell(1);
str = ImportFileUtil.getCellValue(cell, wb);
String[] strs = str.split(",");
otaBaCxList.setZxsjxtfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService));
otaBaCxList.setZxsjxtfj(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "证明材料", cut));
otaBaCxListService.editById(otaBaCxList);
}
break;
@@ -373,7 +374,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
mssc.setSjbgcs(ImportFileUtil.getCellValue(cell, wb));
cell = row.getCell(3);
String[] strs = ImportFileUtil.getCellValue(cell, wb).split(",");
mssc.setTpt(ImportFileUtil.uploadFiles(attFile, strs, ossFileService));
mssc.setTpt(ImportFileUtil.uploadFiles(attFile, strs, ossFileService, errMsg, "系统电子控制器架构拓扑图", cut));
cell = row.getCell(4);
mssc.setKzqmc(ImportFileUtil.getCellValue(cell, wb));
cell = row.getCell(5);
@@ -398,6 +399,9 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
mssc.setCzxtbbh(ImportFileUtil.getCellValue(cell, wb));
mssc.setCreateTime(now);
mssc.setUpdateTime(now);
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(mssc, errMsg, sysDictService, cut);
mccsList.add(mssc);
}
}
@@ -471,7 +475,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
}
Cell cell = row.createCell(0);
cell.setCellValue("证明材料");
cell = row.getCell(1);
cell = row.createCell(1);
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
StringBuilder sb = new StringBuilder();
@@ -493,6 +497,8 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
cell.setCellValue(sb.toString());
}
}
wb.write(new FileOutputStream(file));
wb.close();
}
}
@@ -9,6 +9,7 @@ import com.jero.modules.ota.entity.OtaBaCxLsjl;
import com.jero.modules.ota.mapper.OtaBaCxListMapper;
import com.jero.modules.ota.service.*;
import com.jero.modules.ota.utils.ImportFileUtil;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.logging.Log;
@@ -59,6 +60,9 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
@Autowired
private IOtaBaCxJsfzbacsService otaBaCxJsfzbacsService;
@Autowired
private IOtaBaCxQtService otaBaCxQtService;
@Value(value = "${ota.templatePath}")
private String templatePath;
@@ -102,6 +106,7 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
@Override
public void deleteById(String id) {
removeById(id);
otaBaCxJbxxService.deleteByOtaId(id);
}
/**
@@ -169,16 +174,16 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
}
@Override
public void importData(MultipartFile file, String cut) throws Exception {
public void importData(MultipartFile file, String cut, StringBuilder errMsg) throws Exception {
List<File> fileList = ImportFileUtil.importZip(file, cut, uploadPath);
OtaBaCxJbxx jbxx = otaBaCxJbxxService.parseFileList(fileList, "", cut);
OtaBaCxJbxx jbxx = otaBaCxJbxxService.parseFileList(fileList, "", cut, errMsg);
String otaId = jbxx.getOtaId();
if (StringUtils.isNotEmpty(otaId)) {
otaBaCxZxsjyqService.parseFileList(fileList, otaId, cut);
otaBaCxAqcsService.parseFileList(fileList, otaId, cut);
otaBaCxKsjxtmccsService.parseFileList(fileList, otaId, cut);
otaBaCxKsjjsmccsService.parseFileList(fileList, otaId, cut);
otaBaCxJsfzbacsService.parseFileList(fileList, otaId, cut);
otaBaCxZxsjyqService.parseFileList(fileList, otaId, cut, errMsg);
otaBaCxAqcsService.parseFileList(fileList, otaId, cut, errMsg);
otaBaCxKsjxtmccsService.parseFileList(fileList, otaId, cut, errMsg);
otaBaCxKsjjsmccsService.parseFileList(fileList, otaId, cut, errMsg);
otaBaCxJsfzbacsService.parseFileList(fileList, otaId, cut, errMsg);
} else {
throw new JeroBootException("导入失败");
}
@@ -212,8 +217,11 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
File bacsFile = ImportFileUtil.findFile(exportFile, "驾驶辅助系统基础备案参数.xlsx");
otaBaCxJsfzbacsService.exportData(bacsFile, otaId, cut);
File qtFile = ImportFileUtil.findFile(exportFile, "其他.xlsx");
otaBaCxQtService.exportData(qtFile, otaId, cut);
String outPath = uploadPath + "/车型及功能备案" + System.currentTimeMillis() + ".zip";
//FileUtils.forceDelete(template);
FileOutputStream fos1 = new FileOutputStream(outPath);
ImportFileUtil.toZip(exportFile.getCanonicalPath(), fos1, true);
ImportFileUtil.exportTemplate(response, outPath);
@@ -4,16 +4,24 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.ota.entity.OtaBaCxAqcs;
import com.jero.modules.ota.entity.OtaBaCxQt;
import com.jero.modules.ota.entity.OtaBaCxTxjl;
import com.jero.modules.ota.entity.OtaBaSjQtsjxx;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaCxQtMapper;
import com.jero.modules.ota.service.IOtaBaCxQtService;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
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.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
import java.util.Date;
@@ -127,7 +135,7 @@ public class OtaBaCxQtServiceImpl extends ServiceImpl<OtaBaCxQtMapper, OtaBaCxQt
}
public OtaBaCxQt getByOtaId(String otaId) {
if(org.apache.commons.lang3.StringUtils.isEmpty(otaId)){
if (org.apache.commons.lang3.StringUtils.isEmpty(otaId)) {
return null;
}
LambdaQueryWrapper<OtaBaCxQt> queryWrapper = new LambdaQueryWrapper<>();
@@ -135,4 +143,16 @@ public class OtaBaCxQtServiceImpl extends ServiceImpl<OtaBaCxQtMapper, OtaBaCxQt
return this.getOne(queryWrapper, false);
}
@Override
public void exportData(File file, String otaId, String cut) throws Exception {
OtaBaCxQt qt = this.getByOtaId(otaId);
if (ObjectUtils.isNotEmpty(qt)) {
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
Row row = s.getRow(0);
Cell cell = row.getCell(1);
cell.setCellValue(qt.getSjbbhcs());
wb.close();
}
}
}
@@ -31,6 +31,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
@@ -81,13 +82,14 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
}
}
otaBaCxZxsjyq.setUpdateTime(now);
otaBaCxZxsjyq.setZmcl("");
if (null != otaBaCxZxsjyq.getZmclList() && otaBaCxZxsjyq.getZmclList().size() > 0) {
JSONArray obj = new JSONArray();
for (AttachmentEO aeo : otaBaCxZxsjyq.getZmclList()) {
obj.add(aeo);
}
otaBaCxZxsjyq.setZmcl(obj.toString());
} else {
otaBaCxZxsjyq.setZmcl("");
}
if (ObjectUtils.isNotEmpty(otaBaCxZxsjyqOld) && StringUtils.isNotEmpty(otaBaCxZxsjyqOld.getZmcl())) {
List<AttachmentEO> aeoList = JSONArray.parseArray(otaBaCxZxsjyqOld.getZmcl(), AttachmentEO.class);
@@ -199,14 +201,14 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
}
@Override
public OtaBaCxZxsjyq importData(MultipartFile file, String otaId, String cut) throws Exception {
public OtaBaCxZxsjyq importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
OtaBaCxZxsjyq otaBaCxZxsjyq = parseFileList(upLoadFiles, otaId, cut);
OtaBaCxZxsjyq otaBaCxZxsjyq = parseFileList(upLoadFiles, otaId, cut, errMsg);
return otaBaCxZxsjyq;
}
@Override
public OtaBaCxZxsjyq parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public OtaBaCxZxsjyq parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File attFile = null;
File upFile = null;
for (File f : upLoadFiles) {
@@ -219,13 +221,13 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
if (null == upFile || null == attFile) {
throw new JeroBootException("请上传正确的文件");
}
OtaBaCxZxsjyq otaBaCxZxsjyq = parseFile(upFile, attFile, cut);
OtaBaCxZxsjyq otaBaCxZxsjyq = parseFile(upFile, attFile, cut, errMsg);
otaBaCxZxsjyq.setOtaId(otaId);
add(otaBaCxZxsjyq);
return otaBaCxZxsjyq;
}
private OtaBaCxZxsjyq parseFile(File upFile, File attFile, String cut) throws Exception {
private OtaBaCxZxsjyq parseFile(File upFile, File attFile, String cut, StringBuilder errMsg) throws Exception {
OtaBaCxZxsjyq otaBaCxZxsjyq = new OtaBaCxZxsjyq();
Workbook wb = ImportFileUtil.readExcel(upFile);
Sheet s = wb.getSheetAt(0);
@@ -260,16 +262,20 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
cell = row.getCell(2);
otaBaCxZxsjyq.setSjzt(ImportFileUtil.getCellValueYesOrNo(cell, wb));
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(otaBaCxZxsjyq, errMsg, sysDictService, cut);
row = s.getRow(2);
cell = row.getCell(3);
String[] strs = ImportFileUtil.getCellValue(cell, wb).split(",");
List<OSSFile> list = ImportFileUtil.uploadFiles1(attFile, strs, ossFileService);
List<OSSFile> list = ImportFileUtil.uploadFiles1(attFile, strs, ossFileService, errMsg, "证明材料", cut);
JSONArray obj = new JSONArray();
for (OSSFile f : list) {
AttachmentEO aeo = new AttachmentEO();
aeo.setId(f.getId());
aeo.setFileName(f.getFileName());
obj.add(aeo);
otaBaCxZxsjyq.addZmcl(aeo);
}
otaBaCxZxsjyq.setZmcl(obj.toString());
return otaBaCxZxsjyq;
@@ -332,6 +338,8 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
}
}
cell.setCellValue(sb.toString());
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -1,12 +1,13 @@
package com.jero.modules.ota.service.impl;
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.OtaBaCxTxjl;
import com.jero.modules.ota.entity.OtaBaSjGgnrfs;
import com.jero.modules.ota.entity.OtaBaSjSjyxpg;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaSjGgnrfsMapper;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
@@ -17,6 +18,10 @@ 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.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -25,6 +30,8 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -187,13 +194,13 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
}
@Override
public void importData(MultipartFile file, String otaId, String cut) throws Exception {
public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception{
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
parseFileList(upLoadFiles, otaId, cut);
parseFileList(upLoadFiles, otaId, cut,errMsg);
}
@Override
public void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception{
File attFile = null;
for (File f : upLoadFiles) {
if (f.isDirectory() && f.getName().equals("用户告知内容及方式")) {
@@ -203,11 +210,11 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
if (null == attFile) {
throw new JeroBootException("请上传正确的文件");
}
OtaBaSjGgnrfs fs = parseFile(attFile, otaId, cut);
OtaBaSjGgnrfs fs = parseFile(attFile, otaId, cut,errMsg);
add(fs);
}
private OtaBaSjGgnrfs parseFile(File attFile, String otaId, String cut) throws Exception {
private OtaBaSjGgnrfs parseFile(File attFile, String otaId, String cut, StringBuilder errMsg) throws Exception{
OtaBaSjGgnrfs fs = new OtaBaSjGgnrfs();
fs.setOtaId(otaId);
OtaBaSjSjyxpg pg = otaBaSjSjyxpgService.queryByOtaId(otaId, "");
@@ -230,7 +237,62 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
}
@Override
public void exportData(File file, String otaId, String cut) throws Exception {
public void exportData(File file, File attFile, String otaId, String cut) throws Exception {
OtaBaSjGgnrfs fs = this.getByOtaId(otaId);
if (ObjectUtils.isNotEmpty(fs)) {
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
Row row = s.getRow(0);
Cell cell = row.getCell(1);
cell.setCellValue(ComparisonUtil.queryDictTextByKey("uipgrade_purpose", fs.getSjmd(), sysDictService));
row = s.getRow(1);
cell = row.getCell(1);
cell.setCellValue(fs.getGxbh());
row = s.getRow(2);
cell = row.getCell(1);
cell.setCellValue(fs.getSjsj());
row = s.getRow(3);
cell = row.getCell(1);
cell.setCellValue(fs.getSjky());
row = s.getRow(4);
cell = row.getCell(1);
cell.setCellValue(fs.getSjbkygn());
row = s.getRow(5);
cell = row.getCell(1);
cell.setCellValue(fs.getZdxx());
row = s.getRow(6);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(fs.getSjsfcg()));
row = s.getRow(7);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(fs.getGzbg()));
;
row = s.getRow(8);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(fs.getGzscnr()));
row = s.getRow(9);
cell = row.getCell(1);
cell.setCellValue(ComparisonUtil.queryDictTextByKey("user_notification_mode", fs.getGzyhfs(), sysDictService));
String attStr = fs.getXgwj();
if(StringUtils.isNotEmpty(attStr)){
String[] strs = attStr.split(",");
for (String str : strs) {
List<OSSFile> 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);
}
}
}
}
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -1,8 +1,10 @@
package com.jero.modules.ota.service.impl;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.ota.entity.OtaBaSjGnxtwh;
import com.jero.modules.ota.mapper.OtaBaSjGnxtwhMapper;
import com.jero.modules.ota.service.IOtaBaSjGnxtwhService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -26,10 +28,28 @@ public class OtaBaSjGnxtwhServiceImpl extends ServiceImpl<OtaBaSjGnxtwhMapper, O
* @return
*/
@Override
public void add(OtaBaSjGnxtwh otaBaSjGnxtwh) {
public void add(OtaBaSjGnxtwh otaBaSjGnxtwh) throws Exception {
Date now = new Date();
otaBaSjGnxtwh.setCreateTime(now);
otaBaSjGnxtwh.setUpdateTime(now);
String str = otaBaSjGnxtwh.getDykzq();
if (StringUtils.isNotEmpty(str)) {
String[] arr = str.split(",");
for (int i = 0; i < arr.length - 1; i++) {
for (int j = i + 1; j < arr.length; j++) {
if (arr[i].equals(arr[j])) {
throw new JeroBootException("对应控制器重复:" + arr[i]);
}
}
}
for (String s : arr) {
if (null != queryGnxtByKzq(s)) {
throw new JeroBootException("对应控制器重复:" + s);
}
}
} else {
throw new JeroBootException("对应控制器不能为空");
}
save(otaBaSjGnxtwh);
}
@@ -40,9 +60,26 @@ public class OtaBaSjGnxtwhServiceImpl extends ServiceImpl<OtaBaSjGnxtwhMapper, O
* @return
*/
@Override
public void editById(OtaBaSjGnxtwh otaBaSjGnxtwh) {
public void editById(OtaBaSjGnxtwh otaBaSjGnxtwh) throws Exception {
Date now = new Date();
otaBaSjGnxtwh.setUpdateTime(now);
String str = otaBaSjGnxtwh.getDykzq();
if (StringUtils.isNotEmpty(str)) {
String[] arr = str.split(",");
for (int i = 0; i < arr.length - 1; i++) {
for (int j = i + 1; j < arr.length; j++) {
if (arr[i].equals(arr[j])) {
throw new JeroBootException("对应控制器重复:" + arr[i]);
}
}
}
String res = queryGnxtByKzq(otaBaSjGnxtwh);
if (null != res) {
throw new JeroBootException("对应控制器重复:" + res);
}
} else {
throw new JeroBootException("对应控制器不能为空");
}
saveOrUpdate(otaBaSjGnxtwh);
}
@@ -79,6 +116,24 @@ public class OtaBaSjGnxtwhServiceImpl extends ServiceImpl<OtaBaSjGnxtwhMapper, O
return getById(id);
}
public String queryGnxtByKzq(OtaBaSjGnxtwh kzq) {
List<OtaBaSjGnxtwh> list = list();
for (OtaBaSjGnxtwh wh : list) {
if (kzq.getId().equals(wh.getId())) {
continue;
}
String[] strs = wh.getDykzq().split(",");
String[] strs1 = kzq.getDykzq().split(",");
for (String str : strs) {
for (String str1 : strs1) {
if (str.equals(str1)) {
return str;
}
}
}
}
return null;
}
@Override
public String queryGnxtByKzq(String kzq) {
@@ -61,6 +61,9 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
@Autowired
private IOtaBaSjSjyxpgService otaBaSjSjyxpgService;
@Autowired
private IOtaBaSjQtsjxxService otaBaSjQtsjxxService;
/**
* 保存
@@ -165,17 +168,17 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
}
@Override
public void importData(MultipartFile file, String cut) throws Exception {
public void importData(MultipartFile file, String cut, StringBuilder errMsg) throws Exception {
List<File> fileList = ImportFileUtil.importZip(file, cut, uploadPath);
OtaBaSjSjmbcx mbcx = otaBaSjSjmbcxService.parseFileList(fileList, "", cut);
OtaBaSjSjmbcx mbcx = otaBaSjSjmbcxService.parseFileList(fileList, "", cut, errMsg);
String otaId = mbcx.getOtaId();
if (StringUtils.isNotEmpty(otaId)) {
otaBaSjSjmbclService.parseFileList(fileList, otaId, cut);
otaBaSjSjmbcxService.parseFileList(fileList, otaId, cut);
otaBaSjSjyxpgService.parseFileList(fileList, otaId, cut);
otaBaSjSjxtbhService.parseFileList(fileList, otaId, cut);
otaBaSjSjfzbhService.parseFileList(fileList, otaId, cut);
otaBaSjGgnrfsService.parseFileList(fileList, otaId, cut);
otaBaSjSjmbclService.parseFileList(fileList, otaId, cut, errMsg);
otaBaSjSjmbcxService.parseFileList(fileList, otaId, cut, errMsg);
otaBaSjSjyxpgService.parseFileList(fileList, otaId, cut, errMsg);
otaBaSjSjxtbhService.parseFileList(fileList, otaId, cut, errMsg);
otaBaSjSjfzbhService.parseFileList(fileList, otaId, cut, errMsg);
otaBaSjGgnrfsService.parseFileList(fileList, otaId, cut, errMsg);
} else {
throw new JeroBootException("导入失败");
}
@@ -184,25 +187,36 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
@Override
public void exportData(String otaId, HttpServletResponse response, HttpServletRequest request) throws Exception {
String cut = "cn";
File template = new File(templatePath + "在线升级活动备案.zip");
File template = new File(templatePath + "在线升级活动备案导出.zip");
File exportFile = ImportFileUtil.copyZip(ImportFileUtil.createMfileByFile(template), cut, uploadPath);
File sjmbcxFile = ImportFileUtil.findFile(exportFile, "升级目标车型.xlsx");
otaBaSjSjmbcxService.exportData(sjmbcxFile, otaId, cut);
File jbxxFile = ImportFileUtil.findFile(exportFile, "本次升级涉及的目标车辆.xlsx");
otaBaSjSjmbclService.exportData(jbxxFile, otaId, cut);
File mbclFile = ImportFileUtil.findFile(exportFile, "本次升级涉及的目标车辆.xlsx");
File mbclAttFile = ImportFileUtil.findFoder(exportFile, "本次升级涉及的目标车辆");
otaBaSjSjmbclService.exportData(mbclFile, mbclAttFile, otaId, cut);
File pgFile = ImportFileUtil.findFile(exportFile, "升级影响评估.docx");
otaBaSjSjyxpgService.exportData(pgFile, otaId, cut);
File pgFile = ImportFileUtil.findFile(exportFile, "升级影响评估.xlsx");
File pgAttFile = ImportFileUtil.findFoder(exportFile, "升级影响评估");
File pgAtt1File = ImportFileUtil.findFoder(pgAttFile, "测试报告");
File pgAtt2File = ImportFileUtil.findFoder(pgAttFile, "硬件版本号附件");
otaBaSjSjyxpgService.exportData(pgFile, pgAtt1File, pgAtt2File, otaId, cut);
File sjSjxtbhFile = ImportFileUtil.findFile(exportFile, "本次升级的系统名称与变更参数.docx");
File sjSjxtbhFile = ImportFileUtil.findFile(exportFile, "本次升级的系统名称与变更参数.xlsx");
otaBaSjSjxtbhService.exportData(sjSjxtbhFile, otaId, cut);
File sjfzbhFile = ImportFileUtil.findFile(exportFile, "本次升级的驾驶辅助功能与参数变化.docx");
File sjfzbhFile = ImportFileUtil.findFile(exportFile, "本次升级的驾驶辅助功能与参数变化.xlsx");
otaBaSjSjfzbhService.exportData(sjfzbhFile, otaId, cut);
File fsFile = ImportFileUtil.findFile(exportFile, "用户告知内容及方式.xlsx");
File fsAttFile = ImportFileUtil.findFoder(exportFile, "用户告知内容及方式");
otaBaSjGgnrfsService.exportData(fsFile, fsAttFile, otaId, cut);
File qtFile = ImportFileUtil.findFile(exportFile, "其他升级任务信息.xlsx");
otaBaSjQtsjxxService.exportData(qtFile, otaId, cut);
String outPath = uploadPath + "/在线升级活动备案" + System.currentTimeMillis() + ".zip";
FileOutputStream fos1 = new FileOutputStream(outPath);
ImportFileUtil.toZip(exportFile.getCanonicalPath(), fos1, true);
@@ -3,17 +3,26 @@ package com.jero.modules.ota.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.ota.entity.OtaBaCxQt;
import com.jero.modules.ota.entity.OtaBaCxTxjl;
import com.jero.modules.ota.entity.OtaBaSjGgnrfs;
import com.jero.modules.ota.entity.OtaBaSjQtsjxx;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaSjQtsjxxMapper;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.service.IOtaBaSjQtsjxxService;
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.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Date;
@@ -28,6 +37,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class OtaBaSjQtsjxxServiceImpl extends ServiceImpl<OtaBaSjQtsjxxMapper, OtaBaSjQtsjxx> implements IOtaBaSjQtsjxxService {
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
@Autowired
private IOtaBaCxTxjlService otaBaCxTxjlService;
@@ -134,4 +144,24 @@ public class OtaBaSjQtsjxxServiceImpl extends ServiceImpl<OtaBaSjQtsjxxMapper, O
queryWrapper.eq(OtaBaSjQtsjxx::getOtaId, otaId);
return this.getOne(queryWrapper, false);
}
@Override
public void exportData(File file, String otaId, String cut) throws Exception {
OtaBaSjQtsjxx qt = this.getByOtaId(otaId);
if (ObjectUtils.isNotEmpty(qt)) {
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
Row row = s.getRow(0);
Cell cell = row.getCell(1);
cell.setCellValue(qt.getRwmc());
row = s.getRow(1);
cell = row.getCell(1);
cell.setCellValue(sdf.format(qt.getSjfbsj()));
row = s.getRow(2);
cell = row.getCell(1);
cell.setCellValue(sdf.format(qt.getSjjzsj()));
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.lang.reflect.Field;
import java.util.*;
@@ -107,12 +108,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 +186,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;
}
@@ -213,23 +204,20 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
}
@Override
public void importData(MultipartFile file, String otaId, String cut) throws Exception {
public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
parseFileList(upLoadFiles, otaId, cut);
parseFileList(upLoadFiles, otaId, cut,errMsg);
}
@Override
public void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
File attFile = null;
public void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
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 +225,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,errMsg);
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
deleteByOtaId(otaId);
@@ -245,7 +233,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, StringBuilder errMsg) throws Exception {
Date now = new Date();
List<OtaBaSjSjfzbh> fzbhList = new ArrayList<>();
Workbook wb = ImportFileUtil.readExcel(upFile);
@@ -256,44 +244,63 @@ 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);
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(fzbh, errMsg, sysDictService, cut);
fzbhList.add(fzbh);
}
return fzbhList;
}
@Override
public void exportData(File file, String otaId, String cut) throws Exception {
List<OtaBaSjSjfzbh> fzbhList = this.getByOtaId(otaId);
if (ObjectUtils.isNotEmpty(fzbhList)) {
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
Row row;
Cell cell;
int start = 4;
for (OtaBaSjSjfzbh bh : fzbhList) {
row = s.createRow(start);
cell = row.createCell(0);
cell.setCellValue(bh.getGnmc());
cell = row.createCell(1);
cell.setCellValue(bh.getSjmdlx());
cell = row.createCell(2);
cell.setCellValue(bh.getSjqbgcs());
cell = row.createCell(3);
cell.setCellValue(bh.getSjhbgcs());
cell = row.createCell(4);
cell.setCellValue(bh.getGnbgms());
cell = row.createCell(5);
cell.setCellValue(bh.getSytjbg());
cell = row.createCell(6);
cell.setCellValue(bh.getSjsjkzq());
start++;
}
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -1,15 +1,14 @@
package com.jero.modules.ota.service.impl;
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.constant.enums.CutEnum;
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.OtaBaCxTxjl;
import com.jero.modules.ota.entity.OtaBaSjSjmbcl;
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
import com.jero.modules.ota.entity.VinObj;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaSjSjmbclMapper;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
@@ -33,6 +32,8 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -180,7 +181,7 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
}
@Override
public OtaBaSjSjmbcl parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public OtaBaSjSjmbcl parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File upFile = null;
for (File f : upLoadFiles) {
if (f.getName().equals("本次升级涉及的目标车辆.xlsx")) {
@@ -190,13 +191,13 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
if (null == upFile) {
throw new JeroBootException("请上传正确的文件");
}
OtaBaSjSjmbcl mbcl = parseFile(upFile, otaId, cut);
OtaBaSjSjmbcl mbcl = parseFile(upFile, otaId, cut, errMsg);
mbcl.setOtaId(otaId);
add(mbcl);
return mbcl;
}
private OtaBaSjSjmbcl parseFile(File upFile, String otaId, String cut) throws Exception {
private OtaBaSjSjmbcl parseFile(File upFile, String otaId, String cut, StringBuilder errMsg) throws Exception {
OtaBaSjSjmbcl mbcl = new OtaBaSjSjmbcl();
OtaBaSjSjmbcx mbcx = otaBaSjSjmbcxService.queryByOtaId(otaId, "");
if (ObjectUtils.isNotEmpty(mbcx) && StringUtils.isNotEmpty(mbcx.getCpxh())) {
@@ -268,15 +269,46 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
}
@Override
public OtaBaSjSjmbcl importData(MultipartFile file, String otaId, String cut) throws Exception {
public OtaBaSjSjmbcl importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
OtaBaSjSjmbcl mbcl = parseFileList(upLoadFiles, otaId, cut);
OtaBaSjSjmbcl mbcl = parseFileList(upLoadFiles, otaId, cut, errMsg);
return mbcl;
}
@Override
public void exportData(File file, String otaId, String cut) throws Exception {
public void exportData(File file, File mbclAttFile, String otaId, String cut) throws Exception {
OtaBaSjSjmbcl cl = this.getByOtaId(otaId);
if (ObjectUtils.isNotEmpty(cl)) {
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
Row row = s.getRow(0);
Cell cell = row.getCell(1);
cell.setCellValue(cl.getZsl());
row = s.getRow(1);
cell = row.getCell(1);
cell.setCellValue(sdf.format(cl.getScrqks()) + " - " + sdf.format(cl.getScrqjs()));
row = s.getRow(2);
cell = row.getCell(1);
cell.setCellValue(cl.getVinList());
String attStr = cl.getCsv();
if (StringUtils.isNotEmpty(attStr)) {
String[] strs = attStr.split(",");
for (String str : strs) {
List<OSSFile> 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(mbclAttFile.getCanonicalPath() + "/" + ossFile.getFileName(), download);
}
}
}
}
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -179,14 +179,14 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
}
@Override
public OtaBaSjSjmbcx importData(MultipartFile file, String otaId, String cut) throws Exception {
public OtaBaSjSjmbcx importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
OtaBaSjSjmbcx mbcx = parseFileList(upLoadFiles, otaId, cut);
OtaBaSjSjmbcx mbcx = parseFileList(upLoadFiles, otaId, cut, errMsg);
return mbcx;
}
@Override
public OtaBaSjSjmbcx parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public OtaBaSjSjmbcx parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File upFile = null;
for (File f : upLoadFiles) {
if (f.getName().equals("升级目标车型.xlsx")) {
@@ -196,20 +196,27 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
if (null == upFile) {
throw new JeroBootException("请上传正确的文件");
}
OtaBaSjSjmbcx mbcx = parseFile(upFile, cut);
OtaBaSjSjmbcx mbcx = parseFile(upFile, cut, errMsg);
mbcx.setOtaId(otaId);
add(mbcx);
return mbcx;
}
private OtaBaSjSjmbcx parseFile(File upFile, String cut) throws Exception {
private OtaBaSjSjmbcx parseFile(File upFile, String cut, StringBuilder errMsg) throws Exception {
OtaBaSjSjmbcx mbcx = new OtaBaSjSjmbcx();
Workbook wb = ImportFileUtil.readExcel(upFile);
Sheet s = wb.getSheetAt(0);
Row row = s.getRow(1);
Cell cell = row.getCell(2);
mbcx.setBabh(ImportFileUtil.getCellValue(cell, wb));
String cpbh = ImportFileUtil.getCellValue(cell, wb);
if (StringUtils.isEmpty(cpbh)) {
throw new JeroBootException("升级备案编号不能为空");
}
if (cpbh.length() > 50) {
throw new JeroBootException("升级备案编号字数超过50");
}
mbcx.setBabh(cpbh);
row = s.getRow(2);
cell = row.getCell(2);
mbcx.setQymc(ImportFileUtil.getCellValue(cell, wb));
@@ -220,19 +227,25 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
if (StringUtils.isEmpty(pc)) {
throw new JeroBootException("车型及功能备案《公告》批次不能为空");
}
if (pc.length() > 50) {
throw new JeroBootException("车型及功能备案《公告》批次字数超过50");
}
mbcx.setBapc(pc);
//查找车型备案的同批次数据
LambdaQueryWrapper<OtaBaCxJbxx> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OtaBaCxJbxx::getGgpc, pc);
OtaBaCxJbxx jbxx = otaBaCxJbxxService.getOne(queryWrapper, false);
if (ObjectUtils.isEmpty(jbxx)) {
throw new JeroBootException("车型及功能备案《公告》批次:" + jbxx + " 无法找到车型备案数据");
errMsg.append("车型及功能备案《公告》批次:" + pc + " 无法找到车型备案数据");
} else {
mbcx.setCpsb(jbxx.getCpsb());
mbcx.setCpmc(jbxx.getCpmc());
mbcx.setCpxh(jbxx.getCpxh());
mbcx.setDllx1(jbxx.getDllx1());
mbcx.setDllx2(jbxx.getDllx2());
}
mbcx.setBapc(pc);
mbcx.setCpsb(jbxx.getCpsb());
mbcx.setCpmc(jbxx.getCpmc());
mbcx.setCpxh(jbxx.getCpxh());
mbcx.setDllx1(jbxx.getDllx1());
mbcx.setDllx2(jbxx.getDllx2());
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(mbcx, errMsg, sysDictService, cut);
return mbcx;
}
@@ -245,9 +258,24 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
Row row = s.getRow(1);
Cell cell = row.getCell(2);
cell.setCellValue(cx.getBabh());
row = s.getRow(2);
row = s.getRow(3);
cell = row.getCell(2);
cell.setCellValue(cx.getBapc());
row = s.getRow(4);
cell = row.getCell(2);
cell.setCellValue(cx.getCpsb());
row = s.getRow(5);
cell = row.getCell(2);
cell.setCellValue(cx.getCpmc());
row = s.getRow(6);
cell = row.getCell(2);
cell.setCellValue(cx.getCpxh());
row = s.getRow(7);
cell = row.getCell(2);
cell.setCellValue(cx.getDllx1());
row = s.getRow(8);
cell = row.getCell(2);
cell.setCellValue(cx.getDllx2());
wb.write(new FileOutputStream(file));
wb.close();
}
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileOutputStream;
import java.lang.reflect.Field;
import java.util.*;
@@ -203,13 +204,13 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
}
@Override
public void importData(MultipartFile file, String otaId, String cut) throws Exception {
public void importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception{
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
parseFileList(upLoadFiles, otaId, cut);
parseFileList(upLoadFiles, otaId, cut,errMsg);
}
@Override
public void parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public void parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception{
File upFile = null;
for (File f : upLoadFiles) {
if (f.getName().equals("本次升级的系统名称与变更参数.xlsx")) {
@@ -220,7 +221,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
throw new JeroBootException("请上传正确的文件");
}
List<OtaBaSjSjxtbh> newList = parseFile(upFile, otaId, cut);
List<OtaBaSjSjxtbh> newList = parseFile(upFile, otaId, cut,errMsg);
List<OtaBaSjSjxtbh> oldList = getByOtaId(otaId);
if (ObjectUtils.isEmpty(oldList)) {
oldList = new ArrayList<>();
@@ -232,7 +233,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
otaBaCxTxjlService.saveBatch(reList);
}
private List<OtaBaSjSjxtbh> parseFile(File upFile, String otaId, String cut) throws Exception {
private List<OtaBaSjSjxtbh> parseFile(File upFile, String otaId, String cut, StringBuilder errMsg) throws Exception{
Date now = new Date();
List<OtaBaSjSjxtbh> list = new ArrayList<>();
Workbook wb = ImportFileUtil.readExcel(upFile);
@@ -270,6 +271,8 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
xtbh.setSjbdx(ImportFileUtil.getCellValue(cell, wb));
cell = row.getCell(10);
xtbh.setSfcfsj(ImportFileUtil.getCellValue(cell, wb));
ComparisonUtil cu = new ComparisonUtil();
cu.checkError(xtbh, errMsg, sysDictService, cut);
if (xtbh.isNull()) {
break;
}
@@ -284,6 +287,43 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
@Override
public void exportData(File file, String otaId, String cut) throws Exception {
List<OtaBaSjSjxtbh> bhList = this.getByOtaId(otaId);
if (ObjectUtils.isNotEmpty(bhList)) {
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
Row row;
Cell cell;
int start = 4;
for (OtaBaSjSjxtbh bh : bhList) {
row = s.createRow(start);
cell = row.createCell(0);
cell.setCellValue(bh.getXtmc());
cell = row.createCell(1);
cell.setCellValue(bh.getSjqbgcs());
cell = row.createCell(2);
cell.setCellValue(bh.getSjhbgcs());
cell = row.createCell(3);
cell.setCellValue(bh.getSjkzqmc());
cell = row.createCell(4);
cell.setCellValue(bh.getYjbb());
cell = row.createCell(5);
cell.setCellValue(bh.getSjqrjbb());
cell = row.createCell(6);
cell.setCellValue(bh.getSjhrjbb());
cell = row.createCell(7);
cell.setCellValue(bh.getSjqczxt());
cell = row.createCell(8);
cell.setCellValue(bh.getSjhczxt());
cell = row.createCell(9);
cell.setCellValue(bh.getSjbyzsj());
cell = row.createCell(10);
cell.setCellValue(bh.getSjbdx());
cell = row.createCell(11);
cell.setCellValue(bh.getSfcfsj());
start++;
}
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -3,6 +3,8 @@ 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.*;
import com.jero.modules.ota.enums.OtaModuleEnum;
@@ -14,6 +16,10 @@ 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.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +28,7 @@ import org.springframework.stereotype.Service;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.List;
import java.util.Date;
@@ -194,13 +201,13 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
}
@Override
public OtaBaSjSjyxpg importData(MultipartFile file, String otaId, String cut) throws Exception {
public OtaBaSjSjyxpg importData(MultipartFile file, String otaId, String cut, StringBuilder errMsg) throws Exception {
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
OtaBaSjSjyxpg sjyxpg = parseFileList(upLoadFiles, otaId, cut);
OtaBaSjSjyxpg sjyxpg = parseFileList(upLoadFiles, otaId, cut, errMsg);
return sjyxpg;
}
private OtaBaSjSjyxpg parseFile(File upFile, File attFile1, File attFile2, String cut) throws Exception {
private OtaBaSjSjyxpg parseFile(File upFile, File attFile1, File attFile2, String cut, StringBuilder errMsg) throws Exception {
OtaBaSjSjyxpg sjyxpg = new OtaBaSjSjyxpg();
InputStream is = new FileInputStream(upFile);
XWPFDocument doc = new XWPFDocument(is);
@@ -246,7 +253,7 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
}
@Override
public OtaBaSjSjyxpg parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
public OtaBaSjSjyxpg parseFileList(List<File> upLoadFiles, String otaId, String cut, StringBuilder errMsg) throws Exception {
File upFile = null;
File attFile = null;
File attFile1 = null;
@@ -277,14 +284,87 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
}
OtaBaSjSjyxpg sjyxpg = parseFile(upFile, attFile1, attFile2, cut);
OtaBaSjSjyxpg sjyxpg = parseFile(upFile, attFile1, attFile2, cut, errMsg);
sjyxpg.setOtaId(otaId);
add(sjyxpg);
return sjyxpg;
}
@Override
public void exportData(File file, String otaId, String cut) throws Exception {
public void exportData(File file, File attFile1, File attFile2, String otaId, String cut) throws Exception {
OtaBaSjSjyxpg pg = this.getByOtaId(otaId);
if (ObjectUtils.isNotEmpty(pg)) {
Workbook wb = ImportFileUtil.readExcel(file);
Sheet s = wb.getSheetAt(0);
Row row = s.getRow(0);
Cell cell = row.getCell(1);
cell.setCellValue(ComparisonUtil.queryDictTextByKey("uipgrade_purpose", pg.getSjmd(), sysDictService));
row = s.getRow(1);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getSfbgcs()));
row = s.getRow(2);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getSjxnbh()));
row = s.getRow(3);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getFhgd()));
row = s.getRow(4);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getZdjsxg()));
row = s.getRow(5);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getJrxxg()));
row = s.getRow(6);
cell = row.getCell(1);
cell.setCellValue(ComparisonUtil.queryDictTextByKey("conditions_upgrades", pg.getZxsj().toString(), sysDictService));
row = s.getRow(7);
cell = row.getCell(1);
cell.setCellValue(ComparisonUtil.queryDictTextByKey("upgrade_failed", pg.getAqjz(), sysDictService));
row = s.getRow(8);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getSfyxaq()));
row = s.getRow(9);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getYhqr()));
row = s.getRow(10);
cell = row.getCell(1);
cell.setCellValue(ComparisonUtil.queryDictTextByKey("package_test", pg.getSjbcs(), sysDictService));
row = s.getRow(11);
cell = row.getCell(1);
cell.setCellValue(ImportFileUtil.getCellValueYesOrNoInt(pg.getAqkkx()));
String attStr1 = pg.getBgfj();
if (StringUtils.isNotEmpty(attStr1)) {
String[] strs = attStr1.split(",");
for (String str : strs) {
List<OSSFile> 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(attFile1.getCanonicalPath() + "/" + ossFile.getFileName(), download);
}
}
}
}
String attStr2 = pg.getBgfj();
if (StringUtils.isNotEmpty(attStr2)) {
String[] strs = attStr2.split(",");
for (String str : strs) {
List<OSSFile> 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(attFile2.getCanonicalPath() + "/" + ossFile.getFileName(), download);
}
}
}
}
wb.write(new FileOutputStream(file));
wb.close();
}
}
}
@@ -177,6 +177,56 @@ public class ComparisonUtil<T> {
return resList;
}
public void checkAttError(String[] strs, StringBuilder errMsg, String title, String cut) {
for (String str:strs) {
if(!str.endsWith(".doc")&&!str.endsWith(".docx")&&!str.endsWith(".pdf")&&!str.endsWith(".DOC")&&!str.endsWith(".DOCX")&&!str.endsWith(".PDF")){
errMsg.append(title + " 支持doc/docx/pdf格式 , ");
}
}
}
public void checkError(T clazz, StringBuilder errMsg, ISysDictService sysDictService, String cut) {
Field[] fields = clazz.getClass().getDeclaredFields();
for (Field field : fields) {
OtaTitleEnum ote = OtaTitleEnum.getOtaTitleEnum(field.getName());
if (null == ote) {
continue;
}
String title = ote.getValue();
field.setAccessible(true);
try {
Object val = field.get(clazz);
if (ObjectUtils.isNotEmpty(val)) {
String str = val.toString();
if ("0".equals(ote.getType())) {
if (str.length() > ote.getLen()) {
errMsg.append(title + " 的长度超过了 " + ote.getLen() + ", ");
field.set(clazz, "");
}
} else if ("2".equals(ote.getType())) {
if (!"".equals(str) && !"".equals(str)) {
errMsg.append(title + " 必须填写是或否 , ");
field.set(clazz, "");
}
} else if ("3".equals(ote.getType())) {
//不处理
} else {
String[] strs = str.split(",");
for (String s : strs) {
String res = sysDictService.queryDictItemByValue(ote.getType(), s, cut);
if (StringUtils.isEmpty(res)) {
errMsg.append(title + " 填写了无法识别的选项 , ");
field.set(clazz, "");
}
}
}
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
public List<OtaBaCxTxjl> comparisonCertRecord(String otaId, OtaModuleEnum otaModuleEnum, String tableTitle, T oldClazz, T newClazz, ISysDictService sysDictService) {
List<OtaBaCxTxjl> resList = new ArrayList<>();
@@ -212,6 +262,21 @@ public class ComparisonUtil<T> {
return resList;
}
public static String queryDictTextByKey(String dictKey, String str, ISysDictService sysDictService) {
StringBuilder sb = new StringBuilder();
if (StringUtils.isNotEmpty(str)) {
String[] strs = str.split(",");
for (int i = 0; i < strs.length; i++) {
if (i >= strs.length - 1) {
sb.append(sysDictService.queryDictTextByKey(dictKey, strs[i]));
} else {
sb.append(sysDictService.queryDictTextByKey(dictKey, strs[i])).append(",");
}
}
}
return sb.toString();
}
private String parseDictText(OtaTitleEnum ote, Field field, T clazz, ISysDictService sysDictService) {
String res = "";
try {
@@ -77,12 +77,13 @@ public class ImportFileUtil {
saveDirectory.mkdir();
}
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + File.separator + file.getOriginalFilename()));
//解压缩
String zipEntryName = "";
if (str.equals("zip")) {
zipEntryName = FileUnZip.unZipFiles(path + File.separator + file.getOriginalFilename(), path);
}
FileUtils.forceDelete(new File(path + File.separator + file.getOriginalFilename()));
return new File(path);
}
@@ -90,10 +91,7 @@ public class ImportFileUtil {
List<File> 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")) {
fileList.add(file1);
}
fileList.add(file1);
}
return fileList;
}
@@ -277,13 +275,23 @@ public class ImportFileUtil {
return mFile;
}
public static List<OSSFile> uploadFiles1(File attFile, String[] strs, IOSSFileService ossFileService) throws Exception {
public static List<OSSFile> uploadFiles1(File attFile, String[] strs, IOSSFileService ossFileService, StringBuilder errMsg, String title, String cut) throws Exception {
List<OSSFile> res = new ArrayList<>();
for (int i = 0; i < strs.length; i++) {
if (StringUtils.isNotEmpty(strs[i])) {
File file = ImportFileUtil.findFile(attFile, strs[i]);
if (null == file) {
throw new JeroBootException("找不到文件" + strs[i]);
errMsg.append(title + " 找不到文件 , ");
continue;
}
if (!file.getName().endsWith(".doc") && !file.getName().endsWith(".docx") && !file.getName().endsWith(".pdf")
&& !file.getName().endsWith(".DOC") && !file.getName().endsWith(".DOCX") && !file.getName().endsWith(".PDF")) {
errMsg.append(title + " 只支持doc/docx/pdf格式 , ");
continue;
}
if (file.length() > 50 * 1024 * 1024) {
errMsg.append(title + " 上传文件不可以超过50MB , ");
continue;
}
OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null);
if (ObjectUtils.isNotEmpty(ossFile)) {
@@ -303,13 +311,23 @@ public class ImportFileUtil {
return res;
}
public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService) throws Exception {
public static String uploadFiles(File attFile, String[] strs, IOSSFileService ossFileService, StringBuilder errMsg, String title, String cut) throws Exception {
String res = "";
for (int i = 0; i < strs.length; i++) {
if (StringUtils.isNotEmpty(strs[i])) {
File file = ImportFileUtil.findFile(attFile, strs[i]);
if (null == file) {
throw new JeroBootException("找不到文件" + strs[i]);
errMsg.append(title + " 找不到文件 , ");
continue;
}
if (!file.getName().endsWith(".doc") && !file.getName().endsWith(".docx") && !file.getName().endsWith(".pdf")
&& !file.getName().endsWith(".DOC") && !file.getName().endsWith(".DOCX") && !file.getName().endsWith(".PDF")) {
errMsg.append(title + " 只支持doc/docx/pdf格式 , ");
continue;
}
if (file.length() > 50 * 1024 * 1024) {
errMsg.append(title + " 上传文件不可以超过50MB , ");
continue;
}
OSSFile ossFile = ossFileService.uploadLocalOfCos(ImportFileUtil.createMfileByFile(file), "", null, null);
if (ObjectUtils.isNotEmpty(ossFile)) {
@@ -2859,6 +2859,49 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
}
}
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
for(int k = 0 ;k<rowList.size();k++){
if("".equals(rowList.get("category")) ||
"".equals(rowList.get("inspectionItem")) ||
"".equals(rowList.get("configItem")) ||
"".equals(rowList.get("wvtaId")) ||
"".equals(rowList.get("serialNumber")) ||
"".equals(rowList.get("dutyTerritoryName")) ||
"".equals(rowList.get("sdtName")) ||
"".equals(rowList.get("dutyPersonName")) ||
"".equals(rowList.get("deliverableTypeName")) ||
"".equals(rowList.get("endTimeStr")) ){
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
throw new JeroBootException("请填写必填字段内容,带*的为必填");
}else{
throw new JeroBootException("Please fill in the required fields marked with *");
}
}
}
}else {
for(int k = 0 ;k<rowList.size();k++){
if("".equals(rowList.get("category")) ||
"".equals(rowList.get("inspectionItem")) ||
"".equals(rowList.get("configItem")) ||
"".equals(rowList.get("wvtaId")) ||
"".equals(rowList.get("serialNumber")) ||
"".equals(rowList.get("dutyTerritoryName")) ||
"".equals(rowList.get("sdtName")) ||
"".equals(rowList.get("dutyPersonName")) ||
"".equals(rowList.get("deliverableTypeNameEn")) ||
"".equals(rowList.get("endTimeStr")) ){
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
throw new JeroBootException("请填写必填字段内容,带*的为必填");
}else{
throw new JeroBootException("Please fill in the required fields marked with *");
}
}
}
}
if (i > 1) {
dataList.add(rowList);
}
@@ -3006,7 +3049,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
//编号必填
flag = must(projectCertificationInventoryEO, errorMsg, msgList, serialNumber, "编号", "Standard No");
// flag = must(projectCertificationInventoryEO, errorMsg, msgList, serialNumber, "编号", "Standard No");
//报告编号
if(StringUtils.isNotBlank(reportNumber)){
@@ -3056,15 +3099,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
msgList.add(message);
}
} else {
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "WVTA ID不能为空, ";
}else{
message = errorMsg + " The WVTA ID cannot null, ";
}
msgList.add(message);
}
// else {
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "WVTA ID不能为空, ";
// }else{
// message = errorMsg + " The WVTA ID cannot null, ";
// }
// msgList.add(message);
// }
//类别
if(StringUtils.isNotBlank(category)){
@@ -3077,15 +3121,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
msgList.add(message);
}
}else {
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "类别不能为空, ";
}else{
message = errorMsg + " The Category cannot null, ";
}
msgList.add(message);
}
// else {
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "类别不能为空, ";
// }else{
// message = errorMsg + " The Category cannot null, ";
// }
// msgList.add(message);
// }
//检验项目
if(StringUtils.isNotBlank(inspectionItem)){
@@ -3098,15 +3143,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
msgList.add(message);
}
}else {
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "检验项目不能为空, ";
}else{
message = errorMsg + " The InspectionItem cannot null, ";
}
msgList.add(message);
}
// else {
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "检验项目不能为空, ";
// }else{
// message = errorMsg + " The InspectionItem cannot null, ";
// }
// msgList.add(message);
// }
//配置项
if(StringUtils.isNotBlank(configItem)){
@@ -3119,15 +3165,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
msgList.add(message);
}
}else {
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "配置项不能为空, ";
}else{
message = errorMsg + " The ConfigItem cannot null, ";
}
msgList.add(message);
}
// else {
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "配置项不能为空, ";
// }else{
// message = errorMsg + " The ConfigItem cannot null, ";
// }
// msgList.add(message);
// }
//责任领域
@@ -3136,15 +3183,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.isNotBlank(value)){
projectCertificationInventoryEO.setDutyTerritory(value);
}
}else {
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "责任领域不能为空, ";
}else{
message = errorMsg + " The Responsible Field cannot null, ";
}
msgList.add(message);
}
// else {
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "责任领域不能为空, ";
// }else{
// message = errorMsg + " The Responsible Field cannot null, ";
// }
// msgList.add(message);
// }
//工程接口人(责任领域下的工程接口人)
Map<String, Object> objectMap = iProjectRelatedPersonnelService.queryPersonByProjectId(projectCertificationInventoryEOTemp.getProjectLibraryId(), value);
@@ -3166,30 +3214,32 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
nameEn = "Eng. Interface ";
//验证人员是否存在
personnelVerify(projectCertificationInventoryEO, errorMsg, msgList, sdt, mapPersonList,nameCn,nameEn, com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue());
}else {
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "工程接口人不能为空, ";
}else{
message = errorMsg + " The Eng. Interface cannot null, ";
}
msgList.add(message);
}
// else {
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "工程接口人不能为空, ";
// }else{
// message = errorMsg + " The Eng. Interface cannot null, ";
// }
// msgList.add(message);
// }
//责任人
if(StringUtils.isNotBlank(dutyPerson)){
nameCn = "责任人";
nameEn = "Assignee";
//验证人员是否存在
personDutyPerson(projectCertificationInventoryEO, errorMsg, msgList, dutyPerson, listUserName,nameCn,nameEn);
}else {
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "责任人不能为空, ";
}else{
message = errorMsg + " The Assignee cannot null, ";
}
msgList.add(message);
}
// else {
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "责任人不能为空, ";
// }else{
// message = errorMsg + " The Assignee cannot null, ";
// }
// msgList.add(message);
// }
//交付物类型
if(StringUtils.isNotEmpty(deliverableType)){
value = tree(categoryList,treeNameList, projectCertificationInventoryEO, errorMsg, deliverableType,msgList,"交付物类型","Deliverable Type","deliverable_template");
@@ -3197,15 +3247,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
String treeId = getTreeId(categoryList, projectCertificationInventoryEOTemp, treeNameList, value);
projectCertificationInventoryEO.setDeliverableType(treeId);
}
}else{
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "交付物类型不能为空, ";
}else{
message = errorMsg + " The Deliverable Type cannot null, ";
}
msgList.add(message);
}
// else{
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "交付物类型不能为空, ";
// }else{
// message = errorMsg + " The Deliverable Type cannot null, ";
// }
// msgList.add(message);
// }
//交付物模板
value = templateTransition(zipEntryName, projectCertificationInventoryEO, errorMsg, deliverableTemplate,msgList,"交付物模板","Deliverable Template");
@@ -3227,15 +3278,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
projectCertificationInventoryEO.setEndTime(date);
}
}else{
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
message = errorMsg + "截止时间不能为空, ";
}else{
message = errorMsg + " The Due Date Type cannot null, ";
}
msgList.add(message);
}
// else{
// String message = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
// message = errorMsg + "截止时间不能为空, ";
// }else{
// message = errorMsg + " The Due Date Type cannot null, ";
// }
// msgList.add(message);
// }
}
return msgList;
@@ -3271,9 +3323,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if (!DateUtils.isValidDate(field)) {
flag = false;
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日";
errorMsg += nameCn + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}else{
errorMsg += nameEn + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日";
errorMsg += nameEn + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}
msgList.add(errorMsg);
}
@@ -3286,9 +3338,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(longnow>longdate){
flag = false;
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn + "不能导入今天之前的日期";
errorMsg += nameCn + "不能导入今天之前的日期, ";
}else{
errorMsg += nameEn + " Cannot import dates before today ";
errorMsg += nameEn + " Cannot import dates before today, ";
}
msgList.add(errorMsg);
}
@@ -3433,9 +3485,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
if(count==0){
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn+regulationOwnerId+"与所有人员名单不匹配";
errorMsg += nameCn+regulationOwnerId+"与所有人员名单不匹配, ";
}else{
errorMsg += nameEn+regulationOwnerId+"does not match a person with all person list";
errorMsg += nameEn+regulationOwnerId+"does not match a person with all person list, ";
}
msgList.add(errorMsg);
}
@@ -3467,17 +3519,17 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
if(count == 0){
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配";
errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配, ";
}else{
errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list";
errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list, ";
}
msgList.add(errorMsg);
}
}else{
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配";
errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配, ";
}else{
errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list";
errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list, ";
}
msgList.add(errorMsg);
}
@@ -3518,8 +3570,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
//编号验证
private void verifySerialNumber(List<ProjectCertificationInventoryEO> datas,
ProjectCertificationInventoryEO projectCertificationInventoryEOTemp) {
//1. 验证标准号在文档库中是否存在
List<String> serialNumberList = datas.stream().map(ProjectCertificationInventoryEO::getSerialNumber).collect(Collectors.toList());
//1. 验证标准号在文档库中是否存在
LambdaQueryWrapper<BussDocumentLibraryEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(BussDocumentLibraryEO::getSerialNumber,serialNumberList);
List<BussDocumentLibraryEO> bussDocumentLibraryEOList = iBussDocumentLibraryEOService.list(wrapper);
@@ -3537,24 +3591,31 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
}
}else{
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : datas) {
List<BussDocumentLibraryEO> collect = bussDocumentLibraryEOList.stream()
.filter(e -> e.getSerialNumber().equals(projectCertificationInventoryEO.getSerialNumber())).collect(Collectors.toList());
projectCertificationInventoryEO.setBussDocumentLibraryId(collect.get(0).getId());
//验证编号在法规清单中是否存在
LambdaQueryWrapper<ProjectLawsInventoryEO> lwrapper = new LambdaQueryWrapper<>();
lwrapper.in(ProjectLawsInventoryEO::getSerialNumber,serialNumberList);
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOService.list(lwrapper);
List<String> LawSerialNumberListTemp = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.toList());
if(serialNumberList.size() != LawSerialNumberListTemp.size()){
//存在法规清单中没有的数据
List<String> collect = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).collect(Collectors.toList());
List<String> serialNumbers = serialNumberList.stream().filter(e -> !collect.contains(e)).collect(Collectors.toList());
if(serialNumbers.size() > 0){
if(CutEnum.CN.getValue().equals(datas.get(0).getCut())){
throw new JeroBootException(StringUtils.join(serialNumbers,",")+"法规清单中不存在,不能添加");
}else{
throw new JeroBootException(StringUtils.join(serialNumbers,",")+" does not exist in the project laws and cannot be added");
}
}
}else{
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : datas) {
List<BussDocumentLibraryEO> collect = bussDocumentLibraryEOList.stream()
.filter(e -> e.getSerialNumber().equals(projectCertificationInventoryEO.getSerialNumber())).collect(Collectors.toList());
projectCertificationInventoryEO.setBussDocumentLibraryId(collect.get(0).getId());
}
}
}
// //2. 验证标准号在法规清单中是否添加过
// LambdaQueryWrapper<ProjectCertificationInventoryEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// lambdaQueryWrapper.in(ProjectCertificationInventoryEO::getSerialNumber,serialNumberList).in(ProjectCertificationInventoryEO::getProjectLibraryId,projectCertificationInventoryEOTemp.getProjectLibraryId());
// List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(lambdaQueryWrapper);
// List<String> serialNumberTempList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getSerialNumber).collect(Collectors.toList());
// if(projectCertificationInventoryEOList.size() > 0){
// if(CutEnum.CN.getValue().equals(datas.get(0).getCut())){
// throw new JeroBootException(StringUtils.join(serialNumberTempList,",")+"已存在,不能重复添加");
// }else{
// throw new JeroBootException(StringUtils.join(serialNumberTempList,",")+" already exists and cannot be added again");
// }
// }
}
/**
@@ -291,7 +291,7 @@ export default {
this.confirmLoading = false
this.bussLogList()
} else {
this.$message.warning(this.$t('operationFailed'))
this.$message.warning(res.message)
this.confirmLoading = false
}
})
@@ -428,7 +428,7 @@ export default {
localStorage.removeItem('otaIdT')
this.$router.push({
path: '/upgradeactivityrecord',
query: {}
query: { type:2}
})
},
viewProcessClick(row) {
@@ -53,15 +53,16 @@
</span>
</a-table>
<div>
<a-button type="primary" @click="clickButtonToUpload(fileList)">
{{ (fileList === 'null' || fileList === '' ||
fileList == null) ? $t('uploadattachment') : $t('viewUploadedFiles')
}}
</a-button>
<div style='margin-top: 20px'>
<p>{{$t('note')}}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;{{$t('format')}}</p>
</div>
<!-- 上传附件-->
<!-- <a-button type="primary" @click="clickButtonToUpload(fileList)">-->
<!-- {{ (fileList === 'null' || fileList === '' ||-->
<!-- fileList == null) ? $t('uploadattachment') : $t('viewUploadedFiles')-->
<!-- }}-->
<!-- </a-button>-->
<!-- <div style='margin-top: 20px'>-->
<!-- <p>{{$t('note')}}</p>-->
<!-- <p>&nbsp;&nbsp;&nbsp;&nbsp;{{$t('format')}}</p>-->
<!-- </div>-->
</div>
<div class="bootom-button">
<a-button style="margin-right:50px" @click="save">{{$t('preservation')}}</a-button>
@@ -140,6 +140,9 @@ export default {
}
getAction('/ota/otaBaSjSjmbcl/queryByOtaId',{otaIdT:otaIdT,otaId:otaId}).then(res=>{
if(res.code==200){
if(res.result==null){
res.result={}
}
this.formInline.zsl=res.result.zsl
this.formInline.vinList=res.result.vinList
this.formInline.csv=res.result.csv
@@ -148,7 +151,7 @@ export default {
res.result.scrqjs=res.result.scrqjs == null ? "" : res.result.scrqjs
this.formInline.dateofproduction.push(res.result.scrqks)
this.formInline.dateofproduction.push(res.result.scrqjs)
this.formInline.id = res.result.vinList
this.formInline.id = res.result.id
this.$forceUpdate()
}
@@ -130,7 +130,7 @@
</a-select>
</a-form-model-item>
<a-form-model-item class="itemModel" style="width: 40%;margin-left:-9px">
<a-select v-model="form.dllx2" class="box-input" :disabled="disabled" :placeholder="$t('PleaseSelect')" @change="update">
<a-select v-model="form.dllx2" class="box-input" :disabled="disabled" :placeholder="$t('PleaseSelect')" @change="update2">
<a-select-option v-for="(item, key) in projectNameList2"
:key="key"
:value="item">
@@ -168,7 +168,8 @@ import ImportFile from '@/components/ImportFileData/index'
confirmLoading: false,
disabled: false,
form:{
qymc:'安徽江淮汽车集团股份有限公司'
qymc:'安徽江淮汽车集团股份有限公司',
bapc:undefined
},
url: {
exportData: '/ota/otaBaSjSjmbcx/exportData',
@@ -216,8 +217,23 @@ import ImportFile from '@/components/ImportFileData/index'
this.form.dllx1=undefined
this.form.dllx2=undefined
this.form.qymc='安徽江淮汽车集团股份有限公司'
// if(this.$route.query.type == 1 && res.result.cxmb == null){
// this.form.cxmb=this.form.ggpc+'-'+ this.form.cpmc+'-'+this.form.cpxh
// }
}else{
this.form=res.result
if(this.$route.query.type == 1 && res.result.cxmb == null){
this.form.cxmb = this.form.babh+'-'+ this.form.bapc+'-'+this.form.cpxh
}else {
if(this.$route.query.type == 2 && res.result.cxmb == null){
this.form.cxmb = this.form.babh+'-'+ this.form.bapc+'-'+this.form.cpxh
}else{
this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined
}
}
if(res.result.dllx1==null){
this.form.dllx1=undefined
@@ -242,6 +258,11 @@ import ImportFile from '@/components/ImportFileData/index'
if(otaId==null){
otaId=''
}
// if(this.form.bapc!=null && this.form.bapc!=undefined && this.form.bapc!=''){
// this.$nextTick(()=>{
// this.$refs.ruleForm.clearValidate('bapc')
// })
// }
this.$refs.ruleForm.validate(valid=>{
if(valid){
this.selectListPc.map(item=>{
@@ -256,12 +277,19 @@ import ImportFile from '@/components/ImportFileData/index'
this.getData()
}
})
}else{
this.form.bapc=undefined
}
})
},
next(){
this.save()
// if(this.form.bapc!=null && this.form.bapc!=undefined && this.form.bapc!=''){
// this.$nextTick(()=>{
// this.$refs.ruleForm.clearValidate('bapc')
// })
// }
this.$refs.ruleForm.validate(valid=>{
if(valid){
this.$emit('basicInformationForm')
@@ -289,7 +317,7 @@ import ImportFile from '@/components/ImportFileData/index'
res.result.forEach(item=>{
let obj={}
obj.id=item.id
obj.cpdjbh=item.cpdjbh
obj.cpdjbh=item.cpdjbh+'-'+item.ggpc+'-'+item.cpxh
this.selectListMb.push(obj)
})
}
@@ -309,21 +337,33 @@ import ImportFile from '@/components/ImportFileData/index'
},
changeId(value,option){
this.selectListPc.map(item=>{
if(item.id==value){
this.form.cpsb = item.cpsb
this.form.cpmc = item.cpmc
this.form.cpxh = item.cpxh
getAction('/ota/otaBaCxJbxx/queryByOtaId',{otaIdT:'',otaId:item.id}).then(res=>{
this.form.dllx1=res.result.dllx1 == null?undefined:res.result.dllx1
this.form.dllx2=res.result.dllx2== null?undefined:res.result.dllx2
this.$forceUpdate()
})
}
})
this.$nextTick(()=>{
this.form={...this.form}
this.$refs.ruleForm.validateField('bapc')
})
this.selectListPc.map(item=>{
if(item.id==value){
this.form.cpsb = item.cpsb
this.form.cpmc = item.cpmc
this.form.cpxh = item.cpxh
getAction('/ota/otaBaCxJbxx/queryByOtaId',{otaIdT:'',otaId:item.id}).then(res=>{
this.form.dllx1=res.result.dllx1 == null?undefined:res.result.dllx1
this.form.dllx2=res.result.dllx2== null?undefined:res.result.dllx2
})
}
})
this.$forceUpdate()
},
update(){
update(val){
this.$forceUpdate()
localStorage.removeItem('otaId')
localStorage.removeItem('otaIdT')
localStorage.setItem('otaIdT',val)
this.getData()
},
update2(){
this.$forceUpdate()
}
}
@@ -331,7 +331,11 @@ import { message } from 'ant-design-vue'
if(this.$route.query.type == 1 && res.result.cxmb == null){
this.form.cxmb = this.form.ggpc+'-'+ this.form.cpmc+'-'+this.form.cpxh
}else {
this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined
if(this.$route.query.type == 2 && res.result.cxmb == null){
this.form.cxmb = this.form.ggpc+'-'+ this.form.cpmc+'-'+this.form.cpxh
}else{
this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined
}
}
if(res.result.dllx1 == null ){
res.result.dllx1 = undefined
@@ -385,7 +385,7 @@ export default {
localStorage.removeItem('otaIdT')
this.$router.push({
path: '/vehicleinformation',
query: { type:1}
query: { type:2}
})
},
viewProcessClick(row) {