|
@@ -18,6 +18,7 @@ import com.ruoyi.framework.config.ThreadPoolConfig;
|
|
|
import com.sd.business.entity.bom.bo.BomSpecBo;
|
|
|
import com.sd.business.entity.department.po.Department;
|
|
|
import com.sd.business.entity.excel.enums.ExcelTypeEnum;
|
|
|
+import com.sd.business.entity.order.enums.OrderClassifyEnum;
|
|
|
import com.sd.business.entity.order.po.OrderInfo;
|
|
|
import com.sd.business.entity.order.po.OrderSku;
|
|
|
import com.sd.business.entity.order.po.OrderSkuBom;
|
|
@@ -262,9 +263,6 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
// 获取订单sku
|
|
|
List<OrderSku> orderSkuList = orderSkuService.list(q -> q.in(OrderSku::getOrderId, orderIdList));
|
|
|
|
|
|
- // 查询委外订单
|
|
|
- Map<Long, OrderInfo> map = orderService.mapKEntity(BaseIdPo::getId, q -> q.in(BaseIdPo::getId, orderIdList).eq(OrderInfo::getType, 2));
|
|
|
-
|
|
|
// 生成结果集
|
|
|
List<DocumentBySkuVo> documentBySkuVoList = orderSkuList.stream()
|
|
|
.map(item -> DocumentBySkuVo.builder()
|
|
@@ -282,13 +280,6 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
.build())
|
|
|
.peek(item -> item.setSubtotal(ObjectUtil.equals(item.getQuantity(), BigDecimal.ZERO) ? item.getUnitPrice() : item.getQuantity().multiply(item.getUnitPrice())))
|
|
|
.peek(item -> item.setTotal(item.getSubtotal()))
|
|
|
- .peek(item -> {
|
|
|
- // 判断是否是委外订单,如果是委外订单时将bom数量修改为0
|
|
|
- OrderInfo orderInfo = map.get(item.getOrderId());
|
|
|
- if (ObjectUtil.isNotEmpty(orderInfo)) {
|
|
|
- item.setQuantity(BigDecimal.ZERO);
|
|
|
- }
|
|
|
- })
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
// 赋值sku规格品名和品号
|
|
@@ -323,9 +314,6 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
|
|
|
|
- // 查询委外订单
|
|
|
- Map<Long, OrderInfo> map = orderService.mapKEntity(BaseIdPo::getId, q -> q.in(BaseIdPo::getId, orderIdList).eq(OrderInfo::getType, 2));
|
|
|
-
|
|
|
// 获取订单sku
|
|
|
List<OrderSku> orderSkuList = orderSkuService.list(q -> q.in(OrderSku::getOrderId, orderIdList));
|
|
|
|
|
@@ -356,13 +344,6 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
.add(item.getManagementFeeSummary())
|
|
|
))
|
|
|
.peek(item -> item.setTotal(item.getSubtotal()))
|
|
|
- .peek(item -> {
|
|
|
- // 判断是否是委外订单,如果是委外订单时将bom数量修改为0
|
|
|
- OrderInfo orderInfo = map.get(item.getOrderId());
|
|
|
- if (ObjectUtil.isNotEmpty(orderInfo)) {
|
|
|
- item.setQuantity(BigDecimal.ZERO);
|
|
|
- }
|
|
|
- })
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
// 赋值主材bom品名品号
|
|
@@ -534,7 +515,7 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
case 3:
|
|
|
excelGenerateLogService.generateExcel(ExcelTypeEnum.STATISTICS_DOCUMENT_BY_ORDER,
|
|
|
new DocumentByOrderExcelExportStrategy(idList, departmentName, date, date, orderClassify),
|
|
|
- DateUtil.formatDate(new Date()) + " 对账单");
|
|
|
+ DateUtil.formatDate(new Date()) + " " + OrderClassifyEnum.getEnum(orderClassify).getValue() + "-订单对账单");
|
|
|
break;
|
|
|
default:
|
|
|
throw new ServiceException("未知对账单类型");
|
|
@@ -549,6 +530,12 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
return JSON.toJSONString(wlnCodeList);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public StatementOrderClassifyTotalCountVo getOrderClassifyTotalCount(List<Long> idList) {
|
|
|
+ Assert.notEmpty(idList, "对账单id不能为空");
|
|
|
+ return orderService.getOrderClassifyTotalCount(idList);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据对账单id获取对账订单id列表
|
|
|
*/
|
|
@@ -564,10 +551,6 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
*/
|
|
|
private List<DocumentByOrderVo.SkuSpec> getSkuSpecList(List<OrderSku> orderSkuList) {
|
|
|
|
|
|
- List<Long> orderIdList = orderSkuList.stream().map(OrderSku::getOrderId).collect(Collectors.toList());
|
|
|
- // 查询委外订单
|
|
|
- Map<Long, OrderInfo> map = orderService.mapKEntity(BaseIdPo::getId, q -> q.in(BaseIdPo::getId, orderIdList).eq(OrderInfo::getType, 2));
|
|
|
-
|
|
|
List<DocumentByOrderVo.SkuSpec> skuSpecList = orderSkuList.stream()
|
|
|
.map(item -> {
|
|
|
DocumentByOrderVo.SkuSpec skuSpec = new DocumentByOrderVo.SkuSpec();
|
|
@@ -585,14 +568,6 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
return skuSpec;
|
|
|
})
|
|
|
.peek(item -> item.setSubtotal(item.getQuantity().multiply(item.getUnitPrice())))
|
|
|
- .peek(item -> {
|
|
|
-
|
|
|
- OrderInfo tempOrderInfo = map.get(item.getOrderId());
|
|
|
- // 判断是否是委外订单,如果是委外订单时将bom数量修改为0
|
|
|
- if (ObjectUtil.isNotEmpty(tempOrderInfo)) {
|
|
|
- item.setQuantity(BigDecimal.ZERO);
|
|
|
- }
|
|
|
- })
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
skuSpecService.attributeAssign(skuSpecList, DocumentByOrderVo.SkuSpec::getSkuSpecId, (item, skuSpec) -> {
|
|
@@ -607,8 +582,6 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
* 获取订单bom
|
|
|
*/
|
|
|
private List<DocumentByOrderVo.BomSpec> getBomSpecList(List<Long> orderIdList, List<OrderSku> orderSkuList) {
|
|
|
- // 查询委外订单
|
|
|
- Map<Long, OrderInfo> orderMap = orderService.mapKEntity(BaseIdPo::getId, q -> q.in(BaseIdPo::getId, orderIdList).eq(OrderInfo::getType, 2));
|
|
|
|
|
|
// 主材
|
|
|
List<DocumentByOrderVo.BomSpec> bomSpecList = orderSkuList.stream()
|
|
@@ -616,9 +589,7 @@ public class StatementOfAccountServiceImpl extends ServiceImpl<StatementOfAccoun
|
|
|
DocumentByOrderVo.BomSpec bomSpec = new DocumentByOrderVo.BomSpec();
|
|
|
bomSpec.setOrderSkuId(item.getId());
|
|
|
bomSpec.setBomSpecId(item.getBomSpecId());
|
|
|
- // 判断是否是委外订单,如果是委外订单时将bom数量修改为0
|
|
|
- bomSpec.setQuantity(ObjectUtil.isNotEmpty(orderMap.get(item.getOrderId()))
|
|
|
- ? BigDecimal.ZERO : item.getQuantity());
|
|
|
+ bomSpec.setQuantity(item.getQuantity());
|
|
|
bomSpec.setUnitPrice(item.getUnitPrice());
|
|
|
bomSpec.setCustomProcessingType(item.getCustomProcessingType());
|
|
|
bomSpec.setLaserLogoSummary((Objects.equals(item.getCustomProcessingType(), "20")
|