|
@@ -26,10 +26,10 @@ import java.util.List;
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
public class PurchaseFlow extends FlowDelegate {
|
|
public class PurchaseFlow extends FlowDelegate {
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private PurchaseService purchaseService;
|
|
private PurchaseService purchaseService;
|
|
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private PurchaseBomService purchaseBomService;
|
|
private PurchaseBomService purchaseBomService;
|
|
|
|
|
|
@@ -44,10 +44,6 @@ public class PurchaseFlow extends FlowDelegate {
|
|
return "purchase";
|
|
return "purchase";
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 流程发起
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public Long start(Long flowId, JSONObject submitData) {
|
|
public Long start(Long flowId, JSONObject submitData) {
|
|
|
|
|
|
@@ -74,32 +70,26 @@ public class PurchaseFlow extends FlowDelegate {
|
|
return purchase.getId();
|
|
return purchase.getId();
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 流程结束
|
|
|
|
- * @param flowId
|
|
|
|
- * @param businessId
|
|
|
|
- * @param submitData
|
|
|
|
- */
|
|
|
|
@Override
|
|
@Override
|
|
public void end(Long flowId, Long businessId, JSONObject submitData) {
|
|
public void end(Long flowId, Long businessId, JSONObject submitData) {
|
|
Purchase purchase = purchaseService.getById(businessId);
|
|
Purchase purchase = purchaseService.getById(businessId);
|
|
purchase.setFlowStatus(PurchaseEnums.PASSED.getKey());
|
|
purchase.setFlowStatus(PurchaseEnums.PASSED.getKey());
|
|
purchase.setFlowId(flowId);
|
|
purchase.setFlowId(flowId);
|
|
- //修改采购暂存表的数据
|
|
|
|
|
|
+ // 修改采购暂存表的数据
|
|
purchaseService.updateById(purchase);
|
|
purchaseService.updateById(purchase);
|
|
|
|
|
|
- //修改申购表的状态为已申购
|
|
|
|
|
|
+ // 修改申购表的状态为已申购
|
|
ApplyBuy applyBuy = new ApplyBuy();
|
|
ApplyBuy applyBuy = new ApplyBuy();
|
|
applyBuy.setId(purchase.getApplyBuyId());
|
|
applyBuy.setId(purchase.getApplyBuyId());
|
|
applyBuy.setFlowStatus(4);
|
|
applyBuy.setFlowStatus(4);
|
|
applyBuyService.updateById(applyBuy);
|
|
applyBuyService.updateById(applyBuy);
|
|
|
|
|
|
-
|
|
|
|
- //查询采购合同bom表的信息
|
|
|
|
|
|
+ // 查询采购合同bom表的信息
|
|
List<PurchaseBom> purchaseBoms = purchaseBomService.list(Wrappers.<PurchaseBom>lambdaQuery().eq(PurchaseBom::getPurchaseId, businessId));
|
|
List<PurchaseBom> purchaseBoms = purchaseBomService.list(Wrappers.<PurchaseBom>lambdaQuery().eq(PurchaseBom::getPurchaseId, businessId));
|
|
|
|
|
|
List<ApplyBuyBom> applyBuyBomList = new ArrayList<>();
|
|
List<ApplyBuyBom> applyBuyBomList = new ArrayList<>();
|
|
- //修改申购bom表的采购数量
|
|
|
|
|
|
+
|
|
|
|
+ // 修改申购bom表的采购数量
|
|
for (PurchaseBom purchaseBom : purchaseBoms) {
|
|
for (PurchaseBom purchaseBom : purchaseBoms) {
|
|
ApplyBuyBom applyBuyBom = new ApplyBuyBom();
|
|
ApplyBuyBom applyBuyBom = new ApplyBuyBom();
|
|
applyBuyBom.setPurchaseQuantity(purchaseBom.getPurchaseQuantity());
|
|
applyBuyBom.setPurchaseQuantity(purchaseBom.getPurchaseQuantity());
|
|
@@ -124,4 +114,5 @@ public class PurchaseFlow extends FlowDelegate {
|
|
//修改采购暂存表的数据
|
|
//修改采购暂存表的数据
|
|
purchaseService.updateById(purchase);
|
|
purchaseService.updateById(purchase);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|