Преглед изворни кода

门禁已经开发测试完成,现在开始开发道闸

java110 пре 2 година
родитељ
комит
0584fda55f

+ 73 - 77
java110-db/src/main/resources/mapper/community/ParkingAreaV1ServiceDaoImplMapper.xml

@@ -5,102 +5,98 @@
 <mapper namespace="parkingAreaV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存停车场信息 add by wuxw 2018-07-03 -->
     <insert id="saveParkingAreaInfo" parameterType="Map">
         insert into parking_area(
-type_cd,num,pa_id,remark,community_id
-) values (
-#{typeCd},#{num},#{paId},#{remark},#{communityId}
-)
+        type_cd,num,pa_id,remark,community_id
+        ) values (
+        #{typeCd},#{num},#{paId},#{remark},#{communityId}
+        )
     </insert>
 
 
-
     <!-- 查询停车场信息 add by wuxw 2018-07-03 -->
     <select id="getParkingAreaInfo" parameterType="Map" resultType="Map">
-        select  t.type_cd,t.type_cd typeCd,t.num,t.pa_id,t.pa_id paId,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId 
-from parking_area t 
-where 1 =1 
-<if test="typeCd !=null and typeCd != ''">
-   and t.type_cd= #{typeCd}
-</if> 
-<if test="num !=null and num != ''">
-   and t.num= #{num}
-</if> 
-<if test="paId !=null and paId != ''">
-   and t.pa_id= #{paId}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.type_cd,t.type_cd typeCd,t.num,t.pa_id,t.pa_id paId,t.remark,t.status_cd,t.status_cd
+        statusCd,t.community_id,t.community_id communityId
+        from parking_area t
+        where 1 =1
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="num !=null and num != ''">
+            and t.num= #{num}
+        </if>
+        <if test="paId !=null and paId != ''">
+            and t.pa_id= #{paId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </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="updateParkingAreaInfo" parameterType="Map">
-        update  parking_area t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="typeCd !=null and typeCd != ''">
-, t.type_cd= #{typeCd}
-</if> 
-<if test="num !=null and num != ''">
-, t.num= #{num}
-</if> 
-<if test="remark !=null and remark != ''">
-, t.remark= #{remark}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
- where 1=1 <if test="paId !=null and paId != ''">
-and t.pa_id= #{paId}
-</if> 
+        update parking_area t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="typeCd !=null and typeCd != ''">
+            , t.type_cd= #{typeCd}
+        </if>
+        <if test="num !=null and num != ''">
+            , t.num= #{num}
+        </if>
+        <if test="remark !=null and remark != ''">
+            , t.remark= #{remark}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        where 1=1
+        <if test="paId !=null and paId != ''">
+            and t.pa_id= #{paId}
+        </if>
 
     </update>
 
     <!-- 查询停车场数量 add by wuxw 2018-07-03 -->
-     <select id="queryParkingAreasCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from parking_area t 
-where 1 =1 
-<if test="typeCd !=null and typeCd != ''">
-   and t.type_cd= #{typeCd}
-</if> 
-<if test="num !=null and num != ''">
-   and t.num= #{num}
-</if> 
-<if test="paId !=null and paId != ''">
-   and t.pa_id= #{paId}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
+    <select id="queryParkingAreasCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from parking_area t
+        where 1 =1
+        <if test="typeCd !=null and typeCd != ''">
+            and t.type_cd= #{typeCd}
+        </if>
+        <if test="num !=null and num != ''">
+            and t.num= #{num}
+        </if>
+        <if test="paId !=null and paId != ''">
+            and t.pa_id= #{paId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 22 - 4
service-job/src/main/java/com/java110/job/msgNotify/ali/AliMsgNotifyImpl.java

@@ -29,6 +29,7 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
 @Service("aliMsgNotifyImpl")
@@ -51,7 +52,7 @@ public class AliMsgNotifyImpl implements IMsgNotify {
      *
      * @param communityId 小区
      * @param userId      用户
-     * @param contents     [{
+     * @param contents    [{
      *                    "feeTypeName",
      *                    "payerObjName",
      *                    "billAmountOwed",
@@ -98,15 +99,32 @@ public class AliMsgNotifyImpl implements IMsgNotify {
 
         BigDecimal oweFee = new BigDecimal(0);
 
-        for(JSONObject content : contents){
+        Date startDate = null;
+        Date endDate = null;
+        Date tmpStartDate = null;
+        Date tmpEndDate = null;
+        for (JSONObject content : contents) {
             oweFee = oweFee.add(new BigDecimal(content.getDouble("billAmountOwed")));
+            tmpStartDate = DateUtil.getDateFromStringB(content.getString("date").split("~")[0]);
+            tmpEndDate = DateUtil.getDateFromStringB(content.getString("date").split("~")[1]);
+            if(startDate == null){
+                startDate = tmpStartDate;
+                endDate = tmpEndDate;
+                continue;
+            }
+            if(startDate.getTime()> tmpStartDate.getTime()){
+                startDate = tmpStartDate;
+            }
+            if(endDate.getTime() < tmpEndDate.getTime()){
+                endDate = tmpEndDate;
+            }
         }
 
         JSONObject param = new JSONObject();
         param.put("house", contents.get(0).getString("payerObjName"));
 //        param.put("feeType", content.getString("feeTypeName"));
-//        param.put("date", content.getString("date").split("~")[0]);
-//        param.put("date2", content.getString("date").split("~")[1]);
+        param.put("date", DateUtil.getFormatTimeStringB(startDate));
+        param.put("date2", DateUtil.getFormatTimeStringB(endDate));
         param.put("mount", oweFee.doubleValue());
         request.putQueryParameter("TemplateParam", param.toString());