Compare commits
8 Commits
969c5eb8df
...
7b0734bb32
| Author | SHA1 | Date |
|---|---|---|
|
|
7b0734bb32 | |
|
|
b606368669 | |
|
|
534451400f | |
|
|
9b4e5d62f4 | |
|
|
dee8259e81 | |
|
|
9be20e6a35 | |
|
|
df06e278f1 | |
|
|
a194ebc294 |
|
|
@ -35,6 +35,7 @@ import java.time.LocalDateTime;
|
|||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 零部件出库单
|
||||
|
|
@ -113,6 +114,39 @@ public class ComponentOutboundController {
|
|||
return ApiResult.success(vos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库单冲销
|
||||
*
|
||||
* @param request 确认出库单的参数对象
|
||||
*/
|
||||
@PostMapping("reverse")
|
||||
public ApiResult<Void> reverse(@Valid @RequestBody PackingOutBoundReverseQO request) {
|
||||
// 通过出库单ID获取到出库单
|
||||
WmsComponentOutbound outbound = wmsComponentOutboundService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(outbound)).throwMessage("出库单不存在");
|
||||
VUtil.trueThrowBusinessError(outbound.getIsReverse()).throwMessage("此出库单已经被冲销,不可以二次冲销");
|
||||
List<WmsComponentOutboundItem> outboundItems = wmsComponentOutboundItemService.lambdaQuery()
|
||||
.eq(WmsComponentOutboundItem::getOutboundId, request.getId())
|
||||
.list();
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(outboundItems)).throwMessage("无有效的出库单明细项");
|
||||
|
||||
// 组装库存信息
|
||||
List<InventoryDTO> inventoryDTOS = new ArrayList<>();
|
||||
for (WmsComponentOutboundItem item : outboundItems) {
|
||||
List<WmsComponentOutboundScanCodes> codes = wmsComponentOutboundScanCodesService.findByOutboundItemId(item.getId());
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(codes)).throwMessage("无有效的扫码记录");
|
||||
for (WmsComponentOutboundScanCodes code : codes) {
|
||||
setInventoryDTO(inventoryDTOS, item.getIdnrk(), outbound.getFactoryNo(), item.getLgort(), code.getBatchNumber(), code.getCodeNum());
|
||||
}
|
||||
}
|
||||
// 组装SAP的信息
|
||||
ZWM3A20DTO zwm3a20DTO = new ZWM3A20DTO()
|
||||
.setIType("B")
|
||||
.setIvDelivery(outbound.getVbelv());
|
||||
componentOutboundControllerService.reverse(outbound.getId(), outbound.getPackingId(), inventoryDTOS, zwm3a20DTO);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认出库单
|
||||
*
|
||||
|
|
@ -126,16 +160,36 @@ public class ComponentOutboundController {
|
|||
VUtil.trueThrowBusinessError(Objects.isNull(packing)).throwMessage("此装箱单不存在");
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(request.getItems())).throwMessage("无发货详情信息");
|
||||
|
||||
List<Long> packingItemId = request.getItems()
|
||||
.stream()
|
||||
.map(ComponentOutboundItemInputQO::getPackingItemId)
|
||||
.toList();
|
||||
|
||||
List<WmsComponentPackingItem> packingItems = wmsComponentPackingItemService
|
||||
.lambdaQuery()
|
||||
.in(WmsComponentPackingItem::getId, packingItemId)
|
||||
.eq(WmsComponentPackingItem::getPackingId, packing.getId())
|
||||
.list();
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(packingItems)).throwMessage("无法找到有效的装箱单详情");
|
||||
//判断是否存在了相同的交货单了
|
||||
WmsComponentOutbound outboundSelect = wmsComponentOutboundService.lambdaQuery()
|
||||
.eq(WmsComponentOutbound::getVbelv, packing.getVbelv())
|
||||
.eq(WmsComponentOutbound::getIsReverse, false)
|
||||
.one();
|
||||
VUtil.trueThrowBusinessError(Objects.nonNull(outboundSelect))
|
||||
.throwMessage("交货单已出库,单号为【" + outboundSelect.getOutboundNo() + "】");
|
||||
//判断数量是否一致,且已经存在了相同的收货单了
|
||||
for (WmsComponentPackingItem item : packingItems) {
|
||||
List<ComponentOutboundItemInputQO> items = request.getItems()
|
||||
.stream()
|
||||
.filter(d -> d.getPackingItemId().equals(item.getId()))
|
||||
.toList();
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(items))
|
||||
.throwMessage("物料【" + item.getIdnrk() + "】的实际出库数量为0,小于了出库数量【" + item.getMenge() + "】");
|
||||
|
||||
BigDecimal totalCodeNum = request.getItems().stream()
|
||||
.flatMap(i -> i.getScanCodes() != null ? i.getScanCodes().stream() : Stream.empty())
|
||||
.map(ScanCodeQO::getCodeNum)
|
||||
.filter(Objects::nonNull)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
VUtil.trueThrowBusinessError(item.getMenge().subtract(totalCodeNum).compareTo(BigDecimal.ZERO) != 0)
|
||||
.throwMessage("物料【" + item.getIdnrk() + "】的实际出库数量为【" + totalCodeNum + "】,小于了出库数量【" + item.getMenge() + "】");
|
||||
}
|
||||
|
||||
WmsComponentOutbound outbound = setWmsComponentOutbound(packing);
|
||||
List<WmsComponentOutboundItem> outboundItems = new ArrayList<>();
|
||||
List<WmsComponentOutboundScanCodes> outboundScanCodes = new ArrayList<>();
|
||||
|
|
@ -156,19 +210,15 @@ public class ComponentOutboundController {
|
|||
//处理条码,先根据批次号、序列号进行一次数量汇总
|
||||
|
||||
if (CollectionUtil.isNotEmpty(item.getScanCodes())) {
|
||||
List<ScanCodeQO> scanCodesGroup=new ArrayList<>();
|
||||
for (ScanCodeQO code : item.getScanCodes())
|
||||
{
|
||||
ScanCodeQO codeItem=scanCodesGroup.stream().filter(c->c.getBatchNumber().equals(code.getBatchNumber())
|
||||
List<ScanCodeQO> scanCodesGroup = new ArrayList<>();
|
||||
for (ScanCodeQO code : item.getScanCodes()) {
|
||||
ScanCodeQO codeItem = scanCodesGroup.stream().filter(c -> c.getBatchNumber().equals(code.getBatchNumber())
|
||||
&& c.getSerialNumber().equals(code.getSerialNumber())
|
||||
).findFirst().orElse(null);
|
||||
|
||||
if(Objects.isNull(codeItem))
|
||||
{
|
||||
if (Objects.isNull(codeItem)) {
|
||||
scanCodesGroup.add(code);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
codeItem.setCodeNum(codeItem.getCodeNum().add(code.getCodeNum()));
|
||||
}
|
||||
}
|
||||
|
|
@ -210,14 +260,12 @@ public class ComponentOutboundController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
for (ScanCodeQO code : scanCodesGroup) {
|
||||
// VUtil.trueThrowBusinessError(codeIds.contains(code.getCodeId())).throwMessage("物料[" + outboundItem.getIdnrk() + "]的条码[" + code.getCodeId() + "]被重复使用");
|
||||
// codeIds.add(code.getCodeId());
|
||||
// 组装条码信息
|
||||
WmsComponentOutboundScanCodes scanCodes = new WmsComponentOutboundScanCodes();
|
||||
scanCodes.setOutboundItemId(outboundItem.getId())
|
||||
.setCodeId(code.getCodeId())
|
||||
.setOutboundId(outbound.getId())
|
||||
.setSerialNumbers(code.getSerialNumber())
|
||||
.setCodeNum(code.getCodeNum())
|
||||
.setBatchNumber(code.getBatchNumber())
|
||||
|
|
@ -226,17 +274,10 @@ public class ComponentOutboundController {
|
|||
//组装下库存信息
|
||||
setInventoryDTO(inventories, outboundItem.getIdnrk(),
|
||||
packing.getFactoryNo(), outboundItem.getLgort(), code.getBatchNumber(), code.getCodeNum());
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
setInventoryDTO(inventories, outboundItem.getIdnrk(), packing.getFactoryNo(), outboundItem.getLgort(), "", outboundItem.getOutQty());
|
||||
set3A20Item("", outboundItem, outboundItem.getOutQty(), zwm3a20DTO);
|
||||
}
|
||||
}
|
||||
// 判断下当前的条码是否有已经使用过得
|
||||
// List<WmsComponentOutboundScanCodes> existScanCodes = wmsComponentOutboundScanCodesService.findByCodeIdIn(codeIds);
|
||||
// VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(existScanCodes)).throwMessage("存在已经使用过的条码");
|
||||
componentOutboundControllerService.confirmPda(outbound, outboundItems, outboundScanCodes, zwm3a20DTO, inventories);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
|
@ -270,6 +311,7 @@ public class ComponentOutboundController {
|
|||
.setPackingId(packing.getId())
|
||||
.setCreateName(UserUtil.getUserName())
|
||||
.setCreateId(UserUtil.getUserId())
|
||||
.setIsReverse(false)
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
return outbound;
|
||||
}
|
||||
|
|
@ -308,6 +350,9 @@ public class ComponentOutboundController {
|
|||
return outboundItem;
|
||||
}
|
||||
|
||||
/*
|
||||
组装库存信息
|
||||
*/
|
||||
private void setInventoryDTO(List<InventoryDTO> inventories, String materialNo,
|
||||
String factoryNo, String warehouseNo, String batchNumber, BigDecimal outQty
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -96,6 +96,14 @@ public class ComponentPackingController {
|
|||
*/
|
||||
@PostMapping("getorders")
|
||||
public ApiResult<ZWM3A19DTO> getComponentOrders(@Valid @RequestBody ComponentOrderQO request) {
|
||||
// 判断交货单号是否已经存在了
|
||||
WmsComponentPacking packing = wmscomponentPackingService.lambdaQuery()
|
||||
.eq(WmsComponentPacking::getVbelv, request.getVbelv())
|
||||
.eq(WmsComponentPacking::getIsCompleted, 2)
|
||||
.one();
|
||||
|
||||
VUtil.trueThrowBusinessError(Objects.nonNull(packing))
|
||||
.throwMessage("已存在相同的交货单,单号为【" + packing.getNo() + "】,状态为【" + (packing.getIsCompleted() == 0 ? "未出库" : "已出库") + "】");
|
||||
ZWM3A19DTO result = sapService.zwm3a19(request.getVbelv(), request.getWerks());
|
||||
VUtil.trueThrowBusinessError(StrUtil.isBlank(result.getHeadDTO().getWbstk())
|
||||
|| result.getHeadDTO().getWbstk().equalsIgnoreCase("C"))
|
||||
|
|
@ -137,7 +145,7 @@ public class ComponentPackingController {
|
|||
public ApiResult<Void> deletePacking(@Valid @RequestBody List<Long> ids) {
|
||||
//首先判断是否存在已完成的单据
|
||||
List<WmsComponentPacking> packingList = wmscomponentPackingService.lambdaQuery()
|
||||
.eq(WmsComponentPacking::getIsCompleted, 2)
|
||||
.ne(WmsComponentPacking::getIsCompleted, 0)
|
||||
.in(WmsComponentPacking::getId, ids)
|
||||
.list();
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(packingList)).throwMessage("存在已完成的装车单,请勿删除");
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class InventoryController extends BaseController {
|
|||
@GetMapping("check/getTaskItems")
|
||||
public ApiResult<List<InventoryCheckTaskItemVO>> getTaskItems(@Valid @RequestParam(required = false) Long id) {
|
||||
List<WmsInventoryCheckTaskItem> taskItems = Objects.isNull(id) ? Collections.emptyList() : inventoryCheckTaskItemService.lambdaQuery().eq(WmsInventoryCheckTaskItem::getTaskId, id).list();
|
||||
List<WarehouseVO> warehouseVOS = warehouseService.getEnableList(null);
|
||||
List<WarehouseSimpleVO> warehouseVOS = warehouseService.getEnableList(null);
|
||||
List<InventoryCheckTaskItemVO> vos = new ArrayList<>();
|
||||
warehouseVOS.forEach(warehouseVO -> {
|
||||
WmsInventoryCheckTaskItem item = taskItems.stream().filter(taskItem -> Objects.equals(taskItem.getWarehouseId(), warehouseVO.getId())).findFirst().orElse(null);
|
||||
|
|
@ -107,8 +107,8 @@ public class InventoryController extends BaseController {
|
|||
.setChargeUserId(Objects.isNull(item) ? null : item.getChargeUserId())
|
||||
.setChargeUserName(Objects.isNull(item) ? "" : item.getChargeUserName())
|
||||
.setAddress(warehouseVO.getAddress())
|
||||
.setUserName(warehouseVO.getUserName())
|
||||
.setPhone(warehouseVO.getPhone())
|
||||
// .setUserName(warehouseVO.getUserName())
|
||||
// .setPhone(warehouseVO.getPhone())
|
||||
);
|
||||
});
|
||||
return ApiResult.success(vos);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class OutPurchaseController extends BaseController {
|
|||
public ApiResult<ZWM3A05VO> searchSAP(@Valid @RequestBody @NotNull zwm3A05QO request) {
|
||||
ZWM3A05VO result = sapService.zwm3A05(request);
|
||||
result.getItems().parallelStream().forEach(it -> {
|
||||
it.setBinNos(binService.getBinNos(it.getMatnr(), it.getWerks(), it.getLgort()));
|
||||
it.setBinNos(binService.getBinNos(it.getMatnr(), result.getWerks(), it.getLgort()));
|
||||
});
|
||||
return ApiResult.success(result);
|
||||
}
|
||||
|
|
@ -107,14 +107,15 @@ public class OutPurchaseController extends BaseController {
|
|||
item.setId(IdUtil.getSnowflakeNextId());
|
||||
item.setOrderId(order.getId());
|
||||
item.setNum(BigDecimal.ZERO);
|
||||
item.setWerks(request.getWerks());
|
||||
if (CollectionUtil.isNotEmpty(it.getQrCodes())) {
|
||||
it.getQrCodes().forEach(qrCode -> {
|
||||
MaterialQRCodeContentDTO dto = NoUtil.getMaterialQRCodeContent(qrCode);
|
||||
MaterialQRCodeContentDTO dto = NoUtil.getMaterialQRCodeContent(qrCode.getContent());
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(dto.getMaterialNo(), it.getMatnr()))
|
||||
.throwMessage("物料" + it.getMatnr() + "与二维码不匹配");
|
||||
VUtil.trueThrowBusinessError(!check(dto, it.getCharg(), it.getSernrs()))
|
||||
.throwMessage("物料" + it.getMatnr() + "包含不符合批次号和序列号的扫码记录");
|
||||
item.setNum(item.getNum().add(dto.getNum()));
|
||||
item.setNum(item.getNum().add(qrCode.getNum()));
|
||||
records.add(new OutMaterialScanRecord()
|
||||
.setSource(6)
|
||||
.setSourceId(order.getId())
|
||||
|
|
@ -122,7 +123,7 @@ public class OutPurchaseController extends BaseController {
|
|||
.setTicketId(order.getId())
|
||||
.setTicketItemId(item.getId())
|
||||
.setMaterialNo(dto.getMaterialNo())
|
||||
.setContent(qrCode)
|
||||
.setContent(qrCode.getContent())
|
||||
.setBatchNo(dto.getBatchNo())
|
||||
.setSerialNo(dto.getSerialNo())
|
||||
.setUniqNo(dto.getUniqNo())
|
||||
|
|
@ -137,10 +138,10 @@ public class OutPurchaseController extends BaseController {
|
|||
);
|
||||
});
|
||||
}
|
||||
VUtil.trueThrowBusinessError(it.getNum().compareTo(item.getTemng()) > 0)
|
||||
.throwMessage("物料" + it.getMatnr() + "的扫码数量大于退货数量");
|
||||
VUtil.trueThrowBusinessError(item.getNum().compareTo(it.getNum()) != 0)
|
||||
.throwMessage("物料" + it.getMatnr() + "的扫码数量不一致");
|
||||
// VUtil.trueThrowBusinessError(it.getNum().compareTo(item.getTemng()) > 0)
|
||||
// .throwMessage("物料" + it.getMatnr() + "的扫码数量大于退货数量");
|
||||
// VUtil.trueThrowBusinessError(item.getNum().compareTo(it.getNum()) != 0)
|
||||
// .throwMessage("物料" + it.getMatnr() + "的扫码数量不一致");
|
||||
items.add(item);
|
||||
if (item.getNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||
input1.add(new ZWM3A06Input1DTO()
|
||||
|
|
@ -148,10 +149,10 @@ public class OutPurchaseController extends BaseController {
|
|||
.setRetpo(it.getRetpo())
|
||||
.setMatnr(it.getMatnr())
|
||||
.setMaktx(it.getMaktx())
|
||||
.setErfmg(it.getNum())
|
||||
.setErfmg(item.getNum())
|
||||
.setMeins(it.getMeins())
|
||||
.setCharg(it.getCharg())
|
||||
.setWerks(it.getWerks())
|
||||
.setWerks(item.getWerks())
|
||||
.setLgort(it.getLgort())
|
||||
.setLfbja(it.getLfbja())
|
||||
.setLfbnr(it.getLfbnr())
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.nflg.wms.common.pojo.qo.EnableQO;
|
|||
import com.nflg.wms.common.pojo.qo.WarehouseAddQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseUpdateQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.repository.entity.DictionaryItem;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
|
|
@ -118,7 +119,7 @@ public class WarehouseController extends BaseController {
|
|||
* @param factoryNo 工厂编号
|
||||
*/
|
||||
@GetMapping("getEnableList")
|
||||
public ApiResult<List<WarehouseVO>> getEnableList(@Valid @RequestParam(required = false) String factoryNo) {
|
||||
public ApiResult<List<WarehouseSimpleVO>> getEnableList(@Valid @RequestParam(required = false) String factoryNo) {
|
||||
return ApiResult.success(warehouseControllerService.getEnableList(factoryNo));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ public class WmsComponentOutboundScanCodes {
|
|||
@Id
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 出库单ID
|
||||
*/
|
||||
private Long outboundId;
|
||||
|
||||
/***
|
||||
* 出库单的单行ID号
|
||||
*
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ import java.util.List;
|
|||
@Repository
|
||||
public interface WmsComponentOutboundScanCodesRepository extends MongoRepository<WmsComponentOutboundScanCodes, String> {
|
||||
List<WmsComponentOutboundScanCodes> findByOutboundItemId(Long outboundItemId);
|
||||
|
||||
List<WmsComponentOutboundScanCodes> findByoutboundId(Long outboundId);
|
||||
|
||||
List<WmsComponentOutboundScanCodes> findByCodeIdIn(List<String> attr0);
|
||||
|
||||
}
|
||||
|
|
@ -10,7 +10,10 @@ import com.nflg.wms.common.pojo.dto.ZWM3A20DTO;
|
|||
import com.nflg.wms.common.pojo.qo.ComponentOutboundInputQO;
|
||||
import com.nflg.wms.common.pojo.qo.ComponentOutboundItemInputQO;
|
||||
import com.nflg.wms.common.pojo.qo.ComponentOutboundQO;
|
||||
import com.nflg.wms.common.pojo.qo.PackingOutBoundReverseQO;
|
||||
import com.nflg.wms.common.pojo.vo.ComponentOutboundVO;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.*;
|
||||
import com.nflg.wms.repository.service.*;
|
||||
|
|
@ -19,6 +22,7 @@ import jakarta.validation.Valid;
|
|||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -82,4 +86,36 @@ public class ComponentOutboundControllerService {
|
|||
wmsComponentOutboundScanCodesService.insert(outboundScanCodes);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void reverse(Long outboundId, Long packingId, List<InventoryDTO> inventories, ZWM3A20DTO zwm3a20DTO) {
|
||||
//修改出库单的冲销状态为true
|
||||
wmsComponentOutboundService.lambdaUpdate()
|
||||
.set(WmsComponentOutbound::getIsReverse, true)
|
||||
.set(WmsComponentOutbound::getModifyId, UserUtil.getUserId())
|
||||
.set(WmsComponentOutbound::getModifyName, UserUtil.getUserName())
|
||||
.set(WmsComponentOutbound::getModifyTime, LocalDateTime.now())
|
||||
.eq(WmsComponentOutbound::getId, outboundId)
|
||||
.update();
|
||||
// 修改包装单的冲销状态为true
|
||||
wmscomponentPackingService.lambdaUpdate()
|
||||
.set(WmsComponentPacking::getIsCompleted, 1)
|
||||
.set(WmsComponentPacking::getModifyId, UserUtil.getUserId())
|
||||
.set(WmsComponentPacking::getModifyName, UserUtil.getUserName())
|
||||
.set(WmsComponentPacking::getModifyTime, LocalDateTime.now())
|
||||
.eq(WmsComponentPacking::getId, packingId)
|
||||
.update();
|
||||
//修改库存信息
|
||||
if (CollectionUtil.isNotEmpty(inventories)) {
|
||||
inventoryService.in(inventories);
|
||||
}
|
||||
//SAP冲销
|
||||
Pair<String, String> result = sapService.zwm3a20(zwm3a20DTO);
|
||||
wmsComponentOutboundService.lambdaUpdate()
|
||||
.set(WmsComponentOutbound::getMaterialDoc, result.getKey())
|
||||
.set(WmsComponentOutbound::getMaterialDocYear, result.getValue())
|
||||
.eq(WmsComponentOutbound::getId, outboundId)
|
||||
.update();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,10 @@ public class SapService {
|
|||
JCoTable ot1 = function.getTableParameterList().getTable("OUTPUT1");
|
||||
VUtil.trueThrowBusinessError(ot1.getNumRows() == 0).throwMessage("没有订单数据");
|
||||
ot1.setRow(0);
|
||||
ZWM3A05VO vo = new ZWM3A05VO().setEbeln(ot1.getString("EBELN")).setLifnr(ot1.getString("LIFNR"));
|
||||
ZWM3A05VO vo = new ZWM3A05VO()
|
||||
.setEbeln(ot1.getString("EBELN"))
|
||||
.setLifnr(ot1.getString("LIFNR"))
|
||||
.setWerks(ot1.getString("WERKS"));
|
||||
vo.setItems(JCoUtil.toBeanList(ot1, ZWM3A05ItemVO.class));
|
||||
|
||||
JCoTable ot2 = function.getTableParameterList().getTable("OUTPUT2");
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.nflg.wms.common.pojo.qo.EnableQO;
|
|||
import com.nflg.wms.common.pojo.qo.WarehouseAddQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseUpdateQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import com.nflg.wms.common.util.EecExcelUtil;
|
||||
|
|
@ -217,7 +218,7 @@ public class WarehouseControllerService {
|
|||
.writeTo(response.getOutputStream());
|
||||
}
|
||||
|
||||
public List<WarehouseVO> getEnableList(String factoryNo) {
|
||||
public List<WarehouseSimpleVO> getEnableList(String factoryNo) {
|
||||
return warehouseService.getEnableList(factoryNo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.nflg.wms.admin.util;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.json.JsonMapper;
|
||||
import com.nflg.wms.common.util.BeanUtil;
|
||||
import com.sap.conn.jco.*;
|
||||
|
||||
|
|
@ -11,8 +13,10 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class JCoUtil {
|
||||
|
||||
private static final ObjectMapper MAPPER = new ObjectMapper()
|
||||
.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
|
||||
private static final ObjectMapper MAPPER = JsonMapper.builder()
|
||||
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)
|
||||
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
||||
.build();
|
||||
|
||||
/**
|
||||
* 将 JCoTable 转换为 Java Bean 列表
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.common.pojo.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.nflg.wms.common.util.BomUtil;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import lombok.Data;
|
||||
|
|
@ -118,6 +119,7 @@ public class DepartmentMaterialReturnSlipDTO {
|
|||
return Objects.isNull(num) ? bdmng : num;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
private String key;
|
||||
|
||||
public String getKey() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PackingOutBoundReverseQO {
|
||||
// 出库单ID
|
||||
private Long id;
|
||||
}
|
||||
|
|
@ -1,29 +1,14 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class QRCodeQO {
|
||||
public class QRCodeQO extends QRCodeQO1 {
|
||||
|
||||
/**
|
||||
* 项id
|
||||
*/
|
||||
@NotNull
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 二维码内容
|
||||
*/
|
||||
@NotBlank
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull
|
||||
private BigDecimal num;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class QRCodeQO1 {
|
||||
|
||||
/**
|
||||
* 二维码内容
|
||||
*/
|
||||
@NotBlank
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull
|
||||
private BigDecimal num;
|
||||
}
|
||||
|
|
@ -150,4 +150,9 @@ public class ComponentOutboundVO {
|
|||
private String modifyName;
|
||||
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 是否冲销
|
||||
*/
|
||||
private Boolean isReverse;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ public class ComponentPackingVO {
|
|||
private String wbstk;
|
||||
|
||||
/**
|
||||
* 0 未出库;1 完成出库
|
||||
* 0 未出库;1 对冲;2 出库完成
|
||||
*/
|
||||
private Short isCompleted;
|
||||
|
||||
|
|
@ -136,4 +136,5 @@ public class ComponentPackingVO {
|
|||
* 所属工厂
|
||||
*/
|
||||
private String factoryNo;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,13 +74,13 @@ public class InventoryCheckTaskItemVO {
|
|||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
*/
|
||||
private String userName;
|
||||
// /**
|
||||
// * 责任人
|
||||
// */
|
||||
// private String userName;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
// /**
|
||||
// * 联系电话
|
||||
// */
|
||||
// private String phone;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WarehouseSimpleVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 所属工厂名称
|
||||
*/
|
||||
private String factoryName;
|
||||
|
||||
/**
|
||||
* 所在地点
|
||||
*/
|
||||
private String address;
|
||||
}
|
||||
|
|
@ -5,19 +5,7 @@ import lombok.Data;
|
|||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class WarehouseVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String name;
|
||||
public class WarehouseVO extends WarehouseSimpleVO {
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
|
|
@ -34,11 +22,6 @@ public class WarehouseVO {
|
|||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 所在地点
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
|
|
@ -83,9 +66,4 @@ public class WarehouseVO {
|
|||
* 所属工厂
|
||||
*/
|
||||
private Long factoryId;
|
||||
|
||||
/**
|
||||
* 所属工厂名称
|
||||
*/
|
||||
private String factoryName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.nflg.wms.common.pojo.qo.QRCodeQO1;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
|
|
@ -18,6 +19,10 @@ public class ZWM3A05ItemVO {
|
|||
*/
|
||||
private String ebelp;
|
||||
|
||||
public String getEbelp() {
|
||||
return StrUtil.removeAllPrefix(ebelp, "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 退货项目
|
||||
*/
|
||||
|
|
@ -74,11 +79,6 @@ public class ZWM3A05ItemVO {
|
|||
*/
|
||||
private String lgort;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
private String werks;
|
||||
|
||||
/**
|
||||
* 批次号列表
|
||||
*/
|
||||
|
|
@ -89,17 +89,17 @@ public class ZWM3A05ItemVO {
|
|||
*/
|
||||
private String binNos;
|
||||
|
||||
/**
|
||||
* 实际退货数量(扫码后计算)
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
public BigDecimal getNum() {
|
||||
return Optional.ofNullable(num).orElse(BigDecimal.ZERO);
|
||||
}
|
||||
// /**
|
||||
// * 实际退货数量(扫码后计算)
|
||||
// */
|
||||
// private BigDecimal num;
|
||||
//
|
||||
// public BigDecimal getNum() {
|
||||
// return Optional.ofNullable(num).orElse(BigDecimal.ZERO);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 二维码列表
|
||||
*/
|
||||
private List<String> qrCodes = new ArrayList<>();
|
||||
private List<QRCodeQO1> qrCodes = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ public class ZWM3A05VO {
|
|||
*/
|
||||
private String lifnr;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
private String werks;
|
||||
|
||||
@Valid
|
||||
private List<ZWM3A05ItemVO> items = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,4 +177,9 @@ public class WmsComponentOutbound implements Serializable {
|
|||
* 物料年度凭证
|
||||
*/
|
||||
private String materialDocYear;
|
||||
|
||||
/**
|
||||
* 是否冲销
|
||||
*/
|
||||
private Boolean isReverse;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.time.LocalDateTime;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
|
|
@ -160,7 +160,7 @@ public class WmsComponentPacking implements Serializable {
|
|||
private String factoryNo;
|
||||
|
||||
/**
|
||||
* 0 未出库;1 部分出库;2 出库完成
|
||||
* 0 未出库;1 对冲;2 出库完成
|
||||
*/
|
||||
private Short isCompleted;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.repository.entity.WmsWarehouse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -26,7 +27,7 @@ public interface WmsWarehouseMapper extends BaseMapper<WmsWarehouse> {
|
|||
|
||||
List<WarehouseVO> searchNonPage(@Param("request") WarehouseSearchQO request);
|
||||
|
||||
List<WarehouseVO> getEnableList(String factoryNo);
|
||||
List<WarehouseSimpleVO> getEnableList(String factoryNo);
|
||||
|
||||
List<WarehouseVO> getListByIds(List<Long> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.wms.common.pojo.qo.EnableQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.repository.entity.WmsWarehouse;
|
||||
import jakarta.validation.Valid;
|
||||
|
|
@ -37,7 +38,7 @@ public interface IWmsWarehouseService extends IService<WmsWarehouse> {
|
|||
|
||||
List<WarehouseVO> searchNonPage(@Valid WarehouseSearchQO request);
|
||||
|
||||
List<WarehouseVO> getEnableList(String factoryNo);
|
||||
List<WarehouseSimpleVO> getEnableList(String factoryNo);
|
||||
|
||||
List<WarehouseVO> getListByIds(List<Long> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.wms.common.pojo.qo.EnableQO;
|
||||
import com.nflg.wms.common.pojo.qo.WarehouseSearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseSimpleVO;
|
||||
import com.nflg.wms.common.pojo.vo.WarehouseVO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
|
|
@ -106,7 +107,7 @@ public class WmsWarehouseServiceImpl extends ServiceImpl<WmsWarehouseMapper, Wms
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<WarehouseVO> getEnableList(String factoryNo) {
|
||||
public List<WarehouseSimpleVO> getEnableList(String factoryNo) {
|
||||
return baseMapper.getEnableList(factoryNo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
select id,packing_no,
|
||||
outbound_no,matnr,name1,uname,vbeln,maktx,datum,xnum,cnum,bname,zjshz,zchep,tel_number,sernr,huodh,vbelv,
|
||||
p_name,l_bezei,l_name,g_streen,g_str_suppl2,wbstk,create_name,create_time,factory_no,create_id,
|
||||
create_name,create_time,packing_id
|
||||
create_name,create_time,packing_id,is_reverse
|
||||
from wms_component_outbound
|
||||
<where>
|
||||
<if test="request.packingNo !=null and request.packingNo !=''">
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
order by w.id desc
|
||||
</select>
|
||||
|
||||
<select id="getEnableList" resultType="com.nflg.wms.common.pojo.vo.WarehouseVO">
|
||||
<select id="getEnableList" resultType="com.nflg.wms.common.pojo.vo.WarehouseSimpleVO">
|
||||
select w.*, di.name as factory_name
|
||||
from wms_warehouse w
|
||||
left join dictionary_item di on w.factory_id = di.id
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class CodeGeneratorTest {
|
|||
)
|
||||
.strategyConfig(builder -> {
|
||||
builder
|
||||
.addInclude("wms_inventory_barcode_printing") //只生成指定表
|
||||
.addInclude("wms_component_outbound") //只生成指定表
|
||||
.entityBuilder().idType(IdType.ASSIGN_ID)
|
||||
.enableLombok()
|
||||
.enableChainModel()
|
||||
|
|
|
|||
Loading…
Reference in New Issue