Ver código fonte

优化代码

wuxw 3 anos atrás
pai
commit
023221ea2a

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/communitySpaceOpenTime/CommunitySpaceOpenTimeDto.java

@@ -16,6 +16,7 @@ import java.util.Date;
 public class CommunitySpaceOpenTimeDto extends PageDto implements Serializable {
 
     private String spaceId;
+    private String venueId;
     private String[] spaceIds;
     private String hours;
     private String isOpen;
@@ -103,4 +104,12 @@ public class CommunitySpaceOpenTimeDto extends PageDto implements Serializable {
     public void setAppointmentTime(String appointmentTime) {
         this.appointmentTime = appointmentTime;
     }
+
+    public String getVenueId() {
+        return venueId;
+    }
+
+    public void setVenueId(String venueId) {
+        this.venueId = venueId;
+    }
 }

+ 10 - 0
java110-bean/src/main/java/com/java110/dto/communitySpacePerson/CommunitySpacePersonDto.java

@@ -29,6 +29,8 @@ public class CommunitySpacePersonDto extends PageDto implements Serializable {
     private String receivedAmount;
     private String personName;
     private String spaceId;
+    private String venueId;
+
     private String spaceName;
     private String cspId;
     private String appointmentTime;
@@ -191,4 +193,12 @@ public class CommunitySpacePersonDto extends PageDto implements Serializable {
     public void setTimes(List<CommunitySpacePersonTimeDto> times) {
         this.times = times;
     }
+
+    public String getVenueId() {
+        return venueId;
+    }
+
+    public void setVenueId(String venueId) {
+        this.venueId = venueId;
+    }
 }

+ 4 - 0
java110-db/src/main/resources/mapper/community/CommunitySpaceOpenTimeV1ServiceDaoImplMapper.xml

@@ -31,6 +31,7 @@
         select t.space_id,t.space_id spaceId,t.hours,t.is_open,t.is_open isOpen,t.time_id,t.time_id
         timeId,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId
         from community_space_open_time t
+        left join community_space cs on t.space_id = cs.space_id and cs.status_cd = '0'
         <if test="appointmentTime !=null and appointmentTime != ''">
         left join community_space_person_time cspt on t.space_id = cspt.space_id and cspt.status_cd = '0' and cspt.hours = t.hours
         left join community_space_person csp on cspt.csp_id = csp.csp_id and csp.status_cd = '0' and csp.appointment_time = #{appointmentTime}
@@ -42,6 +43,9 @@
         <if test="spaceId !=null and spaceId != ''">
             and t.space_id= #{spaceId}
         </if>
+        <if test="venueId !=null and venueId != ''">
+            and cs.venue_id= #{venueId}
+        </if>
         <if test="hours !=null and hours != ''">
             and t.hours= #{hours}
         </if>

+ 7 - 0
java110-db/src/main/resources/mapper/community/CommunitySpacePersonV1ServiceDaoImplMapper.xml

@@ -50,6 +50,9 @@
         <if test="spaceId !=null and spaceId != ''">
             and t.space_id= #{spaceId}
         </if>
+        <if test="venueId !=null and venueId != ''">
+            and cs.venue_id= #{venueId}
+        </if>
         <if test="cspId !=null and cspId != ''">
             and t.csp_id= #{cspId}
         </if>
@@ -126,6 +129,7 @@
     <select id="queryCommunitySpacePersonsCount" parameterType="Map" resultType="Map">
         select count(1) count
         from community_space_person t
+        left join community_space cs on t.space_id = cs.space_id and cs.status_cd = '0'
         where 1 =1
         <if test="receivableAmount !=null and receivableAmount != ''">
             and t.receivable_amount= #{receivableAmount}
@@ -148,6 +152,9 @@
         <if test="spaceId !=null and spaceId != ''">
             and t.space_id= #{spaceId}
         </if>
+        <if test="venueId !=null and venueId != ''">
+            and cs.venue_id= #{venueId}
+        </if>
         <if test="cspId !=null and cspId != ''">
             and t.csp_id= #{cspId}
         </if>

+ 1 - 1
service-community/src/main/java/com/java110/community/cmd/communitySpace/ListCommunitySpaceOpenTimeCmd.java

@@ -60,7 +60,6 @@ public class ListCommunitySpaceOpenTimeCmd extends Cmd{
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
 
-        Assert.hasKeyAndValue(reqJson,"spaceId","场地ID");
         Assert.hasKeyAndValue(reqJson,"appointmentTime","预约时间");
         Assert.hasKeyAndValue(reqJson,"communityId","小区ID");
     }
@@ -70,6 +69,7 @@ public class ListCommunitySpaceOpenTimeCmd extends Cmd{
 
         CommunitySpaceOpenTimeDto communitySpaceOpenTimeDto = new CommunitySpaceOpenTimeDto();
         communitySpaceOpenTimeDto.setSpaceId(reqJson.getString("spaceId"));
+        communitySpaceOpenTimeDto.setVenueId(reqJson.getString("venueId"));
         communitySpaceOpenTimeDto.setAppointmentTime(reqJson.getString("appointmentTime"));
         List<CommunitySpaceOpenTimeDto> communitySpaceOpenTimeDtos = communitySpaceOpenTimeV1InnerServiceSMOImpl.queryCommunitySpaceOpenTimes(communitySpaceOpenTimeDto);