From ddd0ff224805e55f81e469630dd417f241012a7c Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 25 Sep 2024 18:45:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=812?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BasicdataPriceController.java | 31 ++++--------------- .../logpm/basicdata/enums/CostTypeEnums.java | 3 ++ .../impl/BasicdataClientServiceImpl.java | 5 +++ .../impl/BasicdataGoodsAreaServiceImpl.java | 19 ++++++------ 4 files changed, 23 insertions(+), 35 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java index 1839d7e0c..e58a9176e 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java @@ -23,39 +23,19 @@ import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteTable; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.logpm.basicdata.excel.price.BasicdataPriceCategoryBasicExcel; -import com.logpm.basicdata.excel.price.BasicdataPriceCategoryDispatchExcel; -import com.logpm.basicdata.excel.price.BasicdataPriceCategoryWarehouseExcel; -import com.logpm.basicdata.excel.price.BasicdataPriceExcel; -import com.logpm.basicdata.excel.price.BasicdataPriceFullVehicleExcel; -import com.logpm.basicdata.excel.price.BasicdataPriceGeneralExcel; +import com.logpm.basicdata.excel.price.*; import com.logpm.basicdata.service.IBasicdataPriceService; -import com.logpm.basicdata.vo.BasicdatPriceApiVO; -import com.logpm.basicdata.vo.BasicdataPriceBasicUpdateVO; -import com.logpm.basicdata.vo.BasicdataPricePageVO; -import com.logpm.basicdata.vo.PriceClientVO; -import com.logpm.basicdata.vo.PriceVO; +import com.logpm.basicdata.vo.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; -import org.apache.commons.codec.Charsets; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PatchMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import springfox.documentation.annotations.ApiIgnore; @@ -63,6 +43,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Map; @@ -184,8 +165,8 @@ public class BasicdataPriceController extends BladeController { try { String fileName = "基础价格表" + DateUtil.today(); response.setContentType("application/vnd.ms-excel"); - response.setCharacterEncoding(Charsets.UTF_8.name()); - fileName = URLEncoder.encode(fileName, Charsets.UTF_8.name()); + response.setCharacterEncoding(StandardCharsets.UTF_8.name()); + fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()); response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build(); WriteTable table1 = EasyExcel.writerTable(0).head(BasicdataPriceExcel.class).build(); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/CostTypeEnums.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/CostTypeEnums.java index ade4e508a..e8ccc63b5 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/CostTypeEnums.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/CostTypeEnums.java @@ -10,6 +10,9 @@ import org.springblade.common.model.IDict; */ public enum CostTypeEnums implements IDict { + /** + * 普通费 + */ NOMAL(1, "普通费"), ADD(2, "附加费"), ; diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java index 139021f08..ae925fe2c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java @@ -57,6 +57,7 @@ import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.RedisKeyConstant; import org.springblade.common.constant.basiccode.BasicCodeShowConstant; import org.springblade.common.constant.basiccode.BasicCodeTypeConstant; +import org.springblade.common.exception.CustomerException; import org.springblade.common.model.dto.NameDTO; import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.log.exception.ServiceException; @@ -690,6 +691,8 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl goodsAreaSheetInfoBeans = new LinkedList<>(); @@ -363,8 +362,8 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl goodsAreaSheetInfoBeans = new LinkedList<>(); @@ -415,8 +414,8 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl goodsAreaSheetInfoBeans = new LinkedList<>(); @@ -461,8 +460,8 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl goodsAreaSheetInfoBeans = new LinkedList<>();