操作记录添加给sap

This commit is contained in:
yf001217 2026-03-24 11:15:59 +08:00
parent f6799c44b6
commit a317719de2
16 changed files with 110 additions and 49 deletions

View File

@ -79,6 +79,9 @@ public class ComponentOutboundController extends BaseController {
@Resource @Resource
private IWmsQrCodeMasterService qrCodeMasterService; private IWmsQrCodeMasterService qrCodeMasterService;
@Resource
private IOptRecordService optRecordService;
/** /**
* 零部件的出库单列表 * 零部件的出库单列表
* @param request 零部件出库单搜索条件参数对象包含分页信息和搜索条件 * @param request 零部件出库单搜索条件参数对象包含分页信息和搜索条件
@ -149,6 +152,10 @@ public class ComponentOutboundController extends BaseController {
setInventoryInDTO(inventoryDTOS, item.getIdnrk(), outbound.getFactoryNo(), item.getLgort(), code.getBatchNo(), code.getSerialNo(), code.getNum()); setInventoryInDTO(inventoryDTOS, item.getIdnrk(), outbound.getFactoryNo(), item.getLgort(), code.getBatchNo(), code.getSerialNo(), code.getNum());
} }
} }
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(outbound.getVbelv());
optRecordService.add(optRecordDTO);
// 组装SAP的信息 // 组装SAP的信息
ZWM3A20DTO zwm3a20DTO = new ZWM3A20DTO() ZWM3A20DTO zwm3a20DTO = new ZWM3A20DTO()
.setIType("B") .setIType("B")
@ -202,6 +209,10 @@ public class ComponentOutboundController extends BaseController {
List<WmsComponentOutboundItem> outboundItems = new ArrayList<>(); List<WmsComponentOutboundItem> outboundItems = new ArrayList<>();
List<InventoryOutDTO> inventories = new ArrayList<>(); List<InventoryOutDTO> inventories = new ArrayList<>();
//List<String> codeIds = new ArrayList<>(); //List<String> codeIds = new ArrayList<>();
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(packing.getVbelv());
optRecordService.add(optRecordDTO);
ZWM3A20DTO zwm3a20DTO = new ZWM3A20DTO() ZWM3A20DTO zwm3a20DTO = new ZWM3A20DTO()
.setItSernrPatch(new ArrayList<>()) .setItSernrPatch(new ArrayList<>())
.setItem(new ArrayList<>()) .setItem(new ArrayList<>())
@ -454,6 +465,10 @@ public class ComponentOutboundController extends BaseController {
}); });
buildZwm3a20DTO(zwm3a20DTO, scanCodesGroup, item); buildZwm3a20DTO(zwm3a20DTO, scanCodesGroup, item);
}); });
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getOutboundNo());
optRecordService.add(optRecordDTO);
Pair<String, String> result = sapService.zwm3a20(zwm3a20DTO); Pair<String, String> result = sapService.zwm3a20(zwm3a20DTO);
wmsComponentOutboundService.lambdaUpdate() wmsComponentOutboundService.lambdaUpdate()
.set(WmsComponentOutbound::getMaterialDoc, result.getKey()) .set(WmsComponentOutbound::getMaterialDoc, result.getKey())

View File

@ -84,7 +84,7 @@ public class InCostCenterBackController extends BaseController {
private IWmsWarehouseService warehouseService; private IWmsWarehouseService warehouseService;
@Resource @Resource
private OptRecordController optRecordController; private IOptRecordService optRecordService;
/** /**
* 查询SAP领料订单数据 * 查询SAP领料订单数据
@ -322,6 +322,10 @@ public class InCostCenterBackController extends BaseController {
).toList() ).toList()
); );
Map<String, List<InMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(InMaterialScanRecord::getKey7)); Map<String, List<InMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(InMaterialScanRecord::getKey7));
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getNo());
optRecordService.add(optRecordDTO);
C_MaterialReturnDTO vo = sapService.zwm00_MB112(new C_MaterialReturnQO() C_MaterialReturnDTO vo = sapService.zwm00_MB112(new C_MaterialReturnQO()
.setResbRsNum(order.getRsnum()) .setResbRsNum(order.getRsnum())
.setItems(dmaps.values().stream().map(its -> { .setItems(dmaps.values().stream().map(its -> {
@ -344,10 +348,6 @@ public class InCostCenterBackController extends BaseController {
}).toList() }).toList()
) )
); );
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getNo());
optRecordController.add(optRecordDTO);
ticket.setDocYear(vo.getEMJahr()); ticket.setDocYear(vo.getEMJahr());
ticket.setMatDoc(vo.getEMblnr()); ticket.setMatDoc(vo.getEMblnr());
inCostcenterBackTicketService.save(ticket); inCostcenterBackTicketService.save(ticket);

View File

@ -84,7 +84,7 @@ public class InProduceBackController extends BaseController {
private IWmsWarehouseService warehouseService; private IWmsWarehouseService warehouseService;
@Resource @Resource
private OptRecordController optRecordController; private IOptRecordService optRecordService;
/** /**
* 查询SAP领料订单数据 * 查询SAP领料订单数据
@ -337,6 +337,10 @@ public class InProduceBackController extends BaseController {
).toList() ).toList()
); );
Map<String, List<InMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(InMaterialScanRecord::getKey7)); Map<String, List<InMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(InMaterialScanRecord::getKey7));
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getNo());
optRecordService.add(optRecordDTO);
Zwm3a11VO vo = sapService.zwm3a11(new Zwm3a11QO() Zwm3a11VO vo = sapService.zwm3a11(new Zwm3a11QO()
.setAufnr(order.getAufnr()) .setAufnr(order.getAufnr())
.setInput1(dmaps.values().stream().map(its -> { .setInput1(dmaps.values().stream().map(its -> {
@ -358,11 +362,6 @@ public class InProduceBackController extends BaseController {
.setSernr(it.getValue())).toList() .setSernr(it.getValue())).toList()
) )
); );
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getNo());
optRecordController.add(optRecordDTO);
BigDecimal totalNum = datas.stream().map(WmsInProduceBackItem::getSqsl).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal totalNum = datas.stream().map(WmsInProduceBackItem::getSqsl).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal inNum = datas.stream().map(WmsInProduceBackItem::getNum).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal inNum = datas.stream().map(WmsInProduceBackItem::getNum).reduce(BigDecimal.ZERO, BigDecimal::add);
inProduceBackService.lambdaUpdate() inProduceBackService.lambdaUpdate()

View File

@ -114,7 +114,7 @@ public class InProduceOrderController extends BaseController {
private IWmsWarehouseService warehouseService; private IWmsWarehouseService warehouseService;
@Resource @Resource
private OptRecordController optRecordController; private IOptRecordService optRecordService;
/** /**
* 从SAP查询生产订单信息 * 从SAP查询生产订单信息
@ -580,12 +580,12 @@ public class InProduceOrderController extends BaseController {
).toList() ).toList()
); );
} }
//同步入库信息到SAP
Zwm00Mb107DTO dto = sapService.zwm00_mb107(order.getOrderNo(), UserUtil.getUserName(), input1, sernrs);
OptRecordDTO optRecordDTO = new OptRecordDTO(); OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1); optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(order.getNo()); optRecordDTO.setOrderId(order.getNo());
optRecordController.add(optRecordDTO); optRecordService.add(optRecordDTO);
//同步入库信息到SAP
Zwm00Mb107DTO dto = sapService.zwm00_mb107(order.getOrderNo(), UserUtil.getUserName(), input1, sernrs);
order.setMblnr(dto.getE_MBLNR()); order.setMblnr(dto.getE_MBLNR());
order.setMjahr(dto.getE_MJAHR()); order.setMjahr(dto.getE_MJAHR());
order.setState((short) 1); order.setState((short) 1);

View File

@ -46,11 +46,6 @@ public class OptRecordController {
*/ */
@PostMapping("add") @PostMapping("add")
public void add(@Valid @RequestBody OptRecordDTO optRecordDTO){ public void add(@Valid @RequestBody OptRecordDTO optRecordDTO){
OptRecord optRecord = new OptRecord(); optRecordService.add(optRecordDTO);
BeanUtils.copyProperties(optRecordDTO, optRecord);
optRecord.setOperationTime(LocalDateTime.now());
optRecord.setOperatorId(UserUtil.getUserId());
optRecord.setOperator(UserUtil.getUserName());
optRecordService.add(optRecord);
} }
} }

