Skip to content

GET /dm-store/partMain/detail/:id

触发按钮:getDetail

入参

传递对象:Long

字段类型必填多选校验规则说明
idLong-路径中的业务 id

出参

传递对象:ResultData<PartMainVo><单个 PartMainVo 对象>

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": 2249,
    "createTime": "2026-05-21 02:11:27",
    "createUser": "zhongmg2",
    "updateTime": "2026-05-21 02:11:27",
    "updateUser": "zhongmg2",
    "factoryNo": "000027",
    "isDelete": 0,
    "partNo": "002261",
    "partCode": "xxx",
    "bigCategory": "xx",
    "smallCategory": "xx",
    "sonCategory": "xx",
    "partName": "xxx",
    "spec": "xx",
    "uom": "KW",
    "controlType": 1,
    "currency": 1,
    "price": 111,
    "preferredSupplier": "FACILITIES CORP",
    "supplierNo": null,
    "isPeriod": 0,
    "isLife": 0,
    "maxLife": null,
    "maxLifeUom": "",
    "useModel": "ss",
    "preciousType": 1,
    "validFlag": 1,
    "description": "22",
    "packageNumber": null,
    "baseUrl": "https://10.188.132.96/lemes-api/common/oss/get/devicemate/DEVICEMATE_PART_MAIN/tst_zmg.png",
    "attachmentVoList": [
      {
        "id": 64634,
        "createTime": "2026-05-21 02:11:17",
        "createUser": "zhongmg2",
        "updateTime": "2026-05-21 02:11:27",
        "updateUser": "zhongmg2",
        "factoryNo": "000027",
        "isDelete": 0,
        "fileId": "DEVICEMATE_PART_MAIN/tst_zmg.png",
        "filePath": "DEVICEMATE_PART_MAIN/tst_zmg.png",
        "fileSize": 458237,
        "fileName": "tst_zmg.png",
        "fileType": "image/png",
        "scope": null,
        "businesskey": "DEVICEMATE_PART_MAIN",
        "targetId": 2249,
        "baseUrl": "https://10.188.132.96/lemes-api/common/oss/get/",
        "isDelOrUp": null
      }
    ],
    "serialRule": 1
  }
}

前端校验规则

前端校验
├── 表单校验
│   ├── partCode
│   │   └── 必填,trigger: blur
│   ├── partName
│   │   └── 必填,trigger: blur
│   ├── spec
│   │   └── 必填,trigger: blur
│   ├── uom
│   │   └── 必填,trigger: change
│   ├── controlType
│   │   └── 必填,trigger: change
│   ├── price
│   │   ├── 必填,trigger: blur
│   │   ├── 仅允许数字和小数点
│   │   ├── 禁止首位输入小数点
│   │   ├── 仅允许 1 个小数点
│   │   ├── 最多 3 位小数
│   │   └── blur 时值为 0 或空提示警告
│   ├── packageNumber
│   │   ├── form.controlType == 3 时必填,trigger: blur
│   │   ├── 仅允许整数
│   │   └── blur 时值为 0 或空提示警告
│   ├── maxLife
│   │   ├── form.controlType == 2 且 form.isLife == 1 时必填,trigger: blur
│   │   ├── 仅允许数字和小数点
│   │   ├── 禁止首位输入小数点
│   │   ├── 仅允许 1 个小数点
│   │   └── 最多 1 位小数
│   ├── maxLifeUom
│   │   └── form.controlType == 2 且 form.isLife == 1 时必填,trigger: blur
│   └── serialRule
│       └── form.controlType == 2 时必填,trigger: change
├── 提交拦截校验
│   └── this.$refs.form.validate 未通过时拦截提交
└── 文件上传校验
    └── attachmentVoList
        ├── 仅允许 image/jpeg、image/png、image/gif、image/jpg
        └── 文件大小必须小于 5MB

后端逻辑

业务流程:查询物料详情并补充附件回显信息
├── 查询物料详情
│   ├── 查询主记录:getById :419
│   └── 记录不存在:findPartMainById :420-423
├── 查询附件回显
│   └── 查询附件:fileClient.listFileWithTarget :428
└── 组装详情结果
    ├── 回填附件列表:partMainVo.setAttachmentVoList :430
    └── 生成附件访问地址:partMainVo.setBaseUrl :431-434

后端校验规则

后端校验
└── 数据存在性校验
    └── 物料主数据必须存在:findPartMainById :419-423
        └── 异常码:ExceptionCode.EX100007

涉及数据库表

库名.表名mapper.statement描述
store.part_mainPartMainMapper.selectById按 id 查询partMain详情
附件数据fileClient.listFileWithTarget按业务目标查询附件并回填 attachmentVoList 或 baseUrl