liuchaojie há 4 anos atrás
pai
commit
ba51108ba5

+ 1 - 1
src/main/java/com/xc/pojo/Stock.java

@@ -18,7 +18,7 @@ public class Stock {
     private Date addTime;//添加时间
     //新增参数
     private Integer depositAmt;//一手保证金
-    private Integer transFee;//购买手续费
+    private BigDecimal transFee;//购买手续费
     private Integer buyMinNum;//最小交易手数
     private Integer buyMaxNum;//最大交易手数
     private String transAmBegin;//上午开始交易时间

+ 2 - 2
src/main/java/com/xc/service/impl/UserPositionServiceImpl.java

@@ -594,7 +594,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
             BigDecimal buy_amt_autual = buyOrderPrice.multiply(new BigDecimal(buyNum));
             log.info("用户可用金额 = {}  实际购买金额 =  {}", user_enable_amt, buy_amt_autual);
             // 手续费
-            BigDecimal position_freez = new BigDecimal(buyNum * stock.getTransFee());
+            BigDecimal position_freez = new BigDecimal(buyNum).multiply(stock.getTransFee());
             //冻结保证金
             BigDecimal depositFreezeAmt = buyOrderPrice.multiply(new BigDecimal(stock.getContractSize())).multiply(new BigDecimal(buyNum)).divide(new BigDecimal(stock.getSiteLever()), 2, 4);
             log.info("冻结保证金 = " + depositFreezeAmt);
@@ -722,7 +722,7 @@ public class UserPositionServiceImpl implements IUserPositionService {
         BigDecimal user_amt = user.getUserAmt();
         // 判断金额是否能够买得起   用 可用金额 > 冻结金额 + 手续费 则标示可以购买
         // 手续费
-        BigDecimal position_freez = new BigDecimal(buyNum * stock.getTransFee());
+        BigDecimal position_freez = new BigDecimal(buyNum).multiply(stock.getTransFee());
         log.info("手续费 = " + position_freez);
         //冻结保证金 = 现价* 合约单位 * 手数 / 杠杆
         BigDecimal depositFreezeAmt = nowPrice.multiply(new BigDecimal(stock.getContractSize())).multiply(new BigDecimal(buyNum)).divide(new BigDecimal(stock.getSiteLever()), 2, 4);

+ 3 - 3
src/main/java/mappers/StockMapper.xml

@@ -128,7 +128,7 @@
        	  	      	#{isShow,jdbcType=INTEGER},
        	  	      	#{addTime,jdbcType=TIMESTAMP},
        	  	      	#{depositAmt,jdbcType=INTEGER},
-       	  	      	#{transFee,jdbcType=INTEGER},
+       	  	      	#{transFee,jdbcType=DECIMAL},
        	  	      	#{buyMinNum,jdbcType=INTEGER},
        	  	      	#{buyMaxNum,jdbcType=INTEGER},
        	  	      	#{transAmBegin,jdbcType=VARCHAR},
@@ -294,7 +294,7 @@
                 #{depositAmt,jdbcType=INTEGER},
             </if>
             <if test="transFee != null">
-                #{transFee,jdbcType=INTEGER},
+                #{transFee,jdbcType=DECIMAL},
             </if>
             <if test="buyMinNum != null">
                 #{buyMinNum,jdbcType=INTEGER},
@@ -399,7 +399,7 @@
                 depositAmt = #{depositAmt,jdbcType=INTEGER},
             </if>
             <if test="transFee != null">
-                transFee = #{transFee,jdbcType=INTEGER},
+                transFee = #{transFee,jdbcType=DECIMAL},
             </if>
             <if test="buyMinNum != null">
                 buyMinNum = #{buyMinNum,jdbcType=INTEGER},