|
@@ -568,10 +568,10 @@ func Check_NeedToDelete_Product_List(list []string, newList []Contract.ContractP
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for _, product := range newList {
|
|
for _, product := range newList {
|
|
|
- all[product.T_product_id] = fmt.Sprintf("%d-%d", product.Id, product.T_product_total)
|
|
|
|
|
|
|
+ all[product.T_product_id] = fmt.Sprintf("%d-%d-%f", product.Id, product.T_product_total, product.T_price)
|
|
|
_, ok := productMap[product.T_product_id]
|
|
_, ok := productMap[product.T_product_id]
|
|
|
if !ok {
|
|
if !ok {
|
|
|
- id := fmt.Sprintf("%d-%d", product.Id, product.T_product_id)
|
|
|
|
|
|
|
+ id := fmt.Sprintf("%d-%d-%f", product.Id, product.T_product_id, product.T_price)
|
|
|
needToDelete[id] = product.T_product_out
|
|
needToDelete[id] = product.T_product_out
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -880,8 +880,9 @@ func (c *ContractController) VerifyContract_Edit() {
|
|
|
T_contract_number: T_number,
|
|
T_contract_number: T_number,
|
|
|
T_product_id: product_id,
|
|
T_product_id: product_id,
|
|
|
T_product_total: num,
|
|
T_product_total: num,
|
|
|
- T_product_out: 0, // 已出库数量
|
|
|
|
|
- T_State: 1, // 1-未出库 2-已部分出库 3-已全部出库
|
|
|
|
|
|
|
+ T_product_out: 0, // 已出库数量
|
|
|
|
|
+ T_price: float32(price), // 已出库数量
|
|
|
|
|
+ T_State: 1, // 1-未出库 2-已部分出库 3-已全部出库
|
|
|
}
|
|
}
|
|
|
_, err = ContractProductDao.Add_ContractProduct(contractProduct)
|
|
_, err = ContractProductDao.Add_ContractProduct(contractProduct)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -897,7 +898,8 @@ func (c *ContractController) VerifyContract_Edit() {
|
|
|
// 修改产品总数量
|
|
// 修改产品总数量
|
|
|
contractProductId, _ := strconv.Atoi(strings.Split(oldContractProduct, "-")[0])
|
|
contractProductId, _ := strconv.Atoi(strings.Split(oldContractProduct, "-")[0])
|
|
|
oldNum, _ := strconv.Atoi(strings.Split(oldContractProduct, "-")[1])
|
|
oldNum, _ := strconv.Atoi(strings.Split(oldContractProduct, "-")[1])
|
|
|
- if oldNum == num && T_number == oldT_number {
|
|
|
|
|
|
|
+ oldPrice := lib.StringToFloat64TwoDecimal(strings.Split(oldContractProduct, "-")[2])
|
|
|
|
|
+ if oldNum == num && T_number == oldT_number && oldPrice == price {
|
|
|
continue
|
|
continue
|
|
|
}
|
|
}
|
|
|
cp := Contract.ContractProduct{
|
|
cp := Contract.ContractProduct{
|
|
@@ -906,7 +908,7 @@ func (c *ContractController) VerifyContract_Edit() {
|
|
|
T_product_total: num,
|
|
T_product_total: num,
|
|
|
T_price: float32(price), // 价格
|
|
T_price: float32(price), // 价格
|
|
|
}
|
|
}
|
|
|
- err = ContractProductDao.Update_ContractProduct(cp, "T_product_total", "T_contract_number")
|
|
|
|
|
|
|
+ err = ContractProductDao.Update_ContractProduct(cp, "T_product_total", "T_contract_number", "T_price")
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
o.Rollback()
|
|
o.Rollback()
|
|
|
c.Data["json"] = lib.JSONS{Code: 203, Msg: "修改失败"}
|
|
c.Data["json"] = lib.JSONS{Code: 203, Msg: "修改失败"}
|