| | |
| | | import com.terra.system.entity.data.MetaEntity; |
| | | import com.terra.system.entity.sys.AttachEntity; |
| | | import com.terra.system.helper.PathHelper; |
| | | import com.terra.system.helper.StringHelper; |
| | | import com.terra.common.helper.StringHelper; |
| | | import com.terra.system.service.data.MetaService; |
| | | import com.terra.system.service.sys.AttachService; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.*; |
| | |
| | | private String getFilePath(int id, Boolean isAttach) { |
| | | if (null == isAttach || !isAttach) { |
| | | MetaEntity me = metaService.selectById(id); |
| | | if (null == me || StringUtils.isEmpty(me.getPath()) || !StaticData.DWG.equals(me.getType())) { |
| | | if (null == me || StringHelper.isEmpty(me.getPath()) || !StaticData.DWG.equals(me.getType())) { |
| | | return null; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | AttachEntity ae = attachService.selectById(id); |
| | | if (null == ae || StringUtils.isEmpty(ae.getPath()) || !ae.getPath().toLowerCase().contains(StaticData.DWG)) { |
| | | if (null == ae || StringHelper.isEmpty(ae.getPath()) || !ae.getPath().toLowerCase().contains(StaticData.DWG)) { |
| | | return null; |
| | | } |
| | | |