取消重复报检

This commit is contained in:
lihao 2025-10-29 16:56:53 +08:00
parent 07bc6e7be8
commit 646c0d842f
1 changed files with 13 additions and 5 deletions

View File

@ -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);
}