|
@@ -49,6 +49,8 @@ public class OutServiceImpl implements OutService {
|
49
|
49
|
public PriceMapper priceMapper;
|
50
|
50
|
@Autowired
|
51
|
51
|
public InRecordMapper inRecordMapper;
|
|
52
|
+ @Autowired
|
|
53
|
+ public DistributionDetailMapper distributionDetailMapper;
|
52
|
54
|
|
53
|
55
|
String result = Type.FAIL;
|
54
|
56
|
int num = 0;
|
|
@@ -115,6 +117,12 @@ public class OutServiceImpl implements OutService {
|
115
|
117
|
OutRecord outRecord = getOutRecord(store, "", "0", userId);
|
116
|
118
|
num += outRecordMapper.insert(outRecord);
|
117
|
119
|
num += storeMapper.insert(store);
|
|
120
|
+
|
|
121
|
+ Distribution distribution = distributionMapper.selectByPrimaryKey(listOutRecord.get(i).getDistributionId());
|
|
122
|
+ distribution.setSumWeight(distribution.getSumWeight() - store.getWeight());
|
|
123
|
+ distribution.setSumCount(distribution.getSumCount() - store.getCount());
|
|
124
|
+ num = distributionMapper.updateByPrimaryKey(distribution);
|
|
125
|
+ num = distributionDetailMapper.deleteByStoreAndDis(distribution.getId(),store.getId());
|
118
|
126
|
}
|
119
|
127
|
result = Tools.moreThanZeroResultJSON(num);
|
120
|
128
|
} else {
|
|
@@ -131,6 +139,12 @@ public class OutServiceImpl implements OutService {
|
131
|
139
|
OutRecord outRecord = getOutRecord(store, "", "0", userId);
|
132
|
140
|
num += outRecordMapper.insert(outRecord);
|
133
|
141
|
num += storeMapper.insert(store);
|
|
142
|
+
|
|
143
|
+ Distribution distribution = distributionMapper.selectByPrimaryKey(listOutRecord.get(i).getDistributionId());
|
|
144
|
+ distribution.setSumWeight(distribution.getSumWeight() - store.getWeight());
|
|
145
|
+ distribution.setSumCount(distribution.getSumCount() - store.getCount());
|
|
146
|
+ num = distributionMapper.updateByPrimaryKey(distribution);
|
|
147
|
+ num = distributionDetailMapper.deleteByStoreAndDis(distribution.getId(),store.getId());
|
134
|
148
|
}
|
135
|
149
|
result = Tools.moreThanZeroResultJSON(num);
|
136
|
150
|
}
|