|
@@ -57,6 +57,8 @@ public class ProductController {
|
|
private SysDictService sysDictService;
|
|
private SysDictService sysDictService;
|
|
@Resource
|
|
@Resource
|
|
private StageService stageService;
|
|
private StageService stageService;
|
|
|
|
+ @Resource
|
|
|
|
+ private ContactsService contactsService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -268,6 +270,7 @@ public class ProductController {
|
|
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
|
|
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
|
|
// List<SysDict> businessStageList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, "BusinessStage"));
|
|
// List<SysDict> businessStageList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, "BusinessStage"));
|
|
List<Stage> businessStageList = stageService.list(new LambdaQueryWrapper<Stage>().eq(Stage::getCompanyId, companyId));
|
|
List<Stage> businessStageList = stageService.list(new LambdaQueryWrapper<Stage>().eq(Stage::getCompanyId, companyId));
|
|
|
|
+ List<Contacts> contactsList = contactsService.list(new LambdaQueryWrapper<Contacts>().eq(Contacts::getCompanyId, companyId));
|
|
opportunityList.forEach(c->{
|
|
opportunityList.forEach(c->{
|
|
Optional<Custom> custom = customList.stream().filter(ct -> ct.getId().equals(c.getCustomerId())).findFirst();
|
|
Optional<Custom> custom = customList.stream().filter(ct -> ct.getId().equals(c.getCustomerId())).findFirst();
|
|
if(custom.isPresent()){
|
|
if(custom.isPresent()){
|
|
@@ -277,7 +280,7 @@ public class ProductController {
|
|
if(user.isPresent()){
|
|
if(user.isPresent()){
|
|
c.setCreatorName(user.get().getName());
|
|
c.setCreatorName(user.get().getName());
|
|
}
|
|
}
|
|
- Optional<User> contacts = userList.stream().filter(u -> u.getId().equals(c.getContactsId())).findFirst();
|
|
|
|
|
|
+ Optional<Contacts> contacts = contactsList.stream().filter(u -> u.getId().equals(c.getContactsId())).findFirst();
|
|
if(contacts.isPresent()){
|
|
if(contacts.isPresent()){
|
|
c.setContactsName(contacts.get().getName());
|
|
c.setContactsName(contacts.get().getName());
|
|
}
|
|
}
|
|
@@ -312,6 +315,8 @@ public class ProductController {
|
|
orderIds.add(-1);
|
|
orderIds.add(-1);
|
|
List<SalesOrder> orderList = salesOrderService.list(new LambdaQueryWrapper<SalesOrder>().in(SalesOrder::getId, orderIds));
|
|
List<SalesOrder> orderList = salesOrderService.list(new LambdaQueryWrapper<SalesOrder>().in(SalesOrder::getId, orderIds));
|
|
List<SysDict> orderTypeList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, "OrderType"));
|
|
List<SysDict> orderTypeList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, "OrderType"));
|
|
|
|
+ List<Integer> businessOpportunityIds = orderList.stream().map(SalesOrder::getBusinessOpportunityId).distinct().collect(Collectors.toList());
|
|
|
|
+ List<BusinessOpportunity> businessOpportunityList = businessOpportunityService.list(new LambdaQueryWrapper<BusinessOpportunity>().in(BusinessOpportunity::getId, businessOpportunityIds));
|
|
orderList.forEach(o->{
|
|
orderList.forEach(o->{
|
|
Optional<Custom> custom = customList.stream().filter(ct -> ct.getId().equals(o.getCustomId())).findFirst();
|
|
Optional<Custom> custom = customList.stream().filter(ct -> ct.getId().equals(o.getCustomId())).findFirst();
|
|
if(custom.isPresent()){
|
|
if(custom.isPresent()){
|
|
@@ -321,10 +326,22 @@ public class ProductController {
|
|
if(user.isPresent()){
|
|
if(user.isPresent()){
|
|
o.setCreatorName(user.get().getName());
|
|
o.setCreatorName(user.get().getName());
|
|
}
|
|
}
|
|
|
|
+ Optional<User> customSigner = userList.stream().filter(u -> u.getId().equals(o.getCustomSigner())).findFirst();
|
|
|
|
+ if(customSigner.isPresent()){
|
|
|
|
+ o.setCustomSignerName(customSigner.get().getName());
|
|
|
|
+ }
|
|
|
|
+ Optional<User> companySigner = userList.stream().filter(u -> u.getId().equals(o.getCompanySigner())).findFirst();
|
|
|
|
+ if(companySigner.isPresent()){
|
|
|
|
+ o.setCompanySigner(companySigner.get().getName());
|
|
|
|
+ }
|
|
Optional<User> incharger = userList.stream().filter(u -> u.getId().equals(o.getInchargerId())).findFirst();
|
|
Optional<User> incharger = userList.stream().filter(u -> u.getId().equals(o.getInchargerId())).findFirst();
|
|
if(incharger.isPresent()){
|
|
if(incharger.isPresent()){
|
|
o.setInchargerName(incharger.get().getName());
|
|
o.setInchargerName(incharger.get().getName());
|
|
}
|
|
}
|
|
|
|
+ Optional<BusinessOpportunity> businessOpportunity = businessOpportunityList.stream().filter(b -> o.getBusinessOpportunityId() != null && b.getId().equals(o.getBusinessOpportunityId())).findFirst();
|
|
|
|
+ if(businessOpportunity.isPresent()){
|
|
|
|
+ o.setBusinessOpportunityName(businessOpportunity.get().getName());
|
|
|
|
+ }
|
|
Optional<SysDict> orderType = orderTypeList.stream().filter(ot -> ot.getId().equals(o.getType())).findFirst();
|
|
Optional<SysDict> orderType = orderTypeList.stream().filter(ot -> ot.getId().equals(o.getType())).findFirst();
|
|
if(orderType.isPresent()){
|
|
if(orderType.isPresent()){
|
|
o.setTypeName(orderType.get().getName());
|
|
o.setTypeName(orderType.get().getName());
|