|
|
@@ -10,6 +10,7 @@ import com.ecp.tire.center.warehouse.api.ship.entity.CenterShip;
|
|
|
import com.ecp.tire.center.warehouse.api.ship.entity.CenterShipCost;
|
|
|
import com.ecp.tire.center.warehouse.api.stock.entity.CenterStockDesc;
|
|
|
import com.ecp.tire.center.warehouse.api.stock.vo.CenterExportPlanInVo;
|
|
|
+import com.ecp.tire.center.warehouse.api.storage.entity.CenterStorageRegion;
|
|
|
import com.ecp.tire.center.warehouse.api.storage.vo.PlanAuditVo;
|
|
|
import com.ecp.tire.center.warehouse.pagehelper.PageHelperUtil;
|
|
|
import com.ecp.tire.center.warehouse.plan.mapper.CenterOrderPlanItemMapper;
|
|
|
@@ -19,6 +20,7 @@ import com.ecp.tire.center.warehouse.plan.service.ICenterOrderPlanService;
|
|
|
import com.ecp.tire.center.warehouse.ship.service.ICenterShipCostService;
|
|
|
import com.ecp.tire.center.warehouse.ship.service.ICenterShipService;
|
|
|
import com.ecp.tire.center.warehouse.stock.service.ICenterStockDescService;
|
|
|
+import com.ecp.tire.center.warehouse.storage.mapper.CenterStorageRegionMapper;
|
|
|
import com.ecp.tire.center.warehouse.util.BillCodeUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import org.springblade.common.enums.CenterTypeEnum;
|
|
|
@@ -58,7 +60,6 @@ public class CenterOrderPlanServiceImpl extends ServiceImpl<CenterOrderPlanMappe
|
|
|
|
|
|
private final CenterOrderPlanItemMapper centerOrderPlanItemMapper;
|
|
|
|
|
|
-
|
|
|
private final IPJCorpClient corpClient;
|
|
|
|
|
|
private final ICenterOrderPlanItemService centerOrderPlanItemService;
|
|
|
@@ -73,11 +74,14 @@ public class CenterOrderPlanServiceImpl extends ServiceImpl<CenterOrderPlanMappe
|
|
|
|
|
|
private final IPJCorpClient pjCorpClient;
|
|
|
|
|
|
+ private final CenterStorageRegionMapper centerStorageRegionMapper;
|
|
|
+
|
|
|
|
|
|
public CenterOrderPlanServiceImpl(CenterOrderPlanItemMapper centerOrderPlanItemMapper, IPJCorpClient corpClient,
|
|
|
ICenterOrderPlanItemService centerOrderPlanItemService, ISysClient sysClient,
|
|
|
ICenterShipService centerShipService, ICenterShipCostService centerShipCostService,
|
|
|
- ICenterStockDescService centerStockDescService, IPJCorpClient pjCorpClient) {
|
|
|
+ ICenterStockDescService centerStockDescService, IPJCorpClient pjCorpClient,
|
|
|
+ CenterStorageRegionMapper centerStorageRegionMapper) {
|
|
|
this.centerOrderPlanItemMapper = centerOrderPlanItemMapper;
|
|
|
this.corpClient = corpClient;
|
|
|
this.centerOrderPlanItemService = centerOrderPlanItemService;
|
|
|
@@ -86,7 +90,7 @@ public class CenterOrderPlanServiceImpl extends ServiceImpl<CenterOrderPlanMappe
|
|
|
this.pjCorpClient = pjCorpClient;
|
|
|
this.centerShipCostService = centerShipCostService;
|
|
|
this.centerStockDescService = centerStockDescService;
|
|
|
-
|
|
|
+ this.centerStorageRegionMapper = centerStorageRegionMapper;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -377,7 +381,7 @@ public class CenterOrderPlanServiceImpl extends ServiceImpl<CenterOrderPlanMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R importCenterPlanItemCode(List<ShipItemImportXSCodeExcel> excelList) {
|
|
|
+ public R importCenterPlanItemCode(List<ShipItemImportXSCodeExcel> excelList, Long storageId) {
|
|
|
List<PjOrderItems> list = new ArrayList<>();
|
|
|
List<String> codesList = excelList.stream().map(ShipItemImportXSCodeExcel::getCode).distinct()
|
|
|
.filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
@@ -389,6 +393,11 @@ public class CenterOrderPlanServiceImpl extends ServiceImpl<CenterOrderPlanMappe
|
|
|
if (CollectionUtils.isEmpty(goodsDescList)) {
|
|
|
return R.fail("未找到商品数据,请核实后重试");
|
|
|
}
|
|
|
+ List<CenterStorageRegion> storageRegionList = centerStorageRegionMapper.selectList(new LambdaQueryWrapper<CenterStorageRegion>()
|
|
|
+ .eq(CenterStorageRegion::getTenantId, bladeUser.getTenantId()).eq(CenterStorageRegion::getIsDeleted, 0).eq(CenterStorageRegion::getParentId, storageId));
|
|
|
+ if (CollectionUtils.isEmpty(storageRegionList)) {
|
|
|
+ return R.fail("未在选择的仓库中找到库区数据,请核实后重试");
|
|
|
+ }
|
|
|
StringBuilder text = new StringBuilder();
|
|
|
int itemNum = 0;
|
|
|
for (ShipItemImportXSCodeExcel excelItem : excelList) {
|
|
|
@@ -402,6 +411,7 @@ public class CenterOrderPlanServiceImpl extends ServiceImpl<CenterOrderPlanMappe
|
|
|
text.append("第").append(itemNum).append("行,数量为空").append("\n");
|
|
|
add = false;
|
|
|
}
|
|
|
+ CenterStorageRegion storageRegion = storageRegionList.stream().filter(item -> item.getRegionName().equals(excelItem.getRegionName())).findFirst().orElse(null);
|
|
|
PjOrderItems item = new PjOrderItems();
|
|
|
item.setGoodsNum(excelItem.getGoodsNum());
|
|
|
item.setGoodsNo(excelItem.getCode());
|
|
|
@@ -421,6 +431,11 @@ public class CenterOrderPlanServiceImpl extends ServiceImpl<CenterOrderPlanMappe
|
|
|
item.setGoodsDescription(goodsDesc.getGoodsDescription());
|
|
|
item.setPattern(goodsDesc.getBrandItem());
|
|
|
item.setSendNum(BigDecimal.ZERO);
|
|
|
+ item.setDot(excelItem.getDot());
|
|
|
+ if (storageRegion != null) {
|
|
|
+ item.setRegionId(storageRegion.getId());
|
|
|
+ item.setRegionName(storageRegion.getRegionName());
|
|
|
+ }
|
|
|
if (add) {
|
|
|
list.add(item);
|
|
|
}
|
|
|
@@ -433,7 +448,7 @@ public class CenterOrderPlanServiceImpl extends ServiceImpl<CenterOrderPlanMappe
|
|
|
BladeUser bladeUser = AuthUtil.getUser();
|
|
|
centerOrderPlanVo.setCreateUser(bladeUser.getUserId());
|
|
|
centerOrderPlanVo.setCreateDept(Long.valueOf(bladeUser.getDeptId()));
|
|
|
- centerOrderPlanVo.setIsAdmin(AuthUtil.isAdmin() ? 0: 1);
|
|
|
+ // centerOrderPlanVo.setIsAdmin(AuthUtil.isAdmin() ? 0: 1);
|
|
|
return baseMapper.exportPlanInData(centerOrderPlanVo);
|
|
|
}
|
|
|
|