关键零部件型号库
This commit is contained in:
+176
@@ -0,0 +1,176 @@
|
||||
package com.jero.modules.laws.part.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
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.modules.laws.part.entity.LawsPartRelevance;
|
||||
import com.jero.modules.laws.part.service.ILawsPartRelevanceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Api(tags = "业务支持-关键零部件绑定关系管理")
|
||||
@RestController
|
||||
@RequestMapping("/laws/lawsPartType")
|
||||
@Slf4j
|
||||
public class LawsPartTypeController {
|
||||
|
||||
@Resource
|
||||
private ILawsPartRelevanceService lawsPartRelevanceService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsPartRelevance
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件绑定关系管理-分页列表查询")
|
||||
@ApiOperation(value = "业务支持-关键零部件绑定关系管理-分页列表查询", notes = "业务支持-关键零部件绑定关系管理-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@RequiresPermissions("keyPartBindingManage:search")
|
||||
public Result<IPage<LawsPartRelevance>> queryPageList(LawsPartRelevance lawsPartRelevance,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsPartRelevance> pageList = lawsPartRelevanceService.queryPage(lawsPartRelevance, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param lawsPartRelevance
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件绑定关系管理-详情")
|
||||
@ApiOperation(value = "业务支持-关键零部件绑定关系管理-详情", notes = "业务支持-关键零部件绑定关系管理-详情")
|
||||
@GetMapping(value = "/queryById")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Translation
|
||||
public Result<LawsPartRelevance> queryById(LawsPartRelevance lawsPartRelevance) {
|
||||
LawsPartRelevance result = lawsPartRelevanceService.queryById(lawsPartRelevance.getId());
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件绑定关系管理-删除")
|
||||
@ApiOperation(value = "业务支持-关键零部件绑定关系管理-删除", notes = "业务支持-关键零部件绑定关系管理-删除")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/delete")
|
||||
@RequiresPermissions("keyPartBindingManage:delete")
|
||||
public Result<?> delete(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
|
||||
return Result.error(ResultCommon.SELECT_DATA);
|
||||
}
|
||||
this.lawsPartRelevanceService.deleteById(map.get("id"));
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件绑定关系管理-批量删除")
|
||||
@ApiOperation(value = "业务支持-关键零部件绑定关系管理-批量删除", notes = "业务支持-关键零部件绑定关系管理-批量删除")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
@RequiresPermissions("keyPartBindingManage:batchDel")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
|
||||
return Result.error(ResultCommon.SELECT_DATA);
|
||||
}
|
||||
this.lawsPartRelevanceService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param lawsPartRelevance
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件绑定关系管理-新增")
|
||||
@ApiOperation(value = "业务支持-关键零部件绑定关系管理-新增", notes = "业务支持-关键零部件绑定关系管理-新增")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("keyPartBindingManage:add")
|
||||
public Result<T> add(@Validated @RequestBody LawsPartRelevance lawsPartRelevance) {
|
||||
lawsPartRelevanceService.add(lawsPartRelevance);
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsPartRelevance
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件绑定关系管理-编辑")
|
||||
@ApiOperation(value = "业务支持-关键零部件绑定关系管理-编辑", notes = "业务支持-关键零部件绑定关系管理-编辑")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@PostMapping(value = "/edit")
|
||||
@RequiresPermissions("keyPartBindingManage:import")
|
||||
public Result<T> edit(@Validated @RequestBody LawsPartRelevance lawsPartRelevance) {
|
||||
this.lawsPartRelevanceService.edit(lawsPartRelevance);
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件绑定关系管理-导入")
|
||||
@ApiOperation(value = "业务支持-关键零部件绑定关系管理-导入", notes = "业务支持-关键零部件绑定关系管理-导入")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@PostMapping(value = "/importExcel")
|
||||
@RequiresPermissions("keyPartBindingManage:import")
|
||||
public Result<?> importExcel(@RequestParam("file") @ApiParam("文件") MultipartFile file) {
|
||||
return lawsPartRelevanceService.importExcel(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模版
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-关键零部件绑定关系管理-下载模版")
|
||||
@ApiOperation(value = "业务支持-关键零部件绑定关系管理-下载模版", notes = "业务支持-关键零部件绑定关系管理-下载模版")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@GetMapping(value = "/downloadTemplate")
|
||||
@RequiresPermissions("keyPartBindingManage:templateDownload")
|
||||
public ModelAndView downloadTemplate(HttpServletResponse response) {
|
||||
return lawsPartRelevanceService.downloadTemplate(response);
|
||||
}
|
||||
}
|
||||
@@ -70,11 +70,11 @@ public class LawsPartRelevance implements Serializable {
|
||||
@Excel(name = "关键零部件名称(英文)", width = 15)
|
||||
private String regPartNameEn;
|
||||
/**
|
||||
* 形式型号
|
||||
* 型号型式
|
||||
*/
|
||||
@NotBlank(message = "形式型号不能为空")
|
||||
@ApiModelProperty(value = "形式型号")
|
||||
@Excel(name = "形式型号", width = 15, dicCode = "form_type")
|
||||
@NotBlank(message = "型号型式不能为空")
|
||||
@ApiModelProperty(value = "型号型式")
|
||||
@Excel(name = "型号型式", width = 15, dicCode = "form_type")
|
||||
@Dict(dicCode = "form_type")
|
||||
private String formType;
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.jero.modules.laws.part.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 关键零部件型号库
|
||||
*
|
||||
* @TableName laws_part_type
|
||||
*/
|
||||
@TableName(value ="laws_part_type")
|
||||
@Data
|
||||
public class LawsPartType implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 0表示未删除,1表示删除
|
||||
*/
|
||||
@TableLogic
|
||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 零件号
|
||||
*/
|
||||
@ApiModelProperty(value = "零件号")
|
||||
@Excel(name = "零件号", width = 15)
|
||||
@NotBlank(message = "零件号")
|
||||
private String partNum;
|
||||
|
||||
/**
|
||||
* 关键零部件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "关键零部件名称")
|
||||
@Excel(name = "关键零部件名称", width = 15)
|
||||
@NotBlank(message = "关键零部件名称不能为空")
|
||||
@TableField(exist = false)
|
||||
private String regPartNameCn;
|
||||
|
||||
/**
|
||||
* 关键零部件名称(英文)
|
||||
*/
|
||||
@ApiModelProperty(value = "关键零部件名称(英文)")
|
||||
@Excel(name = "关键零部件名称(英文)", width = 15)
|
||||
@TableField(exist = false)
|
||||
private String regPartNameEn;
|
||||
|
||||
/**
|
||||
* 零件名称
|
||||
*/
|
||||
@NotBlank(message = "零件名称")
|
||||
@ApiModelProperty(value = "零件名称")
|
||||
@Excel(name = "零件名称", width = 15)
|
||||
private String partName;
|
||||
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
@NotBlank(message = "生产厂家")
|
||||
@ApiModelProperty(value = "生产厂家")
|
||||
@Excel(name = "生产厂家", width = 15, dicCode = "production_factory_code", dictTable = "laws_part_production_factory", dicText = "production_factory")
|
||||
@Dict(dicCode = "production_factory_code", dictTable = "laws_part_production_factory", dicText = "production_factory")
|
||||
private String productionFactory;
|
||||
/**
|
||||
* 适用车型
|
||||
*/
|
||||
@NotBlank(message = "适用车型不能为空")
|
||||
@ApiModelProperty(value = "适用车型")
|
||||
@Excel(name = "适用车型", width = 15, dicCode = "applicable_vehicle_type")
|
||||
@Dict(dicCode = "applicable_vehicle_type")
|
||||
private String applicableVehicleType;
|
||||
|
||||
/**
|
||||
* 型号型式
|
||||
*/
|
||||
@NotBlank(message = "型号型式不能为空")
|
||||
@ApiModelProperty(value = "型号型式")
|
||||
@Excel(name = "型号型式", width = 15, dicCode = "form_type")
|
||||
@Dict(dicCode = "form_type")
|
||||
@TableField(exist = false)
|
||||
private String formType;
|
||||
/**
|
||||
* 技术特性判定要求
|
||||
*/
|
||||
@ApiModelProperty(value = "技术特性判定要求")
|
||||
@Excel(name = "技术特性判定要求", width = 15)
|
||||
@TableField(exist = false)
|
||||
private String decisionRequirement;
|
||||
|
||||
/**
|
||||
* 已有零件对应零件号
|
||||
*/
|
||||
@ApiModelProperty(value = "已有零件对应零件号")
|
||||
@Excel(name = "已有零件对应零件号", width = 15)
|
||||
private String alreadyPartNum;
|
||||
/**
|
||||
* 已有零件对应零件号id
|
||||
*/
|
||||
@ApiModelProperty(value = "已有零件对应零件号id")
|
||||
private String alreadyPartNumId;
|
||||
/**
|
||||
* 分类(国内)
|
||||
*/
|
||||
@ApiModelProperty(value = "分类(国内)")
|
||||
@Excel(name = "分类(国内)", width = 15,dicCode = "classification")
|
||||
@Dict(dicCode = "classification")
|
||||
@TableField(exist = false)
|
||||
private String classification;
|
||||
/**
|
||||
* 适用市场
|
||||
*/
|
||||
@Excel(name = "适用市场", width = 15,dicCode = "market_state")
|
||||
@NotBlank(message = "适用市场不能为空")
|
||||
@ApiModelProperty(value = "适用市场")
|
||||
@Dict(dicCode = "market_state")
|
||||
@TableField(exist = false)
|
||||
private String applicableMarket;
|
||||
/**
|
||||
* 零部件认证交付物
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件认证交付物")
|
||||
@Excel(name = "零部件认证交付物", width = 15,dicCode = "parts_certified_deliverables")
|
||||
@Dict(dicCode = "parts_certified_deliverables")
|
||||
@TableField(exist = false)
|
||||
private String partsCertifiedDeliverables;
|
||||
/**
|
||||
* 责任部门
|
||||
*/
|
||||
@NotBlank(message = "责任部门不能为空")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
@Excel(name = "责任部门", width = 15, dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@TableField(exist = false)
|
||||
private String responsibleDepartment;
|
||||
/**
|
||||
* 责任部门专业模块
|
||||
*/
|
||||
@NotBlank(message = "责任部门专业模块不能为空")
|
||||
@ApiModelProperty(value = "责任部门专业模块")
|
||||
@Dict(dicCode = "responsible_module")
|
||||
@Excel(name = "责任部门专业模块", width = 15, dicCode = "responsible_module")
|
||||
@TableField(exist = false)
|
||||
private String responsibleModule;
|
||||
}
|
||||
Reference in New Issue
Block a user