add 国内法规对接

This commit is contained in:
liao
2023-10-20 09:42:21 +08:00
parent c316029899
commit 3dbe5c8ce1
8 changed files with 535 additions and 25 deletions
@@ -0,0 +1,153 @@
package com.jero.modules.docking.asms.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
import com.jero.modules.docking.asms.service.ILawsAsmsDomesticService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
/**
* @Description: ASMS国内法规
* @Author: jero-boot
* @Date: 2023-10-20
* @Version: V1.0
*/
@Api(tags="ASMS国内法规")
@RestController
@RequestMapping("/docking/asms/lawsAsmsDomestic")
@Slf4j
public class LawsAsmsDomesticController extends JeroController<LawsAsmsDomestic, ILawsAsmsDomesticService> {
@Autowired
private ILawsAsmsDomesticService lawsAsmsDomesticService;
/**
* 分页列表查询
*
* @param lawsAsmsDomestic
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "ASMS国内法规-分页列表查询")
@ApiOperation(value="ASMS国内法规-分页列表查询", notes="ASMS国内法规-分页列表查询")
@GetMapping(value = "/page")
public Result<IPage<LawsAsmsDomestic>> queryPageList(LawsAsmsDomestic lawsAsmsDomestic,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
IPage<LawsAsmsDomestic> pageList = lawsAsmsDomesticService.queryPage(lawsAsmsDomestic, pageNo, pageSize, req);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @param lawsAsmsDomestic
* @param req
* @return
*/
@AutoLog(value = "ASMS国内法规-列表查询")
@ApiOperation(value="ASMS国内法规-列表查询", notes="ASMS国内法规-列表查询")
@GetMapping(value = "/list")
public Result<List<LawsAsmsDomestic>> queryList(LawsAsmsDomestic lawsAsmsDomestic, HttpServletRequest req) {
List<LawsAsmsDomestic> list = lawsAsmsDomesticService.queryList(lawsAsmsDomestic, req);
return Result.OK(list);
}
/**
* 添加
*
* @param lawsAsmsDomestic
* @return
*/
@AutoLog(value = "ASMS国内法规-添加")
@ApiOperation(value="ASMS国内法规-添加", notes="ASMS国内法规-添加")
@PostMapping(value = "/add")
public Result<T> add(@Validated @RequestBody LawsAsmsDomestic lawsAsmsDomestic) {
lawsAsmsDomesticService.add(lawsAsmsDomestic);
return Result.OK("操作成功!");
}
/**
* 编辑
*
* @param lawsAsmsDomestic
* @return
*/
@AutoLog(value = "ASMS国内法规-编辑")
@ApiOperation(value="ASMS国内法规-编辑", notes="ASMS国内法规-编辑")
@PostMapping(value = "/edit")
public Result<T> edit(@Validated @RequestBody LawsAsmsDomestic lawsAsmsDomestic) {
lawsAsmsDomesticService.editById(lawsAsmsDomestic);
return Result.OK("操作成功!");
}
/**
* 通过id删除
*
* @param map
* @return
*/
@AutoLog(value = "ASMS国内法规-通过id删除")
@ApiOperation(value="ASMS国内法规-通过id删除", notes="ASMS国内法规-通过id删除")
@PostMapping(value = "/delete")
public Result<T> delete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!");
}
lawsAsmsDomesticService.deleteById(map.get("id"));
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param map
* @return
*/
@AutoLog(value = "ASMS国内法规-批量删除")
@ApiOperation(value="ASMS国内法规-批量删除", notes="ASMS国内法规-批量删除")
@PostMapping(value = "/deleteBatch")
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
return Result.error("请选择数据!");
}
this.lawsAsmsDomesticService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "ASMS国内法规-通过id查询")
@ApiOperation(value="ASMS国内法规-通过id查询", notes="ASMS国内法规-通过id查询")
@GetMapping(value = "/queryById")
public Result<LawsAsmsDomestic> queryById(@RequestParam(name="id") String id) {
LawsAsmsDomestic lawsAsmsDomestic = lawsAsmsDomesticService.queryById(id);
if(lawsAsmsDomestic==null) {
return Result.error("未找到对应数据");
}
return Result.OK(lawsAsmsDomestic);
}
}
@@ -0,0 +1,143 @@
package com.jero.modules.docking.asms.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* @Description: ASMS国内法规
* @Author: jero-boot
* @Date: 2023-10-20
* @Version: V1.0
*/
@Data
@TableName("laws_asms_domestic")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="laws_asms_domestic对象", description="ASMS国内法规")
public class LawsAsmsDomestic implements Serializable {
private static final long serialVersionUID = 1L;
/**主键ID*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键ID")
private java.lang.String id;
/**标准法规编号/标准号*/
@Excel(name = "标准法规编号/标准号", width = 15)
@ApiModelProperty(value = "标准法规编号/标准号")
private java.lang.String code;
/**标准法规名称/标准名称*/
@Excel(name = "标准法规名称/标准名称", width = 15)
@ApiModelProperty(value = "标准法规名称/标准名称")
private java.lang.String name;
/**法规英文名称*/
@Excel(name = "法规英文名称", width = 15)
@ApiModelProperty(value = "法规英文名称")
private java.lang.String englishName;
/**标准法规类别/标准类别*/
@Excel(name = "标准法规类别/标准类别", width = 15)
@ApiModelProperty(value = "标准法规类别/标准类别")
private java.lang.String type;
/**适用认证*/
@Excel(name = "适用认证", width = 15)
@ApiModelProperty(value = "适用认证")
private java.lang.String applicableCertificationListString;
/**适用车型拼接名称*/
@Excel(name = "适用车型拼接名称", width = 15)
@ApiModelProperty(value = "适用车型拼接名称")
private java.lang.String applicableModelsListString;
/**采标程度*/
@Excel(name = "采标程度", width = 15)
@ApiModelProperty(value = "采标程度")
private java.lang.String degreeAdoption;
/**起草人*/
@Excel(name = "起草人", width = 15)
@ApiModelProperty(value = "起草人")
private java.lang.String draftingPeople;
/**起草单位*/
@Excel(name = "起草单位", width = 15)
@ApiModelProperty(value = "起草单位")
private java.lang.String draftingUnit;
/**标准领域名称*/
@Excel(name = "标准领域名称", width = 15)
@ApiModelProperty(value = "标准领域名称")
private java.lang.String focalPointName;
/**实施日期*/
@Excel(name = "实施日期", width = 15)
@ApiModelProperty(value = "实施日期")
private java.lang.String implementationDate;
/**采用国际标准号*/
@Excel(name = "采用国际标准号", width = 15)
@ApiModelProperty(value = "采用国际标准号")
private java.lang.String internationalStandard;
/**新车实施日期*/
@Excel(name = "新车实施日期", width = 15)
@ApiModelProperty(value = "新车实施日期")
private java.lang.String newCarImplementationDate;
/**新注册车实施日期*/
@Excel(name = "新注册车实施日期", width = 15)
@ApiModelProperty(value = "新注册车实施日期")
private java.lang.String newRegisterCarImplementationDate;
/**动力类型*/
@Excel(name = "动力类型", width = 15)
@ApiModelProperty(value = "动力类型")
private java.lang.String powerTypeListString;
/**在产车实施日期*/
@Excel(name = "在产车实施日期", width = 15)
@ApiModelProperty(value = "在产车实施日期")
private java.lang.String productionCarImplementationDate;
/**提出部门*/
@Excel(name = "提出部门", width = 15)
@ApiModelProperty(value = "提出部门")
private java.lang.String proposingDepartment;
/**发布日期*/
@Excel(name = "发布日期", width = 15)
@ApiModelProperty(value = "发布日期")
private java.lang.String publishDate;
/**代替标准号*/
@Excel(name = "代替标准号", width = 15)
@ApiModelProperty(value = "代替标准号")
private java.lang.String replaceCode;
/**适用范围*/
@Excel(name = "适用范围", width = 15)
@ApiModelProperty(value = "适用范围")
private java.lang.String scopeApplication;
/**标准性质*/
@Excel(name = "标准性质", width = 15)
@ApiModelProperty(value = "标准性质")
private java.lang.String standardNature;
/**标准状态*/
@Excel(name = "标准状态", width = 15)
@ApiModelProperty(value = "标准状态")
private java.lang.String standardStatus;
/**分标委*/
@Excel(name = "分标委", width = 15)
@ApiModelProperty(value = "分标委")
private java.lang.String subcommittee;
/**创建时间*/
@ApiModelProperty(value = "创建时间")
private java.lang.String createTime;
/**更新时间*/
@ApiModelProperty(value = "更新时间")
private java.lang.String updateTime;
/**同步标识*/
@Excel(name = "同步标识", width = 15)
@ApiModelProperty(value = "同步标识")
@Dict(dicCode = "sync_flag")
private java.lang.String syncFlag;
}
@@ -0,0 +1,17 @@
package com.jero.modules.docking.asms.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: ASMS国内法规
* @Author: jero-boot
* @Date: 2023-10-20
* @Version: V1.0
*/
public interface LawsAsmsDomesticMapper extends BaseMapper<LawsAsmsDomestic> {
}
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.modules.docking.asms.mapper.LawsAsmsDomesticMapper">
<resultMap id="LawsAsmsDomesticResultMap" type="com.jero.modules.docking.asms.entity.LawsAsmsDomestic">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="english_name" property="englishName" />
<result column="type" property="type" />
<result column="applicable_certification_list_string" property="applicableCertificationListString" />
<result column="applicable_models_list_string" property="applicableModelsListString" />
<result column="degree_adoption" property="degreeAdoption" />
<result column="drafting_people" property="draftingPeople" />
<result column="drafting_unit" property="draftingUnit" />
<result column="focal_point_name" property="focalPointName" />
<result column="implementation_date" property="implementationDate" />
<result column="international_standard" property="internationalStandard" />
<result column="new_car_implementation_date" property="newCarImplementationDate" />
<result column="new_register_car_implementation_date" property="newRegisterCarImplementationDate" />
<result column="power_type_list_string" property="powerTypeListString" />
<result column="production_car_implementation_date" property="productionCarImplementationDate" />
<result column="proposing_department" property="proposingDepartment" />
<result column="publish_date" property="publishDate" />
<result column="replace_code" property="replaceCode" />
<result column="scope_application" property="scopeApplication" />
<result column="standard_nature" property="standardNature" />
<result column="standard_status" property="standardStatus" />
<result column="subcommittee" property="subcommittee" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="sync_flag" property="syncFlag" />
</resultMap>
</mapper>
@@ -1,9 +0,0 @@
package com.jero.modules.docking.asms.service;
/**
* @Author: liao
* @Date: 2023/10/17 14:51
* @Description: 汽车标准数字化化平台ASMS
*/
public interface IAsmsOpenApi {
}
@@ -0,0 +1,76 @@
package com.jero.modules.docking.asms.service;
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* @Description: ASMS国内法规
* @Author: jero-boot
* @Date: 2023-10-20
* @Version: V1.0
*/
public interface ILawsAsmsDomesticService extends IService<LawsAsmsDomestic> {
/**
* 分页查询
*
* @param lawsAsmsDomestic
* @param pageNo
* @param pageSize
* @param req
* @return
*/
IPage<LawsAsmsDomestic> queryPage(LawsAsmsDomestic lawsAsmsDomestic, Integer pageNo, Integer pageSize, HttpServletRequest req);
/**
* 列表查询
*
* @param lawsAsmsDomestic
* @param req
* @return
*/
List<LawsAsmsDomestic> queryList(LawsAsmsDomestic lawsAsmsDomestic, HttpServletRequest req);
/**
* 保存
*
* @param lawsAsmsDomestic
* @return
*/
void add(LawsAsmsDomestic lawsAsmsDomestic);
/**
* 更新
*
* @param lawsAsmsDomestic
* @return
*/
void editById(LawsAsmsDomestic lawsAsmsDomestic);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
LawsAsmsDomestic queryById(String id);
}
@@ -1,16 +0,0 @@
package com.jero.modules.docking.asms.service.impl;
import com.jero.modules.docking.asms.service.IAsmsOpenApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Author: liao
* @Date: 2023/10/17 14:52
* @Description: 汽车标准数字化化平台ASMS
*/
@Service
@Slf4j
public class AsmsOpenApiImpl implements IAsmsOpenApi {
}
@@ -0,0 +1,113 @@
package com.jero.modules.docking.asms.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
import com.jero.modules.docking.asms.mapper.LawsAsmsDomesticMapper;
import com.jero.modules.docking.asms.service.ILawsAsmsDomesticService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jero.common.exception.JeroBootException;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.system.query.QueryGenerator;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* @Description: ASMS国内法规
* @Author: jero-boot
* @Date: 2023-10-20
* @Version: V1.0
*/
@Service
@Transactional(rollbackFor = JeroBootException.class)
public class LawsAsmsDomesticServiceImpl extends ServiceImpl<LawsAsmsDomesticMapper, LawsAsmsDomestic> implements ILawsAsmsDomesticService {
/**
* 分页查询
*
* @param lawsAsmsDomestic
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@Override
public IPage<LawsAsmsDomestic> queryPage(LawsAsmsDomestic lawsAsmsDomestic, Integer pageNo, Integer pageSize,
HttpServletRequest req) {
QueryWrapper<LawsAsmsDomestic> queryWrapper = QueryGenerator.initQueryWrapper(lawsAsmsDomestic, req.getParameterMap());
Page<LawsAsmsDomestic> page = new Page<>(pageNo, pageSize);
return page(page, queryWrapper);
}
/**
* 列表查询
*
* @param lawsAsmsDomestic
* @param req
* @return
*/
@Override
public List<LawsAsmsDomestic> queryList(LawsAsmsDomestic lawsAsmsDomestic, HttpServletRequest req) {
return list(QueryGenerator.initQueryWrapper(lawsAsmsDomestic, req.getParameterMap()));
}
/**
* 保存
*
* @param lawsAsmsDomestic
* @return
*/
@Override
public void add(LawsAsmsDomestic lawsAsmsDomestic) {
save(lawsAsmsDomestic);
}
/**
* 更新
*
* @param lawsAsmsDomestic
* @return
*/
@Override
public void editById(LawsAsmsDomestic lawsAsmsDomestic) {
saveOrUpdate(lawsAsmsDomestic);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public LawsAsmsDomestic queryById(String id) {
return getById(id);
}
}