|
1
|
package com.lframework.xingyun.sc.impl.statistics;
|
1
|
package com.lframework.xingyun.sc.impl.statistics;
|
|
2
|
|
2
|
|
|
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
4
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
3
|
import com.github.pagehelper.PageInfo;
|
5
|
import com.github.pagehelper.PageInfo;
|
|
4
|
import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
|
6
|
import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
|
|
5
|
import com.lframework.starter.web.core.utils.PageResultUtil;
|
7
|
import com.lframework.starter.web.core.utils.PageResultUtil;
|
|
@@ -26,6 +28,7 @@ import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo; |
|
@@ -26,6 +28,7 @@ import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo; |
|
26
|
import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo;
|
28
|
import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo;
|
|
27
|
import com.lframework.xingyun.sc.vo.statistics.orderDetail.CreateOrderDetailReportVo;
|
29
|
import com.lframework.xingyun.sc.vo.statistics.orderDetail.CreateOrderDetailReportVo;
|
|
28
|
import com.lframework.xingyun.sc.vo.statistics.orderDetail.QueryOrderDetailReportVo;
|
30
|
import com.lframework.xingyun.sc.vo.statistics.orderDetail.QueryOrderDetailReportVo;
|
|
|
|
31
|
+import com.lframework.xingyun.sc.vo.statistics.orderDetail.UpdateOrderDetailReportVo;
|
|
29
|
import org.apache.commons.collections.CollectionUtils;
|
32
|
import org.apache.commons.collections.CollectionUtils;
|
|
30
|
import org.apache.commons.lang3.StringUtils;
|
33
|
import org.apache.commons.lang3.StringUtils;
|
|
31
|
import org.springframework.stereotype.Service;
|
34
|
import org.springframework.stereotype.Service;
|
|
@@ -216,6 +219,30 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
|
@@ -216,6 +219,30 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
|
216
|
return data.getId();
|
219
|
return data.getId();
|
|
217
|
}
|
220
|
}
|
|
218
|
|
221
|
|
|
|
|
222
|
+ @OpLog(type = OtherOpLogType.class, name = "修改订单明细,ID:{}", params = {"#id"})
|
|
|
|
223
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
224
|
+ @Override
|
|
|
|
225
|
+ public void update(UpdateOrderDetailReportVo vo) {
|
|
|
|
226
|
+
|
|
|
|
227
|
+ LambdaUpdateWrapper<OrderDetailReport> updateWrapper = Wrappers.lambdaUpdate(OrderDetailReport.class)
|
|
|
|
228
|
+ .set(OrderDetailReport::getDeliveryDate, vo.getDeliveryDate() == null ? null : vo.getDeliveryDate())
|
|
|
|
229
|
+ .set(OrderDetailReport::getAssessmentExceedsAgreement, StringUtil.isBlank(vo.getAssessmentExceedsAgreement()) ? null : vo.getAssessmentExceedsAgreement())
|
|
|
|
230
|
+ .set(OrderDetailReport::getPriceListNo, StringUtil.isBlank(vo.getPriceListNo()) ? null : vo.getPriceListNo())
|
|
|
|
231
|
+ .set(OrderDetailReport::getPackagingFee, StringUtil.isBlank(vo.getPackagingFee()) ? null : vo.getPackagingFee())
|
|
|
|
232
|
+ .set(OrderDetailReport::getInvoicingStatus, StringUtil.isBlank(vo.getInvoicingStatus()) ? null : vo.getInvoicingStatus())
|
|
|
|
233
|
+ .set(OrderDetailReport::getPieceWeightHeader, StringUtil.isBlank(vo.getPieceWeightHeader()) ? null : vo.getPieceWeightHeader())
|
|
|
|
234
|
+ .set(OrderDetailReport::getSurface, StringUtil.isBlank(vo.getSurface()) ? null : vo.getSurface())
|
|
|
|
235
|
+ .set(OrderDetailReport::getTolerance, StringUtil.isBlank(vo.getTolerance()) ? null : vo.getTolerance())
|
|
|
|
236
|
+ .set(OrderDetailReport::getPerformance, StringUtil.isBlank(vo.getPerformance()) ? null : vo.getPerformance())
|
|
|
|
237
|
+ .set(OrderDetailReport::getPackaging, StringUtil.isBlank(vo.getPackaging()) ? null : vo.getPackaging())
|
|
|
|
238
|
+ .set(OrderDetailReport::getRemarks, StringUtil.isBlank(vo.getRemarks()) ? null : vo.getRemarks())
|
|
|
|
239
|
+ .set(OrderDetailReport::getShippingCost, StringUtil.isBlank(vo.getShippingCost()) ? null : vo.getShippingCost())
|
|
|
|
240
|
+ .eq(OrderDetailReport::getPurchaseOrderLineId, vo.getPurchaseOrderLineId());
|
|
|
|
241
|
+
|
|
|
|
242
|
+ getBaseMapper().update(updateWrapper);
|
|
|
|
243
|
+
|
|
|
|
244
|
+ }
|
|
|
|
245
|
+
|
|
219
|
@Override
|
246
|
@Override
|
|
220
|
public void processHistoricalData() {
|
247
|
public void processHistoricalData() {
|
|
221
|
QueryPurchaseOrderInfoVo vo2 = new QueryPurchaseOrderInfoVo();
|
248
|
QueryPurchaseOrderInfoVo vo2 = new QueryPurchaseOrderInfoVo();
|
|
@@ -223,7 +250,10 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
|
@@ -223,7 +250,10 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
|
223
|
if (CollectionUtils.isNotEmpty(query)) {
|
250
|
if (CollectionUtils.isNotEmpty(query)) {
|
|
224
|
for (PurchaseOrderInfo purchaseOrderInfo : query) {
|
251
|
for (PurchaseOrderInfo purchaseOrderInfo : query) {
|
|
225
|
ContractDistributorStandard standard = contractDistributorStandardService.findById(purchaseOrderInfo.getContractId());
|
252
|
ContractDistributorStandard standard = contractDistributorStandardService.findById(purchaseOrderInfo.getContractId());
|
|
226
|
- CustomerCredit customerCredit = customerCreditService.findById(purchaseOrderInfo.getCustomerCreditId());
|
253
|
+ CustomerCredit customerCredit = null;
|
|
|
|
254
|
+ if (StringUtils.isNotEmpty(purchaseOrderInfo.getCustomerCreditId())) {
|
|
|
|
255
|
+ customerCredit = customerCreditService.findById(purchaseOrderInfo.getCustomerCreditId());
|
|
|
|
256
|
+ }
|
|
227
|
QueryPurchaseOrderLineVo vo1 = new QueryPurchaseOrderLineVo();
|
257
|
QueryPurchaseOrderLineVo vo1 = new QueryPurchaseOrderLineVo();
|
|
228
|
vo1.setPurchaseOrderId(purchaseOrderInfo.getId());
|
258
|
vo1.setPurchaseOrderId(purchaseOrderInfo.getId());
|
|
229
|
List<PurchaseOrderLine> lineVoList = purchaseOrderLineService.query(vo1);
|
259
|
List<PurchaseOrderLine> lineVoList = purchaseOrderLineService.query(vo1);
|
|
@@ -262,14 +292,18 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
|
@@ -262,14 +292,18 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
|
262
|
vo.setSuggestedPrice(subtract.toPlainString());
|
292
|
vo.setSuggestedPrice(subtract.toPlainString());
|
|
263
|
} catch (NumberFormatException e) {
|
293
|
} catch (NumberFormatException e) {
|
|
264
|
// 日志记录或按业务处理:超协价格式无效,忽略计算
|
294
|
// 日志记录或按业务处理:超协价格式无效,忽略计算
|
|
265
|
- log.error("assessmentExceedsAgreement====>" + assessmentExceedsAgreement);
|
295
|
+ log.error("超协价格式错误,使用原始销售价。value=" + assessmentExceedsAgreement);
|
|
266
|
}
|
296
|
}
|
|
267
|
}
|
297
|
}
|
|
268
|
vo.setDeliveryDate(line.getDeliveryDate());
|
298
|
vo.setDeliveryDate(line.getDeliveryDate());
|
|
269
|
vo.setAssessmentExceedsAgreement(line.getAssessmentExceedsAgreement());
|
299
|
vo.setAssessmentExceedsAgreement(line.getAssessmentExceedsAgreement());
|
|
270
|
- vo.setSalesPrice(line.getSalesPrice().toPlainString());
|
300
|
+ if (line.getSalesPrice() != null) {
|
|
|
|
301
|
+ vo.setSalesPrice(line.getSalesPrice().toPlainString());
|
|
|
|
302
|
+ }
|
|
271
|
vo.setPriceListNo(purchaseOrderInfo.getPriceListNo());
|
303
|
vo.setPriceListNo(purchaseOrderInfo.getPriceListNo());
|
|
272
|
- vo.setPackagingFee(line.getPackagingFee().toPlainString());
|
304
|
+ if (line.getPackagingFee() != null) {
|
|
|
|
305
|
+ vo.setPackagingFee(line.getPackagingFee().toPlainString());
|
|
|
|
306
|
+ }
|
|
273
|
vo.setInvoicingStatus(purchaseOrderInfo.getInvoicingStatus());
|
307
|
vo.setInvoicingStatus(purchaseOrderInfo.getInvoicingStatus());
|
|
274
|
vo.setPieceWeightHeader(purchaseOrderInfo.getPieceWeightHeader());
|
308
|
vo.setPieceWeightHeader(purchaseOrderInfo.getPieceWeightHeader());
|
|
275
|
vo.setSurface(purchaseOrderInfo.getSurface());
|
309
|
vo.setSurface(purchaseOrderInfo.getSurface());
|
|
@@ -295,14 +329,14 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
|
@@ -295,14 +329,14 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR |
|
295
|
vo.setContractType(contractType);
|
329
|
vo.setContractType(contractType);
|
|
296
|
if ("加工".equals(contractType)) {
|
330
|
if ("加工".equals(contractType)) {
|
|
297
|
String contractDistributorLineId = line.getContractDistributorLineId();
|
331
|
String contractDistributorLineId = line.getContractDistributorLineId();
|
|
298
|
- ContractStdProcessingLine processingLine = contractStdProcessingLineService.findById(contractDistributorLineId);
|
|
|
|
299
|
-
|
|
|
|
300
|
- if (processingLine != null) {
|
|
|
|
301
|
- String materialProductRatio = processingLine.getMaterialProductRatio();
|
|
|
|
302
|
- SysDataDicItem dataDicItem = sysDataDicItemService.findByCode("RAW_TO_PROD_RATIO", materialProductRatio);
|
|
|
|
303
|
-
|
|
|
|
304
|
- if (dataDicItem != null) {
|
|
|
|
305
|
- vo.setContractType(dataDicItem.getName() + contractType);
|
332
|
+ if (StringUtils.isNotEmpty(contractDistributorLineId)) {
|
|
|
|
333
|
+ ContractStdProcessingLine processingLine = contractStdProcessingLineService.findById(contractDistributorLineId);
|
|
|
|
334
|
+ if (processingLine != null) {
|
|
|
|
335
|
+ String materialProductRatio = processingLine.getMaterialProductRatio();
|
|
|
|
336
|
+ SysDataDicItem dataDicItem = sysDataDicItemService.findByCode("RAW_TO_PROD_RATIO", materialProductRatio);
|
|
|
|
337
|
+ if (dataDicItem != null) {
|
|
|
|
338
|
+ vo.setContractType(dataDicItem.getName() + contractType);
|
|
|
|
339
|
+ }
|
|
306
|
}
|
340
|
}
|
|
307
|
}
|
341
|
}
|
|
308
|
}
|
342
|
}
|