Ver código fonte

设备信息

bing 1 ano atrás
pai
commit
a8ae998214

+ 21 - 19
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/consumption/domain/XfTerm.java

@@ -4,6 +4,8 @@ import org.dromara.common.tenant.core.TenantEntity;
 import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
 import java.util.Date;
 
 import java.io.Serial;
@@ -161,72 +163,72 @@ public class XfTerm extends TenantEntity {
     /**
      * 卡上最大金额
      */
-    private Long maxCardMoney;
+    private BigDecimal maxCardMoney;
 
     /**
      * 定值消费金额
      */
-    private Long constantValue;
+    private BigDecimal constantValue;
 
     /**
      * 编号0代表的金额
      */
-    private Long rationZero;
+    private BigDecimal rationZero;
 
     /**
      * 编号1代表的金额
      */
-    private Long rationOne;
+    private BigDecimal rationOne;
 
     /**
      * 编号2代表的金额
      */
-    private Long rationTwo;
+    private BigDecimal rationTwo;
 
     /**
      * 编号3代表的金额
      */
-    private Long rationThree;
+    private BigDecimal rationThree;
 
     /**
      * 编号4代表的金额
      */
-    private Long rationFour;
+    private BigDecimal rationFour;
 
     /**
      * 编号5代表的金额
      */
-    private Long rationFive;
+    private BigDecimal rationFive;
 
     /**
      * 编号6代表的金额
      */
-    private Long rationSix;
+    private BigDecimal rationSix;
 
     /**
      * 编号7代表的金额
      */
-    private Long rationSeven;
+    private BigDecimal rationSeven;
 
     /**
      * 编号8代表的金额
      */
-    private Long rationEight;
+    private BigDecimal rationEight;
 
     /**
      * 编号9代表的金额
      */
-    private Long rationNine;
+    private BigDecimal rationNine;
 
     /**
      * 每天最大消费次数,0-不限
      */
-    private Long dayCount;
+    private BigDecimal dayCount;
 
     /**
      * 每天最大消费金额
      */
-    private Long dayMoney;
+    private BigDecimal dayMoney;
 
     /**
      * 每餐最大消费次数,0-不限
@@ -236,27 +238,27 @@ public class XfTerm extends TenantEntity {
     /**
      * 单次最大消费金额
      */
-    private Long singleMoney;
+    private BigDecimal singleMoney;
 
     /**
      * 早餐消费金额
      */
-    private Long breakfastMoney;
+    private BigDecimal breakfastMoney;
 
     /**
      * 午餐消费金额
      */
-    private Long lunchMoney;
+    private BigDecimal lunchMoney;
 
     /**
      * 晚餐消费金额
      */
-    private Long supperMoney;
+    private BigDecimal supperMoney;
 
     /**
      * 夜宵消费金额
      */
-    private Long nightMoney;
+    private BigDecimal nightMoney;
 
     /**
      * 早餐开始时间

+ 19 - 18
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/consumption/domain/bo/XfTermBo.java

@@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
 import jakarta.validation.constraints.*;
 
 import java.io.Serial;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -177,62 +178,62 @@ public class XfTermBo extends BaseEntity {
      * 卡上最大金额
      */
 //    @NotNull(message = "卡上最大金额不能为空", groups = { AddGroup.class, EditGroup.class })
-    private Long maxCardMoney;
+    private BigDecimal maxCardMoney;
 
     /**
      * 定值消费金额
      */
-    private Long constantValue;
+    private BigDecimal constantValue;
 
     /**
      * 编号0代表的金额
      */
-    private Long rationZero;
+    private BigDecimal rationZero;
 
     /**
      * 编号1代表的金额
      */
-    private Long rationOne;
+    private BigDecimal rationOne;
 
     /**
      * 编号2代表的金额
      */
-    private Long rationTwo;
+    private BigDecimal rationTwo;
 
     /**
      * 编号3代表的金额
      */
-    private Long rationThree;
+    private BigDecimal rationThree;
 
     /**
      * 编号4代表的金额
      */
-    private Long rationFour;
+    private BigDecimal rationFour;
 
     /**
      * 编号5代表的金额
      */
-    private Long rationFive;
+    private BigDecimal rationFive;
 
     /**
      * 编号6代表的金额
      */
-    private Long rationSix;
+    private BigDecimal rationSix;
 
     /**
      * 编号7代表的金额
      */
-    private Long rationSeven;
+    private BigDecimal rationSeven;
 
     /**
      * 编号8代表的金额
      */
-    private Long rationEight;
+    private BigDecimal rationEight;
 
     /**
      * 编号9代表的金额
      */
-    private Long rationNine;
+    private BigDecimal rationNine;
 
     /**
      * 每天最大消费次数,0-不限
@@ -247,32 +248,32 @@ public class XfTermBo extends BaseEntity {
     /**
      * 每餐最大消费次数,0-不限
      */
-    private Long mealCount;
+    private BigDecimal mealCount;
 
     /**
      * 单次最大消费金额
      */
-    private Long singleMoney;
+    private BigDecimal singleMoney;
 
     /**
      * 早餐消费金额
      */
-    private Long breakfastMoney;
+    private BigDecimal breakfastMoney;
 
     /**
      * 午餐消费金额
      */
-    private Long lunchMoney;
+    private BigDecimal lunchMoney;
 
     /**
      * 晚餐消费金额
      */
-    private Long supperMoney;
+    private BigDecimal supperMoney;
 
     /**
      * 夜宵消费金额
      */
-    private Long nightMoney;
+    private BigDecimal nightMoney;
 
     /**
      * 早餐开始时间

+ 19 - 18
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/consumption/domain/bo/XfTermParamBo.java

@@ -10,6 +10,7 @@ import org.dromara.common.core.validate.AddGroup;
 import org.dromara.common.core.validate.EditGroup;
 import org.dromara.common.mybatis.core.domain.BaseEntity;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -166,62 +167,62 @@ public class XfTermParamBo extends BaseEntity {
      * 卡上最大金额
      */
     @NotNull(message = "卡上最大金额不能为空")
-    private Long maxCardMoney;
+    private BigDecimal maxCardMoney;
 
     /**
      * 定值消费金额
      */
-    private Long constantValue;
+    private BigDecimal constantValue;
 
     /**
      * 编号0代表的金额
      */
-    private Long rationZero;
+    private BigDecimal rationZero;
 
     /**
      * 编号1代表的金额
      */
-    private Long rationOne;
+    private BigDecimal rationOne;
 
     /**
      * 编号2代表的金额
      */
-    private Long rationTwo;
+    private BigDecimal rationTwo;
 
     /**
      * 编号3代表的金额
      */
-    private Long rationThree;
+    private BigDecimal rationThree;
 
     /**
      * 编号4代表的金额
      */
-    private Long rationFour;
+    private BigDecimal rationFour;
 
     /**
      * 编号5代表的金额
      */
-    private Long rationFive;
+    private BigDecimal rationFive;
 
     /**
      * 编号6代表的金额
      */
-    private Long rationSix;
+    private BigDecimal rationSix;
 
     /**
      * 编号7代表的金额
      */
-    private Long rationSeven;
+    private BigDecimal rationSeven;
 
     /**
      * 编号8代表的金额
      */
-    private Long rationEight;
+    private BigDecimal rationEight;
 
     /**
      * 编号9代表的金额
      */
-    private Long rationNine;
+    private BigDecimal rationNine;
 
     /**
      * 每天最大消费次数,0-不限
@@ -231,7 +232,7 @@ public class XfTermParamBo extends BaseEntity {
     /**
      * 每天最大消费金额
      */
-    private Long dayMoney;
+    private BigDecimal dayMoney;
 
     /**
      * 每餐最大消费次数,0-不限
@@ -241,27 +242,27 @@ public class XfTermParamBo extends BaseEntity {
     /**
      * 单次最大消费金额
      */
-    private Long singleMoney;
+    private BigDecimal singleMoney;
 
     /**
      * 早餐消费金额
      */
-    private Long breakfastMoney;
+    private BigDecimal breakfastMoney;
 
     /**
      * 午餐消费金额
      */
-    private Long lunchMoney;
+    private BigDecimal lunchMoney;
 
     /**
      * 晚餐消费金额
      */
-    private Long supperMoney;
+    private BigDecimal supperMoney;
 
     /**
      * 夜宵消费金额
      */
-    private Long nightMoney;
+    private BigDecimal nightMoney;
 
     /**
      * 早餐开始时间

+ 19 - 18
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/consumption/domain/vo/XfTermParamVo.java

@@ -13,6 +13,7 @@ import org.dromara.common.excel.convert.ExcelDictConvert;
 
 import java.io.Serial;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 
@@ -167,62 +168,62 @@ public class XfTermParamVo implements Serializable {
     /**
      * 卡上最大金额
      */
-    private Long maxCardMoney;
+    private BigDecimal maxCardMoney;
 
     /**
      * 定值消费金额
      */
-    private Long constantValue;
+    private BigDecimal constantValue;
 
     /**
      * 编号0代表的金额
      */
-    private Long rationZero;
+    private BigDecimal rationZero;
 
     /**
      * 编号1代表的金额
      */
-    private Long rationOne;
+    private BigDecimal rationOne;
 
     /**
      * 编号2代表的金额
      */
-    private Long rationTwo;
+    private BigDecimal rationTwo;
 
     /**
      * 编号3代表的金额
      */
-    private Long rationThree;
+    private BigDecimal rationThree;
 
     /**
      * 编号4代表的金额
      */
-    private Long rationFour;
+    private BigDecimal rationFour;
 
     /**
      * 编号5代表的金额
      */
-    private Long rationFive;
+    private BigDecimal rationFive;
 
     /**
      * 编号6代表的金额
      */
-    private Long rationSix;
+    private BigDecimal rationSix;
 
     /**
      * 编号7代表的金额
      */
-    private Long rationSeven;
+    private BigDecimal rationSeven;
 
     /**
      * 编号8代表的金额
      */
-    private Long rationEight;
+    private BigDecimal rationEight;
 
     /**
      * 编号9代表的金额
      */
-    private Long rationNine;
+    private BigDecimal rationNine;
 
     /**
      * 每天最大消费次数,0-不限
@@ -232,7 +233,7 @@ public class XfTermParamVo implements Serializable {
     /**
      * 每天最大消费金额
      */
-    private Long dayMoney;
+    private BigDecimal dayMoney;
 
     /**
      * 每餐最大消费次数,0-不限
@@ -242,27 +243,27 @@ public class XfTermParamVo implements Serializable {
     /**
      * 单次最大消费金额
      */
-    private Long singleMoney;
+    private BigDecimal singleMoney;
 
     /**
      * 早餐消费金额
      */
-    private Long breakfastMoney;
+    private BigDecimal breakfastMoney;
 
     /**
      * 午餐消费金额
      */
-    private Long lunchMoney;
+    private BigDecimal lunchMoney;
 
     /**
      * 晚餐消费金额
      */
-    private Long supperMoney;
+    private BigDecimal supperMoney;
 
     /**
      * 夜宵消费金额
      */
-    private Long nightMoney;
+    private BigDecimal nightMoney;
 
     /**
      * 早餐开始时间

+ 12 - 4
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/payment/service/impl/PtUserAccountServiceImpl.java

@@ -9,7 +9,6 @@ import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.backstage.cardCenter.service.IPtCardService;
 import org.dromara.backstage.payment.domain.vo.PtUserAccount4SelectVo;
 import org.dromara.backstage.payment.service.IPtBagService;
-import org.dromara.common.core.domain.R;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.core.utils.file.FileUtils;
@@ -88,7 +87,10 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
     @Override
     public TableDataInfo<PtUserAccount4SelectVo> queryPageList4Select(PtUserAccountBo bo, PageQuery pageQuery) {
         // 方法1. 使用子查询,使得where 后 只有一个表(效率会低点) 方法2. 使用queryWrapper 自己指定字段,字段名带表别名
-        QueryWrapper<PtUserAccount> wrapper = buildQueryWrapper(bo, "u");
+        QueryWrapper<PtUserAccount> wrapper = buildQueryWrapper4Select(bo, "u");
+        if(bo.getDeptId() != null){
+            wrapper.and(wrapper1 -> wrapper1.eq("u.dept_id", bo.getDeptId()).or().like("a.ancestors", bo.getDeptId()));
+        }
         wrapper.orderByAsc("u.dept_id").orderByAsc("u.user_id");
         Page<PtUserAccount4SelectVo> result = baseMapper.customPageList(pageQuery.build(), wrapper);
         return TableDataInfo.build(result);
@@ -142,14 +144,20 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
         return lqw;
     }
 
-    private QueryWrapper<PtUserAccount> buildQueryWrapper(PtUserAccountBo bo,String tableAlias) {
+    /**
+     * 给一卡通账户列表查询条件使用
+     * @param bo
+     * @param tableAlias
+     * @return
+     */
+    private QueryWrapper<PtUserAccount> buildQueryWrapper4Select(PtUserAccountBo bo, String tableAlias) {
         QueryWrapper<PtUserAccount> wrapper = new QueryWrapper<>();
         String columnPrefix = "";
         if(StringUtils.isNotBlank(tableAlias)){
             columnPrefix = tableAlias + ".";
         }
         wrapper.eq(bo.getPostId() != null, columnPrefix+"post_id", bo.getPostId());
-        wrapper.eq(bo.getDeptId() != null, columnPrefix+"dept_id", bo.getDeptId());
+//        wrapper.like(bo.getDeptId() != null, columnPrefix+"dept_id", bo.getDeptId());
         wrapper.eq(StringUtils.isNotBlank(bo.getUserNumb()), columnPrefix+"user_numb", bo.getUserNumb());
         wrapper.like(StringUtils.isNotBlank(bo.getRealName()), columnPrefix+"real_name", bo.getRealName());
         wrapper.eq(StringUtils.isNotBlank(bo.getAccountStatus()), columnPrefix+"account_status", bo.getAccountStatus());