Commit 7c40c2e0 by shiwenbo

修改库存逻辑,不再根据场站是否勾选砂石来判断场站和砂石的关联关系是否需要维护,而是将区域公司下的砂石类型和场站之间全部建立关系。

parent 499ed7fd
...@@ -138,7 +138,7 @@ public class InventoryServiceImpl implements InventoryService { ...@@ -138,7 +138,7 @@ public class InventoryServiceImpl implements InventoryService {
public void updateInventoryBaseInfo(UUID regionalCompany) { public void updateInventoryBaseInfo(UUID regionalCompany) {
List<StationDinasTypeRelation> relation = getStationAndDinasTypeRel(regionalCompany); List<StationDinasTypeRelation> relation = getStationAndDinasTypeRel(regionalCompany);
//根据最新的场站与砂石对应关系,更新库中的数据。添加新的砂石类型,废弃没用的砂石类型 //根据最新的区域公司与砂石对应关系,更新库中的数据。添加新的砂石类型,废弃没用的砂石类型
List<KObject> inventory = inventoryDao.listAllByRegionalCompany(regionalCompany, true); List<KObject> inventory = inventoryDao.listAllByRegionalCompany(regionalCompany, true);
for(StationDinasTypeRelation r : relation) { for(StationDinasTypeRelation r : relation) {
UUID stationId = r.getStationId(); UUID stationId = r.getStationId();
...@@ -192,8 +192,9 @@ public class InventoryServiceImpl implements InventoryService { ...@@ -192,8 +192,9 @@ public class InventoryServiceImpl implements InventoryService {
List<KObject> stationList; List<KObject> stationList;
try { try {
stationList = stationService.listStationInfoByRegionalCompany(regionalCompany); stationList = stationService.listStationInfoByRegionalCompany(regionalCompany);
//根据场站查砂石类型改成根据区域公司查砂石类型,默认每个场站都会卖这些砂石类型,把对应关系全部维护起来。
List<KObject> dinasTypeList = dinasTypeService.getByRegionalCompanyId(regionalCompany);
for(KObject station : stationList) { for(KObject station : stationList) {
List<KObject> dinasTypeList = dinasTypeService.getByStation(station.getUuid("id"));
//TODO:带出今日砂价 //TODO:带出今日砂价
for(KObject dinasType : dinasTypeList) { for(KObject dinasType : dinasTypeList) {
StationDinasTypeRelation item = new StationDinasTypeRelation(station.getUuid("id"), dinasType.getUuid("id"), new BigDecimal(0)); StationDinasTypeRelation item = new StationDinasTypeRelation(station.getUuid("id"), dinasType.getUuid("id"), new BigDecimal(0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment