Browse Source

闭环干仓配租户的作业逻辑

master
pref_mail@163.com 10 months ago
parent
commit
98c85c1020
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java
  2. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDriverArteryClient.java
  3. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java
  4. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java
  5. 2
      blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessAsyncService.java
  6. 4
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java
  7. 23
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java
  8. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  9. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  10. 49
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java

@ -28,7 +28,7 @@ public class RedisKeyConstant {
/**
* 异常件数
*/
public static final String BUSINESS_INEXCE_CARNUMBER ="business:in:carnumber:";
public static final String BUSINESS_INEXCE_CARNUMBER ="business:inexce:carnumber:";
}

3
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDriverArteryClient.java

@ -60,4 +60,7 @@ public interface IBasicdataDriverArteryClient {
@GetMapping(API_PREFIX+"/findDriverListByName")
List<JSONObject> findDriverListByName(@RequestParam String driverName);
@GetMapping(API_PREFIX+"/getDriverArteryById")
BasicdataDriverArteryEntity getDriverArteryById(Long id);
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java

@ -132,7 +132,7 @@ public interface IDistributionDeliveryListClient {
void pushNotification(@RequestParam("warehouseIds")String warehouseIds,@RequestParam("reservationCode")String reservationCode);
@GetMapping(TOP+"/mallClientSignfor")
void mallClientSignfor(@RequestParam("trainNumber")String trainNumber,@RequestParam("warehouseId")Long warehouseId,@RequestParam("orderPackageCode")String orderPackageCode);
void mallClientSignfor(@RequestParam("tenantId") String tenantId,@RequestParam("trainNumber")String trainNumber,@RequestParam("warehouseId")Long warehouseId,@RequestParam("orderPackageCode")String orderPackageCode,@RequestParam("nowTenantId")String nowTenantId);
// /**

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java

@ -82,4 +82,9 @@ public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient
return list;
}
@Override
public BasicdataDriverArteryEntity getDriverArteryById(Long id) {
return basicdataDriverArteryService.getById(id);
}
}

2
blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessAsyncService.java

@ -8,4 +8,6 @@ import java.util.List;
public interface IBusinessAsyncService {
public void saveOtherDataBaseNew(String tenantId, List<BusinessPreOrderEntity> dataResult, String mallName);
}

4
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.service.IBusinessAsyncService;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.distribution.feign.IDistributionDeliveryListClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.annotations.ChangeAsync;
@ -24,6 +25,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
private final IBusinessPreOrderService businessPreOrderService;
private final ISysClient sysClient;
private final IDistributionDeliveryListClient distributionDeliveryListClient;
@ChangeAsync()
@Override
@ -80,4 +82,6 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
}
}
}

23
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

