Browse Source

供应商发货申请增加供应商地点查询

intex
叶佳兴 4 days ago
parent
commit
e4fa9236bd
  1. 37
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestDetailController.java
  2. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestMainController.java
  3. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailPageReqVO.java
  4. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailRespVO.java
  5. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestMainExcelVO.java
  6. 16
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierinvoiceRequest/SupplierinvoiceRequestDetailServiceImpl.java

37
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestDetailController.java

@ -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();
}
}
}
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestMainController.java

@ -17,7 +17,9 @@ import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.supplier.SupplierDO;
import com.win.module.wms.dal.dataobject.supplierdeliverRequest.SupplierdeliverRequestDetailDO;
import com.win.module.wms.dal.dataobject.supplierdeliverRequest.SupplierdeliverRequestMainDO;
import com.win.module.wms.dal.dataobject.supplieritem.SupplieritemDO;
import com.win.module.wms.dal.dataobject.supplieruser.SupplierUserDO;
import com.win.module.wms.dal.mysql.supplieritem.SupplieritemMapper;
import com.win.module.wms.dal.mysql.supplieruser.SupplierUserMapper;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.enums.ErrorCodeConstants;
@ -70,7 +72,8 @@ public class SupplierdeliverRequestMainController {
private SupplierUserMapper supplierUserMapper;
@Resource
private ItembasicService itembasicService;
@Resource
private SupplieritemMapper supplieritemMapper;
@Resource
private SupplierService supplierService;
@ -240,6 +243,10 @@ public class SupplierdeliverRequestMainController {
if(supplierDO!=null){
vo.setSupplierName(supplierDO.getName());
}
SupplieritemDO supplieritemDO = supplieritemMapper.selectBySuppercode(vo.getSupplierCode(),vo.getItemCode());
if(supplieritemDO!=null){
vo.setSupplierAddress(supplieritemDO.getSupplierAddress());
}
resultList.add(vo);
}
}

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailPageReqVO.java

@ -146,5 +146,9 @@ public class SupplierdeliverRequestDetailPageReqVO extends PageParam {
*/
private String poLineType;
@Schema(description = "供应商地点")
private String supplierAddress;
}

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailRespVO.java

@ -200,4 +200,7 @@ public class SupplierdeliverRequestDetailRespVO extends SupplierdeliverRequestDe
*/
private String allowOverShipment;
@Schema(description = "供应商地点")
private String supplierAddress;
}

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestMainExcelVO.java

@ -50,6 +50,10 @@ public class SupplierdeliverRequestMainExcelVO {
@Colour(IndexedColors.LIGHT_YELLOW)
private String supplierName;
@ExcelProperty("供应商地点")
@Colour(IndexedColors.LIGHT_YELLOW)
private String supplierAddress;
@ExcelProperty(value = "便次")
@Colour(IndexedColors.LIGHT_YELLOW)
@ColumnWidth(value = 16)

16
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierinvoiceRequest/SupplierinvoiceRequestDetailServiceImpl.java

@ -975,17 +975,9 @@ public class SupplierinvoiceRequestDetailServiceImpl implements SupplierinvoiceR
}
recordSupplierdeliverDetailVO.setUom(uomMap.get(recordSupplierdeliverDetailVO.getUom()));//单位转换
}
//取货日期
List<LocalDateTime> timeList = new ArrayList<>();
int Serial = 1;
for (RecordSupplierdeliverDetailVO recordSupplierdeliverDetailVO : list) {
recordSupplierdeliverDetailVO.setSupplierSerial(String.valueOf(Serial++));
if(recordSupplierdeliverDetailVO.getPickDate()!=null){
timeList.add(recordSupplierdeliverDetailVO.getPickDate());
}
}
if(!timeList.isEmpty()){
Collections.sort(timeList);
}
//打印几页
BigDecimal total = new BigDecimal(0);
@ -1008,11 +1000,9 @@ public class SupplierinvoiceRequestDetailServiceImpl implements SupplierinvoiceR
supplierdeliverDocumentVO.setSupplierCode(recordMainDO.getSupplierCode());
SupplierDO select = supplierMapper.selectByCode(recordMainDO.getSupplierCode());
supplierdeliverDocumentVO.setSupplierName(select.getShortName());
if(!timeList.isEmpty()){
supplierdeliverDocumentVO.setPickDate(LocalDateTimeUtil.format(timeList.get(0), DatePattern.NORM_DATE_FORMATTER));
if(recordMainDO.getSchdShipDate()!=null){
supplierdeliverDocumentVO.setPickDate(LocalDateTimeUtil.format(recordMainDO.getSchdShipDate(), DatePattern.NORM_DATE_FORMATTER));
}
supplierdeliverDocumentVO.setPrintDate(LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.NORM_DATE_FORMATTER));
supplierdeliverDocumentVO.setPrintTime(LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.NORM_TIME_FORMATTER));
supplierdeliverDocumentVO.setReceivedNumber(itembasicDO.getReceivedNumber());
QueryWrapper<DockDO> dockDOQueryWrapper = new QueryWrapper();
dockDOQueryWrapper.eq("code", recordMainDO.getToDockCode());
@ -1042,6 +1032,8 @@ public class SupplierinvoiceRequestDetailServiceImpl implements SupplierinvoiceR
//根据要货计划查询采购订单中的管理编号
PurchasePlanMainDO purchasePlanMainDO = purchasePlanMainMapper.selectByNumber(recordMainDO.getPpNumber());
if (purchasePlanMainDO != null) {
supplierdeliverDocumentVO.setPrintDate(LocalDateTimeUtil.format(purchasePlanMainDO.getCreateTime(), DatePattern.NORM_DATE_FORMATTER));
supplierdeliverDocumentVO.setPrintTime(LocalDateTimeUtil.format(purchasePlanMainDO.getCreateTime(), DatePattern.NORM_TIME_FORMATTER));
supplierdeliverDocumentVO.setContacts(purchasePlanMainDO.getContacts());
supplierdeliverDocumentVO.setPhone(purchasePlanMainDO.getPhone());
supplierdeliverDocumentVO.setStoolTime(purchasePlanMainDO.getDeliNo());

Loading…
Cancel
Save