作者 yangfu

Merge branch 'feature_order_number' into test

@@ -2,7 +2,7 @@ apiVersion: v1 @@ -2,7 +2,7 @@ apiVersion: v1
2 kind: Service 2 kind: Service
3 metadata: 3 metadata:
4 name: allied-creation-cooperation 4 name: allied-creation-cooperation
5 - namespace: <replace-your-k8s-namespace> 5 + namespace: mmm-suplus-prd
6 labels: 6 labels:
7 k8s-app: allied-creation-cooperation 7 k8s-app: allied-creation-cooperation
8 spec: 8 spec:
@@ -10,6 +10,9 @@ spec: @@ -10,6 +10,9 @@ spec:
10 - name: "http" 10 - name: "http"
11 port: 80 11 port: 80
12 targetPort: 8082 12 targetPort: 8082
  13 + - name: "https"
  14 + port: 443
  15 + targetPort: 443
13 selector: 16 selector:
14 k8s-app: allied-creation-cooperation 17 k8s-app: allied-creation-cooperation
15 --- 18 ---
@@ -17,7 +20,7 @@ apiVersion: extensions/v1beta1 @@ -17,7 +20,7 @@ apiVersion: extensions/v1beta1
17 kind: Deployment 20 kind: Deployment
18 metadata: 21 metadata:
19 name: allied-creation-cooperation 22 name: allied-creation-cooperation
20 - namespace: <replace-your-k8s-namespace> 23 + namespace: mmm-suplus-prd
21 labels: 24 labels:
22 k8s-app: allied-creation-cooperation 25 k8s-app: allied-creation-cooperation
23 spec: 26 spec:
@@ -44,22 +47,66 @@ spec: @@ -44,22 +47,66 @@ spec:
44 - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy 47 - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
45 containers: 48 containers:
46 - name: allied-creation-cooperation 49 - name: allied-creation-cooperation
47 - image: 192.168.0.243:5000/mmm/allied-creation-cooperation:dev 50 + image: 192.168.0.243:5000/mmm/allied-creation-cooperation:master
48 imagePullPolicy: Always 51 imagePullPolicy: Always
49 ports: 52 ports:
50 - containerPort: 8082 53 - containerPort: 8082
  54 + - containerPort: 443
51 volumeMounts: 55 volumeMounts:
52 - mountPath: /opt/logs 56 - mountPath: /opt/logs
53 name: accesslogs 57 name: accesslogs
54 env: 58 env:
55 - name: LOG_LEVEL 59 - name: LOG_LEVEL
56 value: "debug" 60 value: "debug"
  61 + - name: LOG_FRAMEWORK
  62 + value: "beego"
  63 + - name: LOG_TYPE
  64 + value: "file"
57 - name: ENABLE_HTTPS 65 - name: ENABLE_HTTPS
58 value: "true" 66 value: "true"
59 - name: ERROR_BASE_CODE 67 - name: ERROR_BASE_CODE
60 value: "1" 68 value: "1"
61 - name: ERROR_BASE_CODE_MULTIPLE 69 - name: ERROR_BASE_CODE_MULTIPLE
62 value: "1000" 70 value: "1000"
  71 + - name: ENABLE_KAFKA_LOG
  72 + value: "false"
  73 + - name: USER_MODULE_HOST
  74 + value: "https://allied-creation-user-prd.fjmaimaimai.com"
  75 + - name: REDIS_HOST
  76 + valueFrom:
  77 + configMapKeyRef:
  78 + name: suplus-config
  79 + key: redis.ip
  80 + - name: REDIS_PORT
  81 + valueFrom:
  82 + configMapKeyRef:
  83 + name: suplus-config
  84 + key: redis.port
  85 + - name: POSTGRESQL_DB_NAME
  86 + valueFrom:
  87 + configMapKeyRef:
  88 + name: suplus-config
  89 + key: postgresqlalliedcreationcooperation.dbname
  90 + - name: POSTGRESQL_USER
  91 + valueFrom:
  92 + configMapKeyRef:
  93 + name: suplus-config
  94 + key: postgresql.user
  95 + - name: POSTGRESQL_PASSWORD
  96 + valueFrom:
  97 + configMapKeyRef:
  98 + name: suplus-config
  99 + key: postgresql.password
  100 + - name: POSTGRESQL_HOST
  101 + valueFrom:
  102 + configMapKeyRef:
  103 + name: suplus-config
  104 + key: postgresql.host
  105 + - name: POSTGRESQL_PORT
  106 + valueFrom:
  107 + configMapKeyRef:
  108 + name: suplus-config
  109 + key: postgresql.port
