|
@@ -14,6 +14,7 @@ import com.ruoyi.common.core.domain.BaseSelectDto;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import com.sd.business.entity.bom.po.Bom;
|
|
|
import com.sd.business.entity.bom.po.BomSpec;
|
|
|
import com.sd.business.entity.department.po.Department;
|
|
|
import com.sd.business.entity.order.dto.OrderInfoDto;
|
|
@@ -27,13 +28,16 @@ import com.sd.business.entity.order.vo.OrderInfoVo;
|
|
|
import com.sd.business.entity.order.vo.OrderSkuBomVo;
|
|
|
import com.sd.business.entity.order.vo.OrderSkuVo;
|
|
|
import com.sd.business.entity.order.vo.SkuSpecPriceVo;
|
|
|
+import com.sd.business.entity.price.po.PriceBillingStandard;
|
|
|
import com.sd.business.entity.price.po.PriceBillingStandardDetail;
|
|
|
import com.sd.business.entity.sku.po.SkuSpec;
|
|
|
import com.sd.business.mapper.order.OrderMapper;
|
|
|
+import com.sd.business.service.bom.BomService;
|
|
|
import com.sd.business.service.bom.BomSpecService;
|
|
|
import com.sd.business.service.department.DepartmentService;
|
|
|
import com.sd.business.service.order.*;
|
|
|
import com.sd.business.service.price.PriceBillingStandardDetailService;
|
|
|
+import com.sd.business.service.price.PriceBillingStandardService;
|
|
|
import com.sd.business.service.sku.SkuSpecService;
|
|
|
import com.sd.framework.util.Assert;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -65,6 +69,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
|
|
|
private SkuSpecService skuSpecService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private BomService bomService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private BomSpecService bomSpecService;
|
|
|
|
|
|
@Autowired
|
|
@@ -77,6 +84,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
|
|
|
private OrderOperatingLogService orderOperatingLogService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private PriceBillingStandardService priceBillingStandardService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private PriceBillingStandardDetailService priceBillingStandardDetailService;
|
|
|
|
|
|
@Override
|
|
@@ -91,7 +101,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
|
|
|
wrapper.eq("o", OrderInfo::getSettlementStatus, dto.getSettlementStatus());
|
|
|
wrapper.ge("o", OrderInfo::getWlnCreateTime, dto.getBeginTime());
|
|
|
wrapper.le("o", OrderInfo::getWlnCreateTime, dto.getEndTime());
|
|
|
- wrapper.and(q -> q.and(r -> r.eq("o", OrderInfo::getWlnStorageCode, "T007").ge("o", OrderInfo::getWlnStatus, 2))
|
|
|
+ wrapper.and(q -> q
|
|
|
+ .and(r -> r.eq("o", OrderInfo::getWlnStorageCode, "T007").ge("o", OrderInfo::getWlnStatus, 2))
|
|
|
.or(r -> r.ne("o", OrderInfo::getWlnStorageCode, "T007")));
|
|
|
|
|
|
if (Objects.equals(dto.getLinkedStatementOfAccount(), 0)) {
|
|
@@ -282,15 +293,36 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
|
|
|
Assert.notNull(bomSpecId, "sku未绑定bom");
|
|
|
BomSpec bomSpec = bomSpecService.getById(bomSpecId);
|
|
|
Assert.notNull(bomSpec, "未知bom规格");
|
|
|
+ Bom bom = bomService.getById(bomSpec.getBomId());
|
|
|
+ Assert.notNull(bom, "未知bom");
|
|
|
|
|
|
// 其他价格查询
|
|
|
Long deptId = SecurityUtils.getDeptId();
|
|
|
Department department = departmentService.getById(deptId);
|
|
|
Assert.notNull(department, "未知事业部");
|
|
|
- Long priceBillingStandardId = department.getPriceBillingStandardId();
|
|
|
- Assert.notNull(priceBillingStandardId, "事业部未绑定加工计费标准");
|
|
|
- List<PriceBillingStandardDetail> priceBillingStandardDetailList = priceBillingStandardDetailService.list(
|
|
|
- q -> q.eq(PriceBillingStandardDetail::getPriceBillingStandardId, priceBillingStandardId));
|
|
|
+ String priceBillingStandardIdStr = department.getPriceBillingStandardId();
|
|
|
+ Assert.notBlank(priceBillingStandardIdStr, "事业部未绑定加工计费标准");
|
|
|
+
|
|
|
+ List<String> priceBillingStandardIdList = Arrays.stream(priceBillingStandardIdStr.split(",")).collect(Collectors.toList());
|
|
|
+ List<PriceBillingStandard> priceBillingStandardList = priceBillingStandardService.listByIds(priceBillingStandardIdList);
|
|
|
+
|
|
|
+ List<PriceBillingStandardDetail> priceBillingStandardDetailList = null;
|
|
|
+
|
|
|
+ if (StrUtil.isBlank(bom.getSpecies())) {
|
|
|
+ priceBillingStandardDetailList = Collections.emptyList();
|
|
|
+ } else {
|
|
|
+ for (PriceBillingStandard priceBillingStandard : priceBillingStandardList) {
|
|
|
+ if (Objects.equals(bom.getSpecies(), priceBillingStandard.getSpecies())) {
|
|
|
+ priceBillingStandardDetailList = priceBillingStandardDetailService.list(
|
|
|
+ q -> q.eq(PriceBillingStandardDetail::getPriceBillingStandardId, priceBillingStandard.getId()));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (priceBillingStandardDetailList == null) {
|
|
|
+ throw new ServiceException("没有找到加工计费标准");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 赋值
|
|
|
SkuSpecPriceVo skuSpecPriceVo = new SkuSpecPriceVo();
|