|
@@ -105,6 +105,7 @@ func PlanAllocBatch(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
if len(typeBillIds) < 1 {
|
|
|
return nil, errors.New("未找到单据信息")
|
|
|
}
|
|
|
+ _isSend := true
|
|
|
|
|
|
var wg sync.WaitGroup
|
|
|
for _, tId := range typeBillIds {
|
|
@@ -116,7 +117,7 @@ func PlanAllocBatch(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
if tidArr[0] == "1" {
|
|
|
billType = PURCHASE_BILL_TYPE
|
|
|
// _, err = repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillPurchase, billId.Hex(), &model.PurchaseBill{IsSend: true, SendTime: time.Now()})
|
|
|
- _, err = repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillPurchase, billId.Hex(), &model.PurchaseBill{IsSend: true, SendTime: time.Now()}, &repo.RecordLogReq{
|
|
|
+ _, err = repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillPurchase, billId.Hex(), &model.PurchaseBill{IsSend: &_isSend, SendTime: time.Now()}, &repo.RecordLogReq{
|
|
|
Path: c.Request.URL.Path,
|
|
|
UserInfo: user,
|
|
|
TargetId: billId.Hex(),
|
|
@@ -127,7 +128,7 @@ func PlanAllocBatch(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
if tidArr[0] == "2" {
|
|
|
billType = PRODUCE_BILL_TYPE
|
|
|
// _, err = repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduce, billId.Hex(), &model.ProduceBill{IsSend: true, SendTime: time.Now()})
|
|
|
- _, err = repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillProduce, billId.Hex(), &model.ProduceBill{IsSend: true, SendTime: time.Now()}, &repo.RecordLogReq{
|
|
|
+ _, err = repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillProduce, billId.Hex(), &model.ProduceBill{IsSend: &_isSend, SendTime: time.Now()}, &repo.RecordLogReq{
|
|
|
Path: c.Request.URL.Path,
|
|
|
UserInfo: user,
|
|
|
TargetId: billId.Hex(),
|
|
@@ -138,7 +139,7 @@ func PlanAllocBatch(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
if tidArr[0] == "3" {
|
|
|
billType = PRODUCT_BILL_TYPE
|
|
|
// _, err = repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduct, billId.Hex(), &model.ProductBill{IsSend: true, SendTime: time.Now()})
|
|
|
- _, err = repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillProduct, billId.Hex(), &model.ProductBill{IsSend: true, SendTime: time.Now()}, &repo.RecordLogReq{
|
|
|
+ _, err = repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillProduct, billId.Hex(), &model.ProductBill{IsSend: &_isSend, SendTime: time.Now()}, &repo.RecordLogReq{
|
|
|
Path: c.Request.URL.Path,
|
|
|
UserInfo: user,
|
|
|
TargetId: billId.Hex(),
|