Explorar o código

fix 货币查询返回值扩充

classic_blue hai 1 semana
pai
achega
c68b6a267a

+ 2 - 4
fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/CurrencyServiceImpl.java

@@ -74,7 +74,6 @@ public class CurrencyServiceImpl extends ServiceImpl<MtCurrencyMapper, MtCurrenc
     @Override
     public PageResult<CurrencyVo> getCurrencyById(String name, PageParam pageParam) {
         IPage<MtCurrency> mtCurrencyIPage = this.baseMapper.selectPage(new Page<>(pageParam.getPage(), pageParam.getPageSize()), new LambdaQueryWrapper<MtCurrency>()
-                .select(MtCurrency::getId, MtCurrency::getName)
                 .like(StringUtils.isNotBlank(name),MtCurrency::getName, name));
         List<CurrencyVo> currencyVos = mtCurrencyIPage.getRecords().stream().map(mtCurrency -> {
             CurrencyVo currencyVo = new CurrencyVo();
@@ -92,9 +91,8 @@ public class CurrencyServiceImpl extends ServiceImpl<MtCurrencyMapper, MtCurrenc
     @Override
     public List<CurrencyVo> allList(String name) {
         //获取货币列表,可根据名称模糊查询
-        List<MtCurrency> mtCurrencies = this.baseMapper.selectList(new LambdaQueryWrapper<MtCurrency>()
-                .select(MtCurrency::getId, MtCurrency::getName)
-                .likeRight(StringUtils.isNotBlank(name), MtCurrency::getName, name));
+        List<MtCurrency> mtCurrencies = this.list(new LambdaQueryWrapper<MtCurrency>()
+                .like(StringUtils.isNotBlank(name), MtCurrency::getName, name));
         //将MtCurrency复制到CurrencyVo并返回
 	    return mtCurrencies.stream().map(mtCurrency -> {
             CurrencyVo currencyVo = new CurrencyVo();

+ 11 - 0
fuintBackend/fuint-application/src/main/java/com/fuint/common/vo/CurrencyVo.java

@@ -1,10 +1,14 @@
 package com.fuint.common.vo;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
+
 @Data
 public class CurrencyVo {
 	@ApiModelProperty("id")
@@ -12,4 +16,11 @@ public class CurrencyVo {
 
 	@ApiModelProperty("货币名称")
 	private String name;
+
+	@ApiModelProperty("货币符号")
+	private String symbol;
+
+	@ApiModelProperty("创建时间")
+	private Date createTime;
+
 }

+ 5 - 0
fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendFileController.java

@@ -195,6 +195,7 @@ package com.fuint.module.backendApi.controller;
 
 import com.fuint.common.dto.AccountInfo;
 import com.fuint.common.service.SettingService;
+import com.fuint.common.util.AuthUserUtil;
 import com.fuint.common.util.CommonUtil;
 import com.fuint.common.util.DateUtil;
 import com.fuint.common.util.TokenUtil;
@@ -258,6 +259,10 @@ public class BackendFileController extends BaseController {
 //        if (accountInfo == null) {
 //            return getFailureResult(1001, "请先登录");
 //        }
+        AccountInfo accountInfo = AuthUserUtil.get();
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        }
 
         // 校验上传的文件是否为空
         if (file == null || file.isEmpty()) {

+ 1 - 1
fuintBackend/fuint-repository/src/main/java/com/fuint/repository/model/MtCurrency.java

@@ -36,7 +36,7 @@ public class MtCurrency implements Serializable {
     private Integer deleteFlag;
 
     @ApiModelProperty("id")
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "ID", type = IdType.ID_WORKER)
     private Long id;
 
     @ApiModelProperty("货币名称")