|
|
@@ -2,6 +2,7 @@ package proj
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "os"
|
|
|
|
|
|
contractDao "dashoo.cn/micro/app/dao/contract"
|
|
|
custDao "dashoo.cn/micro/app/dao/cust"
|
|
|
@@ -638,9 +639,7 @@ func (p *businessService) BusinessUpgrade(req *model.BusinessUpgradeReq, fileMap
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- businessMap := g.Map{
|
|
|
- p.Dao.C.ApproStatus: ApprovalWaiting,
|
|
|
- }
|
|
|
+ businessMap := g.Map{p.Dao.C.ApproStatus: ApprovalWaiting}
|
|
|
service.SetUpdatedInfo(businessMap, p.GetCxtUserId(), p.GetCxtUserName())
|
|
|
|
|
|
opnContent := gconv.Map(req)
|
|
|
@@ -648,6 +647,24 @@ func (p *businessService) BusinessUpgrade(req *model.BusinessUpgradeReq, fileMap
|
|
|
opnContent["approStatus"] = ApprovalWaiting
|
|
|
service.SetUpdatedInfo(opnContent, p.GetCxtUserId(), p.GetCxtUserName())
|
|
|
|
|
|
+ if fileMap == nil {
|
|
|
+ fileMap = make(map[string]*multipart.FileHeader)
|
|
|
+ }
|
|
|
+ if req.NboType == StatusA || req.NboType == StatusB {
|
|
|
+ fileMap["quotationFile"], err = service.DownloadTempFile(req.QuotationFile)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ defer os.Remove(fileMap["quotationFile"].File.Name())
|
|
|
+ }
|
|
|
+ if req.NboType == StatusA && req.IsAdoptDashoo == "10" {
|
|
|
+ fileMap["dashooParamFile"], err = service.DownloadTempFile(req.DashooParamFile)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ defer os.Remove(fileMap["dashooParamFile"].File.Name())
|
|
|
+ }
|
|
|
+
|
|
|
err = p.Dao.Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
|
|
|
// 更新项目调级
|
|
|
_, err = p.Dao.TX(tx).WherePri(req.Id).Data(businessMap).Update()
|