|
|
@ -26,6 +26,7 @@ import com.win.module.wms.enums.common.ConstantDataInfo; |
|
|
|
import com.win.module.wms.service.itembasic.ItembasicService; |
|
|
|
import com.win.module.wms.service.supplier.SupplierService; |
|
|
|
import com.win.module.wms.service.supplierdeliverRequest.SupplierdeliverRequestDetailService; |
|
|
|
import com.win.module.wms.service.supplieritem.SupplieritemService; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.Parameter; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
@ -65,6 +66,8 @@ public class SupplierdeliverRequestDetailController { |
|
|
|
private SupplieritemMapper supplieritemMapper; |
|
|
|
@Resource |
|
|
|
private ItembasicService itembasicService; |
|
|
|
@Resource |
|
|
|
private SupplieritemService supplieritemService; |
|
|
|
|
|
|
|
@PostMapping("/create") |
|
|
|
@Operation(summary = "创建供应商发货申请子") |
|
|
@ -108,6 +111,31 @@ public class SupplierdeliverRequestDetailController { |
|
|
|
pageVO.setItemCodeList(List.of("没有数据"));//给一个永远也查询不到的品番
|
|
|
|
} |
|
|
|
} |
|
|
|
if(org.apache.commons.lang.StringUtils.isNotEmpty(pageVO.getSupplierAddress())){//供应商地点 且模糊搜索
|
|
|
|
List<SupplieritemDO> supplierAddress = supplieritemService.getSupplierAddress(pageVO.getSupplierAddress()); |
|
|
|
List<String> supplierAddressList = new ArrayList<>();//根据供应商地点查询到的供应商
|
|
|
|
List<String> itemList = new ArrayList<>();//根据供应商地点查询到的物料号
|
|
|
|
for(SupplieritemDO en:supplierAddress){ |
|
|
|
supplierAddressList.add(en.getSupplierCode()); |
|
|
|
itemList.add(en.getItemCode()); |
|
|
|
} |
|
|
|
if(!supplierAddress.isEmpty()){ |
|
|
|
if(pageVO.getSupplierCodeList()!=null && !pageVO.getSupplierCodeList().isEmpty()){//取交集
|
|
|
|
supplierAddressList.retainAll(pageVO.getSupplierCodeList()); |
|
|
|
pageVO.setSupplierCodeList(supplierAddressList); |
|
|
|
}else{ |
|
|
|
pageVO.setSupplierCodeList(supplierAddressList); |
|
|
|
} |
|
|
|
if(pageVO.getItemCodeList()!=null && !pageVO.getItemCodeList().isEmpty()){//取交集
|
|
|
|
itemList.retainAll(pageVO.getItemCodeList()); |
|
|
|
pageVO.setItemCodeList(itemList); |
|
|
|
}else{ |
|
|
|
pageVO.setItemCodeList(itemList); |
|
|
|
} |
|
|
|
}else{//根据供应商地点没有查询到供应商
|
|
|
|
pageVO.setSupplierCodeList(List.of("没有数据"));//给一个永远也查询不到的品番
|
|
|
|
} |
|
|
|
} |
|
|
|
PageResult<SupplierdeliverRequestDetailDO> pageResult = supplierdeliverRequestDetailService.getSupplierdeliverRequestDetailPage(pageVO); |
|
|
|
PageResult<SupplierdeliverRequestDetailRespVO> result = SupplierdeliverRequestDetailConvert.INSTANCE.convertPage(pageResult); |
|
|
|
if (pageResult.getList().size() > 0) { |
|
|
@ -146,6 +174,15 @@ public class SupplierdeliverRequestDetailController { |
|
|
|
vo.setBackNumber(itembasicDO.getBackNumber());//背番
|
|
|
|
} |
|
|
|
vo.setRemark(supplierdeliverRequestMainDO.getRemark()); |
|
|
|
try { |
|
|
|
SupplieritemDO supplieritemDO = supplieritemMapper.selectBySuppercode(vo.getSupplierCode(),vo.getItemCode()); |
|
|
|
if(supplieritemDO!=null){ |
|
|
|
vo.setSupplierAddress(supplieritemDO.getSupplierAddress()); |
|
|
|
vo.setAllowOverShipment(supplieritemDO.getAllowOverShipment()); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.getMessage(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|