java110 před 3 roky
rodič
revize
682afa292d

+ 73 - 77
java110-db/src/main/resources/mapper/store/ResourceStoreTypeV1ServiceDaoImplMapper.xml

@@ -5,102 +5,98 @@
 <mapper namespace="resourceResourceStoreTypeTypeV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存物品类型信息 add by wuxw 2018-07-03 -->
     <insert id="saveResourceStoreTypeInfo" parameterType="Map">
         insert into resource_store_type(
-rst_id,name,description,store_id,parent_id
-) values (
-#{rstId},#{name},#{description},#{storeId},#{parentId}
-)
+        rst_id,name,description,store_id,parent_id
+        ) values (
+        #{rstId},#{name},#{description},#{storeId},#{parentId}
+        )
     </insert>
 
 
-
     <!-- 查询物品类型信息 add by wuxw 2018-07-03 -->
     <select id="getResourceStoreTypeInfo" parameterType="Map" resultType="Map">
-        select  t.rst_id,t.rst_id rstId,t.name,t.description,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.parent_id,t.parent_id parentId 
-from resource_store_type t 
-where 1 =1 
-<if test="rstId !=null and rstId != ''">
-   and t.rst_id= #{rstId}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="description !=null and description != ''">
-   and t.description= #{description}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="storeId !=null and storeId != ''">
-   and t.store_id= #{storeId}
-</if> 
-<if test="parentId !=null and parentId != ''">
-   and t.parent_id= #{parentId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.rst_id,t.rst_id rstId,t.name,t.description,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id
+        storeId,t.parent_id,t.parent_id parentId
+        from resource_store_type t
+        where 1 =1
+        <if test="rstId !=null and rstId != ''">
+            and t.rst_id= #{rstId}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="description !=null and description != ''">
+            and t.description= #{description}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
+        <if test="parentId !=null and parentId != ''">
+            and t.parent_id= #{parentId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改物品类型信息 add by wuxw 2018-07-03 -->
     <update id="updateResourceStoreTypeInfo" parameterType="Map">
-        update  resource_store_type t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="name !=null and name != ''">
-, t.name= #{name}
-</if> 
-<if test="description !=null and description != ''">
-, t.description= #{description}
-</if> 
-<if test="storeId !=null and storeId != ''">
-, t.store_id= #{storeId}
-</if> 
-<if test="parentId !=null and parentId != ''">
-, t.parent_id= #{parentId}
-</if> 
- where 1=1 <if test="rstId !=null and rstId != ''">
-and t.rst_id= #{rstId}
-</if> 
+        update resource_store_type t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="name !=null and name != ''">
+            , t.name= #{name}
+        </if>
+        <if test="description !=null and description != ''">
+            , t.description= #{description}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            , t.store_id= #{storeId}
+        </if>
+        <if test="parentId !=null and parentId != ''">
+            , t.parent_id= #{parentId}
+        </if>
+        where 1=1
+        <if test="rstId !=null and rstId != ''">
+            and t.rst_id= #{rstId}
+        </if>
 
     </update>
 
     <!-- 查询物品类型数量 add by wuxw 2018-07-03 -->
-     <select id="queryResourceStoreTypesCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from resource_store_type t 
-where 1 =1 
-<if test="rstId !=null and rstId != ''">
-   and t.rst_id= #{rstId}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="description !=null and description != ''">
-   and t.description= #{description}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="storeId !=null and storeId != ''">
-   and t.store_id= #{storeId}
-</if> 
-<if test="parentId !=null and parentId != ''">
-   and t.parent_id= #{parentId}
-</if> 
+    <select id="queryResourceStoreTypesCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from resource_store_type t
+        where 1 =1
+        <if test="rstId !=null and rstId != ''">
+            and t.rst_id= #{rstId}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="description !=null and description != ''">
+            and t.description= #{description}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
+        <if test="parentId !=null and parentId != ''">
+            and t.parent_id= #{parentId}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 10 - 5
service-api/src/main/java/com/java110/api/listener/visit/SaveVisitListener.java

@@ -8,11 +8,11 @@ import com.java110.core.context.DataFlowContext;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
 import com.java110.core.factory.CommunitySettingFactory;
 import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.file.FileDto;
 import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.parking.ParkingSpaceDto;
 import com.java110.dto.visit.VisitDto;
 import com.java110.intf.common.IFileInnerServiceSMO;
-import com.java110.dto.file.FileDto;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
 import com.java110.intf.community.IVisitInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarAttrInnerServiceSMO;
@@ -116,7 +116,7 @@ public class SaveVisitListener extends AbstractServiceApiPlusListener {
             //获取预约车免费时长的值
             String freeTime = CommunitySettingFactory.getValue(reqJson.getString("communityId"), CAR_FREE_TIME);
 
-            if(StringUtil.isEmpty(freeTime)){
+            if (StringUtil.isEmpty(freeTime)) {
                 freeTime = "120";
             }
             String visitTime = reqJson.getString("visitTime");
@@ -170,7 +170,12 @@ public class SaveVisitListener extends AbstractServiceApiPlusListener {
                 reqJson.put("psId", "-1");
             }
             //查询预约车辆登记次数
-            int number = Integer.parseInt(CommunitySettingFactory.getValue(reqJson.getString("communityId"), VISIT_NUMBER));
+            String visitNumber = CommunitySettingFactory.getValue(reqJson.getString("communityId"), VISIT_NUMBER);
+            if (StringUtil.isEmpty(visitNumber)) {
+                visitNumber = "10000";
+            }
+            int number = Integer.parseInt(visitNumber);
+
             VisitDto visitDto = new VisitDto();
             //查询当天车辆登记次数
             visitDto.setOwnerId(reqJson.getString("ownerId"));
@@ -232,9 +237,9 @@ public class SaveVisitListener extends AbstractServiceApiPlusListener {
             super.insert(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL);
         }
         commit(context);
-        if (!StringUtil.isEmpty(reqJson.getString("state")) && reqJson.getString("state").equals("1")
+        if ("1".equals(reqJson.getString("state"))
                 && reqJson.containsKey("carNum") && !StringUtil.isEmpty(reqJson.getString("carNum"))
-                && !existCar && !StringUtil.isEmpty(reqJson.getString("psId"))) { //审核通过且有车位就更新车位状态
+                && !existCar && !StringUtil.isEmpty(reqJson.getString("psId")) && !"-1".equals(reqJson.getString("psId"))) { //审核通过且有车位就更新车位状态
             ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto();
             parkingSpaceDto.setPsId(reqJson.getString("psId"));
             //查询停车位

+ 0 - 2
service-api/src/main/java/com/java110/api/smo/visit/impl/AddVisitSMOImpl.java

@@ -26,8 +26,6 @@ public class AddVisitSMOImpl extends DefaultAbstractComponentSMO implements IAdd
 
     @Override
     protected void validate(IPageData pd, JSONObject paramIn) {
-        System.out.println("paramIn  "+paramIn);
-        System.out.println("pd     "+pd);
         //super.validatePageInfo(pd);
 
         //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");