|
|
|
|
@ -10,6 +10,7 @@ import org.springblade.erpdata.pojo.vo.MeasuringToolMaintainVO; |
|
|
|
|
import org.springblade.erpdata.pojo.vo.PurchaseTrackVO; |
|
|
|
|
import org.springblade.erpdata.pojo.vo.StGoodsExtStatusVO; |
|
|
|
|
import org.springblade.erpdata.service.IErpDataWmsService; |
|
|
|
|
import org.springblade.wms.pojo.dto.ErpStPurOtherDTO; |
|
|
|
|
import org.springblade.wms.pojo.entity.StRealtimeStock; |
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate; |
|
|
|
|
import org.springframework.jdbc.core.SqlOutParameter; |
|
|
|
|
@ -17,6 +18,7 @@ import org.springframework.jdbc.core.SqlParameter; |
|
|
|
|
import org.springframework.jdbc.core.simple.SimpleJdbcCall; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.sql.Types; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
@ -94,7 +96,7 @@ public class ErpDataWmsServiceImpl implements IErpDataWmsService { |
|
|
|
|
public String sendErpBuyRequest(String extraBill, Double qty, String ldapName) throws BusinessException{ |
|
|
|
|
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate) |
|
|
|
|
// 指定存储过程名(包含 DB Link)
|
|
|
|
|
.withProcedureName("dba_mgr.pro_rbinvdeptreqmtn") |
|
|
|
|
.withProcedureName("dba_mgr.pro_rbinvdeptreqmtnmes2") |
|
|
|
|
// 关闭元数据访问(DBLink 必须加)
|
|
|
|
|
.withoutProcedureColumnMetaDataAccess() |
|
|
|
|
// 显式声明参数(顺序必须和存储过程一致)
|
|
|
|
|
@ -341,6 +343,61 @@ public class ErpDataWmsServiceImpl implements IErpDataWmsService { |
|
|
|
|
return excflag; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String sendPurOtherRest(ErpStPurOtherDTO dto) throws BusinessException { |
|
|
|
|
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate) |
|
|
|
|
.withProcedureName("dba_mgr.pro_rbpurotherrp") |
|
|
|
|
.withoutProcedureColumnMetaDataAccess() |
|
|
|
|
// 严格按存储过程定义顺序声明参数
|
|
|
|
|
.declareParameters( |
|
|
|
|
// 全部IN输入参数
|
|
|
|
|
new SqlParameter("v_prtno", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_prtlotno", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_reqdat", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_reqqty", Types.NUMERIC), |
|
|
|
|
new SqlParameter("v_reqdate", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_plnarea", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_reqstat", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_reqctlr", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_checkman", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_checkdate", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_note", Types.VARCHAR), |
|
|
|
|
// OUT输出参数
|
|
|
|
|
new SqlOutParameter("v_excnote", Types.VARCHAR), |
|
|
|
|
new SqlOutParameter("v_excflag", Types.VARCHAR), |
|
|
|
|
new SqlOutParameter("v_orderno", Types.VARCHAR) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// 封装入参,空值统一转空字符串避免Oracle null报错
|
|
|
|
|
Map<String, Object> inParams = new HashMap<>(); |
|
|
|
|
inParams.put("v_prtno", dto.getPrtno() == null ? "" : dto.getPrtno()); |
|
|
|
|
inParams.put("v_prtlotno", dto.getPrtlotno() == null ? "" : dto.getPrtlotno()); |
|
|
|
|
inParams.put("v_reqdat", dto.getReqdat() == null ? "" : dto.getReqdat()); |
|
|
|
|
inParams.put("v_reqqty", dto.getReqqty() == null ? BigDecimal.ZERO : dto.getReqqty()); |
|
|
|
|
inParams.put("v_reqdate", dto.getReqdate() == null ? "" : dto.getReqdate()); |
|
|
|
|
inParams.put("v_plnarea", dto.getPlnarea() == null ? "" : dto.getPlnarea()); |
|
|
|
|
inParams.put("v_reqstat", dto.getReqstat() == null ? "" : dto.getReqstat()); |
|
|
|
|
inParams.put("v_reqctlr", dto.getReqctlr() == null ? "" : dto.getReqctlr()); |
|
|
|
|
inParams.put("v_checkman", dto.getCheckman() == null ? "" : dto.getCheckman()); |
|
|
|
|
inParams.put("v_checkdate", dto.getCheckdate() == null ? "" : dto.getCheckdate()); |
|
|
|
|
inParams.put("v_note", dto.getNote() == null ? "" : dto.getNote()); |
|
|
|
|
|
|
|
|
|
// 执行存储过程
|
|
|
|
|
Map<String, Object> resultMap = jdbcCall.execute(inParams); |
|
|
|
|
|
|
|
|
|
// 提取输出参数
|
|
|
|
|
String excflag = (String) resultMap.get("v_excflag"); |
|
|
|
|
String excnote = (String) resultMap.get("v_excnote"); |
|
|
|
|
String orderNo = (String) resultMap.get("v_orderno"); |
|
|
|
|
|
|
|
|
|
// 业务异常判断
|
|
|
|
|
if ("0".equals(excflag)) { |
|
|
|
|
throw new BusinessException("MES生成额外计划发送ERP失败,请联系信息部!!! " + excnote); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return orderNo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public StGoodsExtStatusVO getGoodsExtStatus(String goodsCode){ |
|
|
|
|
return erpDataWmsMapper.getGoodsExtStatus(goodsCode); |
|
|
|
|
|