|
|
|
|
@ -1,19 +1,32 @@ |
|
|
|
|
package org.springblade.desk.order.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartEntity; |
|
|
|
|
import org.springblade.desk.dashboard.service.IDsPartService; |
|
|
|
|
import org.springblade.desk.order.mapper.MoldDemandMapper; |
|
|
|
|
import org.springblade.desk.order.pojo.entity.MoldApply; |
|
|
|
|
import org.springblade.desk.order.pojo.entity.MoldDemand; |
|
|
|
|
import org.springblade.desk.order.pojo.entity.YieldOrder; |
|
|
|
|
import org.springblade.desk.order.pojo.enums.MoldDemandEnum; |
|
|
|
|
import org.springblade.desk.order.pojo.vo.MoldApplyVo; |
|
|
|
|
import org.springblade.desk.order.pojo.vo.MoldDemandVo; |
|
|
|
|
import org.springblade.desk.order.service.IMoldApplyService; |
|
|
|
|
import org.springblade.desk.order.service.IMoldDemandService; |
|
|
|
|
import org.springblade.desk.order.service.IYieldOrderService; |
|
|
|
|
import org.springblade.desk.order.service.IYieldPlanService; |
|
|
|
|
import org.springblade.desk.order.wrapper.MoldApplyWrapper; |
|
|
|
|
import org.springblade.desk.order.wrapper.MoldDemandWrapper; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 服务实现类 |
|
|
|
|
@ -27,6 +40,7 @@ public class MoldDemandServiceImpl extends BaseServiceImpl<MoldDemandMapper, Mol |
|
|
|
|
private final IDsPartService dsPartService; |
|
|
|
|
private final IYieldPlanService planService; |
|
|
|
|
private final IYieldOrderService orderService; |
|
|
|
|
private final IMoldApplyService moldApplyService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<MoldDemand> selectPage(IPage<MoldDemand> page, MoldDemand entity) { |
|
|
|
|
@ -97,4 +111,26 @@ public class MoldDemandServiceImpl extends BaseServiceImpl<MoldDemandMapper, Mol |
|
|
|
|
// return this.save(planList);
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public MoldDemandVo detail(String id) { |
|
|
|
|
MoldDemand detail = baseMapper.getDetailById(id); |
|
|
|
|
MoldDemandVo vo = MoldDemandWrapper.build().entityVO(detail); |
|
|
|
|
if(StringUtils.isNotEmpty(vo.getLinkOrderIds())){ |
|
|
|
|
List<Long> orderIdList = Arrays.stream(vo.getLinkOrderIds().split(",")) |
|
|
|
|
.map(String::trim) |
|
|
|
|
.filter(s ->!s.isEmpty()) |
|
|
|
|
.map(Long::valueOf) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
List<YieldOrder> orderList = orderService.list(Wrappers.<YieldOrder>lambdaQuery().in(BaseEntity::getId,orderIdList)); |
|
|
|
|
vo.setLinkOrderList(orderList); |
|
|
|
|
} |
|
|
|
|
MoldApply moldApply = moldApplyService.getDetailByPartCode(detail.getPartCode()); |
|
|
|
|
MoldApplyVo moldApplyVo = MoldApplyWrapper.build().entityVO(moldApply); |
|
|
|
|
List<MoldApplyVo> moldApplyList = new ArrayList<>(); |
|
|
|
|
moldApplyList.add(moldApplyVo); |
|
|
|
|
vo.setToolUseList(null); |
|
|
|
|
vo.setNearlyApplyList(moldApplyList); |
|
|
|
|
return vo; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|