开发OTA备案工具-车辆升级
This commit is contained in:
+1
@@ -84,6 +84,7 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
}
|
}
|
||||||
otaBaCxJbxx.setOtaId(otaBaCxJbxx.getOtaId());
|
otaBaCxJbxx.setOtaId(otaBaCxJbxx.getOtaId());
|
||||||
otaBaCxJbxx.setUpdateTime(now);
|
otaBaCxJbxx.setUpdateTime(now);
|
||||||
|
deleteById(otaBaCxJbxx.getId());
|
||||||
saveOrUpdate(otaBaCxJbxx);
|
saveOrUpdate(otaBaCxJbxx);
|
||||||
ComparisonUtil cu = new ComparisonUtil();
|
ComparisonUtil cu = new ComparisonUtil();
|
||||||
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxJbxx.getOtaId(), OtaModuleEnum.CX_CXJBXX, otaBaCxJbxxOld, otaBaCxJbxx, sysDictService);
|
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxJbxx.getOtaId(), OtaModuleEnum.CX_CXJBXX, otaBaCxJbxxOld, otaBaCxJbxx, sysDictService);
|
||||||
|
|||||||
+18
-20
@@ -28,6 +28,7 @@ import java.io.File;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-用户告知内容及方式
|
* @Description: 升级备案-用户告知内容及方式
|
||||||
@@ -143,6 +144,22 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
|
|||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OtaBaSjGgnrfs setDefault(String otaId) {
|
||||||
|
OtaBaSjGgnrfs res = new OtaBaSjGgnrfs();
|
||||||
|
Date now = new Date();
|
||||||
|
res.setSjky("车辆解闭锁功能可用,但不可驾驶");
|
||||||
|
res.setSjbkygn("除解闭锁均不可用");
|
||||||
|
res.setSjsfcg(1);
|
||||||
|
res.setGzbg(1);
|
||||||
|
res.setGzscnr(1);
|
||||||
|
res.setGzyhfs("1,3");
|
||||||
|
res.setCreateTime(now);
|
||||||
|
res.setUpdateTime(now);
|
||||||
|
res.setOtaId(otaId);
|
||||||
|
res.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OtaBaSjGgnrfs queryByOtaId(String otaId, String otaIdT) {
|
public OtaBaSjGgnrfs queryByOtaId(String otaId, String otaIdT) {
|
||||||
OtaBaSjGgnrfs res = getByOtaId(otaId);
|
OtaBaSjGgnrfs res = getByOtaId(otaId);
|
||||||
@@ -150,26 +167,7 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
|
|||||||
res = getByOtaId(otaIdT);
|
res = getByOtaId(otaIdT);
|
||||||
}
|
}
|
||||||
if (ObjectUtils.isEmpty(res)) {
|
if (ObjectUtils.isEmpty(res)) {
|
||||||
res = new OtaBaSjGgnrfs();
|
res = setDefault(otaId);
|
||||||
res.setOtaId(otaId);
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(res.getSjky())) {
|
|
||||||
res.setSjky("车辆解闭锁功能可用,但不可驾驶");
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(res.getSjbkygn())) {
|
|
||||||
res.setSjbkygn("除解闭锁均不可用");
|
|
||||||
}
|
|
||||||
if (null == res.getSjsfcg()) {
|
|
||||||
res.setSjsfcg(1);
|
|
||||||
}
|
|
||||||
if (null == res.getGzbg()) {
|
|
||||||
res.setGzbg(1);
|
|
||||||
}
|
|
||||||
if (null == res.getGzscnr()) {
|
|
||||||
res.setGzscnr(1);
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(res.getGzyhfs())) {
|
|
||||||
res.setGzyhfs("1,3");
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -182,6 +182,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
|||||||
if (ObjectUtil.isEmpty(res)) {
|
if (ObjectUtil.isEmpty(res)) {
|
||||||
res = getByOtaId(otaIdT);
|
res = getByOtaId(otaIdT);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("list", res);
|
json.put("list", res);
|
||||||
return json;
|
return json;
|
||||||
|
|||||||
+21
-32
@@ -67,14 +67,13 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
|||||||
public void add(OtaBaSjSjyxpg otaBaSjSjyxpg) {
|
public void add(OtaBaSjSjyxpg otaBaSjSjyxpg) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
if (null != otaBaSjSjyxpg) {
|
if (null != otaBaSjSjyxpg) {
|
||||||
|
|
||||||
String newYzcl = otaBaSjSjyxpg.getBgfj();
|
String newYzcl = otaBaSjSjyxpg.getBgfj();
|
||||||
String oldYzcl = "";
|
String oldYzcl = "";
|
||||||
|
|
||||||
String newZmcl = otaBaSjSjyxpg.getClfj();
|
String newZmcl = otaBaSjSjyxpg.getClfj();
|
||||||
String oldZmcl = "";
|
String oldZmcl = "";
|
||||||
|
|
||||||
OtaBaSjSjyxpg otaBaSjSjyxpgOld = this.queryByOtaId(otaBaSjSjyxpg.getOtaId(),"");
|
OtaBaSjSjyxpg otaBaSjSjyxpgOld = this.queryByOtaId(otaBaSjSjyxpg.getOtaId(), "");
|
||||||
if (null != otaBaSjSjyxpgOld) {
|
if (null != otaBaSjSjyxpgOld) {
|
||||||
otaBaSjSjyxpg.setId(otaBaSjSjyxpgOld.getId());
|
otaBaSjSjyxpg.setId(otaBaSjSjyxpgOld.getId());
|
||||||
oldYzcl = otaBaSjSjyxpgOld.getBgfj();
|
oldYzcl = otaBaSjSjyxpgOld.getBgfj();
|
||||||
@@ -84,13 +83,11 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
|||||||
}
|
}
|
||||||
otaBaSjSjyxpg.setUpdateTime(now);
|
otaBaSjSjyxpg.setUpdateTime(now);
|
||||||
ComparisonUtil cu = new ComparisonUtil();
|
ComparisonUtil cu = new ComparisonUtil();
|
||||||
if (ObjectUtils.isEmpty(otaBaSjSjyxpgOld)) {
|
|
||||||
otaBaSjSjyxpgOld = new OtaBaSjSjyxpg();
|
|
||||||
}
|
|
||||||
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), OtaModuleEnum.SJ_SJYXPG, otaBaSjSjyxpgOld, otaBaSjSjyxpg, sysDictService);
|
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), OtaModuleEnum.SJ_SJYXPG, otaBaSjSjyxpgOld, otaBaSjSjyxpg, sysDictService);
|
||||||
reList.addAll(cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), newYzcl, oldYzcl, OtaModuleEnum.SJ_SJMBCL, "验证材料", ossFileService));
|
reList.addAll(cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), newYzcl, oldYzcl, OtaModuleEnum.SJ_SJMBCL, "验证材料", ossFileService));
|
||||||
reList.addAll(cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), newZmcl, oldZmcl, OtaModuleEnum.SJ_SJMBCL, "证明材料", ossFileService));
|
reList.addAll(cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), newZmcl, oldZmcl, OtaModuleEnum.SJ_SJMBCL, "证明材料", ossFileService));
|
||||||
|
|
||||||
|
deleteById(otaBaSjSjyxpg.getId());
|
||||||
saveOrUpdate(otaBaSjSjyxpg);
|
saveOrUpdate(otaBaSjSjyxpg);
|
||||||
otaBaCxTxjlService.saveBatch(reList);
|
otaBaCxTxjlService.saveBatch(reList);
|
||||||
}
|
}
|
||||||
@@ -152,6 +149,24 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
|||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public OtaBaSjSjyxpg setDefault(String otaId) {
|
||||||
|
Date now = new Date();
|
||||||
|
OtaBaSjSjyxpg res = new OtaBaSjSjyxpg();
|
||||||
|
res.setOtaId(otaId);
|
||||||
|
res.setFhgd(2);
|
||||||
|
res.setZdjsxg(1);
|
||||||
|
res.setZxsj(2);
|
||||||
|
res.setAqjz("2");
|
||||||
|
res.setSfyxaq(2);
|
||||||
|
res.setYhqr(1);
|
||||||
|
res.setSjbcs("3,4");
|
||||||
|
res.setAqkkx(1);
|
||||||
|
res.setCreateTime(now);
|
||||||
|
res.setUpdateTime(now);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OtaBaSjSjyxpg queryByOtaId(String otaId, String otaIdT) {
|
public OtaBaSjSjyxpg queryByOtaId(String otaId, String otaIdT) {
|
||||||
OtaBaSjSjyxpg res = getByOtaId(otaId);
|
OtaBaSjSjyxpg res = getByOtaId(otaId);
|
||||||
@@ -159,33 +174,7 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
|||||||
res = getByOtaId(otaIdT);
|
res = getByOtaId(otaIdT);
|
||||||
}
|
}
|
||||||
if (ObjectUtils.isEmpty(res)) {
|
if (ObjectUtils.isEmpty(res)) {
|
||||||
res = new OtaBaSjSjyxpg();
|
res = setDefault(otaId);
|
||||||
res.setOtaId(otaId);
|
|
||||||
}
|
|
||||||
if (null == res.getFhgd()) {
|
|
||||||
res.setFhgd(2);
|
|
||||||
}
|
|
||||||
if (null == res.getZdjsxg()) {
|
|
||||||
res.setZdjsxg(1);
|
|
||||||
}
|
|
||||||
if (null == res.getZxsj()) {
|
|
||||||
res.setZxsj(2);
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(res.getAqjz())) {
|
|
||||||
res.setAqjz("2");
|
|
||||||
}
|
|
||||||
if (null == res.getSfyxaq()) {
|
|
||||||
res.setSfyxaq(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null == res.getYhqr()) {
|
|
||||||
res.setYhqr(1);
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(res.getSjbcs())) {
|
|
||||||
res.setSjbcs("3,4");
|
|
||||||
}
|
|
||||||
if (null == res.getAqkkx()) {
|
|
||||||
res.setAqkkx(1);
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-2
@@ -241,9 +241,19 @@ public class ComparisonUtil<T> {
|
|||||||
res = "";
|
res = "";
|
||||||
for (int i = 0; i < newValStr.length; i++) {
|
for (int i = 0; i < newValStr.length; i++) {
|
||||||
if (i == newValStr.length - 1) {
|
if (i == newValStr.length - 1) {
|
||||||
res += sysDictService.queryDictTextByKey(ote.getType(), newValStr[i]);
|
String s = sysDictService.queryDictTextByKey(ote.getType(), newValStr[i]);
|
||||||
|
if (StringUtils.isNotEmpty(s)) {
|
||||||
|
res += s;
|
||||||
|
} else {
|
||||||
|
res += "空";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
res += sysDictService.queryDictTextByKey(ote.getType(), newValStr[i]) + ",";
|
String s = sysDictService.queryDictTextByKey(ote.getType(), newValStr[i]);
|
||||||
|
if (StringUtils.isNotEmpty(s)) {
|
||||||
|
res += s + ",";
|
||||||
|
} else {
|
||||||
|
res += "空,";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user