开发OTA备案工具-车辆升级
This commit is contained in:
+168
-135
@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -26,163 +27,195 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级活动备案列表
|
* @Description: 升级备案-升级活动备案列表
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Api(tags="升级备案-升级活动备案列表")
|
@Api(tags = "升级备案-升级活动备案列表")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/ota/otaBaSjList")
|
@RequestMapping("/ota/otaBaSjList")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjListService> {
|
public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjListService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOtaBaSjListService otaBaSjListService;
|
private IOtaBaSjListService otaBaSjListService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param otaBaSjList
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级活动备案列表-分页列表查询")
|
|
||||||
@ApiOperation(value="升级备案-升级活动备案列表-分页列表查询", notes="升级备案-升级活动备案列表-分页列表查询")
|
|
||||||
@GetMapping(value = "/page")
|
|
||||||
public Result<?> queryPageList(OtaBaSjList otaBaSjList,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<OtaBaSjList> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap());
|
|
||||||
queryWrapper.orderByDesc("create_time");
|
|
||||||
Page<OtaBaSjList> page = new Page<OtaBaSjList>(pageNo, pageSize);
|
|
||||||
IPage<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @param otaBaSjList
|
||||||
*/
|
* @param pageNo
|
||||||
@AutoLog(value = "升级备案-升级活动备案列表-列表查询")
|
* @param pageSize
|
||||||
@ApiOperation(value="升级备案-升级活动备案列表-列表查询", notes="升级备案-升级活动备案列表-列表查询")
|
* @param req
|
||||||
@GetMapping(value = "/list")
|
* @return
|
||||||
public Result<List<OtaBaSjList>> queryList() {
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级活动备案列表-分页列表查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级活动备案列表-分页列表查询", notes = "升级备案-升级活动备案列表-分页列表查询")
|
||||||
|
@GetMapping(value = "/page")
|
||||||
|
public Result<?> queryPageList(OtaBaSjList otaBaSjList,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OtaBaSjList> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap());
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
Page<OtaBaSjList> page = new Page<OtaBaSjList>(pageNo, pageSize);
|
||||||
|
IPage<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级活动备案列表-列表查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级活动备案列表-列表查询", notes = "升级备案-升级活动备案列表-列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<List<OtaBaSjList>> queryList() {
|
||||||
List<OtaBaSjList> list = otaBaSjListService.queryList();
|
List<OtaBaSjList> list = otaBaSjListService.queryList();
|
||||||
return Result.OK(list);
|
return Result.OK(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param otaBaSjList
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级活动备案列表-添加")
|
|
||||||
@ApiOperation(value="升级备案-升级活动备案列表-添加", notes="升级备案-升级活动备案列表-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<?> add(@Validated @RequestBody OtaBaSjList otaBaSjList) {
|
|
||||||
otaBaSjListService.add(otaBaSjList);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param otaBaSjList
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级活动备案列表-编辑")
|
|
||||||
@ApiOperation(value="升级备案-升级活动备案列表-编辑", notes="升级备案-升级活动备案列表-编辑")
|
|
||||||
@PutMapping(value = "/edit")
|
|
||||||
public Result<?> edit(@Validated @RequestBody OtaBaSjList otaBaSjList) {
|
|
||||||
otaBaSjListService.editById(otaBaSjList);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级活动备案列表-通过id删除")
|
|
||||||
@ApiOperation(value="升级备案-升级活动备案列表-通过id删除", notes="升级备案-升级活动备案列表-通过id删除")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
otaBaSjListService.deleteById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级活动备案列表-批量删除")
|
|
||||||
@ApiOperation(value="升级备案-升级活动备案列表-批量删除", notes="升级备案-升级活动备案列表-批量删除")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.otaBaSjListService.deleteByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级活动备案列表-通过id查询")
|
|
||||||
@ApiOperation(value="升级备案-升级活动备案列表-通过id查询", notes="升级备案-升级活动备案列表-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(id);
|
|
||||||
if(otaBaSjList==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(otaBaSjList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 添加
|
||||||
*
|
*
|
||||||
* @param request
|
* @param otaBaSjList
|
||||||
* @param otaBaSjList
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级活动备案列表-添加")
|
||||||
|
@ApiOperation(value = "升级备案-升级活动备案列表-添加", notes = "升级备案-升级活动备案列表-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<?> add(@Validated @RequestBody OtaBaSjList otaBaSjList) {
|
||||||
|
otaBaSjListService.add(otaBaSjList);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param otaBaSjList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级活动备案列表-编辑")
|
||||||
|
@ApiOperation(value = "升级备案-升级活动备案列表-编辑", notes = "升级备案-升级活动备案列表-编辑")
|
||||||
|
@PutMapping(value = "/edit")
|
||||||
|
public Result<?> edit(@Validated @RequestBody OtaBaSjList otaBaSjList) {
|
||||||
|
otaBaSjListService.editById(otaBaSjList);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级活动备案列表-通过id删除")
|
||||||
|
@ApiOperation(value = "升级备案-升级活动备案列表-通过id删除", notes = "升级备案-升级活动备案列表-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
otaBaSjListService.deleteById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级活动备案列表-批量删除")
|
||||||
|
@ApiOperation(value = "升级备案-升级活动备案列表-批量删除", notes = "升级备案-升级活动备案列表-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.otaBaSjListService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级活动备案列表-通过id查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级活动备案列表-通过id查询", notes = "升级备案-升级活动备案列表-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(id);
|
||||||
|
if (otaBaSjList == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(otaBaSjList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param otaBaSjList
|
||||||
|
*/
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, OtaBaSjList otaBaSjList) {
|
public ModelAndView exportXls(HttpServletRequest request, OtaBaSjList otaBaSjList) {
|
||||||
return super.exportXls(request, otaBaSjList, OtaBaSjList.class, "升级备案-升级活动备案列表");
|
return super.exportXls(request, otaBaSjList, OtaBaSjList.class, "升级备案-升级活动备案列表");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
return super.importExcel(request, response, OtaBaSjList.class);
|
return super.importExcel(request, response, OtaBaSjList.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备案维护
|
* 备案维护
|
||||||
*
|
*/
|
||||||
*/
|
@AutoLog(value = "升级备案-备案维护")
|
||||||
@AutoLog(value = "升级备案-备案维护")
|
@ApiOperation(value = "升级备案-备案维护", notes = "升级备案-备案维护")
|
||||||
@ApiOperation(value = "升级备案-备案维护", notes = "升级备案-备案维护")
|
@PostMapping(value = "/batchRecord")
|
||||||
@PostMapping(value = "/batchRecord")
|
public Result<?> batchRecord(@RequestParam(name = "ids", required = true) String ids,
|
||||||
public Result<?> batchRecord(@RequestParam(name = "ids", required = true) String ids,
|
@RequestParam(name = "bazt", required = true) String bazt,
|
||||||
@RequestParam(name = "bazt", required = true) String bazt,
|
@RequestParam(name = "batjsj", required = true) String batjsj,
|
||||||
@RequestParam(name = "batjsj", required = true) String batjsj,
|
@RequestParam(name = "bz", required = true) String bz,
|
||||||
@RequestParam(name = "bz", required = true) String bz,
|
@RequestParam(name = "cut") String cut) {
|
||||||
@RequestParam(name = "cut") String cut) {
|
otaBaSjListService.batchRecord(ids, bazt, batjsj, bz, cut);
|
||||||
otaBaSjListService.batchRecord(ids, bazt, batjsj, bz, cut);
|
return Result.OK("备案维护成功!");
|
||||||
return Result.OK("备案维护成功!");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "升级备案-模板下载")
|
||||||
|
@GetMapping(value = "/exportTemplate")
|
||||||
|
// @RequiresPermissions("otaBaCx:exportTemplate")
|
||||||
|
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
this.otaBaSjListService.exportTemplate(response, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "升级备案-数据导入")
|
||||||
|
@PostMapping(value = "/importData")
|
||||||
|
// @RequiresPermissions("otaBaCx:importData")
|
||||||
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
|
@RequestParam(value = "cut", required = false) String cut) throws Exception {
|
||||||
|
try {
|
||||||
|
this.otaBaSjListService.importData(file, cut);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Result.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return Result.OK("导入成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "升级备案-数据导出")
|
||||||
|
@GetMapping(value = "/exportData")
|
||||||
|
// @RequiresPermissions("otaBaCx:exportTemplate")
|
||||||
|
public void exportData(@RequestParam(value = "otaId", required = false) String otaId, HttpServletResponse response, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
this.otaBaSjListService.exportData(otaId, response, request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+159
-132
@@ -4,6 +4,7 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
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;
|
||||||
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.OtaBaCxJbxx;
|
||||||
@@ -17,167 +18,193 @@ import com.jero.common.system.base.controller.JeroController;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级目标车辆
|
* @Description: 升级备案-升级目标车辆
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Api(tags="升级备案-升级目标车辆")
|
@Api(tags = "升级备案-升级目标车辆")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/ota/otaBaSjSjmbcl")
|
@RequestMapping("/ota/otaBaSjSjmbcl")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class OtaBaSjSjmbclController extends JeroController<OtaBaSjSjmbcl, IOtaBaSjSjmbclService> {
|
public class OtaBaSjSjmbclController extends JeroController<OtaBaSjSjmbcl, IOtaBaSjSjmbclService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOtaBaSjSjmbclService otaBaSjSjmbclService;
|
private IOtaBaSjSjmbclService otaBaSjSjmbclService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param otaBaSjSjmbcl
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级目标车辆-分页列表查询")
|
|
||||||
@ApiOperation(value="升级备案-升级目标车辆-分页列表查询", notes="升级备案-升级目标车辆-分页列表查询")
|
|
||||||
@GetMapping(value = "/page")
|
|
||||||
public Result<?> queryPageList(OtaBaSjSjmbcl otaBaSjSjmbcl,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<OtaBaSjSjmbcl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjSjmbcl, req.getParameterMap());
|
|
||||||
Page<OtaBaSjSjmbcl> page = new Page<OtaBaSjSjmbcl>(pageNo, pageSize);
|
|
||||||
IPage<OtaBaSjSjmbcl> pageList = otaBaSjSjmbclService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @param otaBaSjSjmbcl
|
||||||
*/
|
* @param pageNo
|
||||||
@AutoLog(value = "升级备案-升级目标车辆-列表查询")
|
* @param pageSize
|
||||||
@ApiOperation(value="升级备案-升级目标车辆-列表查询", notes="升级备案-升级目标车辆-列表查询")
|
* @param req
|
||||||
@GetMapping(value = "/list")
|
* @return
|
||||||
public Result<List<OtaBaSjSjmbcl>> queryList() {
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车辆-分页列表查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-分页列表查询", notes = "升级备案-升级目标车辆-分页列表查询")
|
||||||
|
@GetMapping(value = "/page")
|
||||||
|
public Result<?> queryPageList(OtaBaSjSjmbcl otaBaSjSjmbcl,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OtaBaSjSjmbcl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjSjmbcl, req.getParameterMap());
|
||||||
|
Page<OtaBaSjSjmbcl> page = new Page<OtaBaSjSjmbcl>(pageNo, pageSize);
|
||||||
|
IPage<OtaBaSjSjmbcl> pageList = otaBaSjSjmbclService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车辆-列表查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-列表查询", notes = "升级备案-升级目标车辆-列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<List<OtaBaSjSjmbcl>> queryList() {
|
||||||
List<OtaBaSjSjmbcl> list = otaBaSjSjmbclService.queryList();
|
List<OtaBaSjSjmbcl> list = otaBaSjSjmbclService.queryList();
|
||||||
return Result.OK(list);
|
return Result.OK(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param otaBaSjSjmbcl
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级目标车辆-添加")
|
|
||||||
@ApiOperation(value="升级备案-升级目标车辆-添加", notes="升级备案-升级目标车辆-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<?> add(@Validated @RequestBody OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
|
||||||
otaBaSjSjmbclService.add(otaBaSjSjmbcl);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param otaBaSjSjmbcl
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级目标车辆-编辑")
|
|
||||||
@ApiOperation(value="升级备案-升级目标车辆-编辑", notes="升级备案-升级目标车辆-编辑")
|
|
||||||
@PutMapping(value = "/edit")
|
|
||||||
public Result<?> edit(@Validated @RequestBody OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
|
||||||
otaBaSjSjmbclService.editById(otaBaSjSjmbcl);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级目标车辆-通过id删除")
|
|
||||||
@ApiOperation(value="升级备案-升级目标车辆-通过id删除", notes="升级备案-升级目标车辆-通过id删除")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
otaBaSjSjmbclService.deleteById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级目标车辆-批量删除")
|
|
||||||
@ApiOperation(value="升级备案-升级目标车辆-批量删除", notes="升级备案-升级目标车辆-批量删除")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.otaBaSjSjmbclService.deleteByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级目标车辆-通过id查询")
|
|
||||||
@ApiOperation(value="升级备案-升级目标车辆-通过id查询", notes="升级备案-升级目标车辆-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
OtaBaSjSjmbcl otaBaSjSjmbcl = otaBaSjSjmbclService.queryById(id);
|
|
||||||
if(otaBaSjSjmbcl==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
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
|
* 添加
|
||||||
*
|
*
|
||||||
* @param request
|
* @param otaBaSjSjmbcl
|
||||||
* @param otaBaSjSjmbcl
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车辆-添加")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-添加", notes = "升级备案-升级目标车辆-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<?> add(@Validated @RequestBody OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
||||||
|
otaBaSjSjmbclService.add(otaBaSjSjmbcl);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param otaBaSjSjmbcl
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车辆-编辑")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-编辑", notes = "升级备案-升级目标车辆-编辑")
|
||||||
|
@PutMapping(value = "/edit")
|
||||||
|
public Result<?> edit(@Validated @RequestBody OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
||||||
|
otaBaSjSjmbclService.editById(otaBaSjSjmbcl);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车辆-通过id删除")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-通过id删除", notes = "升级备案-升级目标车辆-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
otaBaSjSjmbclService.deleteById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车辆-批量删除")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-批量删除", notes = "升级备案-升级目标车辆-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.otaBaSjSjmbclService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级目标车辆-通过id查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-通过id查询", notes = "升级备案-升级目标车辆-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OtaBaSjSjmbcl otaBaSjSjmbcl = otaBaSjSjmbclService.queryById(id);
|
||||||
|
if (otaBaSjSjmbcl == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
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
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param otaBaSjSjmbcl
|
||||||
|
*/
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
public ModelAndView exportXls(HttpServletRequest request, OtaBaSjSjmbcl otaBaSjSjmbcl) {
|
||||||
return super.exportXls(request, otaBaSjSjmbcl, OtaBaSjSjmbcl.class, "升级备案-升级目标车辆");
|
return super.exportXls(request, otaBaSjSjmbcl, OtaBaSjSjmbcl.class, "升级备案-升级目标车辆");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
return super.importExcel(request, response, OtaBaSjSjmbcl.class);
|
return super.importExcel(request, response, OtaBaSjSjmbcl.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-模板下载")
|
||||||
|
@GetMapping(value = "/exportTemplate")
|
||||||
|
// @RequiresPermissions("otaBaCx:exportTemplate")
|
||||||
|
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
this.otaBaSjSjmbclService.exportTemplate(response, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车辆-数据导入")
|
||||||
|
@PostMapping(value = "/importData")
|
||||||
|
// @RequiresPermissions("otaBaCx:importData")
|
||||||
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
OtaBaSjSjmbcl res;
|
||||||
|
try {
|
||||||
|
String[] params = otaId.split("\\?");
|
||||||
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
|
cut = params[1].replace("cut=", "");
|
||||||
|
res = this.otaBaSjSjmbclService.importData(file, otaId, cut);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Result.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return Result.OK(res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+29
@@ -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.entity.OtaBaSjSjmbcx;
|
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjSjmbcxService;
|
import com.jero.modules.ota.service.IOtaBaSjSjmbcxService;
|
||||||
@@ -17,6 +18,7 @@ import com.jero.common.system.base.controller.JeroController;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -180,4 +182,31 @@ public class OtaBaSjSjmbcxController extends JeroController<OtaBaSjSjmbcx, IOtaB
|
|||||||
return super.importExcel(request, response, OtaBaSjSjmbcx.class);
|
return super.importExcel(request, response, OtaBaSjSjmbcx.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车型-模板下载")
|
||||||
|
@GetMapping(value = "/exportTemplate")
|
||||||
|
// @RequiresPermissions("otaBaCx:exportTemplate")
|
||||||
|
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
this.otaBaSjSjmbcxService.exportTemplate(response, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "升级备案-升级目标车型-数据导入")
|
||||||
|
@PostMapping(value = "/importData")
|
||||||
|
// @RequiresPermissions("otaBaCx:importData")
|
||||||
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
OtaBaSjSjmbcx res;
|
||||||
|
try {
|
||||||
|
String[] params = otaId.split("\\?");
|
||||||
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
|
cut = params[1].replace("cut=", "");
|
||||||
|
res = this.otaBaSjSjmbcxService.importData(file, otaId, cut);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Result.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return Result.OK(res);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+166
-138
@@ -4,6 +4,7 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
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;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.modules.ota.entity.OtaBaCxAqcs;
|
import com.jero.modules.ota.entity.OtaBaCxAqcs;
|
||||||
@@ -17,173 +18,200 @@ import com.jero.common.system.base.controller.JeroController;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级影响评估
|
* @Description: 升级备案-升级影响评估
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Api(tags="升级备案-升级影响评估")
|
@Api(tags = "升级备案-升级影响评估")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/ota/otaBaSjSjyxpg")
|
@RequestMapping("/ota/otaBaSjSjyxpg")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class OtaBaSjSjyxpgController extends JeroController<OtaBaSjSjyxpg, IOtaBaSjSjyxpgService> {
|
public class OtaBaSjSjyxpgController extends JeroController<OtaBaSjSjyxpg, IOtaBaSjSjyxpgService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOtaBaSjSjyxpgService otaBaSjSjyxpgService;
|
private IOtaBaSjSjyxpgService otaBaSjSjyxpgService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param otaBaSjSjyxpg
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级影响评估-分页列表查询")
|
|
||||||
@ApiOperation(value="升级备案-升级影响评估-分页列表查询", notes="升级备案-升级影响评估-分页列表查询")
|
|
||||||
@GetMapping(value = "/page")
|
|
||||||
public Result<?> queryPageList(OtaBaSjSjyxpg otaBaSjSjyxpg,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<OtaBaSjSjyxpg> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjSjyxpg, req.getParameterMap());
|
|
||||||
Page<OtaBaSjSjyxpg> page = new Page<OtaBaSjSjyxpg>(pageNo, pageSize);
|
|
||||||
IPage<OtaBaSjSjyxpg> pageList = otaBaSjSjyxpgService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @param otaBaSjSjyxpg
|
||||||
*/
|
* @param pageNo
|
||||||
@AutoLog(value = "升级备案-升级影响评估-列表查询")
|
* @param pageSize
|
||||||
@ApiOperation(value="升级备案-升级影响评估-列表查询", notes="升级备案-升级影响评估-列表查询")
|
* @param req
|
||||||
@GetMapping(value = "/list")
|
* @return
|
||||||
public Result<List<OtaBaSjSjyxpg>> queryList() {
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级影响评估-分页列表查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级影响评估-分页列表查询", notes = "升级备案-升级影响评估-分页列表查询")
|
||||||
|
@GetMapping(value = "/page")
|
||||||
|
public Result<?> queryPageList(OtaBaSjSjyxpg otaBaSjSjyxpg,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<OtaBaSjSjyxpg> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjSjyxpg, req.getParameterMap());
|
||||||
|
Page<OtaBaSjSjyxpg> page = new Page<OtaBaSjSjyxpg>(pageNo, pageSize);
|
||||||
|
IPage<OtaBaSjSjyxpg> pageList = otaBaSjSjyxpgService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级影响评估-列表查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级影响评估-列表查询", notes = "升级备案-升级影响评估-列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<List<OtaBaSjSjyxpg>> queryList() {
|
||||||
List<OtaBaSjSjyxpg> list = otaBaSjSjyxpgService.queryList();
|
List<OtaBaSjSjyxpg> list = otaBaSjSjyxpgService.queryList();
|
||||||
return Result.OK(list);
|
return Result.OK(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param otaBaSjSjyxpg
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级影响评估-添加")
|
|
||||||
@ApiOperation(value="升级备案-升级影响评估-添加", notes="升级备案-升级影响评估-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<?> add(@Validated @RequestBody OtaBaSjSjyxpg otaBaSjSjyxpg) {
|
|
||||||
otaBaSjSjyxpgService.add(otaBaSjSjyxpg);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param otaBaSjSjyxpg
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级影响评估-编辑")
|
|
||||||
@ApiOperation(value="升级备案-升级影响评估-编辑", notes="升级备案-升级影响评估-编辑")
|
|
||||||
@PutMapping(value = "/edit")
|
|
||||||
public Result<?> edit(@Validated @RequestBody OtaBaSjSjyxpg otaBaSjSjyxpg) {
|
|
||||||
otaBaSjSjyxpgService.editById(otaBaSjSjyxpg);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级影响评估-通过id删除")
|
|
||||||
@ApiOperation(value="升级备案-升级影响评估-通过id删除", notes="升级备案-升级影响评估-通过id删除")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
otaBaSjSjyxpgService.deleteById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级影响评估-批量删除")
|
|
||||||
@ApiOperation(value="升级备案-升级影响评估-批量删除", notes="升级备案-升级影响评估-批量删除")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.otaBaSjSjyxpgService.deleteByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级影响评估-通过id查询")
|
|
||||||
@ApiOperation(value="升级备案-升级影响评估-通过id查询", notes="升级备案-升级影响评估-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
OtaBaSjSjyxpg otaBaSjSjyxpg = otaBaSjSjyxpgService.queryById(id);
|
|
||||||
if(otaBaSjSjyxpg==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(otaBaSjSjyxpg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过otaId查询
|
|
||||||
*
|
|
||||||
* @param otaId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "升级备案-升级影响评估-通过otaId查询")
|
|
||||||
@ApiOperation(value = "升级备案-升级影响评估-通过otaId查询", notes = "升级备案-升级影响评估-通过otaId查询")
|
|
||||||
@GetMapping(value = "/queryByOtaId")
|
|
||||||
public Result<?> queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId,
|
|
||||||
@RequestParam(name = "otaIdT", required = true) String otaIdT) {
|
|
||||||
OtaBaSjSjyxpg otaBaSjSjyxpg = otaBaSjSjyxpgService.queryByOtaId(otaId, otaIdT);
|
|
||||||
if (otaBaSjSjyxpg == null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(otaBaSjSjyxpg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 添加
|
||||||
*
|
*
|
||||||
* @param request
|
* @param otaBaSjSjyxpg
|
||||||
* @param otaBaSjSjyxpg
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级影响评估-添加")
|
||||||
|
@ApiOperation(value = "升级备案-升级影响评估-添加", notes = "升级备案-升级影响评估-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<?> add(@Validated @RequestBody OtaBaSjSjyxpg otaBaSjSjyxpg) {
|
||||||
|
otaBaSjSjyxpgService.add(otaBaSjSjyxpg);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param otaBaSjSjyxpg
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级影响评估-编辑")
|
||||||
|
@ApiOperation(value = "升级备案-升级影响评估-编辑", notes = "升级备案-升级影响评估-编辑")
|
||||||
|
@PutMapping(value = "/edit")
|
||||||
|
public Result<?> edit(@Validated @RequestBody OtaBaSjSjyxpg otaBaSjSjyxpg) {
|
||||||
|
otaBaSjSjyxpgService.editById(otaBaSjSjyxpg);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级影响评估-通过id删除")
|
||||||
|
@ApiOperation(value = "升级备案-升级影响评估-通过id删除", notes = "升级备案-升级影响评估-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
otaBaSjSjyxpgService.deleteById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级影响评估-批量删除")
|
||||||
|
@ApiOperation(value = "升级备案-升级影响评估-批量删除", notes = "升级备案-升级影响评估-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.otaBaSjSjyxpgService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级影响评估-通过id查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级影响评估-通过id查询", notes = "升级备案-升级影响评估-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
OtaBaSjSjyxpg otaBaSjSjyxpg = otaBaSjSjyxpgService.queryById(id);
|
||||||
|
if (otaBaSjSjyxpg == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(otaBaSjSjyxpg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过otaId查询
|
||||||
|
*
|
||||||
|
* @param otaId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "升级备案-升级影响评估-通过otaId查询")
|
||||||
|
@ApiOperation(value = "升级备案-升级影响评估-通过otaId查询", notes = "升级备案-升级影响评估-通过otaId查询")
|
||||||
|
@GetMapping(value = "/queryByOtaId")
|
||||||
|
public Result<?> queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId,
|
||||||
|
@RequestParam(name = "otaIdT", required = true) String otaIdT) {
|
||||||
|
OtaBaSjSjyxpg otaBaSjSjyxpg = otaBaSjSjyxpgService.queryByOtaId(otaId, otaIdT);
|
||||||
|
if (otaBaSjSjyxpg == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(otaBaSjSjyxpg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param otaBaSjSjyxpg
|
||||||
|
*/
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, OtaBaSjSjyxpg otaBaSjSjyxpg) {
|
public ModelAndView exportXls(HttpServletRequest request, OtaBaSjSjyxpg otaBaSjSjyxpg) {
|
||||||
return super.exportXls(request, otaBaSjSjyxpg, OtaBaSjSjyxpg.class, "升级备案-升级影响评估");
|
return super.exportXls(request, otaBaSjSjyxpg, OtaBaSjSjyxpg.class, "升级备案-升级影响评估");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
return super.importExcel(request, response, OtaBaSjSjyxpg.class);
|
return super.importExcel(request, response, OtaBaSjSjyxpg.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "车型备案-安全措施-模板下载")
|
||||||
|
@GetMapping(value = "/exportTemplate")
|
||||||
|
// @RequiresPermissions("otaBaCx:exportTemplate")
|
||||||
|
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
this.otaBaSjSjyxpgService.exportTemplate(response, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "车型备案-安全措施-数据导入")
|
||||||
|
@PostMapping(value = "/importData")
|
||||||
|
// @RequiresPermissions("otaBaCx:importData")
|
||||||
|
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||||
|
@RequestParam(value = "cut", required = false) String cut,
|
||||||
|
@RequestParam(value = "otaId", required = false) String otaId) throws Exception {
|
||||||
|
OtaBaSjSjyxpg res;
|
||||||
|
try {
|
||||||
|
String[] params = otaId.split("\\?");
|
||||||
|
otaId = params[0].equals("null") ? "" : params[0];
|
||||||
|
cut = params[1].replace("cut=", "");
|
||||||
|
res = this.otaBaSjSjyxpgService.importData(file, params[0], cut);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Result.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return Result.OK(res);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ public interface IOtaBaSjJssjyyService extends IService<OtaBaSjJssjyy> {
|
|||||||
*/
|
*/
|
||||||
void deleteById(String id);
|
void deleteById(String id);
|
||||||
|
|
||||||
void deleteByOtaId(String otaId)
|
void deleteByOtaId(String otaId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
|
|||||||
+47
-39
@@ -2,67 +2,75 @@ package com.jero.modules.ota.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.modules.ota.entity.OtaBaSjList;
|
import com.jero.modules.ota.entity.OtaBaSjList;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级活动备案列表
|
* @Description: 升级备案-升级活动备案列表
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IOtaBaSjListService extends IService<OtaBaSjList> {
|
public interface IOtaBaSjListService extends IService<OtaBaSjList> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
* @param otaBaSjList
|
* @param otaBaSjList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void add(OtaBaSjList otaBaSjList);
|
void add(OtaBaSjList otaBaSjList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjList
|
* @param otaBaSjList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void editById(OtaBaSjList otaBaSjList);
|
void editById(OtaBaSjList otaBaSjList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过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
|
||||||
*/
|
*/
|
||||||
OtaBaSjList queryById(String id);
|
OtaBaSjList queryById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjList> queryList();
|
List<OtaBaSjList> queryList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备案维护
|
* 备案维护
|
||||||
*
|
*/
|
||||||
*/
|
|
||||||
void batchRecord(String ids, String bazt, String batjsj, String bz, String cut);
|
void batchRecord(String ids, String bazt, String batjsj, String bz, String cut);
|
||||||
|
|
||||||
|
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
|
void importData(MultipartFile file, String cut) throws Exception;
|
||||||
|
|
||||||
|
void exportData(String otaId, HttpServletResponse response, HttpServletRequest request) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
+49
-35
@@ -1,63 +1,77 @@
|
|||||||
package com.jero.modules.ota.service;
|
package com.jero.modules.ota.service;
|
||||||
|
|
||||||
|
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
||||||
import com.jero.modules.ota.entity.OtaBaSjSjmbcl;
|
import com.jero.modules.ota.entity.OtaBaSjSjmbcl;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级目标车辆
|
* @Description: 升级备案-升级目标车辆
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IOtaBaSjSjmbclService extends IService<OtaBaSjSjmbcl> {
|
public interface IOtaBaSjSjmbclService extends IService<OtaBaSjSjmbcl> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
* @param otaBaSjSjmbcl
|
* @param otaBaSjSjmbcl
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void add(OtaBaSjSjmbcl otaBaSjSjmbcl);
|
void add(OtaBaSjSjmbcl otaBaSjSjmbcl);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjSjmbcl
|
* @param otaBaSjSjmbcl
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void editById(OtaBaSjSjmbcl otaBaSjSjmbcl);
|
void editById(OtaBaSjSjmbcl otaBaSjSjmbcl);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过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
|
||||||
*/
|
*/
|
||||||
OtaBaSjSjmbcl queryById(String id);
|
OtaBaSjSjmbcl queryById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjSjmbcl> queryList();
|
List<OtaBaSjSjmbcl> queryList();
|
||||||
|
|
||||||
OtaBaSjSjmbcl queryByOtaId(String otaId, String otaIdT);
|
OtaBaSjSjmbcl queryByOtaId(String otaId, String otaIdT);
|
||||||
|
|
||||||
|
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
|
OtaBaSjSjmbcl parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
|
||||||
|
|
||||||
|
OtaBaSjSjmbcl importData(MultipartFile file, String otaId, String cut) throws Exception;
|
||||||
|
|
||||||
|
void exportData(File file, String otaId, String cut) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
+51
-36
@@ -1,63 +1,78 @@
|
|||||||
package com.jero.modules.ota.service;
|
package com.jero.modules.ota.service;
|
||||||
|
|
||||||
|
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
||||||
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
|
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级目标车型
|
* @Description: 升级备案-升级目标车型
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IOtaBaSjSjmbcxService extends IService<OtaBaSjSjmbcx> {
|
public interface IOtaBaSjSjmbcxService extends IService<OtaBaSjSjmbcx> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
* @param otaBaSjSjmbcx
|
* @param otaBaSjSjmbcx
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
OtaBaSjSjmbcx add(OtaBaSjSjmbcx otaBaSjSjmbcx);
|
OtaBaSjSjmbcx add(OtaBaSjSjmbcx otaBaSjSjmbcx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjSjmbcx
|
* @param otaBaSjSjmbcx
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void editById(OtaBaSjSjmbcx otaBaSjSjmbcx);
|
void editById(OtaBaSjSjmbcx otaBaSjSjmbcx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过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
|
||||||
*/
|
*/
|
||||||
OtaBaSjSjmbcx queryById(String id);
|
OtaBaSjSjmbcx queryById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjSjmbcx> queryList();
|
List<OtaBaSjSjmbcx> queryList();
|
||||||
|
|
||||||
OtaBaSjSjmbcx queryByOtaId(String otaId, String otaIdT);
|
OtaBaSjSjmbcx queryByOtaId(String otaId, String otaIdT);
|
||||||
|
|
||||||
|
|
||||||
|
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
|
OtaBaSjSjmbcx importData(MultipartFile file, String otaId, String cut) throws Exception;
|
||||||
|
|
||||||
|
OtaBaSjSjmbcx parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
|
||||||
|
|
||||||
|
void exportData(File file, String otaId, String cut) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
+49
-35
@@ -1,63 +1,77 @@
|
|||||||
package com.jero.modules.ota.service;
|
package com.jero.modules.ota.service;
|
||||||
|
|
||||||
|
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
|
||||||
import com.jero.modules.ota.entity.OtaBaSjSjyxpg;
|
import com.jero.modules.ota.entity.OtaBaSjSjyxpg;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级影响评估
|
* @Description: 升级备案-升级影响评估
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-03-17
|
* @Date: 2023-03-17
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface IOtaBaSjSjyxpgService extends IService<OtaBaSjSjyxpg> {
|
public interface IOtaBaSjSjyxpgService extends IService<OtaBaSjSjyxpg> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
* @param otaBaSjSjyxpg
|
* @param otaBaSjSjyxpg
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void add(OtaBaSjSjyxpg otaBaSjSjyxpg);
|
void add(OtaBaSjSjyxpg otaBaSjSjyxpg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* 更新
|
||||||
*
|
*
|
||||||
* @param otaBaSjSjyxpg
|
* @param otaBaSjSjyxpg
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void editById(OtaBaSjSjyxpg otaBaSjSjyxpg);
|
void editById(OtaBaSjSjyxpg otaBaSjSjyxpg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过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
|
||||||
*/
|
*/
|
||||||
OtaBaSjSjyxpg queryById(String id);
|
OtaBaSjSjyxpg queryById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OtaBaSjSjyxpg> queryList();
|
List<OtaBaSjSjyxpg> queryList();
|
||||||
|
|
||||||
OtaBaSjSjyxpg queryByOtaId(String otaId, String otaIdT);
|
OtaBaSjSjyxpg queryByOtaId(String otaId, String otaIdT);
|
||||||
|
|
||||||
|
void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
|
OtaBaSjSjyxpg importData(MultipartFile file, String otaId, String cut) throws Exception;
|
||||||
|
|
||||||
|
OtaBaSjSjyxpg parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception;
|
||||||
|
|
||||||
|
void exportData(File file, String otaId, String cut) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -216,7 +216,12 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
jbxx.setCplb(ImportFileUtil.getCellValue(cell, wb));
|
jbxx.setCplb(ImportFileUtil.getCellValue(cell, wb));
|
||||||
row = s.getRow(4);
|
row = s.getRow(4);
|
||||||
cell = row.getCell(1);
|
cell = row.getCell(1);
|
||||||
|
String ggpc = ImportFileUtil.getCellValue(cell, wb);
|
||||||
|
if (StringUtils.isEmpty(cpbh)) {
|
||||||
|
throw new JeroBootException("公告批次不能为空");
|
||||||
|
}
|
||||||
jbxx.setGgpc(ImportFileUtil.getCellValue(cell, wb));
|
jbxx.setGgpc(ImportFileUtil.getCellValue(cell, wb));
|
||||||
|
|
||||||
row = s.getRow(5);
|
row = s.getRow(5);
|
||||||
cell = row.getCell(1);
|
cell = row.getCell(1);
|
||||||
jbxx.setCpsb(ImportFileUtil.getCellValue(cell, wb));
|
jbxx.setCpsb(ImportFileUtil.getCellValue(cell, wb));
|
||||||
|
|||||||
+49
-2
@@ -2,15 +2,22 @@ package com.jero.modules.ota.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaCxJbxx;
|
||||||
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.entity.OtaBaSjLsjl;
|
||||||
|
import com.jero.modules.ota.entity.OtaBaSjSjmbcx;
|
||||||
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.*;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjLsjlService;
|
import com.jero.modules.ota.utils.ImportFileUtil;
|
||||||
import com.jero.modules.system.util.StringUtils;
|
import com.jero.modules.system.util.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -24,11 +31,25 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBaSjList> implements IOtaBaSjListService {
|
public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBaSjList> implements IOtaBaSjListService {
|
||||||
|
|
||||||
|
@Value(value = "${ota.templatePath}")
|
||||||
|
private String templatePath;
|
||||||
|
|
||||||
|
@Value(value = "${ota.uploadPath}")
|
||||||
|
private String uploadPath;
|
||||||
|
|
||||||
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOtaBaSjLsjlService otaBaSjLsjlService;
|
private IOtaBaSjLsjlService otaBaSjLsjlService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOtaBaSjSjmbcxService otaBaSjSjmbcxService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOtaBaSjSjmbclService otaBaSjSjmbclService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOtaBaCxAqcsService otaBaCxAqcsService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,4 +148,30 @@ public class OtaBaSjListServiceImpl extends ServiceImpl<OtaBaSjListMapper, OtaBa
|
|||||||
throw new JeroBootException(ex.getMessage());
|
throw new JeroBootException(ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
ImportFileUtil.exportTemplate(response, templatePath + "在线升级活动备案.zip");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void importData(MultipartFile file, String cut) throws Exception {
|
||||||
|
List<File> fileList = ImportFileUtil.importZip(file, cut, uploadPath);
|
||||||
|
OtaBaSjSjmbcx mbcx = otaBaSjSjmbcxService.parseFileList(fileList, "", cut);
|
||||||
|
String otaId = mbcx.getOtaId();
|
||||||
|
if (StringUtils.isNotEmpty(otaId)) {
|
||||||
|
otaBaSjSjmbclService.parseFileList(fileList, otaId, cut);
|
||||||
|
otaBaCxAqcsService.parseFileList(fileList, otaId, cut);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new JeroBootException("导入失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportData(String otaId, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+58
-2
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.modules.ota.entity.*;
|
import com.jero.modules.ota.entity.*;
|
||||||
import com.jero.modules.ota.enums.OtaModuleEnum;
|
import com.jero.modules.ota.enums.OtaModuleEnum;
|
||||||
import com.jero.modules.ota.mapper.OtaBaSjSjmbclMapper;
|
import com.jero.modules.ota.mapper.OtaBaSjSjmbclMapper;
|
||||||
@@ -9,17 +10,28 @@ import com.jero.modules.ota.service.IOtaBaSjListService;
|
|||||||
import com.jero.modules.ota.service.IOtaBaSjLsjlService;
|
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.ota.utils.ComparisonUtil;
|
||||||
|
import com.jero.modules.ota.utils.ImportFileUtil;
|
||||||
import com.jero.modules.system.service.ISysDictService;
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级目标车辆
|
* @Description: 升级备案-升级目标车辆
|
||||||
@@ -30,6 +42,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
@Service
|
@Service
|
||||||
public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, OtaBaSjSjmbcl> implements IOtaBaSjSjmbclService {
|
public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, OtaBaSjSjmbcl> implements IOtaBaSjSjmbclService {
|
||||||
|
|
||||||
|
@Value(value = "${ota.templatePath}")
|
||||||
|
private String templatePath;
|
||||||
|
|
||||||
|
@Value(value = "${ota.uploadPath}")
|
||||||
|
private String uploadPath;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictService sysDictService;
|
private ISysDictService sysDictService;
|
||||||
@@ -59,7 +76,7 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
|
|||||||
if (ObjectUtils.isEmpty(otaBaSjSjmbclOld)) {
|
if (ObjectUtils.isEmpty(otaBaSjSjmbclOld)) {
|
||||||
otaBaSjSjmbclOld = new OtaBaSjSjmbcl();
|
otaBaSjSjmbclOld = new OtaBaSjSjmbcl();
|
||||||
}
|
}
|
||||||
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjmbcl.getOtaId(), OtaModuleEnum.CX_AQCS, otaBaSjSjmbclOld, otaBaSjSjmbcl, sysDictService);
|
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjmbcl.getOtaId(), OtaModuleEnum.SJ_SJMBCL, otaBaSjSjmbclOld, otaBaSjSjmbcl, sysDictService);
|
||||||
otaBaCxTxjlService.saveBatch(reList);
|
otaBaCxTxjlService.saveBatch(reList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,11 +148,50 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
private OtaBaSjSjmbcl getByOtaId(String otaId) {
|
private OtaBaSjSjmbcl getByOtaId(String otaId) {
|
||||||
if(StringUtils.isEmpty(otaId)){
|
if (StringUtils.isEmpty(otaId)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<OtaBaSjSjmbcl> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OtaBaSjSjmbcl> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(OtaBaSjSjmbcl::getOtaId, otaId);
|
queryWrapper.eq(OtaBaSjSjmbcl::getOtaId, otaId);
|
||||||
return this.getOne(queryWrapper, false);
|
return this.getOne(queryWrapper, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
ImportFileUtil.exportTemplate(response, templatePath + "本次升级涉及的目标车辆.zip");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjmbcl parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
|
||||||
|
File upFile = null;
|
||||||
|
for (File f : upLoadFiles) {
|
||||||
|
if (f.getName().equals("本次升级涉及的目标车辆.xlsx")) {
|
||||||
|
upFile = f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (null == upFile) {
|
||||||
|
throw new JeroBootException("请上传正确的文件");
|
||||||
|
}
|
||||||
|
OtaBaSjSjmbcl mbcl = parseFile(upFile, cut);
|
||||||
|
mbcl.setOtaId(otaId);
|
||||||
|
add(mbcl);
|
||||||
|
return mbcl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private OtaBaSjSjmbcl parseFile(File upFile, String cut) {
|
||||||
|
OtaBaSjSjmbcl mbcl = new OtaBaSjSjmbcl();
|
||||||
|
return mbcl;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjmbcl importData(MultipartFile file, String otaId, String cut) throws Exception {
|
||||||
|
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
|
||||||
|
OtaBaSjSjmbcl mbcl = parseFileList(upLoadFiles, otaId, cut);
|
||||||
|
return mbcl;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportData(File file, String otaId, String cut) throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+92
-1
@@ -1,24 +1,37 @@
|
|||||||
package com.jero.modules.ota.service.impl;
|
package com.jero.modules.ota.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.modules.ota.entity.*;
|
import com.jero.modules.ota.entity.*;
|
||||||
import com.jero.modules.ota.enums.OtaModuleEnum;
|
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.IOtaBaCxJbxxService;
|
||||||
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjListService;
|
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.ota.utils.ComparisonUtil;
|
||||||
|
import com.jero.modules.ota.utils.ImportFileUtil;
|
||||||
import com.jero.modules.system.service.ISysDictService;
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级目标车型
|
* @Description: 升级备案-升级目标车型
|
||||||
@@ -38,6 +51,16 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IOtaBaCxTxjlService otaBaCxTxjlService;
|
private IOtaBaCxTxjlService otaBaCxTxjlService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOtaBaCxJbxxService otaBaCxJbxxService;
|
||||||
|
|
||||||
|
@Value(value = "${ota.templatePath}")
|
||||||
|
private String templatePath;
|
||||||
|
|
||||||
|
@Value(value = "${ota.uploadPath}")
|
||||||
|
private String uploadPath;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -140,11 +163,79 @@ public class OtaBaSjSjmbcxServiceImpl extends ServiceImpl<OtaBaSjSjmbcxMapper, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
private OtaBaSjSjmbcx getByOtaId(String otaId) {
|
private OtaBaSjSjmbcx getByOtaId(String otaId) {
|
||||||
if(org.apache.commons.lang3.StringUtils.isEmpty(otaId)){
|
if (org.apache.commons.lang3.StringUtils.isEmpty(otaId)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<OtaBaSjSjmbcx> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OtaBaSjSjmbcx> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(OtaBaSjSjmbcx::getOtaId, otaId);
|
queryWrapper.eq(OtaBaSjSjmbcx::getOtaId, otaId);
|
||||||
return this.getOne(queryWrapper, false);
|
return this.getOne(queryWrapper, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
ImportFileUtil.exportTemplate(response, templatePath + "升级目标车型.zip");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjmbcx importData(MultipartFile file, String otaId, String cut) throws Exception {
|
||||||
|
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
|
||||||
|
OtaBaSjSjmbcx mbcx = parseFileList(upLoadFiles, otaId, cut);
|
||||||
|
return mbcx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjmbcx parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
|
||||||
|
File upFile = null;
|
||||||
|
for (File f : upLoadFiles) {
|
||||||
|
if (f.getName().equals("车型基本信息.xlsx")) {
|
||||||
|
upFile = f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (null == upFile) {
|
||||||
|
throw new JeroBootException("请上传正确的文件");
|
||||||
|
}
|
||||||
|
OtaBaSjSjmbcx mbcx = parseFile(upFile, cut);
|
||||||
|
mbcx.setOtaId(otaId);
|
||||||
|
add(mbcx);
|
||||||
|
return mbcx;
|
||||||
|
}
|
||||||
|
|
||||||
|
private OtaBaSjSjmbcx parseFile(File upFile, String cut) throws Exception {
|
||||||
|
OtaBaSjSjmbcx mbcx = new OtaBaSjSjmbcx();
|
||||||
|
Workbook wb = ImportFileUtil.readExcel(upFile);
|
||||||
|
Sheet s = wb.getSheetAt(0);
|
||||||
|
|
||||||
|
Row row = s.getRow(1);
|
||||||
|
Cell cell = row.getCell(2);
|
||||||
|
mbcx.setBabh(ImportFileUtil.getCellValue(cell, wb));
|
||||||
|
row = s.getRow(2);
|
||||||
|
cell = row.getCell(2);
|
||||||
|
mbcx.setQymc(ImportFileUtil.getCellValue(cell, wb));
|
||||||
|
|
||||||
|
row = s.getRow(3);
|
||||||
|
cell = row.getCell(2);
|
||||||
|
String pc = ImportFileUtil.getCellValue(cell, wb);
|
||||||
|
if (StringUtils.isEmpty(pc)) {
|
||||||
|
throw new JeroBootException("车型及功能备案《公告》批次不能为空");
|
||||||
|
}
|
||||||
|
//查找车型备案的同批次数据
|
||||||
|
LambdaQueryWrapper<OtaBaCxJbxx> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(OtaBaCxJbxx::getGgpc, pc);
|
||||||
|
OtaBaCxJbxx jbxx = otaBaCxJbxxService.getOne(queryWrapper, false);
|
||||||
|
if (ObjectUtils.isEmpty(jbxx)) {
|
||||||
|
throw new JeroBootException("车型及功能备案《公告》批次:" + jbxx + " 无法找到车型备案数据");
|
||||||
|
}
|
||||||
|
mbcx.setBapc(pc);
|
||||||
|
mbcx.setCpsb(jbxx.getCpsb());
|
||||||
|
mbcx.setCpmc(jbxx.getCpmc());
|
||||||
|
mbcx.setCpxh(jbxx.getCpxh());
|
||||||
|
mbcx.setDllx1(jbxx.getDllx1());
|
||||||
|
mbcx.setDllx2(jbxx.getDllx2());
|
||||||
|
return mbcx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportData(File file, String otaId, String cut) throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+54
-1
@@ -2,22 +2,30 @@ package com.jero.modules.ota.service.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.modules.ota.entity.*;
|
import com.jero.modules.ota.entity.*;
|
||||||
import com.jero.modules.ota.enums.OtaModuleEnum;
|
import com.jero.modules.ota.enums.OtaModuleEnum;
|
||||||
import com.jero.modules.ota.mapper.OtaBaSjSjyxpgMapper;
|
import com.jero.modules.ota.mapper.OtaBaSjSjyxpgMapper;
|
||||||
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
import com.jero.modules.ota.service.IOtaBaCxTxjlService;
|
||||||
import com.jero.modules.ota.service.IOtaBaSjSjyxpgService;
|
import com.jero.modules.ota.service.IOtaBaSjSjyxpgService;
|
||||||
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.system.service.ISysDictService;
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
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;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 升级备案-升级影响评估
|
* @Description: 升级备案-升级影响评估
|
||||||
@@ -35,6 +43,12 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IOtaBaCxTxjlService otaBaCxTxjlService;
|
private IOtaBaCxTxjlService otaBaCxTxjlService;
|
||||||
|
|
||||||
|
@Value(value = "${ota.templatePath}")
|
||||||
|
private String templatePath;
|
||||||
|
|
||||||
|
@Value(value = "${ota.uploadPath}")
|
||||||
|
private String uploadPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -128,11 +142,50 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
private OtaBaSjSjyxpg getByOtaId(String otaId) {
|
private OtaBaSjSjyxpg getByOtaId(String otaId) {
|
||||||
if(org.apache.commons.lang3.StringUtils.isEmpty(otaId)){
|
if (org.apache.commons.lang3.StringUtils.isEmpty(otaId)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<OtaBaSjSjyxpg> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OtaBaSjSjyxpg> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(OtaBaSjSjyxpg::getOtaId, otaId);
|
queryWrapper.eq(OtaBaSjSjyxpg::getOtaId, otaId);
|
||||||
return this.getOne(queryWrapper, false);
|
return this.getOne(queryWrapper, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportTemplate(HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
ImportFileUtil.exportTemplate(response, templatePath + "升级影响评估.zip");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjyxpg importData(MultipartFile file, String otaId, String cut) throws Exception {
|
||||||
|
List<File> upLoadFiles = ImportFileUtil.importZip(file, cut, uploadPath);
|
||||||
|
OtaBaSjSjyxpg sjyxpg = parseFileList(upLoadFiles, otaId, cut);
|
||||||
|
return sjyxpg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private OtaBaSjSjyxpg parseFile(File upFile, String cut) {
|
||||||
|
OtaBaSjSjyxpg sjyxpg = new OtaBaSjSjyxpg();
|
||||||
|
return sjyxpg;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OtaBaSjSjyxpg parseFileList(List<File> upLoadFiles, String otaId, String cut) throws Exception {
|
||||||
|
File upFile = null;
|
||||||
|
for (File f : upLoadFiles) {
|
||||||
|
if (f.getName().equals("车型基本信息.xlsx")) {
|
||||||
|
upFile = f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (null == upFile) {
|
||||||
|
throw new JeroBootException("请上传正确的文件");
|
||||||
|
}
|
||||||
|
OtaBaSjSjyxpg sjyxpg = parseFile(upFile, cut);
|
||||||
|
sjyxpg.setOtaId(otaId);
|
||||||
|
add(sjyxpg);
|
||||||
|
return sjyxpg;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportData(File file, String otaId, String cut) throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user