Browse Source

维护订单日志增加

dist.1.3.0
汤建军 8 months ago
parent
commit
5482ee7451
  1. 77
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

77
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -305,7 +305,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
distributionStockupVO.setStockupStatusName(DictBizCache.getValue(DictBizConstant.ORDER_STOCKUP_STATUS, distributionStockupVO.getStockupStatus()));
if (ObjectUtils.isNotNull(distributionStockupVO.getCreateUser())) {
R<User> userR = userClient.userInfoById(distributionStockupVO.getCreateUser());
if(userR.isSuccess()&& userR.getData()!=null){
if (userR.isSuccess() && userR.getData() != null) {
distributionStockupVO.setCreateUserName(userR.getData().getName());
}
}
@ -708,9 +708,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
warehouseIds.addAll(warehouseListIds);
}
} else {
warehouseIds.add( myCurrentWarehouse.getId());
warehouseIds.add(myCurrentWarehouse.getId());
}
List<DistributionStockArticleEntity> result = baseMapper.selectClientListPage(page, distributionStockArticle,warehouseIds);
List<DistributionStockArticleEntity> result = baseMapper.selectClientListPage(page, distributionStockArticle, warehouseIds);
return page.setRecords(result);
}
@ -874,7 +874,6 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public IPage<DistributionStockArticleVO> handlePackage(IPage<DistributionStockArticleVO> pageVO) {
@ -1012,15 +1011,15 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
// }
List<Long> warehouseIdList = new ArrayList<>();
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Func.isEmpty(myCurrentWarehouse)){
if (Func.isEmpty(myCurrentWarehouse)) {
List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWarehouseList();
List<Long> collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
warehouseIdList.addAll(collect);
}else{
} else {
warehouseIdList.add(myCurrentWarehouse.getId());
}
IPage<DistributionStockArticleEntity> distributionStockArticleEntityIPage = baseMapper.pageListOwe(page, stockArticleEntity,warehouseIdList);
IPage<DistributionStockArticleEntity> distributionStockArticleEntityIPage = baseMapper.pageListOwe(page, stockArticleEntity, warehouseIdList);
return distributionStockArticleEntityIPage;
}
@ -1133,7 +1132,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
queryOrderVO = this.queryOrderVOCont(queryrderDTO.getCondition(), 2);
break;
}
return queryOrderVO;
return queryOrderVO;
}
@Override
@ -1186,7 +1185,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
break;
}
return arrayList;
return arrayList;
}
@Override
@ -1939,7 +1938,6 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
DistributionStockArticleEntity stockArticleEntity = this.findStockArticleByOrderCodeAndWarehouseId(s, warehouseId);
DistributionStockArticleEntity t = new DistributionStockArticleEntity();
if (Func.isEmpty(stockArticleEntity)) {
t.setId(stockArticleEntity.getId());
log.error(method + "订单不存在orderCode:{}", s);
throw new RuntimeException("订单不存在");
}
@ -2028,7 +2026,8 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
// 这里在和原始对象进行比较
check2ObjSome(t, stockArticleEntity);
t = check2ObjSome(t, stockArticleEntity);
log.info("维护订单信息,t:{}",t);
if (!cn.hutool.core.util.ObjectUtil.isAllEmpty(t.getGenre(), t.getReservationStatus(),
t.getHandQuantity(), t.getDeliveryQuantity(), t.getOrderStatus(), t.getSigninQuantity())) {
baseMapper.updateDistributionStockArticleEntityById(t);
@ -2110,7 +2109,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
}
private void check2ObjSome(DistributionStockArticleEntity t, DistributionStockArticleEntity stockArticleEntity) {
private DistributionStockArticleEntity check2ObjSome(DistributionStockArticleEntity t, DistributionStockArticleEntity stockArticleEntity) {
t.setId(stockArticleEntity.getId());
if (t.getOrderStatus() != null && t.getOrderStatus().equals(stockArticleEntity.getOrderStatus())) {
@ -2132,7 +2131,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
t.setSigninQuantity(null);
}
return t;
}
@Override
@ -2281,7 +2280,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
}
if (deliveryQuantity == 0){
if (deliveryQuantity == 0) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
}
if (signingQuantity == 0) {
@ -2587,35 +2586,35 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
String orderCode = orderCodeDTO.getOrderCode();
Long fromWarehouseId = orderCodeDTO.getFromWarehouseId();
DistributionStockArticleEntity stockArticleEntity = findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(!Objects.isNull(stockArticleEntity)){
if (!Objects.isNull(stockArticleEntity)) {
Long orderId = stockArticleEntity.getId();
String waybillNo = stockArticleEntity.getWaybillNumber();
WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
Map<String, Object> map = new HashMap<>();
map.put("id", orderId);
map.put("orderCode",orderCode);
map.put("orderCode", orderCode);
String filename = QRCodeUtil.createCodeToFile(orderCode);
map.put("orderCodeImage", QRCodeUtil.getEmpAutograph(filename));
if(!Objects.isNull(warehouseWaybill)){
if (!Objects.isNull(warehouseWaybill)) {
String consignee = warehouseWaybill.getConsignee();
String consigneeName = warehouseWaybill.getConsigneeName();
String consigneeMobile = warehouseWaybill.getConsigneeMobile();
String remark = warehouseWaybill.getRemark();
map.put("consigneeUnit", StringUtil.isBlank(consignee)?"":consignee);
map.put("consigneePerson",StringUtil.isBlank(consigneeName)?"":consigneeName);
map.put("consigneeMobile",StringUtil.isBlank(consigneeMobile)?"":consigneeMobile);
map.put("consigneeUnit", StringUtil.isBlank(consignee) ? "" : consignee);
map.put("consigneePerson", StringUtil.isBlank(consigneeName) ? "" : consigneeName);
map.put("consigneeMobile", StringUtil.isBlank(consigneeMobile) ? "" : consigneeMobile);
map.put("product", warehouseWaybill.getGoodsName() + "(" + warehouseWaybill.getTotalCount() + ")");
map.put("remark",StringUtil.isBlank(remark)?"":remark);
map.put("remark", StringUtil.isBlank(remark) ? "" : remark);
}
String customerName = stockArticleEntity.getCustomerName();
String customerTelephone = stockArticleEntity.getCustomerTelephone();
String customerAddress = stockArticleEntity.getCustomerAddress();
map.put("customerName",StringUtil.isBlank(customerName)?"":customerName);
map.put("customerTelephone",StringUtil.isBlank(customerTelephone)?"":customerTelephone);
map.put("customerAddress",StringUtil.isBlank(customerAddress)?"":customerAddress);
map.put("customerName", StringUtil.isBlank(customerName) ? "" : customerName);
map.put("customerTelephone", StringUtil.isBlank(customerTelephone) ? "" : customerTelephone);
map.put("customerAddress", StringUtil.isBlank(customerAddress) ? "" : customerAddress);
// 订单号 生成二维码
String fileTypeName = QRCodeUtil.createCodeToFile(orderCode);
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
@ -2642,7 +2641,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
@Override
public void addHandQuantityAndIncomingNum(Long stockId, Integer enterNum) {
baseMapper.addHandQuantityAndIncomingNum(stockId,enterNum);
baseMapper.addHandQuantityAndIncomingNum(stockId, enterNum);
}
/**
@ -2688,14 +2687,14 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
BasicdataWarehouseEntity currentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<Long> collect = null;
if(ObjectUtils.isNotNull(currentWarehouse)){
if (ObjectUtils.isNotNull(currentWarehouse)) {
collect = new ArrayList<>();
collect.add(currentWarehouse.getId());
}else{
} else {
collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}
log.info(">>>>>>>>>>>>>当前仓库:{}",collect);
IPage<DistributionSignforStockArticleVO> distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity,collect);
log.info(">>>>>>>>>>>>>当前仓库:{}", collect);
IPage<DistributionSignforStockArticleVO> distributionStockArticleEntityIPage = baseMapper.pageSignforListOwe(page, stockArticleEntity, collect);
//处理创建人
distributionStockArticleEntityIPage.getRecords().forEach(a -> {
if (Func.isNotEmpty(a.getCreateUser())) {
@ -2760,11 +2759,11 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
BasicdataWarehouseEntity currentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<Long> warehouseIdList = null;
if (ObjectUtils.isNotNull(currentWarehouse)){
if (ObjectUtils.isNotNull(currentWarehouse)) {
warehouseIdList = new ArrayList<>();
warehouseIdList.add(currentWarehouse.getId());
}else{
warehouseIdList=myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
} else {
warehouseIdList = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}
// if (collect.size() > 1) {
@ -2776,7 +2775,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
// stockArticleEntity.setWarehouseIdList(null);
// stockArticleEntity.setWarehouseId(currentWarehouse.getId());
// }
List<DistributionSignforStockArticleVO> list = baseMapper.listSignforListOwe(stockArticleEntity,warehouseIdList);
List<DistributionSignforStockArticleVO> list = baseMapper.listSignforListOwe(stockArticleEntity, warehouseIdList);
//处理创建人
List<DistributionSignForStockArticleExcel> signForStockArticleExcels = new ArrayList<>();
list.forEach(a -> {
@ -2794,10 +2793,6 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
/**
* @param orderIds
* @return
@ -2849,15 +2844,15 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public Integer findOrderTotalNumByOrderCodes(List<String> orderCodes,Long warehouseId) {
return baseMapper.findOrderTotalNumByOrderCodes(orderCodes,warehouseId);
public Integer findOrderTotalNumByOrderCodes(List<String> orderCodes, Long warehouseId) {
return baseMapper.findOrderTotalNumByOrderCodes(orderCodes, warehouseId);
}
@Override
public Integer findOrderTotalNumByOrderPackageCodes(List<String> orderPackageCodes, Long warehouseId) {
List<String> orderCodes = distributionParcelListService.findOrderCodesByOrderPackageCodes(orderPackageCodes,warehouseId);
List<String> orderCodes = distributionParcelListService.findOrderCodesByOrderPackageCodes(orderPackageCodes, warehouseId);
return baseMapper.findOrderTotalNumByOrderCodes(orderCodes,warehouseId);
return baseMapper.findOrderTotalNumByOrderCodes(orderCodes, warehouseId);
}
@Override

Loading…
Cancel
Save