From 0b4d8997b1add104e5bd9c7cda3964f8e48e12ae Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Fri, 17 Jan 2025 18:33:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=85=E5=A4=B4bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zhgd/mybatis/DataScopeHandler.java | 78 ++++++++++--------- .../entity/GreenConstructionScheme.java | 46 ++++++++++- .../baotou/entity/SceneExposeSpecial.java | 1 - .../modules/baotou/entity/bo/NoticeUnit.java | 1 - .../mapper/GreenConstructionSchemeMapper.java | 2 + .../xml/GreenConstructionSchemeMapper.xml | 31 ++++++-- .../java/com/zhgd/xmgl/util/EasyPoiUtil.java | 3 +- 7 files changed, 114 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/zhgd/mybatis/DataScopeHandler.java b/src/main/java/com/zhgd/mybatis/DataScopeHandler.java index 8cccb827c..11dc373bc 100644 --- a/src/main/java/com/zhgd/mybatis/DataScopeHandler.java +++ b/src/main/java/com/zhgd/mybatis/DataScopeHandler.java @@ -95,16 +95,6 @@ public class DataScopeHandler implements DataPermissionHandler { @Lazy @Autowired private ISystemUserService systemUserService; - //protected Expression getProjectSn(Object engineeringSn){ - // SecurityUser user = SecurityUtil.getUser(); - // if (user.getAccountType() == 4) { - // return new StringValue(user.getSn()); - // } - // if (user.getAccountType() == 3) { - // return new StringValue(engineeringService.getOne(Wrappers.lambdaQuery().eq(Engineering::getEngineeringSn, engineeringSn)).getProjectSn()); - // } - // return null; - //} @Lazy @Autowired private IUserDeviceService userDeviceService; @@ -117,10 +107,6 @@ public class DataScopeHandler implements DataPermissionHandler { return null; } - protected String getEngineeringSn() { - return "engineering_sn"; - } - protected String getProjectSn() { return "project_sn"; } @@ -158,6 +144,11 @@ public class DataScopeHandler implements DataPermissionHandler { return tables; } + /** + * 合作单位ids设备 + * + * @return + */ private HashMap getFieldEnterpriseIdsTables() { HashMap tables = new HashMap<>(16); tables.put("ai_analyse_hard_ware_record", "enterprise_ids"); @@ -205,12 +196,22 @@ public class DataScopeHandler implements DataPermissionHandler { return tables; } + /** + * 视频监控 + * + * @return + */ private HashMap getFieldVideoTables() { HashMap tables = new HashMap<>(16); tables.put("video_item", "item_id"); return tables; } + /** + * 合作单位ids设备的数据 + * + * @return + */ private HashMap> getFieldEnterpriseDataTables() { HashMap> tables = new HashMap<>(16); tables.put("car_pass_record", new MapBuilder().put(DATA_COLUMN, "camera_id").put(DEV_FIELD, "cameraId").put(DEV_MAPPER, CarCameraMapper.class).build()); @@ -277,36 +278,43 @@ public class DataScopeHandler implements DataPermissionHandler { return tables; } + /** - * 项目组 + * ai预警 * * @return */ - private HashMap getFieldGroupsTables() { - HashMap tables = new HashMap<>(16); - tables.put("danger_environment_evaluate", "project_group_id"); - tables.put("project_group", "id"); - return tables; - } - - /** - * 装置 - * - * @return - */ - private HashMap getFieldDevUnitTables() { - HashMap tables = new HashMap<>(16); - tables.put("danger_environment_evaluate", "device_id"); - tables.put("device_unit", "id"); - return tables; - } - private HashMap getFieldAiTables() { HashMap tables = new HashMap<>(16); tables.put("ai_analyse_hard_ware_alarm_record", "hardware_id"); return tables; } + +// /** +// * 项目组 +// * +// * @return +// */ +// private HashMap getFieldGroupsTables() { +// HashMap tables = new HashMap<>(16); +// tables.put("danger_environment_evaluate", "project_group_id"); +// tables.put("project_group", "id"); +// return tables; +// } + +// /** +// * 装置 +// * +// * @return +// */ +// private HashMap getFieldDevUnitTables() { +// HashMap tables = new HashMap<>(16); +// tables.put("danger_environment_evaluate", "device_id"); +// tables.put("device_unit", "id"); +// return tables; +// } + // private HashMap getFieldSecurityTables() { // HashMap tables = new HashMap<>(16); // tables.put("xz_security_quality_inspection_record", "device_unit_id"); @@ -370,7 +378,7 @@ public class DataScopeHandler implements DataPermissionHandler { } } } - //合作单位ids数据 + //合作单位ids设备的数据 List> devIdNames = getNeedFilterLeftExpression(plainSelect, ds, this.getFieldEnterpriseDataTables()); if (CollUtil.isNotEmpty(devIdNames)) { for (Map item : devIdNames) { diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/GreenConstructionScheme.java b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/GreenConstructionScheme.java index 18f90dffe..930aad0e9 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/GreenConstructionScheme.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/GreenConstructionScheme.java @@ -13,7 +13,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** - * @Description: 绿色施工方案管理 + * @Description: 危大工程清单 * @author: pds * @date: 2024-08-24 * @version: V1.0 @@ -52,9 +52,49 @@ public class GreenConstructionScheme implements Serializable { /**更新时间*/ @ApiModelProperty(value="更新时间") private java.util.Date updateDate ; + + /**模板**/ + /**装置*/ + @ApiModelProperty(value="装置") + private java.lang.Long deviceUnit ; + /** + * 项目组 + */ + @ApiModelProperty(value = "项目组") + private java.lang.Long projectGroup; + /** + * 监理单位 + */ + @ApiModelProperty(value = "监理单位") + private java.lang.Long supervisingUnit; + /** + * EPC承包商 + */ + @ApiModelProperty(value = "EPC承包商") + private java.lang.Long epcContractor; + /** + * 施工单位 + */ + @ApiModelProperty(value = "施工单位") + private java.lang.Long constructionUnit; + + @TableField(exist = false) + @ApiModelProperty(value = "装置名称") + private java.lang.String deviceUnitName; + @TableField(exist = false) + @ApiModelProperty(value = "项目组名称") + private java.lang.String projectGroupName; + @TableField(exist = false) + @ApiModelProperty(value = "监理单位名称") + private java.lang.String supervisingUnitName; + @TableField(exist = false) + @ApiModelProperty(value = "EPC承包商名称") + private java.lang.String epcContractorName; + @TableField(exist = false) + @ApiModelProperty(value = "施工单位名称") + private java.lang.String constructionUnitName; + @TableField(exist = false) - /**承包商名称*/ - @Excel(name = "承包商名称", width = 15) @ApiModelProperty(value="承包商名称") private java.lang.String contractorName ; } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/SceneExposeSpecial.java b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/SceneExposeSpecial.java index 53fe1e7ce..75d8f60f6 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/SceneExposeSpecial.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/SceneExposeSpecial.java @@ -85,7 +85,6 @@ public class SceneExposeSpecial implements Serializable { @ApiModelProperty(value = "附件") private String fileUrl; - /**模板**/ /** * 项目组 */ diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/bo/NoticeUnit.java b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/bo/NoticeUnit.java index bb36a9fd3..f439aa2a3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/bo/NoticeUnit.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/bo/NoticeUnit.java @@ -20,7 +20,6 @@ public class NoticeUnit implements Serializable { @ApiModelProperty(value = "项目sn") private String projectSn; - /**模板**/ /** * 项目组 */ diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/GreenConstructionSchemeMapper.java b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/GreenConstructionSchemeMapper.java index 4035b3dc1..6ee8b9f19 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/GreenConstructionSchemeMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/GreenConstructionSchemeMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zhgd.annotation.DataScope; import com.zhgd.xmgl.modules.baotou.entity.GreenConstructionScheme; import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -18,6 +19,7 @@ import java.util.List; * @version: V1.0 */ @Mapper +@DataScope(includeTable = "green_construction_scheme") public interface GreenConstructionSchemeMapper extends BaseMapper { List queryList(@Param(Constants.WRAPPER)QueryWrapper queryWrapper); diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/GreenConstructionSchemeMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/GreenConstructionSchemeMapper.xml index a28bd30c8..057dd3281 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/GreenConstructionSchemeMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/GreenConstructionSchemeMapper.xml @@ -1,21 +1,38 @@ - diff --git a/src/main/java/com/zhgd/xmgl/util/EasyPoiUtil.java b/src/main/java/com/zhgd/xmgl/util/EasyPoiUtil.java index d03e5de1b..301878510 100644 --- a/src/main/java/com/zhgd/xmgl/util/EasyPoiUtil.java +++ b/src/main/java/com/zhgd/xmgl/util/EasyPoiUtil.java @@ -9,6 +9,7 @@ import com.documents4j.api.IConverter; import com.documents4j.job.LocalConverter; import com.zhgd.xmgl.modules.basicdata.entity.SystemUser; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.apache.poi.xwpf.usermodel.XWPFDocument; import javax.servlet.http.HttpServletResponse; @@ -125,7 +126,7 @@ public class EasyPoiUtil { } } } else if (osName.contains("nux") || osName.contains("nix")) { - File pdfFile = new File(tempFile.getPath(), tempFile.getName() + ".pdf"); + File pdfFile = new File(tempFile.getParent(), StringUtils.substringBeforeLast(tempFile.getName(),".") + ".pdf"); log.info("linux环境开始导出pdf,源文件:{},目标文件:{}", tempFile.getAbsolutePath(), pdfFile.getAbsolutePath()); linuxWordToPdf(pdfFile, tempFile); try {