开发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);
|
||||||
}
|
}
|
||||||
|
|||||||
+51
@@ -1,11 +1,20 @@
|
|||||||
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,6 +26,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
@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
|
||||||
|
private IOtaBaCxLsjlService otaBaCxLsjlService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -86,4 +100,41 @@ public class OtaBaCxListServiceImpl extends ServiceImpl<OtaBaCxListMapper, OtaBa
|
|||||||
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+53
-2
@@ -1,12 +1,21 @@
|
|||||||
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: 升级备案-升级活动备案列表
|
||||||
@@ -17,6 +26,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
@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
|
||||||
|
private IOtaBaSjLsjlService otaBaSjLsjlService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -86,4 +100,41 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
|
|||||||
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