Browse Source

1.数据同步打托逻辑修改

single_db
zhenghaoyu 1 year ago
parent
commit
891c78c4bd
  1. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayGoodsClient.java
  2. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java
  3. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java
  4. 70
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java
  5. 14
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayGoodsClient.java
  6. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java
  7. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java
  8. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayGoodsClient.java

@ -95,4 +95,10 @@ public interface IWarehouseTrayGoodsClient {
*/
@GetMapping(GETTRAYLIST+"/getTrayInfoByInventory")
String getTrayInfoByInventory(@RequestParam Long marketId,@RequestParam String cargoNumber);
@GetMapping(API_PREFIX+"/findTrayCodeByOrderPackageCode")
WarehouseTrayGoodsEntity findTrayCodeByOrderPackageCode(@RequestParam String unitNo);
@GetMapping(API_PREFIX+"/delTrayGoodsById")
void delTrayGoodsById(@RequestParam Long trayGoodsId, @RequestParam Long warehouseId);
}

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java

@ -20,6 +20,7 @@ package com.logpm.warehouse.feign;
import com.alibaba.fastjson.JSONObject;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -57,6 +58,9 @@ public interface IWarehouseTrayTypeClient {
@PostMapping(API_PREFIX+"/orderScanOrderPackageCode")
boolean orderScanOrderPackageCode(@RequestBody Map<String, Object> map);
@PostMapping(API_PREFIX+"/orderScanOrderPackageCode")
R orderScanOrderPackageCodeReturnR(@RequestBody Map<String, Object> map);
@PostMapping(API_PREFIX+"/enterZeroOrderByTrayCode")
boolean enterZeroOrderByTrayCode(@RequestBody Map<String, Object> map);

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java

@ -101,6 +101,8 @@ public interface IWarehouseUpdownGoodsClient {
* @return
*/
@GetMapping(LOCATIONSTOCKLISTINFORMATION+"/getAllocationNameByInventory")
String getAllocationNameByInventory(@RequestParam Long marketId,@RequestParam String cargoNumber);
@GetMapping(API_PREFIX+"/findEntityByOrderPackageCode")
WarehouseUpdownGoodsEntity findEntityByOrderPackageCode(@RequestParam String unitNo);
}

70
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java

@ -18,9 +18,9 @@ import com.logpm.oldproject.feign.IAdvanceClient;
import com.logpm.oldproject.feign.ITrayClient;
import com.logpm.oldproject.feign.ITrayScanClient;
import com.logpm.oldproject.feign.ITrayScanDesClient;
import com.logpm.warehouse.feign.IWarehouseTaryAllocationClient;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.feign.*;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
@ -77,6 +77,10 @@ public class OrderStatusHandler {
private ITrayScanDesClient trayScanDesClient;
@Autowired
private ITrayScanClient trayScanClient;
@Autowired
private IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
@Autowired
private IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
@RabbitHandler
@ -218,16 +222,70 @@ public class OrderStatusHandler {
m.put("warehouseId",warehouseId);
m.put("orderPackageCode",unitNo);
boolean b = warehouseTrayTypeClient.orderScanOrderPackageCode(m);
if(!b){
log.warn("####################orderStatusHandler: 打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
R response = warehouseTrayTypeClient.orderScanOrderPackageCodeReturnR(m);
int code = response.getCode();
if(code == 4001){
log.info("####################orderStatusHandler: 包件已在当前托盘打托 unitNo={} trayCode={}",unitNo,"T"+trayId);
}else if(code == 4002){
log.info("####################orderStatusHandler: 包件已在其他托盘打托 unitNo={} ",unitNo);
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsClient.findTrayCodeByOrderPackageCode(unitNo);
if(Objects.isNull(trayGoodsEntity)){
log.warn("####################orderStatusHandler: 包件未打托 unitNo={}",unitNo);
}else{
String oldTrayCode = trayGoodsEntity.getTrayCode();
Long trayGoodsId = trayGoodsEntity.getId();
Long wid = trayGoodsEntity.getWarehouseId();
BasicdataTrayEntity oldTrayEntity = basicdataTrayClient.getTrayByTrayCode(oldTrayCode);
Long oldTrayId = oldTrayEntity.getId();
//判断托盘是否有上架
Long oldAllocationId = taryAllocationClient.findAllocationByTrayId(oldTrayId);
if (Objects.isNull(oldAllocationId)){
//没有上架
//直接解绑托盘
warehouseTrayGoodsClient.delTrayGoodsById(trayGoodsId,wid);
}else{
//有上架
//下架
updownTypeClient.downPackage(unitNo,wid);
}
}
boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m);
if(!b1){
log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
}else{
log.info("####################orderStatusHandler: 二次打托成功 unitNo={} trayCode={}",unitNo,"T"+trayId);
}
}else if(code == 4003){
log.info("####################orderStatusHandler: 包件未打托已上架 unitNo={} ",unitNo);
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsClient.findEntityByOrderPackageCode(unitNo);
if(Objects.isNull(updownGoodsEntity)){
log.warn("####################orderStatusHandler: 包件未上架 unitNo={}",unitNo);
}else{
Long wid = updownGoodsEntity.getWarehouseId();
updownTypeClient.downPackage(unitNo,wid);
}
boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m);
if(!b1){
log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
}else{
log.info("####################orderStatusHandler: 二次打托成功 unitNo={} trayCode={}",unitNo,"T"+trayId);
}
}else if(code == 4004){
log.info("####################orderStatusHandler: 包件打托方式不正确 unitNo={} ",unitNo);
//先去空置托盘再打托
warehouseTrayTypeClient.trayToNull("T"+trayId);
boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m);
if(!b1){
log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
}
}else{
String msg1 = r.getMsg();
int code1 = r.getCode();
log.warn("######################orderStatusHandler: 打托失败 msg={} code={}",msg1,code1);
log.warn("######################orderStatusHandler: 打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
}
}else{
//有上架就上架
updownTypeClient.upShelfPackage(unitNo,allocationId,warehouseId);

14
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayGoodsClient.java

@ -89,4 +89,18 @@ public class WarehouseTrayGoodsClient implements IWarehouseTrayGoodsClient {
public String getTrayInfoByInventory(Long marketId, String cargoNumber) {
return warehouseTrayGoodsService.getTrayInfoByInventory(marketId,cargoNumber);
}
@Override
public WarehouseTrayGoodsEntity findTrayCodeByOrderPackageCode(String unitNo) {
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value",unitNo);
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper);
return trayGoodsEntity;
}
@Override
public void delTrayGoodsById(Long trayGoodsId,Long warehouseId) {
warehouseTrayGoodsService.deleteByTrayGoodsId(trayGoodsId,warehouseId);
}
}

11
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java

@ -51,6 +51,17 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
}
}
@Override
public R orderScanOrderPackageCodeReturnR(Map<String, Object> map) {
String trayType = (String) map.get("trayType");
String trayCode = (String) map.get("trayCode");
Long warehouseId = (Long) map.get("warehouseId");
String orderPackageCode = (String) map.get("orderPackageCode");
return warehouseTrayTypeService.orderScanOrderPackageCodeSync(trayType, trayCode, orderPackageCode, warehouseId);
}
@Override
public boolean enterZeroOrderByTrayCode(Map<String, Object> map) {
String trayType = (String) map.get("trayType");

9
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java

@ -1,6 +1,7 @@
package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
@ -101,4 +102,12 @@ public class WarehouseUpdownGoodsClient implements IWarehouseUpdownGoodsClient {
public String getAllocationNameByInventory(Long marketId, String cargoNumber) {
return warehouseUpdownGoodsService.getAllocationNameByInventory(marketId, cargoNumber);
}
@Override
public WarehouseUpdownGoodsEntity findEntityByOrderPackageCode(String unitNo) {
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value",unitNo);
return warehouseUpdownGoodsService.getOne(queryWrapper);
}
}

8
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -575,11 +575,11 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String oldTrayCode = trayGoodsEntity.getTrayCode();
if(oldTrayCode.equals(trayCode)){
log.warn("##############orderScanOrderPackageCode: 该包条已打托 trayCode={}",trayCode);
return Resp.scanFail(2001,"该包条已打托","已扫描");
return Resp.scanFail(4001,"该包条已打托","已扫描");
}
log.warn("#########orderScanOrderPackageCode: 包件已打托 orderPackageCode={}",orderPackageCode);
return Resp.scanFail(2001,"包件已打托","已在"+oldTrayCode+"托盘绑定");
return Resp.scanFail(4002,"包件已打托","已在"+oldTrayCode+"托盘绑定");
}
QueryWrapper<WarehouseUpdownGoodsEntity> updownGoodsEntityQueryWrapper = new QueryWrapper<>();
@ -589,7 +589,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(!Objects.isNull(updownGoodsEntity)){
String positionCode = updownGoodsEntity.getPositionCode();
log.warn("#########orderScanOrderPackageCode: 包件已上架 orderPackageCode={}",orderPackageCode);
return Resp.scanFail(2001,"包件已上架","包件已上架"+positionCode+",请先下架或进行移库绑定");
return Resp.scanFail(4003,"包件已上架","包件已上架"+positionCode+",请先下架或进行移库绑定");
}
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
@ -659,7 +659,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(!tt.equals(trayType)){
log.warn("##############orderScanOrderPackageCode: 打托方式不正确 {}={}",trayType,tt);
return Resp.scanFail(2001,"打托方式不正确","打托方式不正确");
return Resp.scanFail(4004,"打托方式不正确","打托方式不正确");
}
if(StringUtil.isBlank(filterValue)){

Loading…
Cancel
Save