|
|
|
|
@ -2,6 +2,7 @@ package org.springblade.erpdata.service.impl; |
|
|
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.desk.produce.pojo.dto.MesRbRedoRoutDTO; |
|
|
|
|
import org.springblade.erpdata.mapper.ErpDataProduceMapper; |
|
|
|
|
import org.springblade.erpdata.pojo.vo.MesRbRedoVO; |
|
|
|
|
@ -32,7 +33,7 @@ public class ErpDataProduceServiceImpl implements IErpDataProduceService { |
|
|
|
|
private final JdbcTemplate jdbcTemplate; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public QueryBatchVO queryBatch(String partCode) { |
|
|
|
|
public List<QueryBatchVO> queryBatch(String partCode) { |
|
|
|
|
return erpDataProduceMapper.queryBatch(partCode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -232,4 +233,77 @@ public class ErpDataProduceServiceImpl implements IErpDataProduceService { |
|
|
|
|
public List<MesRbRedoRoutDTO> loadReworkNoProcess() { |
|
|
|
|
return erpDataProduceMapper.loadReworkNoProcess(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Boolean signDeleteErp(String useCode) { |
|
|
|
|
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate) |
|
|
|
|
// 指定存储过程名(包含 DB Link)
|
|
|
|
|
.withProcedureName("dba_mgr.pro_rbqjdel") |
|
|
|
|
// 建议关闭元数据访问(通过 DB Link 访问时可避免权限/性能问题)
|
|
|
|
|
.withoutProcedureColumnMetaDataAccess() |
|
|
|
|
// 显式声明参数
|
|
|
|
|
.declareParameters( |
|
|
|
|
new SqlParameter("v_invadjcode", Types.VARCHAR), |
|
|
|
|
new SqlOutParameter("v_excnote", Types.VARCHAR), |
|
|
|
|
new SqlOutParameter("v_excflag", Types.VARCHAR) |
|
|
|
|
); |
|
|
|
|
// 2. 封装输入参数
|
|
|
|
|
Map<String, Object> inParams = new HashMap<>(); |
|
|
|
|
inParams.put("v_invadjcode", useCode); |
|
|
|
|
// 3. 执行并获取结果 Map
|
|
|
|
|
Map<String, Object> resultMap = jdbcCall.execute(inParams); |
|
|
|
|
|
|
|
|
|
// 4. 提取输出参数
|
|
|
|
|
String excflag = (String) resultMap.get("v_excflag"); |
|
|
|
|
String excnote = (String) resultMap.get("v_excnote"); |
|
|
|
|
return !"0".equals(excflag); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String saveDeclare(String partCode, String batchNo, Integer quantity, String remark, String quaLevel, String deptNo, String warnNo, String locationNo, String woCode, String userName) { |
|
|
|
|
SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate) |
|
|
|
|
// 指定存储过程名(包含 DB Link)
|
|
|
|
|
.withProcedureName("dba_mgr.pro_rbqjmtn") |
|
|
|
|
// 建议关闭元数据访问(通过 DB Link 访问时可避免权限/性能问题)
|
|
|
|
|
.withoutProcedureColumnMetaDataAccess() |
|
|
|
|
// 显式声明参数
|
|
|
|
|
.declareParameters( |
|
|
|
|
new SqlParameter("v_prtno", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_splcode", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_num", Types.INTEGER), |
|
|
|
|
new SqlParameter("v_remark", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_prtlotno", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_deptno", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_warno", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_warlocno", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_mtnman", Types.VARCHAR), |
|
|
|
|
new SqlParameter("v_sono", Types.VARCHAR), |
|
|
|
|
new SqlOutParameter("v_excnote", Types.VARCHAR), |
|
|
|
|
new SqlOutParameter("v_excflag", Types.VARCHAR), |
|
|
|
|
new SqlOutParameter("v_invadjcode", Types.VARCHAR) |
|
|
|
|
); |
|
|
|
|
// 2. 封装输入参数
|
|
|
|
|
Map<String, Object> inParams = new HashMap<>(); |
|
|
|
|
inParams.put("v_prtno", partCode); |
|
|
|
|
inParams.put("v_splcode", batchNo); |
|
|
|
|
inParams.put("v_num", quantity); |
|
|
|
|
inParams.put("v_remark", remark); |
|
|
|
|
inParams.put("v_prtlotno", quaLevel); |
|
|
|
|
inParams.put("v_deptno", deptNo); |
|
|
|
|
inParams.put("v_warno", warnNo); |
|
|
|
|
inParams.put("v_warlocno", locationNo); |
|
|
|
|
inParams.put("v_mtnman", userName); |
|
|
|
|
inParams.put("v_sono", woCode); |
|
|
|
|
// 3. 执行并获取结果 Map
|
|
|
|
|
Map<String, Object> resultMap = jdbcCall.execute(inParams); |
|
|
|
|
|
|
|
|
|
// 4. 提取输出参数
|
|
|
|
|
String excflag = (String) resultMap.get("v_excflag"); |
|
|
|
|
String excnote = (String) resultMap.get("v_excnote"); |
|
|
|
|
Object code = resultMap.get("v_invadjcode"); |
|
|
|
|
if (code == null) { |
|
|
|
|
throw new ServiceException("接口回传数据失败,请联系信息中心"); |
|
|
|
|
} |
|
|
|
|
return (String) code; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|