|
|
@ -11,6 +11,7 @@ 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 com.spring.modules.sys.service.SysUserService; |
|
|
|
|
|
import ifs.fnd.ap.Server; |
|
|
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; |
|
|
@ -36,17 +37,16 @@ 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; |
|
|
|
|
|
|
|
|
@Value("${ifs-control.ifs-username}") |
|
|
|
|
|
private String ifsUsername; |
|
|
|
|
|
|
|
|
private Server server = null; |
|
|
|
|
|
|
|
|
|
|
|
public QuoteDetailBomTreeServiceImpl(IfsServer ifsServer, |
|
|
|
|
|
@Value("${ifs-control.ifs-username}")String ifsUsername, |
|
|
|
|
|
@Value("${ifs-control.ifs-password}") String ifsPassword) { |
|
|
|
|
|
this.server = ifsServer.getIfsServer(ifsUsername,ifsPassword); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Value("${ifs-control.ifs-password}") |
|
|
|
|
|
private String ifsPassword; |
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional |
|
|
@Transactional |
|
|
public long initQuoteDetailBomTree(QuoteDetail detail, Long parentId, Integer level) { |
|
|
public long initQuoteDetailBomTree(QuoteDetail detail, Long parentId, Integer level) { |
|
|
@ -109,7 +109,7 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
component.setBomFlag("N"); |
|
|
component.setBomFlag("N"); |
|
|
} |
|
|
} |
|
|
if ("Y".equals(component.getStatus())) { |
|
|
if ("Y".equals(component.getStatus())) { |
|
|
getFinalPartCost(component); |
|
|
|
|
|
|
|
|
getFinalPartCost(component,server); |
|
|
} |
|
|
} |
|
|
//新增子物料信息 |
|
|
//新增子物料信息 |
|
|
component.setTreeId(bom.getId()); |
|
|
component.setTreeId(bom.getId()); |
|
|
@ -163,11 +163,11 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
return purchase; |
|
|
return purchase; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void getFinalPartCost(QuoteDetailBom component) { |
|
|
|
|
|
|
|
|
private void getFinalPartCost(QuoteDetailBom component,Server ifsServer) { |
|
|
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(ifsServer.getIfsServer(ifsUsername,ifsPassword), part); |
|
|
|
|
|
|
|
|
Map<String, String> map = baseSearchBean.getInventoryValueByPartNo(ifsServer, 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); |
|
|
|