Ver código fonte

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

魏超 5 anos atrás
pai
commit
3f17998392

+ 5
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java Ver arquivo

@@ -678,6 +678,11 @@ public class CommConstant {
678 678
      */
679 679
     public static final String PAY_STATUS_REFUNDED = "refunded";
680 680
 
681
+    /**
682
+     * 退款异常
683
+     */
684
+    public static final String PAY_STATUS_CHANGE = "change";
685
+
681 686
 
682 687
     /**
683 688
      * 已经取消支付

+ 19
- 19
src/main/java/com/huiju/estateagents/service/impl/TaRaiseRecordServiceImpl.java Ver arquivo

@@ -143,13 +143,13 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
143 143
 //            lockedHouseResources(taHousingResources);
144 144
         }
145 145
         //判断销售批次是否是发布状态和房源是否正常状态
146
-        checkHouseStatus(taRaiseRecord,orgId, personId, taRaise);
146
+        checkHouseStatus(taRaiseRecord, orgId, personId, taRaise);
147 147
 
148 148
         //插入认筹单
149 149
         saveRaiseRecord(taRaiseRecord, orgId, personId, taRaise);
150 150
 
151 151
         //发送订阅消息
152
-        sendRaiseMsg(taRaiseRecord.getRaiseRecordId(),personId,"在线选房认筹通知","已提交认筹","点击详情查看认筹单","房源紧俏,请赶紧缴费",true);
152
+        sendRaiseMsg(taRaiseRecord.getRaiseRecordId(), personId, "在线选房认筹通知", "已提交认筹", "点击详情查看认筹单", "房源紧俏,请赶紧缴费", true);
153 153
 
154 154
         return taRaiseRecord;
155 155
     }
@@ -158,23 +158,23 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
158 158
     private void checkHouseStatus(TaRaiseRecord taRaiseRecord, Integer orgId, String personId, TaRaise taRaise) throws Exception {
159 159
         //销售批次是否有效状态
160 160
         TaSalesBatch taSalesBatch = taSalesBatchMapper.selectById(taRaise.getSalesBatchId());
161
-        if (!taSalesBatch.getStatus().equals(CommConstant.STATUS_NORMAL)){
161
+        if (!taSalesBatch.getStatus().equals(CommConstant.STATUS_NORMAL)) {
162 162
             throw new Exception("此销售批次已经取消发布!");
163 163
         }
164 164
         //判断房源是否已经删除
165 165
         List<Integer> houseList = taRaiseRecord.getHouseList();
166 166
         for (Integer houseId : houseList) {
167 167
             TaHousingResources taHousingResources = taHousingResourcesMapper.selectById(houseId);
168
-            if (taHousingResources.getStatus() != CommConstant.STATUS_NORMAL){
168
+            if (taHousingResources.getStatus() != CommConstant.STATUS_NORMAL) {
169 169
                 throw new Exception("存在已经删除的房源!");
170 170
             }
171 171
             //判断我是否认筹过这些房源
172 172
             QueryWrapper<TaRaiseHouse> taRaiseHouseQueryWrapper = new QueryWrapper<>();
173
-            taRaiseHouseQueryWrapper.eq("org_id",orgId);
174
-            taRaiseHouseQueryWrapper.eq("house_id",houseId);
175
-            taRaiseHouseQueryWrapper.eq("person_id",personId);
173
+            taRaiseHouseQueryWrapper.eq("org_id", orgId);
174
+            taRaiseHouseQueryWrapper.eq("house_id", houseId);
175
+            taRaiseHouseQueryWrapper.eq("person_id", personId);
176 176
             List<TaRaiseHouse> taRaiseHouses = taRaiseHouseMapper.selectList(taRaiseHouseQueryWrapper);
177
-            if (taRaiseHouses.size() > 0){
177
+            if (taRaiseHouses.size() > 0) {
178 178
                 throw new Exception("存在已经认筹过的房源!");
179 179
             }
180 180
         }
@@ -237,7 +237,7 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
237 237
                 taRaiseHouse.setHouseLockingStatus(CommConstant.HOUSE_LOCKING_STATUS_LOCKED);
238 238
                 taRaiseHouse.setPersonId(personId);
239 239
                 taRaiseHouse.setPersonName(taPerson.getName());
240
-            }else{
240
+            } else {
241 241
                 taRaiseHouse.setHouseLockingStatus(CommConstant.HOUSE_LOCKING_STATUS_UNLOCKED);
242 242
             }
243 243
             taRaiseHouse.setOrgId(orgId);
@@ -247,15 +247,15 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
247 247
             //更新房源的实际热度
248 248
             TaHousingResources taHousingResources = taHousingResourcesMapper.selectById(e);
249 249
             Integer raiseRealHeat = taHousingResources.getRaiseRealHeat();
250
-            if (null == raiseRealHeat){
250
+            if (null == raiseRealHeat) {
251 251
                 raiseRealHeat = 0;
252 252
             }
253
-            taHousingResources.setRaiseRealHeat(raiseRealHeat+1);
253
+            taHousingResources.setRaiseRealHeat(raiseRealHeat + 1);
254 254
             taHousingResourcesMapper.updateById(taHousingResources);
255 255
         });
256 256
 
257 257
         //把idcard字断更新进person表
258
-        if (StringUtil.isEmpty(taPerson.getIdcard())){
258
+        if (StringUtil.isEmpty(taPerson.getIdcard())) {
259 259
             taPerson.setIdcard(taRaiseRecord.getIdcard());
260 260
             taPersonMapper.updateById(taPerson);
261 261
         }
@@ -276,15 +276,15 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
276 276
     /**
277 277
      * 发送认筹订阅消息
278 278
      *
279
-     * @param raiseRecordId  认筹单ID
280
-     * @param personId   用户ID
281
-     * @param title  审核类型
282
-     * @param result     审核结果
283
-     * @param remark 失败原因
284
-     * @param isSuccess  是否成功 true是(只有成功才发送短信)
279
+     * @param raiseRecordId 认筹单ID
280
+     * @param personId      用户ID
281
+     * @param title         审核类型
282
+     * @param result        审核结果
283
+     * @param remark        失败原因
284
+     * @param isSuccess     是否成功 true是(只有成功才发送短信)
285 285
      */
286 286
     @Override
287
-    public void sendRaiseMsg(Integer raiseRecordId, String personId, String title, String result, String reason,String remark, Boolean isSuccess) {
287
+    public void sendRaiseMsg(Integer raiseRecordId, String personId, String title, String result, String reason, String remark, Boolean isSuccess) {
288 288
         logger.info("sendSubscribeMsg 接收参数:houseId:{},checkType:{},result:{},reason:{}, remark:{}",
289 289
                 raiseRecordId, title, result, reason, remark);
290 290
 

+ 25
- 4
src/main/java/com/huiju/estateagents/service/impl/WxPayServiceImpl.java Ver arquivo

@@ -198,18 +198,39 @@ public class WxPayServiceImpl implements IWxPayService {
198 198
         log.info("更新订单{}状态为退款",orderInfo.get("transaction_id"));
199 199
         //更新订单状态为退款
200 200
         String transactionId = orderInfo.get("transaction_id");
201
+        Integer raiseRecordId;
202
+        String personId;
201 203
         List<TaOrder> orderList = taOrderMapper.selectList(new QueryWrapper<TaOrder>().eq("transaction_id", transactionId));
202 204
         orderList.forEach(e -> {
203
-            e.setPayStatus(CommConstant.PAY_STATUS_REFUNDED);
205
+            if (orderInfo.get("refund_status").equals(WXPayConstants.SUCCESS)){
206
+                e.setPayStatus(CommConstant.PAY_STATUS_REFUNDED);
207
+            }
208
+            if (!orderInfo.get("refund_status").equals(WXPayConstants.SUCCESS)){
209
+                e.setPayStatus(CommConstant.PAY_STATUS_CHANGE);
210
+            }
211
+
204 212
             if (null != e.getParentOrderId()){
213
+
205 214
                 //更新认筹单为退款
206 215
                 TaRaiseRecord taRaiseRecord = taRaiseRecordMapper.selectOne(new QueryWrapper<TaRaiseRecord>().eq("order_id", e.getParentOrderId()));
207
-                taRaiseRecord.setPayStatus(CommConstant.PAY_STATUS_REFUNDED);
216
+                if (orderInfo.get("refund_status").equals(WXPayConstants.SUCCESS)){
217
+                    taRaiseRecord.setPayStatus(CommConstant.PAY_STATUS_REFUNDED);
218
+                }
219
+                if (!orderInfo.get("refund_status").equals(WXPayConstants.SUCCESS)){
220
+                    taRaiseRecord.setPayStatus(CommConstant.PAY_STATUS_CHANGE);
221
+                }
222
+
208 223
                 taRaiseRecordMapper.updateById(taRaiseRecord);
209 224
                 //更新退款时间
210 225
                 e.setPayTime(LocalDateTime.now());
211
-                //发送订阅消息
212
-                taRaiseRecordService.sendRaiseMsg(taRaiseRecord.getRaiseRecordId(),taRaiseRecord.getRaiseId(),"在线选房认筹通知","线上退费成功","点击详情查看认筹单","线上退费成功",false);
226
+                if (orderInfo.get("refund_status").equals(WXPayConstants.SUCCESS)){
227
+                    //发送订阅消息
228
+                    taRaiseRecordService.sendRaiseMsg(taRaiseRecord.getRaiseRecordId(),taRaiseRecord.getPersonId(),"在线选房认筹通知","线上退费成功","点击详情查看认筹单","线上退费成功",false);
229
+                }
230
+                if (!orderInfo.get("refund_status").equals(WXPayConstants.SUCCESS)){
231
+                    //发送订阅消息
232
+                    taRaiseRecordService.sendRaiseMsg(taRaiseRecord.getRaiseRecordId(),taRaiseRecord.getPersonId(),"在线选房认筹通知","线上退费失败","点击详情查看认筹单","请联系置业顾问",false);
233
+                }
213 234
             }
214 235
             taOrderMapper.updateById(e);
215 236
         });

+ 2
- 2
src/main/resources/mapper/TaPreselectionRecordMapper.xml Ver arquivo

@@ -55,7 +55,7 @@
55 55
                 AND t6.person_id != #{personId}
56 56
             </if>
57 57
           GROUP BY
58
-            t6.preselection_record_id
58
+            t3.preselection_record_id
59 59
          ORDER BY
60 60
             t3.create_date DESC
61 61
 
@@ -124,7 +124,7 @@
124 124
                 AND t.house_id = #{bo.houseId}
125 125
             </if>
126 126
             <if test="bo.phone != null and bo.phone != ''">
127
-                AND b.phone = #{bo.phone}
127
+                AND b.phone like CONCAT('%',#{bo.phone}, '%')
128 128
             </if>
129 129
             <if test="bo.apartmentId != null and bo.apartmentId != ''">
130 130
                 AND a.apartment_id = #{bo.apartmentId}

+ 5
- 5
src/main/resources/mapper/TaRaiseRecordMapper.xml Ver arquivo

@@ -50,7 +50,7 @@
50 50
         GROUP BY
51 51
           t.house_id
52 52
         ORDER BY
53
-          t3.create_date DESC
53
+          t.raise_real_heat DESC
54 54
     </select>
55 55
 
56 56
     <select id="listRaiseRecordByCondition" resultType="com.huiju.estateagents.entity.TaRaiseRecord">
@@ -108,10 +108,10 @@
108 108
             AND t.house_locking_status = #{bo.lockingStatus}
109 109
         </if>
110 110
         <if test="bo.tel != null and bo.tel != ''">
111
-            AND t.tel = #{bo.tel}
111
+            AND t.tel like CONCAT('%',#{bo.tel} , '%')
112 112
         </if>
113 113
         <if test="bo.personTel != null and bo.personTel != ''">
114
-            AND t5.tel = #{bo.personTel}
114
+            AND t5.tel like CONCAT('%',#{bo.personTel}  , '%')
115 115
         </if>
116 116
         <if test="bo.payStatus != null and bo.payStatus != ''">
117 117
             AND t.pay_status = #{bo.payStatus}
@@ -157,10 +157,10 @@
157 157
                 AND t.raise_record_id = #{bo.raiseRecordId}
158 158
             </if>
159 159
             <if test = "bo.tel != null and bo.tel != ''">
160
-                AND t.tel = #{bo.tel}
160
+                AND t.tel  like CONCAT('%',#{bo.tel} , '%')
161 161
             </if>
162 162
             <if test = "bo.personTel != null and bo.personTel != ''">
163
-                AND t3.tel = #{bo.personTel}
163
+                AND t3.tel like CONCAT('%',#{bo.personTel}  , '%')
164 164
             </if>
165 165
             <if test = "bo.transactionId != null and bo.transactionId != ''">
166 166
                 AND t2.transaction_id = #{bo.transactionId}