|
|
|
@ -281,6 +281,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionPositioningService distributionPositioningService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionPlanLogService distributionPlanLogService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) { |
|
|
|
|
|
|
|
|
@ -752,11 +755,25 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
// iDistributionNodeWorkService.signForCheck(DistributionSignforEntity distributionSignforEntity,DistributionReservationEntity reservationEntity);
|
|
|
|
|
|
|
|
|
|
// sendNodeWorkDataBroadcast();
|
|
|
|
|
|
|
|
|
|
//复核日志
|
|
|
|
|
handleSignforLog(distributionSignfor,AuthUtil.getUser(),myCurrentWarehouse,reservationEntity); |
|
|
|
|
|
|
|
|
|
return R.success("操作成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleSignforLog(DistributionSignforEntity distributionSignfor,BladeUser user,BasicdataWarehouseEntity warehouse,DistributionReservationEntity reservationEntity) { |
|
|
|
|
String content = user.getNickName() + "在" + warehouse.getName() + "复核签收,预约编号:" + reservationEntity.getReservationCode(); |
|
|
|
|
DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); |
|
|
|
|
distributionPlanLogEntity.setContent(content); |
|
|
|
|
distributionPlanLogEntity.setRefId(distributionSignfor.getReservationId()); |
|
|
|
|
distributionPlanLogEntity.setRefCode(reservationEntity.getReservationCode()); |
|
|
|
|
distributionPlanLogEntity.setWarehouseId(warehouse.getId()); |
|
|
|
|
distributionPlanLogEntity.setWarehouseName(warehouse.getName()); |
|
|
|
|
distributionPlanLogEntity.setOperator(user.getNickName()); |
|
|
|
|
distributionPlanLogEntity.setType(1); |
|
|
|
|
distributionPlanLogService.save(distributionPlanLogEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private NodeFanoutMsg<org.springblade.common.model.DistributionReCheckSignVO> buildNodeFanoutMsgByReCheck(DistributionReservationEntity reservationEntity) { |
|
|
|
|
|
|
|
|
|
// 查询当前预约单下的定制品和零担签收数据
|
|
|
|
@ -1159,50 +1176,57 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R searchNode(Integer searchType, String searchCode) { |
|
|
|
|
List<DeliveryNodeVo> nodeVos = null; |
|
|
|
|
switch (searchType) { |
|
|
|
|
case 1: |
|
|
|
|
//配送单查询
|
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.selectDeliveryByTrainNumber(searchCode); |
|
|
|
|
if (Func.isEmpty(deliveryListEntity)) { |
|
|
|
|
return R.fail("未查询到配送单信息,请查看搜索类型是否匹配"); |
|
|
|
|
} |
|
|
|
|
//解析配送节点
|
|
|
|
|
nodeVos = handleDeliveryNode(deliveryListEntity); |
|
|
|
|
//进行数据组装
|
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.selectByReservationCode(searchCode); |
|
|
|
|
if (Func.isEmpty(reservationEntity)) { |
|
|
|
|
return R.fail("未查询到预约单信息,请查看搜索类型是否匹配"); |
|
|
|
|
} |
|
|
|
|
//解析配送节点
|
|
|
|
|
nodeVos = handleReservationNode(reservationEntity); |
|
|
|
|
//预约单查询
|
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
//自提单号
|
|
|
|
|
DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = distrilbutionBillLadingService.selectByBillLadingCode(searchCode); |
|
|
|
|
if (Func.isEmpty(distrilbutionBillLadingEntity)) { |
|
|
|
|
return R.fail("未查询到自提单信息,请查看搜索类型是否匹配"); |
|
|
|
|
} |
|
|
|
|
//解析配送节点
|
|
|
|
|
nodeVos = handleBillLading(distrilbutionBillLadingEntity); |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
//备货任务查询
|
|
|
|
|
DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectStockUpByStockUpCode(searchCode); |
|
|
|
|
if (Func.isEmpty(distributionStockupEntity)) { |
|
|
|
|
return R.fail("未查询到备货任务信息,请查看搜索类型是否匹配"); |
|
|
|
|
} |
|
|
|
|
nodeVos = handleStockUp(distributionStockupEntity); |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
log.info("未知的搜索类型 searchType={}", searchType); |
|
|
|
|
// List<DeliveryNodeVo> nodeVos = null;
|
|
|
|
|
// switch (searchType) {
|
|
|
|
|
// case 1:
|
|
|
|
|
// //配送单查询
|
|
|
|
|
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.selectDeliveryByTrainNumber(searchCode);
|
|
|
|
|
// if (Func.isEmpty(deliveryListEntity)) {
|
|
|
|
|
// return R.fail("未查询到配送单信息,请查看搜索类型是否匹配");
|
|
|
|
|
// }
|
|
|
|
|
// //解析配送节点
|
|
|
|
|
// nodeVos = handleDeliveryNode(deliveryListEntity);
|
|
|
|
|
// //进行数据组装
|
|
|
|
|
// break;
|
|
|
|
|
// case 2:
|
|
|
|
|
// DistributionReservationEntity reservationEntity = distributionReservationService.selectByReservationCode(searchCode);
|
|
|
|
|
// if (Func.isEmpty(reservationEntity)) {
|
|
|
|
|
// return R.fail("未查询到预约单信息,请查看搜索类型是否匹配");
|
|
|
|
|
// }
|
|
|
|
|
// //解析配送节点
|
|
|
|
|
// nodeVos = handleReservationNode(reservationEntity);
|
|
|
|
|
// //预约单查询
|
|
|
|
|
// break;
|
|
|
|
|
// case 3:
|
|
|
|
|
// //自提单号
|
|
|
|
|
// DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = distrilbutionBillLadingService.selectByBillLadingCode(searchCode);
|
|
|
|
|
// if (Func.isEmpty(distrilbutionBillLadingEntity)) {
|
|
|
|
|
// return R.fail("未查询到自提单信息,请查看搜索类型是否匹配");
|
|
|
|
|
// }
|
|
|
|
|
// //解析配送节点
|
|
|
|
|
// nodeVos = handleBillLading(distrilbutionBillLadingEntity);
|
|
|
|
|
// break;
|
|
|
|
|
// case 4:
|
|
|
|
|
// //备货任务查询
|
|
|
|
|
// DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectStockUpByStockUpCode(searchCode);
|
|
|
|
|
// if (Func.isEmpty(distributionStockupEntity)) {
|
|
|
|
|
// return R.fail("未查询到备货任务信息,请查看搜索类型是否匹配");
|
|
|
|
|
// }
|
|
|
|
|
// nodeVos = handleStockUp(distributionStockupEntity);
|
|
|
|
|
// break;
|
|
|
|
|
// default:
|
|
|
|
|
// log.info("未知的搜索类型 searchType={}", searchType);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
List<DistributionPlanLogEntity> list = distributionPlanLogService.list(Wrappers.<DistributionPlanLogEntity>query().lambda() |
|
|
|
|
.eq(DistributionPlanLogEntity::getRefCode, searchCode) |
|
|
|
|
.orderByDesc(DistributionPlanLogEntity::getCreateTime) |
|
|
|
|
); |
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
|
|
|
|
|
return R.data(list); |
|
|
|
|
} |
|
|
|
|
return R.data(nodeVos); |
|
|
|
|
return R.fail("未查询到相关信息!!!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -3519,43 +3543,43 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R signforack(DistributionSignforDTO distributionSignfor) { |
|
|
|
|
DistributionSignforEntity signforEntity = distributionSignforMapper.getByReservationId(distributionSignfor.getReservationId()); |
|
|
|
|
if (Func.isEmpty(signforEntity)) { |
|
|
|
|
log.error("预约查询签收信息错误"); |
|
|
|
|
return R.fail("请联系管理员!!!"); |
|
|
|
|
} |
|
|
|
|
if ((signforEntity.getReceivedQuantity() + signforEntity.getReceivedinQuantity()) <= 0) { |
|
|
|
|
|
|
|
|
|
log.error("signforack############未进行签收上传图片"); |
|
|
|
|
return Resp.scanFail(12000, "请先进行签收扫描后上传图片", "请先进行签收扫描后上传图片", null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
log.info("=============签收图片数据为:{}", distributionSignfor.getMap()); |
|
|
|
|
if (ObjectUtils.isNotNull(distributionSignfor.getMap())) { |
|
|
|
|
List<DistributionSignPrintEntity> distributionSignPrintList = new ArrayList<>(); |
|
|
|
|
distributionSignfor.getMap().forEach((k, v) -> { |
|
|
|
|
v.forEach(i -> { |
|
|
|
|
DistributionSignPrintEntity distributionSignPrint = new DistributionSignPrintEntity(); |
|
|
|
|
BeanUtils.copyProperties(i, distributionSignPrint); |
|
|
|
|
distributionSignPrint.setId(null); |
|
|
|
|
distributionSignPrint.setReservationId(distributionSignfor.getReservationId()); |
|
|
|
|
distributionSignPrintList.add(distributionSignPrint); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
iDistributionSignPrintService.saveBatch(distributionSignPrintList); |
|
|
|
|
} |
|
|
|
|
//修改签收表司机签收数量
|
|
|
|
|
boolean update = this.update(new UpdateWrapper<DistributionSignforEntity>().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId()) |
|
|
|
|
.eq(DistributionSignforEntity::getDeliveryId, distributionSignfor.getDeliveryId()) |
|
|
|
|
.set(DistributionSignforEntity::getSjsigningTime, simpleDateFormat.format(new Date())) |
|
|
|
|
// .set(StringUtils.isNotBlank(distributionSignfor.getDeliverySignPictures()), DistributionSignforEntity::getDeliverySignPictures, distributionSignfor.getDeliverySignPictures())
|
|
|
|
|
.set(DistributionSignforEntity::getDriverSigning, "2") |
|
|
|
|
.set(StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks()) |
|
|
|
|
.set(StringUtils.isNotBlank(distributionSignfor.getSigneeName()), DistributionSignforEntity::getSigneeName, distributionSignfor.getSigneeName()) |
|
|
|
|
); |
|
|
|
|
return R.status(update); |
|
|
|
|
// DistributionSignforEntity signforEntity = distributionSignforMapper.getByReservationId(distributionSignfor.getReservationId());
|
|
|
|
|
// if (Func.isEmpty(signforEntity)) {
|
|
|
|
|
// log.error("预约查询签收信息错误");
|
|
|
|
|
// return R.fail("请联系管理员!!!");
|
|
|
|
|
// }
|
|
|
|
|
// if ((signforEntity.getReceivedQuantity() + signforEntity.getReceivedinQuantity()) <= 0) {
|
|
|
|
|
//
|
|
|
|
|
// log.error("signforack############未进行签收上传图片");
|
|
|
|
|
// return Resp.scanFail(12000, "请先进行签收扫描后上传图片", "请先进行签收扫描后上传图片", null);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
// log.info("=============签收图片数据为:{}", distributionSignfor.getMap());
|
|
|
|
|
// if (ObjectUtils.isNotNull(distributionSignfor.getMap())) {
|
|
|
|
|
// List<DistributionSignPrintEntity> distributionSignPrintList = new ArrayList<>();
|
|
|
|
|
// distributionSignfor.getMap().forEach((k, v) -> {
|
|
|
|
|
// v.forEach(i -> {
|
|
|
|
|
// DistributionSignPrintEntity distributionSignPrint = new DistributionSignPrintEntity();
|
|
|
|
|
// BeanUtils.copyProperties(i, distributionSignPrint);
|
|
|
|
|
// distributionSignPrint.setId(null);
|
|
|
|
|
// distributionSignPrint.setReservationId(distributionSignfor.getReservationId());
|
|
|
|
|
// distributionSignPrintList.add(distributionSignPrint);
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// iDistributionSignPrintService.saveBatch(distributionSignPrintList);
|
|
|
|
|
// }
|
|
|
|
|
// //修改签收表司机签收数量
|
|
|
|
|
// boolean update = this.update(new UpdateWrapper<DistributionSignforEntity>().lambda()
|
|
|
|
|
// .eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId())
|
|
|
|
|
// .eq(DistributionSignforEntity::getDeliveryId, distributionSignfor.getDeliveryId())
|
|
|
|
|
// .set(DistributionSignforEntity::getSjsigningTime, simpleDateFormat.format(new Date()))
|
|
|
|
|
//// .set(StringUtils.isNotBlank(distributionSignfor.getDeliverySignPictures()), DistributionSignforEntity::getDeliverySignPictures, distributionSignfor.getDeliverySignPictures())
|
|
|
|
|
// .set(DistributionSignforEntity::getDriverSigning, "2")
|
|
|
|
|
// .set(StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks())
|
|
|
|
|
// .set(StringUtils.isNotBlank(distributionSignfor.getSigneeName()), DistributionSignforEntity::getSigneeName, distributionSignfor.getSigneeName())
|
|
|
|
|
// );
|
|
|
|
|
return this.updatePicturePDA(distributionSignfor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|