Ver código fonte

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 1 ano atrás
pai
commit
4f1188e596

+ 9 - 9
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java

@@ -194,18 +194,18 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
         UpdateWrapper<Contacts> contactsUpdateWrapper = new UpdateWrapper<>();
         List<BusinessOpportunity> opportunityList = businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().in("contacts_id", ids));
         if (!opportunityList.isEmpty()){
-//            List<BusinessOpportunity> collect = opportunityList.stream().filter(o -> o.getStage() < 4).collect(Collectors.toList());
-//            if (!collect.isEmpty()){
-//                String oName=" ";
-//                for (BusinessOpportunity businessOpportunity : collect) {
-//                    oName+=businessOpportunity.getName()+" ";
-//                }
-//                msg.setError(oName+"等商机正在进行且跟联系人有关");
-//            }
+            List<BusinessOpportunity> collect = opportunityList.stream().filter(o -> o.getStageId()!=null&&o.getStageId() < 5).collect(Collectors.toList());
+            if (!collect.isEmpty()){
+                String oName=" ";
+                for (BusinessOpportunity businessOpportunity : collect) {
+                    oName+=businessOpportunity.getName()+" ";
+                }
+                msg.setError(oName+"等商机正在进行且跟联系人有关");
+            }
         }
         List<Task> taskList = taskMapper.selectList(new QueryWrapper<Task>().in("contacts_id", ids));
         if (!taskList.isEmpty()){
-            List<Task> collect = taskList.stream().filter(t -> t.getStatus() != 2).collect(Collectors.toList());
+            List<Task> collect = taskList.stream().filter(t ->t.getStatus()!=null&&t.getStatus() != 2).collect(Collectors.toList());
             if (!collect.isEmpty()){
                 msg.setError("存在任务未完成且跟联系人有关");
             }