Browse Source

2025-11-27

pda调整扫描、查询、确认逻辑(其他入库)
master
fengyuan_yang 2 months ago
parent
commit
268a18c946
  1. 9
      src/main/java/com/gaotao/modules/otherInbound/controller/OtherInboundController.java
  2. 2
      src/main/java/com/gaotao/modules/otherInbound/service/OtherInboundService.java
  3. 8
      src/main/java/com/gaotao/modules/otherInbound/service/impl/OtherInboundServiceImpl.java
  4. 19
      src/main/resources/mapper/schedule/ScheduleMapper.xml

9
src/main/java/com/gaotao/modules/otherInbound/controller/OtherInboundController.java

@ -128,6 +128,7 @@ public class OtherInboundController extends AbstractController {
String warehouseId = (String) params.get("warehouseId"); String warehouseId = (String) params.get("warehouseId");
String operationType = (String) params.get("operationType"); String operationType = (String) params.get("operationType");
String documentType = (String) params.get("documentType"); String documentType = (String) params.get("documentType");
String rollNo = (String) params.get("labelCode");
if (site == null || site.trim().isEmpty()) { if (site == null || site.trim().isEmpty()) {
return R.error("站点不能为空"); return R.error("站点不能为空");
@ -135,9 +136,9 @@ public class OtherInboundController extends AbstractController {
if (inboundNo == null || inboundNo.trim().isEmpty()) { if (inboundNo == null || inboundNo.trim().isEmpty()) {
return R.error("入库单号不能为空"); return R.error("入库单号不能为空");
} }
if (materialCode == null || materialCode.trim().isEmpty()) {
return R.error("物料编码不能为空");
}
// if (materialCode == null || materialCode.trim().isEmpty()) {
// return R.error("物料编码不能为空");
// }
if (operationType == null || operationType.trim().isEmpty()) { if (operationType == null || operationType.trim().isEmpty()) {
return R.error("操作类型不能为空"); return R.error("操作类型不能为空");
} }
@ -159,7 +160,7 @@ public class OtherInboundController extends AbstractController {
// 调用存储过程GetScanLabelVerification // 调用存储过程GetScanLabelVerification
otherInboundService.validateLabelWithOtherInbound( otherInboundService.validateLabelWithOtherInbound(
site, buNo, inboundNo, materialCode, actualQty, batchNo, warehouseId, operationType, documentType, userName);
site, buNo, inboundNo, materialCode, actualQty, batchNo, warehouseId, operationType, documentType, userName, rollNo);
return R.ok("操作成功"); return R.ok("操作成功");
} catch (Exception e) { } catch (Exception e) {
logger.error("验证标签失败", e); logger.error("验证标签失败", e);

2
src/main/java/com/gaotao/modules/otherInbound/service/OtherInboundService.java

@ -59,7 +59,7 @@ public interface OtherInboundService {
*/ */
void validateLabelWithOtherInbound(String site, String buNo, String inboundNo, String materialCode, void validateLabelWithOtherInbound(String site, String buNo, String inboundNo, String materialCode,
Double actualQty, String batchNo, String warehouseId, Double actualQty, String batchNo, String warehouseId,
String operationType, String documentType, String userName);
String operationType, String documentType, String userName, String rollNo);
/** /**
* 获取已扫描标签列表从ScannedRollTempTable缓存表 * 获取已扫描标签列表从ScannedRollTempTable缓存表

8
src/main/java/com/gaotao/modules/otherInbound/service/impl/OtherInboundServiceImpl.java

@ -60,9 +60,9 @@ public class OtherInboundServiceImpl implements OtherInboundService {
@Override @Override
public void validateLabelWithOtherInbound(String site, String buNo, String inboundNo, String materialCode, public void validateLabelWithOtherInbound(String site, String buNo, String inboundNo, String materialCode,
Double actualQty, String batchNo, String warehouseId, Double actualQty, String batchNo, String warehouseId,
String operationType, String documentType, String userName) {
logger.info("调用GetScanLabelVerification存储过程,站点: {}, 入库单: {}, 物料: {}, 数量: {}, 批次: {}, 操作类型: {}, 单据类型: {}, 用户: {}",
site, inboundNo, materialCode, actualQty, batchNo, operationType, documentType, userName);
String operationType, String documentType, String userName, String rollNo) {
logger.info("调用GetScanLabelVerification存储过程,站点: {}, 入库单: {}, 物料: {}, 数量: {}, 批次: {}, 操作类型: {}, 单据类型: {}, 用户: {}, rollNo:{}",
site, inboundNo, materialCode, actualQty, batchNo, operationType, documentType, userName, rollNo);
try { try {
// 调用存储过程 GetScanLabelVerification参考采购入库功能 // 调用存储过程 GetScanLabelVerification参考采购入库功能
@ -75,7 +75,7 @@ public class OtherInboundServiceImpl implements OtherInboundService {
params.add(""); // 参数5: 空字符串 params.add(""); // 参数5: 空字符串
params.add(materialCode != null ? materialCode : ""); // 参数6: 物料编码 params.add(materialCode != null ? materialCode : ""); // 参数6: 物料编码
params.add(actualQty != null ? actualQty : 0.0); // 参数7: 数量 params.add(actualQty != null ? actualQty : 0.0); // 参数7: 数量
params.add(""); // 参数8: 空字符串
params.add(rollNo != null ? rollNo : ""); // 参数8: rollNo
params.add(batchNo != null ? batchNo : ""); // 参数9: 批次号 params.add(batchNo != null ? batchNo : ""); // 参数9: 批次号
params.add("其他入库"); // 参数10: 单据类型 params.add("其他入库"); // 参数10: 单据类型
params.add(operationType != null ? operationType : ""); // 参数11: 操作类型 I-添加 D-移除 params.add(operationType != null ? operationType : ""); // 参数11: 操作类型 I-添加 D-移除

19
src/main/resources/mapper/schedule/ScheduleMapper.xml

@ -940,20 +940,10 @@
sfr.RollQty rollQty, sfr.RollQty rollQty,
sfr.FirstLevelRollNo firstLevelRollNo, sfr.FirstLevelRollNo firstLevelRollNo,
sfr.VirtualRollFlag virtualRollFlag, sfr.VirtualRollFlag virtualRollFlag,
B.good_qty goodQty,
B.defect_qty defectQty,
B.total_qty totalQty,
CASE
WHEN total_qty = 0 THEN
CAST (0 AS DECIMAL(18, 2))
ELSE
CAST (
ROUND(
CAST (good_qty AS DECIMAL(20, 6)) / total_qty * 100,
2
) AS DECIMAL (18, 2)
)
END AS yieldRate
SUM(B.good_qty) AS goodQty,
SUM(B.defect_qty) AS defectQty,
SUM(B.total_qty) AS totalQty,
CASE WHEN SUM(B.total_qty) = 0 THEN CAST(0 AS DECIMAL(18, 2)) ELSE CAST( ROUND( CAST(SUM(B.good_qty) AS DECIMAL(20, 6)) / SUM(B.total_qty) * 100, 2) AS DECIMAL(18, 2) ) END AS yieldRate
FROM FROM
SFDC_Rolls sfr SFDC_Rolls sfr
LEFT JOIN ProductionReport B ON sfr.Site = B.site LEFT JOIN ProductionReport B ON sfr.Site = B.site
@ -978,6 +968,7 @@
AND sfr.RollNo = #{rollNo} AND sfr.RollNo = #{rollNo}
</if> </if>
</where> </where>
GROUP BY sfr.Site,sfr.OrderNo,sfr.RollNo,sfr.CreatedDate,sfr.Createdby,sfr.CurrentOpsItemNo,sfr.LastFinishedOpsItemNo,sfr.FinishedDate,sfr.FinishedFlag,sfr.OnLineFlag,sfr.PauseFlag,sfr.OriRollNo,sfr.StartOpsItemNo,sfr.RollType,sfr.CreatedOpsItemNo,sfr.CreatedOpsSeqNo,sfr.RollQty,sfr.FirstLevelRollNo,sfr.VirtualRollFlag
ORDER BY sfr.RollNo ORDER BY sfr.RollNo
</select> </select>

Loading…
Cancel
Save