Merge remote-tracking branch 'origin/master' into xizang-changyun
| | |
| | | String url = tencentCosUtil.upLoadFile(file); |
| | | return R.ok(url, url); |
| | | } |
| | | @PostMapping("/downloadImg") |
| | | @ApiOperation(value = "文件下载", tags = "公共-文件下载") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "文件url", name = "url", dataType = "String", required = true) |
| | | }) |
| | | public String downloadImg(@RequestParam("url") String url) { |
| | | return tencentCosUtil.downLoadFileImg(url); |
| | | } |
| | | @PostMapping("/download") |
| | | @ApiOperation(value = "文件下载", tags = "公共-文件下载") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "文件url", name = "url", dataType = "String", required = true) |
| | | }) |
| | | public void upload(@RequestParam("url") String url) { |
| | | public void download(@RequestParam("url") String url) { |
| | | tencentCosUtil.downLoadFile(url); |
| | | } |
| | | } |
| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.util.Base64; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | |
| | | public void downLoadFile(String file) { |
| | | HttpServletResponse response = WebUtils.response(); |
| | | String replace = file.replace(rootSrc, ""); |
| | | response.setHeader("Access-Control-Expose-Headers","File-Type"); |
| | | COSCredentials cred = new BasicCOSCredentials( |
| | | secretId, |
| | | secretKey); |
| | |
| | | cosClient.shutdown(); |
| | | } |
| | | } |
| | | // https://xzgttest-1305134071.cos.ap-chengdu.myqcloud.com/xizang/e4ea88b8-5470-456e-bf97-75cf47f38e84.jpg |
| | | public String downLoadFileImg(String file) { |
| | | byte[] data = null; |
| | | String replace = file.replace(rootSrc, ""); |
| | | COSCredentials cred = new BasicCOSCredentials( |
| | | secretId, |
| | | secretKey); |
| | | // 2.1 设置存储桶的地域(上文获得) |
| | | Region region = new Region(bucketAddr); |
| | | ClientConfig clientConfig = new ClientConfig(region); |
| | | // 2.2 使用https协议传输 |
| | | clientConfig.setHttpProtocol(HttpProtocol.https); |
| | | COSClient cosClient = new COSClient(cred, clientConfig); |
| | | try { |
| | | // 5. 下载文件并获取输入流 |
| | | InputStream inputStream = cosClient.getObject(bucketName, replace).getObjectContent(); |
| | | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); |
| | | // 6. 处理输入流,例如读取内容或保存到本地文件 |
| | | byte[] buffer = new byte[1024]; |
| | | int len; |
| | | while ((len = inputStream.read(buffer)) != -1) { |
| | | // 处理读取到的数据 |
| | | swapStream.write(buffer, 0, len); |
| | | } |
| | | data = swapStream.toByteArray(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | // 7. 关闭输入流 |
| | | cosClient.shutdown(); |
| | | } |
| | | return Base64.getEncoder().encodeToString(data); |
| | | } |
| | | } |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:10633/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://127.0.0.1:10633/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: XiZang@2025! |
| | | # 从库数据源 |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://xzgt.test.591taxi.cn:13306/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://xzgt.test.591taxi.cn:13306/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: 8f5z9g52gx4bg |
| | | # 从库数据源 |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:10633/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://127.0.0.1:10633/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: XiZang@2025! |
| | | # 从库数据源 |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://xzgt.test.591taxi.cn:13306/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://xzgt.test.591taxi.cn:13306/xizang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: 8f5z9g52gx4bg |
| | | # 从库数据源 |
| | |
| | | private Integer status; |
| | | @ApiModelProperty(value = "内存大小多个文件逗号拼接") |
| | | @TableField("memory") |
| | | private Integer memory; |
| | | private String memory; |
| | | @ApiModelProperty(value = "附件名称 逗号拼接") |
| | | @TableField("contract_file_name") |
| | | private Integer contractFileName; |
| | | private String contractFileName; |
| | | |
| | | } |
| | |
| | | <if test="query.status != null"> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | <if test="req.leaseStatus != null"> |
| | | and t1.lease_status = #{req.leaseStatus} |
| | | </if> |
| | | AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | <select id="userHistoryList" resultType="com.ruoyi.system.vo.HouseVO"> |
| | |
| | | left join t_tenant t2 on t1.tenant_id = t2.id |
| | | LEFT JOIN t_house t3 on t3.id = t1.house_id |
| | | where t1.house_id = #{req.id} |
| | | AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TenantVO"> |
| | | SELECT id, resident_name, checkIn_time, tenant_attributes, tenant_type, phone, id_card, email, |
| | | bank_number, mail_address, create_time, disabled,account, |
| | | bank_number, mail_address, create_time, disabled,account |
| | | FROM t_tenant |
| | | <where> |
| | | <if test="query.residentName != null and query.residentName != ''"> |