View File

@ -92,7 +92,7 @@ public class OutAssistanceController extends BaseController {
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Resource @Resource
private OptRecordController optRecordController; private IOptRecordService optRecordService;
/** /**
* 查询SAP领料订单数据 * 查询SAP领料订单数据
@ -393,10 +393,7 @@ public class OutAssistanceController extends BaseController {
}); });
qrCodeMasterService.updateBarCode(qrCodeMasters); qrCodeMasterService.updateBarCode(qrCodeMasters);
submitSap(order, ticket, records, datas, qrCodeMasters); submitSap(order, ticket, records, datas, qrCodeMasters);
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(request.getNo());
optRecordController.add(optRecordDTO);
} else { } else {
inventoryForOutRepository.saveAll(request.getRecommendBatch() inventoryForOutRepository.saveAll(request.getRecommendBatch()
.stream() .stream()
@ -435,6 +432,10 @@ public class OutAssistanceController extends BaseController {
).toList() ).toList()
); );
Map<String, List<OutMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(OutMaterialScanRecord::getKey7)); Map<String, List<OutMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(OutMaterialScanRecord::getKey7));
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(order.getNo());
optRecordService.add(optRecordDTO);
SubcontractedOrderConfirmDTO dto = sapService.zwm3a04(new SubcontractedOrderConfirmQO() SubcontractedOrderConfirmDTO dto = sapService.zwm3a04(new SubcontractedOrderConfirmQO()
.setIEbeln(order.getEbeln()) .setIEbeln(order.getEbeln())
.setIItems(dmaps.values().stream().map(its -> { .setIItems(dmaps.values().stream().map(its -> {
@ -543,10 +544,6 @@ public class OutAssistanceController extends BaseController {
}); });
qrCodeMasterService.updateBarCode(qrCodeMasters); qrCodeMasterService.updateBarCode(qrCodeMasters);
submitSap(order, ticket, records, outAssistanceItemService.getList(order.getId()), qrCodeMasters); submitSap(order, ticket, records, outAssistanceItemService.getList(order.getId()), qrCodeMasters);
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getNo());
optRecordController.add(optRecordDTO);
} else { } else {
List<OutAssistanceItemVO> items = outAssistanceTicketItemService.getList(qo.getId()); List<OutAssistanceItemVO> items = outAssistanceTicketItemService.getList(qo.getId());
items.forEach(it -> { items.forEach(it -> {

View File

@ -94,6 +94,9 @@ public class OutCostCenterController extends BaseController {
@Resource @Resource
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Resource
private IOptRecordService optRecordService;
/** /**
* 查询SAP领料订单数据 * 查询SAP领料订单数据
*/ */
@ -422,6 +425,10 @@ public class OutCostCenterController extends BaseController {
).toList() ).toList()
); );
Map<String, List<OutMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(OutMaterialScanRecord::getKey7)); Map<String, List<OutMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(OutMaterialScanRecord::getKey7));
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getNo());
optRecordService.add(optRecordDTO);
C_MaterialOutboundDTO vo = sapService.ZWM00_MB115(new C_MaterialOutboundQO() C_MaterialOutboundDTO vo = sapService.ZWM00_MB115(new C_MaterialOutboundQO()
.setResbRsNum(order.getRsnum()) .setResbRsNum(order.getRsnum())
.setItems(dmaps.values().stream().map(its -> { .setItems(dmaps.values().stream().map(its -> {

View File

@ -98,7 +98,7 @@ public class OutProduceController extends BaseController {
private IWmsQrCodeMasterService qrCodeMasterService; private IWmsQrCodeMasterService qrCodeMasterService;
@Resource @Resource
private OptRecordController optRecordController; private IOptRecordService optRecordService;
/** /**
* 查询SAP领料订单数据 * 查询SAP领料订单数据
@ -557,6 +557,10 @@ public class OutProduceController extends BaseController {
).toList() ).toList()
); );
Map<String, List<OutMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(OutMaterialScanRecord::getKey7)); Map<String, List<OutMaterialScanRecord>> dmaps = records.stream().collect(Collectors.groupingBy(OutMaterialScanRecord::getKey7));
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(order.getAufnr());
optRecordService.add(optRecordDTO);
Zwm3a10VO vo = sapService.zwm3A10(new Zwm3a10QO() Zwm3a10VO vo = sapService.zwm3A10(new Zwm3a10QO()
.setAufnr(order.getAufnr()) .setAufnr(order.getAufnr())
.setType(order.getType() == 0 ? "A" : "B") .setType(order.getType() == 0 ? "A" : "B")
@ -576,11 +580,6 @@ public class OutProduceController extends BaseController {
) )
); );
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(order.getAufnr());
optRecordController.add(optRecordDTO);
outProduceTicketService.lambdaUpdate() outProduceTicketService.lambdaUpdate()
.set(WmsOutProduceTicket::getMatDoc, vo.getMat_doc()) .set(WmsOutProduceTicket::getMatDoc, vo.getMat_doc())
.set(WmsOutProduceTicket::getDocYear, vo.getDocYear()) .set(WmsOutProduceTicket::getDocYear, vo.getDocYear())

View File

@ -76,6 +76,9 @@ public class OutPurchaseController extends BaseController {
@Resource @Resource
private IWmsReturnRequestItemService returnRequestItemService; private IWmsReturnRequestItemService returnRequestItemService;
@Resource
private IOptRecordService optRecordService;
// /** // /**
// * 获取采购退库信息PDA使用 // * 获取采购退库信息PDA使用
// * @return 要退库的物料信息列表 // * @return 要退库的物料信息列表
@ -134,6 +137,7 @@ public class OutPurchaseController extends BaseController {
@Transactional @Transactional
@PostMapping("save") @PostMapping("save")
public ApiResult<Void> save(@Valid @RequestBody ZWM3A05VO request) { public ApiResult<Void> save(@Valid @RequestBody ZWM3A05VO request) {
String outPurchaseNo = serialNumberControllerService.generateSerialNumber(20);
Long orderId = IdUtil.getSnowflakeNextId(); Long orderId = IdUtil.getSnowflakeNextId();
List<WmsOutPurchaseItem> items = new ArrayList<>(); List<WmsOutPurchaseItem> items = new ArrayList<>();
List<OutMaterialScanRecord> records = new ArrayList<>(); List<OutMaterialScanRecord> records = new ArrayList<>();
@ -262,7 +266,7 @@ public class OutPurchaseController extends BaseController {
qrCodeMasterService.updateBarCode(qrCodeMasters); qrCodeMasterService.updateBarCode(qrCodeMasters);
outPurchaseService.save( outPurchaseService.save(
new WmsOutPurchase() new WmsOutPurchase()
.setNo(serialNumberControllerService.generateSerialNumber(20)) .setNo(outPurchaseNo)
.setId(orderId) .setId(orderId)
.setEbeln(request.getEbeln()) .setEbeln(request.getEbeln())
.setLifnr(request.getLifnr()) .setLifnr(request.getLifnr())
@ -312,6 +316,10 @@ public class OutPurchaseController extends BaseController {
.eq(WmsReturnRequest::getId, request.getPurchaseOrderId()) .eq(WmsReturnRequest::getId, request.getPurchaseOrderId())
.update(); .update();
} }
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(outPurchaseNo);
optRecordService.add(optRecordDTO);
Pair<String, String> result = sapService.zwm3A06(request.getEbeln(), input1, input2); Pair<String, String> result = sapService.zwm3A06(request.getEbeln(), input1, input2);
outPurchaseService.lambdaUpdate() outPurchaseService.lambdaUpdate()
.set(WmsOutPurchase::getMatDoc, result.getKey()) .set(WmsOutPurchase::getMatDoc, result.getKey())

View File

@ -29,10 +29,7 @@ import com.nflg.wms.common.exception.NflgException;
import com.nflg.wms.common.pojo.ApiResult; 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.PackageMaterialScanRecord; import com.nflg.wms.common.pojo.document.PackageMaterialScanRecord;
import com.nflg.wms.common.pojo.dto.InventoryInDTO; import com.nflg.wms.common.pojo.dto.*;
import com.nflg.wms.common.pojo.dto.PackageMaterialDTO;
import com.nflg.wms.common.pojo.dto.SAPOrderDTO;
import com.nflg.wms.common.pojo.dto.StructuralPackageMaterialQRCodeContentDTO;
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.*;
import com.nflg.wms.common.util.*; import com.nflg.wms.common.util.*;
@ -130,6 +127,9 @@ public class StructuralPackageOrderController extends BaseController {
@Resource @Resource
private IWmsInventoryService inventoryService; private IWmsInventoryService inventoryService;
@Resource
private IOptRecordService optRecordService;
/** /**
* 搜索SAP订单 * 搜索SAP订单
* @param request 请求参数 * @param request 请求参数
@ -989,6 +989,10 @@ public class StructuralPackageOrderController extends BaseController {
VUtil.trueThrowBusinessError(Objects.isNull(dto)).throwMessage("ZIM_004未查询到数据"); VUtil.trueThrowBusinessError(Objects.isNull(dto)).throwMessage("ZIM_004未查询到数据");
VUtil.trueThrowBusinessError(StrUtil.isBlank(dto.getWarehouseNo())).throwMessage("ZIM_004接口查询到仓库为空"); VUtil.trueThrowBusinessError(StrUtil.isBlank(dto.getWarehouseNo())).throwMessage("ZIM_004接口查询到仓库为空");
BigDecimal num = BigDecimal.valueOf(order.getNum()); BigDecimal num = BigDecimal.valueOf(order.getNum());
OptRecordDTO optRecordDTO1 = new OptRecordDTO();
optRecordDTO1.setOperationType((short)1);
optRecordDTO1.setOrderId(order.getOrderNo());
optRecordService.add(optRecordDTO1);
Pair<Pair<String, String>, Pair<String, String>> pair = sapService.zwm3a17(new ZWM3A17DTO() Pair<Pair<String, String>, Pair<String, String>> pair = sapService.zwm3a17(new ZWM3A17DTO()
.setEbeln(order.getExternalOrderNo()) .setEbeln(order.getExternalOrderNo())
.setUsnam(UserUtil.getUserName()) .setUsnam(UserUtil.getUserName())
@ -1012,6 +1016,10 @@ public class StructuralPackageOrderController extends BaseController {
) )
); );
if (StrUtil.equalsIgnoreCase(dto.getKzkri(), "X")) { if (StrUtil.equalsIgnoreCase(dto.getKzkri(), "X")) {
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(order.getOrderNo());
optRecordService.add(optRecordDTO);
sapService.zwm3a18(new ZWM3A18DTO() sapService.zwm3a18(new ZWM3A18DTO()
.setEbeln(order.getExternalOrderNo()) .setEbeln(order.getExternalOrderNo())
.setUsnam(UserUtil.getUserName()) .setUsnam(UserUtil.getUserName())

View File

@ -105,6 +105,9 @@ public class TransferCompanyController extends BaseController {
@Resource @Resource
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Resource
private IOptRecordService optRecordService;
/** /**
* 查询SAP订单数据 * 查询SAP订单数据
*/ */
@ -460,6 +463,10 @@ public class TransferCompanyController 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()
); );
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(order.getNo());
optRecordService.add(optRecordDTO);
ZWM00_MB116VO vo = sapService.zwm00_mb116(new ZWM00_MB116QO() ZWM00_MB116VO vo = sapService.zwm00_mb116(new ZWM00_MB116QO()
.setEbeln(order.getEbeln()) .setEbeln(order.getEbeln())
.setUsnam(UserUtil.getUserName()) .setUsnam(UserUtil.getUserName())
@ -728,6 +735,10 @@ public class TransferCompanyController extends BaseController {
).toList() ).toList()
); );
inMaterialScanRecordRespository.saveAll(records); inMaterialScanRecordRespository.saveAll(records);
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getTicketNo());
optRecordService.add(optRecordDTO);
Pair<Pair<String, String>, Pair<String, String>> vos = sapService.zwm3a17(new ZWM3A17DTO() Pair<Pair<String, String>, Pair<String, String>> vos = sapService.zwm3a17(new ZWM3A17DTO()
.setEbeln(ticket.getEbeln()) .setEbeln(ticket.getEbeln())
.setUsnam(UserUtil.getUserName()) .setUsnam(UserUtil.getUserName())

View File

@ -104,7 +104,7 @@ public class TransferFactoryController extends BaseController {
private RedissonClient redissonClient; private RedissonClient redissonClient;
@Resource @Resource
private OptRecordController optRecordController; private IOptRecordService optRecordService;
/** /**
* 查询SAP领料订单数据 * 查询SAP领料订单数据
@ -727,7 +727,7 @@ public class TransferFactoryController extends BaseController {
OptRecordDTO optRecordDTO = new OptRecordDTO(); OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1); optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(ticket.getNo()); optRecordDTO.setOrderId(ticket.getNo());
optRecordController.add(optRecordDTO); optRecordService.add(optRecordDTO);
transferFactoryTicketService.lambdaUpdate() transferFactoryTicketService.lambdaUpdate()
.set(WmsTransferFactoryTicket::getMatDoc, vo.getEMblnr()) .set(WmsTransferFactoryTicket::getMatDoc, vo.getEMblnr())
.set(WmsTransferFactoryTicket::getDocYear, vo.getEMjahr()) .set(WmsTransferFactoryTicket::getDocYear, vo.getEMjahr())

View File

@ -6,6 +6,7 @@ import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
import com.nflg.wms.common.pojo.document.OutMaterialScanRecord; import com.nflg.wms.common.pojo.document.OutMaterialScanRecord;
import com.nflg.wms.common.pojo.dto.InventoryInDTO; import com.nflg.wms.common.pojo.dto.InventoryInDTO;
import com.nflg.wms.common.pojo.dto.InventoryOutDTO; import com.nflg.wms.common.pojo.dto.InventoryOutDTO;
import com.nflg.wms.common.pojo.dto.OptRecordDTO;
import com.nflg.wms.common.pojo.dto.ZWM3A20DTO; import com.nflg.wms.common.pojo.dto.ZWM3A20DTO;
import com.nflg.wms.common.util.UserUtil; import com.nflg.wms.common.util.UserUtil;
import com.nflg.wms.repository.entity.WmsComponentOutbound; import com.nflg.wms.repository.entity.WmsComponentOutbound;
@ -46,6 +47,9 @@ public class ComponentOutboundControllerService {
@Resource @Resource
private OutMaterialScanRecordRespository outMaterialScanRecordRespository; private OutMaterialScanRecordRespository outMaterialScanRecordRespository;
@Resource
private IOptRecordService optRecordService;
@Transactional @Transactional
public void confirmPda(WmsComponentOutbound outbound, List<WmsComponentOutboundItem> outboundItems, List<OutMaterialScanRecord> records) { public void confirmPda(WmsComponentOutbound outbound, List<WmsComponentOutboundItem> outboundItems, List<OutMaterialScanRecord> records) {
confirmPda(outbound, outboundItems, records, null, null); confirmPda(outbound, outboundItems, records, null, null);
@ -63,6 +67,10 @@ public class ComponentOutboundControllerService {
} }
if (Objects.nonNull(zwm3a20DTO)) { if (Objects.nonNull(zwm3a20DTO)) {
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(outbound.getOutboundNo());
optRecordService.add(optRecordDTO);
// 处理SAP的信息并写入物料凭证和物料年度凭证信息到出口单中 // 处理SAP的信息并写入物料凭证和物料年度凭证信息到出口单中
Pair<String, String> result = sapService.zwm3a20(zwm3a20DTO); Pair<String, String> result = sapService.zwm3a20(zwm3a20DTO);
wmsComponentOutboundService.lambdaUpdate() wmsComponentOutboundService.lambdaUpdate()
@ -107,6 +115,12 @@ public class ComponentOutboundControllerService {
if (CollectionUtil.isNotEmpty(inventories)) { if (CollectionUtil.isNotEmpty(inventories)) {
inventoryService.in(inventories); inventoryService.in(inventories);
} }
//加操作记录
WmsComponentOutbound outbound = wmsComponentOutboundService.getById(outboundId);
OptRecordDTO optRecordDTO = new OptRecordDTO();
optRecordDTO.setOperationType((short)1);
optRecordDTO.setOrderId(outbound.getOutboundNo());
optRecordService.add(optRecordDTO);
//SAP冲销 //SAP冲销
Pair<String, String> result = sapService.zwm3a20(zwm3a20DTO); Pair<String, String> result = sapService.zwm3a20(zwm3a20DTO);
wmsComponentOutboundService.lambdaUpdate() wmsComponentOutboundService.lambdaUpdate()

View File

@ -6,15 +6,13 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.nflg.wms.admin.pojo.dto.QCReceiveDTO; import com.nflg.wms.admin.pojo.dto.QCReceiveDTO;
import com.nflg.wms.admin.pojo.dto.ZWM3A27ItemDTO; import com.nflg.wms.admin.pojo.dto.ZWM3A27ItemDTO;
import com.nflg.wms.common.pojo.dto.OptRecordDTO;
import com.nflg.wms.common.pojo.vo.QCTaskItemScanCodesVO; import com.nflg.wms.common.pojo.vo.QCTaskItemScanCodesVO;
import com.nflg.wms.common.pojo.vo.QCTaskItemVO; import com.nflg.wms.common.pojo.vo.QCTaskItemVO;
import com.nflg.wms.repository.entity.WmsQcReceive; import com.nflg.wms.repository.entity.WmsQcReceive;
import com.nflg.wms.repository.entity.WmsQcReceiveItem; import com.nflg.wms.repository.entity.WmsQcReceiveItem;
import com.nflg.wms.repository.entity.WmsSrmQualityInspection; import com.nflg.wms.repository.entity.WmsSrmQualityInspection;
import com.nflg.wms.repository.service.IWmsInventoryService; import com.nflg.wms.repository.service.*;
import com.nflg.wms.repository.service.IWmsQcReceiveItemService;
import com.nflg.wms.repository.service.IWmsQcReceiveService;
import com.nflg.wms.repository.service.IWmsSrmQualityInspectionService;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
@ -48,6 +46,9 @@ public class NormalQMControllerService {
@Resource @Resource
private SapService sapService; private SapService sapService;
@Resource
private IOptRecordService optRecordService;
public List<QCTaskItemVO> getTaskItem(@Valid @NotNull Long taskId) { public List<QCTaskItemVO> getTaskItem(@Valid @NotNull Long taskId) {
List<QCTaskItemVO> tasks = wmsQcReceiveItemService.getTaskItem(taskId); List<QCTaskItemVO> tasks = wmsQcReceiveItemService.getTaskItem(taskId);
if (CollectionUtil.isNotEmpty(tasks)) { if (CollectionUtil.isNotEmpty(tasks)) {

View File

@ -20,5 +20,5 @@ import java.util.List;
public interface IOptRecordService extends IService<OptRecord> { public interface IOptRecordService extends IService<OptRecord> {
List<OptRecordVO> search(OptRecordQO request); List<OptRecordVO> search(OptRecordQO request);
void add(OptRecord optRecord); void add(OptRecordDTO optRecordDTO);
} }

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.nflg.wms.common.pojo.dto.OptRecordDTO; import com.nflg.wms.common.pojo.dto.OptRecordDTO;
import com.nflg.wms.common.pojo.qo.OptRecordQO; import com.nflg.wms.common.pojo.qo.OptRecordQO;
import com.nflg.wms.common.pojo.vo.OptRecordVO; import com.nflg.wms.common.pojo.vo.OptRecordVO;
import com.nflg.wms.common.util.UserUtil;
import com.nflg.wms.repository.entity.OptRecord; import com.nflg.wms.repository.entity.OptRecord;
import com.nflg.wms.repository.mapper.OptRecordMapper; import com.nflg.wms.repository.mapper.OptRecordMapper;
import com.nflg.wms.repository.service.IOptRecordService; import com.nflg.wms.repository.service.IOptRecordService;
@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -30,7 +32,12 @@ public class OptRecordServiceImpl extends ServiceImpl<OptRecordMapper, OptRecord
} }
@Override @Override
public void add(OptRecord optRecord) { public void add(OptRecordDTO optRecordDTO) {
OptRecord optRecord = new OptRecord();
BeanUtils.copyProperties(optRecordDTO, optRecord);
optRecord.setOperationTime(LocalDateTime.now());
optRecord.setOperatorId(UserUtil.getUserId());
optRecord.setOperator(UserUtil.getUserName());
boolean saveSuccess = this.save(optRecord); boolean saveSuccess = this.save(optRecord);
if (!saveSuccess) { if (!saveSuccess) {
throw new RuntimeException("新增操作记录失败,请稍后重试"); throw new RuntimeException("新增操作记录失败,请稍后重试");