|
@@ -23,43 +23,40 @@ public class SupplierPriceUpdateFlow {
|
|
|
@Autowired
|
|
|
private SupplierPriceChangeService supplierPriceChangeService;
|
|
|
|
|
|
- private FlowConstructor getFlowConstructor() {
|
|
|
- return FlowConstructor.init(new ExampleAbstract() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public String getCode() {
|
|
|
- return "js_supplierPriceUpdate";
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void end() {
|
|
|
-
|
|
|
- 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);
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- }
|
|
|
+ private final FlowConstructor flowConstructor = FlowConstructor.init(new ExampleAbstract() {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getCode() {
|
|
|
+ return "js_supplierPriceUpdate";
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void end() {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
public void create(SupplierPriceVo supplierPriceVo) {
|
|
|
- getFlowConstructor().create(supplierPriceVo.getId(), "价格维护", supplierPriceVo.getRemarks(), supplierPriceVo);
|
|
|
+ flowConstructor.create(supplierPriceVo.getId(), "价格维护", supplierPriceVo.getRemarks(), supplierPriceVo);
|
|
|
}
|
|
|
|
|
|
public void jump(JumpVo jumpVo) {
|
|
|
- getFlowConstructor().jump(jumpVo);
|
|
|
+ flowConstructor.jump(jumpVo);
|
|
|
}
|
|
|
|
|
|
}
|