Sfoglia il codice sorgente

'/wx/taPersonVisitRecord增加orgId'

魏熙美 5 anni fa
parent
commit
47c9e324ba

+ 2
- 1
src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java Vedi File

87
         }
87
         }
88
         TaPerson person = taPersons.get(0);
88
         TaPerson person = taPersons.get(0);
89
         taPersonVisitRecord.setActivity(taPersonVisitRecord.getPropertyName());
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
         if(eventProperties<=0){
91
         if(eventProperties<=0){
92
             TaEventProperties taEventProperty = new TaEventProperties();
92
             TaEventProperties taEventProperty = new TaEventProperties();
93
             taEventProperty.setBuildingId(taPersonVisitRecord.getTargetId());
93
             taEventProperty.setBuildingId(taPersonVisitRecord.getTargetId());
109
         if(!StringUtils.isEmpty(taPersonVisitRecord.getBuildingId())){
109
         if(!StringUtils.isEmpty(taPersonVisitRecord.getBuildingId())){
110
             QueryWrapper<TaBuildingIntention> intentionQueryWrapper = new QueryWrapper<>();
110
             QueryWrapper<TaBuildingIntention> intentionQueryWrapper = new QueryWrapper<>();
111
             intentionQueryWrapper.eq("building_id",taPersonVisitRecord.getBuildingId());
111
             intentionQueryWrapper.eq("building_id",taPersonVisitRecord.getBuildingId());
112
+            intentionQueryWrapper.eq("org_id", getOrgId(request));
112
             intentionQueryWrapper.eq("event_code",taPersonVisitRecord.getEvent());
113
             intentionQueryWrapper.eq("event_code",taPersonVisitRecord.getEvent());
113
             List<TaBuildingIntention>list = buildingIntentionService.list(intentionQueryWrapper);
114
             List<TaBuildingIntention>list = buildingIntentionService.list(intentionQueryWrapper);
114
             if (list.size()>0){
115
             if (list.size()>0){

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaEventPropertiesMapper.java Vedi File

17
 @Mapper
17
 @Mapper
18
 public interface TaEventPropertiesMapper extends BaseMapper<TaEventProperties> {
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 Vedi File

14
  */
14
  */
15
 public interface ITaEventPropertiesService extends IService<TaEventProperties> {
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 Vedi File

22
     TaEventPropertiesMapper taEventPropertiesMapper;
22
     TaEventPropertiesMapper taEventPropertiesMapper;
23
 
23
 
24
     @Override
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 Vedi File

3
 <mapper namespace="com.huiju.estateagents.mapper.TaEventPropertiesMapper">
3
 <mapper namespace="com.huiju.estateagents.mapper.TaEventPropertiesMapper">
4
     <select id="isEventExist" resultType="java.lang.Integer">
4
     <select id="isEventExist" resultType="java.lang.Integer">
5
         SELECT
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
     </select>
17
     </select>
14
 
18
 
15
 </mapper>
19
 </mapper>