开发OTA备案工具-填写记录

This commit is contained in:
高嵩
2023-03-26 01:38:26 +08:00
parent 7f99dfa14e
commit 7f2843de34
5 changed files with 46 additions and 6 deletions
@@ -8,7 +8,7 @@ public enum OtaModuleEnum {
CX_KSJDXTMCYCS("可升级的系统名称与参数", "1","1"),
CX_KZXSJDJSFZGNMCYCS("可在线升级的驾驶辅助功能名称与参数", "1","1"),
CX_JSFZXTJCBACS("驾驶辅助系统基础备案参数", "1","1"),
CX_QT("QT", "1","1");
CX_QT("其他", "1","1");
String name;
String nameEN;
@@ -5,10 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.ota.entity.AttachmentEO;
import com.jero.modules.ota.entity.OtaBaCxAqcs;
import com.jero.modules.ota.entity.OtaBaCxJbxx;
import com.jero.modules.ota.entity.OtaBaCxTxjl;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaCxAqcsMapper;
import com.jero.modules.ota.service.IOtaBaCxAqcsService;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.utils.ComparisonUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -25,6 +30,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBaCxAqcs> implements IOtaBaCxAqcsService {
@Autowired
private IOtaBaCxTxjlService otaBaCxTxjlService;
/**
* 保存
*
@@ -50,6 +58,9 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
otaBaCxAqcs.setZmcl(obj.toString());
}
saveOrUpdate(otaBaCxAqcs);
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxAqcsOld.getOtaId(), OtaModuleEnum.CX_AQCS, otaBaCxAqcsOld, otaBaCxAqcs);
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -4,14 +4,14 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.ota.entity.OtaBaCxJsfzbacs;
import com.jero.modules.ota.entity.OtaBaCxKsjxtmccs;
import com.jero.modules.ota.entity.OtaBaCxLsjl;
import com.jero.modules.ota.entity.OtaBaCxSjmk;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaCxJsfzbacsMapper;
import com.jero.modules.ota.service.IOtaBaCxJsfzbacsService;
import com.jero.modules.ota.service.IOtaBaCxLsjlService;
import com.jero.modules.ota.service.IOtaBaCxSjmkService;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.utils.ComparisonUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -30,6 +30,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMapper, OtaBaCxJsfzbacs> implements IOtaBaCxJsfzbacsService {
@Autowired
private IOtaBaCxTxjlService otaBaCxTxjlService;
@Autowired
private IOtaBaCxSjmkService OtaBaCxSjmkService;
@@ -41,12 +43,16 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
public void add(JSONObject json) {
OtaBaCxJsfzbacs otaBaCxJsfzbacs = new OtaBaCxJsfzbacs();
String otaId = json.getString("otaId");
OtaBaCxJsfzbacs otaBaCxJsfzbacsOld = this.getByOtaId(otaId);
otaBaCxJsfzbacs.setOtaId(otaId);
parseBjData(json, otaBaCxJsfzbacs);
Date now = new Date();
otaBaCxJsfzbacs.setCreateTime(now);
otaBaCxJsfzbacs.setUpdateTime(now);
saveOrUpdate(otaBaCxJsfzbacs);
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaId, OtaModuleEnum.CX_JSFZXTJCBACS, otaBaCxJsfzbacsOld, otaBaCxJsfzbacs);
otaBaCxTxjlService.saveBatch(reList);
//处理控制器列表,先删除,后添加
OtaBaCxSjmkService.deleteByOtaId(otaId);
JSONArray kzq = json.getJSONArray("kzq");
@@ -3,9 +3,14 @@ package com.jero.modules.ota.service.impl;
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.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 org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -22,6 +27,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class OtaBaCxQtServiceImpl extends ServiceImpl<OtaBaCxQtMapper, OtaBaCxQt> implements IOtaBaCxQtService {
@Autowired
private IOtaBaCxTxjlService otaBaCxTxjlService;
/**
* 保存
*
@@ -40,6 +48,9 @@ public class OtaBaCxQtServiceImpl extends ServiceImpl<OtaBaCxQtMapper, OtaBaCxQt
}
otaBaCxQt.setUpdateTime(now);
saveOrUpdate(otaBaCxQt);
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxQt.getOtaId(), OtaModuleEnum.CX_QT, otaBaCxQtOld, otaBaCxQt);
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -5,11 +5,16 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.ota.entity.AttachmentEO;
import com.jero.modules.ota.entity.OtaBaCxJbxx;
import com.jero.modules.ota.entity.OtaBaCxTxjl;
import com.jero.modules.ota.entity.OtaBaCxZxsjyq;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaCxZxsjyqMapper;
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.service.IOtaBaCxZxsjyqService;
import com.jero.modules.ota.utils.ComparisonUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -26,6 +31,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, OtaBaCxZxsjyq> implements IOtaBaCxZxsjyqService {
@Autowired
private IOtaBaCxTxjlService otaBaCxTxjlService;
/**
* 保存
*
@@ -34,9 +42,10 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
*/
@Override
public void add(OtaBaCxZxsjyq otaBaCxZxsjyq) {
OtaBaCxZxsjyq otaBaCxZxsjyqOld = new OtaBaCxZxsjyq();;
Date now = new Date();
if (otaBaCxZxsjyq.getOtaId() != null) {
OtaBaCxZxsjyq otaBaCxZxsjyqOld = getByOtaId(otaBaCxZxsjyq.getOtaId());
otaBaCxZxsjyqOld = getByOtaId(otaBaCxZxsjyq.getOtaId());
if (otaBaCxZxsjyqOld != null) {
otaBaCxZxsjyq.setId(otaBaCxZxsjyqOld.getId());
} else {
@@ -52,6 +61,9 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
otaBaCxZxsjyq.setZmcl(obj.toString());
}
saveOrUpdate(otaBaCxZxsjyq);
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxZxsjyq.getOtaId(), OtaModuleEnum.CX_ZXSJYQ, otaBaCxZxsjyqOld, otaBaCxZxsjyq);
otaBaCxTxjlService.saveBatch(reList);
}
/**