开发OTA备案工具-导入导出

This commit is contained in:
高嵩
2023-03-27 23:48:13 +08:00
parent d879bd1e9b
commit f23fb9e9db
2 changed files with 141 additions and 139 deletions
@@ -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.OtaBaCxLsjl; import com.jero.modules.ota.entity.OtaBaCxLsjl;
@@ -22,13 +23,13 @@ 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/otaBaCxLsjl") @RequestMapping("/ota/otaBaCxLsjl")
@Slf4j @Slf4j
@@ -46,11 +47,11 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
* @return * @return
*/ */
@AutoLog(value = "车型备案-历史记录-分页列表查询") @AutoLog(value = "车型备案-历史记录-分页列表查询")
@ApiOperation(value="车型备案-历史记录-分页列表查询", notes="车型备案-历史记录-分页列表查询") @ApiOperation(value = "车型备案-历史记录-分页列表查询", notes = "车型备案-历史记录-分页列表查询")
@GetMapping(value = "/page") @GetMapping(value = "/page")
public Result<?> queryPageList(OtaBaCxLsjl otaBaCxLsjl, public Result<?> queryPageList(OtaBaCxLsjl otaBaCxLsjl,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<OtaBaCxLsjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxLsjl, req.getParameterMap()); QueryWrapper<OtaBaCxLsjl> queryWrapper = QueryGenerator.initQueryWrapper(otaBaCxLsjl, req.getParameterMap());
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("create_time");
@@ -65,10 +66,10 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
* @return * @return
*/ */
@AutoLog(value = "车型备案-历史记录-列表查询") @AutoLog(value = "车型备案-历史记录-列表查询")
@ApiOperation(value="车型备案-历史记录-列表查询", notes="车型备案-历史记录-列表查询") @ApiOperation(value = "车型备案-历史记录-列表查询", notes = "车型备案-历史记录-列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<List<OtaBaCxLsjl>> queryList() { public Result<List<OtaBaCxLsjl>> queryList() {
List<OtaBaCxLsjl> list = otaBaCxLsjlService.queryList(); List<OtaBaCxLsjl> list = otaBaCxLsjlService.list();
return Result.OK(list); return Result.OK(list);
} }
@@ -79,7 +80,7 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
* @return * @return
*/ */
@AutoLog(value = "车型备案-历史记录-添加") @AutoLog(value = "车型备案-历史记录-添加")
@ApiOperation(value="车型备案-历史记录-添加", notes="车型备案-历史记录-添加") @ApiOperation(value = "车型备案-历史记录-添加", notes = "车型备案-历史记录-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OtaBaCxLsjl otaBaCxLsjl) { public Result<?> add(@Validated @RequestBody OtaBaCxLsjl otaBaCxLsjl) {
otaBaCxLsjlService.add(otaBaCxLsjl); otaBaCxLsjlService.add(otaBaCxLsjl);
@@ -93,7 +94,7 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
* @return * @return
*/ */
@AutoLog(value = "车型备案-历史记录-编辑") @AutoLog(value = "车型备案-历史记录-编辑")
@ApiOperation(value="车型备案-历史记录-编辑", notes="车型备案-历史记录-编辑") @ApiOperation(value = "车型备案-历史记录-编辑", notes = "车型备案-历史记录-编辑")
@PutMapping(value = "/edit") @PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody OtaBaCxLsjl otaBaCxLsjl) { public Result<?> edit(@Validated @RequestBody OtaBaCxLsjl otaBaCxLsjl) {
otaBaCxLsjlService.editById(otaBaCxLsjl); otaBaCxLsjlService.editById(otaBaCxLsjl);
@@ -107,9 +108,9 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
* @return * @return
*/ */
@AutoLog(value = "车型备案-历史记录-通过id删除") @AutoLog(value = "车型备案-历史记录-通过id删除")
@ApiOperation(value="车型备案-历史记录-通过id删除", notes="车型备案-历史记录-通过id删除") @ApiOperation(value = "车型备案-历史记录-通过id删除", notes = "车型备案-历史记录-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) { public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
otaBaCxLsjlService.deleteById(id); otaBaCxLsjlService.deleteById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
@@ -121,9 +122,9 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
* @return * @return
*/ */
@AutoLog(value = "车型备案-历史记录-批量删除") @AutoLog(value = "车型备案-历史记录-批量删除")
@ApiOperation(value="车型备案-历史记录-批量删除", notes="车型备案-历史记录-批量删除") @ApiOperation(value = "车型备案-历史记录-批量删除", notes = "车型备案-历史记录-批量删除")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.otaBaCxLsjlService.deleteByIds(Arrays.asList(ids.split(","))); this.otaBaCxLsjlService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
@@ -135,11 +136,11 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
* @return * @return
*/ */
@AutoLog(value = "车型备案-历史记录-通过id查询") @AutoLog(value = "车型备案-历史记录-通过id查询")
@ApiOperation(value="车型备案-历史记录-通过id查询", notes="车型备案-历史记录-通过id查询") @ApiOperation(value = "车型备案-历史记录-通过id查询", notes = "车型备案-历史记录-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
OtaBaCxLsjl otaBaCxLsjl = otaBaCxLsjlService.queryById(id); OtaBaCxLsjl otaBaCxLsjl = otaBaCxLsjlService.queryById(id);
if(otaBaCxLsjl==null) { if (otaBaCxLsjl == null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
return Result.OK(otaBaCxLsjl); return Result.OK(otaBaCxLsjl);
@@ -152,11 +153,11 @@ public class OtaBaCxLsjlController extends JeroController<OtaBaCxLsjl, IOtaBaCxL
* @return * @return
*/ */
@AutoLog(value = "车型备案-历史记录-通过otaId查询") @AutoLog(value = "车型备案-历史记录-通过otaId查询")
@ApiOperation(value="车型备案-历史记录-通过otaId查询", notes="车型备案-历史记录-通过otaId查询") @ApiOperation(value = "车型备案-历史记录-通过otaId查询", notes = "车型备案-历史记录-通过otaId查询")
@GetMapping(value = "/queryByOtaId") @GetMapping(value = "/queryByOtaId")
public Result<?> queryByOtaId(@RequestParam(name="otaId",required=true) String otaId) { public Result<?> queryByOtaId(@RequestParam(name = "otaId", required = true) String otaId) {
List<OtaBaCxLsjl> otaBaCxLsjlList = otaBaCxLsjlService.queryByOtaId(otaId); List<OtaBaCxLsjl> otaBaCxLsjlList = otaBaCxLsjlService.queryByOtaId(otaId);
if(otaBaCxLsjlList==null) { if (otaBaCxLsjlList == null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
return Result.OK(otaBaCxLsjlList); return Result.OK(otaBaCxLsjlList);
@@ -93,6 +93,7 @@ public class OtaBaCxLsjlServiceImpl extends ServiceImpl<OtaBaCxLsjlMapper, OtaBa
public List<OtaBaCxLsjl> queryByOtaId(String otaId) { public List<OtaBaCxLsjl> queryByOtaId(String otaId) {
LambdaQueryWrapper<OtaBaCxLsjl> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OtaBaCxLsjl> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OtaBaCxLsjl::getOtaId, otaId); queryWrapper.eq(OtaBaCxLsjl::getOtaId, otaId);
queryWrapper.orderByDesc(OtaBaCxLsjl::getCreateTime);
List<OtaBaCxLsjl> res = this.list(queryWrapper); List<OtaBaCxLsjl> res = this.list(queryWrapper);
return res; return res;
} }