Merge remote-tracking branch '惠信/feature/NoScanning' into feature/NoScanning
This commit is contained in:
commit
6255ed5b94
|
|
@ -13,6 +13,7 @@ import com.nflg.wms.admin.pojo.request.UpdateItemNumRequest;
|
||||||
import com.nflg.wms.admin.repository.InMaterialScanRecordRespository;
|
import com.nflg.wms.admin.repository.InMaterialScanRecordRespository;
|
||||||
import com.nflg.wms.admin.repository.InventoryForOutRepository;
|
import com.nflg.wms.admin.repository.InventoryForOutRepository;
|
||||||
import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
|
import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
|
||||||
|
import com.nflg.wms.admin.repository.TransferFactoryNoScanRecordRespository;
|
||||||
import com.nflg.wms.admin.service.BasdeSerialNumberControllerService;
|
import com.nflg.wms.admin.service.BasdeSerialNumberControllerService;
|
||||||
import com.nflg.wms.admin.service.NoScanningBaseControllerService;
|
import com.nflg.wms.admin.service.NoScanningBaseControllerService;
|
||||||
import com.nflg.wms.admin.service.SapService;
|
import com.nflg.wms.admin.service.SapService;
|
||||||
|
|
@ -27,6 +28,7 @@ import com.nflg.wms.common.pojo.ApiResult;
|
||||||
import com.nflg.wms.common.pojo.PageData;
|
import com.nflg.wms.common.pojo.PageData;
|
||||||
import com.nflg.wms.common.pojo.document.InMaterialScanRecord;
|
import com.nflg.wms.common.pojo.document.InMaterialScanRecord;
|
||||||
import com.nflg.wms.common.pojo.document.OutMaterialScanRecord;
|
import com.nflg.wms.common.pojo.document.OutMaterialScanRecord;
|
||||||
|
import com.nflg.wms.common.pojo.document.TransferFactoryNoScanRecord;
|
||||||
import com.nflg.wms.common.pojo.dto.*;
|
import com.nflg.wms.common.pojo.dto.*;
|
||||||
import com.nflg.wms.common.pojo.qo.*;
|
import com.nflg.wms.common.pojo.qo.*;
|
||||||
import com.nflg.wms.common.pojo.vo.*;
|
import com.nflg.wms.common.pojo.vo.*;
|
||||||
|
|
@ -115,15 +117,17 @@ public class TransferFactoryController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private NoScanningBaseControllerService noScanningBaseControllerService;
|
private NoScanningBaseControllerService noScanningBaseControllerService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TransferFactoryNoScanRecordRespository transferFactoryNoScanRecordRespository;;
|
||||||
/**
|
/**
|
||||||
* 查询SAP领料订单数据
|
* 查询SAP领料订单数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("searchSAP")
|
@PostMapping("searchSAP")
|
||||||
public ApiResult<PageData<TransferOrderDTO>> searchSAP0(@Valid @RequestBody TransferOrderQO request) {
|
public ApiResult<PageData<TransferOrderDTO>> searchSAP0(@Valid @RequestBody TransferOrderQO request) {
|
||||||
List<TransferOrderDTO> datas = sapService.zwm3a16(request);
|
List<TransferOrderDTO> datas = sapService.zwm3a16(request);
|
||||||
if (CollectionUtil.isNotEmpty(datas)){
|
if (CollectionUtil.isNotEmpty(datas)) {
|
||||||
datas.forEach(dto -> {
|
datas.forEach(dto -> {
|
||||||
dto.setLockedNum(transferFactoryItemService.getLockedNum(dto.getAufnr(),dto.getMatnr()));
|
dto.setLockedNum(transferFactoryItemService.getLockedNum(dto.getAufnr(), dto.getMatnr()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return ApiResult.success(PageUtil.Page(datas, request.getPage(), request.getPageSize()));
|
return ApiResult.success(PageUtil.Page(datas, request.getPage(), request.getPageSize()));
|
||||||
|
|
@ -660,6 +664,28 @@ public class TransferFactoryController extends BaseController {
|
||||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||||
).toList()
|
).toList()
|
||||||
);
|
);
|
||||||
|
if (!Objects.isNull(request) && CollectionUtil.isNotEmpty(request.getItems())) {
|
||||||
|
List<TransferFactoryNoScanRecord> temRecords = new ArrayList<>();
|
||||||
|
request.getItems().forEach(item -> {
|
||||||
|
if (CollectionUtil.isNotEmpty(item.getDatas())) {
|
||||||
|
item.getDatas().forEach(data -> {
|
||||||
|
temRecords.add(new TransferFactoryNoScanRecord()
|
||||||
|
.setId(request.getId())
|
||||||
|
.setItemId(item.getOrderItemId())
|
||||||
|
.setNum(data.getNum())
|
||||||
|
.setBatchNo(data.getBatchNo())
|
||||||
|
.setSerialNo(data.getSerialNo())
|
||||||
|
.setBinNo(data.getBinNo())
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} });
|
||||||
|
if(CollectionUtil.isNotEmpty(temRecords))
|
||||||
|
{
|
||||||
|
transferFactoryNoScanRecordRespository.saveAll(temRecords);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -759,7 +785,51 @@ public class TransferFactoryController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("pda/getTicketForIn")
|
@GetMapping("pda/getTicketForIn")
|
||||||
public ApiResult<List<TransferFactoryTicketVO>> getTicketForOut(@Valid @RequestParam @NotBlank String no) {
|
public ApiResult<List<TransferFactoryTicketVO>> getTicketForOut(@Valid @RequestParam @NotBlank String no) {
|
||||||
return ApiResult.success(transferFactoryTicketService.getVOByOrderNo(no));
|
List<TransferFactoryTicketVO> vos=transferFactoryTicketService.getVOByOrderNo(no);
|
||||||
|
if(CollectionUtil.isNotEmpty(vos))
|
||||||
|
{
|
||||||
|
vos.forEach(p -> {
|
||||||
|
List<NoScanningItemQO> items = new ArrayList<>();
|
||||||
|
List<WmsTransferFactoryItem> wmsItems=transferFactoryItemService.lambdaQuery()
|
||||||
|
.eq(WmsTransferFactoryItem::getOrderId, p.getId())
|
||||||
|
.list();
|
||||||
|
if(CollectionUtil.isNotEmpty(wmsItems))
|
||||||
|
{
|
||||||
|
wmsItems.forEach(wmsItem -> {
|
||||||
|
List<NoScanningItemDataQO> dataQOS=new ArrayList<>();
|
||||||
|
List<TransferFactoryNoScanRecord> mongoRecords=
|
||||||
|
transferFactoryNoScanRecordRespository.getTransferFactoryNoScanRecordBy(
|
||||||
|
p.getId(),
|
||||||
|
wmsItem.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(mongoRecords))
|
||||||
|
{
|
||||||
|
mongoRecords.forEach(mongoRecord -> {
|
||||||
|
dataQOS.add(new NoScanningItemDataQO()
|
||||||
|
.setBinNo(mongoRecord.getBinNo())
|
||||||
|
.setNum(mongoRecord.getNum())
|
||||||
|
.setSerialNo(mongoRecord.getSerialNo())
|
||||||
|
.setBatchNo(mongoRecord.getBatchNo())
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
items.add(new NoScanningItemQO()
|
||||||
|
.setOrderItemId(wmsItem.getId())
|
||||||
|
.setWarehouseNo(p.getUmlgo())
|
||||||
|
.setMaterialNo(wmsItem.getMatnr())
|
||||||
|
.setDatas(dataQOS)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NoScanningQO qo = new NoScanningQO()
|
||||||
|
.setId(p.getId())
|
||||||
|
.setNo(p.getNo())
|
||||||
|
.setItems(items);
|
||||||
|
p.noScannings.add(qo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return ApiResult.success(vos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.nflg.wms.admin.repository;
|
||||||
|
|
||||||
|
import com.nflg.wms.common.pojo.document.TransferFactoryNoScanRecord;
|
||||||
|
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface TransferFactoryNoScanRecordRespository
|
||||||
|
extends MongoRepository<TransferFactoryNoScanRecord, String> {
|
||||||
|
List<TransferFactoryNoScanRecord> getTransferFactoryNoScanRecordBy(Long id, Long itemId);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.nflg.wms.common.pojo.document;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.data.mongodb.core.mapping.Document;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Document(collection = "TransferFactoryNoScanRecord")
|
||||||
|
public class TransferFactoryNoScanRecord {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转储单ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转储单项目Id
|
||||||
|
*/
|
||||||
|
private Long ItemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次号
|
||||||
|
*/
|
||||||
|
private String batchNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号
|
||||||
|
*/
|
||||||
|
private String serialNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库位
|
||||||
|
*/
|
||||||
|
private String binNo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class NoScanningItemDataQO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次号
|
||||||
|
*/
|
||||||
|
private String batchNo;
|
||||||
|
|
||||||
|
public String getBatchNo(){
|
||||||
|
if (StrUtil.isBlank(batchNo)){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return batchNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号
|
||||||
|
*/
|
||||||
|
private String serialNo;
|
||||||
|
|
||||||
|
public String getSerialNo(){
|
||||||
|
if (StrUtil.isBlank(serialNo)){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return serialNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库位
|
||||||
|
*/
|
||||||
|
private String binNo;
|
||||||
|
|
||||||
|
public String getBinNo(){
|
||||||
|
if (StrUtil.isBlank(binNo)){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return binNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class NoScanningItemQO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单项ID
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private Long orderItemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料编号
|
||||||
|
*/
|
||||||
|
@NotBlank
|
||||||
|
private String materialNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存地点编号
|
||||||
|
*/
|
||||||
|
@NotBlank
|
||||||
|
private String warehouseNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细列表
|
||||||
|
*/
|
||||||
|
@Valid
|
||||||
|
@NotEmpty
|
||||||
|
private List<NoScanningItemDataQO> datas;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class NoScanningQO {
|
||||||
|
/**
|
||||||
|
* 订单id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号
|
||||||
|
*/
|
||||||
|
private String no;
|
||||||
|
|
||||||
|
@Valid
|
||||||
|
@NotEmpty
|
||||||
|
private List<NoScanningItemQO> items;
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
package com.nflg.wms.common.pojo.vo;
|
package com.nflg.wms.common.pojo.vo;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.nflg.wms.common.pojo.document.TransferFactoryNoScanRecord;
|
||||||
|
import com.nflg.wms.common.pojo.qo.NoScanningQO;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TransferFactoryTicketVO {
|
public class TransferFactoryTicketVO {
|
||||||
|
|
@ -133,4 +136,10 @@ public class TransferFactoryTicketVO {
|
||||||
* 审核时间
|
* 审核时间
|
||||||
*/
|
*/
|
||||||
public LocalDateTime auditTime;
|
public LocalDateTime auditTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未扫描的物料凭证
|
||||||
|
*/
|
||||||
|
public List<NoScanningQO> noScannings;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue