Browse Source

2026-04-15

优化
master
fengyuan_yang 1 day ago
parent
commit
388b36b567
  1. 31
      src/main/java/com/gaotao/modules/productionReturn/controller/ProductionReturnController.java
  2. 7
      src/main/java/com/gaotao/modules/productionReturn/dao/ProductionReturnMapper.java
  3. 9
      src/main/java/com/gaotao/modules/productionReturn/service/ProductionReturnService.java
  4. 22
      src/main/java/com/gaotao/modules/productionReturn/service/impl/ProductionReturnServiceImpl.java
  5. 15
      src/main/resources/mapper/productionReturn/ProductionReturnMapper.xml

31
src/main/java/com/gaotao/modules/productionReturn/controller/ProductionReturnController.java

@ -288,4 +288,35 @@ public class ProductionReturnController extends AbstractController {
return R.error("获取已扫描标签列表失败: " + e.getMessage());
}
}
/**
* 申请单退仓获取已扫描标签列表从缓存表
*/
@PostMapping("getApplicationScannedLabelList")
public R getApplicationScannedLabelList(@RequestBody Map<String, Object> params) {
try {
String site = (String) params.get("site");
String buNo = (String) params.get("buNo");
String inboundNo = (String) params.get("inboundNo");
if (site == null || site.trim().isEmpty()) {
return R.error("站点不能为空");
}
if (buNo == null || buNo.trim().isEmpty()) {
return R.error("业务单元不能为空");
}
if (inboundNo == null || inboundNo.trim().isEmpty()) {
return R.error("生产订单号不能为空");
}
List<Map<String, Object>> scannedList = productionReturnService.getApplicationScannedLabelList(site, buNo, inboundNo);
return R.ok().put("data", scannedList);
} catch (Exception e) {
logger.error("获取已扫描标签列表失败", e);
return R.error("获取已扫描标签列表失败: " + e.getMessage());
}
}
}

7
src/main/java/com/gaotao/modules/productionReturn/dao/ProductionReturnMapper.java

@ -87,4 +87,11 @@ public interface ProductionReturnMapper {
List<Map<String, Object>> getScannedLabelList(@Param("site") String site,
@Param("buNo") String buNo,
@Param("orderNo") String orderNo);
/**
* 申请单退仓获取已扫描标签列表从缓存表
*/
List<Map<String, Object>> getApplicationScannedLabelList(@Param("site") String site,
@Param("buNo") String buNo,
@Param("orderNo") String orderNo);
}

9
src/main/java/com/gaotao/modules/productionReturn/service/ProductionReturnService.java

@ -101,4 +101,13 @@ public interface ProductionReturnService {
* @return 已扫描标签列表
*/
List<Map<String, Object>> getScannedLabelList(String site, String buNo, String orderNo);
/**
* 申请单退仓获取已扫描标签列表从缓存表
* @param site 站点
* @param buNo 业务单元
* @param orderNo 生产订单号
* @return 已扫描标签列表
*/
List<Map<String, Object>> getApplicationScannedLabelList(String site, String buNo, String orderNo);
}

22
src/main/java/com/gaotao/modules/productionReturn/service/impl/ProductionReturnServiceImpl.java

@ -402,6 +402,28 @@ public class ProductionReturnServiceImpl implements ProductionReturnService {
}
}
@Override
public List<Map<String, Object>> getApplicationScannedLabelList(String site, String buNo, String orderNo) {
logger.info("申请单退仓获取已扫描标签列表,站点: {}, 业务单元: {}, 生产订单号: {}", site, buNo, orderNo);
try {
List<Map<String, Object>> scannedList = productionReturnMapper.getApplicationScannedLabelList(site, buNo, orderNo);
if (scannedList == null) {
scannedList = new ArrayList<>();
}
logger.info("申请单退仓获取已扫描标签列表成功,站点: {}, 业务单元: {}, 生产订单号: {}, 记录数: {}",
site, buNo, orderNo, scannedList.size());
return scannedList;
} catch (Exception e) {
logger.error("申请单退仓获取已扫描标签列表失败,站点: {}, 业务单元: {}, 生产订单号: {}, 错误信息: {}",
site, buNo, orderNo, e.getMessage(), e);
throw new RuntimeException("获取已扫描标签列表失败: " + e.getMessage(), e);
}
}
/**
* 生成事务明细记录
*/

15
src/main/resources/mapper/productionReturn/ProductionReturnMapper.xml

@ -218,4 +218,19 @@
ORDER BY RollNo DESC
</select>
<!-- 申请单退仓:获取已扫描标签列表(从缓存表) -->
<select id="getApplicationScannedLabelList" resultType="java.util.Map">
SELECT
site,
bu_no as buNo,
part_no as partNo,
RollNo as labelCode,
RollQty as quantity
FROM ScannedRollTempTable
WHERE site = #{site}
AND bu_no = #{buNo}
AND NotifyNo = #{orderNo}
ORDER BY RollNo DESC
</select>
</mapper>
Loading…
Cancel
Save