Browse Source

2025-12-05

pda在物料清单列表->物料可用库存
master
fengyuan_yang 6 months ago
parent
commit
88cc04d273
  1. 40
      src/main/java/com/gaotao/modules/inboundNotification/controller/InboundNotificationController.java
  2. 10
      src/main/java/com/gaotao/modules/inboundNotification/dao/InboundNotificationHeadMapper.java
  3. 14
      src/main/java/com/gaotao/modules/inboundNotification/service/InboundNotificationService.java
  4. 22
      src/main/java/com/gaotao/modules/inboundNotification/service/impl/InboundNotificationServiceImpl.java
  5. 18
      src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml

40
src/main/java/com/gaotao/modules/inboundNotification/controller/InboundNotificationController.java

@ -254,6 +254,46 @@ public class InboundNotificationController extends AbstractController {
} }
} }
/**
* 获取物料可用库存
* 调用存储过程 GetInventoryStock
*/
@PostMapping("getInventoryStock")
public R getInventoryStock(@RequestBody Map<String, Object> params) {
try {
String site = (String) params.get("site");
String notifyNo = (String) params.get("notifyNo");
String notifyType = (String) params.get("notifyType");
String orderNo = (String) params.get("orderNo");
String orderLineNo = (String) params.get("orderLineNo");
String partNo = (String) params.get("partNo");
String warehouseId = (String) params.get("warehouseId");
if (site == null || site.trim().isEmpty()) {
return R.error("站点不能为空");
}
if (partNo == null || partNo.trim().isEmpty()) {
return R.error("物料编码不能为空");
}
List<Map<String, Object>> stockList = inboundNotificationService.getInventoryStock(
site,
notifyNo != null ? notifyNo : "",
notifyType != null ? notifyType : "",
orderNo != null ? orderNo : "",
orderLineNo != null ? orderLineNo : "",
partNo,
warehouseId != null ? warehouseId : ""
);
return R.ok().put("data", stockList);
} catch (Exception e) {
logger.error("获取物料可用库存失败", e);
return R.error("获取物料可用库存失败: " + e.getMessage());
}
}
// =========================== PC =========================== // =========================== PC ===========================

10
src/main/java/com/gaotao/modules/inboundNotification/dao/InboundNotificationHeadMapper.java

@ -90,6 +90,16 @@ public interface InboundNotificationHeadMapper extends BaseMapper<InboundNotific
@Param("buNo") String buNo, @Param("buNo") String buNo,
@Param("inboundNo") String inboundNo); @Param("inboundNo") String inboundNo);
/**
* 获取物料可用库存调用存储过程
*/
List<Map<String, Object>> getInventoryStock(@Param("site") String site,
@Param("notifyNo") String notifyNo,
@Param("notifyType") String notifyType,
@Param("orderNo") String orderNo,
@Param("orderLineNo") String orderLineNo,
@Param("partNo") String partNo,
@Param("warehouseId") String warehouseId);
IPage<InboundNotificationHeadVo> searchInboundNotification(Page<InboundNotificationHeadVo> inboundNotificationHeadVoPage, @Param("query") InboundNotificationHeadVo data); IPage<InboundNotificationHeadVo> searchInboundNotification(Page<InboundNotificationHeadVo> inboundNotificationHeadVoPage, @Param("query") InboundNotificationHeadVo data);

14
src/main/java/com/gaotao/modules/inboundNotification/service/InboundNotificationService.java

@ -69,6 +69,20 @@ public interface InboundNotificationService {
*/ */
List<Map<String, Object>> getScannedLabelList(String site, String buNo, String inboundNo); List<Map<String, Object>> getScannedLabelList(String site, String buNo, String inboundNo);
/**
* 获取物料可用库存
* @param site 站点
* @param notifyNo 入库单号
* @param notifyType 类型
* @param orderNo 单据号
* @param orderLineNo 单据行号
* @param partNo 物料编码
* @param warehouseId 当前仓库
* @return 可用库存列表
*/
List<Map<String, Object>> getInventoryStock(String site, String notifyNo, String notifyType,
String orderNo, String orderLineNo, String partNo, String warehouseId);
PageUtils searchInboundNotification(InboundNotificationHeadVo data); PageUtils searchInboundNotification(InboundNotificationHeadVo data);
void saveInboundNotification(InboundNotificationHeadVo data); void saveInboundNotification(InboundNotificationHeadVo data);

22
src/main/java/com/gaotao/modules/inboundNotification/service/impl/InboundNotificationServiceImpl.java

@ -359,6 +359,28 @@ public class InboundNotificationServiceImpl implements InboundNotificationServic
} }
} }
@Override
public List<Map<String, Object>> getInventoryStock(String site, String notifyNo, String notifyType,
String orderNo, String orderLineNo, String partNo, String warehouseId) {
logger.info("获取物料可用库存,站点: {}, 物料编码: {}", site, partNo);
try {
List<Map<String, Object>> stockList = headMapper.getInventoryStock(
site, notifyNo, notifyType, orderNo, orderLineNo, partNo, warehouseId);
if (stockList == null) {
stockList = new ArrayList<>();
}
logger.info("获取物料可用库存成功,站点: {}, 物料编码: {}, 记录数: {}", site, partNo, stockList.size());
return stockList;
} catch (Exception e) {
logger.error("获取物料可用库存失败,站点: {}, 物料编码: {}, 错误信息: {}", site, partNo, e.getMessage(), e);
throw new RuntimeException("获取物料可用库存失败: " + e.getMessage(), e);
}
}
/** /**
* 生成事务明细记录 * 生成事务明细记录
* @return 生成的明细记录列表用于子明细关联 * @return 生成的明细记录列表用于子明细关联

18
src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml

@ -72,7 +72,10 @@
<!-- 获取物料清单 --> <!-- 获取物料清单 -->
<select id="getMaterialList" resultType="java.util.Map"> <select id="getMaterialList" resultType="java.util.Map">
SELECT SELECT
d.site, d.bu_no,d.part_no as partNo,d.part_desc,
d.site,
d.bu_no,
d.part_no as partNo,
d.part_desc,
SUM(CASE WHEN hardtag_in_flag = '已入库' then CAST(roll_qty AS float) else 0 end) totalinLabels,--已入库数 SUM(CASE WHEN hardtag_in_flag = '已入库' then CAST(roll_qty AS float) else 0 end) totalinLabels,--已入库数
D.required_qty as labelCount --需入库总数 D.required_qty as labelCount --需入库总数
FROM inbound_notification_detail d FROM inbound_notification_detail d
@ -227,4 +230,17 @@
AND NotifyNo = #{inboundNo} AND NotifyNo = #{inboundNo}
ORDER BY RollNo DESC ORDER BY RollNo DESC
</select> </select>
<!-- 获取物料可用库存(调用存储过程) -->
<select id="getInventoryStock" resultType="java.util.Map" statementType="CALLABLE">
{call GetInventoryStock(
#{site, mode=IN, jdbcType=VARCHAR},
#{notifyNo, mode=IN, jdbcType=VARCHAR},
#{notifyType, mode=IN, jdbcType=VARCHAR},
#{orderNo, mode=IN, jdbcType=VARCHAR},
#{orderLineNo, mode=IN, jdbcType=VARCHAR},
#{partNo, mode=IN, jdbcType=VARCHAR},
#{warehouseId, mode=IN, jdbcType=VARCHAR}
)}
</select>
</mapper> </mapper>
Loading…
Cancel
Save