Преглед на файлове

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

Min преди 1 година
родител
ревизия
b9d85cf24e

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -139,7 +139,7 @@ public class BusinessOpportunityController {
         msg.setData(r);
         return msg;
     }
-    @RequestMapping("insertStage")
+    @RequestMapping("saveStage")
     public HttpRespMsg insertStage(List<Stage> stages, HttpServletRequest request) {
 //        request
         return stageService.changeStage(stages);

+ 4 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java

@@ -78,8 +78,9 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
     /**
      * 商机阶段 0-验证客户 1-需求分析 2-方案报价 3-赢单
      */
-    @TableField("stage")
-    private Integer stage;
+    @TableField("stage_id")
+    private Integer stageId;
+    private String stageValue;
 
     /**
      * 创建时间
@@ -94,7 +95,7 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
      * 修改时间
      */
     @TableField("edit_time")
-    private LocalDateTime editTime;
+    private Date editTime;
 
     /**
      * 创建人

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

@@ -194,14 +194,14 @@ 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.getStage() < 4).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()){

+ 24 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -33,12 +33,35 @@
     <select id="selectAllList" resultType="com.management.platform.entity.BusinessOpportunity">
         select
         <include refid="Base_Column_List"></include>,
+        (select `name` from  stage where id =  stage_id) stageValue,
         (select custom_name from custom where id = customer_id) customerName,
         (select `name` from contacts where id = contacts_id) contactsName,
+        (select `name` from `user` where id = contacts_id) inchargerName,
+        (select `name` from `user` where id = creator_id) creatorName,
         (SELECT sum(total) from business_product WHERE business_id = id)
         from business_opportunity
         where company_id = #{companyId}
-        and
+        <if test="name != null and name != ''">
+            and `name` LIKE CONCAT('%', #{name}, '%')
+        </if>
+        <if test="inchargerId != null ">
+            and incharger_id = #{inchargerId}
+        </if>
+        <if test="startTime != null and endTime != null ">
+            and create_time BETWEEN  #{startTime} and #{endTime}
+        </if>
+        <if test="contactsName != null and contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        </if>
+        <if test="customerName != null and customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        </if>
+        <if test="stageId != null ">
+            and stage_id = #{stageId}
+        </if>
+        <if test="productId != null ">
+            and id in (select business_id from business_product where product_id = #{productId})
+        </if>
     </select>
 
 </mapper>