Browse Source

Merge branch 'dev' into pre-production

# Conflicts:
#	blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java
newStockUp
zhenghaoyu 1 year ago
parent
commit
25f05381bb
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  2. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ReCheckTrayListVO.java
  3. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseUpdownGoodsVO.java
  4. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  5. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java
  6. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java
  7. 39
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  8. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  9. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml
  10. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml
  11. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsLogService.java
  12. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java
  13. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  14. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsLogServiceImpl.java
  15. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java
  16. 152
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  17. 16
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

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

@ -8,7 +8,7 @@ public interface ModuleNameConstant {
/**
* 如果不需要 ""
*/
public static final String DEVAUTH ="";
public static final String DEVAUTH ="-zhy";
/**
* 工厂对接服务名称

1
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ReCheckTrayListVO.java

@ -14,4 +14,5 @@ public class ReCheckTrayListVO implements Serializable {
private Long marketId;//商场id
private String marketName;//商场名称
private String name;
private String isFleeing;//串货
}

3
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseUpdownGoodsVO.java

@ -7,4 +7,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
public class WarehouseUpdownGoodsVO extends WarehouseUpdownGoodsEntity {
private String orderCode;
}

10
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java

@ -1,6 +1,5 @@
package com.logpm.factory.comfac.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -23,7 +22,9 @@ import com.logpm.factory.pan.service.IPanFactoryOrderService;
import com.logpm.factory.pan.service.IPanPackageInfoService;
import com.logpm.factory.pan.service.IPanPackageListService;
import com.logpm.factory.snm.constant.PanFactoryEnum;
import com.logpm.factory.snm.entity.*;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import com.logpm.factory.snm.entity.PanPackageInfo;
import com.logpm.factory.snm.entity.PanPackageList;
import com.logpm.factory.zb.entity.ZbOrderPackageEntity;
import com.logpm.factory.zb.entity.ZbPackageInfoEntity;
import com.logpm.factory.zb.entity.ZbReceiptEntity;
@ -40,16 +41,13 @@ import com.logpm.oldproject.feign.IDetailProductClient;
import com.logpm.oldproject.feign.IServiceNumClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.checkerframework.checker.units.qual.C;
import org.jetbrains.annotations.Nullable;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.sql.Date;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.util.ArrayList;
@ -543,7 +541,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setVolume("");//体积
advanceDetailEntity.setUnitNo(StringUtil.isBlank(factoryPackageEntity.getCode()) ? "" : factoryPackageEntity.getCode());//包条码
advanceDetailEntity.setMctsTruck(advanceEntity.getMctsTruck());//车次号
advanceDetailEntity.setMctsTruckNo(advanceEntity.getMctsTruckNo());//车牌号
advanceDetailEntity.setMctsTruckNo(StringUtil.isBlank(advanceEntity.getMctsTruckNo())?"":advanceEntity.getMctsTruckNo());//车牌号
advanceDetailEntity.setDate100(null);//基地发货日期
advanceDetailEntity.setDate2("");//预约到厂时间
advanceDetailEntity.setDate3("");//实际到厂时间

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java

@ -19,7 +19,7 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
InterceptorRegistration registry = interceptorRegistry.addInterceptor(new FactoryAccountsInterceptor(factoryTokenService));
registry.addPathPatterns("/factory/**").
excludePathPatterns("/factory/auth/token").
excludePathPatterns("/factory/oupai")
excludePathPatterns("/factory/oupai/**")
.excludePathPatterns("/factory/common/**");
}
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -383,7 +383,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
"$expand=Order($select=" +
"Code,SelfCode,ContractNumber,ServiceNumber,OrderClass,OrderType,Status,FactoryShipStatus,FactorySendQty,WarehouseReceiveStatus,WarehouseReceiveQty,ReservationStatus,Store,MatingCode,IsMating,FirstClassCode,Leave,Customer,Province,City,CustomerAddress,CustomerPhone,ShopReceiver,BrandCode,BrandName,From,OutGoingTime,CreateTime,Freeze,FirstShipTime,MatingShipTime,FirstReceiveTime,MatingReceiveTime;\n" +
"$expand=Store($select=Name,Code))" +
"&$expand=PackageDetails($select=Code,Name,OrgCode,OrgCode)" +
"&$expand=PackageDetails($select=Code,Name,Type,Unit,OrgCode)" +
"&$expand=CurrentWarehouse($select=Name,Code)" +
"&$expand=SendWarehouse($select=Name,Code)" +
")&$expand=FromWarehouse($select=Name,Code)&$expand=CurrentWarehouse($select=Name,Code)&$expand=EndWarehouse($select=Name,Code)";

39
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java

@ -794,7 +794,7 @@ public class WarehouseTrayTypeApiController {
public R scanSourceTrayCode(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########scanSourceTrayCode: ";
log.info(method + "扫码来源托盘 trayTypeDTO={}", trayTypeDTO);
String sourceTrayCode = trayTypeDTO.getSourceTrayCode();//来源托盘
String sourceTrayCode = trayTypeDTO.getTrayCode();//来源托盘
try{
if(!StringUtil.hasLength(sourceTrayCode)){
log.warn(method+"来源托盘码不能为空 sourceTrayCode={}",sourceTrayCode);
@ -810,17 +810,42 @@ public class WarehouseTrayTypeApiController {
}
}
@ResponseBody
@PostMapping("/scanTargetTrayCode")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "扫码目标托盘", notes = "传入trayTypeDTO")
public R scanTargetTrayCode(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########scanTargetTrayCode: ";
log.info(method + "扫码来源托盘 trayTypeDTO={}", trayTypeDTO);
log.info(method + "扫码目标托盘 trayTypeDTO={}", trayTypeDTO);
String targetTrayCode = trayTypeDTO.getTrayCode();//来源托盘
try{
if(!StringUtil.hasLength(targetTrayCode)){
log.warn(method+"目标托盘码不能为空 targetTrayCode={}",targetTrayCode);
return R.fail(403,"目标托盘码不能为空");
}
return warehouseTrayTypeService.scanTargetTrayCode(targetTrayCode);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/mergeTray")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "合托", notes = "传入trayTypeDTO")
public R mergeTray(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########mergeTray: ";
log.info(method + "合托 trayTypeDTO={}", trayTypeDTO);
String sourceTrayCode = trayTypeDTO.getSourceTrayCode();//来源托盘码
String targetTrayCode = trayTypeDTO.getTargetTrayCode();//目标托盘码
try{
if(!StringUtil.hasLength(sourceTrayCode)){
log.warn(method+"来源托盘码不能为空 sourceTrayCode={}",sourceTrayCode);
return R.fail(403,"来源托盘码不能为空");
@ -829,7 +854,13 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"目标托盘码不能为空 targetTrayCode={}",targetTrayCode);
return R.fail(403,"目标托盘码不能为空");
}
return warehouseTrayTypeService.scanTargetTrayCode(sourceTrayCode,targetTrayCode);
if(targetTrayCode.equals(sourceTrayCode)){
log.warn(method+"目标托盘码和来源托盘不能为同一个 targetTrayCode={} sourceTrayCode={}",targetTrayCode,sourceTrayCode);
return R.fail(403,"目标托盘码和来源托盘不能为同一个");
}
return warehouseTrayTypeService.mergeTray(sourceTrayCode,targetTrayCode);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java

@ -322,7 +322,7 @@ public class WarehouseUpdownTypeApiController {
public R downScanPackage(@RequestBody UpdownTypeDTO updownTypeDTO ) {
String method = "###########downScanPackage: ";
log.info(method + "下架扫描包件码 updownTypeDTO={}", updownTypeDTO);
String orderPackageCode = updownTypeDTO.getCode();
String orderPackageCode = updownTypeDTO.getOrderPackageCode();
try{
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包件码不能为空 orderPackageCode={}",orderPackageCode);

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml

@ -165,6 +165,7 @@
ldpl.order_package_code code,
1 goodsType,
lwtg.num num,
lwtg.is_fleeing isFleeing,
ldpl.material_name name
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_parcel_list ldpl on ldpl.id = lwtg.association_id and ldpl.is_deleted = 0
@ -176,6 +177,7 @@
select ldsa.order_code orderCode,
2 goodsType,
lwtg.num num,
lwtg.is_fleeing isFleeing,
ldsa.description_goods name
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_stock_article ldsa on ldsa.id = lwtg.association_id and ldsa.is_deleted = 0
@ -189,6 +191,7 @@
ldsl.description_goods name,
3 goodsType,
lwtg.num num,
lwtg.is_fleeing isFleeing,
ldsl.market_id marketId,
ldsl.market_name marketName
from logpm_warehouse_tray_goods lwtg
@ -248,7 +251,7 @@
FROM logpm_warehouse_tray_goods lwtg
LEFT JOIN logpm_warehouse_tary_allocation lwta ON lwta.tray_id = lwtg.tray_id AND lwta.is_deleted = 0
WHERE lwtg.market_id = #{marketId}
and lwtg.association_code = #{materialCode}
and lwtg.association_value = #{materialCode}
and lwtg.incoming_batch = #{incomingBatch}
AND lwta.id IS NULL
</select>

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml

@ -204,7 +204,7 @@
lwug.allocation_title allocationName,
lwt.pallet_code trayCode,
lwug.num num
from logpm_warehouse_updown_goods lwug on ldsa.id = lwug.association_id
from logpm_warehouse_updown_goods lwug
left join logpm_warehouse_tary_allocation lwta on lwta.allocation_id = lwug.allocation_id and lwta.is_deleted = 0
left join logpm_warehouse_tray lwt on lwt.id = lwta.tray_id
where lwug.association_id = #{orderId}
@ -218,13 +218,12 @@
lwug.allocation_title allocationName,
lwt.pallet_code trayCode,
lwug.num num
FROM logpm_warehouse_updown_goods lwug ON ldsa.id = lwug.association_id
FROM logpm_warehouse_updown_goods lwug
LEFT JOIN logpm_warehouse_tary_allocation lwta ON lwta.allocation_id = lwug.allocation_id AND lwta.is_deleted = 0
LEFT JOIN logpm_warehouse_tray lwt ON lwt.id = lwta.tray_id
WHERE lwug.market_id = #{marketId}
and lwug.association_value = #{materialCode}
and lwug.incoming_batch = #{incomingBatch}
AND lwta.id IS NOT NULL
</select>
</mapper>

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsLogService.java

@ -14,7 +14,7 @@ public interface IWarehouseTrayGoodsLogService extends BaseService<WarehouseTray
void saveLogZero(DistributionStockArticleEntity stockArticleEntity, WarehouseTrayTypeEntity trayTypeEntity, Integer num, String bindingType, String remark, String palletizingType);
void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,Integer num, String bindingType, String remark, String palletizingType);
void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,String materialCode,Integer num, String bindingType, String remark, String palletizingType);
void saveLogByTrayGoodsList(List<WarehouseTrayGoodsEntity> sourceTrayGoodsList, String bindingType, String remark, String palletizingType);
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java

@ -50,7 +50,7 @@ public interface IWarehouseTrayGoodsService extends BaseService<WarehouseTrayGoo
WarehouseTrayGoodsEntity getStockDataByMaterialIdAndMarketId(Long materialId, Long marketId, Long trayTypeId,String incomingBatch);
void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,Integer num, String isException);
void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,String materialCode,Integer num, String isException);

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -64,7 +64,7 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R scanSourceTrayCode(String sourceTrayCode);
R scanTargetTrayCode(String sourceTrayCode,String targetTrayCode);
R mergeTray(String sourceTrayCode,String targetTrayCode);
OrderDetailVO orderDetail(String orderCode,String trayCode);
@ -72,4 +72,6 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R selectStockByMaterialCodeAndMarketId(Long marketId, String materialCode);
R scanTargetTrayCode(String targetTrayCode);
}

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsLogServiceImpl.java

@ -51,12 +51,12 @@ public class WarehouseTrayGoodsLogServiceImpl extends BaseServiceImpl<WarehouseT
}
@Override
public void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,Integer num, String bindingType, String remark, String palletizingType) {
public void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,String materialCode,Integer num, String bindingType, String remark, String palletizingType) {
WarehouseTrayGoodsLogEntity trayGoodsLogEntity = new WarehouseTrayGoodsLogEntity();
trayGoodsLogEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsLogEntity.setTrayTypeId(trayTypeEntity.getId());
trayGoodsLogEntity.setAssociationId(materialId);
trayGoodsLogEntity.setAssociationValue(null);
trayGoodsLogEntity.setAssociationValue(materialCode);
trayGoodsLogEntity.setAssociationType("4");
trayGoodsLogEntity.setBindingType(bindingType);
trayGoodsLogEntity.setRemark(remark);

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java

@ -16,7 +16,6 @@ import lombok.extern.log4j.Log4j2;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -166,7 +165,7 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
}
@Override
public void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,Integer num, String isException) {
public void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,String materialCode,Integer num, String isException) {
WarehouseTrayGoodsEntity trayGoodsEntity = new WarehouseTrayGoodsEntity();
trayGoodsEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsEntity.setTrayCode(trayTypeEntity.getTrayCode());
@ -212,11 +211,9 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
@Override
public void deleteByIdList(List<WarehouseTrayGoodsEntity> trayGoodsList) {
List<Long> ids = new ArrayList<>();
for (WarehouseTrayGoodsEntity trayGoodsEntity:trayGoodsList){
ids.add(trayGoodsEntity.getId());
baseMapper.deleteEntityByTrayGoodsId(trayGoodsEntity.getId());
}
baseMapper.deleteByIdList(ids);
}
@Override

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

@ -37,10 +37,7 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
@Log4j2
@Service
@ -942,20 +939,20 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(chuanFlag){
if(Objects.isNull(warehouseTrayGoodsEntity)){
//存入有数据库存品与托盘绑定关系表
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,1, "1");
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,materialCode,1, "1");
}else{
warehouseTrayGoodsService.updateEntityStock(warehouseTrayGoodsEntity,1);
}
}else{
if(Objects.isNull(warehouseTrayGoodsEntity)){
//存入有数据库存品与托盘绑定关系表
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,1, "0");
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,materialCode,1, "0");
}else{
warehouseTrayGoodsService.updateEntityStock(warehouseTrayGoodsEntity,-1);
}
}
// //添加上拖日志表
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,incomingBatch,1, "1", "分拣打托:有数据库存品 分拣", "1");
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,incomingBatch,materialCode,1, "1", "分拣打托:有数据库存品 分拣", "1");
updateNumByTrayTypeId(trayTypeEntity);
@ -978,6 +975,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
Long trayTypeId = trayGoodsEntity.getTrayTypeId();
Integer num = trayGoodsEntity.getNum();
Long materialId = trayGoodsEntity.getAssociationId();
String materialCode = trayGoodsEntity.getAssociationValue();
Long marketId = trayGoodsEntity.getMarketId();
Long trayId = trayGoodsEntity.getTrayId();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
@ -1006,7 +1004,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
//添加下托日志
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,num,"0","分拣打托:有数据库存品分拣","2");
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,materialCode,num,"0","分拣打托:有数据库存品分拣","2");
updateNumByTrayTypeId(trayTypeEntity);
@ -1140,6 +1138,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
String marketName = stockListEntity.getMarketName();
Long materialId = stockListEntity.getMaterialId();
String cargoNumber = stockListEntity.getCargoNumber();
BasicMaterialEntity materialEntity = basicMaterialClient.getMaterialOwnId(materialId);
if(Objects.isNull(materialEntity)){
log.warn("#########saveTrayTypeByStock: 未找到物料信息 materialId={}",materialId);
@ -1196,20 +1195,20 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(chuanFlag){
if(Objects.isNull(warehouseTrayGoodsEntity)){
//存入有数据库存品与托盘绑定关系表
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,num, "1");
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,cargoNumber,num, "1");
}else{
warehouseTrayGoodsService.updateEntityStock(warehouseTrayGoodsEntity,num);
}
}else{
if(Objects.isNull(warehouseTrayGoodsEntity)){
//存入有数据库存品与托盘绑定关系表
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,num, "0");
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,cargoNumber,num, "0");
}else{
warehouseTrayGoodsService.updateEntityStock(warehouseTrayGoodsEntity,-num);
}
}
// //添加上拖日志表
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,incomingBatch,num, "1", "分拣打托:无数据库存品 分拣", "1");
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,incomingBatch,cargoNumber,num, "1", "分拣打托:无数据库存品 分拣", "1");
updateNumByTrayTypeId(trayTypeEntity);
@ -1254,6 +1253,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getById(trayGoodsId);
Long trayTypeId = trayGoodsEntity.getTrayTypeId();
Long materialId = trayGoodsEntity.getAssociationId();
String materialCode = trayGoodsEntity.getAssociationValue();
Long marketId = trayGoodsEntity.getMarketId();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
WarehouseTrayTypeEntity trayTypeEntity = baseMapper.selectById(trayTypeId);
@ -1261,7 +1261,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
warehouseTrayGoodsService.updateEntityStock(trayGoodsEntity,enterNum);
//添加下托日志 Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,Integer num, String bindingType, String remark, String palletizingType
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,Math.abs(enterNum),"0","下架:库存品部分下架","2");
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,materialCode,Math.abs(enterNum),"0","下架:库存品部分下架","2");
updateNumByTrayTypeId(trayTypeEntity);
}
@ -1355,8 +1355,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
log.warn("################scanSourceTrayCode: 托盘没有打托方式 trayId={}",trayId);
return R.fail(403,"托盘未绑定数据");
}
Map<String,Object> map = new HashMap<>();
String type = trayTypeEntity.getType();
Long trayTypeId = trayTypeEntity.getId();
Integer totalNum = trayTypeEntity.getTotalNum();
Integer orderTotalNum = trayTypeEntity.getOrderTotalNum();
Integer stockNum = trayTypeEntity.getStockNum();
Integer stockTotalNum = trayTypeEntity.getStockTotalNum();
List<ReCheckTrayListVO> trayListVOS = null;
if(PalletProductTypeConstant.CUSTOMIZED.equals(type)){//订制品打托
@ -1370,26 +1375,32 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}else {
log.warn("##################getEntityByTrayCode: 未知的打托类型");
}
return R.data(trayListVOS);
map.put("trayCode",trayCode);
map.put("totalNum",totalNum);
map.put("orderTotalNum",orderTotalNum);
map.put("stockNum",stockNum);
map.put("stockTotalNum",stockTotalNum);
map.put("list",trayListVOS);
return R.data(map);
}
@Override
public R scanTargetTrayCode(String sourceTrayCode,String targetTrayCode) {
log.info("#################scanTargetTrayCode: 合托扫码目标托盘 targetTrayCode={}",targetTrayCode);
public R mergeTray(String sourceTrayCode,String targetTrayCode) {
log.info("#################mergeTray: 合托扫码目标托盘 targetTrayCode={}",targetTrayCode);
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(targetTrayCode);
if(Objects.isNull(trayEntity)){
log.warn("################scanTargetTrayCode: 托盘信息不存在 targetTrayCode={}",targetTrayCode);
log.warn("################mergeTray: 托盘信息不存在 targetTrayCode={}",targetTrayCode);
return R.fail(403,"托盘信息不存在");
}
Integer disableType = trayEntity.getDisableType();
Long targetTrayId = trayEntity.getId();
if(disableType == 2){
log.warn("################scanTargetTrayCode: 托盘已禁用 targetTrayCode={}",targetTrayCode);
log.warn("################mergeTray: 托盘已禁用 targetTrayCode={}",targetTrayCode);
return R.fail(403,"托盘已禁用");
}
Long allocationId = warehouseTaryAllocationService.getAllocationIdByTrayId(targetTrayId);
if(!Objects.isNull(allocationId)){
log.warn("################scanTargetTrayCode: 托盘已上架 targetTrayId={}",targetTrayId);
log.warn("################mergeTray: 托盘已上架 targetTrayId={}",targetTrayId);
return R.fail(403,"托盘已上架,请先下架");
}
QueryWrapper<WarehouseTrayTypeEntity> sourceQueryWapper = new QueryWrapper<>();
@ -1397,36 +1408,40 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
.eq("is_deleted",0);
WarehouseTrayTypeEntity sourceTrayTypeEntity = baseMapper.selectOne(sourceQueryWapper);
if(Objects.isNull(sourceTrayTypeEntity)){
log.warn("################scanTargetTrayCode: 来源托盘信息有误 sourceTrayCode={}",sourceTrayCode);
log.warn("################mergeTray: 来源托盘信息有误 sourceTrayCode={}",sourceTrayCode);
return R.fail(403,"来源托盘信息有误");
}
QueryWrapper<WarehouseTrayTypeEntity> targetQueryWapper = new QueryWrapper<>();
targetQueryWapper.eq("tray_code",targetTrayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity targetTrayTypeEntity = baseMapper.selectOne(targetQueryWapper);
if(Objects.isNull(targetTrayTypeEntity)){
log.warn("################scanTargetTrayCode: 目标托盘信息有误 targetTrayCode={}",targetTrayCode);
return R.fail(403,"目标托盘信息有误");
}
String sourceType = sourceTrayTypeEntity.getType();
String targetType = targetTrayTypeEntity.getType();
if(!sourceType.equals(targetType)){
log.warn("################scanTargetTrayCode: 托盘货物类型不同 sourceType={} targetType={}",sourceType,targetType);
return R.fail(403,"托盘货物类型不同");
}
BasicdataTrayEntity sourceTrayEntity = basicdataTrayClient.getTrayByTrayCode(sourceTrayCode);
if(Objects.isNull(sourceTrayEntity)){
log.warn("################scanTargetTrayCode: 托盘信息不存在 sourceTrayCode={}",sourceTrayCode);
return R.fail(403,"托盘信息不存在");
}
Long sourceTrayId = sourceTrayEntity.getId();
Long sourceTrayId = sourceTrayTypeEntity.getTrayId();
Long sourceTrayTypeId = sourceTrayTypeEntity.getId();
Long targetTrayTypeId = targetTrayTypeEntity.getId();
//先把来源托盘数据合到目标托盘
copyTrayGoodsToTargetTray(sourceTrayTypeId,targetTrayTypeEntity);
if(Objects.isNull(targetTrayTypeEntity)){
targetTrayTypeEntity = new WarehouseTrayTypeEntity();
BeanUtil.copy(sourceTrayTypeEntity,targetTrayTypeEntity);
targetTrayTypeEntity.setTrayId(targetTrayId);
targetTrayTypeEntity.setTrayCode(targetTrayCode);
targetTrayTypeEntity.setId(null);
save(targetTrayTypeEntity);//保存打托方式
//先把来源托盘数据合到目标托盘
copyTrayGoodsToTargetTray(sourceTrayTypeId,targetTrayTypeEntity);
//空置来源托盘
downTrayGoodsByTrayId(sourceTrayId,"合托:下托");
}else{
String targetType = targetTrayTypeEntity.getType();
if(!sourceType.equals(targetType)){
log.warn("################mergeTray: 托盘货物类型不同 sourceType={} targetType={}",sourceType,targetType);
return R.fail(403,"托盘货物类型不同");
}
//空置来源托盘
downTrayGoodsByTrayId(sourceTrayId,"合托:下托");
//先把来源托盘数据合到目标托盘
copyTrayGoodsToTargetTray(sourceTrayTypeId,targetTrayTypeEntity);
//空置来源托盘
downTrayGoodsByTrayId(sourceTrayId,"合托:下托");
}
return R.success("合托成功");
}
@ -1518,6 +1533,65 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
return R.data(ls);
}
@Override
public R scanTargetTrayCode(String trayCode) {
log.info("#################scanTargetTrayCode: 合托扫码来源托盘 trayCode={}",trayCode);
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(trayEntity)){
log.warn("################scanTargetTrayCode: 托盘信息不存在 trayCode={}",trayCode);
return R.fail(403,"托盘信息不存在");
}
Integer disableType = trayEntity.getDisableType();
Long trayId = trayEntity.getId();
if(disableType == 2){
log.warn("################scanTargetTrayCode: 托盘已禁用 trayCode={}",trayCode);
return R.fail(403,"托盘已禁用");
}
Long allocationId = warehouseTaryAllocationService.getAllocationIdByTrayId(trayId);
if(!Objects.isNull(allocationId)){
log.warn("################scanTargetTrayCode: 托盘已上架 trayId={}",trayId);
return R.fail(403,"托盘已上架,请先下架");
}
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_id",trayId)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = baseMapper.selectOne(queryWrapper);
if(Objects.isNull(trayTypeEntity)){
log.info("################scanTargetTrayCode: 托盘未绑定数据 trayId={}",trayId);
return R.success("托盘未绑定数据");
}else{
Map<String,Object> map = new HashMap<>();
String type = trayTypeEntity.getType();
Long trayTypeId = trayTypeEntity.getId();
Integer totalNum = trayTypeEntity.getTotalNum();
Integer orderTotalNum = trayTypeEntity.getOrderTotalNum();
Integer stockNum = trayTypeEntity.getStockNum();
Integer stockTotalNum = trayTypeEntity.getStockTotalNum();
List<ReCheckTrayListVO> trayListVOS = null;
if(PalletProductTypeConstant.CUSTOMIZED.equals(type)){//订制品打托
trayListVOS = warehouseTrayGoodsService.getReCheckPackageByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.ARTIFICIAL.equals(type)){
trayListVOS = warehouseTrayGoodsService.getReCheckZeroByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.STOCKDATA.equals(type)){
trayListVOS = warehouseTrayGoodsService.getReCheckStockByTrayTypeId(trayTypeId);
}else if(PalletProductTypeConstant.STOCKNODATA.equals(type)){
trayListVOS = warehouseTrayGoodsService.getReCheckStockByTrayTypeId(trayTypeId);
}else {
log.warn("##################scanTargetTrayCode: 未知的打托类型");
}
map.put("trayCode",trayCode);
map.put("totalNum",totalNum);
map.put("orderTotalNum",orderTotalNum);
map.put("stockNum",stockNum);
map.put("stockTotalNum",stockTotalNum);
map.put("list",trayListVOS);
return R.data(map);
}
}
private void copyTrayGoodsToTargetTray(Long sourceTrayTypeId, WarehouseTrayTypeEntity targetTrayTypeEntity) {
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_type_id",sourceTrayTypeId);

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

@ -170,10 +170,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
throw new CustomerException(403,"包件信息不存在");
}
String orderPackageGroundingStatus = parcelListEntity.getOrderPackageGroundingStatus();
if("20".equals(orderPackageGroundingStatus)){
log.warn("#################findUpShelfScanGoods: 包件已上架 code={}",code);
throw new CustomerException(403,"包件已上架");
}
// if("20".equals(orderPackageGroundingStatus)){
// log.warn("#################findUpShelfScanGoods: 包件已上架 code={}",code);
// throw new CustomerException(403,"包件已上架");
// }
List<UpShelfDataVO> ls = new ArrayList<>();
UpShelfDataVO dataVO = new UpShelfDataVO();
dataVO.setOrderCode(parcelListEntity.getOrderCode());
@ -749,7 +749,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
log.warn("##########downScanPackage: 包件信息不存在 orderPackageCode={}",orderPackageCode);
return R.fail(403,"包件信息不存在");
}
return R.data(parcelListEntity);
WarehouseUpdownGoodsVO updownGoodsVO = new WarehouseUpdownGoodsVO();
BeanUtil.copy(updownGoodsEntity,updownGoodsVO);
updownGoodsVO.setOrderCode(parcelListEntity.getOrderCode());
return R.data(updownGoodsVO);
}
@Override
@ -1269,7 +1272,6 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
updownZeroOrderVO.setWaybillCode(stockArticleEntity.getWaybillNumber());
updownZeroOrderVO.setOrderCode(orderCode);
updownZeroOrderVO.setTotalNumber(totalNumber);
List<PositionVO> ls = new ArrayList<>();
List<PositionVO> updownGoodsEntities = warehouseUpdownGoodsService.getUpdownGoodsByZeroOrderId(orderId);
List<PositionVO> trayGoodsEntities = warehouseTrayGoodsService.getTrayGoodsByZeroOrderIdNoAllocationId(orderId);
updownGoodsEntities.addAll(trayGoodsEntities);
@ -1278,7 +1280,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
totalNumber = totalNumber -num;
}
updownZeroOrderVO.setResidueNumber(totalNumber);
updownZeroOrderVO.setList(ls);
updownZeroOrderVO.setList(updownGoodsEntities);
return updownZeroOrderVO;
}

Loading…
Cancel
Save