开发OTA备案工具 添加备案历史接口
This commit is contained in:
+15
-1
@@ -2,6 +2,7 @@ package com.jero.modules.ota.controller;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
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;
|
||||||
@@ -167,4 +168,17 @@ public class OtaBaCxListController extends JeroController<OtaBaCxList, IOtaBaCxL
|
|||||||
return super.importExcel(request, response, OtaBaCxList.class);
|
return super.importExcel(request, response, OtaBaCxList.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* 备案维护
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "车型及功能备案列表-备案维护")
|
||||||
|
@ApiOperation(value="车型及功能备案列表-备案维护", notes="车型及功能备案列表-备案维护")
|
||||||
|
@PutMapping(value = "/record")
|
||||||
|
public Result<?> record(@RequestBody Map<String,Object> map) {
|
||||||
|
otaBaCxListService.record(map);
|
||||||
|
return Result.OK("备案维护成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
+13
@@ -2,6 +2,7 @@ package com.jero.modules.ota.controller;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
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;
|
||||||
@@ -167,4 +168,16 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
|
|||||||
return super.importExcel(request, response, OtaBaSjList.class);
|
return super.importExcel(request, response, OtaBaSjList.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备案维护
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-备案维护")
|
||||||
|
@ApiOperation(value="升级备案-备案维护", notes="升级备案-备案维护")
|
||||||
|
@PutMapping(value = "/record")
|
||||||
|
public Result<?> record(@RequestBody Map<String,Object> map) {
|
||||||
|
otaBaSjListService.record(map);
|
||||||
|
return Result.OK("备案维护成功!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -3,6 +3,7 @@ package com.jero.modules.ota.service;
|
|||||||
import com.jero.modules.ota.entity.OtaBaCxList;
|
import com.jero.modules.ota.entity.OtaBaCxList;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 车型及功能备案列表
|
* @Description: 车型及功能备案列表
|
||||||
@@ -58,4 +59,10 @@ public interface IOtaBaCxListService extends IService<OtaBaCxList> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaCxList> queryList();
|
List<OtaBaCxList> queryList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备案维护
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void record(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -3,6 +3,7 @@ package com.jero.modules.ota.service;
|
|||||||
import com.jero.modules.ota.entity.OtaBaSjList;
|
import com.jero.modules.ota.entity.OtaBaSjList;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级活动备案列表
|
* @Description: 升级备案-升级活动备案列表
|
||||||
@@ -58,4 +59,10 @@ public interface IOtaBaSjListService extends IService<OtaBaSjList> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjList> queryList();
|
List<OtaBaSjList> queryList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备案维护
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void record(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
+94
-43
@@ -1,29 +1,43 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxList;
|
import com.jero.modules.ota.entity.OtaBaCxList;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaCxLsjl;
|
||||||
import com.jero.modules.ota.mapper.OtaBaCxListMapper;
|
import com.jero.modules.ota.mapper.OtaBaCxListMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaCxListService;
|
import com.jero.modules.ota.service.IOtaBaCxListService;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaCxLsjlService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
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 OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBaCxList> implements IOtaBaCxListService {
|
public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBaCxList> implements IOtaBaCxListService {
|
||||||
|
|
||||||
/**
|
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
* 保存
|
|
||||||
*
|
@Autowired
|
||||||
* @param otaBaCxList
|
private IOtaBaCxLsjlService otaBaCxLsjlService;
|
||||||
* @return
|
|
||||||
*/
|
/**
|
||||||
@Override
|
* 保存
|
||||||
|
*
|
||||||
|
* @param otaBaCxList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void add(OtaBaCxList otaBaCxList) {
|
public void add(OtaBaCxList otaBaCxList) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaCxList.setCreateTime(now);
|
otaBaCxList.setCreateTime(now);
|
||||||
@@ -31,59 +45,96 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
|
|||||||
save(otaBaCxList);
|
save(otaBaCxList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaCxList
|
* @param otaBaCxList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(OtaBaCxList otaBaCxList) {
|
public void editById(OtaBaCxList otaBaCxList) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaCxList.setUpdateTime(now);
|
otaBaCxList.setUpdateTime(now);
|
||||||
saveOrUpdate(otaBaCxList);
|
saveOrUpdate(otaBaCxList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过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 OtaBaCxList queryById(String id) {
|
public OtaBaCxList queryById(String id) {
|
||||||
return getById(id);
|
return getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OtaBaCxList> queryList() {
|
public List<OtaBaCxList> queryList() {
|
||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备案维护
|
||||||
|
*
|
||||||
|
* @param map
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void record(Map<String, Object> map) {
|
||||||
|
try {
|
||||||
|
String id = (String) map.get("id");
|
||||||
|
OtaBaCxList otaBaCxList = this.queryById(id);
|
||||||
|
if (null != otaBaCxList) {
|
||||||
|
String bazt = (String) map.get("bazt");
|
||||||
|
otaBaCxList.setBazt(bazt);
|
||||||
|
Object batjsj = map.get("batjsj");
|
||||||
|
if (null != batjsj) {
|
||||||
|
Date batjsjDate = null;
|
||||||
|
batjsjDate = sdf.parse((String) batjsj);
|
||||||
|
otaBaCxList.setBatjsj(batjsjDate);
|
||||||
|
}
|
||||||
|
String bz = (String) map.get("bz");
|
||||||
|
otaBaCxList.setBz(bz);
|
||||||
|
this.saveOrUpdate(otaBaCxList);
|
||||||
|
//添加历史记录数据
|
||||||
|
OtaBaCxLsjl lsjl = new OtaBaCxLsjl();
|
||||||
|
lsjl.setOtaId(otaBaCxList.getId());
|
||||||
|
lsjl.setSjzt(bazt);
|
||||||
|
otaBaCxLsjlService.add(lsjl);
|
||||||
|
}
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new JeroBootException(e.getMessage());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
throw new JeroBootException(ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+96
-45
@@ -1,29 +1,43 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaCxLsjl;
|
||||||
import com.jero.modules.ota.entity.OtaBaSjList;
|
import com.jero.modules.ota.entity.OtaBaSjList;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaSjLsjl;
|
||||||
import com.jero.modules.ota.mapper.OtaBaSjListMapper;
|
import com.jero.modules.ota.mapper.OtaBaSjListMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjListService;
|
import com.jero.modules.ota.service.IOtaBaSjListService;
|
||||||
|
import com.jero.modules.ota.service.IOtaBaSjLsjlService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import java.util.List;
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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 OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBaSjList> implements IOtaBaSjListService {
|
public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBaSjList> implements IOtaBaSjListService {
|
||||||
|
|
||||||
/**
|
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
* 保存
|
|
||||||
*
|
@Autowired
|
||||||
* @param otaBaSjList
|
private IOtaBaSjLsjlService otaBaSjLsjlService;
|
||||||
* @return
|
|
||||||
*/
|
/**
|
||||||
@Override
|
* 保存
|
||||||
|
*
|
||||||
|
* @param otaBaSjList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void add(OtaBaSjList otaBaSjList) {
|
public void add(OtaBaSjList otaBaSjList) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaSjList.setCreateTime(now);
|
otaBaSjList.setCreateTime(now);
|
||||||
@@ -31,59 +45,96 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
|
|||||||
save(otaBaSjList);
|
save(otaBaSjList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjList
|
* @param otaBaSjList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(OtaBaSjList otaBaSjList) {
|
public void editById(OtaBaSjList otaBaSjList) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
otaBaSjList.setUpdateTime(now);
|
otaBaSjList.setUpdateTime(now);
|
||||||
saveOrUpdate(otaBaSjList);
|
saveOrUpdate(otaBaSjList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过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 OtaBaSjList queryById(String id) {
|
public OtaBaSjList queryById(String id) {
|
||||||
return getById(id);
|
return getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<OtaBaSjList> queryList() {
|
public List<OtaBaSjList> queryList() {
|
||||||
return list();
|
return list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备案维护
|
||||||
|
*
|
||||||
|
* @param map
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void record(Map<String, Object> map) {
|
||||||
|
try {
|
||||||
|
String id = (String) map.get("id");
|
||||||
|
OtaBaSjList otaBaSjList = this.queryById(id);
|
||||||
|
if (null != otaBaSjList) {
|
||||||
|
String bazt = (String) map.get("bazt");
|
||||||
|
otaBaSjList.setBazt(bazt);
|
||||||
|
Object batjsj = map.get("batjsj");
|
||||||
|
if (null != batjsj) {
|
||||||
|
Date batjsjDate = null;
|
||||||
|
batjsjDate = sdf.parse((String) batjsj);
|
||||||
|
otaBaSjList.setBatjsj(batjsjDate);
|
||||||
|
}
|
||||||
|
String bz = (String) map.get("bz");
|
||||||
|
otaBaSjList.setBz(bz);
|
||||||
|
this.saveOrUpdate(otaBaSjList);
|
||||||
|
//添加历史记录数据
|
||||||
|
OtaBaSjLsjl lsjl = new OtaBaSjLsjl();
|
||||||
|
lsjl.setOtaId(otaBaSjList.getId());
|
||||||
|
lsjl.setSjzt(bazt);
|
||||||
|
otaBaSjLsjlService.add(lsjl);
|
||||||
|
}
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new JeroBootException(e.getMessage());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
throw new JeroBootException(ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user