Handy_Cao 3 years ago
parent
commit
0feae7cbfc

+ 75 - 12
public/proto/thj.proto

@@ -142,6 +142,27 @@ message LoginQueryRsp {
 	optional uint32 ServerLastNoticeId = 8; // 最大通知id
 }
 
+// 商品规则和费用
+message GoodsRuleAndFee {
+	optional int32 GoodsID = 1; // 商品ID
+	optional int32 CustomerTypeID = 2; // 保证金类别枚举值
+	repeated GoodsRule GoodsRuleList = 3; // 商品规则列表
+}
+
+// 通用查询参数信息
+message ParamValue {
+	optional string Key = 1; // 参数名
+	optional string Value = 2; // 参数值
+}
+
+// 商品规则类型
+message GoodsRule {
+	optional int32 Ruleid = 1; // 规则id
+	optional int32 GoodsID = 2; // 商品ID
+	optional string RuleName = 3; // 规则名称
+	optional double ParamValue = 4; // 参数值
+}
+
 // 账户信息
 message AccountInfo {
 	optional uint32 UserID = 1; // 用户ID
@@ -166,6 +187,19 @@ message TAAccountAll {
 	repeated uint32 MarketsIdList = 3; // 市场id数组
 }
 
+// 持仓头寸信息
+message TradePosition {
+	optional uint32 GoodsId = 1; // 商品id
+	optional uint32 BuyFrozenQty = 2; // 买持仓冻结
+	optional uint32 BuyOtherFrozenQty = 3; // 买持仓其他冻结
+	optional uint32 BuyCurPositionQty = 4; // 买当前持仓总数量
+	optional double BuyCurHolderAmount = 5; // 买当前持仓总金额
+	optional uint32 SellFrozenQty = 6; // 卖持仓冻结
+	optional uint32 SellOtherFrozenQty = 7; // 卖持仓其他冻结
+	optional uint32 SellCurPositionQty = 8; // 卖当前持仓总数量
+	optional double SellCurHolderAmount = 9; // 卖当前持仓总金额
+}
+
 // 资金账户信息
 message TaAccountInfo {
 	optional uint64 AccountId = 1; // 账户id
@@ -207,6 +241,15 @@ message MoneyChangedNtf {
 	optional uint64 AccountID = 3; // uint64 交易账号
 }
 
+// 公共通知消息头
+message NotifyHead {
+	optional int32 NtfMode = 1; // 消息通知模式(单播、组播、广播)
+	repeated uint32 ExcludeAcctIDs = 2; // 排除账号集合(首先过滤此集合帐号)
+	repeated uint32 ExchIDs = 3; // 目标交易所集合(若匹配所属交易所,推送)
+	repeated uint32 MemberIDs = 4; // 目标会员集合(若匹配所属会员,推送)
+	repeated uint64 AccountIDs = 5; // 目标账号集合(以上均不匹配时,最后检查此集合)
+}
+
 // 新增修改收货地址请求
 message UserReceiveInfoReq {
 	optional MessageHead Header = 1;
@@ -264,18 +307,18 @@ message UserReceiveIsDefaultRsp {
 // 新增修改用户发票信息请求
 message UserReceiptInfoReq {
 	optional MessageHead Header = 1;
-		optional uint64 ClientSerialID = 2; // 客户端唯一ID
-		optional uint32 UserID = 3; // 用户ID
-		optional string UserName = 4; // 发票抬头姓名
-		optional uint32 ReceiptType = 5; // 发票类型
-		optional string TaxpayerID = 6; // 纳税人识别号
-		optional string ContactInfo = 7; // 联系方式
-		optional uint64 ReceiptInfoId = 8; // 修改时填用户发票信息id
-		optional string ReceiptBank = 9; // 发票开户行[发票类型:企业]
-		optional string ReceiptAccount = 10; // 发票帐号[发票类型:企业]
-		optional string Address = 11; // 地址[发票类型:企业]
-		optional string IDNum = 12; // 身份证号码[发票类型:个人]
-		optional string Email = 13; // 收件邮箱
+	optional uint64 ClientSerialID = 2; // 客户端唯一ID
+	optional uint32 UserID = 3; // 用户ID
+	optional string UserName = 4; // 发票抬头姓名
+	optional uint32 ReceiptType = 5; // 发票类型
+	optional string TaxpayerID = 6; // 纳税人识别号
+	optional string ContactInfo = 7; // 联系方式
+	optional uint64 ReceiptInfoId = 8; // 修改时填用户发票信息id
+	optional string ReceiptBank = 9; // 发票开户行[发票类型:企业]
+	optional string ReceiptAccount = 10; // 发票帐号[发票类型:企业]
+	optional string Address = 11; // 地址[发票类型:企业]
+	optional string IDNum = 12; // 身份证号码[发票类型:个人]
+	optional string Email = 13; // 收件邮箱
 }
 
 // 新增修改用户发票信息请求响应
@@ -850,4 +893,24 @@ message SpotPresaleTransferDestingRsp {
 	optional uint32 UserID = 4; // 用户ID
 	optional uint64 TransferID = 5; // 协议转让ID
 	optional string ClientSerialNo = 6; // 客户端流水号
+}
+// 铁合金收益支取申请接口请求
+message THJProfitDrawApplyReq {
+	optional MessageHead Header = 1;
+	optional uint32 UserID = 2; // 用户ID,必填
+	optional string DrawMonth = 3; // 支取月份:格式yyyyMMeg:202209,必填
+	optional double DrawAmount = 4; // 支取金额,必填
+	optional uint32 ApplySrc = 5; // 申请来源-1:管理端
+	optional uint32 ApplyerID = 6; // 申请人
+	optional uint32 ClientType = 7; // 终端类型,如果申请来源为2则填写
+	optional string ClientSerialNo = 8; // 客户端流水号
+}
+// 铁合金收益支取申请接口响应
+message THJProfitDrawApplyRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+	optional uint32 UserID = 4; // 用户ID
+	optional uint64 ApplyID = 5; // 申请ID
+	optional string ClientSerialNo = 6; // 客户端流水号
 }

+ 35 - 0
src/business/trade/index.ts

@@ -14,6 +14,7 @@ import {
     spotPresaleBreachOfContractApply,
     hdWROrder,
     hdWRDealOrder,
+    thjProfitDrawApply,
 } from '@/services/api/trade'
 import { formatDate } from "@/filters";
 import Long from 'long'
@@ -401,4 +402,38 @@ export function useHdWRDealOrder() {
         formData,
         formSubmit,
     }
+}
+
+// 铁合金收益支取申请接口
+export function useTHJProfitDrawApplyReq() {
+    const loading = shallowRef(false)
+    const { getUserId, getLoginId } = useLoginStore()
+
+    const formData = reactive<Proto.THJProfitDrawApplyReq>({
+        UserID: getUserId(), // 用户ID
+        ApplySrc: ClientType.Web,
+        ApplyerID: getLoginId(),
+        ClientType: ClientType.Web
+    })
+
+    const onSubmit = (drawMonth: string, amount: number) => {
+        loading.value = true
+        return thjProfitDrawApply({
+            data: {
+                ...formData,
+                DrawMonth: drawMonth,
+                DrawAmount: amount,
+                ClientSerialNo: v4(),
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    return {
+        loading,
+        formData,
+        onSubmit,
+    }
 }

+ 2 - 0
src/constants/funcode.ts

@@ -79,4 +79,6 @@ export enum FunCode {
 	SpotPresaleTransferCancelRsp = 1441868,           /// 铁合金现货预售转让撤销接口响应(0, 22, 76)
 	SpotPresaleTransferDestingReq = 1441869,          /// 铁合金现货预售转让摘牌接口请求(0, 22, 77)
 	SpotPresaleTransferDestingRsp = 1441870,          /// 铁合金现货预售转让摘牌接口响应(0, 22, 78)
+	THJProfitDrawApplyReq = 1441871,                  /// 铁合金收益支取申请接口请求(0, 22, 79)
+	THJProfitDrawApplyRsp = 1441872,                  /// 铁合金收益支取申请接口响应(0, 22, 80)
 } 

+ 2 - 2
src/packages/mobile/views/contract/details/index.backup.vue

@@ -10,7 +10,7 @@
                         <app-select :options="deliveryDate" @confirm="onDateChange" />
                     </template>
                 </Field>
-                <Field label="交收日期" v-if="selectedDate?.enddate">
+                <Field label="到期日期" v-if="selectedDate?.enddate">
                     <template #input>
                         <span>{{ formatDate(selectedDate.enddate, 'YYYY-MM-DD') }}</span>
                     </template>
@@ -94,7 +94,7 @@ const goodsImages = computed(() => {
 // 表单验证规则
 const formRules: { [key in keyof Proto.SpotPresaleTransferDestingReq]?: FieldRule[] } = {
     TransferID: [{
-        message: '请选择交收日期',
+        message: '请选择到期日期',
         validator: () => {
             return !formData.TransferID?.equals(0)
         }

+ 1 - 1
src/packages/mobile/views/contract/details/index.vue

@@ -10,7 +10,7 @@
                         <app-select v-model="selectedMonth" :options="deliveryMonths" />
                     </template>
                 </Field>
-                <Field label="交收日期" v-if="selectedMonth">
+                <Field label="到期日期" v-if="selectedMonth">
                     <template #input>
                         <span>{{ formatDate(selectedMonth, 'YYYY-MM-DD') }}</span>
                     </template>

+ 39 - 7
src/packages/mobile/views/mine/generalize/components/promotion/index.vue

@@ -3,22 +3,28 @@
         @refresh="onRefresh" disabled>
         <app-list :columns="columns" :data-list="dataList" v-if="dataList.length" @click="onClick">
             <!-- 日期 -->
-            <template #profitmonth="{ value }">
+            <template #profitmonth="{ value}">
                 {{ formatDate(value, 'YYYY-MM') }}
             </template>
+            <!-- 操作 -->
+            <template #operate="{row}">
+                <Button type="primary" size="mini" @click="submit(row)">申请支取</Button>
+            </template>
         </app-list>
         <Empty v-if="!dataList.length"></Empty>
     </app-pull-refresh>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, watch } from 'vue'
+import { shallowRef, watch, computed } from 'vue'
 import { formatDate } from '@/filters'
 import { useQueryTHJPromotionIncome } from '@/business/order'
+import { useTHJProfitDrawApplyReq } from '@/business/trade'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
-import { Empty } from 'vant'
+import { Empty, Toast, Button } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
+import { fullloading, dialog } from '@/utils/vant'
 
 const props = defineProps({
     status: {
@@ -29,16 +35,25 @@ const props = defineProps({
 
 const { router } = useNavigation()
 const { pageIndex, pageCount, getTHJPromotionIncome } = useQueryTHJPromotionIncome()
+const { onSubmit } = useTHJProfitDrawApplyReq()
 const dataList = shallowRef<Model.THJPromotionIncomeRsp[]>([])
 const error = shallowRef(false)
 
 /// 下拉刷新
 const pullRefreshRef = shallowRef()
 
-const columns: Model.TableColumn[] = [
-    { prop: 'profitmonth', label: '时间' },
-    { prop: 'sumamount', label: '金额' },
-]
+const columns = computed<Model.TableColumn[]>(() => {
+    const result=[
+        { prop: 'profitmonth', label: '时间' },
+        { prop: 'sumamount', label: '金额' },
+    ]
+
+    if (props.status === 1) {
+        result.push({ prop: 'operate', label: '操作' })
+    }
+
+    return result
+})
 
 const onClick = (item: Model.THJPromotionIncomeRsp) => {
     router.push({ name: 'promotion-detail', params: { item: JSON.stringify(item) } })
@@ -58,6 +73,23 @@ const onRefresh = (finish: () => void) => {
     })
 }
 
+const submit = (item: Model.THJPromotionIncomeRsp) => {
+    dialog('确定要申请支取吗?', {
+        showCancelButton: true
+    }).then(() => {
+        fullloading((hideLoading) => {
+            onSubmit(item.profitmonth, item.sumamount).then(() => {
+                hideLoading()
+                dialog('请求成功,请耐心等待审核。').then(() => {
+                    router.back()
+                })
+            }).catch((err) => {
+                Toast.fail(err)
+            })
+        })
+    })
+}
+
 watch(() => props.status, () => {
     pullRefreshRef.value?.refresh()
 })

+ 4 - 4
src/packages/mobile/views/mine/generalize/index.vue

@@ -93,9 +93,9 @@ const dropdownTypes = computed(() => {
         }
         case 1: {
             return [
-                { text: '全部', value: 0 },
-                { text: '已支付', value: 1 },
-                { text: '未支付', value: 2 }
+                { text: '未支付', value: 1 },
+                { text: '支取中', value: 2 },
+                { text: '已支付', value: 3 }
             ]
         }
     }
@@ -112,7 +112,7 @@ const onMenuChange = () => {
     if (selectedMenu.value === 0) {
         selectedType.value = Market.THJ
     } else {
-        selectedType.value = 0
+        selectedType.value = 1
     }
 }
 

+ 1 - 1
src/packages/mobile/views/purchase/detail/index.backup.vue

@@ -195,7 +195,7 @@ const formRules: { [key in keyof Proto.SpotPresaleDestingOrderReq | 'addressInfo
     }],
     PresaleApplyID: [
         {
-            message: '请选择交收日期',
+            message: '请选择到期日期',
             validator: () => {
                 return !!formData.value.PresaleApplyID
             }

+ 2 - 2
src/packages/mobile/views/purchase/detail/index.vue

@@ -18,7 +18,7 @@
                             :optionProps="{ label: 'endmonth', value: 'presaleapplyid' }" @confirm="onMonthChange" />
                     </template>
                 </Field>
-                <Field label="交收日期" v-if="selectedDate?.presaleapplyid">
+                <Field label="到期日期" v-if="selectedDate?.presaleapplyid">
                     <template #input>
                         <span>{{ selectedDate.enddate }}</span>
                     </template>
@@ -189,7 +189,7 @@ const formRules: { [key in keyof Proto.SpotPresaleDestingOrderReq | 'addressInfo
         }
     }],
     PresaleApplyID: [{
-        message: '请选择交收日期',
+        message: '请选择到期日期',
         validator: () => {
             return !!formData.value.PresaleApplyID
         }

+ 7 - 0
src/services/api/trade/index.ts

@@ -84,4 +84,11 @@ export function spotPresaleTransferCancel(params: TradeParams<Proto.SpotPresaleT
  */
 export function spotPresaleTransferDesting(params: TradeParams<Proto.SpotPresaleTransferDestingReq, Proto.SpotPresaleTransferDestingRsp>) {
     return tradeServerRequest('SpotPresaleTransferDestingReq', 'SpotPresaleTransferDestingRsp', params, Market.THJ);
+}
+
+/**
+ * 铁合金收益支取申请接口请求
+ */
+ export function thjProfitDrawApply(params: TradeParams<Proto.THJProfitDrawApplyReq, Proto.THJProfitDrawApplyRsp>) {
+    return tradeServerRequest('THJProfitDrawApplyReq', 'THJProfitDrawApplyRsp', params, Market.THJ);
 }

+ 21 - 0
src/types/proto/trade.d.ts

@@ -349,5 +349,26 @@ declare global {
             TransferID: string; // 协议转让ID
             ClientSerialNo: string; // 客户端流水号
         }
+
+        // 铁合金收益支取申请接口请求
+        interface THJProfitDrawApplyReq {
+            Header?: IMessageHead; // 消息头
+            UserID?: number; // 用户ID,必填
+            DrawMonth?: string; // 支取月份:格式yyyyMMeg:202209,必填
+            DrawAmount?: number; // 支取金额,必填
+            ApplySrc?: number; // 申请来源-1:管理端
+            ApplyerID?: number; // 申请人
+            ClientType?: number; // 终端类型,如果申请来源为2则填写
+            ClientSerialNo?: string; // 客户端流水号
+        }
+        // 铁合金收益支取申请接口响应
+        interface THJProfitDrawApplyRsp {
+            Header?: IMessageHead; // 消息头
+            RetCode?: number; // 返回码
+            RetDesc?: string; // 描述信息
+            UserID?: number; // 用户ID
+            ApplyID?: number;// 申请ID
+            ClientSerialN?: string; // 客户端流水号
+        }
     }
 }