Browse Source

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

training
caoyizhong 1 year ago
parent
commit
28bb97cff6
  1. 26
      blade-service/logpm-distribution/src/main/resources/application-prod.yml
  2. 58
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java
  3. 19
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java
  4. 19
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

26
blade-service/logpm-distribution/src/main/resources/application-prod.yml

@ -29,3 +29,29 @@ spring:
url: ${blade.datasource.distribution.slave.url} url: ${blade.datasource.distribution.slave.url}
username: ${blade.datasource.distribution.slave.username} username: ${blade.datasource.distribution.slave.username}
password: ${blade.datasource.distribution.slave.password} password: ${blade.datasource.distribution.slave.password}
#rabbitmq配置
rabbitmq:
host: 172.16.128.146
port: 5672
username: admin
password: Slwk@123654
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true

58
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java

@ -270,9 +270,9 @@ public class WarehouseGoodsAllocationController extends BladeController {
} }
R r = warehouseUpdownTypeService.upShelfPackage(upShelfPackageList, allocationId,myCurrentWarehouse.getId()); R r = warehouseUpdownTypeService.upShelfPackage(upShelfPackageList, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) { // if (r.getCode() == 200) {
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); // warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
} // }
return r; return r;
} }
@ -294,9 +294,9 @@ public class WarehouseGoodsAllocationController extends BladeController {
} }
//上架托盘 //上架托盘
R r = warehouseUpdownTypeService.upShelfTray(trayCode, allocationId,myCurrentWarehouse.getId()); R r = warehouseUpdownTypeService.upShelfTray(trayCode, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) { // if (r.getCode() == 200) {
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); // warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
} // }
return r; return r;
} }
@ -319,9 +319,9 @@ public class WarehouseGoodsAllocationController extends BladeController {
//查询该库位的货物信息 //查询该库位的货物信息
R r = warehouseUpdownTypeService.upShelfStockList(upShelfStockList, allocationId,myCurrentWarehouse.getId()); R r = warehouseUpdownTypeService.upShelfStockList(upShelfStockList, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) { // if (r.getCode() == 200) {
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); // warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
} // }
return r; return r;
} }
@ -345,9 +345,9 @@ public class WarehouseGoodsAllocationController extends BladeController {
//查询该库位的货物信息 //查询该库位的货物信息
R r = warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList, allocationId,myCurrentWarehouse.getId()); R r = warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList, allocationId,myCurrentWarehouse.getId());
if (r.getCode() == 200) { // if (r.getCode() == 200) {
warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); // warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
} // }
return r; return r;
} }
@ -375,12 +375,12 @@ public class WarehouseGoodsAllocationController extends BladeController {
@ApiOperationSupport(order = 18) @ApiOperationSupport(order = 18)
@ApiOperation(value = "货位 统计所有库位数量") @ApiOperation(value = "货位 统计所有库位数量")
public R locationsnub() { public R locationsnub() {
// if (null !=bladeRedis.get(Url+"/locationsnub)")){ if (null !=bladeRedis.get(Url+"/locationsnub)")){
// log.info("缓存取值>>>>>>>>>>"); log.info("缓存取值>>>>>>>>>>");
// return R.data(bladeRedis.get(Url+"/locationsnub")); return R.data(bladeRedis.get(Url+"/locationsnub"));
// } }
locationsnubVO locationsnubVO = warehouseGoodsAllocationService.selectlocationsnub(); locationsnubVO locationsnubVO = warehouseGoodsAllocationService.selectlocationsnub();
//bladeRedis.setEx(Url+"/locationsnub",locationsnubVO,360L); bladeRedis.setEx(Url+"/locationsnub",locationsnubVO,360L);
return R.data(locationsnubVO); return R.data(locationsnubVO);
} }
@ -458,10 +458,10 @@ public class WarehouseGoodsAllocationController extends BladeController {
} }
try { try {
R r = warehouseUpdownTypeService.downPackage(upShelfPackageList); R r = warehouseUpdownTypeService.downPackage(upShelfPackageList);
if (r.getCode() == 200) { // if (r.getCode() == 200) {
String prefix = Url+"/*"; // String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix)); // bladeRedis.del(bladeRedis.keys(prefix));
} // }
return r; return r;
} catch (CustomerException e) { } catch (CustomerException e) {
log.warn(e.message); log.warn(e.message);
@ -485,10 +485,10 @@ public class WarehouseGoodsAllocationController extends BladeController {
} }
try { try {
R r = warehouseUpdownTypeService.downZeroOrder(upShelfZeroOrderList); R r = warehouseUpdownTypeService.downZeroOrder(upShelfZeroOrderList);
if (r.getCode() == 200) { // if (r.getCode() == 200) {
String prefix = Url+"/*"; // String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix)); // bladeRedis.del(bladeRedis.keys(prefix));
} // }
return r; return r;
} catch (CustomerException e) { } catch (CustomerException e) {
log.warn(e.message); log.warn(e.message);
@ -513,10 +513,10 @@ public class WarehouseGoodsAllocationController extends BladeController {
} }
try { try {
R r = warehouseUpdownTypeService.downStock(upShelfStockList); R r = warehouseUpdownTypeService.downStock(upShelfStockList);
if (r.getCode() == 200) { // if (r.getCode() == 200) {
String prefix = Url+"/*"; // String prefix = Url+"/*";
bladeRedis.del(bladeRedis.keys(prefix)); // bladeRedis.del(bladeRedis.keys(prefix));
} // }
return r; return r;
} catch (CustomerException e) { } catch (CustomerException e) {
log.warn(e.message); log.warn(e.message);

19
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -316,6 +316,11 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
log.warn("#################upShelfScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId); log.warn("#################upShelfScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"货区信息不存在"); throw new CustomerException(403,"货区信息不存在");
} }
String areaType = basicdataGoodsAreaEntity.getAreaType();
if("1".equals(areaType)){
log.warn("#################upShelfScanAllocation: 备货区不能上下架 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"备货区不能上下架");
}
Long wid = basicdataGoodsAreaEntity.getWarehouseId(); Long wid = basicdataGoodsAreaEntity.getWarehouseId();
String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称 String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid); BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid);
@ -649,6 +654,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
continue; continue;
} }
} }
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
return Resp.scanSuccess("上架成功","成功上架"+num+"条"); return Resp.scanSuccess("上架成功","成功上架"+num+"条");
} }
@ -801,6 +808,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
throw new CustomerException(code,r.getMsg()); throw new CustomerException(code,r.getMsg());
} }
} }
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
return Resp.scanSuccess("上架成功","成功上架"+num+"条"); return Resp.scanSuccess("上架成功","成功上架"+num+"条");
} }
@ -931,6 +940,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
} }
} }
String msg = "上架成功"; String msg = "上架成功";
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
if (s.length()>0){msg = msg+s+"超出输入数量,或输入数量为0,请输入正确数量再进行操作";} if (s.length()>0){msg = msg+s+"超出输入数量,或输入数量为0,请输入正确数量再进行操作";}
return Resp.scanSuccess(msg,"成功上架"+num+"件"); return Resp.scanSuccess(msg,"成功上架"+num+"件");
} }
@ -1609,6 +1620,12 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
log.warn("#################moveAllocationScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId); log.warn("#################moveAllocationScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"货区信息不存在"); throw new CustomerException(403,"货区信息不存在");
} }
String areaType = basicdataGoodsAreaEntity.getAreaType();
if("1".equals(areaType)){
log.warn("#################moveAllocationScanAllocation: 备货区不能上下架 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"备货区不能上下架");
}
Long wid = basicdataGoodsAreaEntity.getWarehouseId(); Long wid = basicdataGoodsAreaEntity.getWarehouseId();
String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称 String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid); BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid);
@ -1871,6 +1888,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//更新打托方式上的数量 //更新打托方式上的数量
updateUpdownTypeNum(updownTypeEntity); updateUpdownTypeNum(updownTypeEntity);
String type = trayTypeEntity.getType(); String type = trayTypeEntity.getType();
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
if("3".equals(type)){ if("3".equals(type)){
Integer stockNum = trayTypeEntity.getStockNum(); Integer stockNum = trayTypeEntity.getStockNum();
return Resp.scanSuccess("上架成功","整托上架成功"+stockNum+"件"); return Resp.scanSuccess("上架成功","整托上架成功"+stockNum+"件");

19
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -93,6 +93,9 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
} }
String waybillNo = wayBillEntity.getWaybillNo(); String waybillNo = wayBillEntity.getWaybillNo();
if(ObjectUtils.isEmpty(allNum)){
allNum=wayBillEntity.getNumber();
}
//通过运单号先去查询新系统是否存在这个运单号 //通过运单号先去查询新系统是否存在这个运单号
QueryWrapper<WarehouseWaybillEntity> waybillQueryWrapper = new QueryWrapper<>(); QueryWrapper<WarehouseWaybillEntity> waybillQueryWrapper = new QueryWrapper<>();
waybillQueryWrapper.eq("waybill_no", waybillNo); waybillQueryWrapper.eq("waybill_no", waybillNo);
@ -170,11 +173,11 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
distributionStockArticleEntity.setServiceNumber(warehouseWaybill.getServiceNo()); distributionStockArticleEntity.setServiceNumber(warehouseWaybill.getServiceNo());
distributionStockArticleEntity.setWaybillNumber(waybillNo); distributionStockArticleEntity.setWaybillNumber(waybillNo);
distributionStockArticleEntity.setWaybillId(warehouseWaybill.getId()); distributionStockArticleEntity.setWaybillId(warehouseWaybill.getId());
distributionStockArticleEntity.setWarehouseId(warehouseWaybill.getId()); distributionStockArticleEntity.setWarehouseId(basicdataWarehouseEntity.getId());
distributionStockArticleEntity.setMallName(warehouseWaybill.getConsigneeName()); distributionStockArticleEntity.setMallName(warehouseWaybill.getConsigneeName());
distributionStockArticleEntity.setMallId(warehouseWaybill.getConsigneeId()); distributionStockArticleEntity.setMallId(warehouseWaybill.getConsigneeId());
distributionStockArticleEntity.setDescriptionGoods(warehouseWaybill.getGoodsName()); distributionStockArticleEntity.setDescriptionGoods(warehouseWaybill.getGoodsName());
distributionStockArticleEntity.setWarehouse(warehouseWaybill.getDepartureWarehouseName()); distributionStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName());
distributionStockArticleEntity.setWarehouseEntryTime(date); distributionStockArticleEntity.setWarehouseEntryTime(date);
distributionStockArticleEntity.setTotalNumber(totalCount); distributionStockArticleEntity.setTotalNumber(totalCount);
distributionStockArticleEntity.setHandQuantity(totalCount); distributionStockArticleEntity.setHandQuantity(totalCount);
@ -235,7 +238,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
DistributionParcelListEntity entity = new DistributionParcelListEntity(); DistributionParcelListEntity entity = new DistributionParcelListEntity();
entity.setMaterialName(warehouseWayBillDetail.getProductName()); entity.setMaterialName(warehouseWayBillDetail.getProductName());
entity.setQuantity(warehouseWayBillDetail.getNum()); entity.setQuantity(warehouseWayBillDetail.getNum());
entity.setConditions(1); entity.setConditions(3);
entity.setStockArticleId(id); entity.setStockArticleId(id);
ls.add(entity); ls.add(entity);
} }
@ -244,6 +247,14 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
log.warn("#################createStockArticle: 保存包件信息失败 orderSelfNum={}", waybillNo); log.warn("#################createStockArticle: 保存包件信息失败 orderSelfNum={}", waybillNo);
throw new CustomerException(405, "保存包件信息失败"); throw new CustomerException(405, "保存包件信息失败");
} }
// 判断运单的货物是否齐套
// todo 目前这里无法判断零担货物是否齐套 默认已到期
} }
@ -444,7 +455,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
Date date = new Date(); Date date = new Date();
warehouseWaybill.setCreateTime(date); warehouseWaybill.setCreateTime(date);
warehouseWaybill.setUpdateTime(date); warehouseWaybill.setUpdateTime(date);
warehouseWaybillMapper.insert(warehouseWaybill); save(warehouseWaybill);
return warehouseWaybill; return warehouseWaybill;
} }

Loading…
Cancel
Save