|
@@ -107,17 +107,17 @@ public class BusinessFsOutConfirmServiceImpl extends ServiceImpl<BusinessFsOutCo
|
107
|
107
|
.eq(BusinessStoreWareDetail::getZid, id)
|
108
|
108
|
.eq(BusinessStoreWareDetail::getType, "contract"));
|
109
|
109
|
|
110
|
|
- List<BusinessStoreWareDetailVO> storeWareDetailVOList = new ArrayList<>();
|
|
110
|
+ List<BusinessStoreWareDetailDataVO> storeWareDetailVOList = new ArrayList<>();
|
111
|
111
|
|
112
|
112
|
if (CollectionUtil.isNotEmpty(storeWareDetailList)) {
|
113
|
113
|
for (BusinessStoreWareDetail businessStoreWareDetail : storeWareDetailList) {
|
114
|
|
- BusinessStoreWareDetailVO storeWareDetailVO = new BusinessStoreWareDetailVO();
|
|
114
|
+ BusinessStoreWareDetailDataVO storeWareDetailVO = new BusinessStoreWareDetailDataVO();
|
115
|
115
|
|
116
|
116
|
//获取仓房
|
117
|
117
|
BasicEnum houseInfo = basicEnumMapper.selectById(businessStoreWareDetail.getHouseId());
|
118
|
118
|
if (ObjectUtils.isNotEmpty(houseInfo)) {
|
119
|
|
- storeWareDetailVO.setHouseId(businessStoreWareDetail.getHouseId());
|
120
|
|
- storeWareDetailVO.setHouseName(houseInfo.getEnumname());
|
|
119
|
+ storeWareDetailVO.setBasicStorehouseId(businessStoreWareDetail.getHouseId());
|
|
120
|
+ storeWareDetailVO.setBasicStorehouseName(houseInfo.getEnumname());
|
121
|
121
|
}
|
122
|
122
|
|
123
|
123
|
//获取货位
|
|
@@ -130,18 +130,18 @@ public class BusinessFsOutConfirmServiceImpl extends ServiceImpl<BusinessFsOutCo
|
130
|
130
|
//获取品种
|
131
|
131
|
BasicEnum grainKind = basicEnumMapper.selectById(businessStoreWareDetail.getGrainKind());
|
132
|
132
|
if (ObjectUtils.isNotEmpty(grainKind)) {
|
133
|
|
- storeWareDetailVO.setGrainKind(businessStoreWareDetail.getGrainKind());
|
134
|
|
- storeWareDetailVO.setGrainKindName(grainKind.getEnumname());
|
|
133
|
+ storeWareDetailVO.setGrainVarietyId(businessStoreWareDetail.getGrainKind());
|
|
134
|
+ storeWareDetailVO.setGrainVarietyName(grainKind.getEnumname());
|
135
|
135
|
}
|
136
|
136
|
//获取性质
|
137
|
137
|
BasicEnum grainAttribute = basicEnumMapper.selectById(businessStoreWareDetail.getGrainAttribute());
|
138
|
138
|
if (ObjectUtils.isNotEmpty(grainAttribute)) {
|
139
|
|
- storeWareDetailVO.setGrainAttribute(businessStoreWareDetail.getGrainAttribute());
|
140
|
|
- storeWareDetailVO.setGrainAttributeName(grainAttribute.getEnumname());
|
|
139
|
+ storeWareDetailVO.setGrainNatureId(businessStoreWareDetail.getGrainAttribute());
|
|
140
|
+ storeWareDetailVO.setGrainNatureName(grainAttribute.getEnumname());
|
141
|
141
|
}
|
142
|
142
|
|
143
|
143
|
//销售合同使用轮出价格,数量和总价
|
144
|
|
- storeWareDetailVO.setInPrice(businessStoreWareDetail.getOutPrice() == null ? "0.0" : businessStoreWareDetail.getOutPrice());
|
|
144
|
+ storeWareDetailVO.setSettlePrice(businessStoreWareDetail.getOutPrice() == null ? "0.0" : businessStoreWareDetail.getOutPrice());
|
145
|
145
|
|
146
|
146
|
//获取保存的确认单数量
|
147
|
147
|
Double sum = businessFsOutConfirmMapper.selectSum(id, businessStoreWareDetail.getGrainKind(), businessStoreWareDetail.getGrainAttribute());
|
|
@@ -155,39 +155,39 @@ public class BusinessFsOutConfirmServiceImpl extends ServiceImpl<BusinessFsOutCo
|
155
|
155
|
double num = Double.parseDouble(businessStoreWareDetail.getOutCount()) - sum;
|
156
|
156
|
|
157
|
157
|
if (num <= 0) {
|
158
|
|
- storeWareDetailVO.setInCount("0.0");
|
|
158
|
+ storeWareDetailVO.setSettleQuantity("0.0");
|
159
|
159
|
storeWareDetailVOList.add(storeWareDetailVO);
|
160
|
160
|
} else {
|
161
|
|
- storeWareDetailVO.setInCount(Double.toString(num));
|
|
161
|
+ storeWareDetailVO.setSettleQuantity(Double.toString(num));
|
162
|
162
|
storeWareDetailVOList.add(storeWareDetailVO);
|
163
|
163
|
}
|
164
|
164
|
}
|
165
|
165
|
}
|
166
|
166
|
|
167
|
167
|
|
168
|
|
- List<BusinessStoreWareDetailVO> list = new ArrayList<>();
|
|
168
|
+ List<BusinessStoreWareDetailDataVO> list = new ArrayList<>();
|
169
|
169
|
|
170
|
170
|
//通过仓房,货位,品种,性质进行汇总
|
171
|
|
- Map<String, List<BusinessStoreWareDetailVO>> collect =
|
|
171
|
+ Map<String, List<BusinessStoreWareDetailDataVO>> collect =
|
172
|
172
|
storeWareDetailVOList.stream().collect(Collectors.groupingBy(this::fetchGroupKey));
|
173
|
173
|
|
174
|
174
|
|
175
|
|
- Set<Map.Entry<String, List<BusinessStoreWareDetailVO>>> entries = collect.entrySet();
|
|
175
|
+ Set<Map.Entry<String, List<BusinessStoreWareDetailDataVO>>> entries = collect.entrySet();
|
176
|
176
|
|
177
|
|
- for (Map.Entry<String, List<BusinessStoreWareDetailVO>> entry : entries) {
|
|
177
|
+ for (Map.Entry<String, List<BusinessStoreWareDetailDataVO>> entry : entries) {
|
178
|
178
|
int sum = 0;
|
179
|
|
- List<BusinessStoreWareDetailVO> value = entry.getValue();
|
180
|
|
- List<String> collect1 = value.stream().map(BusinessStoreWareDetailVO::getInCount).collect(Collectors.toList());
|
|
179
|
+ List<BusinessStoreWareDetailDataVO> value = entry.getValue();
|
|
180
|
+ List<String> collect1 = value.stream().map(BusinessStoreWareDetailDataVO::getSettleQuantity).collect(Collectors.toList());
|
181
|
181
|
for (String s : collect1) {
|
182
|
182
|
sum += Double.parseDouble(s);
|
183
|
183
|
}
|
184
|
|
- BusinessStoreWareDetailVO storeWareDetailVO = value.get(0);
|
185
|
|
- storeWareDetailVO.setInCount(String.valueOf(sum));
|
|
184
|
+ BusinessStoreWareDetailDataVO storeWareDetailVO = value.get(0);
|
|
185
|
+ storeWareDetailVO.setSettleQuantity(String.valueOf(sum));
|
186
|
186
|
list.add(storeWareDetailVO);
|
187
|
187
|
}
|
188
|
188
|
|
189
|
189
|
|
190
|
|
- vo.setStoreWareDetailVOList(list);
|
|
190
|
+ vo.setStoreWareDetailDataVOList(list);
|
191
|
191
|
|
192
|
192
|
return vo;
|
193
|
193
|
|
|
@@ -195,8 +195,8 @@ public class BusinessFsOutConfirmServiceImpl extends ServiceImpl<BusinessFsOutCo
|
195
|
195
|
}
|
196
|
196
|
|
197
|
197
|
|
198
|
|
- private String fetchGroupKey(BusinessStoreWareDetailVO vo) {
|
199
|
|
- return vo.getHouseId() + "_" + vo.getWarehouseId() + "_" + vo.getGrainKind() + "_" + vo.getGrainAttribute();
|
|
198
|
+ private String fetchGroupKey(BusinessStoreWareDetailDataVO vo) {
|
|
199
|
+ return vo.getBasicStorehouseId() + "_" + vo.getWarehouseId() + "_" + vo.getGrainVarietyId() + "_" + vo.getGrainNatureId();
|
200
|
200
|
}
|
201
|
201
|
|
202
|
202
|
/**
|
|
@@ -226,20 +226,20 @@ public class BusinessFsOutConfirmServiceImpl extends ServiceImpl<BusinessFsOutCo
|
226
|
226
|
//通过确认单获取合同信息
|
227
|
227
|
List<BusinessFsOutConfirmContractItem> businessFsOutConfirmContractItemList = businessFsOutConfirmContractItemMapper.selectList(new LambdaQueryWrapper<BusinessFsOutConfirmContractItem>()
|
228
|
228
|
.eq(BusinessFsOutConfirmContractItem::getFsOutConfirmId, businessFsOutConfirm.getId()));
|
229
|
|
- List<BusinessStoreWareDetailVO> listVO = new ArrayList<>();
|
|
229
|
+ List<BusinessStoreWareDetailDataVO> listVO = new ArrayList<>();
|
230
|
230
|
if (CollectionUtil.isNotEmpty(businessFsOutConfirmContractItemList)) {
|
231
|
231
|
for (BusinessFsOutConfirmContractItem businessFsOutConfirmContractItem : businessFsOutConfirmContractItemList) {
|
232
|
232
|
|
233
|
|
- BusinessStoreWareDetailVO storeWareDetailVO = new BusinessStoreWareDetailVO();
|
234
|
|
- storeWareDetailVO.setInCount(String.valueOf(businessFsOutConfirmContractItem.getSettleQuantity()));
|
235
|
|
- storeWareDetailVO.setInPrice(String.valueOf(businessFsOutConfirmContractItem.getSettlePrice()));
|
236
|
|
- storeWareDetailVO.setInDetailTotalPrice(String.valueOf(businessFsOutConfirmContractItem.getSettleAmount()));
|
|
233
|
+ BusinessStoreWareDetailDataVO storeWareDetailVO = new BusinessStoreWareDetailDataVO();
|
|
234
|
+ storeWareDetailVO.setSettleQuantity(String.valueOf(businessFsOutConfirmContractItem.getSettleQuantity()));
|
|
235
|
+ storeWareDetailVO.setSettlePrice(String.valueOf(businessFsOutConfirmContractItem.getSettlePrice()));
|
|
236
|
+ storeWareDetailVO.setSettleAmount(String.valueOf(businessFsOutConfirmContractItem.getSettleAmount()));
|
237
|
237
|
|
238
|
238
|
//设置仓房货位品种性质
|
239
|
239
|
BasicStorehouse basicStorehouse = basicStorehouseMapper.selectById(businessFsOutConfirmContractItem.getBasicStorehouseId());
|
240
|
240
|
if (ObjectUtils.isNotEmpty(basicStorehouse)) {
|
241
|
|
- storeWareDetailVO.setHouseId(businessFsOutConfirmContractItem.getBasicStorehouseId());
|
242
|
|
- storeWareDetailVO.setHouseName(basicStorehouse.getStorehouseName());
|
|
241
|
+ storeWareDetailVO.setBasicStorehouseId(businessFsOutConfirmContractItem.getBasicStorehouseId());
|
|
242
|
+ storeWareDetailVO.setBasicStorehouseName(basicStorehouse.getStorehouseName());
|
243
|
243
|
}
|
244
|
244
|
|
245
|
245
|
BasicWarehouse basicWarehouse = basicWarehouseMapper.selectById(businessFsOutConfirmContractItem.getWarehouseId());
|
|
@@ -250,19 +250,19 @@ public class BusinessFsOutConfirmServiceImpl extends ServiceImpl<BusinessFsOutCo
|
250
|
250
|
|
251
|
251
|
BasicEnum grainVariety = basicEnumMapper.selectById(businessFsOutConfirmContractItem.getGrainVarietyId());
|
252
|
252
|
if (ObjectUtils.isNotEmpty(grainVariety)) {
|
253
|
|
- storeWareDetailVO.setGrainKindName(grainVariety.getEnumname());
|
254
|
|
- storeWareDetailVO.setGrainKind(businessFsOutConfirmContractItem.getGrainVarietyId());
|
|
253
|
+ storeWareDetailVO.setGrainVarietyName(grainVariety.getEnumname());
|
|
254
|
+ storeWareDetailVO.setGrainVarietyId(businessFsOutConfirmContractItem.getGrainVarietyId());
|
255
|
255
|
}
|
256
|
256
|
BasicEnum grainNature = basicEnumMapper.selectById(businessFsOutConfirmContractItem.getGrainNatureId());
|
257
|
257
|
if (ObjectUtils.isNotEmpty(grainNature)) {
|
258
|
|
- storeWareDetailVO.setGrainAttribute(businessFsOutConfirmContractItem.getGrainNatureId());
|
259
|
|
- storeWareDetailVO.setGrainAttributeName(grainNature.getEnumname());
|
|
258
|
+ storeWareDetailVO.setGrainNatureId(businessFsOutConfirmContractItem.getGrainNatureId());
|
|
259
|
+ storeWareDetailVO.setGrainVarietyName(grainNature.getEnumname());
|
260
|
260
|
}
|
261
|
261
|
listVO.add(storeWareDetailVO);
|
262
|
262
|
|
263
|
263
|
}
|
264
|
264
|
}
|
265
|
|
- vo.setStoreWareDetailVOList(listVO);
|
|
265
|
+ vo.setStoreWareDetailDataVOList(listVO);
|
266
|
266
|
|
267
|
267
|
List<BusinessFsOutConfirmDiffPriceItem> fsOutConfirmDiffPriceItemList = businessFsOutConfirmDiffPriceItemMapper.selectList(new LambdaQueryWrapper<BusinessFsOutConfirmDiffPriceItem>()
|
268
|
268
|
.eq(BusinessFsOutConfirmDiffPriceItem::getFsOutConfirmId, businessFsOutConfirm.getId()));
|