开发OTA备案工具-车辆升级
This commit is contained in:
+38
-35
@@ -2,60 +2,63 @@ package com.jero.modules.ota.service;
|
|||||||
|
|
||||||
import com.jero.modules.ota.entity.OtaBaSjGnxtwh;
|
import com.jero.modules.ota.entity.OtaBaSjGnxtwh;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 车型备案-功能系统维护
|
* @Description: 车型备案-功能系统维护
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-28
|
* @Date: 2023-03-28
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IOtaBaSjGnxtwhService extends IService<OtaBaSjGnxtwh> {
|
public interface IOtaBaSjGnxtwhService extends IService<OtaBaSjGnxtwh> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
* @param otaBaSjGnxtwh
|
* @param otaBaSjGnxtwh
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void add(OtaBaSjGnxtwh otaBaSjGnxtwh);
|
void add(OtaBaSjGnxtwh otaBaSjGnxtwh);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjGnxtwh
|
* @param otaBaSjGnxtwh
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void editById(OtaBaSjGnxtwh otaBaSjGnxtwh);
|
void editById(OtaBaSjGnxtwh otaBaSjGnxtwh);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id删除
|
* 通过id删除
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void deleteById(String id);
|
void deleteById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
*
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void deleteByIds(List<String> ids);
|
void deleteByIds(List<String> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
OtaBaSjGnxtwh queryById(String id);
|
OtaBaSjGnxtwh queryById(String id);
|
||||||
|
|
||||||
|
String queryGnxtByKzq(String kzq);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjGnxtwh> queryList();
|
List<OtaBaSjGnxtwh> queryList();
|
||||||
}
|
}
|
||||||
|
|||||||
+61
-43
@@ -4,26 +4,28 @@ import com.jero.modules.ota.entity.OtaBaSjGnxtwh;
|
|||||||
import com.jero.modules.ota.mapper.OtaBaSjGnxtwhMapper;
|
import com.jero.modules.ota.mapper.OtaBaSjGnxtwhMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjGnxtwhService;
|
import com.jero.modules.ota.service.IOtaBaSjGnxtwhService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 车型备案-功能系统维护
|
* @Description: 车型备案-功能系统维护
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-28
|
* @Date: 2023-03-28
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class OtaBaSjGnxtwhServiceImpl extends ServiceImpl<OtaBaSjGnxtwhMapper, OtaBaSjGnxtwh> implements IOtaBaSjGnxtwhService {
|
public class OtaBaSjGnxtwhServiceImpl extends ServiceImpl<OtaBaSjGnxtwhMapper, OtaBaSjGnxtwh> implements IOtaBaSjGnxtwhService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
* @param otaBaSjGnxtwh
|
* @param otaBaSjGnxtwh
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void add(OtaBaSjGnxtwh otaBaSjGnxtwh) {
|
public void add(OtaBaSjGnxtwh otaBaSjGnxtwh) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaSjGnxtwh.setCreateTime(now);
|
otaBaSjGnxtwh.setCreateTime(now);
|
||||||
@@ -31,58 +33,74 @@ public class OtaBaSjGnxtwhServiceImpl extends ServiceImpl<OtaBaSjGnxtwhMapper, O
|
|||||||
save(otaBaSjGnxtwh);
|
save(otaBaSjGnxtwh);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjGnxtwh
|
* @param otaBaSjGnxtwh
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(OtaBaSjGnxtwh otaBaSjGnxtwh) {
|
public void editById(OtaBaSjGnxtwh otaBaSjGnxtwh) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaSjGnxtwh.setUpdateTime(now);
|
otaBaSjGnxtwh.setUpdateTime(now);
|
||||||
saveOrUpdate(otaBaSjGnxtwh);
|
saveOrUpdate(otaBaSjGnxtwh);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id删除
|
* 通过id删除
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteById(String id) {
|
public void deleteById(String id) {
|
||||||
removeById(id);
|
removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
*
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(List<String> ids) {
|
public void deleteByIds(List<String> ids) {
|
||||||
removeByIds(ids);
|
removeByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public OtaBaSjGnxtwh queryById(String id) {
|
public OtaBaSjGnxtwh queryById(String id) {
|
||||||
return getById(id);
|
return getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String queryGnxtByKzq(String kzq) {
|
||||||
|
List<OtaBaSjGnxtwh> list = list();
|
||||||
|
for (OtaBaSjGnxtwh wh : list) {
|
||||||
|
String[] strs = wh.getDykzq().split(",");
|
||||||
|
for (String str : strs) {
|
||||||
|
if (str.equals(kzq)) {
|
||||||
|
return wh.getGnxt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OtaBaSjGnxtwh> queryList() {
|
public List<OtaBaSjGnxtwh> queryList() {
|
||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-15
@@ -11,11 +11,12 @@ import com.jero.modules.ota.enums.OtaModuleEnum;
|
|||||||
import com.jero.modules.ota.enums.OtaTitleEnum;
|
import com.jero.modules.ota.enums.OtaTitleEnum;
|
||||||
import com.jero.modules.ota.mapper.OtaBaSjSjxtbhMapper;
|
import com.jero.modules.ota.mapper.OtaBaSjSjxtbhMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaSjGnxtwhService;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjSjxtbhService;
|
import com.jero.modules.ota.service.IOtaBaSjSjxtbhService;
|
||||||
import com.jero.modules.ota.utils.ComparisonUtil;
|
import com.jero.modules.ota.utils.ComparisonUtil;
|
||||||
import com.jero.modules.ota.utils.ImportFileUtil;
|
import com.jero.modules.ota.utils.ImportFileUtil;
|
||||||
import com.jero.modules.system.service.ISysDictService;
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
import com.jero.modules.system.util.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
@@ -52,6 +53,9 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IOSSFileService ossFileService;
|
private IOSSFileService ossFileService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOtaBaSjGnxtwhService otaBaSjGnxtwhService;
|
||||||
|
|
||||||
@Value(value = "${ota.templatePath}")
|
@Value(value = "${ota.templatePath}")
|
||||||
private String templatePath;
|
private String templatePath;
|
||||||
|
|
||||||
@@ -221,7 +225,8 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
|||||||
oldList = new ArrayList<>();
|
oldList = new ArrayList<>();
|
||||||
}
|
}
|
||||||
ComparisonUtil cu = new ComparisonUtil();
|
ComparisonUtil cu = new ComparisonUtil();
|
||||||
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJXTMCBH, OtaTitleEnum.SJKZQMC.getName(), oldList, newList, sysDictService);
|
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJXTMCBH, OtaTitleEnum.XTMC.getName(), oldList, newList, sysDictService);
|
||||||
|
deleteByOtaId(otaId);
|
||||||
saveOrUpdateBatch(newList);
|
saveOrUpdateBatch(newList);
|
||||||
otaBaCxTxjlService.saveBatch(reList);
|
otaBaCxTxjlService.saveBatch(reList);
|
||||||
}
|
}
|
||||||
@@ -233,30 +238,38 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
|
|||||||
Sheet s = wb.getSheetAt(0);
|
Sheet s = wb.getSheetAt(0);
|
||||||
int rows = s.getPhysicalNumberOfRows();
|
int rows = s.getPhysicalNumberOfRows();
|
||||||
for (int i = 4; i < rows; i++) {
|
for (int i = 4; i < rows; i++) {
|
||||||
Row row = s.getRow(i);
|
|
||||||
Cell cell = row.getCell(0);
|
|
||||||
OtaBaSjSjxtbh xtbh = new OtaBaSjSjxtbh();
|
OtaBaSjSjxtbh xtbh = new OtaBaSjSjxtbh();
|
||||||
cell = row.getCell(1);
|
xtbh.setOtaId(otaId);
|
||||||
|
Row row = s.getRow(i);
|
||||||
|
Cell cell = row.getCell(2);
|
||||||
|
String kzq = ImportFileUtil.getCellValue(cell, wb);
|
||||||
|
if (StringUtils.isNotEmpty(kzq)) {
|
||||||
|
xtbh.setSjkzqmc(kzq);
|
||||||
|
String gnxt = otaBaSjGnxtwhService.queryGnxtByKzq(kzq);
|
||||||
|
if (StringUtils.isNotEmpty(gnxt)) {
|
||||||
|
xtbh.setXtmc(gnxt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cell = row.getCell(0);
|
||||||
xtbh.setSjqbgcs(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSjqbgcs(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(2);
|
cell = row.getCell(1);
|
||||||
xtbh.setSjhbgcs(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSjhbgcs(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(3);
|
cell = row.getCell(3);
|
||||||
xtbh.setSjkzqmc(ImportFileUtil.getCellValue(cell, wb));
|
|
||||||
cell = row.getCell(4);
|
|
||||||
xtbh.setYjbb(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setYjbb(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(5);
|
cell = row.getCell(4);
|
||||||
xtbh.setSjqrjbb(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSjqrjbb(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(6);
|
cell = row.getCell(5);
|
||||||
xtbh.setSjhrjbb(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSjhrjbb(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(7);
|
cell = row.getCell(6);
|
||||||
xtbh.setSjqczxt(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSjqczxt(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(8);
|
cell = row.getCell(7);
|
||||||
xtbh.setSjhczxt(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSjhczxt(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(9);
|
cell = row.getCell(8);
|
||||||
xtbh.setSjbyzsj(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSjbyzsj(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(10);
|
cell = row.getCell(9);
|
||||||
xtbh.setSjbdx(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSjbdx(ImportFileUtil.getCellValue(cell, wb));
|
||||||
cell = row.getCell(11);
|
cell = row.getCell(10);
|
||||||
xtbh.setSfcfsj(ImportFileUtil.getCellValue(cell, wb));
|
xtbh.setSfcfsj(ImportFileUtil.getCellValue(cell, wb));
|
||||||
xtbh.setCreateTime(now);
|
xtbh.setCreateTime(now);
|
||||||
xtbh.setUpdateTime(now);
|
xtbh.setUpdateTime(now);
|
||||||
|
|||||||
Reference in New Issue
Block a user