lyh
2025-07-10 36d911c4155b90d06f68e92d54da82f805f910d2
台账导出
已修改4个文件
76 ■■■■■ 文件已修改
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/IBaseFactoryService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/BaseFactoryServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java
@@ -1,5 +1,6 @@
package org.jeecg.modules.eam.dto;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -82,9 +83,25 @@
    private String equipmentName;
    /**
     * 中心
     */
//    @Excel(name = "中心", width = 15, orderNum = "5")
    @ApiModelProperty(value = "中心")
    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code")
    private transient String zxfactoryOrgCode;
    /**
     * 工区
     */
//    @Excel(name = "工区", width = 15, orderNum = "6")
    @ApiModelProperty(value = "工区")
    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code")
    private transient String gqfactoryOrgCode;
    /**
     * 工段
     */
    @Excel(name = "中心/工区/工段", width = 15, orderNum = "4",dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code")
    @Excel(name = "中心/工区/工段", width = 15, orderNum = "4")
    @ApiModelProperty(value = "中心/工区/工段")
    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "factory_code")
    private String factoryOrgCode;
@@ -151,8 +168,9 @@
    /**
     * 灭火器
     */
    @Excel(name = "灭火器", width = 15, orderNum = "16")
    @Excel(name = "灭火器", width = 15, orderNum = "16",dicCode = "yn")
    @ApiModelProperty(value = "灭火器")
    @Dict(dicCode = "yn")
    private String fireExtinguisher;
    /**
@@ -195,6 +213,12 @@
     * 重量(吨)
     */
    @Excel(name = "重量(吨)", width = 15, orderNum = "22")
    @ApiModelProperty(value = "重量(吨)")
    private String equipmentWeightStr;
    /**
     * 重量(吨)
     */
    @ApiModelProperty(value = "重量(吨)")
    private BigDecimal equipmentWeight;
@@ -410,4 +434,20 @@
    @ApiModelProperty(value = "备注")
    private String remark;
    public void setFactoryOrgCode(String factoryOrgCode){
        this.factoryOrgCode = factoryOrgCode;
        if(StrUtil.isNotEmpty(factoryOrgCode)){
            if(factoryOrgCode.length()==12){
                this.gqfactoryOrgCode = factoryOrgCode.substring(0,9);
                this.zxfactoryOrgCode = factoryOrgCode.substring(0,6);
            }
            if(factoryOrgCode.length()==9){
                this.zxfactoryOrgCode = factoryOrgCode.substring(0,6);
            }
        }
    }
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java
@@ -26,8 +26,6 @@
import org.jeecg.modules.eam.service.IEamEquipmentService;
import org.jeecg.modules.eam.vo.EamEquipmentTree;
import org.jeecg.modules.eam.vo.EquipmentSearchResult;
//import org.jeecg.modules.mdc.entity.MdcEquipment;
//import org.jeecg.modules.mdc.service.IMdcEquipmentService;
import org.jeecg.modules.system.entity.BaseFactory;
import org.jeecg.modules.system.entity.EamBaseRepairDepart;
import org.jeecg.modules.system.service.IBaseFactoryService;
@@ -230,6 +228,17 @@
        equipmentList.forEach(item -> {
            EamEquipmentDto eamEquipmentDto = new EamEquipmentDto();
            BeanUtils.copyProperties(item,eamEquipmentDto);
            if (eamEquipmentDto.getFactoryOrgCode().length()==12){
                eamEquipmentDto.setFactoryOrgCode(
                        baseFactoryService.factoryDataNameByOrgCode(eamEquipmentDto.getZxfactoryOrgCode())
                        +"/"+baseFactoryService.factoryDataNameByOrgCode(eamEquipmentDto.getGqfactoryOrgCode())+"/"+
                                baseFactoryService.factoryDataNameByOrgCode(eamEquipmentDto.getFactoryOrgCode()));
            }else {
                eamEquipmentDto.setFactoryOrgCode(
                        baseFactoryService.factoryDataNameByOrgCode(eamEquipmentDto.getZxfactoryOrgCode())
                                +"/"+ baseFactoryService.factoryDataNameByOrgCode(eamEquipmentDto.getFactoryOrgCode()));
            }
            eamEquipmentDto.setEquipmentWeightStr(eamEquipmentDto.getEquipmentWeight().toEngineeringString());
            eamEquipmentDtos.add(eamEquipmentDto);
        });
        // Step.3 AutoPoi 导出Excel
lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/IBaseFactoryService.java
@@ -61,4 +61,10 @@
     * 根据产线id批量删除并删除其可能存在的子级产线
     */
    void deleteBatchWithChildren(List<String> ids);
    /**
     * 通过orgCode置换中心名称
     * @param orgCode
     */
    String factoryDataNameByOrgCode(String orgCode);
}
lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/BaseFactoryServiceImpl.java
@@ -349,4 +349,17 @@
            }
        }
    }
    /**
     * 通过orgCode置换中心名称
     * @param orgCode
     */
    @Override
    public String factoryDataNameByOrgCode(String orgCode){
        BaseFactory baseFactory = baseMapper.selectOne(new LambdaQueryWrapper<BaseFactory>().eq(BaseFactory::getOrgCode, orgCode));
        if (baseFactory != null) {
            return baseFactory.getFactoryName();
        }
        return null;
    }
}