|
|
|
@ -14,6 +14,7 @@ import com.spring.modules.sys.service.SysUserService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
@ -40,6 +41,12 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
|
private IfsServer ifsServer; |
|
|
|
@Autowired |
|
|
|
private BaseSearchBean baseSearchBean; |
|
|
|
|
|
|
|
@Value("${ifs-control.ifs-username}") |
|
|
|
private String ifsUsername; |
|
|
|
|
|
|
|
@Value("${ifs-control.ifs-password}") |
|
|
|
private String ifsPassword; |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public long initQuoteDetailBomTree(QuoteDetail detail, Long parentId, Integer level) { |
|
|
|
@ -133,13 +140,13 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
|
component.setBomFlag("N"); |
|
|
|
} |
|
|
|
if ("Y".equals(component.getStatus())){ |
|
|
|
SysUserEntity user = (SysUserEntity)SecurityUtils.getSubject().getPrincipal(); |
|
|
|
// SysUserEntity user = (SysUserEntity)SecurityUtils.getSubject().getPrincipal(); |
|
|
|
// 获取用户信息 |
|
|
|
SysUserEntity sysUser = sysUserService.getById(user.getUserId()); |
|
|
|
// SysUserEntity sysUser = sysUserService.getById(user.getUserId()); |
|
|
|
PartInformationEntity part = new PartInformationEntity(); |
|
|
|
part.setSite(component.getSite()); |
|
|
|
part.setPartNo(component.getComponentPart()); |
|
|
|
Map<String, String> map = baseSearchBean.getInventoryValueByPartNo(ifsServer.getIfsServer(sysUser.getIfsUsername(),sysUser.getIfsPassword()), part); |
|
|
|
Map<String, String> map = baseSearchBean.getInventoryValueByPartNo(ifsServer.getIfsServer(ifsUsername,ifsPassword), part); |
|
|
|
if (Objects.equals(map.get("resultCode"),"200")){ |
|
|
|
// 返回成功 将成本 |
|
|
|
InventoryPartUnitCostSumVo unitCostSumVo = JSONObject.parseObject(map.get("obj"), InventoryPartUnitCostSumVo.class); |
|
|
|
|