开发OTA备案工具-车辆升级
This commit is contained in:
-1
@@ -156,7 +156,6 @@ public class OtaBaCxJbxxController extends JeroController<OtaBaCxJbxx, IOtaBaCxJ
|
|||||||
public Result<?> queryByOtaId(@RequestParam(name = "otaId") String otaId,
|
public Result<?> queryByOtaId(@RequestParam(name = "otaId") String otaId,
|
||||||
@RequestParam(name = "otaIdT") String otaIdT) {
|
@RequestParam(name = "otaIdT") String otaIdT) {
|
||||||
OtaBaCxJbxx otaBaCxJbxx = otaBaCxJbxxService.queryByOtaId(otaId, otaIdT);
|
OtaBaCxJbxx otaBaCxJbxx = otaBaCxJbxxService.queryByOtaId(otaId, otaIdT);
|
||||||
otaBaCxJbxx = otaBaCxJbxxService.queryByOtaId(otaId, otaIdT);
|
|
||||||
return Result.OK(otaBaCxJbxx);
|
return Result.OK(otaBaCxJbxx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
||||||
import com.jero.modules.ota.entity.OtaBaSjSjmbcl;
|
import com.jero.modules.ota.entity.OtaBaSjSjmbcl;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjSjmbclService;
|
import com.jero.modules.ota.service.IOtaBaSjSjmbclService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -144,6 +145,18 @@ public class OtaBaSjSjmbclController extends JeroController<OtaBaSjSjmbcl, IOtaB
|
|||||||
return Result.OK(otaBaSjSjmbcl);
|
return Result.OK(otaBaSjSjmbcl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过OtaId查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车辆-通过otaId查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-通过otaId查询", notes = "升级备案-升级目标车辆-通过otaId查询")
|
||||||
|
@GetMapping(value = "/queryByOtaId")
|
||||||
|
public Result<?> queryByOtaId(@RequestParam(name = "otaId") String otaId,
|
||||||
|
@RequestParam(name = "otaIdT") String otaIdT) {
|
||||||
|
OtaBaSjSjmbcl otaBaSjSjmbcl = otaBaSjSjmbclService.queryByOtaId(otaId, otaIdT);
|
||||||
|
return Result.OK(otaBaSjSjmbcl);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 导出excel
|
||||||
*
|
*
|
||||||
|
|||||||
+15
-2
@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaSjSjmbcl;
|
||||||
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
|
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjSjmbcxService;
|
import com.jero.modules.ota.service.IOtaBaSjSjmbcxService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -81,8 +82,8 @@ public class OtaBaSjSjmbcxController extends JeroController<OtaBaSjSjmbcx, IOtaB
|
|||||||
@ApiOperation(value="升级备案-升级目标车型-添加", notes="升级备案-升级目标车型-添加")
|
@ApiOperation(value="升级备案-升级目标车型-添加", notes="升级备案-升级目标车型-添加")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<?> add(@Validated @RequestBody OtaBaSjSjmbcx otaBaSjSjmbcx) {
|
public Result<?> add(@Validated @RequestBody OtaBaSjSjmbcx otaBaSjSjmbcx) {
|
||||||
otaBaSjSjmbcxService.add(otaBaSjSjmbcx);
|
OtaBaSjSjmbcx cx = otaBaSjSjmbcxService.add(otaBaSjSjmbcx);
|
||||||
return Result.OK("添加成功!");
|
return Result.OK(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -144,6 +145,18 @@ public class OtaBaSjSjmbcxController extends JeroController<OtaBaSjSjmbcx, IOtaB
|
|||||||
return Result.OK(otaBaSjSjmbcx);
|
return Result.OK(otaBaSjSjmbcx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过OtaId查询
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车型-通过otaId查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车型-通过otaId查询", notes = "升级备案-升级目标车型-通过otaId查询")
|
||||||
|
@GetMapping(value = "/queryByOtaId")
|
||||||
|
public Result<?> queryByOtaId(@RequestParam(name = "otaId") String otaId,
|
||||||
|
@RequestParam(name = "otaIdT") String otaIdT) {
|
||||||
|
OtaBaSjSjmbcx otaBaSjSjmbcx = otaBaSjSjmbcxService.queryByOtaId(otaId, otaIdT);
|
||||||
|
return Result.OK(otaBaSjSjmbcx);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 导出excel
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -115,4 +115,11 @@ public class OtaBaSjList implements Serializable {
|
|||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private java.lang.String bz;
|
private java.lang.String bz;
|
||||||
|
|
||||||
|
public void updateData(OtaBaSjSjmbcx otaBaSjSjmbcx) {
|
||||||
|
this.cpdjbh = otaBaSjSjmbcx.getBabh();
|
||||||
|
this.ggpc = otaBaSjSjmbcx.getBapc();
|
||||||
|
this.cpsb = otaBaSjSjmbcx.getCpsb();
|
||||||
|
this.cpmc = otaBaSjSjmbcx.getCpmc();
|
||||||
|
this.cpxh = otaBaSjSjmbcx.getCpxh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -90,4 +90,9 @@ public class OtaBaSjSjmbcl implements Serializable {
|
|||||||
@ApiModelProperty(value = "VIN码清单")
|
@ApiModelProperty(value = "VIN码清单")
|
||||||
private java.lang.String vinList;
|
private java.lang.String vinList;
|
||||||
|
|
||||||
|
/**csv附件*/
|
||||||
|
@Excel(name = "csv附件", width = 15)
|
||||||
|
@ApiModelProperty(value = "csv附件")
|
||||||
|
private java.lang.String csv;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-1
@@ -8,7 +8,15 @@ public enum OtaModuleEnum {
|
|||||||
CX_KSJDXTMCYCS("可升级的系统名称与参数", "1","1"),
|
CX_KSJDXTMCYCS("可升级的系统名称与参数", "1","1"),
|
||||||
CX_KZXSJDJSFZGNMCYCS("可在线升级的驾驶辅助功能名称与参数", "1","1"),
|
CX_KZXSJDJSFZGNMCYCS("可在线升级的驾驶辅助功能名称与参数", "1","1"),
|
||||||
CX_JSFZXTJCBACS("驾驶辅助系统基础备案参数", "1","1"),
|
CX_JSFZXTJCBACS("驾驶辅助系统基础备案参数", "1","1"),
|
||||||
CX_QT("其他", "1","1");
|
CX_QT("其他", "1","1"),
|
||||||
|
|
||||||
|
SJ_SJMBCX("升级目标车型", "1","1"),
|
||||||
|
SJ_SJMBCL("本次升级的目标车辆", "1","1"),
|
||||||
|
SJ_SJYXPG("升级影响评估", "1","1"),
|
||||||
|
SJ_SJXTMCBH("本次升级的系统名称与参数变化", "1","1"),
|
||||||
|
SJ_SJJSMCBH("本次升级的驾驶辅助功能名称与参数变化", "1","1"),
|
||||||
|
SJ_YHGZNRFS("用户告知内容及方式", "1","1"),
|
||||||
|
SJ_QT("其他升级任务信息", "1","1");
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
String nameEN;
|
String nameEN;
|
||||||
|
|||||||
+2
@@ -58,4 +58,6 @@ public interface IOtaBaSjSjmbclService extends IService<OtaBaSjSjmbcl> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjSjmbcl> queryList();
|
List<OtaBaSjSjmbcl> queryList();
|
||||||
|
|
||||||
|
OtaBaSjSjmbcl queryByOtaId(String otaId, String otaIdT);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -18,7 +18,7 @@ public interface IOtaBaSjSjmbcxService extends IService<OtaBaSjSjmbcx> {
|
|||||||
* @param otaBaSjSjmbcx
|
* @param otaBaSjSjmbcx
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void add(OtaBaSjSjmbcx otaBaSjSjmbcx);
|
OtaBaSjSjmbcx add(OtaBaSjSjmbcx otaBaSjSjmbcx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
@@ -58,4 +58,6 @@ public interface IOtaBaSjSjmbcxService extends IService<OtaBaSjSjmbcx> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjSjmbcx> queryList();
|
List<OtaBaSjSjmbcx> queryList();
|
||||||
|
|
||||||
|
OtaBaSjSjmbcx queryByOtaId(String otaId, String otaIdT);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -64,7 +64,7 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
*/
|
*/
|
||||||
public OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx) {
|
public OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx) {
|
||||||
//对比填写记录用的
|
//对比填写记录用的
|
||||||
OtaBaCxJbxx OtaBaCxJbxxOld = new OtaBaCxJbxx();
|
OtaBaCxJbxx otaBaCxJbxxOld = new OtaBaCxJbxx();
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
OtaBaCxList otaBaCxList;
|
OtaBaCxList otaBaCxList;
|
||||||
if (StringUtils.isEmpty(otaBaCxJbxx.getOtaId())) {
|
if (StringUtils.isEmpty(otaBaCxJbxx.getOtaId())) {
|
||||||
@@ -76,7 +76,7 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
otaBaCxJbxx.setOtaId(otaBaCxList.getId());
|
otaBaCxJbxx.setOtaId(otaBaCxList.getId());
|
||||||
otaBaCxJbxx.setCreateTime(now);
|
otaBaCxJbxx.setCreateTime(now);
|
||||||
} else {
|
} else {
|
||||||
OtaBaCxJbxxOld = this.getByOtaId(otaBaCxJbxx.getOtaId());
|
otaBaCxJbxxOld = this.getByOtaId(otaBaCxJbxx.getOtaId());
|
||||||
otaBaCxList = otaBaCxListService.queryById(otaBaCxJbxx.getOtaId());
|
otaBaCxList = otaBaCxListService.queryById(otaBaCxJbxx.getOtaId());
|
||||||
otaBaCxList.updateData(otaBaCxJbxx);
|
otaBaCxList.updateData(otaBaCxJbxx);
|
||||||
otaBaCxListService.editById(otaBaCxList);
|
otaBaCxListService.editById(otaBaCxList);
|
||||||
@@ -84,7 +84,7 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
otaBaCxJbxx.setUpdateTime(now);
|
otaBaCxJbxx.setUpdateTime(now);
|
||||||
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);
|
||||||
otaBaCxTxjlService.saveBatch(reList);
|
otaBaCxTxjlService.saveBatch(reList);
|
||||||
return otaBaCxJbxx;
|
return otaBaCxJbxx;
|
||||||
}
|
}
|
||||||
|
|||||||
+96
-47
@@ -1,89 +1,138 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
import com.jero.modules.ota.entity.OtaBaSjSjmbcl;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
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.mapper.OtaBaSjSjmbclMapper;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaSjListService;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaSjLsjlService;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjSjmbclService;
|
import com.jero.modules.ota.service.IOtaBaSjSjmbclService;
|
||||||
|
import com.jero.modules.ota.utils.ComparisonUtil;
|
||||||
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
|
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 org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
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-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, OtaBaSjSjmbcl> implements IOtaBaSjSjmbclService {
|
public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, OtaBaSjSjmbcl> implements IOtaBaSjSjmbclService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
@Autowired
|
||||||
*
|
private ISysDictService sysDictService;
|
||||||
* @param otaBaSjSjmbcl
|
|
||||||
* @return
|
@Autowired
|
||||||
*/
|
private IOtaBaCxTxjlService otaBaCxTxjlService;
|
||||||
@Override
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*
|
||||||
|
* @param otaBaSjSjmbcl
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void add(OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
public void add(OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaSjSjmbcl.setCreateTime(now);
|
if (null != otaBaSjSjmbcl) {
|
||||||
otaBaSjSjmbcl.setUpdateTime(now);
|
OtaBaSjSjmbcl otaBaSjSjmbclOld = this.getByOtaId(otaBaSjSjmbcl.getOtaId());
|
||||||
save(otaBaSjSjmbcl);
|
if (null != otaBaSjSjmbclOld) {
|
||||||
|
otaBaSjSjmbcl.setId(otaBaSjSjmbclOld.getId());
|
||||||
|
} else {
|
||||||
|
otaBaSjSjmbcl.setCreateTime(now);
|
||||||
|
}
|
||||||
|
otaBaSjSjmbcl.setUpdateTime(now);
|
||||||
|
saveOrUpdate(otaBaSjSjmbcl);
|
||||||
|
ComparisonUtil cu = new ComparisonUtil();
|
||||||
|
if (ObjectUtils.isEmpty(otaBaSjSjmbclOld)) {
|
||||||
|
otaBaSjSjmbclOld = new OtaBaSjSjmbcl();
|
||||||
|
}
|
||||||
|
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjmbcl.getOtaId(), OtaModuleEnum.CX_AQCS, otaBaSjSjmbclOld, otaBaSjSjmbcl, sysDictService);
|
||||||
|
otaBaCxTxjlService.saveBatch(reList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjSjmbcl
|
* @param otaBaSjSjmbcl
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
public void editById(OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaSjSjmbcl.setUpdateTime(now);
|
otaBaSjSjmbcl.setUpdateTime(now);
|
||||||
saveOrUpdate(otaBaSjSjmbcl);
|
saveOrUpdate(otaBaSjSjmbcl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过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 OtaBaSjSjmbcl queryById(String id) {
|
public OtaBaSjSjmbcl queryById(String id) {
|
||||||
return getById(id);
|
return getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OtaBaSjSjmbcl> queryList() {
|
public List<OtaBaSjSjmbcl> queryList() {
|
||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjmbcl queryByOtaId(String otaId, String otaIdT) {
|
||||||
|
//判断是否保存过,否则查询模版数据回显
|
||||||
|
OtaBaSjSjmbcl res = getByOtaId(otaId);
|
||||||
|
if (ObjectUtils.isEmpty(res)) {
|
||||||
|
res = getByOtaId(otaIdT);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
private OtaBaSjSjmbcl getByOtaId(String otaId) {
|
||||||
|
LambdaQueryWrapper<OtaBaSjSjmbcl> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(OtaBaSjSjmbcl::getOtaId, otaId);
|
||||||
|
return this.getOne(queryWrapper, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+104
-47
@@ -1,89 +1,146 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.jero.modules.ota.entity.*;
|
||||||
|
import com.jero.modules.ota.enums.OtaModuleEnum;
|
||||||
import com.jero.modules.ota.mapper.OtaBaSjSjmbcxMapper;
|
import com.jero.modules.ota.mapper.OtaBaSjSjmbcxMapper;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaSjListService;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjSjmbcxService;
|
import com.jero.modules.ota.service.IOtaBaSjSjmbcxService;
|
||||||
|
import com.jero.modules.ota.utils.ComparisonUtil;
|
||||||
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
|
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 org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
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-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, OtaBaSjSjmbcx> implements IOtaBaSjSjmbcxService {
|
public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, OtaBaSjSjmbcx> implements IOtaBaSjSjmbcxService {
|
||||||
|
|
||||||
/**
|
@Autowired
|
||||||
* 保存
|
private IOtaBaSjListService otaBaSjListService;
|
||||||
*
|
|
||||||
* @param otaBaSjSjmbcx
|
@Autowired
|
||||||
* @return
|
private ISysDictService sysDictService;
|
||||||
*/
|
|
||||||
@Override
|
@Autowired
|
||||||
public void add(OtaBaSjSjmbcx otaBaSjSjmbcx) {
|
private IOtaBaCxTxjlService otaBaCxTxjlService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*
|
||||||
|
* @param otaBaSjSjmbcx
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjmbcx add(OtaBaSjSjmbcx otaBaSjSjmbcx) {
|
||||||
|
//对比填写记录用的
|
||||||
|
OtaBaSjSjmbcx otaBaSjSjmbcxOld = new OtaBaSjSjmbcx();
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaSjSjmbcx.setCreateTime(now);
|
OtaBaSjList otaBaSjList;
|
||||||
|
if (StringUtils.isEmpty(otaBaSjSjmbcx.getOtaId())) {
|
||||||
|
//在保存的时候设置一个id 并返回前端 下次保存的时候判断是否为更新
|
||||||
|
otaBaSjList = new OtaBaSjList();
|
||||||
|
otaBaSjList.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
otaBaSjList.updateData(otaBaSjSjmbcx);
|
||||||
|
otaBaSjListService.add(otaBaSjList);
|
||||||
|
otaBaSjSjmbcx.setOtaId(otaBaSjList.getId());
|
||||||
|
otaBaSjSjmbcx.setCreateTime(now);
|
||||||
|
} else {
|
||||||
|
otaBaSjSjmbcxOld = this.getByOtaId(otaBaSjSjmbcx.getOtaId());
|
||||||
|
otaBaSjList = otaBaSjListService.queryById(otaBaSjSjmbcx.getOtaId());
|
||||||
|
otaBaSjList.updateData(otaBaSjSjmbcx);
|
||||||
|
otaBaSjListService.editById(otaBaSjList);
|
||||||
|
}
|
||||||
otaBaSjSjmbcx.setUpdateTime(now);
|
otaBaSjSjmbcx.setUpdateTime(now);
|
||||||
save(otaBaSjSjmbcx);
|
saveOrUpdate(otaBaSjSjmbcx);
|
||||||
|
ComparisonUtil cu = new ComparisonUtil();
|
||||||
|
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjmbcx.getOtaId(), OtaModuleEnum.SJ_SJMBCX, otaBaSjSjmbcxOld, otaBaSjSjmbcx, sysDictService);
|
||||||
|
otaBaCxTxjlService.saveBatch(reList);
|
||||||
|
return otaBaSjSjmbcx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjSjmbcx
|
* @param otaBaSjSjmbcx
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(OtaBaSjSjmbcx otaBaSjSjmbcx) {
|
public void editById(OtaBaSjSjmbcx otaBaSjSjmbcx) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaSjSjmbcx.setUpdateTime(now);
|
otaBaSjSjmbcx.setUpdateTime(now);
|
||||||
saveOrUpdate(otaBaSjSjmbcx);
|
saveOrUpdate(otaBaSjSjmbcx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过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 OtaBaSjSjmbcx queryById(String id) {
|
public OtaBaSjSjmbcx queryById(String id) {
|
||||||
return getById(id);
|
return getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OtaBaSjSjmbcx> queryList() {
|
public List<OtaBaSjSjmbcx> queryList() {
|
||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjmbcx queryByOtaId(String otaId, String otaIdT) {
|
||||||
|
//判断是否保存过,否则查询模版数据回显
|
||||||
|
OtaBaSjSjmbcx res = getByOtaId(otaId);
|
||||||
|
if (ObjectUtils.isEmpty(res)) {
|
||||||
|
res = getByOtaId(otaIdT);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
private OtaBaSjSjmbcx getByOtaId(String otaId) {
|
||||||
|
LambdaQueryWrapper<OtaBaSjSjmbcx> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(OtaBaSjSjmbcx::getOtaId, otaId);
|
||||||
|
return this.getOne(queryWrapper, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user