Browse Source

Merge remote-tracking branch 'origin/fix_bug_20231221' into fix_bug_20231221

single_db
pref_mail@163.com 1 year ago
parent
commit
a32c9764fc
  1. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  2. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  3. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  4. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  5. 35
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  6. 18
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OldWaybillClient.java

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -140,4 +140,12 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
* @param packageIds
*/
Integer updateLoadingAndSigningByIds(@Param("packageIds")List<Long> packageIds);
/**
* 根据二维码查询包件信息
* @param orderPackageCode
* @param warehouseId
* @return
*/
DistributionParcelListEntity selectByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode,@Param("warehouseId") Long warehouseId);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -868,6 +868,10 @@
where order_package_code = #{orderPackageCode}
and order_package_status in ('20','30')
</select>
<select id="selectByOrderPackageCode"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT * FROM logpm_distribution_parcel_list WHERE order_package_code = #{orderPackageCode} and warehouse_id = #{warehouseId}
</select>
<update id="updateOrderPackageCodeById">
update logpm_distribution_parcel_list

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java

@ -161,4 +161,12 @@ public interface IDistributionParcelListService extends BaseService<Distribution
DistributionParcelListEntity findByOrderPackageCodeAndStatus(String orderPackageCode);
void updateOrderPackageCodeById(Long packageId, String orderPackageStatus);
/**
* 根据二维码查询包件
* @param barcode
* @param id
* @return
*/
DistributionParcelListEntity selectByOrderPackageCode(String orderPackageCode, Long warehouseId);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -619,6 +619,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
baseMapper.updateOrderPackageCodeById(packageId,orderPackageStatus);
}
@Override
public DistributionParcelListEntity selectByOrderPackageCode(String orderPackageCode, Long warehouseId) {
return baseMapper.selectByOrderPackageCode(orderPackageCode,warehouseId);
}
/**
* @param distributionParcelList 包件信息
* @return

35
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -654,11 +654,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// ---------------------------------2023-09-09 包件签收调整---------------------------------------------------------------
//思路: 在于一个客户下不会出现重复的包条码
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(),myCurrentWarehouse.getId());
if (Func.isEmpty(parcelListEntity)){
return Resp.scanFail("包件信息不存在","包件信息不存在");
}
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distrilbutionloadingscanDTO.getReservationId());
if (Func.isEmpty(distributionReservationEntity)){
log.error("########无效的预约单,reservationId:{}",distrilbutionloadingscanDTO.getReservationId());
@ -794,6 +799,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionParcelListEntity> parcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
//该货物是否属于该计划
List<DistributionParcelListEntity> distributionParcelListEntities = parcelListEntities.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
if (Func.isNotEmpty(distributionParcelListEntities) && distributionParcelListEntities.size() == 1) {
//这里按道理也具备签收条件,需要标注该装车记录不正常
log.error("#####################distributionParcelListEntities窜货", distributionParcelListEntities);
@ -802,7 +808,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//判断该货物是否属于该客户
// 异常签收
// return Resp.scanFail("异常签收包件","异常签收包件");
return R.fail(3006, "异常签收");
//判断客户
boolean flag = judgmentClient(distributionReservationEntity,parcelListEntity.getStockArticleId());
if (flag){
return R.fail(3006, "异常签收");
}else {
return Resp.scanFail("异常签收包件","不满足签收条件");
}
}
} else {
//一个客户下出现重复包条码
@ -814,6 +826,27 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanSuccess("签收成功", str);
}
private boolean judgmentClient(DistributionReservationEntity distributionReservationEntity, Long stockArticleId) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(stockArticleId);
switch (distributionReservationEntity.getDeliveryType()){
case "1":
//商配
if (stockArticleEntity.getConsigneeUnit().equals(distributionReservationEntity.getReceivingUnit()) && stockArticleEntity.getConsigneePerson().equals(distributionReservationEntity.getConsignee()) && stockArticleEntity.getMallName().equals(distributionReservationEntity.getMallName())){
return true;
}else {
return false;
}
case "2":
if (stockArticleEntity.getCustomerName().equals(distributionReservationEntity.getConsignee()) && stockArticleEntity.getCustomerAddress().equals(distributionReservationEntity.getDeliveryAddress()) && stockArticleEntity.getCustomerTelephone().equals(distributionReservationEntity.getDeliveryPhone())){
return true;
}else {
return false;
}
//市配
}
return false;
}
// List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// .eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())

18
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OldWaybillClient.java

@ -13,7 +13,6 @@ import jodd.util.StringUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.OldSystemDataPushConfig;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +22,7 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@ApiIgnore()
@RestController
@ -48,10 +48,10 @@ public class OldWaybillClient implements IOldWaybillClient {
WayBillEntity byWaybillId = wayBillService.getByWaybillId(Integer.parseInt(waybillId));
if(byWaybillId==null){
return null;
while (Objects.isNull(byWaybillId)){
byWaybillId = wayBillService.getByWaybillId(Integer.parseInt(waybillId));
}
log.info(">>>>>>>>>>>>>>>>> 运单信息 {}", byWaybillId);
log.info(">>>>>>>>>>>>>>>>> 旧仓库ID 集合 {}", OldSystemDataPushConfig.getWarehourseIdList());
@ -59,17 +59,18 @@ public class OldWaybillClient implements IOldWaybillClient {
// 需要验证当前需要开启的数据推送仓库 null+""
if (!OldSystemDataPushConfig.getWarehourseIdList().contains(byWaybillId.getWarehouseId() + "")) {
log.info(">>> waybillDataHandler 当前开单仓库不是目前系统上线运行仓库 {}", byWaybillId.getWarehouseId());
return null;
return R.fail(405,"当前仓不处理");
}
String authCode = oldLogin(byWaybillId.getArriveSiteId() + "");
String url = oldSystemProperties.getUrl() + "openApi/newSystem.WaybillQuery/index?waybillId=" + waybillId;
log.info("#############waybillDataHandler: 请求地址为 url={}",url);
String body = HttpRequest.get(url).header("token", authCode).execute().body();
log.info(">>>>> waybillDataHandler 老系统返回结果 {} ",body);
JSONObject jsonObject = JSONObject.parseObject(body);
if (200 == Integer.parseInt(jsonObject.get("code").toString())) {
Integer code = jsonObject.getInteger("code");
if (200 == code) {
// 请求成功
JSONArray jsonArray = jsonObject.getJSONArray("data");
// 循环结果
@ -85,12 +86,9 @@ public class OldWaybillClient implements IOldWaybillClient {
String operationTime = DateUtil.format(new Date(), "yyyy-MM-dd hh:mm:ss");
oldSystemWaybillClient.handleDataToPlatform(unitNo, operationTime);
}
}
} else {
log.error("##################waybillDataHandler: 请求老系统接口 失败,url:{},waybillId:{}", url, waybillId);
// 请求失败
}
} catch (Exception e) {
log.error(">>>> 运单信息查询解析报错 ", e);

Loading…
Cancel
Save