|
|
@@ -51,11 +51,20 @@ func (p *businessService) GetList(req *model.ProjBusinessSearchReq) (total int,
|
|
|
if req.NboType != "" {
|
|
|
db = db.Where("proj."+p.Dao.C.NboType, req.NboType)
|
|
|
}
|
|
|
+ if req.ProductLine != "" {
|
|
|
+ db = db.Where("proj."+p.Dao.C.ProductLine, req.ProductLine)
|
|
|
+ }
|
|
|
+ if req.NboSource != "" {
|
|
|
+ db = db.Where("proj."+p.Dao.C.NboSource, req.NboSource)
|
|
|
+ }
|
|
|
+ if req.DistributorName != "" {
|
|
|
+ db = db.Where("proj."+p.Dao.C.DistributorName, "%"+req.DistributorName+"%")
|
|
|
+ }
|
|
|
if req.BeginTime != "" {
|
|
|
- db = db.WhereGTE("proj."+p.Dao.C.CreatedTime, req.BeginTime)
|
|
|
+ db = db.WhereGTE("proj."+p.Dao.C.FilingTime, req.BeginTime)
|
|
|
}
|
|
|
if req.EndTime != "" {
|
|
|
- db = db.WhereLTE("proj."+p.Dao.C.CreatedTime, req.EndTime)
|
|
|
+ db = db.WhereLTE("proj."+p.Dao.C.FilingTime, req.EndTime)
|
|
|
}
|
|
|
total, err = db.Count()
|
|
|
if err != nil {
|
|
|
@@ -732,26 +741,37 @@ func (p *businessService) BusinessUpgradeNotify(flow *workflowModel.PlatWorkflow
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-// BusinessDowngrade 项目降级
|
|
|
-func (p *businessService) BusinessDowngrade(req *model.BusinessDowngradeReq) error {
|
|
|
- business, err := p.BusinessGradation(req.Id, req.NboType, "down")
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
+// 获取项目的钉钉审批的降级类型
|
|
|
+func (p *businessService) getBusDingDowngradeType(dbNboType, reqNboType string) string {
|
|
|
var downgradeType string
|
|
|
switch true {
|
|
|
- case business.NboType == StatusB && req.NboType == StatusC:
|
|
|
+ case dbNboType == StatusB && reqNboType == StatusC:
|
|
|
downgradeType = "option_0"
|
|
|
- case business.NboType == StatusA && req.NboType == StatusB:
|
|
|
+ case dbNboType == StatusA && reqNboType == StatusB:
|
|
|
downgradeType = "option_1"
|
|
|
- case business.NboType == StatusA && req.NboType == StatusC:
|
|
|
+ case dbNboType == StatusA && reqNboType == StatusC:
|
|
|
downgradeType = "option_2"
|
|
|
- case business.NboType == StatusA && req.NboType == StatusReserve:
|
|
|
+ case dbNboType == StatusA && reqNboType == StatusReserve:
|
|
|
downgradeType = "option_YZMFJYQQK6O0"
|
|
|
+ case dbNboType == StatusB && reqNboType == StatusReserve:
|
|
|
+ downgradeType = "option_232GR5NMFCSG0"
|
|
|
+ case dbNboType == StatusC && reqNboType == StatusReserve:
|
|
|
+ downgradeType = "option_1ZV2GJLDKQOW0"
|
|
|
default:
|
|
|
- return myerrors.TipsError("错误的降级类型")
|
|
|
}
|
|
|
+ return downgradeType
|
|
|
+}
|
|
|
|
|
|
+// BusinessDowngrade 项目降级
|
|
|
+func (p *businessService) BusinessDowngrade(req *model.BusinessDowngradeReq) error {
|
|
|
+ business, err := p.BusinessGradation(req.Id, req.NboType, "down")
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ downgradeType := p.getBusDingDowngradeType(business.NboType, req.NboType)
|
|
|
+ if downgradeType == "" {
|
|
|
+ return myerrors.TipsError("错误的降级类型")
|
|
|
+ }
|
|
|
businessMap := g.Map{
|
|
|
p.Dao.C.ApproStatus: ApprovalWaiting,
|
|
|
}
|