|
@@ -1,8 +1,10 @@
|
|
package com.fjhx.service.flow;
|
|
package com.fjhx.service.flow;
|
|
|
|
|
|
import com.fjhx.entity.supplier.SupplierPrice;
|
|
import com.fjhx.entity.supplier.SupplierPrice;
|
|
-import com.fjhx.params.FlowVo;
|
|
|
|
|
|
+import com.fjhx.entity.supplier.SupplierPriceChange;
|
|
|
|
+import com.fjhx.params.JumpVo;
|
|
import com.fjhx.params.supplier.SupplierPriceVo;
|
|
import com.fjhx.params.supplier.SupplierPriceVo;
|
|
|
|
+import com.fjhx.service.supplier.SupplierPriceChangeService;
|
|
import com.fjhx.service.supplier.SupplierPriceService;
|
|
import com.fjhx.service.supplier.SupplierPriceService;
|
|
import com.fjhx.utils.ExampleAbstract;
|
|
import com.fjhx.utils.ExampleAbstract;
|
|
import com.fjhx.utils.FlowConstructor;
|
|
import com.fjhx.utils.FlowConstructor;
|
|
@@ -18,6 +20,9 @@ public class SupplierPriceUpdateFlow {
|
|
@Autowired
|
|
@Autowired
|
|
private SupplierPriceService supplierPriceService;
|
|
private SupplierPriceService supplierPriceService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private SupplierPriceChangeService supplierPriceChangeService;
|
|
|
|
+
|
|
private FlowConstructor getFlowConstructor() {
|
|
private FlowConstructor getFlowConstructor() {
|
|
return FlowConstructor.init(new ExampleAbstract() {
|
|
return FlowConstructor.init(new ExampleAbstract() {
|
|
|
|
|
|
@@ -28,8 +33,22 @@ public class SupplierPriceUpdateFlow {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void end() {
|
|
public void end() {
|
|
- SupplierPrice supplierPrice = getCacheData(SupplierPrice.class);
|
|
|
|
- supplierPriceService.updateById(supplierPrice);
|
|
|
|
|
|
+
|
|
|
|
+ SupplierPriceVo supplierPriceVo = getCacheData(SupplierPriceVo.class);
|
|
|
|
+
|
|
|
|
+ // 添加价格变更记录
|
|
|
|
+ SupplierPrice supplierPrice = supplierPriceService.getById(supplierPriceVo.getId());
|
|
|
|
+ SupplierPriceChange supplierPriceChange = new SupplierPriceChange();
|
|
|
|
+ supplierPriceChange.setSupplierPriceId(supplierPrice.getId());
|
|
|
|
+ supplierPriceChange.setSupplierId(supplierPrice.getSupplierId());
|
|
|
|
+ supplierPriceChange.setMaterialId(supplierPrice.getMaterialId());
|
|
|
|
+ supplierPriceChange.setOldPrice(supplierPrice.getPrice());
|
|
|
|
+ supplierPriceChange.setNewPrice(supplierPriceVo.getPrice());
|
|
|
|
+ supplierPriceChange.setRemark(supplierPriceVo.getRemarks());
|
|
|
|
+ supplierPriceChangeService.save(supplierPriceChange);
|
|
|
|
+
|
|
|
|
+ // 变更价格
|
|
|
|
+ supplierPriceService.updateById(supplierPriceVo);
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
});
|
|
@@ -39,8 +58,8 @@ public class SupplierPriceUpdateFlow {
|
|
getFlowConstructor().create(supplierPriceVo.getId(), "价格维护", supplierPriceVo.getRemarks(), supplierPriceVo);
|
|
getFlowConstructor().create(supplierPriceVo.getId(), "价格维护", supplierPriceVo.getRemarks(), supplierPriceVo);
|
|
}
|
|
}
|
|
|
|
|
|
- public void jump(FlowVo flowVo) {
|
|
|
|
- getFlowConstructor().jump(flowVo);
|
|
|
|
|
|
+ public void jump(JumpVo jumpVo) {
|
|
|
|
+ getFlowConstructor().jump(jumpVo);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|