lvzhiqiang il y a 1 an
Parent
commit
f5c2def9c2

+ 11 - 0
src/main/java/top/lvzhiqiang/entity/CoinCurrencyHolding.java

@@ -65,6 +65,11 @@ public class CoinCurrencyHolding implements Serializable {
     private BigDecimal currentAmount;
 
     /**
+     * 卖出总额
+     */
+    private BigDecimal sellAmount;
+
+    /**
      * 所属平台
      */
     private String exchangeCategory;
@@ -92,6 +97,12 @@ public class CoinCurrencyHolding implements Serializable {
     private LocalDateTime buyTime;
 
     /**
+     * 卖出时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime sellTime;
+
+    /**
      * 最后修改时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

+ 10 - 4
src/main/java/top/lvzhiqiang/mapper/CoinMapper.java

@@ -268,15 +268,18 @@ public interface CoinMapper {
     void insertOrUpdateBinanceOrderHistoryList(List<CoinBinanceOrderHistory> coinBinanceOrderHistoryList);
 
     @Select({"<script>" +
-            "select cch.*,cec.category_name exchangeCategory from coin_currency_holding cch left join coin_exchange_category cec on cch.exchange_category_id=cec.id WHERE cch.delete_flag = 1 and cch.status = 1" +
+            "select cch.*,cec.category_name exchangeCategory from coin_currency_holding cch left join coin_exchange_category cec on cch.exchange_category_id=cec.id WHERE cch.delete_flag = 1" +
             "<if test=\"keyword != null and keyword != ''\">" +
             "   and cch.symbol like concat('%',#{keyword},'%')" +
             "</if>" +
             "<if test=\"symbol != null and symbol != ''\">" +
             "   and cch.symbol = #{symbol}" +
             "</if>" +
+            "<if test=\"status != null and status != ''\">" +
+            "   and cch.status = #{status}" +
+            "</if>" +
             "<if test=\"categoryField != null and categoryField != ''\">" +
-            "   and cec.id = #{categoryField}" +
+            "   and cch.exchange_category_id = #{categoryField}" +
             "</if>" +
             " order by " +
             "<foreach collection='sortField' item='sf' index=\"index\" separator=\",\">" +
@@ -292,15 +295,18 @@ public interface CoinMapper {
     int updateCurrentHolding(CoinCurrencyHolding coinCurrencyHolding);
 
     @Select({"<script>" +
-            "select sum(current_amount) from coin_currency_holding cch WHERE cch.delete_flag = 1 and cch.status = 1" +
+            "select sum(current_amount) from coin_currency_holding cch WHERE cch.delete_flag = 1" +
             "<if test=\"keyword != null and keyword != ''\">" +
             "   and cch.symbol like concat('%',#{keyword},'%')" +
             "</if>" +
             "<if test=\"symbol != null and symbol != ''\">" +
             "   and cch.symbol = #{symbol}" +
             "</if>" +
+            "<if test=\"status != null and status != ''\">" +
+            "   and cch.status = #{status}" +
+            "</if>" +
             "<if test=\"categoryField != null and categoryField != ''\">" +
-            "   and cch.id = #{categoryField}" +
+            "   and cch.exchange_category_id = #{categoryField}" +
             "</if>" +
             "</script>"})
     BigDecimal getCurrentHoldingTotalAmout(Map<String, Object> params);

+ 6 - 1
src/main/resources/static/coin.html

@@ -388,6 +388,11 @@
             <select id="apis-quiet-div-currentHolding-categoryField" style="height: 24px;">
                 <option value="">--</option>
             </select>
+            <select id="apis-quiet-div-currentHolding-status" style="height: 24px;">
+                <option value="1">有效</option>
+                <option value="2">失效</option>
+                <option value="">全部</option>
+            </select>
             <select id="apis-quiet-div-currentHolding-sortField" style="height: 24px;">
                 <option value="cch.buy_time">买入时间</option>
                 <option value="cch.current_amount">当前金额</option>
@@ -507,7 +512,7 @@
         </div>
     </div>
     <div id="apis-quiet-content" style="display: none;">
-        total:<span class="contentSPAN">0</span>
+        total:<span class="contentSPAN">0</span><span class="contentSPAN2"></span>
         <audio controls style="display: none;">
             <source src="" type="audio/mpeg">
             您的浏览器不支持音频播放。

+ 18 - 2
src/main/resources/static/js/my-coin.js

@@ -284,6 +284,20 @@ function handleSelectChange(objj) {
                 $("#apis-quiet-content > audio")[0].load();
             }
 
+            if (nameEn === 'currentHolding') {
+                $("span.contentSPAN2").css("display", "inline");
+                $("span.contentSPAN2").dblclick(function () {
+                    if ($(this).html().includes("***")) {
+                        $(this).html($(this).attr("realV"));
+                    } else {
+                        $(this).html('  |  ' + "***");
+                    }
+                });
+            } else {
+                $("span.contentSPAN2").css("display", "none");
+                $("span.contentSPAN2").unbind("dblclick");
+            }
+
             $(obj).parent("div").next("div").find("span.contentSPAN").html('0');
             $(obj).parent("div").next("div").find("tr.contentTH").html(theadStr);
             $(obj).parent("div").next("div").find("tbody.contentTD").html('');
@@ -400,6 +414,7 @@ function mainSearch(url, nameEn, slideDiv, typetype, needCustomFlag) {
         jsonData.sortField = $("#apis-quiet-div-currentHolding-sortField").val();
         jsonData.sort = $("#apis-quiet-div-currentHolding-sort").val();
         jsonData.categoryField = $("#apis-quiet-div-currentHolding-categoryField").val();
+        jsonData.status = $("#apis-quiet-div-currentHolding-status").val();
     } else if (nameEn === 'bookmark') {
         jsonData.pageNo = $("#apis-quiet-div-bookmark-pageNo").val();
         jsonData.pageSize = $("#apis-quiet-div-bookmark-pageSize").val();
@@ -543,8 +558,9 @@ function getCurrentHoldingTotalAmout(jsonData) {
         success: function (data) {
             //请求成功时处理
             if (data != null && $.trim(data) != "" && data.success) {
-                let contentSPAN = $('#apis-quiet-content').find("span.contentSPAN");
-                contentSPAN.html(contentSPAN.html() + '  |  ' +data.data);
+                let contentSPAN2 = $('#apis-quiet-content').find("span.contentSPAN2");
+                contentSPAN2.attr("realV", '  |  ' + data.data);
+                contentSPAN2.html('  |  ' + "***");
             } else {
                 //alert(data.message);
             }