Selaa lähdekoodia

feat: 正启之星-江西发起结算data空的判断

lixuesong 2 vuotta sitten
vanhempi
commit
171b0c8787

+ 12 - 6
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmPayOffServiceImpl.java

@@ -765,16 +765,22 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 				if (Objects.equals(settleObj.getInt("code"), CommonConstants.SUCCESS)) {
 					JSONObject dataJsonObj = settleObj.getJSONObject("data");
 					log.info("政企之星结算提交成功: {}", settleObj.getStr("data"));
+					note.setUpdateTime(LocalDateTime.now());
 					//streamId 获取不到
-					if (dataJsonObj == null) {
+					if (dataJsonObj != null) {
+						String requestId = dataJsonObj.getStr("requestId");
+						if (StrUtil.isNotBlank(requestId)) {
+							note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
+							// 新增字段streamId
+							note.setStreamId(requestId);
+							noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
+						} else {
+							noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
+						}
+					} else {
 						log.warn("政企之星结算提交成功 data 获取不到: {}", note.getSettleNo());
 						noticeInfo.append(sysUser.getRealname()).append(":提交结算成功,业务流水号获取不到,请联系管理员;");
 					}
-					note.setUpdateTime(LocalDateTime.now());
-					note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
-					// 新增字段streamId
-					note.setStreamId(dataJsonObj.getStr("requestId"));
-					noticeInfo.append(sysUser.getRealname()).append(":提交结算成功;");
 				} else {
 					log.warn("政企之星结算失败: {}", note.getSettleNo());
 					note.setUpdateTime(LocalDateTime.now());

+ 19 - 6
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmScorePackageSettleNoteServiceImpl.java

@@ -1083,8 +1083,15 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 						// data获取不到
 						if (dataJsonObj == null) {
 							log.info("政企之星提交成功 data 获取不到");
+							redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + ":note_id_" + id);
 							return;
 						}
+						String requestId = dataJsonObj.getStr("requestId");
+						if (StrUtil.isBlank(requestId)) {
+							redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + ":note_id_" + id);
+							return;
+						}
+
 						WmScorePackageSettleNote note = new WmScorePackageSettleNote();
 						LocalDateTime now = LocalDateTime.now();
 						note.setId(id);
@@ -1092,7 +1099,7 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 						note.setSubToGigTime(now);
 						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
 						// 新增字段streamId
-						note.setStreamId(dataJsonObj.getStr("requestId"));
+						note.setStreamId(requestId);
 						this.baseMapper.updateById(note);
 					});
 
@@ -1643,13 +1650,19 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 
 				log.info("政企之星结算提交成功: {}", note.getSettleNo());
 				//data 获取不到
-				if (dataJsonObj == null) {
+				if (dataJsonObj != null) {
+					String requestId = dataJsonObj.getStr("requestId");
+					if (StrUtil.isNotBlank(requestId)) {
+						note.setUpdateTime(LocalDateTime.now());
+						note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
+						// 新增字段streamId
+						note.setStreamId(requestId);
+					} else {
+						log.warn("政企之星结算提交成功 requestId 获取不到: {}", note.getSettleNo());
+					}
+				} else {
 					log.warn("政企之星结算提交成功 data 获取不到: {}", note.getSettleNo());
 				}
-				note.setUpdateTime(LocalDateTime.now());
-				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
-				// 新增字段streamId
-				note.setStreamId(dataJsonObj.getStr("requestId"));
 			} else {
 				log.warn("政企之星结算提交失败: {}", note.getSettleNo());
 				note.setUpdateTime(LocalDateTime.now());