作者 yangfu

Merge branch 'feature_order_number' into test

... ... @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: allied-creation-cooperation
namespace: <replace-your-k8s-namespace>
namespace: mmm-suplus-prd
labels:
k8s-app: allied-creation-cooperation
spec:
... ... @@ -10,6 +10,9 @@ spec:
- name: "http"
port: 80
targetPort: 8082
- name: "https"
port: 443
targetPort: 443
selector:
k8s-app: allied-creation-cooperation
---
... ... @@ -17,7 +20,7 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: allied-creation-cooperation
namespace: <replace-your-k8s-namespace>
namespace: mmm-suplus-prd
labels:
k8s-app: allied-creation-cooperation
spec:
... ... @@ -44,22 +47,66 @@ spec:
- cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
containers:
- name: allied-creation-cooperation
image: 192.168.0.243:5000/mmm/allied-creation-cooperation:dev
image: 192.168.0.243:5000/mmm/allied-creation-cooperation:master
imagePullPolicy: Always
ports:
- containerPort: 8082
- containerPort: 443
volumeMounts:
- mountPath: /opt/logs
name: accesslogs
env:
- name: LOG_LEVEL
value: "debug"
- name: LOG_FRAMEWORK
value: "beego"
- name: LOG_TYPE
value: "file"
- name: ENABLE_HTTPS
value: "true"
- name: ERROR_BASE_CODE
value: "1"
- name: ERROR_BASE_CODE_MULTIPLE
value: "1000"
- name: ENABLE_KAFKA_LOG
value: "false"
- name: USER_MODULE_HOST
value: "https://allied-creation-user-prd.fjmaimaimai.com"
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.ip
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.port
- name: POSTGRESQL_DB_NAME
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresqlalliedcreationcooperation.dbname
- name: POSTGRESQL_USER
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.user
- name: POSTGRESQL_PASSWORD
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.password
- name: POSTGRESQL_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.host
- name: POSTGRESQL_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.port
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
if [ "$?" == "1" ];then
kubectl create -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml --record
kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation
kubectl create -f /tmp/prd/allied-creation-cooperation/allied-creation-cooperation.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-cooperation
if [ "$?" == "0" ];then
echo "allied-creation-cooperation service install success!"
else
echo "allied-creation-cooperation service install fail!"
fi
kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
if [ "$?" == "0" ];then
echo "allied-creation-cooperation deployment install success!"
else
echo "allied-creation-cooperation deployment install fail!"
fi
else
kubectl delete -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml
kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation
kubectl delete -f /tmp/prd/allied-creation-cooperation/allied-creation-cooperation.yaml
kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-cooperation
while [ "$?" == "0" ]
do
kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation
kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-cooperation
done
kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
while [ "$?" == "0" ]
do
kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
done
kubectl create -f /tmp/dev/allied-creation-cooperation/allied-creation-cooperation.yaml --record
kubectl -n <replace-your-k8s-namespace> get svc | grep -q allied-creation-cooperation
kubectl create -f /tmp/prd/allied-creation-cooperation/allied-creation-cooperation.yaml --record
kubectl -n mmm-suplus-prd get svc | grep -q allied-creation-cooperation
if [ "$?" == "0" ];then
echo "allied-creation-cooperation service update success!"
else
echo "allied-creation-cooperation service update fail!"
fi
kubectl -n <replace-your-k8s-namespace> get pods | grep -q allied-creation-cooperation
kubectl -n mmm-suplus-prd get pods | grep -q allied-creation-cooperation
if [ "$?" == "0" ];then
echo "allied-creation-cooperation deployment update success!"
else
... ...
... ... @@ -12,6 +12,8 @@ import (
type SearchDividendsEstimateQuery struct {
// 承接人分红预算单号
DividendsEstimateOrderNumber string `cname:"承接人分红预算单号" json:"dividendsEstimateOrderNumber,omitempty"`
// 分红订单号或退货单号
MatchOrderOrReturnedOrderNum string `json:"matchOrderOrReturnedOrderNum"`
// 分红类型,1订单分红,2退货冲销,3金额激励
DividendsType int32 `cname:"分红类型" json:"dividendsType,omitempty"`
// 公司ID,通过集成REST上下文获取
... ...
... ... @@ -11,6 +11,8 @@ import (
type SearchDividendsOrderQuery struct {
// 分红订单号
DividendsOrderNumber string `cname:"分红订单号" json:"dividendsOrderNumber,omitempty"`
// 来源单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
// 客户名称
CustomerName string `cname:"客户名称" json:"customerName,omitempty"`
// 页面大小
... ...
... ... @@ -13,6 +13,8 @@ type SearchDividendsReturnedOrderQuery struct {
DividendsReturnedCustomerName string `cname:"退货客户姓名" json:"dividendsReturnedCustomerName,omitempty"`
// 分红退货单号
DividendsReturnedOrderNumber string `cname:"分红退货单号" json:"dividendsReturnedOrderNumber,omitempty"`
//源单号(原始订单号)
OriginalOrderNum string `json:"originalOrderNum"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 页面大小
... ...
... ... @@ -348,7 +348,10 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte
query.Where("order_good_id = ?", orderGoodId)
}
if dividendsEstimateOrderNumber, ok := queryOptions["dividendsEstimateOrderNumber"]; ok && dividendsEstimateOrderNumber != "" {
query.Where("dividends_estimate_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsEstimateOrderNumber))
query.Where("dividends_estimate_order_number like ?", fmt.Sprintf("%%%s%%", dividendsEstimateOrderNumber))
}
if matchOrderOrReturnedOrderNum, ok := queryOptions["matchOrderOrReturnedOrderNum"]; ok && matchOrderOrReturnedOrderNum != "" {
query.Where("order_or_returned_order_num like ?", fmt.Sprintf("%%%s%%", matchOrderOrReturnedOrderNum))
}
if dividendsEstimateIds, ok := queryOptions["dividendsEstimateIds"]; ok && len(dividendsEstimateIds.([]int64)) > 0 {
query.Where("dividends_estimate_id IN (?)", pg.In(dividendsEstimateIds))
... ...
... ... @@ -564,7 +564,10 @@ func (repository *DividendsOrderRepository) Find(queryOptions map[string]interfa
dividendsOrders := make([]*domain.DividendsOrder, 0)
query := sqlbuilder.BuildQuery(tx.Model(&dividendsOrderModels), queryOptions)
if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" {
query.Where("dividends_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsOrderNumber))
query.Where("dividends_order_number like ?", fmt.Sprintf("%%%s%%", dividendsOrderNumber))
}
if dividendsOriginalOrderNum, ok := queryOptions["dividendsOriginalOrderNum"]; ok && dividendsOriginalOrderNum != "" {
query.Where("dividends_original_order_num like ?", fmt.Sprintf("%%%s%%", dividendsOriginalOrderNum))
}
if dividendsOrderNumbers, ok := queryOptions["dividendsOrderNumbers"]; ok && len(dividendsOrderNumbers.([]string)) > 0 {
query.Where("dividends_order_number IN (?)", pg.In(dividendsOrderNumbers.([]string)))
... ...
... ... @@ -574,8 +574,11 @@ func (repository *DividendsReturnedOrderRepository) Find(queryOptions map[string
if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" {
query.Where("dividends_order_number = ?", dividendsOrderNumber)
}
if originalOrderNum, ok := queryOptions["originalOrderNum"]; ok && originalOrderNum != "" {
query.Where("original_order_num like ?", fmt.Sprintf("%%%s%%", originalOrderNum))
}
if dividendsReturnedOrderNumber, ok := queryOptions["dividendsReturnedOrderNumber"]; ok && dividendsReturnedOrderNumber != "" {
query.Where("dividends_returned_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsReturnedOrderNumber))
query.Where("dividends_returned_order_number like ?", fmt.Sprintf("%%%s%%", dividendsReturnedOrderNumber))
}
if dividendsReturnedOrderNumbers, ok := queryOptions["dividendsReturnedOrderNumbers"]; ok && len(dividendsReturnedOrderNumbers.([]string)) > 0 {
query.Where("dividends_returned_order_number IN (?)", pg.In(dividendsReturnedOrderNumbers.([]string)))
... ...