add:国内整车型号及VIN库部分代码;法规释疑库代码
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.common;
|
||||||
|
|
||||||
|
public interface Constant {
|
||||||
|
|
||||||
|
String TAKE_EFFECT = "1";
|
||||||
|
|
||||||
|
String ABOLISH = "2";
|
||||||
|
|
||||||
|
String FUEL_OIL = "1";
|
||||||
|
|
||||||
|
String HYBRID_POWER = "2";
|
||||||
|
|
||||||
|
String PURE_ELECTRIC = "3";
|
||||||
|
|
||||||
|
}
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.controller;
|
||||||
|
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
|
import com.jero.modules.activiti.process.vehicledomestic.service.IProcessVehicleDomesticReleaseService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号和VIN前八位管控流程 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/process/vehicle/domestic")
|
||||||
|
public class ProcessVehicleDomesticReleaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IProcessVehicleDomesticReleaseService processVehicleDomesticReleaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据能源类型导出模板
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "国内整车型号和VIN前八位管控流程-根据能源类型导出模板")
|
||||||
|
@ApiOperation(value="国内整车型号和VIN前八位管控流程-根据能源类型导出模板", notes="国内整车型号和VIN前八位管控流程-根据能源类型导出模板")
|
||||||
|
@GetMapping(value = "/exportTemplateByType")
|
||||||
|
// @RequiresPermissions("clubManagement:clubManagement:import")
|
||||||
|
public ModelAndView exportTemplateByType(HttpServletRequest request) {
|
||||||
|
return processVehicleDomesticReleaseService.exportTemplateByType(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "国内整车型号和VIN前八位管控流程-导入")
|
||||||
|
@ApiOperation(value="国内整车型号和VIN前八位管控流程-导入", notes="国内整车型号和VIN前八位管控流程-导入")
|
||||||
|
@PostMapping(value = "/importExcel")
|
||||||
|
// @RequiresPermissions("clubManagement:clubManagement:import")
|
||||||
|
public Result<?> excelimport(HttpServletRequest request) {
|
||||||
|
return processVehicleDomesticReleaseService.importExcel(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号和VIN前八位管控流程
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("process_vehicle_domestic_release")
|
||||||
|
@ApiModel(value="ProcessVehicleDomesticRelease对象", description="国内整车型号和VIN前八位管控流程")
|
||||||
|
public class ProcessVehicleDomesticRelease implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "流程实例Id")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "整车型号id")
|
||||||
|
private String vehicleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "抄送人员")
|
||||||
|
private String copyUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0表示流程未完成,1表示流程已完成")
|
||||||
|
private Integer isFinish;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.jero.modules.activiti.process.vehicledomestic.entity.ProcessVehicleDomesticRelease;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号和VIN前八位管控流程 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
public interface ProcessVehicleDomesticReleaseMapper extends BaseMapper<ProcessVehicleDomesticRelease> {
|
||||||
|
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.activiti.process.vehicledomestic.mapper.ProcessVehicleDomesticReleaseMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.modules.activiti.process.vehicledomestic.entity.ProcessVehicleDomesticRelease;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号和VIN前八位管控流程 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
public interface IProcessVehicleDomesticReleaseService extends IService<ProcessVehicleDomesticRelease> {
|
||||||
|
|
||||||
|
ModelAndView exportTemplateByType(HttpServletRequest request);
|
||||||
|
|
||||||
|
Result<?> importExcel(HttpServletRequest request);
|
||||||
|
}
|
||||||
+384
@@ -0,0 +1,384 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
|
import com.jero.common.util.ImportExcelUtil;
|
||||||
|
import com.jero.modules.activiti.process.vehicledomestic.common.Constant;
|
||||||
|
import com.jero.modules.activiti.process.vehicledomestic.entity.ProcessVehicleDomesticRelease;
|
||||||
|
import com.jero.modules.activiti.process.vehicledomestic.mapper.ProcessVehicleDomesticReleaseMapper;
|
||||||
|
import com.jero.modules.activiti.process.vehicledomestic.service.IProcessVehicleDomesticReleaseService;
|
||||||
|
import com.jero.modules.activiti.process.vehicledomestic.vo.excel.*;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号和VIN前八位管控流程 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProcessVehicleDomesticReleaseServiceImpl extends ServiceImpl<ProcessVehicleDomesticReleaseMapper, ProcessVehicleDomesticRelease> implements IProcessVehicleDomesticReleaseService {
|
||||||
|
|
||||||
|
|
||||||
|
private static final String NEWLINE_CHARACTER = "</br>";
|
||||||
|
private static final String ENERGY_TYPE = "energyType";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelAndView exportTemplateByType(HttpServletRequest request) {
|
||||||
|
String energyType = request.getParameter(ENERGY_TYPE);
|
||||||
|
if (StringUtils.isBlank(energyType)) {
|
||||||
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, ENERGY_TYPE);
|
||||||
|
}
|
||||||
|
// AutoPoi 导出Excel
|
||||||
|
ModelAndView modelAndView = new ModelAndView(new JeecgEntityExcelView());
|
||||||
|
// 设置文件名
|
||||||
|
modelAndView.addObject(JeroController.FILE_NAME, "国内整车型号及VIN前八位统计表.xls");
|
||||||
|
List<?> excelList;
|
||||||
|
// 根据 energyType 设置数据类型
|
||||||
|
if (Constant.FUEL_OIL.equals(energyType)) {
|
||||||
|
excelList = new ArrayList<>();
|
||||||
|
modelAndView.addObject(JeroController.CLASS, FuelOilExcel.class);
|
||||||
|
} else if (Constant.HYBRID_POWER.equals(energyType)) {
|
||||||
|
excelList = new ArrayList<>();
|
||||||
|
modelAndView.addObject(JeroController.CLASS, HybridPowerExcel.class);
|
||||||
|
} else {
|
||||||
|
excelList = new ArrayList<>();
|
||||||
|
modelAndView.addObject(JeroController.CLASS, PureElectricExcel.class);
|
||||||
|
}
|
||||||
|
// 设置导出参数
|
||||||
|
ExportParams exportParams = new ExportParams(null, "国内");
|
||||||
|
exportParams.setType(ExcelType.HSSF);
|
||||||
|
modelAndView.addObject(JeroController.PARAMS, exportParams);
|
||||||
|
// 将数据列表传递给 NormalExcelConstants.DATA_LIST
|
||||||
|
modelAndView.addObject(NormalExcelConstants.DATA_LIST, excelList);
|
||||||
|
return modelAndView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<?> importExcel(HttpServletRequest request) {
|
||||||
|
String energyType = request.getParameter(ENERGY_TYPE);
|
||||||
|
if (StringUtils.isBlank(energyType)) {
|
||||||
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, ENERGY_TYPE);
|
||||||
|
}
|
||||||
|
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||||
|
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||||
|
List<?> excelList = new ArrayList<>();
|
||||||
|
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||||
|
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||||
|
// 校验表头
|
||||||
|
excelHeadVerify(energyType, file);
|
||||||
|
try {
|
||||||
|
ImportParams params = new ImportParams();
|
||||||
|
params.setNeedSave(true);
|
||||||
|
params.setHeadRows(1);
|
||||||
|
excelList = getExcelData(energyType, file, params);
|
||||||
|
if (CollectionUtils.isEmpty(excelList)) {
|
||||||
|
throw new JeroBootException("没有数据可导入");
|
||||||
|
}
|
||||||
|
// 校验数据
|
||||||
|
StringBuilder msg = validatorExcel(energyType, excelList);
|
||||||
|
if (StringUtils.isNotEmpty(msg.toString())) {
|
||||||
|
return Result.error(msg.toString());
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
log.error(e.getMessage(),e);
|
||||||
|
return Result.error("文件导入失败:"+e.getMessage());
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
file.getInputStream().close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.OK(excelList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private StringBuilder validatorExcel(String energyType, List<?> excelList) {
|
||||||
|
StringBuilder msg;
|
||||||
|
if (Constant.FUEL_OIL.equals(energyType)) {
|
||||||
|
msg = validatorFuelOil(castList(excelList, FuelOilExcel.class));
|
||||||
|
} else if (Constant.HYBRID_POWER.equals(energyType)) {
|
||||||
|
msg = validatorHybridPower(castList(excelList, HybridPowerExcel.class));
|
||||||
|
} else {
|
||||||
|
msg = validatorPureElectric(castList(excelList, PureElectricExcel.class));
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> List<T> castList(List<?> list, Class<T> clazz) {
|
||||||
|
return list.stream()
|
||||||
|
.map(clazz::cast)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验燃油类型的字段
|
||||||
|
private StringBuilder validatorFuelOil(List<FuelOilExcel> excelList) {
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
|
for (int i = 0; i < excelList.size(); i++) {
|
||||||
|
FuelOilExcel fuelOilExcel = excelList.get(i);
|
||||||
|
StringBuilder msgSub = new StringBuilder();
|
||||||
|
// 校验通用字段
|
||||||
|
BaseExcel baseExcel = new BaseExcel();
|
||||||
|
BeanUtils.copyProperties(fuelOilExcel, baseExcel);
|
||||||
|
validateCommonFields(baseExcel, i, msgSub); // 不再赋值 msgSub
|
||||||
|
// 校验燃油类型的特有字段
|
||||||
|
OilAndHybridExcel oilAndHybridExcel = new OilAndHybridExcel();
|
||||||
|
BeanUtils.copyProperties(fuelOilExcel, oilAndHybridExcel);
|
||||||
|
validateOilAndHybridFields(oilAndHybridExcel, i , msgSub); // 不再赋值 msgSub
|
||||||
|
if (msgSub.length() > 0) {
|
||||||
|
msg.append(msgSub).append(NEWLINE_CHARACTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验纯电动类型的字段
|
||||||
|
private StringBuilder validatorPureElectric(List<PureElectricExcel> excelList) {
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
|
for (int i = 0; i < excelList.size(); i++) {
|
||||||
|
PureElectricExcel pureElectricExcel = excelList.get(i);
|
||||||
|
StringBuilder msgSub = new StringBuilder();
|
||||||
|
// 校验通用字段
|
||||||
|
BaseExcel baseExcel = new BaseExcel();
|
||||||
|
BeanUtils.copyProperties(pureElectricExcel, baseExcel);
|
||||||
|
validateCommonFields(baseExcel, i, msgSub);
|
||||||
|
// 校验纯电类型的特有字段
|
||||||
|
ElectricAndHybridExcel electricAndHybridExcel = new ElectricAndHybridExcel();
|
||||||
|
BeanUtils.copyProperties(pureElectricExcel, electricAndHybridExcel);
|
||||||
|
validateElectricAndHybridFields(electricAndHybridExcel, i , msgSub);
|
||||||
|
if (msgSub.length() > 0) {
|
||||||
|
msg.append(msgSub).append(NEWLINE_CHARACTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验混合动力类型的字段
|
||||||
|
private StringBuilder validatorHybridPower(List<HybridPowerExcel> excelList) {
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
|
for (int i = 0; i < excelList.size(); i++) {
|
||||||
|
HybridPowerExcel hybridPowerExcel = excelList.get(i);
|
||||||
|
StringBuilder msgSub = new StringBuilder();
|
||||||
|
// 校验通用字段
|
||||||
|
BaseExcel baseExcel = new BaseExcel();
|
||||||
|
BeanUtils.copyProperties(hybridPowerExcel, baseExcel);
|
||||||
|
validateCommonFields(baseExcel, i, msgSub);
|
||||||
|
// 校验混合动力类型的特有字段
|
||||||
|
OilAndHybridExcel oilAndHybridExcel = new OilAndHybridExcel();
|
||||||
|
BeanUtils.copyProperties(hybridPowerExcel, oilAndHybridExcel);
|
||||||
|
validateOilAndHybridFields(oilAndHybridExcel, i , msgSub);
|
||||||
|
ElectricAndHybridExcel electricAndHybridExcel = new ElectricAndHybridExcel();
|
||||||
|
BeanUtils.copyProperties(hybridPowerExcel, electricAndHybridExcel);
|
||||||
|
validateElectricAndHybridFields(electricAndHybridExcel, i , msgSub);
|
||||||
|
// 校验混合方式
|
||||||
|
if (StringUtils.isBlank(hybridPowerExcel.getMixedModel())) {
|
||||||
|
msgSub.append(getErrorMsg(i, "混合方式不能为空;"));
|
||||||
|
}
|
||||||
|
if (msgSub.length() > 0) {
|
||||||
|
msg.append(msgSub).append(NEWLINE_CHARACTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通用字段校验
|
||||||
|
private StringBuilder validateCommonFields(Object excelObject, int index, StringBuilder msgSub) {
|
||||||
|
// 车型代码(必填,下拉单选,来源BOM)
|
||||||
|
if (excelObject instanceof BaseExcel) {
|
||||||
|
BaseExcel baseModel = (BaseExcel) excelObject;
|
||||||
|
// 车型代码(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(baseModel.getVehicleTypeCode())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "车型代码不能为空;"));
|
||||||
|
}
|
||||||
|
// 动力类型(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(baseModel.getPowerType())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "动力类型不能为空;"));
|
||||||
|
}
|
||||||
|
// 车辆外廓尺寸(必填,手填,长度不超过50)
|
||||||
|
if (StringUtils.isBlank(baseModel.getCarOutSize())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "车辆外廓尺寸不能为空;"));
|
||||||
|
} else if (baseModel.getCarOutSize().length() > 50) {
|
||||||
|
msgSub.append(getErrorMsg(index, "车辆外廓尺寸长度不能超过50字符;"));
|
||||||
|
}
|
||||||
|
// 前后标牌(必填,手填,长度不超过50)
|
||||||
|
if (StringUtils.isBlank(baseModel.getAroundSignage())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "前后标牌不能为空;"));
|
||||||
|
} else if (baseModel.getAroundSignage().length() > 50) {
|
||||||
|
msgSub.append(getErrorMsg(index, "前后标牌长度不能超过50字符;"));
|
||||||
|
}
|
||||||
|
// 整备质量(教练车)(非必填,手填,数字格式,长度不超过50)
|
||||||
|
if (StringUtils.isNotBlank(baseModel.getVehicleQuality()) && baseModel.getVehicleQuality().length() > 50) {
|
||||||
|
msgSub.append(getErrorMsg(index, "整备质量长度不能超过50字符;"));
|
||||||
|
}
|
||||||
|
// 驱动型式(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(baseModel.getDrivingType())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "驱动型式不能为空;"));
|
||||||
|
}
|
||||||
|
// 车身形式(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(baseModel.getBodyType())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "车身形式不能为空;"));
|
||||||
|
}
|
||||||
|
// 燃料类型(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(baseModel.getFuelType())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "燃料类型不能为空;"));
|
||||||
|
}
|
||||||
|
// 前排正面气囊(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(baseModel.getFrontFrontAirbag())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "前排正面气囊不能为空;"));
|
||||||
|
}
|
||||||
|
// 前排座椅侧气囊(非必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(baseModel.getFrontSeatSideAirbags())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "前排座椅侧气囊不能为空;"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msgSub;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 燃油和混合动力共有字段校验
|
||||||
|
private StringBuilder validateOilAndHybridFields(Object excelObject, int index, StringBuilder msgSub) {
|
||||||
|
// 车型代码(必填,下拉单选,来源BOM)
|
||||||
|
if (excelObject instanceof OilAndHybridExcel) {
|
||||||
|
OilAndHybridExcel oilAndHybridExcel = (OilAndHybridExcel) excelObject;
|
||||||
|
// 发动机型号(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(oilAndHybridExcel.getEngineType())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "发动机型号不能为空;"));
|
||||||
|
}
|
||||||
|
// 变速器型式(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(oilAndHybridExcel.getTransmissionType())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "变速器型式不能为空;"));
|
||||||
|
}
|
||||||
|
// 变速器型号(必填,下拉多选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(oilAndHybridExcel.getTransmissionModel())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "变速器型号不能为空;"));
|
||||||
|
}
|
||||||
|
// 发动机排量(L)(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(oilAndHybridExcel.getEngineCapacity())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "发动机排量不能为空;"));
|
||||||
|
}
|
||||||
|
// 排放水平(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(oilAndHybridExcel.getEmissionLevel())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "排放水平不能为空;"));
|
||||||
|
}
|
||||||
|
// 油耗阶段(必填,下拉单选)
|
||||||
|
if (StringUtils.isBlank(oilAndHybridExcel.getFuelConsumptionStage())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "油耗阶段不能为空;"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msgSub;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 纯电动和混合动力共有字段验证
|
||||||
|
private StringBuilder validateElectricAndHybridFields(Object excelObject, int index, StringBuilder msgSub) {
|
||||||
|
// 车型代码(必填,下拉单选,来源BOM)
|
||||||
|
if (excelObject instanceof ElectricAndHybridExcel) {
|
||||||
|
ElectricAndHybridExcel electricAndHybridExcel = (ElectricAndHybridExcel) excelObject;
|
||||||
|
// 驱动电机型号(必填,下拉多选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getDriveMotorModel())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "驱动电机型号不能为空;"));
|
||||||
|
}
|
||||||
|
// 驱动电机峰值功率(必填,手填,长度不超过50)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getDriveMotorPeakPower())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "驱动电机峰值功率不能为空;"));
|
||||||
|
} else if (electricAndHybridExcel.getDriveMotorPeakPower().length() > 50) {
|
||||||
|
msgSub.append(getErrorMsg(index, "驱动电机峰值功率长度不能超过50字符;"));
|
||||||
|
}
|
||||||
|
// 驱动电机额定功率(必填,手填,长度不超过50)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getDriveMotorRatedPower())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "驱动电机额定功率不能为空;"));
|
||||||
|
} else if (electricAndHybridExcel.getDriveMotorRatedPower().length() > 50) {
|
||||||
|
msgSub.append(getErrorMsg(index, "驱动电机额定功率长度不能超过50字符;"));
|
||||||
|
}
|
||||||
|
// 驱动电机类型(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getDriveMotorType())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "驱动电机类型不能为空;"));
|
||||||
|
}
|
||||||
|
// 动力电池型号(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getPowerBatteryModel())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "动力电池型号不能为空;"));
|
||||||
|
}
|
||||||
|
// 电池类型(必填,下拉单选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getBatteryType())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "电池类型不能为空;"));
|
||||||
|
}
|
||||||
|
// 动力电池组标称电压(必填,手填,长度不超过50)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getPowerBatteryVoltage())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "动力电池组标称电压不能为空;"));
|
||||||
|
} else if (electricAndHybridExcel.getPowerBatteryVoltage().length() > 50) {
|
||||||
|
msgSub.append(getErrorMsg(index, "动力电池组标称电压长度不能超过50字符;"));
|
||||||
|
}
|
||||||
|
// 动力电池组总成标称容量(必填,手填,长度不超过50)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getPowerBatteryVolume())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "动力电池组总成标称容量不能为空;"));
|
||||||
|
} else if (electricAndHybridExcel.getPowerBatteryVolume().length() > 50) {
|
||||||
|
msgSub.append(getErrorMsg(index, "动力电池组总成标称容量长度不能超过50字符;"));
|
||||||
|
}
|
||||||
|
// 驱动电机的布置位置(必填,下拉多选,来源BOM)
|
||||||
|
if (StringUtils.isBlank(electricAndHybridExcel.getDriveMotorPlace())) {
|
||||||
|
msgSub.append(getErrorMsg(index, "驱动电机的布置位置不能为空;"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msgSub;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析excel数据
|
||||||
|
private List<?> getExcelData(String energyType, MultipartFile file, ImportParams params) throws Exception {
|
||||||
|
Class<?> clazz;
|
||||||
|
if (Constant.FUEL_OIL.equals(energyType)) {
|
||||||
|
clazz = FuelOilExcel.class;
|
||||||
|
} else if (Constant.HYBRID_POWER.equals(energyType)) {
|
||||||
|
clazz = HybridPowerExcel.class;
|
||||||
|
} else {
|
||||||
|
clazz = PureElectricExcel.class;
|
||||||
|
}
|
||||||
|
return ExcelImportUtil.importExcel(file.getInputStream(), clazz, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验表头
|
||||||
|
private void excelHeadVerify(String energyType, MultipartFile file) {
|
||||||
|
Class<?> clazz;
|
||||||
|
if (Constant.FUEL_OIL.equals(energyType)) {
|
||||||
|
clazz = FuelOilExcel.class;
|
||||||
|
} else if (Constant.HYBRID_POWER.equals(energyType)) {
|
||||||
|
clazz = HybridPowerExcel.class;
|
||||||
|
} else {
|
||||||
|
clazz = PureElectricExcel.class;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (!(boolean) ImportExcelUtil.checkTemplateTitle(file, clazz, 0, 0)){
|
||||||
|
throw new JeroBootException(ResultCommon.IMPORT_TEMPLATE_ERROR);
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new JeroBootException(ResultCommon.IMPORT_TEMPLATE_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getErrorMsg(int rowIndex, String errorMsg) {
|
||||||
|
return "第" + (rowIndex + 4) + "行" + errorMsg;
|
||||||
|
}
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.vo.excel;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出能源类型为传统燃油对应的excel模板
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BaseExcel {
|
||||||
|
|
||||||
|
@Excel(name = "车型代码", width = 20)
|
||||||
|
private String vehicleTypeCode;
|
||||||
|
|
||||||
|
@Excel(name = "动力类型", width = 20)
|
||||||
|
private String powerType;
|
||||||
|
|
||||||
|
@Excel(name = "车辆外廓尺寸(长*宽*高)", width = 20)
|
||||||
|
private String carOutSize;
|
||||||
|
|
||||||
|
@Excel(name = "前后标牌", width = 20)
|
||||||
|
private String aroundSignage;
|
||||||
|
|
||||||
|
@Excel(name = "整备质量(教练车)", width = 20)
|
||||||
|
private String vehicleQuality;
|
||||||
|
|
||||||
|
@Excel(name = "驱动型式", width = 20)
|
||||||
|
private String drivingType;
|
||||||
|
|
||||||
|
@Excel(name = "车身形式", width = 20)
|
||||||
|
private String bodyType;
|
||||||
|
|
||||||
|
@Excel(name = "燃料类型", width = 20)
|
||||||
|
private String fuelType;
|
||||||
|
|
||||||
|
@Excel(name = "前排正面气囊", width = 20)
|
||||||
|
private String frontFrontAirbag;
|
||||||
|
|
||||||
|
@Excel(name = "前排座椅侧气囊", width = 20)
|
||||||
|
private String frontSeatSideAirbags;
|
||||||
|
|
||||||
|
}
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.vo.excel;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ElectricAndHybridExcel {
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机型号", width = 20)
|
||||||
|
private String driveMotorModel;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机峰值功率(kw)", width = 20)
|
||||||
|
private String driveMotorPeakPower;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机额定功率(kw)", width = 20)
|
||||||
|
private String driveMotorRatedPower;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机类型", width = 20)
|
||||||
|
private String driveMotorType;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池型号", width = 20)
|
||||||
|
private String powerBatteryModel;
|
||||||
|
|
||||||
|
@Excel(name = "电池类型", width = 20)
|
||||||
|
private String batteryType;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池组标称电压", width = 20)
|
||||||
|
private String powerBatteryVoltage;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池组总成标称容量", width = 20)
|
||||||
|
private String powerBatteryVolume;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机的布置位置", width = 20)
|
||||||
|
private String driveMotorPlace;
|
||||||
|
|
||||||
|
}
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.vo.excel;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出能源类型为传统燃油对应的excel模板
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FuelOilExcel {
|
||||||
|
|
||||||
|
@Excel(name = "车型代码", width = 20)
|
||||||
|
private String vehicleTypeCode;
|
||||||
|
|
||||||
|
@Excel(name = "动力类型", width = 20)
|
||||||
|
private String powerType;
|
||||||
|
|
||||||
|
@Excel(name = "车辆外廓尺寸(长*宽*高)", width = 20)
|
||||||
|
private String carOutSize;
|
||||||
|
|
||||||
|
@Excel(name = "前后标牌", width = 20)
|
||||||
|
private String aroundSignage;
|
||||||
|
|
||||||
|
@Excel(name = "整备质量(教练车)", width = 20)
|
||||||
|
private String vehicleQuality;
|
||||||
|
|
||||||
|
@Excel(name = "驱动型式", width = 20)
|
||||||
|
private String drivingType;
|
||||||
|
|
||||||
|
@Excel(name = "车身形式", width = 20)
|
||||||
|
private String bodyType;
|
||||||
|
|
||||||
|
@Excel(name = "燃料类型", width = 20)
|
||||||
|
private String fuelType;
|
||||||
|
|
||||||
|
@Excel(name = "发动机型号", width = 20)
|
||||||
|
private String engineType;
|
||||||
|
|
||||||
|
@Excel(name = "变速器型式", width = 20)
|
||||||
|
private String transmissionType;
|
||||||
|
|
||||||
|
@Excel(name = "变速器型号", width = 20)
|
||||||
|
private String transmissionModel;
|
||||||
|
|
||||||
|
@Excel(name = "发动机排量(L)", width = 20)
|
||||||
|
private String engineCapacity;
|
||||||
|
|
||||||
|
@Excel(name = "排放水平", width = 20)
|
||||||
|
private String emissionLevel;
|
||||||
|
|
||||||
|
@Excel(name = "油耗阶段", width = 20)
|
||||||
|
private String fuelConsumptionStage;
|
||||||
|
|
||||||
|
@Excel(name = "前排正面气囊", width = 20)
|
||||||
|
private String frontFrontAirbag;
|
||||||
|
|
||||||
|
@Excel(name = "前排座椅侧气囊", width = 20)
|
||||||
|
private String frontSeatSideAirbags;
|
||||||
|
|
||||||
|
}
|
||||||
+90
@@ -0,0 +1,90 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.vo.excel;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出能源类型为纯电动对应的excel模板
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class HybridPowerExcel {
|
||||||
|
|
||||||
|
@Excel(name = "车型代码", width = 20)
|
||||||
|
private String vehicleTypeCode;
|
||||||
|
|
||||||
|
@Excel(name = "动力类型", width = 20)
|
||||||
|
private String powerType;
|
||||||
|
|
||||||
|
@Excel(name = "车辆外廓尺寸(长*宽*高)", width = 20)
|
||||||
|
private String carOutSize;
|
||||||
|
|
||||||
|
@Excel(name = "前后标牌", width = 20)
|
||||||
|
private String aroundSignage;
|
||||||
|
|
||||||
|
@Excel(name = "整备质量(教练车)", width = 20)
|
||||||
|
private String vehicleQuality;
|
||||||
|
|
||||||
|
@Excel(name = "驱动型式", width = 20)
|
||||||
|
private String drivingType;
|
||||||
|
|
||||||
|
@Excel(name = "车身形式", width = 20)
|
||||||
|
private String bodyType;
|
||||||
|
|
||||||
|
@Excel(name = "燃料类型", width = 20)
|
||||||
|
private String fuelType;
|
||||||
|
|
||||||
|
@Excel(name = "发动机型号", width = 20)
|
||||||
|
private String engineType;
|
||||||
|
|
||||||
|
@Excel(name = "变速器型式", width = 20)
|
||||||
|
private String transmissionType;
|
||||||
|
|
||||||
|
@Excel(name = "变速器型号", width = 20)
|
||||||
|
private String transmissionModel;
|
||||||
|
|
||||||
|
@Excel(name = "发动机排量(L)", width = 20)
|
||||||
|
private String engineCapacity;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机型号", width = 20)
|
||||||
|
private String driveMotorModel;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机峰值功率(kw)", width = 20)
|
||||||
|
private String driveMotorPeakPower;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机额定功率(kw)", width = 20)
|
||||||
|
private String driveMotorRatedPower;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机类型", width = 20)
|
||||||
|
private String driveMotorType;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池型号", width = 20)
|
||||||
|
private String powerBatteryModel;
|
||||||
|
|
||||||
|
@Excel(name = "电池类型", width = 20)
|
||||||
|
private String batteryType;
|
||||||
|
|
||||||
|
@Excel(name = "混合方式", width = 20)
|
||||||
|
private String mixedModel;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池组标称电压", width = 20)
|
||||||
|
private String powerBatteryVoltage;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池组总成标称容量", width = 20)
|
||||||
|
private String powerBatteryVolume;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机的布置位置", width = 20)
|
||||||
|
private String driveMotorPlace;
|
||||||
|
|
||||||
|
@Excel(name = "排放水平", width = 20)
|
||||||
|
private String emissionLevel;
|
||||||
|
|
||||||
|
@Excel(name = "油耗阶段", width = 20)
|
||||||
|
private String fuelConsumptionStage;
|
||||||
|
|
||||||
|
@Excel(name = "前排正面气囊", width = 20)
|
||||||
|
private String frontFrontAirbag;
|
||||||
|
|
||||||
|
@Excel(name = "前排座椅侧气囊", width = 20)
|
||||||
|
private String frontSeatSideAirbags;
|
||||||
|
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.vo.excel;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OilAndHybridExcel {
|
||||||
|
|
||||||
|
@Excel(name = "发动机型号", width = 20)
|
||||||
|
private String engineType;
|
||||||
|
|
||||||
|
@Excel(name = "变速器型式", width = 20)
|
||||||
|
private String transmissionType;
|
||||||
|
|
||||||
|
@Excel(name = "变速器型号", width = 20)
|
||||||
|
private String transmissionModel;
|
||||||
|
|
||||||
|
@Excel(name = "发动机排量(L)", width = 20)
|
||||||
|
private String engineCapacity;
|
||||||
|
|
||||||
|
@Excel(name = "排放水平", width = 20)
|
||||||
|
private String emissionLevel;
|
||||||
|
|
||||||
|
@Excel(name = "油耗阶段", width = 20)
|
||||||
|
private String fuelConsumptionStage;
|
||||||
|
}
|
||||||
+69
@@ -0,0 +1,69 @@
|
|||||||
|
package com.jero.modules.activiti.process.vehicledomestic.vo.excel;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出能源类型为混合动力对应的excel模板
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PureElectricExcel {
|
||||||
|
|
||||||
|
@Excel(name = "车型代码",width=20)
|
||||||
|
private String vehicleTypeCode;
|
||||||
|
|
||||||
|
@Excel(name = "动力类型",width=20)
|
||||||
|
private String powerType;
|
||||||
|
|
||||||
|
@Excel(name = "车辆外廓尺寸(长*宽*高)",width=20)
|
||||||
|
private String carOutSize;
|
||||||
|
|
||||||
|
@Excel(name = "前后标牌",width=20)
|
||||||
|
private String aroundSignage;
|
||||||
|
|
||||||
|
@Excel(name = "整备质量(教练车)",width=20)
|
||||||
|
private String vehicleQuality;
|
||||||
|
|
||||||
|
@Excel(name = "驱动型式",width=20)
|
||||||
|
private String drivingType;
|
||||||
|
|
||||||
|
@Excel(name = "车身形式",width=20)
|
||||||
|
private String bodyType;
|
||||||
|
|
||||||
|
@Excel(name = "燃料类型",width=20)
|
||||||
|
private String fuelType;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机型号",width=20)
|
||||||
|
private String driveMotorModel;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机峰值功率(kw)",width=20)
|
||||||
|
private String driveMotorPeakPower;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机额定功率(kw)",width=20)
|
||||||
|
private String driveMotorRatedPower;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机类型",width=20)
|
||||||
|
private String driveMotorType;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池型号",width=20)
|
||||||
|
private String powerBatteryModel;
|
||||||
|
|
||||||
|
@Excel(name = "电池类型",width=20)
|
||||||
|
private String batteryType;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池组标称电压",width=20)
|
||||||
|
private String powerBatteryVoltage;
|
||||||
|
|
||||||
|
@Excel(name = "动力电池组总成标称容量",width=20)
|
||||||
|
private String powerBatteryVolume;
|
||||||
|
|
||||||
|
@Excel(name = "驱动电机的布置位置",width=20)
|
||||||
|
private String driveMotorPlace;
|
||||||
|
|
||||||
|
@Excel(name = "前排正面气囊",width=20)
|
||||||
|
private String frontFrontAirbag;
|
||||||
|
|
||||||
|
@Excel(name = "前排座椅侧气囊",width=20)
|
||||||
|
private String frontSeatSideAirbags;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.common;
|
||||||
|
|
||||||
|
public interface Constant {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整车型号及vin前八位库-状态:现行
|
||||||
|
*/
|
||||||
|
String TAKE_EFFECT = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整车型号及vin前八位库-状态:废弃
|
||||||
|
*/
|
||||||
|
String ABOLISH = "2";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法规释疑库-发布状态:未发布
|
||||||
|
*/
|
||||||
|
String UN_PUBLISH = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法规释疑库-发布状态:已发布
|
||||||
|
*/
|
||||||
|
String PUBLISH = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法规释疑库-不是管理员
|
||||||
|
*/
|
||||||
|
String NOT_ADMIN = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法规释疑库-是管理员
|
||||||
|
*/
|
||||||
|
String IS_ADMIN = "1";
|
||||||
|
|
||||||
|
}
|
||||||
+96
@@ -0,0 +1,96 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
|
import com.jero.common.aspect.annotation.Translation;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
import com.jero.modules.laws.businessSupport.common.Constant;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsRegulationsQuestionLibrary;
|
||||||
|
import com.jero.modules.laws.businessSupport.service.ILawsRegulationsQuestionLibraryService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 法规释疑库表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-20
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("regulationsQuestion")
|
||||||
|
@Api(tags="法规释疑库表")
|
||||||
|
public class LawsRegulationsQuestionLibraryController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILawsRegulationsQuestionLibraryService lawsRegulationsQuestionLibraryService;
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "法规释疑库-分页列表查询")
|
||||||
|
@ApiOperation(value = "法规释疑库-分页列表查询", notes = "法规释疑库-分页列表查询")
|
||||||
|
@GetMapping(value = "/page")
|
||||||
|
@RequiresPermissions("legalClarificationDatabase:search")
|
||||||
|
public Result<IPage<LawsRegulationsQuestionLibrary>> queryPageList(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
IPage<LawsRegulationsQuestionLibrary> pageList = lawsRegulationsQuestionLibraryService.queryPage(lawsRegulationsQuestionLibrary, pageNo, pageSize);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "法规释疑库-保存")
|
||||||
|
@ApiOperation(value = "法规释疑库-保存", notes = "法规释疑库-保存")
|
||||||
|
@PostMapping(value = "/save")
|
||||||
|
@RequiresPermissions("legalClarificationDatabaseFormPage:save")
|
||||||
|
public Result<?> save(@RequestBody LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) {
|
||||||
|
// 第一次保存,附上初值
|
||||||
|
lawsRegulationsQuestionLibrary.setReleaseStatus(Constant.UN_PUBLISH); // 未发布
|
||||||
|
lawsRegulationsQuestionLibraryService.add(lawsRegulationsQuestionLibrary);
|
||||||
|
return Result.OK(ResultCommon.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "法规释疑库-发布")
|
||||||
|
@ApiOperation(value = "法规释疑库-发布", notes = "法规释疑库-发布")
|
||||||
|
@PostMapping(value = "/release")
|
||||||
|
@RequiresPermissions("legalClarificationDatabaseFormPage:release")
|
||||||
|
public Result<?> release(@RequestBody LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) {
|
||||||
|
// 不管第几次发布,发布时间都更新
|
||||||
|
lawsRegulationsQuestionLibrary.setReleaseTime(new Date());
|
||||||
|
lawsRegulationsQuestionLibrary.setReleaseStatus(Constant.PUBLISH);
|
||||||
|
lawsRegulationsQuestionLibraryService.add(lawsRegulationsQuestionLibrary);
|
||||||
|
return Result.OK(ResultCommon.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "法规释疑库-通过id删除")
|
||||||
|
@ApiOperation(value = "法规释疑库-通过id删除", notes = "法规释疑库-通过id删除")
|
||||||
|
@PostMapping(value = "/delete")
|
||||||
|
// @RequiresPermissions("legalClarificationDatabase:delete")
|
||||||
|
public Result<?> delete(@RequestBody @ApiParam(name = "id", value = "主键") JSONObject jsonObject) {
|
||||||
|
if (Objects.isNull(jsonObject) || StringUtils.isBlank(jsonObject.getString("id"))) {
|
||||||
|
throw new JeroBootException(ResultCommon.SELECT_DATA);
|
||||||
|
}
|
||||||
|
lawsRegulationsQuestionLibraryService.deleteById(jsonObject.getString("id"));
|
||||||
|
return Result.OK(ResultCommon.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "法规释疑库-通过id查询")
|
||||||
|
@ApiOperation(value = "法规释疑库-通过id查询", notes = "法规释疑库-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
@Translation
|
||||||
|
@RequiresPermissions("legalClarificationDatabase:view")
|
||||||
|
public Result<LawsRegulationsQuestionLibrary> queryById(@RequestParam(name = "id") @ApiParam("主键") String id) {
|
||||||
|
LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary = lawsRegulationsQuestionLibraryService.queryById(id);
|
||||||
|
return Result.OK(lawsRegulationsQuestionLibrary);
|
||||||
|
}
|
||||||
|
}
|
||||||
+86
@@ -0,0 +1,86 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsVehicleDomesticLibrary;
|
||||||
|
import com.jero.modules.laws.businessSupport.service.ILawsVehicleDomesticLibraryService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号及VIN前八位管控库 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@Api(tags="国内整车型号及VIN前八位管控库")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/vehicle/domestic")
|
||||||
|
@Slf4j
|
||||||
|
public class LawsVehicleDomesticLibraryController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILawsVehicleDomesticLibraryService lawsVehicleDomesticControlLibraryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "国内整车型号及VIN前八位管控库-分页列表查询")
|
||||||
|
@ApiOperation(value="国内整车型号及VIN前八位管控库-分页列表查询", notes="国内整车型号及VIN前八位管控库-分页列表查询")
|
||||||
|
@GetMapping(value = "/page")
|
||||||
|
// @RequiresPermissions("companyStandardStatistics:search")
|
||||||
|
public Result<?> queryPageList(LawsVehicleDomesticLibrary lawsVehicleDomesticLibrary,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
IPage<LawsVehicleDomesticLibrary> pageList= lawsVehicleDomesticControlLibraryService.queryPageList(lawsVehicleDomesticLibrary, pageNo, pageSize, req);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
*
|
||||||
|
* @param jsonObject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "国内整车型号及VIN前八位管控库-查看")
|
||||||
|
@ApiOperation(value="国内整车型号及VIN前八位管控库-查看", notes="国内整车型号及VIN前八位管控库-查看")
|
||||||
|
@PostMapping(value = "/queryOne")
|
||||||
|
// @RequiresPermissions("companyStandardStatistics:edit")
|
||||||
|
public Result<?> queryOne(@RequestBody JSONObject jsonObject) {
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
return lawsVehicleDomesticControlLibraryService.queryOne(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "国内整车型号及VIN前八位管控库-删除")
|
||||||
|
@ApiOperation(value="国内整车型号及VIN前八位管控库-删除", notes="国内整车型号及VIN前八位管控库-删除")
|
||||||
|
@PostMapping(value = "/delete")
|
||||||
|
// @RequiresPermissions("companyStandardStatistics:delete")
|
||||||
|
public Result<?> delete(@RequestBody JSONObject jsonObject) {
|
||||||
|
return lawsVehicleDomesticControlLibraryService.delete(jsonObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作废
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "国内整车型号及VIN前八位管控库-作废")
|
||||||
|
@ApiOperation(value="国内整车型号及VIN前八位管控库-作废", notes="国内整车型号及VIN前八位管控库-作废")
|
||||||
|
@PostMapping(value = "/abolish")
|
||||||
|
// @RequiresPermissions("companyStandardStatistics:delete")
|
||||||
|
public Result<?> abolish(@RequestBody JSONObject jsonObject) {
|
||||||
|
return lawsVehicleDomesticControlLibraryService.abolish(jsonObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号及VIN前八位管控库-子表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/laws-vehicle-domestic-library-sublist")
|
||||||
|
public class LawsVehicleDomesticLibrarySublistController {
|
||||||
|
|
||||||
|
}
|
||||||
+107
@@ -0,0 +1,107 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.jero.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 法规释疑库表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("laws_regulations_question_library")
|
||||||
|
@ApiModel(value="LawsRegulationsQuestionLibrary对象", description="法规释疑库表")
|
||||||
|
public class LawsRegulationsQuestionLibrary implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "问题提出专业模块")
|
||||||
|
@Dict(dicCode = "professional_module")
|
||||||
|
private String questionSpecializedModule;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准编号")
|
||||||
|
private String standardNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "条款号")
|
||||||
|
private String regulationNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "问题描述")
|
||||||
|
private String problemDescription;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复来源")
|
||||||
|
private String replySource;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复")
|
||||||
|
private String replyContent;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发布状态(0-未发布、1-已发布)")
|
||||||
|
@Dict(dicCode = "dynamic_news_status")
|
||||||
|
private String releaseStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发布时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date releaseTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "编辑人")
|
||||||
|
private String writer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||||
|
@TableLogic(value = "0", delval = "1")
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否可以编辑和删除")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean isEditAndRemove;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否管理员")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String isAdmin;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发布日期开始日期")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String releaseStartTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发布日期结束日期")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String releaseEndTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+124
@@ -0,0 +1,124 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号及VIN前八位管控库
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("laws_vehicle_domestic_library")
|
||||||
|
@ApiModel(value="LawsVehicleDomesticLibrary对象", description="整车型号及VIN前八位管控库-国内")
|
||||||
|
public class LawsVehicleDomesticLibrary implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "能源类型")
|
||||||
|
private String energyType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "整车型号")
|
||||||
|
private String vehicleModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "vin前八位")
|
||||||
|
private String vinTopEight;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "整车型号编制依据")
|
||||||
|
private String vehicleBasis;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "vin编制依据")
|
||||||
|
private String vinBasis;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "代替整车型号")
|
||||||
|
private String insteadVehicleModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请人")
|
||||||
|
private String applicant;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "完成日期")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date finishDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "法规工程师")
|
||||||
|
private String regulatoryEngineer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "逻辑删除")
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "车型代码")
|
||||||
|
private String vehicleTypeCode;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "子表数据")
|
||||||
|
private LawsVehicleDomesticLibrarySublist lawsVehicleDomesticLibrarySublist;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发动机型号")
|
||||||
|
private String engineType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变速器型式")
|
||||||
|
private String transmissionType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变速器型号")
|
||||||
|
private String transmissionModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发动机排量(L)")
|
||||||
|
private String engineCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排放水平")
|
||||||
|
private String emissionLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "油耗阶段")
|
||||||
|
private String fuelConsumptionStage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "前排正面气囊")
|
||||||
|
private String frontFrontAirbag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "前排座椅侧气囊")
|
||||||
|
private String frontSeatSideAirbags;
|
||||||
|
|
||||||
|
}
|
||||||
+140
@@ -0,0 +1,140 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号及VIN前八位管控库-子表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("laws_vehicle_domestic_library_sublist")
|
||||||
|
@ApiModel(value="LawsVehicleDomesticLibrarySublist对象", description="国内整车型号及VIN前八位管控库-子表")
|
||||||
|
public class LawsVehicleDomesticLibrarySublist implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "整车型号id")
|
||||||
|
private String vehicleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "车型代码")
|
||||||
|
private String vehicleTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "动力类型")
|
||||||
|
private String powerType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "车辆外廓尺寸(长*宽*高)")
|
||||||
|
private String carOutSize;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "前后标牌")
|
||||||
|
private String aroundSignage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "整备质量(教练车)")
|
||||||
|
private String vehicleQuality;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "驱动型式")
|
||||||
|
private String drivingType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "车身形式")
|
||||||
|
private String bodyType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "燃料类型")
|
||||||
|
private String fuelType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发动机型号")
|
||||||
|
private String engineType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变速器型式")
|
||||||
|
private String transmissionType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "变速器型号")
|
||||||
|
private String transmissionModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发动机排量(L)")
|
||||||
|
private String engineCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "驱动电机型号")
|
||||||
|
private String driveMotorModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "驱动电机峰值功率(kw)")
|
||||||
|
private String driveMotorPeakPower;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "驱动电机额定功率(kw)")
|
||||||
|
private String driveMotorRatedPower;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "驱动电机类型")
|
||||||
|
private String driveMotorType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "动力电池型号")
|
||||||
|
private String powerBatteryModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "电池类型")
|
||||||
|
private String batteryType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "混合方式")
|
||||||
|
private String mixedModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "动力电池组标称电压")
|
||||||
|
private String powerBatteryVoltage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "动力电池组总成标称容量")
|
||||||
|
private String powerBatteryVolume;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "驱动电机的布置位置")
|
||||||
|
private String driveMotorPlace;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排放水平")
|
||||||
|
private String emissionLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "油耗阶段")
|
||||||
|
private String fuelConsumptionStage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "前排正面气囊")
|
||||||
|
private String frontFrontAirbag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "前排座椅侧气囊")
|
||||||
|
private String frontSeatSideAirbags;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "逻辑删除")
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsRegulationsQuestionLibrary;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 法规释疑库表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-20
|
||||||
|
*/
|
||||||
|
public interface LawsRegulationsQuestionLibraryMapper extends BaseMapper<LawsRegulationsQuestionLibrary> {
|
||||||
|
|
||||||
|
IPage<LawsRegulationsQuestionLibrary> getPageList(Page<LawsRegulationsQuestionLibrary> page, @Param("param") LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary);
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsVehicleDomesticLibrary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 整车型号及VIN前八位管控库-国内 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
public interface LawsVehicleDomesticLibraryMapper extends BaseMapper<LawsVehicleDomesticLibrary> {
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsVehicleDomesticLibrarySublist;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号及VIN前八位管控库-子表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
public interface LawsVehicleDomesticLibrarySublistMapper extends BaseMapper<LawsVehicleDomesticLibrarySublist> {
|
||||||
|
|
||||||
|
}
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
<?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.laws.businessSupport.mapper.LawsRegulationsQuestionLibraryMapper">
|
||||||
|
|
||||||
|
<select id="getPageList" resultType="com.jero.modules.laws.businessSupport.entity.LawsRegulationsQuestionLibrary">
|
||||||
|
select * from laws_regulations_question_library
|
||||||
|
<where>
|
||||||
|
del_flag = 0
|
||||||
|
<if test="param.standardNumber != null and param.standardNumber != ''">
|
||||||
|
and standard_number like concat('%', #{param.standardNumber}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.regulationNumber != null and param.regulationNumber">
|
||||||
|
and regulation_number = #{param.regulationNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.questionSpecializedModule != null and param.questionSpecializedModule">
|
||||||
|
and question_specialized_module = #{param.questionSpecializedModule}
|
||||||
|
</if>
|
||||||
|
<if test="param.releaseStartTime != null">
|
||||||
|
AND release_time >= #{param.releaseStartTime}
|
||||||
|
</if>
|
||||||
|
<if test="param.releaseEndTime != null">
|
||||||
|
AND release_time <= #{param.releaseEndTime}
|
||||||
|
</if>
|
||||||
|
<!-- 非管理员用户只能查看发布状态为 1 的数据,并且发帖人可以查看自己的所有数据 -->
|
||||||
|
<if test="param.isAdmin == null or param.isAdmin == '1'">
|
||||||
|
and (writer = #{param.writer} or release_status = 1)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
<!-- 按 standard_number 排序 -->
|
||||||
|
order by standard_number asc, create_time desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.laws.businessSupport.mapper.LawsVehicleDomesticLibraryMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.laws.businessSupport.mapper.LawsVehicleDomesticLibrarySublistMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsRegulationsQuestionLibrary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 法规释疑库表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-20
|
||||||
|
*/
|
||||||
|
public interface ILawsRegulationsQuestionLibraryService extends IService<LawsRegulationsQuestionLibrary> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param lawsRegulationsQuestionLibrary
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<LawsRegulationsQuestionLibrary> queryPage(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary, Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
* @param lawsRegulationsQuestionLibrary
|
||||||
|
*/
|
||||||
|
void add(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void deleteById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LawsRegulationsQuestionLibrary queryById(String id);
|
||||||
|
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsVehicleDomesticLibrary;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 整车型号及VIN前八位管控库-国内 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
public interface ILawsVehicleDomesticLibraryService extends IService<LawsVehicleDomesticLibrary> {
|
||||||
|
|
||||||
|
IPage<LawsVehicleDomesticLibrary> queryPageList(LawsVehicleDomesticLibrary lawsVehicleDomesticLibrary, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||||
|
|
||||||
|
Result<?> queryOne(String id);
|
||||||
|
|
||||||
|
Result<?> delete(JSONObject jsonObject);
|
||||||
|
|
||||||
|
Result<?> abolish(JSONObject jsonObject);
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsVehicleDomesticLibrarySublist;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号及VIN前八位管控库-子表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
public interface ILawsVehicleDomesticLibrarySublistService extends IService<LawsVehicleDomesticLibrarySublist> {
|
||||||
|
|
||||||
|
}
|
||||||
+112
@@ -0,0 +1,112 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsRegulationsQuestionLibrary;
|
||||||
|
import com.jero.modules.laws.businessSupport.mapper.LawsRegulationsQuestionLibraryMapper;
|
||||||
|
import com.jero.modules.laws.businessSupport.service.ILawsRegulationsQuestionLibraryService;
|
||||||
|
import com.jero.modules.laws.common.constant.FieldCommon;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 法规释疑库表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
|
public class LawsRegulationsQuestionLibraryServiceImpl extends ServiceImpl<LawsRegulationsQuestionLibraryMapper, LawsRegulationsQuestionLibrary> implements ILawsRegulationsQuestionLibraryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LawsRegulationsQuestionLibraryMapper lawsRegulationsQuestionLibraryMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<LawsRegulationsQuestionLibrary> queryPage(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary, Integer pageNo, Integer pageSize) {
|
||||||
|
Page<LawsRegulationsQuestionLibrary> page = new Page<>(pageNo, pageSize);
|
||||||
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
lawsRegulationsQuestionLibrary.setWriter(loginUser.getId());
|
||||||
|
if (loginUser.getRoleIds().contains("admin")){
|
||||||
|
lawsRegulationsQuestionLibrary.setIsAdmin("1");
|
||||||
|
}
|
||||||
|
IPage<LawsRegulationsQuestionLibrary> pageList = lawsRegulationsQuestionLibraryMapper.getPageList(page, lawsRegulationsQuestionLibrary);
|
||||||
|
setResultData(pageList.getRecords());
|
||||||
|
return pageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) {
|
||||||
|
if (StringUtils.isBlank(lawsRegulationsQuestionLibrary.getQuestionSpecializedModule())) {
|
||||||
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "questionSpecializedModule");
|
||||||
|
}
|
||||||
|
// 判断是否拥有操作权限(管理员和编辑人拥有权限)
|
||||||
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
isHaveOperateAuth(lawsRegulationsQuestionLibrary);
|
||||||
|
lawsRegulationsQuestionLibrary.setWriter(loginUser.getId());
|
||||||
|
// 编辑后更新创建时间为最新时间,让其排在最前面
|
||||||
|
lawsRegulationsQuestionLibrary.setCreateTime(new Date());
|
||||||
|
saveOrUpdate(lawsRegulationsQuestionLibrary);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void isHaveOperateAuth(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) {
|
||||||
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
if (StringUtils.isNotBlank(lawsRegulationsQuestionLibrary.getWriter())
|
||||||
|
&& !lawsRegulationsQuestionLibrary.getWriter().equals(loginUser.getId())
|
||||||
|
&& !loginUser.getRoleIds().contains(FieldCommon.ROLE_ADMIN)) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_PERMISSION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteById(String id) {
|
||||||
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary = getById(id);
|
||||||
|
if (!loginUser.getId().equals(lawsRegulationsQuestionLibrary.getWriter())
|
||||||
|
&& !loginUser.getRoleIds().contains(FieldCommon.ROLE_ADMIN)) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_PERMISSION);
|
||||||
|
}
|
||||||
|
removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public LawsRegulationsQuestionLibrary queryById(String id) {
|
||||||
|
LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary = getById(id);
|
||||||
|
if (Objects.isNull(lawsRegulationsQuestionLibrary)) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
|
}
|
||||||
|
return lawsRegulationsQuestionLibrary;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setResultData(List<LawsRegulationsQuestionLibrary> pageList) {
|
||||||
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
pageList.forEach(lawsRegulationsQuestionLibrary -> {
|
||||||
|
if (loginUser.getRoleIds().contains(FieldCommon.ROLE_ADMIN) || loginUser.getId().equals(lawsRegulationsQuestionLibrary.getWriter())) {
|
||||||
|
// 可以编辑和删除
|
||||||
|
lawsRegulationsQuestionLibrary.setIsEditAndRemove(true);
|
||||||
|
} else {
|
||||||
|
// 不能编辑和删除
|
||||||
|
lawsRegulationsQuestionLibrary.setIsEditAndRemove(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
+119
@@ -0,0 +1,119 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
|
import com.jero.common.constant.enums.LanguageEnum;
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
import com.jero.common.util.MessageUtils;
|
||||||
|
import com.jero.modules.laws.businessSupport.common.Constant;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsVehicleDomesticLibrary;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsVehicleDomesticLibrarySublist;
|
||||||
|
import com.jero.modules.laws.businessSupport.mapper.LawsVehicleDomesticLibraryMapper;
|
||||||
|
import com.jero.modules.laws.businessSupport.service.ILawsVehicleDomesticLibraryService;
|
||||||
|
import com.jero.modules.laws.businessSupport.service.ILawsVehicleDomesticLibrarySublistService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 整车型号及VIN前八位管控库-国内 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LawsVehicleDomesticLibraryServiceImpl extends ServiceImpl<LawsVehicleDomesticLibraryMapper, LawsVehicleDomesticLibrary> implements ILawsVehicleDomesticLibraryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILawsVehicleDomesticLibrarySublistService lawsVehicleDomesticLibrarySublistService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<LawsVehicleDomesticLibrary> queryPageList(LawsVehicleDomesticLibrary lawsVehicleDomesticLibrary, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||||
|
LambdaQueryWrapper<LawsVehicleDomesticLibrary> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
String energyType = lawsVehicleDomesticLibrary.getEnergyType(); // 能源类型
|
||||||
|
String vehicleModel = lawsVehicleDomesticLibrary.getVehicleModel(); // 整车型号
|
||||||
|
String vinTopEight = lawsVehicleDomesticLibrary.getVinTopEight(); // VIN前八位
|
||||||
|
String vehicleTypeCode = lawsVehicleDomesticLibrary.getVehicleTypeCode(); // 车型代码
|
||||||
|
if (StringUtils.isNotBlank(energyType)) {
|
||||||
|
lambdaQueryWrapper.eq(LawsVehicleDomesticLibrary::getEnergyType, energyType);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(vehicleModel)) {
|
||||||
|
lambdaQueryWrapper.like(LawsVehicleDomesticLibrary::getVehicleModel, vehicleModel);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(vinTopEight)) {
|
||||||
|
lambdaQueryWrapper.like(LawsVehicleDomesticLibrary::getVinTopEight, vinTopEight);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(vehicleTypeCode)) {
|
||||||
|
LambdaQueryWrapper<LawsVehicleDomesticLibrarySublist> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.select(LawsVehicleDomesticLibrarySublist::getVehicleId);
|
||||||
|
queryWrapper.eq(LawsVehicleDomesticLibrarySublist::getVehicleTypeCode, vehicleTypeCode);
|
||||||
|
List<LawsVehicleDomesticLibrarySublist> list = lawsVehicleDomesticLibrarySublistService.list(queryWrapper);
|
||||||
|
List<String> ids = list.stream().map(LawsVehicleDomesticLibrarySublist::getId).collect(Collectors.toList());
|
||||||
|
lambdaQueryWrapper.in(LawsVehicleDomesticLibrary::getId, ids);
|
||||||
|
}
|
||||||
|
Page<LawsVehicleDomesticLibrary> page = new Page<>(pageNo, pageSize);
|
||||||
|
Page<LawsVehicleDomesticLibrary> result = page(page, lambdaQueryWrapper);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<?> queryOne(String id) {
|
||||||
|
if (StringUtils.isBlank(id)) {
|
||||||
|
throw new JeroBootException(ResultCommon.PARAMETERS_CANNOT_BE_NULL);
|
||||||
|
}
|
||||||
|
LawsVehicleDomesticLibrary lawsVehicleDomesticLibrary = getById(id);
|
||||||
|
if (Objects.isNull(lawsVehicleDomesticLibrary)) {
|
||||||
|
throw new JeroBootException(ResultCommon.PARAMETERS_CANNOT_BE_NULL);
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<LawsVehicleDomesticLibrarySublist> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(LawsVehicleDomesticLibrarySublist::getVehicleId, id);
|
||||||
|
LawsVehicleDomesticLibrarySublist lawsVehicleDomesticLibrarySublist = lawsVehicleDomesticLibrarySublistService.getOne(queryWrapper, false);
|
||||||
|
lawsVehicleDomesticLibrary.setLawsVehicleDomesticLibrarySublist(lawsVehicleDomesticLibrarySublist);
|
||||||
|
return Result.OK(lawsVehicleDomesticLibrary);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<?> delete(JSONObject jsonObject) {
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
if(StringUtils.isBlank(id)){
|
||||||
|
return Result.error(ResultCommon.PLEASE_SELECT_DATA);
|
||||||
|
}
|
||||||
|
// 删除主表数据
|
||||||
|
removeById(id);
|
||||||
|
// 删除子表数据
|
||||||
|
lawsVehicleDomesticLibrarySublistService.remove(new LambdaQueryWrapper<LawsVehicleDomesticLibrarySublist>().eq(LawsVehicleDomesticLibrarySublist::getVehicleId, id));
|
||||||
|
return Result.OK(ResultCommon.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<?> abolish(JSONObject jsonObject) {
|
||||||
|
String id = jsonObject.getString("id");
|
||||||
|
if(StringUtils.isBlank(id)){
|
||||||
|
return Result.error(ResultCommon.PLEASE_SELECT_DATA);
|
||||||
|
}
|
||||||
|
LawsVehicleDomesticLibrary lawsVehicleDomesticLibrary = getById(id);
|
||||||
|
if (Constant.ABOLISH.equals(lawsVehicleDomesticLibrary.getState())) {
|
||||||
|
String errMessage = "";
|
||||||
|
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())){
|
||||||
|
errMessage = "状态已经是废止了";
|
||||||
|
}else{
|
||||||
|
errMessage = "The status is already abolished";
|
||||||
|
}
|
||||||
|
throw new JeroBootException(errMessage);
|
||||||
|
}
|
||||||
|
lawsVehicleDomesticLibrary.setState(Constant.ABOLISH);
|
||||||
|
updateById(lawsVehicleDomesticLibrary);
|
||||||
|
return Result.OK();
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.jero.modules.laws.businessSupport.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.modules.laws.businessSupport.entity.LawsVehicleDomesticLibrarySublist;
|
||||||
|
import com.jero.modules.laws.businessSupport.mapper.LawsVehicleDomesticLibrarySublistMapper;
|
||||||
|
import com.jero.modules.laws.businessSupport.service.ILawsVehicleDomesticLibrarySublistService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 国内整车型号及VIN前八位管控库-子表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author sz
|
||||||
|
* @since 2024-09-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LawsVehicleDomesticLibrarySublistServiceImpl extends ServiceImpl<LawsVehicleDomesticLibrarySublistMapper, LawsVehicleDomesticLibrarySublist> implements ILawsVehicleDomesticLibrarySublistService {
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.jero.modules.laws.club.mapper.LawsClubPaymentMapper">
|
<mapper namespace="com.jero.modules.laws.club.mapper.LawsClubPaymentMapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user