作者 yangfu

Merge branch 'feature_order_number' into test

  1 +apiVersion: v1
  2 +kind: Service
  3 +metadata:
  4 + name: allied-creation-gateway
  5 + namespace: mmm-suplus-prd
  6 + labels:
  7 + k8s-app: allied-creation-gateway
  8 +spec:
  9 + ports:
  10 + - name: "http"
  11 + port: 80
  12 + targetPort: 8082
  13 + - name: "https"
  14 + port: 443
  15 + targetPort: 443
  16 + selector:
  17 + k8s-app: allied-creation-gateway
  18 +---
  19 +apiVersion: extensions/v1beta1
  20 +kind: Deployment
  21 +metadata:
  22 + name: allied-creation-gateway
  23 + namespace: mmm-suplus-prd
  24 + labels:
  25 + k8s-app: allied-creation-gateway
  26 +spec:
  27 + replicas: 1
  28 + template:
  29 + metadata:
  30 + labels:
  31 + k8s-app: allied-creation-gateway
  32 + spec:
  33 + affinity:
  34 + nodeAffinity:
  35 + preferredDuringSchedulingIgnoredDuringExecution:
  36 + - preference: {}
  37 + weight: 100
  38 + requiredDuringSchedulingIgnoredDuringExecution:
  39 + nodeSelectorTerms:
  40 + - matchExpressions:
  41 + - key: kubernetes.io/hostname
  42 + operator: In
  43 + values:
  44 + - cn-hangzhou.i-bp1djh1xn7taumbue1ze
  45 + - cn-hangzhou.i-bp1djh1xn7taumbue1zd
  46 + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
  47 + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
  48 + containers:
  49 + - name: allied-creation-gateway
  50 + image: 192.168.0.243:5000/mmm/allied-creation-gateway:master
  51 + imagePullPolicy: Always
  52 + ports:
  53 + - containerPort: 8082
  54 + - containerPort: 443
  55 + volumeMounts:
  56 + - mountPath: /opt/logs
  57 + name: accesslogs
  58 + env:
  59 + - name: POSTGRESQL_DB_NAME
  60 + valueFrom:
  61 + configMapKeyRef:
  62 + name: suplus-config
  63 + key: postgresqlalliedcreation.dbname
  64 + - name: POSTGRESQL_USER
  65 + valueFrom:
  66 + configMapKeyRef:
  67 + name: suplus-config
  68 + key: postgresql.user
  69 + - name: POSTGRESQL_PASSWORD
  70 + valueFrom:
  71 + configMapKeyRef:
  72 + name: suplus-config
  73 + key: postgresql.password
  74 + - name: POSTGRESQL_HOST
  75 + valueFrom:
  76 + configMapKeyRef:
  77 + name: suplus-config
  78 + key: postgresql.host
  79 + - name: POSTGRESQL_PORT
  80 + valueFrom:
  81 + configMapKeyRef:
  82 + name: suplus-config
  83 + key: postgresql.port
  84 + - name: REDIS_HOST
  85 + valueFrom:
  86 + configMapKeyRef:
  87 + name: suplus-config
  88 + key: redis.ip
  89 + - name: REDIS_PORT
  90 + valueFrom:
  91 + configMapKeyRef:
  92 + name: suplus-config
  93 + key: redis.port
  94 + - name: REDIS_AUTH
  95 + value: ""
  96 + - name: LOG_LEVEL
  97 + value: "debug"
  98 + - name: LOG_FRAMEWORK
  99 + value: "beego"
  100 + - name: LOG_TYPE
  101 + value: "file"
  102 + - name: ERROR_BASE_CODE
  103 + value: "1"
  104 + - name: ERROR_BASE_CODE_MULTIPLE
  105 + value: "1000"
  106 + - name: ENABLE_KAFKA_LOG
  107 + value: "false"
  108 + - name: HTTP_PORT
  109 + value: "8082"
  110 + - name: ALLIED_CREATION_USER_HOST
  111 + value: "https://allied-creation-user-prd.fjmaimaimai.com"
  112 + - name: ALLIED_CREATION_COOPERATION_HOST
  113 + value: "https://allied-creation-cooperation-prd.fjmaimaimai.com"
  114 + - name: ALLIED_CREATION_BASIC_HOST
  115 + value: "https://allied-creation-basic-prd.fjmaimaimai.com"
  116 + - name: SMS_SERVE_HOST
  117 + value: "https://sms.fjmaimaimai.com:9897"
  118 + # - name: REDIS_HOST
  119 + # valueFrom:
  120 + # configMapKeyRef:
  121 + # name: suplus-config
  122 + # key: redis.ip
  123 + # - name: REDIS_PORT
  124 + # valueFrom:
  125 + # configMapKeyRef:
  126 + # name: suplus-config
  127 + # key: redis.port
  128 + volumes:
  129 + - name: accesslogs
  130 + emptyDir: {}
  1 +#!/bin/bash
  2 +export PATH=/root/local/bin:$PATH
  3 +kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-gateway
  4 +if [ "$?" == "1" ];then
  5 + kubectl create -f /tmp/prd/allied-creation-gateway/allied-creation-gateway.yaml --record
  6 + kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-gateway
  7 + if [ "$?" == "0" ];then
  8 + echo "allied-creation-gateway service install success!"
  9 + else
  10 + echo "allied-creation-gateway service install fail!"
  11 + fi
  12 + kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-gateway
  13 + if [ "$?" == "0" ];then
  14 + echo "allied-creation-gateway deployment install success!"
  15 + else
  16 + echo "allied-creation-gateway deployment install fail!"
  17 + fi
  18 +else
  19 + kubectl delete -f /tmp/prd/allied-creation-gateway/allied-creation-gateway.yaml
  20 + kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-gateway
  21 + while [ "$?" == "0" ]
  22 + do
  23 + kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-gateway
  24 + done
  25 + kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-gateway
  26 + while [ "$?" == "0" ]
  27 + do
  28 + kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-gateway
  29 + done
  30 + kubectl create -f /tmp/prd/allied-creation-gateway/allied-creation-gateway.yaml --record
  31 + kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-gateway
  32 + if [ "$?" == "0" ];then
  33 + echo "allied-creation-gateway service update success!"
  34 + else
  35 + echo "allied-creation-gateway service update fail!"
  36 + fi
  37 + kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-gateway
  38 + if [ "$?" == "0" ];then
  39 + echo "allied-creation-gateway deployment update success!"
  40 + else
  41 + echo "allied-creation-gateway deployment update fail!"
  42 + fi
  43 +fi