63 volumes: 110 volumes:
64 - name: accesslogs 111 - name: accesslogs
65 emptyDir: {} 112 emptyDir: {}
1 #!/bin/bash 1 #!/bin/bash
2 export PATH=/root/local/bin:$PATH 2 export PATH=/root/local/bin:$PATH
3 -kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation 3 +kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
4 if [ "$?" == "1" ];then 4 if [ "$?" == "1" ];then
5 - kubectl create -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml --record  
6 - kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation 5 + kubectl create -f /tmp/prd/allied-creation-cooperation/allied-creation-cooperation.yaml --record
  6 + kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-cooperation
7 if [ "$?" == "0" ];then 7 if [ "$?" == "0" ];then
8 echo "allied-creation-cooperation service install success!" 8 echo "allied-creation-cooperation service install success!"
9 else 9 else
10 echo "allied-creation-cooperation service install fail!" 10 echo "allied-creation-cooperation service install fail!"
11 fi 11 fi
12 - kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation 12 + kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
13 if [ "$?" == "0" ];then 13 if [ "$?" == "0" ];then
14 echo "allied-creation-cooperation deployment install success!" 14 echo "allied-creation-cooperation deployment install success!"
15 else 15 else
16 echo "allied-creation-cooperation deployment install fail!" 16 echo "allied-creation-cooperation deployment install fail!"
17 fi 17 fi
18 else 18 else
19 - kubectl delete -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml  
20 - kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation 19 + kubectl delete -f /tmp/prd/allied-creation-cooperation/allied-creation-cooperation.yaml
  20 + kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-cooperation
21 while [ "$?" == "0" ] 21 while [ "$?" == "0" ]
22 do 22 do
23 - kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation 23 + kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-cooperation
24 done 24 done
25 - kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation 25 + kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
26 while [ "$?" == "0" ] 26 while [ "$?" == "0" ]
27 do 27 do
28 - kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation 28 + kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
29 done 29 done
30 - kubectl create -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml --record  
31 - kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation 30 + kubectl create -f /tmp/prd/allied-creation-cooperation/allied-creation-cooperation.yaml --record
  31 + kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-cooperation
