采购登记微服务和int接口测试回滚事务

This commit is contained in:
彭枝刚 2024-12-02 13:50:29 +08:00
parent f593e07b1f
commit 5f18f6de50
4 changed files with 6 additions and 6 deletions

View File

@ -24,6 +24,6 @@ public interface RemotePoService {
R<JSONObject> dealPoDataLogic(@RequestBody JSONObject messageObj, @RequestHeader("from") String var2);
@PostMapping("/po-order/api/saveDocumentData")
R<String> saveDocumentData(@RequestBody List<DocumentDetailed> zwDocumentDetailList);
R<String> saveDocumentData(@RequestBody List<DocumentDetailed> zwDocumentDetailList) throws Exception;
}

View File

@ -18,6 +18,7 @@ import com.foreverwin.mom.wms.service.PoOrderDetailService;
import com.foreverwin.mom.wms.service.PoOrderService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -67,7 +68,8 @@ public class PoOrderController {
@ApiOperation(value = "采购登记-获取物料", notes = "采购登记-获取物料")
@SysLog("采购登记-获取物料")
@PostMapping("/api/saveDocumentData")
public R saveDocumentData(@RequestBody List<DocumentDetailed> zwDocumentDetailList) {
@Transactional
public R saveDocumentData(@RequestBody List<DocumentDetailed> zwDocumentDetailList) throws Exception{
return R.ok(poOrderService.saveDocumentData(zwDocumentDetailList));
}

View File

@ -19,7 +19,7 @@ import java.util.List;
*/
public interface PoOrderService extends IService<PoOrder> {
String saveDocumentData(List<DocumentDetailed> zwDocumentDetailList);
String saveDocumentData(List<DocumentDetailed> zwDocumentDetailList) throws Exception;
JSONObject dealPoDataLogic(JSONObject messageObj);

View File

@ -50,13 +50,11 @@ public class PoOrderServiceImpl extends ServiceImpl<PoOrderMapper, PoOrder> impl
private final RemoteNextNumberService remoteNextNumberService;
private final ZWmsInventoryService zWmsInventoryService;
private final ZWmsInventoryLogService zWmsInventoryLogService;
private final WmsItemService wmsItemService;
private final RemoteItemService remoteItemService;
// NLV 已使用 Snow
@Override
@Transactional
public String saveDocumentData(List<DocumentDetailed> zwDocumentDetailList) {
public String saveDocumentData(List<DocumentDetailed> zwDocumentDetailList) throws Exception{
String site = TenantContextHolder.getTenantId();
// 先创建单据号
Map map = new HashMap();