@@ -12,6 +12,7 @@ type SearchDividendsEstimateQuery struct { @@ -12,6 +12,7 @@ type SearchDividendsEstimateQuery struct {
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 // 承接人分红预算单号 13 // 承接人分红预算单号
14 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` 14 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
  15 + OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号
15 // 分红类型,1订单分红,2退货冲销,3金额激励 16 // 分红类型,1订单分红,2退货冲销,3金额激励
16 DividendsType int `json:"dividendsType"` 17 DividendsType int `json:"dividendsType"`
17 PageNumber int `json:"pageNumber"` 18 PageNumber int `json:"pageNumber"`
@@ -75,7 +75,8 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat @@ -75,7 +75,8 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat
75 searchDividendsEstimateQuery.Operator) 75 searchDividendsEstimateQuery.Operator)
76 result, err := creationCooperationGateway.DividendsEstimatesSearch(allied_creation_cooperation.ReqDividendsEstimateSearch{ 76 result, err := creationCooperationGateway.DividendsEstimatesSearch(allied_creation_cooperation.ReqDividendsEstimateSearch{
77 DividendsEstimateOrderNumber: searchDividendsEstimateQuery.DividendsEstimateOrderNumber, //承接人分红预算单号 77 DividendsEstimateOrderNumber: searchDividendsEstimateQuery.DividendsEstimateOrderNumber, //承接人分红预算单号
78 - DividendsType: searchDividendsEstimateQuery.DividendsType, //分红类型,1订单分红,2退货冲销,3金额激励 78 + OrderOrReturnedOrderNum: searchDividendsEstimateQuery.OrderOrReturnedOrderNum,
  79 + DividendsType: searchDividendsEstimateQuery.DividendsType, //分红类型,1订单分红,2退货冲销,3金额激励
79 PageNumber: searchDividendsEstimateQuery.PageNumber, 80 PageNumber: searchDividendsEstimateQuery.PageNumber,
80 PageSize: searchDividendsEstimateQuery.PageSize, 81 PageSize: searchDividendsEstimateQuery.PageSize,
81 CompanyId: searchDividendsEstimateQuery.Operator.CompanyId, 82 CompanyId: searchDividendsEstimateQuery.Operator.CompanyId,
@@ -11,6 +11,8 @@ type SearchDividendsOrderQuery struct { @@ -11,6 +11,8 @@ type SearchDividendsOrderQuery struct {
11 DividendsOrderNumber string `json:"dividendsOrderNumber,omitempty"` 11 DividendsOrderNumber string `json:"dividendsOrderNumber,omitempty"`
12 // 客户名称 12 // 客户名称
13 CustomerName string `json:"customerName,omitempty"` 13 CustomerName string `json:"customerName,omitempty"`
  14 + // 来源单号
  15 + DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
14 // 页码 16 // 页码
15 PageNumber int `json:"pageNumber"` 17 PageNumber int `json:"pageNumber"`
16 // 每页限制 18 // 每页限制
@@ -83,12 +83,13 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD @@ -83,12 +83,13 @@ func (dividendsOrderService *DividendsOrderService) RemoveDividendsOrder(removeD
83 func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchDividendsOrderQuery *query.SearchDividendsOrderQuery) (int, interface{}, error) { 83 func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchDividendsOrderQuery *query.SearchDividendsOrderQuery) (int, interface{}, error) {
84 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(searchDividendsOrderQuery.Operator) 84 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(searchDividendsOrderQuery.Operator)
85 result, err := creationCooperationGateway.DividendsOrderSearch(allied_creation_cooperation.ReqDividendsOrderSearch{ 85 result, err := creationCooperationGateway.DividendsOrderSearch(allied_creation_cooperation.ReqDividendsOrderSearch{
86 - PageNumber: searchDividendsOrderQuery.PageNumber,  
87 - PageSize: searchDividendsOrderQuery.PageSize,  
88 - CustomerName: searchDividendsOrderQuery.CustomerName,  
89 - DividendsOrderNumber: searchDividendsOrderQuery.DividendsOrderNumber,  
90 - OrgIds: searchDividendsOrderQuery.Operator.OrgIds,  
91 - CompanyId: int(searchDividendsOrderQuery.Operator.CompanyId), 86 + PageNumber: searchDividendsOrderQuery.PageNumber,
  87 + PageSize: searchDividendsOrderQuery.PageSize,
  88 + CustomerName: searchDividendsOrderQuery.CustomerName,
  89 + DividendsOrderNumber: searchDividendsOrderQuery.DividendsOrderNumber,
  90 + DividendsOriginalOrderNum: searchDividendsOrderQuery.DividendsOriginalOrderNum,
  91 + OrgIds: searchDividendsOrderQuery.Operator.OrgIds,
  92 + CompanyId: int(searchDividendsOrderQuery.Operator.CompanyId),
92 }) 93 })
93 if err != nil { 94 if err != nil {
94 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 95 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -11,6 +11,7 @@ type SearchDividendsReturnedOrderQuery struct { @@ -11,6 +11,7 @@ type SearchDividendsReturnedOrderQuery struct {
11 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName,omitempty"` 11 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName,omitempty"`
12 // 分红退货单号 12 // 分红退货单号
13 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber,omitempty"` 13 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber,omitempty"`
  14 + OriginalOrderNum string `json:"originalOrderNum"` //源单号(原始订单号)
14 // 查询偏离量 15 // 查询偏离量
15 PageNumber int `json:"pageNumber"` 16 PageNumber int `json:"pageNumber"`
16 // 每页 17 // 每页
@@ -80,6 +80,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide @@ -80,6 +80,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
80 PageSize: searchDividendsReturnedOrderQuery.PageSize, 80 PageSize: searchDividendsReturnedOrderQuery.PageSize,
81 DividendsReturnedOrderNumber: searchDividendsReturnedOrderQuery.DividendsReturnedOrderNumber, 81 DividendsReturnedOrderNumber: searchDividendsReturnedOrderQuery.DividendsReturnedOrderNumber,
82 DividendsReturnedCustomerName: searchDividendsReturnedOrderQuery.DividendsReturnedCustomerName, 82 DividendsReturnedCustomerName: searchDividendsReturnedOrderQuery.DividendsReturnedCustomerName,
  83 + OriginalOrderNum: searchDividendsReturnedOrderQuery.OriginalOrderNum,
83 OrgIds: searchDividendsReturnedOrderQuery.Operator.OrgIds, 84 OrgIds: searchDividendsReturnedOrderQuery.Operator.OrgIds,
84 }) 85 })
85 if err != nil { 86 if err != nil {
@@ -42,6 +42,7 @@ type ( @@ -42,6 +42,7 @@ type (
42 ReqDividendsEstimateSearch struct { 42 ReqDividendsEstimateSearch struct {
43 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` //承接人分红预算单号 43 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` //承接人分红预算单号
44 CooperationContractNumber string `json:"orderOrReturnedOrderNum"` //合约编号 44 CooperationContractNumber string `json:"orderOrReturnedOrderNum"` //合约编号
  45 + OrderOrReturnedOrderNum string `json:"matchOrderOrReturnedOrderNum"` // 分红订单号或退货单号
45 DividendsType int `json:"dividendsType"` //分红类型,1订单分红,2退货冲销,3金额激励 46 DividendsType int `json:"dividendsType"` //分红类型,1订单分红,2退货冲销,3金额激励
46 PageNumber int `json:"pageNumber"` 47 PageNumber int `json:"pageNumber"`
47 PageSize int `json:"pageSize"` 48 PageSize int `json:"pageSize"`
@@ -124,14 +124,15 @@ type ( @@ -124,14 +124,15 @@ type (
124 //查询分红订单 124 //查询分红订单
125 type ( 125 type (
126 ReqDividendsOrderSearch struct { 126 ReqDividendsOrderSearch struct {
127 - CompanyId int `json:"companyId"`  
128 - CustomerName string `json:"customerName"`  
129 - DividendsOrderNumber string `json:"dividendsOrderNumber"`  
130 - OrgId int64 `json:"orgId"`  
131 - OrgIds []int64 `json:"orgIds"`  
132 - PageNumber int `json:"pageNumber"`  
133 - PageSize int `json:"pageSize"`  
134 - UserId int `json:"userId"` 127 + CompanyId int `json:"companyId"`
  128 + CustomerName string `json:"customerName"`
  129 + DividendsOrderNumber string `json:"dividendsOrderNumber"`
  130 + DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
  131 + OrgId int64 `json:"orgId"`
  132 + OrgIds []int64 `json:"orgIds"`
  133 + PageNumber int `json:"pageNumber"`
  134 + PageSize int `json:"pageSize"`
  135 + UserId int `json:"userId"`
135 } 136 }
136 137
137 DataDividendsOrderSearch struct { 138 DataDividendsOrderSearch struct {
@@ -101,6 +101,7 @@ type ( @@ -101,6 +101,7 @@ type (
101 OrgId int `json:"orgId"` 101 OrgId int `json:"orgId"`
102 PageNumber int `json:"pageNumber"` 102 PageNumber int `json:"pageNumber"`
103 PageSize int `json:"pageSize"` 103 PageSize int `json:"pageSize"`
  104 + OriginalOrderNum string `json:"originalOrderNum"` //源单号(原始订单号)
104 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` 105 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"`
105 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` 106 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
106 UserId int `json:"userId"` 107 UserId int `json:"userId"`