新增发货单ERP接口
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpBillMainSaveReqDTO;
|
||||||
|
import com.zt.plat.module.erp.enums.ApiConstants;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME)
|
||||||
|
@Tag(name = "RPC 服务 - ERP")
|
||||||
|
public interface ErpBillMainApi {
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/erp-external";
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/submit-bill-main")
|
||||||
|
@Operation(summary = "erp数据提交")
|
||||||
|
String submitBillMainToErp(@Valid @RequestBody ErpBillMainSaveReqDTO reqDTO);
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/submit-bill-reverse")
|
||||||
|
@Operation(summary = "冲销")
|
||||||
|
String submitBillMainReverseToErp(@Valid @RequestBody ErpBillMainSaveReqDTO reqDTO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.zt.plat.module.erp.api.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 收发货单新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpBillMainSaveReqDTO {
|
||||||
|
|
||||||
|
@Schema(description = "收货单号;自动生成")
|
||||||
|
private String billNumber;
|
||||||
|
|
||||||
|
@Schema(description = "过账日期")
|
||||||
|
private LocalDateTime postingDate;
|
||||||
|
|
||||||
|
@Schema(description = "实物物料编码")
|
||||||
|
private String materialCoding;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码")
|
||||||
|
private String warehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "实物收发货数量")
|
||||||
|
private BigDecimal materialQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "实物计量单位")
|
||||||
|
private String materialUom;
|
||||||
|
|
||||||
|
@Schema(description = "批次")
|
||||||
|
private String batch;
|
||||||
|
|
||||||
|
@Schema(description = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "采购订单行号")
|
||||||
|
private String poItem;
|
||||||
|
|
||||||
|
@Schema(description = "客商编号")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private String creatorId;
|
||||||
|
|
||||||
|
@Schema(description = "用户名称")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpBillMainSaveReqDTO;
|
||||||
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
|
import com.zt.plat.module.erp.service.erp.ErpBillMainService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
|
public class ErpBillMainApiImpl implements ErpBillMainApi{
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpBillMainService erpBillMainService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitBillMainToErp(ErpBillMainSaveReqDTO reqDTO) {
|
||||||
|
ErpBillMainSaveReqVO erpBillMainSaveReqDTO = BeanUtils.toBean(reqDTO,ErpBillMainSaveReqVO.class);
|
||||||
|
return erpBillMainService.submitBillMainToErp(erpBillMainSaveReqDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitBillMainReverseToErp(ErpBillMainSaveReqDTO reqDTO) {
|
||||||
|
ErpBillMainSaveReqVO erpBillMainSaveReqDTO = BeanUtils.toBean(reqDTO,ErpBillMainSaveReqVO.class);
|
||||||
|
return erpBillMainService.submitBillMainReverseToErp(erpBillMainSaveReqDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.zt.plat.module.erp.controller.admin.erp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
|
import com.zt.plat.module.erp.service.erp.ErpBillMainService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - ERP收货订单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/bill-main")
|
||||||
|
@Validated
|
||||||
|
public class ErpBillMainController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpBillMainService erpBillMainService;
|
||||||
|
|
||||||
|
@PostMapping("/submitBillMainToErp")
|
||||||
|
@Operation(summary = "ERP收货订单推送")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-bom:create')")
|
||||||
|
public String submitBillMainToErp(ErpBillMainSaveReqVO createVo) {
|
||||||
|
return erpBillMainService.submitBillMainToErp(createVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.zt.plat.module.erp.controller.admin.erp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 收发货单新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpBillMainSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "收货单号;自动生成")
|
||||||
|
private String billNumber;
|
||||||
|
|
||||||
|
@Schema(description = "过账日期")
|
||||||
|
private LocalDateTime postingDate;
|
||||||
|
|
||||||
|
@Schema(description = "实物物料编码")
|
||||||
|
private String materialCoding;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码")
|
||||||
|
private String warehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "实物收发货数量")
|
||||||
|
private BigDecimal materialQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "实物计量单位")
|
||||||
|
private String materialUom;
|
||||||
|
|
||||||
|
@Schema(description = "批次")
|
||||||
|
private String batch;
|
||||||
|
|
||||||
|
@Schema(description = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "采购订单行号")
|
||||||
|
private String poItem;
|
||||||
|
|
||||||
|
@Schema(description = "客商编号")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "用户id")
|
||||||
|
private String creatorId;
|
||||||
|
|
||||||
|
@Schema(description = "用户名称")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.zt.plat.module.erp.service.erp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
|
|
||||||
|
public interface ErpBillMainService {
|
||||||
|
String submitBillMainToErp(ErpBillMainSaveReqVO createVo);
|
||||||
|
String submitBillMainReverseToErp(ErpBillMainSaveReqVO createVo);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user