Procházet zdrojové kódy

'/wx/taPersonVisitRecord增加orgId'

魏熙美 před 5 roky
rodič
revize
47c9e324ba

+ 2
- 1
src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java Zobrazit soubor

@@ -87,7 +87,7 @@ public class TaPersonVisitRecordController extends BaseController {
87 87
         }
88 88
         TaPerson person = taPersons.get(0);
89 89
         taPersonVisitRecord.setActivity(taPersonVisitRecord.getPropertyName());
90
-        Integer eventProperties = taEventPropertiesService.isEventExist(taPersonVisitRecord.getTargetId(),taPersonVisitRecord.getEventType(),taPersonVisitRecord.getActivity());
90
+        Integer eventProperties = taEventPropertiesService.isEventExist(taPersonVisitRecord.getTargetId(),taPersonVisitRecord.getEventType(),taPersonVisitRecord.getActivity(), getOrgId(request));
91 91
         if(eventProperties<=0){
92 92
             TaEventProperties taEventProperty = new TaEventProperties();
93 93
             taEventProperty.setBuildingId(taPersonVisitRecord.getTargetId());
@@ -109,6 +109,7 @@ public class TaPersonVisitRecordController extends BaseController {
109 109
         if(!StringUtils.isEmpty(taPersonVisitRecord.getBuildingId())){
110 110
             QueryWrapper<TaBuildingIntention> intentionQueryWrapper = new QueryWrapper<>();
111 111
             intentionQueryWrapper.eq("building_id",taPersonVisitRecord.getBuildingId());
112
+            intentionQueryWrapper.eq("org_id", getOrgId(request));
112 113
             intentionQueryWrapper.eq("event_code",taPersonVisitRecord.getEvent());
113 114
             List<TaBuildingIntention>list = buildingIntentionService.list(intentionQueryWrapper);
114 115
             if (list.size()>0){

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaEventPropertiesMapper.java Zobrazit soubor

@@ -17,6 +17,6 @@ import org.apache.ibatis.annotations.Param;
17 17
 @Mapper
18 18
 public interface TaEventPropertiesMapper extends BaseMapper<TaEventProperties> {
19 19
 
20
-    Integer isEventExist(@Param("targetId") String targetId, @Param("eventType") String eventType, @Param("activity") String activity);
20
+    Integer isEventExist(@Param("targetId") String targetId, @Param("eventType") String eventType, @Param("activity") String activity, @Param("orgId") Integer orgId);
21 21
 
22 22
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaEventPropertiesService.java Zobrazit soubor

@@ -14,6 +14,6 @@ import com.huiju.estateagents.entity.TaEventProperties;
14 14
  */
15 15
 public interface ITaEventPropertiesService extends IService<TaEventProperties> {
16 16
 
17
-    Integer isEventExist(String targetId,String eventType,String activity);
17
+    Integer isEventExist(String targetId,String eventType,String activity, Integer orgId);
18 18
 
19 19
 }

+ 2
- 2
src/main/java/com/huiju/estateagents/service/impl/TaEventPropertiesServiceImpl.java Zobrazit soubor

@@ -22,8 +22,8 @@ public class TaEventPropertiesServiceImpl extends ServiceImpl<TaEventPropertiesM
22 22
     TaEventPropertiesMapper taEventPropertiesMapper;
23 23
 
24 24
     @Override
25
-    public Integer isEventExist(String targetId,String eventType,String activity){
26
-        return taEventPropertiesMapper.isEventExist(targetId,eventType,activity);
25
+    public Integer isEventExist(String targetId,String eventType,String activity, Integer orgId){
26
+        return taEventPropertiesMapper.isEventExist(targetId,eventType,activity, orgId);
27 27
     }
28 28
 
29 29
 }

+ 11
- 7
src/main/resources/mapper/TaEventPropertiesMapper.xml Zobrazit soubor

@@ -3,13 +3,17 @@
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaEventPropertiesMapper">
4 4
     <select id="isEventExist" resultType="java.lang.Integer">
5 5
         SELECT
6
-	COUNT(1)
7
-FROM
8
-	ta_event_properties t
9
-WHERE
10
-	( ( t.target_id IS NULL AND #{targetId} IS NULL ) OR t.target_id	= #{targetId} )
11
-	AND ( ( t.event_type IS NULL AND #{eventType} IS NULL ) OR t.event_type = #{eventType} )
12
-	AND ( ( t.property_code IS NULL AND #{activity} IS NULL ) OR t.property_code = #{activity} )
6
+			COUNT(1)
7
+		FROM
8
+			ta_event_properties t
9
+		WHERE
10
+			( ( t.target_id IS NULL AND #{targetId} IS NULL ) OR t.target_id	= #{targetId} )
11
+			AND ( ( t.event_type IS NULL AND #{eventType} IS NULL ) OR t.event_type = #{eventType} )
12
+			AND ( ( t.property_code IS NULL AND #{activity} IS NULL ) OR t.property_code = #{activity} )
13
+			<if test="orgId != null">
14
+				and t.org_id = #{orgId}
15
+			</if>
16
+
13 17
     </select>
14 18
 
15 19
 </mapper>