@ -13,9 +13,11 @@ import com.logpm.business.dto.BusinessPreOrderDTO;
import com.logpm.business.dto.BusinessSanDTO;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.mapper.BusinessPreOrderMapper;
import com.logpm.business.service.IBusinessAsyncService;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.business.vo.*;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.feign.IDistributionDeliveryListClient;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
@ -32,6 +34,7 @@ import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
@ -51,9 +54,8 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
private final IInComingClient inComingClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
private final BladeRedis bladeRedis;
private final IDistributionParcelListClient distributionParcelListClient;
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
private final IDistributionDeliveryListClient distributionDeliveryListClient;
@ -78,7 +80,6 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
List<BusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
List<BusinessPreOrderEntity> data = new ArrayList<>();
List<String> carNumberList = new ArrayList<>();
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
if (distributionBusinessPreOrderEntity.getInWarehouse() == 1) {
@ -320,7 +321,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
}else{
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber()+":"+businessSanDTO.getTrayCode();
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER +businessSanDTO.getTrayCode();
Object o = bladeRedis.get(key);
if (Objects.isNull(o)) {
@ -342,6 +343,10 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
// 推送业务系统
distributionDeliveryListClient.mallClientSignfor(selectD.getFromTenantId(), businessSanDTO.getDistrCarNumber(), selectD.getAcceptWarehouseId(), orderPackageCode, AuthUtil.getTenantId());
return Resp.scanSuccess("扫描成功", a + "件");
}
@ -372,6 +377,10 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
t.setFromTenantId(distributionBusinessPreOrderEntity.getFromTenantId());
t.setOperationStatus(1);
t.setInWarehouse(0);
t.setAcceptWarehouseId(distributionBusinessPreOrderEntity.getAcceptWarehouseId());
t.setAcceptWarehouseName(distributionBusinessPreOrderEntity.getAcceptWarehouseName());
t.setSendWarehouseId(distributionBusinessPreOrderEntity.getSendWarehouseId());
t.setSendWarehouseName(distributionBusinessPreOrderEntity.getSendWarehouseName());
this.save(t);
}
R r = inOrderWarehourseByFeign(businessSanDTO);
@ -383,7 +392,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
if(StringUtil.isNotBlank(businessSanDTO.getTrayCode())){
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber()+":"+businessSanDTO.getTrayCode();
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER +businessSanDTO.getTrayCode();
Object o = bladeRedis.get(key);
if (Objects.isNull(o)) {
@ -404,7 +413,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}else{
//记录当前车次的异常件数
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber());
String key =RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode();
String key =RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER +businessSanDTO.getTrayCode();
if (Objects.isNull(o)) {
// 查询当前车次的异常入库数量
@ -427,7 +436,9 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
}
// 推送业务系统
distributionDeliveryListClient.mallClientSignfor(t.getFromTenantId(), businessSanDTO.getDistrCarNumber(), t.getAcceptWarehouseId(), orderPackageCode, AuthUtil.getTenantId());
return Resp.scanSuccess("扫描成功", "异常" + a + "件");
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java

@ -27,6 +27,7 @@ import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.vo.DistributionRetentionScanVo;
import lombok.AllArgsConstructor;
import org.apache.logging.log4j.util.Strings;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -129,8 +130,9 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList
/**
* @param
*/
@ChangeAsync
@Override
public void mallClientSignfor(String trainNumber,Long warehouseId,String orderPackageCode) {
public void mallClientSignfor(String tenantId,String trainNumber,Long warehouseId,String orderPackageCode,String nowTenantId) {
distributionDeliveryListService.mallClientSignfor(trainNumber,warehouseId,orderPackageCode);
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -464,6 +464,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
void mallClientSignfor(String trainNumber, Long warehouseId, String orderPackageCode);
/**
* 查询签收预约客户包件信息
* @param reservationId

49
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -249,6 +249,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Autowired
private IUserClient userClient;
@Autowired
private IBasicdataDriverArteryClient arteryClient;
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
// @Lazy
@ -7235,6 +7238,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
@Transactional
public void mallClientSignfor(String trainNumber, Long warehouseId, String orderPackageCode) {
//查询包件是否合法
DistributionParcelListEntity packageObj = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda()
@ -7265,7 +7269,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("仓库查询错误");
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(packageObj.getId());
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(packageObj.getStockArticleId());
if (Func.isEmpty(stockArticleEntity)) {
//订单查询错误
log.error("订单查询错误");
@ -7315,7 +7319,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getSignforState, LoadScanSigningStatusConstant.weiqianshou.getValue())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isEmpty(loadscanEntity)) {
if (!Func.isEmpty(loadscanEntity)) {
//存在装车数据
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
loadscanEntity.setSignforState(2);
@ -7389,7 +7393,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(packageObj.getOrderPackageCode(), warehouseId, "签收下架解托");
content = "包件在" + entityWarehouseId.getName() + "由" + loadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
}
}
} else {
@ -7521,7 +7525,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
packageObj.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(packageObj);
//下架解托
Map<String, Object> info = new HashMap<>();
warehouseUpdownTypeClient.downPackageAndDelTrayAndIsUpdate(packageObj.getOrderPackageCode(), entityWarehouseId.getId(), "扫描装车进行下架、解托", false);
//维护订单
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),warehouseId);
@ -7674,23 +7677,27 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private List<JSONObject> handleMallLogJSONObject(BasicdataWarehouseEntity warehouse, Long userId, String orderPackageCode, String content, Integer node) {
List<JSONObject> trunklinePackageTrackLog = new ArrayList<>();
JSONObject js = new JSONObject();
R<User> userR = userClient.userInfoById(userId);
User user = userR.getData();
js.put("tenantId", user.getTenantId());
js.put("createTime", new Date());
js.put("createUser", user.getId());
js.put("updateUser", user.getId());
js.put("updateTime", new Date());
js.put("isDeleted", 0);
js.put("status", 1);
js.put("createDept", warehouse.getDepartment());
js.put("orderPackageCode", orderPackageCode);
js.put("warehouseId", warehouse.getId());
js.put("warehouseName", warehouse.getName());
js.put("workNode", node);
js.put("content", content);
js.put("operator", user.getName());
trunklinePackageTrackLog.add(js);
//查询司机用户
BasicdataDriverArteryEntity driverArtery = arteryClient.getDriverArteryById(userId);
if (!Func.isEmpty(driverArtery)){
R<User> userR = userClient.userInfoById(driverArtery.getUserId());
User user = userR.getData();
js.put("tenantId", user.getTenantId());
js.put("createTime", new Date());
js.put("createUser", user.getId());
js.put("updateUser", user.getId());
js.put("updateTime", new Date());
js.put("isDeleted", 0);
js.put("status", 1);
js.put("createDept", warehouse.getDepartment());
js.put("orderPackageCode", orderPackageCode);
js.put("warehouseId", warehouse.getId());
js.put("warehouseName", warehouse.getName());
js.put("workNode", node);
js.put("content", content);
js.put("operator", user.getName());
trunklinePackageTrackLog.add(js);
}
return trunklinePackageTrackLog;
}
}

Loading…
Cancel
Save