提交 dc185a8c 编写于 作者: yujiaming's avatar yujiaming

action_cancel, action_done行为更新

上级 95cbc82b
...@@ -56,10 +56,8 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm ...@@ -56,10 +56,8 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
List<Purchase_requisition_line> lines = purchaseRequisitionLineService.selectByRequisitionId(et.getId()); List<Purchase_requisition_line> lines = purchaseRequisitionLineService.selectByRequisitionId(et.getId());
if(lines.size() != 0){ if(lines.size() != 0){
for(Purchase_requisition_line line : lines){ for(Purchase_requisition_line line : lines){
//移除 line 关联 supplierinfo,从Product_supplierinfo中删除相关的记录 //移除 line 关联 supplierinfo,从Product_supplierinfo表中将采购申请所对应的供应商价格记录删除
// 调用的时models.py中的unlink()方法,从Product_supplierinfo表中将采购申请所对应的供应商价格记录删除 supplierinfoService.removeByPurchaseRequisitionLineId(line.getRequisitionId());
// unlink() 作用是删除当前表中的采购申请行对应的供应商价格记录
} }
} }
// 取消采购申请所对应的采购订单 // 取消采购申请所对应的采购订单
...@@ -68,7 +66,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm ...@@ -68,7 +66,7 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
purchaseOrderService.button_cancel(order); purchaseOrderService.button_cancel(order);
// 本采购申请单相关的采购询价单已取消 // 本采购申请单相关的采购询价单已取消
} }
log.warn("purchase_order"); // log.warn("purchase_order");
et.setState(StaticDict.PURCHASE_REQUISITION__STATE.CANCEL.getValue()); et.setState(StaticDict.PURCHASE_REQUISITION__STATE.CANCEL.getValue());
this.update(et); this.update(et);
...@@ -96,11 +94,10 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm ...@@ -96,11 +94,10 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
//移除 line 关联 supplierinfo,从Product_supplierinfo中删除相关的记录 //移除 line 关联 supplierinfo,从Product_supplierinfo中删除相关的记录
if(lines.size() != 0){ if(lines.size() != 0){
for(Purchase_requisition_line line : lines){ for(Purchase_requisition_line line : lines){
// 需要调用product.supplierinfo模型中的unlink()方法,未处理 supplierinfoService.removeByPurchaseRequisitionLineId(line.getRequisitionId());
// unlink() 作用是删除当前表中的采购申请行对应的供应商价格记录
} }
} }
log.warn("移除 line 关联 supplierinfo"); // log.warn("移除 line 关联 supplierinfo");
et.setState(StaticDict.PURCHASE_REQUISITION__STATE.DONE.getValue()); et.setState(StaticDict.PURCHASE_REQUISITION__STATE.DONE.getValue());
this.update(et); this.update(et);
...@@ -158,12 +155,13 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm ...@@ -158,12 +155,13 @@ public class Purchase_requisitionExService extends Purchase_requisitionServiceIm
supplierinfo.setPrice(line.getPriceUnit()); supplierinfo.setPrice(line.getPriceUnit());
supplierinfo.setCurrencyId(purchaseRequisition.getCurrencyId()); supplierinfo.setCurrencyId(purchaseRequisition.getCurrencyId());
supplierinfo.setPurchaseRequisitionLineId(line.getId()); supplierinfo.setPurchaseRequisitionLineId(line.getId());
// 设置不能为空的值为默认值,sequence,minqty, // 设置不能为空的值为默认值,sequence,minqty,delay
supplierinfo.setSequence(1); supplierinfo.setSequence(1);
supplierinfo.setMinQty(0.0); supplierinfo.setMinQty(0.0);
supplierinfo.setDelay(1);
supplierinfoService.create(supplierinfo); supplierinfoService.create(supplierinfo);
} }
log.warn("关联 create_supplier_info"); // log.warn("关联 create_supplier_info");
} }
et.setState(StaticDict.PURCHASE_REQUISITION__STATE.ONGOING.getValue()); et.setState(StaticDict.PURCHASE_REQUISITION__STATE.ONGOING.getValue());
} else { } else {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册