|
@@ -202,7 +202,7 @@ public class AddOrderJob implements Job,ApplicationContextAware {
|
|
|
listSon = senYuDataSourceThree.queryForList(sql);
|
|
|
}
|
|
|
List<JSONObject> jianSon = JsonChangeUtils.toJSONObject(listSon);
|
|
|
- int size = 0;
|
|
|
+ List<SyOrderDataItem> syItemList = new ArrayList<>();
|
|
|
for (JSONObject Object:jianSon) {
|
|
|
SyOrderDataItem sy2 = JSONObject.toJavaObject(Object, SyOrderDataItem.class);
|
|
|
sy2.setId(sy.getAccount()+sy2.getId());
|
|
@@ -240,15 +240,13 @@ public class AddOrderJob implements Job,ApplicationContextAware {
|
|
|
sy2.setRSupplier(rsup.get(1));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- syOrderDataItemService.save(sy2);
|
|
|
- size++;
|
|
|
+ syItemList.add(sy2);
|
|
|
}
|
|
|
//添加单证id 原数据账套+原数据id
|
|
|
String syId = sy.getId();
|
|
|
sy.setId(sy.getAccount()+sy.getId());
|
|
|
|
|
|
- if(size<=0){
|
|
|
+ if(syItemList.size()<jianSon.size()){
|
|
|
//回写不拉取的数据状态 0
|
|
|
String blackWrite = "UPDATE SO_SOMain SET cdefine15 = '0' WHERE id='"+syId+"'";
|
|
|
if(sy.getAccount().equals("901")){
|
|
@@ -260,7 +258,10 @@ public class AddOrderJob implements Job,ApplicationContextAware {
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
|
- //添加主表数据进入数据库
|
|
|
+ //添加主子表数据进入数据库
|
|
|
+ for (SyOrderDataItem sy2:syItemList) {
|
|
|
+ syOrderDataItemService.save(sy2);
|
|
|
+ }
|
|
|
syOrderDataService.save(sy);
|
|
|
//回写拉取的数据状态 1
|
|
|
String blackWrite = "UPDATE SO_SOMain SET cdefine15 = '1' WHERE id='"+syId+"'";
|