Browse Source

Merge branch 'dev' into pre-production

newStockUp
pref_mail@163.com 1 year ago
parent
commit
49503253fe
  1. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java
  2. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataStorageServicesDTO.java
  3. 94
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java
  4. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java

@ -22,6 +22,7 @@ public class PackageStockupVO implements Serializable {
private String isScanStr;//是否备货
private String scaned;//备货
private String materialName;//物料名称
private Long scanId;//扫码记录id

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataStorageServicesDTO.java

@ -33,6 +33,6 @@ import java.util.List;
public class BasicdataStorageServicesDTO extends BasicdataStorageServicesEntity {
private static final long serialVersionUID = 1L;
private List<String> sendWarehouseIds;
private List<String> sendWarehouseIds; //发站仓
}

94
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStorageServicesServiceImpl.java

@ -30,9 +30,11 @@ import com.logpm.basicdata.excel.BasicdataStorageServicesExcel;
import com.logpm.basicdata.mapper.BasicdataStorageServicesMapper;
import com.logpm.basicdata.service.IBasicdataStorageServicesService;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IDeptClient;
@ -96,73 +98,57 @@ public class BasicdataStorageServicesServiceImpl extends BaseServiceImpl<Basicda
this.updateById(basicdataStorageServices);
return true;
}else{
//添加
List<String> sendWarehouseIds = new ArrayList<>();
if(ObjectUtils.isNull( basicdataStorageServices.getSendWarehouseIds()) || basicdataStorageServices.getSendWarehouseIds().size() == 0 ){
BladeUser user = AuthUtil.getUser();
// R<UserVO> userR = userClient.userInfoByIdOwn(user.getUserId());
QueryWrapper<BasicdataWarehouseEntity> queryWrapper = new QueryWrapper();
queryWrapper.eq("tenant_id",user.getTenantId());
/*if(userR.getData().getRoleName().equals("管理员")){
//查询全部
queryWrapper.eq("tenant_id",user.getTenantId());
}else{
queryWrapper.eq("department",user.getDeptId());
}*/
//查询全部仓库
List<BasicdataWarehouseEntity> list1 = basicdataWarehouseService.list(queryWrapper);
//查询有没有过服务舱
List<BasicdataStorageServicesEntity> list = this.list(Wrappers.<BasicdataStorageServicesEntity>query().lambda()
.eq(BasicdataStorageServicesEntity::getServeWarehouseId, basicdataStorageServices.getServeWarehouseId())
.eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId())
);
if(list.size() > 0){
// 有
list.removeIf(q -> {
boolean b = list1.stream().anyMatch(i -> i.getId().equals(q.getSendWarehouseId()));
if (b) {
return list1.removeIf(i -> i.getId().equals(q.getSendWarehouseId()));
}
return false;
});
// list1.removeIf(person1 -> list.stream().anyMatch(person2 -> person2.getSendWarehouseId().equals(person1.getId())));
List<Long> collect = list1.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
sendWarehouseIds = collect.stream().map(String::valueOf).collect(Collectors.toList());
boolean b = list.stream().anyMatch(i -> ObjectUtil.isEmpty(i.getSendWarehouseId()));
if(b){
throw new ServiceException("当前添加已存在!");
}else{
//没有
List<Long> collect = list1.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
sendWarehouseIds = collect.stream().map(String::valueOf).collect(Collectors.toList());
}
}else{
sendWarehouseIds = basicdataStorageServices.getSendWarehouseIds();
}
List<BasicdataStorageServicesEntity> servicesEntities = new ArrayList<>();
sendWarehouseIds.forEach( i ->{
List<BasicdataStorageServicesEntity> list = this.list(Wrappers.<BasicdataStorageServicesEntity>query().lambda()
.eq(BasicdataStorageServicesEntity::getServeWarehouseId, basicdataStorageServices.getServeWarehouseId())
.eq(BasicdataStorageServicesEntity::getSendWarehouseId, i)
.eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId())
);
if(list.size() < 1){
BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity();
BeanUtils.copyProperties(basicdataStorageServices,basicdataStorageServicesEntity);
// 获取仓库名称
BasicdataWarehouseEntity sendBasicdataWarehouseEntity = basicdataWarehouseService.getById(i);
basicdataStorageServicesEntity.setSendWarehouseName(sendBasicdataWarehouseEntity.getName());
BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName());
basicdataStorageServicesEntity.setSendWarehouseId(i);
servicesEntities.add(basicdataStorageServicesEntity);
}
}
List<String> sendWarehouseIds = basicdataStorageServices.getSendWarehouseIds();
List<BasicdataStorageServicesEntity> servicesEntities = new ArrayList<>();
if(ObjectUtil.isEmpty(sendWarehouseIds) || sendWarehouseIds.size() < 1){
BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity();
BeanUtils.copyProperties(basicdataStorageServices,basicdataStorageServicesEntity);
// 获取仓库名称
BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName());
servicesEntities.add(basicdataStorageServicesEntity);
}else{
sendWarehouseIds.forEach( i ->{
List<BasicdataStorageServicesEntity> list = this.list(Wrappers.<BasicdataStorageServicesEntity>query().lambda()
.eq(BasicdataStorageServicesEntity::getServeWarehouseId, basicdataStorageServices.getServeWarehouseId())
.eq(BasicdataStorageServicesEntity::getSendWarehouseId, i)
.eq(BasicdataStorageServicesEntity::getClientId, basicdataStorageServices.getClientId())
);
if(list.size() < 1){
BasicdataStorageServicesEntity basicdataStorageServicesEntity = new BasicdataStorageServicesEntity();
BeanUtils.copyProperties(basicdataStorageServices,basicdataStorageServicesEntity);
// 获取仓库名称
BasicdataWarehouseEntity sendBasicdataWarehouseEntity = basicdataWarehouseService.getById(i);
basicdataStorageServicesEntity.setSendWarehouseName(sendBasicdataWarehouseEntity.getName());
BasicdataWarehouseEntity serveBasicdataWarehouseEntity = basicdataWarehouseService.getById(basicdataStorageServices.getServeWarehouseId());
basicdataStorageServicesEntity.setServeWarehouseName(serveBasicdataWarehouseEntity.getName());
basicdataStorageServicesEntity.setSendWarehouseId(i);
servicesEntities.add(basicdataStorageServicesEntity);
}
});
}
});
if(servicesEntities.size() > 0){
this.saveBatch(servicesEntities);
}

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

@ -99,7 +99,7 @@
and CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) = #{allocation}
and ldpl.pallet = #{pallet}
and ldr.is_deleted = 0 -->
select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId
select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName
from logpm_distribution_reservation_package ldrp
LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id =ldrp.parce_list_id and lwtg.association_type = '3'

Loading…
Cancel
Save