diff --git a/pu/src/client/nccloud/web/pu/arrival/action/QCRptDataPushtoQmsAction.java b/pu/src/client/nccloud/web/pu/arrival/action/QCRptDataPushtoQmsAction.java index a5b90823..d0f77696 100644 --- a/pu/src/client/nccloud/web/pu/arrival/action/QCRptDataPushtoQmsAction.java +++ b/pu/src/client/nccloud/web/pu/arrival/action/QCRptDataPushtoQmsAction.java @@ -97,7 +97,10 @@ public class QCRptDataPushtoQmsAction implements ICommonAction { validArriveList.add(arriveVO); } } - buildSyncData(arriveVOS); + if(validArriveList.isEmpty()){ + throw new BusinessException("已经报检不允许重复报检"); + } + buildSyncData(validArriveList.toArray(new ArriveVO[validArriveList.size()])); } catch (BusinessException e) { ExceptionUtils.wrapException(e); @@ -174,7 +177,10 @@ public class QCRptDataPushtoQmsAction implements ICommonAction { singleObj.put("Content", contentArray); pushData(singleObj); update.add(hvo.getPk_arriveorder()); - updateArrveOrder(hvo.getPk_arriveorder()); + // updateArrveOrder(hvo.getPk_arriveorder()); + } + if(update.size() > 0) { + updateArrveOrder(update.toArray(new String[update.size()])); } } @@ -187,10 +193,12 @@ public class QCRptDataPushtoQmsAction implements ICommonAction { return null; } - private void updateArrveOrder(String pkArriveorder) throws DAOException { + private void updateArrveOrder(String[] pkArriveorder) throws DAOException { BaseDAO dao = new BaseDAO(); - String sql = "update po_arriveorder_b set vbdef32='Y' where pk_arriveorder='" - + pkArriveorder + "'"; + // 将数组元素拼接为 '值1','值2',... 格式,适配IN条件 + String ids = String.join("','", pkArriveorder); + // 构建更新语句(where条件使用IN匹配数组中的所有值) + String sql = "update po_arriveorder_b set vbdef32='Y' where pk_arriveorder in ('" + ids + "')"; dao.executeUpdate(sql); }