| | |
| | | "avatar": "", |
| | | "version": "4.9.2", |
| | | "createdTime": "2025-3-10 16:38:19", |
| | | "updatedTime": "2025-4-15 16:12:47", |
| | | "updatedTime": "2025-4-16 17:11:07", |
| | | "dbConns": [], |
| | | "profile": { |
| | | "default": { |
| | |
| | | "codeRoot": "" |
| | | } |
| | | }, |
| | | "defKey": "eam_sys_files", |
| | | "defName": "设å¤ç®¡çé件表", |
| | | "defKey": "eam_equipment_attachment", |
| | | "defName": "è®¾å¤ææ¡£", |
| | | "comment": "", |
| | | "properties": { |
| | | "partitioned by": "(date string)", |
| | |
| | | "id": "AE037CD2-F1D7-43A9-8AA7-0B6556CABB47" |
| | | }, |
| | | { |
| | | "defKey": "equipment_id", |
| | | "defName": "设å¤ID", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "F0AA43F9-BB17-41C9-B5A3-9946067055FC" |
| | | }, |
| | | { |
| | | "defKey": "file_encode_name", |
| | | "defName": "æä»¶å å¯å", |
| | | "comment": "", |
| | |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "5B36A3AD-359D-446C-87AD-338A4C6C0069" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | | "indexes": [], |
| | | "type": "P" |
| | | }, |
| | | { |
| | | "id": "9D0C5472-CECA-4676-8F92-5AD1D03EE367", |
| | | "env": { |
| | | "base": { |
| | | "nameSpace": "", |
| | | "codeRoot": "" |
| | | } |
| | | }, |
| | | "defKey": "eam_sys_files1", |
| | | "defName": "设å¤ç®¡çé件表", |
| | | "comment": "", |
| | | "properties": { |
| | | "partitioned by": "(date string)", |
| | | "row format delimited": "", |
| | | "fields terminated by ','": "", |
| | | "collection items terminated by '-'": "", |
| | | "map keys terminated by ':'": "", |
| | | "store as textfile;": "" |
| | | }, |
| | | "sysProps": { |
| | | "nameTemplate": "{defKey}[{defName}]" |
| | | }, |
| | | "notes": {}, |
| | | "headers": [ |
| | | { |
| | | "refKey": "hideInGraph", |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "defKey", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "defName", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "primaryKey", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "notNull", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "autoIncrement", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "domain", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "type", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "len", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "scale", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "comment", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "refDict", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "defaultValue", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "isStandard", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "uiHint", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "extProps", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr1", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr2", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr3", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr4", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr5", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr6", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr7", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr8", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr9", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | } |
| | | ], |
| | | "fields": [ |
| | | { |
| | | "defKey": "id", |
| | | "defName": "主é®", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": true, |
| | | "notNull": true, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": null, |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "3699A3C0-B0E2-4461-BD22-F00D9CCDF981", |
| | | "uiHint": null |
| | | }, |
| | | { |
| | | "defKey": "create_by", |
| | | "defName": "å建人", |
| | | "comment": "", |
| | | "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": null, |
| | | "uiHint": null, |
| | | "id": "66AAE852-A01A-45C5-86FD-CBDAC090207B", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "create_time", |
| | | "defName": "å建æ¶é´", |
| | | "comment": "", |
| | | "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": null, |
| | | "uiHint": null, |
| | | "id": "E5DF786B-CDF8-4C7C-9000-F9DF66EB0B61", |
| | | "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" |
| | | }, |
| | | { |
| | | "defKey": "update_by", |
| | | "defName": "æ´æ°äºº", |
| | | "comment": "", |
| | | "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": null, |
| | | "uiHint": null, |
| | | "id": "71FE4281-BBF4-498D-9575-B86D7FBFE279", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "update_time", |
| | | "defName": "æ´æ°æ¶é´", |
| | | "comment": "", |
| | | "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": null, |
| | | "uiHint": null, |
| | | "id": "52F980A8-0036-4FA4-AC68-3B207A828060", |
| | | "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" |
| | | }, |
| | | { |
| | | "defKey": "del_flag", |
| | | "defName": "å 餿 è®°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": null, |
| | | "baseType": "1D764C4A-6F9F-421E-B11A-6F3E23B51811", |
| | | "extProps": {}, |
| | | "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E", |
| | | "id": "E05B0E7B-556F-47E0-912A-074924FE90EF", |
| | | "uiHint": null |
| | | }, |
| | | { |
| | | "defKey": "file_encode_name", |
| | | "defName": "æä»¶å å¯å", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": null, |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "BE09D493-E183-402D-ACC4-EEA21EB35B8E", |
| | | "id": "01499664-437B-40BF-A2D1-9D931D731984", |
| | | "uiHint": null |
| | | }, |
| | | { |
| | | "defKey": "file_name", |
| | | "defName": "æä»¶åç§°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": null, |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "BE09D493-E183-402D-ACC4-EEA21EB35B8E", |
| | | "id": "A3FD9D88-56A8-43D4-94EF-12E2F73DA4E1", |
| | | "uiHint": null |
| | | }, |
| | | { |
| | | "defKey": "file_path", |
| | | "defName": "æä»¶ä¿åè·¯å¾", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": null, |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "D3320083-11F8-4A4C-B03D-24E7EB18A527", |
| | | "uiHint": null |
| | | }, |
| | | { |
| | | "defKey": "file_suffix", |
| | | "defName": "æä»¶åç¼å", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": null, |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", |
| | | "id": "2232DE73-B928-4576-A3F7-99DAC095ABD2", |
| | | "uiHint": null |
| | | }, |
| | | { |
| | | "defKey": "file_size", |
| | | "defName": "æä»¶å¤§å°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": null, |
| | | "baseType": "A48A12F5-2E10-4F0A-8449-60887F0D30E0", |
| | | "extProps": {}, |
| | | "domain": "2E60DFAE-915E-4328-AEE2-6ED5FB43BAF5", |
| | | "id": "07C7567D-6B96-432A-BE2C-54AFA4293E9F", |
| | | "uiHint": null |
| | | }, |
| | | { |
| | | "defKey": "description", |
| | | "defName": "æè¿°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": null, |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "D9B55620-8B6D-48E0-A284-0BD9BF4B062F", |
| | | "uiHint": null |
| | | } |
| | | ], |
| | | "correlations": [], |
| | |
| | | "refEntities": [ |
| | | "74D17B8E-6DA8-477B-810C-EC8B3FBF53F2", |
| | | "B2E5D0C4-4FF7-4221-8366-FC7B31B7411A", |
| | | "9D0C5472-CECA-4676-8F92-5AD1D03EE367", |
| | | "257DC169-B593-4D03-8FE4-6AF75C335A93", |
| | | "B9F80758-3E0D-4350-9DA0-C2D82DC2912A", |
| | | "759CE3A5-4823-4215-B14F-5D26B6FA0B58", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentAttachment; |
| | | import org.jeecg.modules.eam.request.EamEquipmentAttachmentRequest; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentAttachmentService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: è®¾å¤ææ¡£å°è´¦ä½¿ç¨ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-04-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="è®¾å¤ææ¡£å°è´¦ä½¿ç¨") |
| | | @RestController |
| | | @RequestMapping("/eam/equipmentAttachment") |
| | | public class EamEquipmentAttachmentController extends JeecgController<EamEquipmentAttachment, IEamEquipmentAttachmentService> { |
| | | @Autowired |
| | | private IEamEquipmentAttachmentService eamEquipmentAttachmentService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamEquipmentAttachment |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "è®¾å¤ææ¡£å°è´¦ä½¿ç¨-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-å页å表æ¥è¯¢", notes="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamEquipmentAttachment eamEquipmentAttachment, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | Page<EamEquipmentAttachment> page = new Page<>(pageNo, pageSize); |
| | | if(StringUtils.isBlank(eamEquipmentAttachment.getEquipmentId())) { |
| | | return Result.OK(page); |
| | | } |
| | | //åªä¿ç设å¤id |
| | | EamEquipmentAttachment query = new EamEquipmentAttachment(); |
| | | query.setEquipmentId(eamEquipmentAttachment.getEquipmentId()); |
| | | QueryWrapper<EamEquipmentAttachment> queryWrapper = QueryGenerator.initQueryWrapper(eamEquipmentAttachment, req.getParameterMap()); |
| | | queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | IPage<EamEquipmentAttachment> pageList = eamEquipmentAttachmentService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "è®¾å¤ææ¡£å°è´¦ä½¿ç¨-æ·»å ") |
| | | @ApiOperation(value="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-æ·»å ", notes="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamEquipmentAttachmentRequest request) { |
| | | boolean b = eamEquipmentAttachmentService.saveEntity(request); |
| | | if(!b) { |
| | | return Result.OK("æä½å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param eamEquipmentAttachment |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "è®¾å¤ææ¡£å°è´¦ä½¿ç¨-ç¼è¾") |
| | | @ApiOperation(value="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-ç¼è¾", notes="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamEquipmentAttachment eamEquipmentAttachment) { |
| | | eamEquipmentAttachmentService.updateById(eamEquipmentAttachment); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "è®¾å¤ææ¡£å°è´¦ä½¿ç¨-éè¿idå é¤") |
| | | @ApiOperation(value="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-éè¿idå é¤", notes="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-éè¿idå é¤") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
| | | EamEquipmentAttachment entity = eamEquipmentAttachmentService.getById(id); |
| | | if(entity != null) { |
| | | entity.setDelFlag(CommonConstant.DEL_FLAG_1); |
| | | eamEquipmentAttachmentService.updateById(entity); |
| | | } |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "è®¾å¤ææ¡£å°è´¦ä½¿ç¨-æ¹éå é¤") |
| | | @ApiOperation(value="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-æ¹éå é¤", notes="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-æ¹éå é¤") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | list.forEach(id -> { |
| | | EamEquipmentAttachment entity = eamEquipmentAttachmentService.getById(id); |
| | | if(entity != null) { |
| | | entity.setDelFlag(CommonConstant.DEL_FLAG_1); |
| | | eamEquipmentAttachmentService.updateById(entity); |
| | | } |
| | | }); |
| | | return Result.OK("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "è®¾å¤ææ¡£å°è´¦ä½¿ç¨-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-éè¿idæ¥è¯¢", notes="è®¾å¤ææ¡£å°è´¦ä½¿ç¨-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
| | | EamEquipmentAttachment eamEquipmentAttachment = eamEquipmentAttachmentService.getById(id); |
| | | return Result.OK(eamEquipmentAttachment); |
| | | } |
| | | |
| | | @GetMapping("/downloadFile") |
| | | public void downloadFile(@RequestParam("id") String id, HttpServletResponse response) { |
| | | eamEquipmentAttachmentService.downloadFile(response, eamEquipmentAttachmentService.getById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | /** |
| | | * @Description: è®¾å¤ææ¡£å°è´¦ä½¿ç¨ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-04-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("eam_equipment_attachment") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="eam_equipment_attachment对象", description="è®¾å¤ææ¡£å°è´¦ä½¿ç¨") |
| | | public class EamEquipmentAttachment implements Serializable { |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /**å建人*/ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¶é´*/ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | /**å 餿 è®°*/ |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | private Integer delFlag; |
| | | /**æä»¶å å¯å*/ |
| | | @ApiModelProperty(value = "设å¤ID") |
| | | private String equipmentId; |
| | | /**æä»¶å å¯å*/ |
| | | @ApiModelProperty(value = "æä»¶å å¯å") |
| | | private String fileEncodeName; |
| | | /**æä»¶åç§°*/ |
| | | @ApiModelProperty(value = "æä»¶åç§°") |
| | | private String fileName; |
| | | /**æä»¶ä¿åè·¯å¾*/ |
| | | @ApiModelProperty(value = "æä»¶ä¿åè·¯å¾") |
| | | private String filePath; |
| | | /**æä»¶åç¼å*/ |
| | | @ApiModelProperty(value = "æä»¶åç¼å") |
| | | private String fileSuffix; |
| | | /**æä»¶å¤§å°*/ |
| | | @ApiModelProperty(value = "æä»¶å¤§å°") |
| | | private Long fileSize; |
| | | /**æè¿°*/ |
| | | @ApiModelProperty(value = "æè¿°") |
| | | private String description; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentAttachment; |
| | | |
| | | /** |
| | | * @Description: è®¾å¤ææ¡£å°è´¦ä½¿ç¨ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-04-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EamEquipmentAttachmentMapper extends BaseMapper<EamEquipmentAttachment> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.eam.mapper.EamEquipmentAttachmentMapper"> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.request; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 设å¤é件管ç |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="请æ±å¯¹è±¡", description="设å¤é件管ç") |
| | | public class EamEquipmentAttachmentRequest implements Serializable { |
| | | /**æè¿°*/ |
| | | @ApiModelProperty(value = "æè¿°") |
| | | private String description; |
| | | /**æè¿°*/ |
| | | @ApiModelProperty(value = "设å¤ID") |
| | | private String equipmentId; |
| | | /**ä¸ä¼ æä»¶å¯¹ç³»*/ |
| | | @ApiModelProperty(value = "ä¸ä¼ æä»¶å¯¹ç³»") |
| | | private List<FileUploadResult> fileList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import org.jeecg.modules.eam.entity.EamEquipmentAttachment; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.request.EamEquipmentAttachmentRequest; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @Description: è®¾å¤ææ¡£å°è´¦ä½¿ç¨ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-04-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEamEquipmentAttachmentService extends IService<EamEquipmentAttachment> { |
| | | |
| | | /** |
| | | * |
| | | * @param response |
| | | * @param byId |
| | | */ |
| | | void downloadFile(HttpServletResponse response, EamEquipmentAttachment byId); |
| | | |
| | | /** |
| | | * ä¿å对象 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | boolean saveEntity(EamEquipmentAttachmentRequest request); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.util.FileUtil; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentAttachment; |
| | | import org.jeecg.modules.eam.mapper.EamEquipmentAttachmentMapper; |
| | | import org.jeecg.modules.eam.request.EamEquipmentAttachmentRequest; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentAttachmentService; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: è®¾å¤ææ¡£å°è´¦ä½¿ç¨ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-04-16 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EamEquipmentAttachmentServiceImpl extends ServiceImpl<EamEquipmentAttachmentMapper, EamEquipmentAttachment> implements IEamEquipmentAttachmentService { |
| | | |
| | | @Autowired |
| | | private IEamEquipmentService eamEquipmentService; |
| | | |
| | | @Override |
| | | public void downloadFile(HttpServletResponse response, EamEquipmentAttachment entity) { |
| | | FileUtil.downLoadFile(response, entity.getFilePath(), entity.getFileName()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveEntity(EamEquipmentAttachmentRequest request) { |
| | | if(request == null || CollectionUtil.isEmpty(request.getFileList())){ |
| | | return false; |
| | | } |
| | | EamEquipment equipment = eamEquipmentService.getById(request.getEquipmentId()); |
| | | if(equipment == null){ |
| | | throw new JeecgBootException("请å
éæ©è®¾å¤åä¸ä¼ ææ¡£"); |
| | | } |
| | | List<EamEquipmentAttachment> resultList = new ArrayList<>(); |
| | | for (FileUploadResult fileUploadResult : request.getFileList()) { |
| | | EamEquipmentAttachment entity = new EamEquipmentAttachment(); |
| | | entity.setFilePath(fileUploadResult.getFilePath()); |
| | | entity.setFileName(fileUploadResult.getFileName()); |
| | | entity.setFileEncodeName(fileUploadResult.getFileEncodeName()); |
| | | entity.setFileSize(fileUploadResult.getFileSize()); |
| | | entity.setFileSuffix(fileUploadResult.getFileSuffix()); |
| | | entity.setDescription(request.getDescription()); |
| | | entity.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | entity.setEquipmentId(request.getEquipmentId()); |
| | | resultList.add(entity); |
| | | } |
| | | return this.saveBatch(resultList); |
| | | } |
| | | } |
| | |
| | | #code_generate_project_path |
| | | project_path=F:\\java_workspace |
| | | project_path=D:\\java_workspace |
| | | #bussi_package[User defined] |
| | | bussi_package=org.jeecg.modules |
| | | |
| | |
| | | |
| | | #SQLServer2005\u4ee5\u4e0a |
| | | diver_name=org.hibernate.dialect.SQLServerDialect |
| | | url=jdbc:sqlserver://192.168.1.118:1433;DatabaseName=LXZN_TEST_HANGYU |
| | | url=jdbc:sqlserver://192.168.1.118:1433;DatabaseName=LXZN_TEST_WK |
| | | username=sa |
| | | password=123 |
| | | database_name=LXZN_TEST_HANGYU |
| | | database_name=LXZN_TEST_WK |