From 7a27de3e84b9a5da458d259b2a027b3f3f45769d Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Wed, 18 Dec 2024 13:46:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3url=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/contract/service/BmContractService.java | 5 +++-- .../contract/service/impl/BmContractServiceImpl.java | 9 +++++++-- .../resources/mapper/material/device/DevInfoMapper.xml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/contract/service/BmContractService.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/contract/service/BmContractService.java index 3e1190d..0de52e0 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/contract/service/BmContractService.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/contract/service/BmContractService.java @@ -3,6 +3,7 @@ package com.bonus.material.contract.service; import com.bonus.material.contract.domain.BmContract; import com.bonus.material.device.domain.vo.DevInfoVo; +import java.io.UnsupportedEncodingException; import java.util.List; /** @@ -13,9 +14,9 @@ public interface BmContractService { List list(BmContract bmContract); - Integer add(BmContract bmContract); + Integer add(BmContract bmContract) throws UnsupportedEncodingException; - Integer edit(BmContract bmContract); + Integer edit(BmContract bmContract) throws UnsupportedEncodingException; Integer del(BmContract bmContract); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/contract/service/impl/BmContractServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/contract/service/impl/BmContractServiceImpl.java index 877c93b..1ac7cb0 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/contract/service/impl/BmContractServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/contract/service/impl/BmContractServiceImpl.java @@ -12,6 +12,9 @@ import com.bonus.material.device.mapper.BmFileInfoMapper; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @@ -42,7 +45,7 @@ public class BmContractServiceImpl implements BmContractService { } @Override - public Integer add(BmContract bmContract) { + public Integer add(BmContract bmContract) throws UnsupportedEncodingException { bmContract.setContractCode(getString()); bmContract.setOwnerId(SecurityUtils.getLoginUser().getUserid()); bmContract.setOwnerCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId()); @@ -55,6 +58,7 @@ public class BmContractServiceImpl implements BmContractService { bmFileInfo.setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT); // 合同照片附件 bmFileInfo.setFileType(0L); + bmFileInfo.setFileName(URLEncoder.encode(bmFileInfo.getFileName(), StandardCharsets.UTF_8.toString())); bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); bmFileInfoMapper.insertBmFileInfo(bmFileInfo); } @@ -64,7 +68,7 @@ public class BmContractServiceImpl implements BmContractService { } @Override - public Integer edit(BmContract bmContract) { + public Integer edit(BmContract bmContract) throws UnsupportedEncodingException { bmContract.setOwnerId(SecurityUtils.getLoginUser().getUserid()); bmContract.setOwnerCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId()); Integer edit = bmContractMapper.edit(bmContract); @@ -78,6 +82,7 @@ public class BmContractServiceImpl implements BmContractService { bmFileInfo.setTaskType(MaterialConstants.APPENDICES_OF_CONTRACT); // 合同照片附件 bmFileInfo.setFileType(0L); + bmFileInfo.setFileName(URLEncoder.encode(bmFileInfo.getFileName(), StandardCharsets.UTF_8.toString())); bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); bmFileInfoMapper.insertBmFileInfo(bmFileInfo); } diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index 9d161df..841a5b8 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -849,7 +849,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND d.type_id = #{typeId} - + AND d.update_time between #{startTime} and #{endTime} ORDER BY