|
@@ -1,7 +1,6 @@
|
|
|
package fms
|
|
|
|
|
|
import (
|
|
|
- "hongze/fms_api/controller/resp"
|
|
|
"hongze/fms_api/global"
|
|
|
"hongze/fms_api/models/base"
|
|
|
"hongze/fms_api/utils"
|
|
@@ -744,7 +743,7 @@ func UpdateSupplementContractPreRegister(item *ContractRegister, serviceAmountLi
|
|
|
}
|
|
|
|
|
|
if e := tmp.Create(); e != nil {
|
|
|
- resp.FailData("日期格式有误", "Err:"+e.Error(), c)
|
|
|
+ err = e
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -784,42 +783,5 @@ func UpdateSupplementContractPreRegister(item *ContractRegister, serviceAmountLi
|
|
|
//}
|
|
|
}
|
|
|
|
|
|
- for i := range invoiceList {
|
|
|
- if invoiceList[i].ContractInvoiceId == 0{
|
|
|
- if e := invoiceList[i].Create(); e != nil {
|
|
|
- err = e
|
|
|
- return
|
|
|
- }
|
|
|
- } else {
|
|
|
- if e := tx.Model(invoiceList[i]).Select(invoiceUpdateCols).Updates(invoiceList[i]).Error; e != nil {
|
|
|
- err = e
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //更新另一类型的invoice表数据
|
|
|
- invoiceItem := ContractInvoice{
|
|
|
- ContractRegisterId: item.ContractRegisterId,
|
|
|
- StartDate: item.StartDate,
|
|
|
- EndDate: item.EndDate,
|
|
|
- CurrencyUnit: item.CurrencyUnit,
|
|
|
- }
|
|
|
- tx.Model(&invoiceItem).Select([]string{"StartDate","EndDate","CurrencyUnit"}).Where("ContractRegisterId",item.ContractRegisterId).Updates(invoiceItem)
|
|
|
-
|
|
|
- //删除
|
|
|
- if len(delInvoiceIds) > 0 {
|
|
|
- for _, id := range delInvoiceIds {
|
|
|
- ob := ContractInvoice{ContractInvoiceId: id}
|
|
|
- tx.Model(&ob).Delete(ob)
|
|
|
- }
|
|
|
- }
|
|
|
- if len(delPreRegisterIds) > 0 {
|
|
|
- for _, id := range delPreRegisterIds {
|
|
|
- ob := ContractPreRegister{PreRegisterId: id}
|
|
|
- tx.Model(&ob).Delete(ob)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
return
|
|
|
}
|