|
|
@@ -165,6 +165,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
PurchaseApCheck check = purchaseApCheckDao.findOne(id);
|
|
|
if (check != null) {
|
|
|
if (!CollectionUtils.isEmpty(check.getItems()) && check.getCheckStatus().equals("不同意")) {
|
|
|
+ List<String> sqls = new ArrayList<>();
|
|
|
for (PurchaseApCheckItem item : check.getItems()) {
|
|
|
item.setCheckQty(0.0);
|
|
|
Double newYCheckQtyVal = item.getOldYCheckQty();
|
|
|
@@ -201,8 +202,17 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
}
|
|
|
String sql = "update " + sourceTable + " set " + yCheckQtyName + " = " + newYCheckQtyVal + " where "
|
|
|
+ idName + " = " + sourceIdVal;
|
|
|
- commonDao.getJdbcTemplate().execute(sql);
|
|
|
+ sqls.add(sql);
|
|
|
}
|
|
|
+ if (!CollectionUtils.isEmpty(sqls)) {
|
|
|
+ try {
|
|
|
+ commonDao.getJdbcTemplate().batchUpdate(sqls.toArray(new String[sqls.size()]));
|
|
|
+ } catch (RuntimeException e) {
|
|
|
+ System.out.println("生成对账单批量更新来源数据失败: " + e.getMessage());
|
|
|
+ throw new IllegalOperatorException("保存失败!");
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
check.setCheckStatus("已作废");
|
|
|
purchaseApCheckDao.save(check);
|
|
|
@@ -224,6 +234,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
@Override
|
|
|
public void updateYCheckQty(List<HashMap<String, Object>> list) {
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
+ List<String> sqls = new ArrayList<>();
|
|
|
for (HashMap<String, Object> map : list) {
|
|
|
Set<String> keySet = map.keySet();
|
|
|
Double newYCheckQtyVal = null;
|
|
|
@@ -264,9 +275,15 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
}
|
|
|
String sql = "update " + sourceTable + " set " + yCheckQtyName + " = " + newYCheckQtyVal + " where "
|
|
|
+ idName + " = " + sourceIdVal;
|
|
|
- commonDao.getJdbcTemplate().execute(sql);
|
|
|
-
|
|
|
+ sqls.add(sql);
|
|
|
}
|
|
|
+ if (!CollectionUtils.isEmpty(sqls)) {
|
|
|
+ try {
|
|
|
+ commonDao.getJdbcTemplate().batchUpdate(sqls.toArray(new String[sqls.size()]));
|
|
|
+ } catch (RuntimeException e) {
|
|
|
+ System.out.println("生成对账单批量更新来源数据失败: " + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|