32 if [ "$?" == "0" ];then 32 if [ "$?" == "0" ];then
33 echo "allied-creation-cooperation service update success!" 33 echo "allied-creation-cooperation service update success!"
34 else 34 else
35 echo "allied-creation-cooperation service update fail!" 35 echo "allied-creation-cooperation service update fail!"
36 fi 36 fi
37 - kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation 37 + kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
38 if [ "$?" == "0" ];then 38 if [ "$?" == "0" ];then
39 echo "allied-creation-cooperation deployment update success!" 39 echo "allied-creation-cooperation deployment update success!"
40 else 40 else
@@ -12,6 +12,8 @@ import ( @@ -12,6 +12,8 @@ import (
12 type SearchDividendsEstimateQuery struct { 12 type SearchDividendsEstimateQuery struct {
13 // 承接人分红预算单号 13 // 承接人分红预算单号
14 DividendsEstimateOrderNumber string `cname:"承接人分红预算单号" json:"dividendsEstimateOrderNumber,omitempty"` 14 DividendsEstimateOrderNumber string `cname:"承接人分红预算单号" json:"dividendsEstimateOrderNumber,omitempty"`
  15 + // 分红订单号或退货单号
  16 + MatchOrderOrReturnedOrderNum string `json:"matchOrderOrReturnedOrderNum"`
15 // 分红类型,1订单分红,2退货冲销,3金额激励 17 // 分红类型,1订单分红,2退货冲销,3金额激励
16 DividendsType int32 `cname:"分红类型" json:"dividendsType,omitempty"` 18 DividendsType int32 `cname:"分红类型" json:"dividendsType,omitempty"`
17 // 公司ID,通过集成REST上下文获取 19 // 公司ID,通过集成REST上下文获取
@@ -11,6 +11,8 @@ import ( @@ -11,6 +11,8 @@ import (
11 type SearchDividendsOrderQuery struct { 11 type SearchDividendsOrderQuery struct {
12 // 分红订单号 12 // 分红订单号
13 DividendsOrderNumber string `cname:"分红订单号" json:"dividendsOrderNumber,omitempty"` 13 DividendsOrderNumber string `cname:"分红订单号" json:"dividendsOrderNumber,omitempty"`
  14 + // 来源单号
  15 + DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
14 // 客户名称 16 // 客户名称
15 CustomerName string `cname:"客户名称" json:"customerName,omitempty"` 17 CustomerName string `cname:"客户名称" json:"customerName,omitempty"`
16 // 页面大小 18 // 页面大小
@@ -13,6 +13,8 @@ type SearchDividendsReturnedOrderQuery struct { @@ -13,6 +13,8 @@ type SearchDividendsReturnedOrderQuery struct {
13 DividendsReturnedCustomerName string `cname:"退货客户姓名" json:"dividendsReturnedCustomerName,omitempty"` 13 DividendsReturnedCustomerName string `cname:"退货客户姓名" json:"dividendsReturnedCustomerName,omitempty"`
14 // 分红退货单号 14 // 分红退货单号
15 DividendsReturnedOrderNumber string `cname:"分红退货单号" json:"dividendsReturnedOrderNumber,omitempty"` 15 DividendsReturnedOrderNumber string `cname:"分红退货单号" json:"dividendsReturnedOrderNumber,omitempty"`
  16 + //源单号(原始订单号)
  17 + OriginalOrderNum string `json:"originalOrderNum"`
16 // 页面大小 18 // 页面大小
17 PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` 19 PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
18 // 页面大小 20 // 页面大小
@@ -348,7 +348,10 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte @@ -348,7 +348,10 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte
348 query.Where("order_good_id = ?", orderGoodId) 348 query.Where("order_good_id = ?", orderGoodId)
349 } 349 }
350 if dividendsEstimateOrderNumber, ok := queryOptions["dividendsEstimateOrderNumber"]; ok && dividendsEstimateOrderNumber != "" { 350 if dividendsEstimateOrderNumber, ok := queryOptions["dividendsEstimateOrderNumber"]; ok && dividendsEstimateOrderNumber != "" {
351 - query.Where("dividends_estimate_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsEstimateOrderNumber)) 351 + query.Where("dividends_estimate_order_number like ?", fmt.Sprintf("%%%s%%", dividendsEstimateOrderNumber))
  352 + }
  353 + if matchOrderOrReturnedOrderNum, ok := queryOptions["matchOrderOrReturnedOrderNum"]; ok && matchOrderOrReturnedOrderNum != "" {
  354 + query.Where("order_or_returned_order_num like ?", fmt.Sprintf("%%%s%%", matchOrderOrReturnedOrderNum))
352 } 355 }
353 if dividendsEstimateIds, ok := queryOptions["dividendsEstimateIds"]; ok && len(dividendsEstimateIds.([]int64)) > 0 { 356 if dividendsEstimateIds, ok := queryOptions["dividendsEstimateIds"]; ok && len(dividendsEstimateIds.([]int64)) > 0 {
354 query.Where("dividends_estimate_id IN (?)", pg.In(dividendsEstimateIds)) 357 query.Where("dividends_estimate_id IN (?)", pg.In(dividendsEstimateIds))
@@ -564,7 +564,10 @@ func (repository *DividendsOrderRepository) Find(queryOptions map[string]interfa @@ -564,7 +564,10 @@ func (repository *DividendsOrderRepository) Find(queryOptions map[string]interfa
564 dividendsOrders := make([]*domain.DividendsOrder, 0) 564 dividendsOrders := make([]*domain.DividendsOrder, 0)
565 query := sqlbuilder.BuildQuery(tx.Model(&dividendsOrderModels), queryOptions) 565 query := sqlbuilder.BuildQuery(tx.Model(&dividendsOrderModels), queryOptions)
566 if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" { 566 if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" {
567 - query.Where("dividends_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsOrderNumber)) 567 + query.Where("dividends_order_number like ?", fmt.Sprintf("%%%s%%", dividendsOrderNumber))
  568 + }
  569 + if dividendsOriginalOrderNum, ok := queryOptions["dividendsOriginalOrderNum"]; ok && dividendsOriginalOrderNum != "" {
  570 + query.Where("dividends_original_order_num like ?", fmt.Sprintf("%%%s%%", dividendsOriginalOrderNum))
568 } 571 }
569 if dividendsOrderNumbers, ok := queryOptions["dividendsOrderNumbers"]; ok && len(dividendsOrderNumbers.([]string)) > 0 { 572 if dividendsOrderNumbers, ok := queryOptions["dividendsOrderNumbers"]; ok && len(dividendsOrderNumbers.([]string)) > 0 {
570 query.Where("dividends_order_number IN (?)", pg.In(dividendsOrderNumbers.([]string))) 573 query.Where("dividends_order_number IN (?)", pg.In(dividendsOrderNumbers.([]string)))
@@ -574,8 +574,11 @@ func (repository *DividendsReturnedOrderRepository) Find(queryOptions map[string @@ -574,8 +574,11 @@ func (repository *DividendsReturnedOrderRepository) Find(queryOptions map[string
574 if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" { 574 if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" {
575 query.Where("dividends_order_number = ?", dividendsOrderNumber) 575 query.Where("dividends_order_number = ?", dividendsOrderNumber)
576 } 576 }
  577 + if originalOrderNum, ok := queryOptions["originalOrderNum"]; ok && originalOrderNum != "" {
  578 + query.Where("original_order_num like ?", fmt.Sprintf("%%%s%%", originalOrderNum))
  579 + }
577 if dividendsReturnedOrderNumber, ok := queryOptions["dividendsReturnedOrderNumber"]; ok && dividendsReturnedOrderNumber != "" { 580 if dividendsReturnedOrderNumber, ok := queryOptions["dividendsReturnedOrderNumber"]; ok && dividendsReturnedOrderNumber != "" {
578 - query.Where("dividends_returned_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsReturnedOrderNumber)) 581 + query.Where("dividends_returned_order_number like ?", fmt.Sprintf("%%%s%%", dividendsReturnedOrderNumber))
579 } 582 }
580 if dividendsReturnedOrderNumbers, ok := queryOptions["dividendsReturnedOrderNumbers"]; ok && len(dividendsReturnedOrderNumbers.([]string)) > 0 { 583 if dividendsReturnedOrderNumbers, ok := queryOptions["dividendsReturnedOrderNumbers"]; ok && len(dividendsReturnedOrderNumbers.([]string)) > 0 {
581 query.Where("dividends_returned_order_number IN (?)", pg.In(dividendsReturnedOrderNumbers.([]string))) 584 query.Where("dividends_returned_order_number IN (?)", pg.In(dividendsReturnedOrderNumbers.([]string)))