|
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import io.swagger.v3.oas.annotations.Hidden; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.tenant.annotation.NonDS; |
|
|
|
|
@ -14,6 +15,7 @@ import org.springblade.desk.dashboard.pojo.entity.DsPartVersionEntity; |
|
|
|
|
import org.springblade.desk.dashboard.service.IDsCraftService; |
|
|
|
|
import org.springblade.desk.dashboard.service.IDsPartService; |
|
|
|
|
import org.springblade.desk.dashboard.service.IDsPartVersionService; |
|
|
|
|
import org.springblade.desk.dashboard.service.IDsTaskingService; |
|
|
|
|
import org.springblade.desk.order.pojo.entity.YieldOrder; |
|
|
|
|
import org.springblade.desk.order.pojo.entity.YieldPlan; |
|
|
|
|
import org.springblade.desk.order.service.IYieldOrderService; |
|
|
|
|
@ -32,6 +34,7 @@ import java.util.stream.Collectors; |
|
|
|
|
*/ |
|
|
|
|
@NonDS |
|
|
|
|
@Hidden() |
|
|
|
|
@Slf4j |
|
|
|
|
@RestController |
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
public class ApsOrderClient implements IApsOrderClient { |
|
|
|
|
@ -46,6 +49,8 @@ public class ApsOrderClient implements IApsOrderClient { |
|
|
|
|
|
|
|
|
|
private final IDsPartVersionService dsPartVersionService; |
|
|
|
|
|
|
|
|
|
private final IDsTaskingService dsTaskingService; |
|
|
|
|
|
|
|
|
|
//private final IErpMesRbWoClient mesRbWoClient;
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -127,8 +132,15 @@ public class ApsOrderClient implements IApsOrderClient { |
|
|
|
|
@Override |
|
|
|
|
public DsPartEntity getDsCraftListByCode(String prtno) { |
|
|
|
|
DsPartEntity part = null; |
|
|
|
|
boolean result = true; |
|
|
|
|
List<DsPartVersionEntity> partVersionList = dsPartVersionService.list(Wrappers.<DsPartVersionEntity>lambdaQuery().eq(DsPartVersionEntity::getPartCode,prtno)); |
|
|
|
|
if(CollectionUtils.isNotEmpty(partVersionList)){ |
|
|
|
|
// 同步零件前置 防止烧结订单没有零件信息
|
|
|
|
|
//如果零件信息为null,调用
|
|
|
|
|
if (CollectionUtils.isEmpty(partVersionList)) { |
|
|
|
|
log.info("零件信息为null,从老mes同步零件信息"); |
|
|
|
|
result = dsTaskingService.syncPart(null, null, prtno); |
|
|
|
|
} |
|
|
|
|
if(result){ |
|
|
|
|
Long partId = partVersionList.stream() |
|
|
|
|
.max(Comparator.comparing(DsPartVersionEntity::getPartVersion)) |
|
|
|
|
.map(DsPartVersionEntity::getPartId) |
|
|
|
|
|