|
|
|
@ -59,6 +59,7 @@ import com.logpm.warehouse.feign.IWarehouseUpdownStockUpAreaClient;
|
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
|
import org.apache.logging.log4j.util.Strings; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
import org.springblade.common.constant.DistributionTypeConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; |
|
|
|
@ -910,13 +911,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
//统计客户装车数
|
|
|
|
|
Integer lad = distributionLoadscanMapper.selectCount(new QueryWrapper<DistributionLoadscanEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getReservationId, signforEntity.getReservationId()) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())) |
|
|
|
|
.eq(DistributionLoadscanEntity::getReservationId, signforEntity.getReservationId()) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())) |
|
|
|
|
.intValue(); |
|
|
|
|
|
|
|
|
|
Integer nad = distributionLoadscaninvnMapper.selectCount(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getReservationId, signforEntity.getReservationId()) |
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())) |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getReservationId, signforEntity.getReservationId()) |
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())) |
|
|
|
|
.intValue(); |
|
|
|
|
signforEntity.setLoadedNumber(lad); |
|
|
|
|
signforEntity.setLoadedinNumber(nad); |
|
|
|
@ -950,7 +951,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
log.error("signforack############未进行签收上传图片"); |
|
|
|
|
return R.fail("无签收数据"); |
|
|
|
|
} |
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
log.info("=============签收图片数据为:{}", distributionSignfor.getMap()); |
|
|
|
|
if (ObjectUtils.isNotNull(distributionSignfor.getMap())) { |
|
|
|
|
List<DistributionSignPrintEntity> distributionSignPrintList = new ArrayList<>(); |
|
|
|
@ -1592,13 +1593,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
* @param signingId |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void push0ldSystemSignInfo(Long signingId) { |
|
|
|
|
public Map<String, Object> push0ldSystemSignInfo(Long signingId) { |
|
|
|
|
try { |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列"); |
|
|
|
|
//得到审核的任务ID
|
|
|
|
|
if (ObjectUtil.isEmpty(signingId)) { |
|
|
|
|
log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空"); |
|
|
|
|
return; |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//得到签收对象
|
|
|
|
@ -1608,20 +1609,20 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(distributionSignforEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionSignforEntity {}", distributionSignforEntity); |
|
|
|
|
return; |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
// 得到配送计划
|
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignforEntity.getDeliveryId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity); |
|
|
|
|
return; |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 得到配送客户
|
|
|
|
|
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionSignforEntity.getReservationId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionReservationEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionReservationEntity {}", distributionReservationEntity); |
|
|
|
|
return; |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1727,12 +1728,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); |
|
|
|
|
Map<String, Object> map = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); |
|
|
|
|
return map; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error(">>>>> 推送老系统签收信息报错", e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2466,7 +2468,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
signforExcel.setDeliveryStatusName(d.getSijiSigningStatus()); |
|
|
|
|
signforExcel.setExamineUserName(d.getExamineUserName()); |
|
|
|
|
signforExcel.setWarehouseName(d.getWarehouseName()); |
|
|
|
|
int unsigneds =d.getReservationNum() - d.getReceivedQuantity(); |
|
|
|
|
int unsigneds = d.getReservationNum() - d.getReceivedQuantity(); |
|
|
|
|
signforExcel.setUnsigneds(unsigneds); |
|
|
|
|
|
|
|
|
|
a.add(signforExcel); |
|
|
|
@ -2514,7 +2516,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return R.fail(403, "仓库信息不能为空"); |
|
|
|
|
} |
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//查询是否完成复核
|
|
|
|
|
//查询是否完成复核
|
|
|
|
|
DistributionSignforEntity signforEntity = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) |
|
|
|
|
); |
|
|
|
@ -2809,7 +2811,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error(">>>>> 签收异常报错", e); |
|
|
|
|
throw new CustomerException("签收异常报错"+e.getMessage()); |
|
|
|
|
throw new CustomerException("签收异常报错" + e.getMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2981,7 +2983,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscanService.updateById(distributionLoadscanEntity); |
|
|
|
|
packageLockIds.add(distributionLoadscanEntity.getPackageId()); |
|
|
|
|
//缺少一个异步维护包件签收的方法
|
|
|
|
|
// distributionAsyncService.changeOrderSignforStatus(collect.get(0));
|
|
|
|
|
// distributionAsyncService.changeOrderSignforStatus(collect.get(0));
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
//更新签收人
|
|
|
|
|
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser()); |
|
|
|
@ -3013,7 +3015,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return Resp.scanFail("服务器正忙...", "服务器正忙"); |
|
|
|
|
} |
|
|
|
|
//查询配送计划的计划司机
|
|
|
|
|
distributionLoadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
distributionLoadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
@ -3071,7 +3073,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
//更新签收人
|
|
|
|
|
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser()); |
|
|
|
|
// 包件解托下架
|
|
|
|
|
// 包件解托下架
|
|
|
|
|
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode(); |
|
|
|
|
try { |
|
|
|
|
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd()); |
|
|
|
@ -3088,7 +3090,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//维护签收包件状态
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
//推送信息至工厂
|
|
|
|
|
// distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
|
|
|
|
|
// distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
|
|
|
|
|
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, distributionLoadscanEntity.getSigningTime(), myCurrentWarehouse); |
|
|
|
|
|
|
|
|
|
//收集包件
|
|
|
|
@ -3097,14 +3099,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
// 推送商家端
|
|
|
|
|
|
|
|
|
|
// 推送
|
|
|
|
|
// try {
|
|
|
|
|
// sendMessage(orderPackageCode, distributionReservationEntity.getReservationCode(),
|
|
|
|
|
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
|
|
|
|
|
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
//// throw new RuntimeException(e);
|
|
|
|
|
// log.error(">>>> 签收推送报错", e);
|
|
|
|
|
// }
|
|
|
|
|
// try {
|
|
|
|
|
// sendMessage(orderPackageCode, distributionReservationEntity.getReservationCode(),
|
|
|
|
|
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
|
|
|
|
|
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
//// throw new RuntimeException(e);
|
|
|
|
|
// log.error(">>>> 签收推送报错", e);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
//一个客户下出现重复包条码
|
|
|
|
@ -3220,7 +3222,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return Resp.scanFail(12000, "请先进行签收扫描后上传图片", "请先进行签收扫描后上传图片", null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
log.info("=============签收图片数据为:{}", distributionSignfor.getMap()); |
|
|
|
|
if (ObjectUtils.isNotNull(distributionSignfor.getMap())) { |
|
|
|
|
List<DistributionSignPrintEntity> distributionSignPrintList = new ArrayList<>(); |
|
|
|
@ -3271,7 +3273,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (Func.isEmpty(distributionDeliveryListEntity)) { |
|
|
|
|
return R.fail(403, "配送错误!!!"); |
|
|
|
|
} |
|
|
|
|
if (distributionDeliveryListEntity.getKind().equals("2")){ |
|
|
|
|
if (distributionDeliveryListEntity.getKind().equals("2")) { |
|
|
|
|
return Resp.scanFail("请调整配送计划", "请调整配送计划"); |
|
|
|
|
} |
|
|
|
|
List<Long> packageLockIds = new ArrayList<>(); |
|
|
|
@ -3390,7 +3392,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscanEntity.setIsAbnormalLoading(2); |
|
|
|
|
distributionLoadscanEntity.setIsAbnormalSigning(2); |
|
|
|
|
distributionLoadscanEntity.setAbnormalNote("异常签收"); |
|
|
|
|
loadscanEntity =distributionLoadscanEntity; |
|
|
|
|
loadscanEntity = distributionLoadscanEntity; |
|
|
|
|
log.info("异常签收>>>>>>>>>>>>>>>reservationId:{},deliveryId:{},orderPackageCode:{}", distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getOrderPackageCode()); |
|
|
|
|
//进行签收数量的修改
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
@ -3422,7 +3424,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd()); |
|
|
|
|
aaa.add(trunklinePackageTrackLog); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
} else { |
|
|
|
|
return Resp.scanFail("操作失败", "不属于该客户"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4937,10 +4939,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
String method = "######################DistributionSignforServiceImpl.oneclickPDA"; |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
//进行防重复提交
|
|
|
|
|
|
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
return R.fail(403, "仓库信息不能为空"); |
|
|
|
|
// throw new CustomerException(403, "仓库信息不能为/**/空");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int loadingPackageNum = 0; |
|
|
|
|
int loadingInventoryNum = 0; |
|
|
|
|
int signingPackageNum = 0; |
|
|
|
@ -4965,6 +4970,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
log.error(method + "reservationEntity参数错误:{}", reservationEntity); |
|
|
|
|
return R.fail("服务器正忙~~"); |
|
|
|
|
} |
|
|
|
|
Long batchLock = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "reservationId:" ); |
|
|
|
|
if (!Objects.isNull(batchLock)){ |
|
|
|
|
return R.fail("请不要重复操作"); |
|
|
|
|
} |
|
|
|
|
List<Long> packageLockIds = new ArrayList<>(); |
|
|
|
|
//查询数据
|
|
|
|
|
DistributionSignforEntity distributionSignforEntity = baseMapper.selectOne(new QueryWrapper<DistributionSignforEntity>().lambda() |
|
|
|
@ -5272,8 +5281,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
loadingPackageNum += parcelListEntityList.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); |
|
|
|
|
signingPackageNum += parcelListEntityList.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); |
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { |
|
|
|
|
if (OrderPackageStatusConstant.yiqianshou.getValue().equals(parcelListEntity.getOrderPackageStatus())){ |
|
|
|
|
log.info("司机一键签收 >>>>>包件已签收:{}",parcelListEntity.getOrderPackageCode()); |
|
|
|
|
if (OrderPackageStatusConstant.yiqianshou.getValue().equals(parcelListEntity.getOrderPackageStatus())) { |
|
|
|
|
log.info("司机一键签收 >>>>>包件已签收:{}", parcelListEntity.getOrderPackageCode()); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
//查询是否进行装车
|
|
|
|
@ -5448,6 +5457,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionSignforEntity.setDriverRemarks(distributionSignfor.getDriverRemarks()); |
|
|
|
|
} |
|
|
|
|
this.updateById(distributionSignforEntity); |
|
|
|
|
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "reservationId:", distributionSignfor.getReservationId(),60L); |
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -6097,8 +6107,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue()); |
|
|
|
|
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscanEntity.setSigningUser(user.getNickName()); |
|
|
|
|
loadingNumber += distributionLoadscanEntity.getLoadedNub()+signforEntity.getLoadedNumber(); |
|
|
|
|
signingNumber += distributionLoadscanEntity.getReceivedQuantity()+signforEntity.getReceivedQuantity(); |
|
|
|
|
loadingNumber += distributionLoadscanEntity.getLoadedNub() + signforEntity.getLoadedNumber(); |
|
|
|
|
signingNumber += distributionLoadscanEntity.getReceivedQuantity() + signforEntity.getReceivedQuantity(); |
|
|
|
|
//进行签收数量的统计
|
|
|
|
|
distributionLoadscanService.updateById(distributionLoadscanEntity); |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
@ -6445,13 +6455,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Boolean clerkCheckPushData(Long id) { |
|
|
|
|
public Map<String, Object> clerkCheckPushData(Long id) { |
|
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
try { |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列"); |
|
|
|
|
//得到审核的任务ID
|
|
|
|
|
if (ObjectUtil.isEmpty(id)) { |
|
|
|
|
log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空"); |
|
|
|
|
return false; |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//得到签收对象
|
|
|
|
@ -6461,20 +6473,29 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(distributionSignforEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionSignforEntity {}", distributionSignforEntity); |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "没有签收对象 distributionSignforEntity"); |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
// 得到配送计划
|
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignforEntity.getDeliveryId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity); |
|
|
|
|
return false; |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "没有配送计划 distributionDeliveryListEntity"); |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 得到配送客户
|
|
|
|
|
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionSignforEntity.getReservationId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionReservationEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionReservationEntity {}", distributionReservationEntity); |
|
|
|
|
return false; |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "没有配送客户 distributionReservationEntity"); |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -6536,30 +6557,31 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
List<SignPushDataUnitDTO> pushOldPackageLoading = distributionSignforMapper.selectPushOldPackageLoading(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); |
|
|
|
|
List<SignPushDataUnitDTO> pushOldPackageSigning = distributionSignforMapper.selectPushOldPackageSigning(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); |
|
|
|
|
if (Func.isNotEmpty(pushOldPackageLoading)) { |
|
|
|
|
pushOldPackageLoading = handleSignPushDataUnitDTOList(pushOldPackageLoading); |
|
|
|
|
buildNameAndPhone(pushOldPackageLoading); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldPackageLoading); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(pushOldPackageSigning)) { |
|
|
|
|
pushOldPackageSigning = handleSignPushDataUnitDTOList(pushOldPackageSigning); |
|
|
|
|
buildNameAndPhone(pushOldPackageSigning); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldPackageSigning); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (distributionReservationEntity.getReservationStockListNum() > 0) {
|
|
|
|
|
//
|
|
|
|
|
// //查询库存品扫描签收
|
|
|
|
|
// List<SignPushDataUnitDTO> loadingPushOldInventory = distributionSignforMapper.selectLoadingPushOldInventory(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
|
|
|
|
|
// List<SignPushDataUnitDTO> signingPushOldInventory = distributionSignforMapper.selectSigningPushOldInventory(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId());
|
|
|
|
|
// if (Func.isNotEmpty(loadingPushOldInventory)) {
|
|
|
|
|
// buildNameAndPhone(loadingPushOldInventory);
|
|
|
|
|
// signPushDataUnitDTOS.addAll(loadingPushOldInventory);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (Func.isNotEmpty(signingPushOldInventory)) {
|
|
|
|
|
// buildNameAndPhone(signingPushOldInventory);
|
|
|
|
|
// signPushDataUnitDTOS.addAll(signingPushOldInventory);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (distributionReservationEntity.getReservationStockListNum() > 0) { |
|
|
|
|
//查询是否存在转的库存品
|
|
|
|
|
List<SignPushDataUnitDTO> pushOldInventoryPackageLoading = distributionSignforMapper.selectPushOldInventoryPackageLoading(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); |
|
|
|
|
List<SignPushDataUnitDTO> pushOldInventoryPackageSigning = distributionSignforMapper.selectPushOldInventoryPackageSigning(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); |
|
|
|
|
if (Func.isNotEmpty(pushOldInventoryPackageLoading)) { |
|
|
|
|
buildNameAndPhone(pushOldInventoryPackageLoading); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldInventoryPackageLoading); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(pushOldInventoryPackageSigning)) { |
|
|
|
|
buildNameAndPhone(pushOldInventoryPackageSigning); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldInventoryPackageSigning); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//查询签收图片
|
|
|
|
|
List<DistributionSignPrintVO> distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId()); |
|
|
|
|
|
|
|
|
@ -6582,14 +6604,38 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info(">>>> clerkCheckPushData SignPushDataDTO :{}", delivery); |
|
|
|
|
Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); |
|
|
|
|
return b; |
|
|
|
|
resultMap = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); |
|
|
|
|
return resultMap; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "数据准备错误"+e.getMessage()); |
|
|
|
|
log.error(">>>>> 推送老系统签收信息报错", e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private List<SignPushDataUnitDTO> handleSignPushDataUnitDTOList(List<SignPushDataUnitDTO> pushOldPackageLoading) { |
|
|
|
|
pushOldPackageLoading.stream().forEach(k->{ |
|
|
|
|
if (k.getGoods_type() == 3){ |
|
|
|
|
String unitNo = k.getUnitNo(); |
|
|
|
|
int indexOfUnitNo = unitNo.lastIndexOf("-"); |
|
|
|
|
if (indexOfUnitNo>0){ |
|
|
|
|
unitNo.substring(indexOfUnitNo); |
|
|
|
|
k.setUnitNo(unitNo); |
|
|
|
|
} |
|
|
|
|
String orderSelfNum = k.getOrderSelfNum(); |
|
|
|
|
int indexOfOrderSelfNum = orderSelfNum.lastIndexOf("-"); |
|
|
|
|
if (indexOfUnitNo>0){ |
|
|
|
|
orderSelfNum.substring(indexOfUnitNo); |
|
|
|
|
k.setOrderSelfNum(orderSelfNum); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return pushOldPackageLoading; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -6747,7 +6793,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
List<DistributionAddvaluePackageDTO> list = new ArrayList<>(); |
|
|
|
|
if (!addvaluePackageVOS.isEmpty()) { |
|
|
|
|
addvaluePackageVOS.forEach(a->{ |
|
|
|
|
addvaluePackageVOS.forEach(a -> { |
|
|
|
|
DistributionAddvaluePackageDTO dto = Func.copy(a, DistributionAddvaluePackageDTO.class); |
|
|
|
|
list.add(dto); |
|
|
|
|
}); |
|
|
|
@ -6756,6 +6802,158 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> clerkInventoryCheckPushData(String orderPackageCode) { |
|
|
|
|
Map<String,Object> resultMap = new HashMap<>(); |
|
|
|
|
try { |
|
|
|
|
//查询此包件
|
|
|
|
|
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, orderPackageCode) |
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (!loadscaninvnEntityList.isEmpty()) { |
|
|
|
|
//未进行装车
|
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", orderPackageCode+"没有装车扫描记录"); |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
if (loadscaninvnEntityList.size()>1) { |
|
|
|
|
//存在多个记录
|
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", orderPackageCode+"存在多个装车扫描记录"); |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
DistributionLoadscaninvnEntity loadscaninvnEntity = loadscaninvnEntityList.get(0); |
|
|
|
|
//查询signfor
|
|
|
|
|
DistributionSignforEntity signforEntity = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getReservationId, loadscaninvnEntity.getReservationId()) |
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(signforEntity)) { |
|
|
|
|
//存在多个记录
|
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", orderPackageCode+"查询signfor数据错误,id:"+loadscaninvnEntity.getReservationId()); |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
// 得到配送计划
|
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(loadscaninvnEntity.getDeliveryId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity); |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "没有配送计划 distributionDeliveryListEntity"); |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 得到配送客户
|
|
|
|
|
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(loadscaninvnEntity.getReservationId()); |
|
|
|
|
if (ObjectUtil.isEmpty(distributionReservationEntity)) { |
|
|
|
|
log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionReservationEntity {}", distributionReservationEntity); |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "没有配送客户 distributionReservationEntity"); |
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//组合配送信息
|
|
|
|
|
SignPushDataDTO delivery = distributionDeliveryListMapper.selectPushOldDelivery(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId()); |
|
|
|
|
|
|
|
|
|
WarehouseEntity warehouseEntity = warehouseClient.findByName(distributionReservationEntity.getWarehouseName()); |
|
|
|
|
if (ObjectUtils.isNotNull(warehouseEntity)) { |
|
|
|
|
// 需要增加老系统的仓库ID
|
|
|
|
|
delivery.setWarehouseId(Long.parseLong(warehouseEntity.getId() + "")); |
|
|
|
|
delivery.setWarehouseName(warehouseEntity.getTitle()); |
|
|
|
|
} |
|
|
|
|
//还需要配送的出库人、配送人、操作人信息
|
|
|
|
|
if (Func.isNotEmpty(delivery)) { |
|
|
|
|
if ("1".equals(delivery.getKind())) { |
|
|
|
|
//自主配送
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda() |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId()) |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getIsMaster, 2) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity)) { |
|
|
|
|
delivery.setOutId(Long.parseLong(distributionDeliverySelfEntity.getDriverId())); |
|
|
|
|
delivery.setOutName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
delivery.setOutPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//外协
|
|
|
|
|
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.<DistributionDeliveryTripartiteEntity>query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, delivery.getId())); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)) { |
|
|
|
|
delivery.setOutName(distributionDeliveryTripartiteEntity.getDriverName()); |
|
|
|
|
delivery.setOutPhone(distributionDeliveryTripartiteEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
R<User> userR = userClient.userInfoById(delivery.getAdministratorsId()); |
|
|
|
|
if (Func.isNotEmpty(userR)) { |
|
|
|
|
User user = userR.getData(); |
|
|
|
|
delivery.setAdministratorsName(user.getName()); |
|
|
|
|
delivery.setAdministratorsPhone(user.getPhone()); |
|
|
|
|
} |
|
|
|
|
DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(loadscaninvnEntity.getReservationId()); |
|
|
|
|
if (Func.isNotEmpty(distributionStockupEntity)) { |
|
|
|
|
if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())) { |
|
|
|
|
delivery.setOutToId(distributionStockupEntity.getStockupUserId()); |
|
|
|
|
delivery.setOutToName(distributionStockupEntity.getStockupUser()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询客户信息
|
|
|
|
|
List<SignPushDataContactDTO> customer = distributionReservationMapper.selectPushOldCustomer(loadscaninvnEntity.getReservationId()); |
|
|
|
|
if (Func.isNotEmpty(customer)) { |
|
|
|
|
//查询客户订单
|
|
|
|
|
List<SignPushDataUnitDTO> signPushDataUnitDTOS = new ArrayList<>(); |
|
|
|
|
if (distributionReservationEntity.getReservationStockListNum() > 0) { |
|
|
|
|
//查询包件扫描签收
|
|
|
|
|
//查询包件扫描签收
|
|
|
|
|
List<SignPushDataUnitDTO> pushOldInventoryPackageLoading = distributionSignforMapper.selectPushOldSingleInventoryPackageLoading(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(),orderPackageCode); |
|
|
|
|
List<SignPushDataUnitDTO> pushOldInventoryPackageSigning = distributionSignforMapper.selectPushOldSingleInventoryPackageSigning(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(),orderPackageCode); |
|
|
|
|
if (Func.isNotEmpty(pushOldInventoryPackageLoading)) { |
|
|
|
|
buildNameAndPhone(pushOldInventoryPackageLoading); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldInventoryPackageLoading); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(pushOldInventoryPackageSigning)) { |
|
|
|
|
buildNameAndPhone(pushOldInventoryPackageSigning); |
|
|
|
|
signPushDataUnitDTOS.addAll(pushOldInventoryPackageSigning); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询签收图片
|
|
|
|
|
List<DistributionSignPrintVO> distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId()); |
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(signPushDataUnitDTOS)) { |
|
|
|
|
SignPushDataContactDTO signPushDataContactDTO = customer.get(0); |
|
|
|
|
signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS); |
|
|
|
|
if (Func.isNotEmpty(distributionSignPrintVOS)) { |
|
|
|
|
String urls = distributionSignPrintVOS.stream().map(DistributionSignPrintVO::getUrlRoute).collect(Collectors.joining(",")); |
|
|
|
|
signPushDataContactDTO.setImage(urls); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(signforEntity.getClerkSignRemarks())) { |
|
|
|
|
signPushDataContactDTO.setContact(signforEntity.getClerkSignRemarks()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
buildReservationNameAndPhone(customer); |
|
|
|
|
//完成客户信息添加
|
|
|
|
|
delivery.setSignPushDataContactDTOs(customer); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
log.info(">>>> clerkCheckPushData SignPushDataDTO :{}", delivery); |
|
|
|
|
resultMap = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); |
|
|
|
|
return resultMap; |
|
|
|
|
}catch (Exception e) { |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "数据准备错误"+e.getMessage()); |
|
|
|
|
log.error(">>>>> 推送老系统签收信息报错", e); |
|
|
|
|
} |
|
|
|
|
resultMap.put("result", false); |
|
|
|
|
resultMap.put("msg", "未知错误"); |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void buildNameAndPhone(List<SignPushDataUnitDTO> pushOldPackageSigning) { |
|
|
|
|
for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) { |
|
|
|
|
User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getAdministratorsId()); |
|
|
|
@ -6853,11 +7051,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (k.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()) |
|
|
|
|
&& k.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { |
|
|
|
|
String content = "包件在" + warehouse.getName() + "由" + user.getNickName() + "完成复核,配送车次号:" + trainNumber + "预约任务号:" + reservationEntity.getReservationCode(); |
|
|
|
|
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CLERK_REVIEW.getCode(),trainNumber,new Date()); |
|
|
|
|
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CLERK_REVIEW.getCode(), trainNumber, new Date()); |
|
|
|
|
aaa.add(js); |
|
|
|
|
} else { |
|
|
|
|
String content = "包件在" + warehouse.getName() + "由" + user.getNickName() + "复核取消计划无操作包件,配送车次号:" + trainNumber + "预约任务号:" + reservationEntity.getReservationCode(); |
|
|
|
|
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode(),trainNumber,new Date()); |
|
|
|
|
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode(), trainNumber, new Date()); |
|
|
|
|
aaa.add(js); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -6927,8 +7125,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node, String trainNumber, Date warehouseEntryTimeEnd) { |
|
|
|
|
JSONObject trunklinePackageTrackLog = new JSONObject(); |
|
|
|
|
trunklinePackageTrackLog.put("tenantId", user.getTenantId()); |
|
|
|
@ -6951,6 +7147,4 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|