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

Loading…
Cancel
Save