Browse Source

银行缴费接口整理

yuedefeng 6 năm trước cách đây
mục cha
commit
8de40bcaaa

+ 5 - 4
src/dashoo.cn/backend/api/business/bankapi/ICBCService.go

@@ -65,13 +65,13 @@ func (s *ICBCService) AuthToken() string {
 	//先登录
 	tokenParams, _ := json.Marshal(user4CreateToken)
 	strTokenParams := string(tokenParams)
-	retToken := s.Post("/", strTokenParams, "")
+	retToken := s.Post("/auth", strTokenParams, "")
 	p, _ := ioutil.ReadAll(retToken.Body)
 	json.Unmarshal(p, &userToken)
 	return userToken.Token
 }
 
-func (s *ICBCService) GetBillList(commercialNo string) string {
+func (s *ICBCService) GetBillList(commercialNo string) []byte {
 	fmt.Println(commercialNo)
 	myToken := s.AuthToken()
 
@@ -79,7 +79,8 @@ func (s *ICBCService) GetBillList(commercialNo string) string {
 	billQueryParam.CommercialNo = commercialNo
 	queryJson, _ := json.Marshal(billQueryParam)
 	queryParams := string(queryJson)
-	retVal := s.Post("/get-bill-list", queryParams, myToken)
+	retVal := s.Post("/paymentinfo/get-bill-list", queryParams, myToken)
 	p, _ := ioutil.ReadAll(retVal.Body)
-	return string(p)
+	fmt.Println(string(p))
+	return p
 }

+ 1 - 1
src/dashoo.cn/backend/api/conf/app.conf

@@ -88,4 +88,4 @@ AposeUrl=http://47.92.212.59:8080/acti-api/api/apose
 BaseUrl=http://47.92.212.59:8080/acti-api/api/acti
 
 [bank]
-callbackHost=http://localhost:10091/api/
+callbackHost=http://localhost:10091/api

+ 3 - 2
src/dashoo.cn/backend/api/controllers/bankapi/icbc.go

@@ -23,8 +23,9 @@ func (this *ICBCController) GetBillList() {
 	var icbcBillQueryParam bankapi.ICBCBillQueryParam
 	json.Unmarshal(this.Ctx.Input.RequestBody, &icbcBillQueryParam)
 	svc := bankapi.GetICBCService(utils.DBE)
+	var datainfo DataInfo
 	ret := svc.GetBillList(icbcBillQueryParam.CommercialNo)
-
-	this.Data["json"] = ret
+	json.Unmarshal(ret, &datainfo)
+	this.Data["json"] = &datainfo
 	this.ServeJSON()
 }

+ 34 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/paymentinfo.go

@@ -1,6 +1,8 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/bankapi"
+	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/paymentinfo"
 	. "dashoo.cn/backend/api/controllers"
@@ -9,6 +11,7 @@ import (
 	"encoding/json"
 	"strconv"
 	"time"
+	"wayne-master/src/backend/util/integer"
 )
 
 type PaymentInfoController struct {
@@ -63,6 +66,37 @@ func (this *PaymentInfoController) GetEntityList() {
 	this.ServeJSON()
 }
 
+// @Title 获取列表
+// @Description get user by token
+// @Success 200 {object} []paymentinfo.PaymentinfoList
+// @router /get-bill-list [post]
+func (this *PaymentInfoController) GetBillList() {
+
+	var icbcBillQueryParam bankapi.ICBCBillQueryParam
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &icbcBillQueryParam)
+
+	var supplierEntity supplier.OilSupplier
+	supplierSvc := supplier.GetOilSupplierService(utils.DBE)
+	supplierWhere := "1=1 and CommercialNo='"+ icbcBillQueryParam.CommercialNo +"'"
+	supplierSvc.DBE.Where(supplierWhere).Get(&supplierEntity)
+
+	var billList []paymentinfo.OilPaymentInfo
+	billWhere := "1=1 and SupplierId='" + strconv.Itoa(supplierEntity.Id) +"'"
+	svc := paymentinfo.GetPaymentService(utils.DBE)
+	svc.DBE.Where(billWhere).OrderBy("Id DESC").Find(&billList)
+
+	//获取分页信息
+	//page := this.GetPageInfoForm()
+	var datainfo DataInfo
+	datainfo.Items = billList
+	datainfo.CurrentItemCount = integer.Int2Int64(len(billList))
+	datainfo.PageIndex = 1
+	datainfo.ItemsPerPage = 1000
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 获取实体
 // @Description 获取实体
 // @Success 200 {object} paymentinfo.PaymentinfoList

+ 7 - 0
src/dashoo.cn/backend/api/routers/router.go

@@ -5,6 +5,7 @@ package routers
 
 import (
 	"dashoo.cn/backend/api/controllers"
+	"dashoo.cn/backend/api/controllers/bankapi"
 	"dashoo.cn/backend/api/controllers/casbin"
 	"dashoo.cn/backend/api/controllers/document"
 	"dashoo.cn/backend/api/controllers/oilsupplier"
@@ -384,6 +385,12 @@ func init() {
 				&rtx.RtxController{},
 			),
 		),
+		//bankapi
+		beego.NSNamespace("/bankapi",
+			beego.NSInclude(
+				&bankapi.ICBCController{},
+			),
+		),
 	)
 	beego.AddNamespace(ns)
 }

+ 9 - 0
src/dashoo.cn/frontend_web/src/api/bankapi/icbc.js

@@ -0,0 +1,9 @@
+export default {
+  getBillList (params, myAxios) {
+    return myAxios({
+      url: '/bankapi/bill-list',
+      method: 'post',
+      data: params
+    })
+  }
+}

+ 260 - 0
src/dashoo.cn/frontend_web/src/pages/oilbank/icbclist.vue

@@ -0,0 +1,260 @@
+<template>
+  <div>
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item>银行账单</el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-card class="box-card">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> 供应商账单
+        </span>
+        <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
+          <el-form-item label="组织机构代码">
+            <el-input v-model="searchForm.commercialNo" size="small" placeholder="请输入" style="width: 100%"></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" size="mini" icon="el-icon-search" @click="handleSearch">获取账单</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <el-form label-width="120px" :inline="true">
+        <el-form-item label="企业名称">
+          <span>上海国际会议中心</span>
+        </el-form-item>
+        <el-form-item label="组织机构代码">
+          <span>9999999</span>
+        </el-form-item>
+        <el-form-item label="缴费总金额">
+          <span style="font-weight: bold; color: red;">10000 元</span>
+        </el-form-item>
+        <el-form-item label="">
+          <el-button type="primary" icon="el-icon-money" @click="handleGetMoney">收款成功</el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+    <el-card class="box-card" style="height: calc(100vh - 115px);">
+      <el-table :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="SupplierName" label="企业名称"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="SupplierTypeName" label="项目类型"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="PayType" label="缴费类型">
+          <template slot-scope="scope">
+            {{ transferStr(scope.row.PayType) }}
+          </template>
+        </el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Amount" label="缴费金额">
+        </el-table-column>
+      </el-table>
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                     :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+                     :total="currentItemCount">
+      </el-pagination>
+    </el-card>
+
+  </div>
+</template>
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+  import api from '@/api/bankapi/icbc'
+
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser'
+      })
+    },
+    name: 'paymentinfo',
+
+    data () {
+      return {
+        dialogVisible: false,
+        delevisble: false,
+        // 列表数据
+        selectsupplierlist: [],
+        entityList: [],
+        // 分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+        // 列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
+        // 工作流
+        entrydetail: {
+          process: 'oil_audit_apply',
+          business: '',
+          instance: ''
+        },
+        // 查询时间
+        CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
+        // 查询项
+        searchFormReset: {},
+        entityForm: {
+          Id: '',
+          SupplierName: '',
+          SupplierId: '',
+          SupplierTypeName: ''
+        },
+        searchForm: {
+          commercialNo: ''
+
+        }
+      }
+    },
+    created () {
+      // 查询条件初始值备份
+      // Object.assign(this.searchFormReset, this.searchForm)
+      // 查询列表
+      // this.initDatas()
+      // this.getDictOptions()
+    },
+    methods: {
+      initDatas () {
+        // 分页及列表条件
+        let params = {
+          commercialNo: this.searchForm.commercialNo,
+        }
+        // 访问接口
+        api.getBillList(params, this.$axios).then(res => {
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      getDictOptions () {
+        api.getDictList(this.$axios).then(res => {
+          // this.dictOptions.customerList = res.data.items['customerList']
+          // this.dictOptions.projectList = res.data.items['projectList']
+
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      searchCommand (command) {
+        if (command === 'search') {
+          this.dialogVisible = true
+        } else if (command === 'clear') {
+          this.clearSearch()
+        }
+      },
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order === 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initDatas()
+      },
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
+        this.CreateOn = ''
+        this.initDatas()
+      },
+
+      transferStr (val) {
+        if (val === '1') {
+          return '准入缴费'
+        }else if (val === '2') {
+          return '年审缴费'
+        }else if (val === '3') {
+          return '增项缴费'
+        } else {
+          return val
+        }
+      },
+      handleGetMoney () {
+        let idlist = ''
+        for (let idx in this.entityList) {
+          idlist += this.entityList[idx].Id + ','
+        }
+        let params = {
+          ids: idlist,
+        }
+        //下面调用接口修改状态
+
+      },
+
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
+      },
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.initDatas()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.initDatas()
+      },
+      deleteEntity (row) {
+        api.deleteEntity(row.Id, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.initDatas()
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      GetCommand (cmdType, row) {
+        let cmd = {}
+        cmd.Command = cmdType
+        cmd.row = row
+        return cmd
+      },
+
+      jstimehandle (val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      },
+
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+
+</style>