开发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.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 备案维护
|
||||
*
|
||||
*/
|
||||
@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.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 备案维护
|
||||
*
|
||||
*/
|
||||
@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.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 车型及功能备案列表
|
||||
@@ -58,4 +59,10 @@ public interface IOtaBaCxListService extends IService<OtaBaCxList> {
|
||||
* @return
|
||||
*/
|
||||
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.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 升级备案-升级活动备案列表
|
||||
@@ -58,4 +59,10 @@ public interface IOtaBaSjListService extends IService<OtaBaSjList> {
|
||||
* @return
|
||||
*/
|
||||
List<OtaBaSjList> queryList();
|
||||
|
||||
/**
|
||||
* 备案维护
|
||||
*
|
||||
*/
|
||||
void record(Map<String, Object> map);
|
||||
}
|
||||
|
||||
+94
-43
@@ -1,29 +1,43 @@
|
||||
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.OtaBaCxLsjl;
|
||||
import com.jero.modules.ota.mapper.OtaBaCxListMapper;
|
||||
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 java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 车型及功能备案列表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-03-17
|
||||
* @Date: 2023-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBaCxList> implements IOtaBaCxListService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param otaBaCxList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
@Autowired
|
||||
private IOtaBaCxLsjlService otaBaCxLsjlService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param otaBaCxList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(OtaBaCxList otaBaCxList) {
|
||||
Date now = new Date();
|
||||
otaBaCxList.setCreateTime(now);
|
||||
@@ -31,59 +45,96 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
|
||||
save(otaBaCxList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param otaBaCxList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param otaBaCxList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(OtaBaCxList otaBaCxList) {
|
||||
Date now = new Date();
|
||||
Date now = new Date();
|
||||
otaBaCxList.setUpdateTime(now);
|
||||
saveOrUpdate(otaBaCxList);
|
||||
saveOrUpdate(otaBaCxList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OtaBaCxList queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OtaBaCxList> queryList() {
|
||||
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;
|
||||
|
||||
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.OtaBaSjLsjl;
|
||||
import com.jero.modules.ota.mapper.OtaBaSjListMapper;
|
||||
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 java.util.List;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 升级备案-升级活动备案列表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-03-17
|
||||
* @Date: 2023-03-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBaSjList> implements IOtaBaSjListService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param otaBaSjList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
@Autowired
|
||||
private IOtaBaSjLsjlService otaBaSjLsjlService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param otaBaSjList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(OtaBaSjList otaBaSjList) {
|
||||
Date now = new Date();
|
||||
otaBaSjList.setCreateTime(now);
|
||||
@@ -31,59 +45,96 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
|
||||
save(otaBaSjList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param otaBaSjList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param otaBaSjList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(OtaBaSjList otaBaSjList) {
|
||||
Date now = new Date();
|
||||
Date now = new Date();
|
||||
otaBaSjList.setUpdateTime(now);
|
||||
saveOrUpdate(otaBaSjList);
|
||||
saveOrUpdate(otaBaSjList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OtaBaSjList queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OtaBaSjList> queryList() {
|
||||
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