|
|
@ -2,6 +2,7 @@ package com.spring.modules.quote.service.impl; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
import com.spring.ifs.api.IfsServer; |
|
|
import com.spring.ifs.bean.BaseSearchBean; |
|
|
import com.spring.ifs.bean.BaseSearchBean; |
|
|
import com.spring.modules.part.entity.PartInformationEntity; |
|
|
import com.spring.modules.part.entity.PartInformationEntity; |
|
|
import com.spring.modules.part.vo.InventoryPartUnitCostSumVo; |
|
|
import com.spring.modules.part.vo.InventoryPartUnitCostSumVo; |
|
|
@ -9,6 +10,7 @@ import com.spring.modules.quote.entity.*; |
|
|
import com.spring.modules.quote.mapper.QuoteDetailBomTreeMapper; |
|
|
import com.spring.modules.quote.mapper.QuoteDetailBomTreeMapper; |
|
|
import com.spring.modules.quote.service.*; |
|
|
import com.spring.modules.quote.service.*; |
|
|
import com.spring.modules.sys.entity.SysUserEntity; |
|
|
import com.spring.modules.sys.entity.SysUserEntity; |
|
|
|
|
|
import com.spring.modules.sys.service.SysUserService; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.shiro.SecurityUtils; |
|
|
import org.apache.shiro.SecurityUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -32,6 +34,10 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
@Autowired |
|
|
@Autowired |
|
|
private QuoteDetailToolService quoteDetailToolService; |
|
|
private QuoteDetailToolService quoteDetailToolService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
|
|
|
private SysUserService sysUserService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IfsServer ifsServer; |
|
|
|
|
|
@Autowired |
|
|
private BaseSearchBean baseSearchBean; |
|
|
private BaseSearchBean baseSearchBean; |
|
|
@Override |
|
|
@Override |
|
|
@Transactional |
|
|
@Transactional |
|
|
@ -82,10 +88,12 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
// Part是正式料号需要从IFS获得成本信息 |
|
|
// Part是正式料号需要从IFS获得成本信息 |
|
|
if ("Y".equals(component.getStatus())){ |
|
|
if ("Y".equals(component.getStatus())){ |
|
|
SysUserEntity user = (SysUserEntity)SecurityUtils.getSubject().getPrincipal(); |
|
|
SysUserEntity user = (SysUserEntity)SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
|
// 获取用户信息 |
|
|
|
|
|
SysUserEntity sysUser = sysUserService.getById(user.getUserId()); |
|
|
PartInformationEntity part = new PartInformationEntity(); |
|
|
PartInformationEntity part = new PartInformationEntity(); |
|
|
part.setSite(component.getSite()); |
|
|
part.setSite(component.getSite()); |
|
|
part.setPartNo(component.getComponentPart()); |
|
|
part.setPartNo(component.getComponentPart()); |
|
|
Map<String, String> map = baseSearchBean.getInventoryValueByPartNo(user.getServer(), part); |
|
|
|
|
|
|
|
|
Map<String, String> map = baseSearchBean.getInventoryValueByPartNo(ifsServer.getIfsServer(sysUser.getIfsUsername(),sysUser.getIfsPassword()), part); |
|
|
if (Objects.equals(map.get("resultCode"),"200")){ |
|
|
if (Objects.equals(map.get("resultCode"),"200")){ |
|
|
// 返回成功 将成本 |
|
|
// 返回成功 将成本 |
|
|
InventoryPartUnitCostSumVo unitCostSumVo = JSONObject.parseObject(map.get("obj"), InventoryPartUnitCostSumVo.class); |
|
|
InventoryPartUnitCostSumVo unitCostSumVo = JSONObject.parseObject(map.get("obj"), InventoryPartUnitCostSumVo.class); |
|
|
|