|
|
|
@ -28,7 +28,9 @@ import com.logpm.basic.entity.BasicMaterialEntity;
|
|
|
|
|
import com.logpm.basic.entity.BasicPrintTemplateEntity; |
|
|
|
|
import com.logpm.basic.feign.IBasicMaterialClient; |
|
|
|
|
import com.logpm.basic.feign.IBasicPrintTemplateClient; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataClientEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataClientClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
|
import com.logpm.distribution.dto.DistributionStockArticleDTO; |
|
|
|
|
import com.logpm.distribution.dto.DistributionStockArticleOweDTO; |
|
|
|
@ -138,6 +140,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
private final IDistributionLoadscanService distributionLoadscanService; |
|
|
|
|
private final IDistributionOrderCustomerLogService distributionOrderCustomerLogService; |
|
|
|
|
private final IBasicdataClientClient basicdataClientClient; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionStockArticleVO> selectDistributionStockArticlePage(IPage<DistributionStockArticleVO> page, DistributionStockArticleVO distributionStockArticle) { |
|
|
|
@ -180,14 +183,14 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
list.forEach(li -> { |
|
|
|
|
DistributionStockArticleVO distributionStockArticleVO = buildVo(li); |
|
|
|
|
DistributionStockArticleExcel excel = new DistributionStockArticleExcel(); |
|
|
|
|
assert distributionStockArticleVO != null; |
|
|
|
|
if (distributionStockArticleVO.getTotalNumber() != null && |
|
|
|
|
assert distributionStockArticleVO != null; |
|
|
|
|
if (distributionStockArticleVO.getTotalNumber() != null && |
|
|
|
|
distributionStockArticleVO.getIncomingNum() != null) { |
|
|
|
|
distributionStockArticleVO.setUnreceivedQuantity( |
|
|
|
|
distributionStockArticleVO.getTotalNumber() - distributionStockArticleVO.getIncomingNum() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
excel.setIsZeroString("1".equals(distributionStockArticleVO.getIsZero())?"是":"否"); |
|
|
|
|
excel.setIsZeroString("1".equals(distributionStockArticleVO.getIsZero()) ? "是" : "否"); |
|
|
|
|
BeanUtil.copyProperties(distributionStockArticleVO, excel); |
|
|
|
|
excelList.add(excel); |
|
|
|
|
}); |
|
|
|
@ -199,6 +202,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建参数 |
|
|
|
|
* |
|
|
|
|
* @param distributionStockArticle |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
@ -1169,9 +1173,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
IPage<DistributionStockArticleEntity> stockArticleEntityList = baseMapper.selectAllDistributionOrder(page, stockArticleEntity); |
|
|
|
|
List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleNewWrapper.build().listVO(stockArticleEntityList.getRecords()); |
|
|
|
|
for (DistributionStockArticleVO stockArticleVO : stockArticleVOS) { |
|
|
|
|
if (IsOrNoConstant.no.getValue().equals(stockArticleVO.getIsZero())){ |
|
|
|
|
if (IsOrNoConstant.no.getValue().equals(stockArticleVO.getIsZero())) { |
|
|
|
|
stockArticleVO.setReservationNum(stockArticleVO.getHandQuantity()); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
List<DistributionParcelNumberVO> distributionParcelNumberVOS = distributionParcelNumberMapper.selectZeroPackage(stockArticleVO.getId()); |
|
|
|
|
// 零担查询当前操作计划可用数量
|
|
|
|
|
int reservationNum = distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getHandQuantity).sum() - distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getDeliveryQuantity).sum(); |
|
|
|
@ -2010,7 +2014,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} else if (collect.size() == 1) { |
|
|
|
|
stockArticleEntity.setWarehouseId(collect.get(0)); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(currentWarehouse)){ |
|
|
|
|
if (Func.isNotEmpty(currentWarehouse)) { |
|
|
|
|
stockArticleEntity.setWarehouseIdList(null); |
|
|
|
|
stockArticleEntity.setWarehouseId(currentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
@ -2028,7 +2032,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void updateAllOrderTotalNum(String orderCode, Integer total) { |
|
|
|
|
baseMapper.updateAllOrderTotalNum(orderCode,total); |
|
|
|
|
baseMapper.updateAllOrderTotalNum(orderCode, total); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -2078,7 +2082,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} else if (collect.size() == 1) { |
|
|
|
|
stockArticleEntity.setWarehouseId(collect.get(0)); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(currentWarehouse)){ |
|
|
|
|
if (Func.isNotEmpty(currentWarehouse)) { |
|
|
|
|
stockArticleEntity.setWarehouseIdList(null); |
|
|
|
|
stockArticleEntity.setWarehouseId(currentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
@ -2098,6 +2102,50 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return signForStockArticleExcels; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param orderIds |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Boolean maintenanceOrderMall(String orderIds) { |
|
|
|
|
List<DistributionStockArticleEntity> distributionStockArticleEntities = this.listByIds(Func.toLongList(orderIds)); |
|
|
|
|
List<DistributionStockArticleEntity> list = new ArrayList<>(); |
|
|
|
|
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) { |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity(); |
|
|
|
|
stockArticleEntity.setId(distributionStockArticleEntity.getId()); |
|
|
|
|
if (Func.isNotEmpty(distributionStockArticleEntity.getConsigneeUnit())) { |
|
|
|
|
//查询客户
|
|
|
|
|
List<BasicdataClientEntity> clientByName = basicdataClientClient.getClientByName(distributionStockArticleEntity.getConsigneeUnit()); |
|
|
|
|
if (!clientByName.isEmpty()) { |
|
|
|
|
BasicdataClientEntity basicdataClientEntity = clientByName.get(0); |
|
|
|
|
stockArticleEntity.setMallId(basicdataClientEntity.getId()); |
|
|
|
|
stockArticleEntity.setMallName(basicdataClientEntity.getClientName()); |
|
|
|
|
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
} else { |
|
|
|
|
List<Map<String, Object>> maps = baseMapper.selectAdvance(distributionStockArticleEntity.getOrderCode()); |
|
|
|
|
if (!maps.isEmpty()) { |
|
|
|
|
String dealerName = (String) maps.get(0).get("dealer_name"); |
|
|
|
|
String dealerCode = (String) maps.get(0).get("dealer_code"); |
|
|
|
|
stockArticleEntity.setMallName(dealerName); |
|
|
|
|
stockArticleEntity.setMallCode(dealerCode); |
|
|
|
|
} else { |
|
|
|
|
stockArticleEntity.setMallName(distributionStockArticleEntity.getConsigneeUnit()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
list.add(stockArticleEntity); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean flag = this.updateBatchById(list); |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>维护订单商场信息,:{}",flag); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R findEditCustomerLog(Long orderId) { |
|
|
|
|
|
|
|
|
|