|
@@ -39,6 +39,7 @@ public class DistributionServiceImpl implements DistributionService {
|
39
|
39
|
String result = Type.FAIL;
|
40
|
40
|
int num = 0;
|
41
|
41
|
|
|
42
|
+
|
42
|
43
|
@Override
|
43
|
44
|
public String queryWaitTrucks(String userId, String belongId) {
|
44
|
45
|
|
|
@@ -79,14 +80,24 @@ public class DistributionServiceImpl implements DistributionService {
|
79
|
80
|
});
|
80
|
81
|
List<Store> list = JSON.parseObject(jsonList, new TypeReference<List<Store>>() {
|
81
|
82
|
});
|
82
|
|
- if (distribution.getListDetail().size() == list.size()) {
|
83
|
|
- distribution.setOutFlag("2");
|
84
|
|
- num += distributionMapper.updateByPrimaryKey(distribution);
|
85
|
|
- }
|
|
83
|
+
|
|
84
|
+ int detailnum = 0;
|
|
85
|
+ double detailwgt = 0;
|
|
86
|
+
|
86
|
87
|
for (int i = 0; i < list.size(); i++) {
|
87
|
88
|
list.get(i).setLockFlag("0");
|
|
89
|
+ detailnum += list.get(i).getCount();
|
|
90
|
+ detailwgt += list.get(i).getWeight();
|
88
|
91
|
num += storeMapper.updateByPrimaryKey(list.get(i));
|
89
|
92
|
}
|
|
93
|
+ if (distribution.getListDetail().size() == list.size()) {
|
|
94
|
+ distribution.setOutFlag("2");
|
|
95
|
+ num += distributionMapper.updateByPrimaryKey(distribution);
|
|
96
|
+ }else {
|
|
97
|
+ distribution.setSumCount(distribution.getSumCount() - detailnum);
|
|
98
|
+ distribution.setSumWeight(distribution.getSumWeight() - detailwgt);
|
|
99
|
+ num += distributionMapper.updateByPrimaryKey(distribution);
|
|
100
|
+ }
|
90
|
101
|
for (int i = 0; i < distribution.getListDetail().size(); i++) {
|
91
|
102
|
for (int j = 0; j < list.size(); j++) {
|
92
|
103
|
if (distribution.getListDetail().get(i).getStore().getId().equals(list.get(j).getId())) {
|