收发货单提交erp接口
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.zt.plat.module.erp.api;
|
||||
|
||||
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.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||
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);
|
||||
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;
|
||||
|
||||
import com.zt.plat.module.erp.api.dto.BillMainSubmitErpReqDTO;
|
||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||
|
||||
public interface ErpBillMainService {
|
||||
String submitBillMainToErp(ErpBillMainSaveReqVO createVo);
|
||||
String submitBillMainReverseToErp(ErpBillMainSaveReqVO createVo);
|
||||
String submitErp(BillMainSubmitErpReqDTO reqDTO);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zt.plat.module.erp.service.erp;
|
||||
|
||||
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.controller.admin.erp.vo.ErpBillMainSaveReqVO;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -62,6 +63,67 @@ public class ErpBillMainServiceImpl implements ErpBillMainService {
|
||||
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
|
||||
private ErpSubmitReqDTO buildBaseReqDTO(ErpBillMainSaveReqVO vo, String funcnr) {
|
||||
ErpSubmitReqDTO reqDTO = new ErpSubmitReqDTO();
|
||||
|
||||
Reference in New Issue
Block a user