收发货单提交erp接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.erp.api;
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.api.dto.BillMainSubmitErpReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpBillMainSaveReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpBillMainSaveReqDTO;
|
||||||
import com.zt.plat.module.erp.enums.ApiConstants;
|
import com.zt.plat.module.erp.enums.ApiConstants;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@@ -21,4 +22,8 @@ public interface ErpBillMainApi {
|
|||||||
@PostMapping(PREFIX + "/submit-bill-main-reverse")
|
@PostMapping(PREFIX + "/submit-bill-main-reverse")
|
||||||
@Operation(summary = "冲销")
|
@Operation(summary = "冲销")
|
||||||
String submitBillMainReverseToErp(@Valid @RequestBody ErpBillMainSaveReqDTO reqDTO);
|
String submitBillMainReverseToErp(@Valid @RequestBody ErpBillMainSaveReqDTO reqDTO);
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/submit/erp")
|
||||||
|
@Operation(summary = "erp数据提交")
|
||||||
|
String submitErp(@Valid @RequestBody BillMainSubmitErpReqDTO reqDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,176 @@
|
|||||||
|
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 = "管理后台 - 收发货单提交ERP Request DTO")
|
||||||
|
@Data
|
||||||
|
public class BillMainSubmitErpReqDTO {
|
||||||
|
@Schema(description = "接口编号")
|
||||||
|
private String funcnr;
|
||||||
|
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "类型(收货、发货、移库,字典: RECEIVING_SHIPPING_TYPE)")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "订单号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "订单明细主键")
|
||||||
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
@Schema(description = "收货单号;自动生成")
|
||||||
|
private String billNumber;
|
||||||
|
|
||||||
|
@Schema(description = "实物物料编码")
|
||||||
|
private String materialCoding;
|
||||||
|
|
||||||
|
@Schema(description = "实物物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "实物收发货数量")
|
||||||
|
private BigDecimal materialQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "总干重")
|
||||||
|
private BigDecimal dryQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "实物计量单位")
|
||||||
|
private String materialUom;
|
||||||
|
|
||||||
|
@Schema(description = "金属物料编码")
|
||||||
|
private String metalCoding;
|
||||||
|
|
||||||
|
@Schema(description = "金属物料名称")
|
||||||
|
private String metalName;
|
||||||
|
|
||||||
|
@Schema(description = "实际发货量")
|
||||||
|
private BigDecimal metalQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "金属计量单位")
|
||||||
|
private String metalUom;
|
||||||
|
|
||||||
|
@Schema(description = "工厂名称")
|
||||||
|
private String factoryName;
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码")
|
||||||
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "库位名称")
|
||||||
|
private String warehouseName;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码")
|
||||||
|
private String warehouseNumber;
|
||||||
|
|
||||||
|
@Schema(description = "不含税总金额")
|
||||||
|
private BigDecimal notTaxAmount;
|
||||||
|
|
||||||
|
@Schema(description = "含税总金额")
|
||||||
|
private BigDecimal inTaxAmount;
|
||||||
|
|
||||||
|
@Schema(description = "总税额")
|
||||||
|
private BigDecimal taxAmount;
|
||||||
|
|
||||||
|
@Schema(description = "付款比例")
|
||||||
|
private BigDecimal paymentRatio;
|
||||||
|
|
||||||
|
@Schema(description = "实付总金额")
|
||||||
|
private BigDecimal relativityAmount;
|
||||||
|
|
||||||
|
@Schema(description = "过账日期")
|
||||||
|
private LocalDateTime postingDate;
|
||||||
|
|
||||||
|
@Schema(description = "客商编号")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客商名称")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@Schema(description = "订单类型")
|
||||||
|
private String orderType;
|
||||||
|
|
||||||
|
@Schema(description = "订单分类(销售、采购、委托加工、来料加工,字典:SPLY_BSN_TP)")
|
||||||
|
private String businessType;
|
||||||
|
|
||||||
|
@Schema(description = "状态(字典值RECEIVING_SHIPPING_STATUS )")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "小协议号")
|
||||||
|
private String agreementNumber;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "合同编码")
|
||||||
|
private String contractNumber;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称")
|
||||||
|
private String contractName;
|
||||||
|
|
||||||
|
@Schema(description = "合同纸质合同号")
|
||||||
|
private String paperContractNumber;
|
||||||
|
|
||||||
|
@Schema(description = "是否以金属结算(字典:ERP_CTRT_YN);根据订单类型判断,如果订单为原料,则默认\"是\",如果是服务订单则不显示,默认为否。如铁精矿/烟尘")
|
||||||
|
private String isMetalSettlement;
|
||||||
|
|
||||||
|
@Schema(description = "币种码")
|
||||||
|
private String currencyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "税码")
|
||||||
|
private String taxNumber;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例编号")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "审批意见")
|
||||||
|
private String reviewOpinion;
|
||||||
|
|
||||||
|
@Schema(description = "任务节点主键")
|
||||||
|
private String taskNodeId;
|
||||||
|
|
||||||
|
@Schema(description = "收发货方式(字典: RECEIVING_SHIPPING_WAY)")
|
||||||
|
private String way;
|
||||||
|
|
||||||
|
@Schema(description = "总净重")
|
||||||
|
private BigDecimal wetQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "应该发货量")
|
||||||
|
private BigDecimal allQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "是否付款(字典: ERP_CTRT_YN)")
|
||||||
|
private String isPay;
|
||||||
|
|
||||||
|
@Schema(description = "物料类型(原料、成品、服务,字典:SPLY_MTRL_TP)")
|
||||||
|
private String materialType;
|
||||||
|
|
||||||
|
@Schema(description = "进厂开始日期")
|
||||||
|
private LocalDateTime intoStartDate;
|
||||||
|
|
||||||
|
@Schema(description = "进厂结束日期")
|
||||||
|
private LocalDateTime intoEndDate;
|
||||||
|
|
||||||
|
@Schema(description = "ERP订单号")
|
||||||
|
private String orderSapNumber;
|
||||||
|
|
||||||
|
@Schema(description = "税率")
|
||||||
|
private BigDecimal taxRatio;
|
||||||
|
|
||||||
|
@Schema(description = "收发货类型分类(字典: SND_OR_REC)")
|
||||||
|
private String isEstimate;
|
||||||
|
|
||||||
|
@Schema(description = "品位类型(字典: GRADE_TYPE)")
|
||||||
|
private String gradeType;
|
||||||
|
|
||||||
|
@Schema(description = "计量类型(字典:ASY_MTNG_TP)")
|
||||||
|
private String meteringType;
|
||||||
|
|
||||||
|
@Schema(description = "是否货权转移(字典:ERP_CTRT_YN)")
|
||||||
|
private String isProductive;
|
||||||
|
|
||||||
|
@Schema(description = "ERP状态(字典:BLL_ERP_STS)")
|
||||||
|
private String erpStatus;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.erp.api;
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.erp.api.dto.BillMainSubmitErpReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpBillMainSaveReqDTO;
|
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.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
import com.zt.plat.module.erp.service.erp.ErpBillMainService;
|
import com.zt.plat.module.erp.service.erp.ErpBillMainService;
|
||||||
@@ -29,4 +30,9 @@ public class ErpBillMainApiImpl implements ErpBillMainApi{
|
|||||||
ErpBillMainSaveReqVO erpBillMainSaveReqDTO = BeanUtils.toBean(reqDTO,ErpBillMainSaveReqVO.class);
|
ErpBillMainSaveReqVO erpBillMainSaveReqDTO = BeanUtils.toBean(reqDTO,ErpBillMainSaveReqVO.class);
|
||||||
return erpBillMainService.submitBillMainReverseToErp(erpBillMainSaveReqDTO);
|
return erpBillMainService.submitBillMainReverseToErp(erpBillMainSaveReqDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitErp(BillMainSubmitErpReqDTO reqDTO) {
|
||||||
|
return erpBillMainService.submitErp(reqDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.zt.plat.module.erp.service.erp;
|
package com.zt.plat.module.erp.service.erp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.erp.api.dto.BillMainSubmitErpReqDTO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
|
|
||||||
public interface ErpBillMainService {
|
public interface ErpBillMainService {
|
||||||
String submitBillMainToErp(ErpBillMainSaveReqVO createVo);
|
String submitBillMainToErp(ErpBillMainSaveReqVO createVo);
|
||||||
String submitBillMainReverseToErp(ErpBillMainSaveReqVO createVo);
|
String submitBillMainReverseToErp(ErpBillMainSaveReqVO createVo);
|
||||||
|
String submitErp(BillMainSubmitErpReqDTO reqDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.erp.service.erp;
|
package com.zt.plat.module.erp.service.erp;
|
||||||
|
|
||||||
import com.zt.plat.module.erp.api.ErpExternalApi;
|
import com.zt.plat.module.erp.api.ErpExternalApi;
|
||||||
|
import com.zt.plat.module.erp.api.dto.BillMainSubmitErpReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -62,6 +63,67 @@ public class ErpBillMainServiceImpl implements ErpBillMainService {
|
|||||||
return submitToErp(reqDTO);
|
return submitToErp(reqDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String submitErp(BillMainSubmitErpReqDTO reqDTO) {
|
||||||
|
String res = null;
|
||||||
|
switch (reqDTO.getFuncnr()) {
|
||||||
|
case "095":
|
||||||
|
// TODO 暂时返回成功
|
||||||
|
/*ErpSubmitReqDTO erpSubmitReqDTO = buildBaseReqDTO(createVo, reqDTO.getFuncnr());
|
||||||
|
Map<String, Object> req = new HashMap<>();
|
||||||
|
Map<String, Object> head = new HashMap<>();
|
||||||
|
head.put("pstng_date", createVo.getPostingDate());
|
||||||
|
head.put("doc_date", createVo.getPostingDate());
|
||||||
|
head.put("header_txt", createVo.getRemark());
|
||||||
|
head.put("bill_of_lading", "");
|
||||||
|
req.put("head", head);
|
||||||
|
List<Map<String, Object>> items = getMaps(createVo);
|
||||||
|
req.put("item", items);
|
||||||
|
erpSubmitReqDTO.setReq(req);
|
||||||
|
res = submitToErp(erpSubmitReqDTO);*/
|
||||||
|
|
||||||
|
res = "095";
|
||||||
|
break;
|
||||||
|
case "071":
|
||||||
|
// TODO 暂时返回成功
|
||||||
|
/*ErpSubmitReqDTO erpSubmitReqDTO = buildBaseReqDTO(createVo, reqDTO.getFuncnr());
|
||||||
|
Map<String, Object> req = new HashMap<>();
|
||||||
|
Map<String, Object> head = new HashMap<>();
|
||||||
|
head.put("pstng_date", createVo.getPostingDate());
|
||||||
|
head.put("doc_date", createVo.getPostingDate());
|
||||||
|
head.put("header_txt", createVo.getRemark());
|
||||||
|
head.put("bill_of_lading", "");
|
||||||
|
req.put("head", head);
|
||||||
|
List<Map<String, Object>> items = getMaps(createVo);
|
||||||
|
req.put("item", items);
|
||||||
|
erpSubmitReqDTO.setReq(req);
|
||||||
|
res = submitToErp(erpSubmitReqDTO);*/
|
||||||
|
|
||||||
|
res = "071";
|
||||||
|
break;
|
||||||
|
case "093":
|
||||||
|
// TODO 暂时返回成功
|
||||||
|
/*ErpSubmitReqDTO erpSubmitReqDTO = buildBaseReqDTO(createVo, reqDTO.getFuncnr());
|
||||||
|
Map<String, Object> req = new HashMap<>();
|
||||||
|
Map<String, Object> head = new HashMap<>();
|
||||||
|
head.put("pstng_date", createVo.getPostingDate());
|
||||||
|
head.put("doc_date", createVo.getPostingDate());
|
||||||
|
head.put("header_txt", createVo.getRemark());
|
||||||
|
head.put("bill_of_lading", "");
|
||||||
|
req.put("head", head);
|
||||||
|
List<Map<String, Object>> items = getMaps(createVo);
|
||||||
|
req.put("item", items);
|
||||||
|
erpSubmitReqDTO.setReq(req);
|
||||||
|
res = submitToErp(erpSubmitReqDTO);*/
|
||||||
|
|
||||||
|
res = "093";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
// 抽取重复代码:构建基础 ErpSubmitReqDTO
|
// 抽取重复代码:构建基础 ErpSubmitReqDTO
|
||||||
private ErpSubmitReqDTO buildBaseReqDTO(ErpBillMainSaveReqVO vo, String funcnr) {
|
private ErpSubmitReqDTO buildBaseReqDTO(ErpBillMainSaveReqVO vo, String funcnr) {
|
||||||
ErpSubmitReqDTO reqDTO = new ErpSubmitReqDTO();
|
ErpSubmitReqDTO reqDTO = new ErpSubmitReqDTO();
|
||||||
|
|||||||
Reference in New Issue
Block a user