修改OTA全局上传附件,填写记录中少了单引号
This commit is contained in:
+7
-1
@@ -84,7 +84,13 @@ public class OtaBaCxJbxxController extends JeroController<OtaBaCxJbxx, IOtaBaCxJ
|
||||
@ApiOperation(value = "车型备案-车型基本信息-添加", notes = "车型备案-车型基本信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody OtaBaCxJbxx otaBaCxJbxx) {
|
||||
OtaBaCxJbxx res = otaBaCxJbxxService.add(otaBaCxJbxx);
|
||||
OtaBaCxJbxx res;
|
||||
try {
|
||||
res = otaBaCxJbxxService.add(otaBaCxJbxx);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ public interface IOtaBaCxJbxxService extends IService<OtaBaCxJbxx> {
|
||||
* @param otaBaCxJbxx
|
||||
* @return
|
||||
*/
|
||||
OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx);
|
||||
OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx) throws Exception;
|
||||
|
||||
/**
|
||||
* 更新
|
||||
|
||||
+1
@@ -52,6 +52,7 @@ public interface IOtaBaCxSjmkService extends IService<OtaBaCxSjmk> {
|
||||
*/
|
||||
OtaBaCxSjmk queryById(String id);
|
||||
|
||||
List<OtaBaCxSjmk> setDefault(String otaId);
|
||||
|
||||
List<OtaBaCxSjmk> queryByOtaId(String otaId);
|
||||
|
||||
|
||||
+10
-1
@@ -62,7 +62,16 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
||||
* @param otaBaCxJbxx
|
||||
* @return
|
||||
*/
|
||||
public OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx) {
|
||||
public OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx) throws Exception {
|
||||
String ggpc = otaBaCxJbxx.getGgpc();
|
||||
if (StringUtils.isNotEmpty(ggpc)) {
|
||||
List<OtaBaCxJbxx> xxList = this.list();
|
||||
for (OtaBaCxJbxx xx : xxList) {
|
||||
if (ggpc.equals(xx.getGgpc())) {
|
||||
throw new JeroBootException("公告批次重复");
|
||||
}
|
||||
}
|
||||
}
|
||||
//对比填写记录用的
|
||||
OtaBaCxJbxx otaBaCxJbxxOld = new OtaBaCxJbxx();
|
||||
Date now = new Date();
|
||||
|
||||
+6
@@ -80,6 +80,9 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
|
||||
saveOrUpdate(otaBaCxJsfzbacs);
|
||||
//处理控制器列表,先删除,后添加
|
||||
List<OtaBaCxSjmk> oldList = OtaBaCxSjmkService.queryByOtaId(otaId);
|
||||
if (ObjectUtils.isEmpty(oldList)) {
|
||||
oldList = OtaBaCxSjmkService.setDefault(otaId);
|
||||
}
|
||||
OtaBaCxSjmkService.deleteByOtaId(otaId);
|
||||
JSONArray kzq = json.getJSONArray("kzq");
|
||||
List<OtaBaCxSjmk> sjmkList = parseKzqData(kzq, otaId);
|
||||
@@ -232,6 +235,9 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
|
||||
if (ObjectUtils.isEmpty(otaBaCxJsfzbacs)) {
|
||||
otaBaCxJsfzbacs = getByOtaId(otaIdT);
|
||||
kzqList = OtaBaCxSjmkService.queryByOtaId(otaIdT);
|
||||
if (ObjectUtils.isEmpty(otaBaCxJsfzbacs)) {
|
||||
kzqList = OtaBaCxSjmkService.setDefault(otaId);
|
||||
}
|
||||
}
|
||||
res.put("bj", otaBaCxJsfzbacs);
|
||||
res.put("kzq", kzqList);
|
||||
|
||||
+1
-4
@@ -109,9 +109,6 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
||||
otaBaCxJsfzbacs.setUpdateTime(now);
|
||||
newList.add(otaBaCxJsfzbacs);
|
||||
}
|
||||
if (ObjectUtils.isEmpty(oldList)) {
|
||||
oldList = new ArrayList<>();
|
||||
}
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.CX_KZXSJDJSFZGNMCYCS, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
|
||||
saveOrUpdateBatch(newList);
|
||||
@@ -307,7 +304,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
|
||||
cell = row.getCell(2);
|
||||
mssc.setSfksj(ImportFileUtil.getCellValueYesOrNo(cell, wb));
|
||||
cell = row.getCell(3);
|
||||
mssc.setJszdhjb(ImportFileUtil.getCellValue(cell, wb));
|
||||
mssc.setJszdhjb(ImportFileUtil.getCellValueDict(cell, wb, "driving_automation_level", sysDictService, cut));
|
||||
cell = row.getCell(4);
|
||||
mssc.setSjggcs(ImportFileUtil.getCellValue(cell, wb));
|
||||
cell = row.getCell(5);
|
||||
|
||||
+23
@@ -2,14 +2,17 @@ package com.jero.modules.ota.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.ota.entity.OtaBaCxKsjjsmccs;
|
||||
import com.jero.modules.ota.entity.OtaBaCxSjmk;
|
||||
import com.jero.modules.ota.mapper.OtaBaCxSjmkMapper;
|
||||
import com.jero.modules.ota.service.IOtaBaCxSjmkService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @Description: 车型备案-车端OTA升级功能模块
|
||||
@@ -80,11 +83,31 @@ public class OtaBaCxSjmkServiceImpl extends ServiceImpl<OtaBaCxSjmkMapper, OtaBa
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OtaBaCxSjmk> setDefault(String otaId) {
|
||||
Date now = new Date();
|
||||
List<OtaBaCxSjmk> res = new ArrayList<>();
|
||||
String[] titles = {"车端OTA升级功能模块"};
|
||||
for (String t : titles) {
|
||||
OtaBaCxSjmk cs = new OtaBaCxSjmk();
|
||||
cs.setOtaId(otaId);
|
||||
cs.setBjmc(t);
|
||||
cs.setCreateTime(now);
|
||||
cs.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
res.add(cs);
|
||||
}
|
||||
saveBatch(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OtaBaCxSjmk> queryByOtaId(String otaId) {
|
||||
LambdaQueryWrapper<OtaBaCxSjmk> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(OtaBaCxSjmk::getOtaId, otaId);
|
||||
List<OtaBaCxSjmk> list = this.list(queryWrapper);
|
||||
if (ObjectUtils.isEmpty(list)) {
|
||||
list = setDefault(otaId);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -204,12 +204,12 @@ public class ComparisonUtil<T> {
|
||||
field.set(clazz, "");
|
||||
}
|
||||
} else if ("1".equals(ote.getType())) {
|
||||
if (!"有".equals(str) && !"无".equals(str)) {
|
||||
errMsg.append(title + " 必须填写是或否 , ");
|
||||
if (!"1".equals(str) && !"2".equals(str)) {
|
||||
errMsg.append(title + " 必须填写有或无 , ");
|
||||
field.set(clazz, "");
|
||||
}
|
||||
} else if ("2".equals(ote.getType())) {
|
||||
if (!"是".equals(str) && !"否".equals(str)) {
|
||||
if (!"1".equals(str) && !"2".equals(str)) {
|
||||
errMsg.append(title + " 必须填写是或否 , ");
|
||||
field.set(clazz, "");
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public class ComparisonUtil<T> {
|
||||
} else {
|
||||
String[] strs = str.split(",");
|
||||
for (String s : strs) {
|
||||
String res = sysDictService.queryDictItemByValue(ote.getType(), s, cut);
|
||||
String res = sysDictService.queryDictTextByKeyEn(ote.getType(), s, cut);
|
||||
if (StringUtils.isEmpty(res)) {
|
||||
errMsg.append(title + " 填写了无法识别的选项 , ");
|
||||
field.set(clazz, "");
|
||||
|
||||
Reference in New Issue
Block a user