|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.spring.modules.quote.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.spring.ifs.api.IfsServer; |
|
|
|
import com.spring.ifs.bean.BaseSearchBean; |
|
|
|
@ -9,6 +10,7 @@ import com.spring.modules.part.vo.InventoryPartUnitCostSumVo; |
|
|
|
import com.spring.modules.quote.entity.*; |
|
|
|
import com.spring.modules.quote.mapper.QuoteDetailBomTreeMapper; |
|
|
|
import com.spring.modules.quote.service.*; |
|
|
|
import com.spring.modules.sys.dao.SysUserDao; |
|
|
|
import com.spring.modules.sys.entity.SysUserEntity; |
|
|
|
import com.spring.modules.sys.service.SysUserService; |
|
|
|
import ifs.fnd.ap.Server; |
|
|
|
@ -38,6 +40,10 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
|
private QuoteDetailToolService quoteDetailToolService; |
|
|
|
@Autowired |
|
|
|
private BaseSearchBean baseSearchBean; |
|
|
|
@Autowired |
|
|
|
private SysUserDao sysUserDao; |
|
|
|
@Autowired |
|
|
|
private IfsServer ifsServer; |
|
|
|
|
|
|
|
private Server server = null; |
|
|
|
|
|
|
|
@ -50,6 +56,17 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public long initQuoteDetailBomTree(QuoteDetail detail, Long parentId, Integer level) { |
|
|
|
//获取当前用户的ifs账号和连接 LR 2025-05-30 Start |
|
|
|
//获取当前操作的账号 |
|
|
|
String username = ((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUsername(); |
|
|
|
|
|
|
|
SysUserEntity ifsUser = sysUserDao.selectOne(new QueryWrapper<SysUserEntity>().eq("username", username)); |
|
|
|
if (ifsUser == null || !org.apache.commons.lang3.StringUtils.isNotBlank(ifsUser.getIfsUsername()) || !org.apache.commons.lang3.StringUtils.isNotBlank(ifsUser.getIfsPassword())) { |
|
|
|
throw new RuntimeException("请维护IFS账号和密码!"); |
|
|
|
} |
|
|
|
Server ifsCon = ifsServer.getIfsServer(ifsUser.getIfsUsername(), ifsUser.getIfsPassword()); |
|
|
|
//获取当前用户的ifs账号和连接 LR 2025-05-30 End |
|
|
|
|
|
|
|
// 1、通过PartNo、Site和BuNo 查询BOM信息 失效日期日期为空 替代为* 和Routing (存在BOM的物料) |
|
|
|
if (parentId.equals(0L)){ |
|
|
|
detail.setBomType("Manufacturing"); |
|
|
|
@ -109,7 +126,8 @@ public class QuoteDetailBomTreeServiceImpl extends ServiceImpl<QuoteDetailBomTre |
|
|
|
component.setBomFlag("N"); |
|
|
|
} |
|
|
|
if ("Y".equals(component.getStatus())) { |
|
|
|
getFinalPartCost(component,server); |
|
|
|
//getFinalPartCost(component, server); // 获取最终的物料的成本 使用当前用的 |
|
|
|
getFinalPartCost(component, ifsCon); |
|
|
|
} |
|
|
|
//新增子物料信息 |
|
|
|
component.setTreeId(bom.getId()); |
|
|
|
|