浏览代码

Merge branch 'feat-20220415-taxhelperstopopt'

shc 3 年之前
父节点
当前提交
ce242cd4c7

+ 95 - 85
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/PartyAServiceImpl.java

@@ -1266,7 +1266,8 @@ public class PartyAServiceImpl implements PartyAService {
 			config.setAppId(deptSub.getAppId());
 			config.setAppSecrete(deptSub.getAppSecret());
 			config.setQueryUrl(deptSub.getQueryUrl());
-			result = settleByTaxHelper(noteList, config, member, taxCode);
+			// result = settleByTaxHelper(noteList, config, member, taxCode);
+			result = settleByTaxHelper();
 		}
 
 		return result;
@@ -1326,94 +1327,103 @@ public class PartyAServiceImpl implements PartyAService {
 	/**
 	 * 税帮云结算
 	 *
-	 * @param noteList 结算记录
-	 * @param config   税帮云config
-	 * @param sysUser  用户
-	 * @param taxCode  企业三合一码
 	 * @return 结果
 	 */
-	private Map<String, String> settleByTaxHelper(List<WmScorePackageSettleNote> noteList,
-												  TaxHelperConfig config,
-												  SysUser sysUser,
-												  String taxCode) {
-
-		// 加锁
-		boolean absent = redisTemplate.opsForValue().setIfAbsent(
-				CacheConstants.SETTLE_PACKAGE_KEY + ":" + sysUser.getUsername() + ":" + taxCode + ":"
-						+ new HashSet(noteList).hashCode(), noteList, CacheConstants.SETTLE_TIME, TimeUnit.DAYS);
-
-		if (!absent) {
-			log.error("当前用户存在其他结算请求");
-			return getResultMap("4000", "当前用户存在其他结算请求");
-		}
-
-		// 开始结算
-		TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
-		taxHelperSettlementModel.setEnterpriseCode(taxCode);
-		taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
-		taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() + "/v2/settlementNotify");
-
-		List<TaxHelperSettlementModel.AbstractArr> abstractArrList = new ArrayList<>();
-		Map<String, TaxHelperSettlementModel.DetailedArr> detailArrMap = new HashMap<>();
-		noteList.forEach(note -> {
-			TaxHelperSettlementModel.DetailedArr detailedArr;
-			if (detailArrMap.containsKey(sysUser.getIdCardNumber())) {
-				detailedArr = detailArrMap.get(sysUser.getIdCardNumber());
-				detailedArr.setInputAmount((BigDecimal.valueOf(detailedArr.getInputAmount())
-						.add(note.getSettleAmount())
-						.doubleValue()));
-			} else {
-				detailedArr = new TaxHelperSettlementModel.DetailedArr();
-				detailedArr.setIdCard(sysUser.getIdCardNumber());
-				detailedArr.setInputAmount(note.getSettleAmount().doubleValue());
-				// detailedArr.setCategoryName("专业技术服务");
-				detailedArr.setCategoryName(StringUtils.isEmpty(note.getCategoryName()) ? "健康咨询服务费" : note.getCategoryName());
-				detailArrMap.put(sysUser.getIdCardNumber(), detailedArr);
-			}
-			TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
-			abstractArr.setIdCard(sysUser.getIdCardNumber());
-			abstractArr.setNumber(1);
-			abstractArr.setPrice(note.getSettleAmount().doubleValue());
-			abstractArr.setAmount(note.getSettleAmount().doubleValue());
-			abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
-					.getUserId());
-			abstractArrList.add(abstractArr);
-		});
-		taxHelperSettlementModel.setCount(detailArrMap.size());
-		List<TaxHelperSettlementModel.DetailedArr> detailedArrList = new ArrayList<>(detailArrMap.values());
-		taxHelperSettlementModel.setDetailedArr(detailedArrList);
-		taxHelperSettlementModel.setAbstractArr(abstractArrList);
-		TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
-		TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
-		log.info("税邦云结算: {}", response);
-		if (response.success()) {
-			noteList.forEach(note -> {
-				log.info("税邦云结算提交成功: {}", note.getSettleNo());
-				//streamId 获取不到
-				if (StringUtils.isEmpty(response.getMessage())) {
-					log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
-				}
-				note.setUpdateTime(LocalDateTime.now());
-				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
-				// 新增字段streamId
-				note.setStreamId(response.getMessage());
-				wmScorePackageSettleNoteService.updateById(note);
-			});
-			return getResultMap("2000", "提交结算成功");
-		} else {
-			noteList.forEach(note -> {
-				log.info("税邦云结算提交失败: {}", note.getSettleNo());
-				note.setUpdateTime(LocalDateTime.now());
-				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
-				wmScorePackageSettleNoteService.updateById(note);
-			});
-			return getResultMap("4000", "结算失败");
-
-		}
-
-
+	private Map<String, String> settleByTaxHelper() {
+		return getResultMap("4000", "因系统维护,暂时不能提起支付,有问题请联系客服");
 	}
 
+	// /**
+	//  * 税帮云结算
+	//  *
+	//  * @param noteList 结算记录
+	//  * @param config   税帮云config
+	//  * @param sysUser  用户
+	//  * @param taxCode  企业三合一码
+	//  * @return 结果
+	//  */
+	// private Map<String, String> settleByTaxHelper(List<WmScorePackageSettleNote> noteList,
+	// 											  TaxHelperConfig config,
+	// 											  SysUser sysUser,
+	// 											  String taxCode) {
+	//
+	// 	// 加锁
+	// 	boolean absent = redisTemplate.opsForValue().setIfAbsent(
+	// 			CacheConstants.SETTLE_PACKAGE_KEY + ":" + sysUser.getUsername() + ":" + taxCode + ":"
+	// 					+ new HashSet(noteList).hashCode(), noteList, CacheConstants.SETTLE_TIME, TimeUnit.DAYS);
+	//
+	// 	if (!absent) {
+	// 		log.error("当前用户存在其他结算请求");
+	// 		return getResultMap("4000", "当前用户存在其他结算请求");
+	// 	}
+	//
+	// 	// 开始结算
+	// 	TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
+	// 	taxHelperSettlementModel.setEnterpriseCode(taxCode);
+	// 	taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
+	// 	taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() + "/v2/settlementNotify");
+	//
+	// 	List<TaxHelperSettlementModel.AbstractArr> abstractArrList = new ArrayList<>();
+	// 	Map<String, TaxHelperSettlementModel.DetailedArr> detailArrMap = new HashMap<>();
+	// 	noteList.forEach(note -> {
+	// 		TaxHelperSettlementModel.DetailedArr detailedArr;
+	// 		if (detailArrMap.containsKey(sysUser.getIdCardNumber())) {
+	// 			detailedArr = detailArrMap.get(sysUser.getIdCardNumber());
+	// 			detailedArr.setInputAmount((BigDecimal.valueOf(detailedArr.getInputAmount())
+	// 					.add(note.getSettleAmount())
+	// 					.doubleValue()));
+	// 		} else {
+	// 			detailedArr = new TaxHelperSettlementModel.DetailedArr();
+	// 			detailedArr.setIdCard(sysUser.getIdCardNumber());
+	// 			detailedArr.setInputAmount(note.getSettleAmount().doubleValue());
+	// 			// detailedArr.setCategoryName("专业技术服务");
+	// 			detailedArr.setCategoryName(StringUtils.isEmpty(note.getCategoryName()) ? "健康咨询服务费" : note.getCategoryName());
+	// 			detailArrMap.put(sysUser.getIdCardNumber(), detailedArr);
+	// 		}
+	// 		TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
+	// 		abstractArr.setIdCard(sysUser.getIdCardNumber());
+	// 		abstractArr.setNumber(1);
+	// 		abstractArr.setPrice(note.getSettleAmount().doubleValue());
+	// 		abstractArr.setAmount(note.getSettleAmount().doubleValue());
+	// 		abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
+	// 				.getUserId());
+	// 		abstractArrList.add(abstractArr);
+	// 	});
+	// 	taxHelperSettlementModel.setCount(detailArrMap.size());
+	// 	List<TaxHelperSettlementModel.DetailedArr> detailedArrList = new ArrayList<>(detailArrMap.values());
+	// 	taxHelperSettlementModel.setDetailedArr(detailedArrList);
+	// 	taxHelperSettlementModel.setAbstractArr(abstractArrList);
+	// 	TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
+	// 	TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
+	// 	log.info("税邦云结算: {}", response);
+	// 	if (response.success()) {
+	// 		noteList.forEach(note -> {
+	// 			log.info("税邦云结算提交成功: {}", note.getSettleNo());
+	// 			//streamId 获取不到
+	// 			if (StringUtils.isEmpty(response.getMessage())) {
+	// 				log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
+	// 			}
+	// 			note.setUpdateTime(LocalDateTime.now());
+	// 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
+	// 			// 新增字段streamId
+	// 			note.setStreamId(response.getMessage());
+	// 			wmScorePackageSettleNoteService.updateById(note);
+	// 		});
+	// 		return getResultMap("2000", "提交结算成功");
+	// 	} else {
+	// 		noteList.forEach(note -> {
+	// 			log.info("税邦云结算提交失败: {}", note.getSettleNo());
+	// 			note.setUpdateTime(LocalDateTime.now());
+	// 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+	// 			wmScorePackageSettleNoteService.updateById(note);
+	// 		});
+	// 		return getResultMap("4000", "结算失败");
+	//
+	// 	}
+	//
+	//
+	// }
+
 	/**
 	 * 记录用户认证信息
 	 *

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

@@ -259,9 +259,10 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 				}
 			}
 			if("1".equals(input.getSubType())){
-				if (!Objects.equals(user.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
-					return R.failed(user.getRealname()+"人员未认证或未绑卡,不能结算");
-				}
+				return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
+				// if (!Objects.equals(user.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
+				// 	return R.failed(user.getRealname()+"人员未认证或未绑卡,不能结算");
+				// }
 			}
 		}
 
@@ -503,7 +504,8 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 			} else {
 				return R.failed("未配置企业的统一社会信用代码");
 			}
-			return settleByShuiBangYun(input, sysDeptSub, wmScorePackage,taxCode);
+			// return settleByShuiBangYun(input, sysDeptSub, wmScorePackage,taxCode);
+			return settleByShuiBangYun();
 		}
 
 	}
@@ -541,143 +543,148 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
 			} else {
 				return R.failed("未配置企业的统一社会信用代码");
 			}
-			return settleByShuiBangYun(input, sysDeptSub, wmScorePackage,taxCode);
+			// return settleByShuiBangYun(input, sysDeptSub, wmScorePackage,taxCode);
+			return settleByShuiBangYun();
 		}
 
 	}
 
-	private R settleByShuiBangYun(WmScorePackageSettleInput input,
-								  SysDeptSub sysDeptSub,
-								  WmScorePackage wmScorePackage,
-								  String taxCode) {
-		List<WmScorePackageSettleNote> notes = input.getNotes();
-		StringBuilder noticeInfo = new StringBuilder();
-
-
-		/**
-		 * WmScorePackageSettleNote
-		 */
-		for (WmScorePackageSettleNote note : notes) {
-			note.setInvoiceType(input.getInvoiceCategory());
-			note.setCategoryName(input.toCategoryName());
-			note.setSubToGigTime(LocalDateTime.now());
-		}
-		noteService.updateBatchById(notes);
-
-
-
-		for (int i = 0; i < notes.size(); i++) {
-			WmScorePackageSettleNote note = notes.get(i);
-			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
-
-			if (!Objects.equals(sysUser.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
-				return R.failed(sysUser.getRealname() + "人员未认证或未绑卡,不能结算");
-			}
-
-			if (redisTemplate.hasKey(CacheConstants.SETTLE_PACKAGE_KEY + note.getId())) {
-				return R.failed("结算对象-" + sysUser.getRealname() + ":正在结算,请勿重复结算");
-			}
-
-			if (DingEnum.NOTE_STATUS_SUCCESS.getType().equals(note.getSettleNoteStatus())) {
-				log.info("结算对象-" + sysUser.getRealname() + ":已结算,请勿重复结算");
-				return R.failed("结算对象-" + sysUser.getRealname() + ":已结算,请勿重复结算");
-			}
-			if (DingEnum.NOTE_STATUS_SUBMIT.getType().equals(note.getSettleNoteStatus())) {
-				log.info("结算对象-" + sysUser.getRealname() + ":已提交,请等待耐心结算结果");
-				return R.failed("结算对象-" + sysUser.getRealname() + ":已提交,请等待耐心结算结果");
-			}
-
-		}
-
-		for (int i = 0; i < notes.size(); i++) {
-			WmScorePackageSettleNote note = notes.get(i);
-
-			/**
-			 * 加锁
-			 */
-			redisTemplate.opsForValue().set(CacheConstants.SETTLE_PACKAGE_KEY + note.getId(),
-					note.getId(), CacheConstants.SETTLE_TIME, TimeUnit.DAYS);
-
-			SysUser sysUser = sysUserMapper.selectById(note.getUserId());
-
-			TaxHelperConfig config = new TaxHelperConfig();
-			config.setAppId(sysDeptSub.getAppId());
-			config.setAppSecrete(sysDeptSub.getAppSecret());
-			config.setQueryUrl(sysDeptSub.getQueryUrl());
-
-			/**
-			 * 开始结算
-			 */
-			TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
-			taxHelperSettlementModel.setEnterpriseCode(taxCode);
-
-			taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
-			taxHelperSettlementModel.setCount(1);
-
-			taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() + "/settlementNotify");
-			TaxHelperSettlementModel.DetailedArr detailedArr = new TaxHelperSettlementModel.DetailedArr();
-			detailedArr.setIdCard(sysUser.getIdCardNumber());
-			detailedArr.setInputAmount(note.getSettleAmount().doubleValue());
-			detailedArr.setCategoryName(note.getCategoryName());
-			taxHelperSettlementModel.setDetailedArr(Arrays.asList(detailedArr));
-
-			TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
-
-			abstractArr.setIdCard(sysUser.getIdCardNumber());
-			abstractArr.setNumber(1);
-			abstractArr.setPrice(note.getSettleAmount().doubleValue());
-			abstractArr.setAmount(note.getSettleAmount().doubleValue());
-
-			// abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/admin/api/h5PackagePage?current=1&size=20&id=" + wmScorePackage.getScorePackageName());
-			abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note.getUserId());
-
-			taxHelperSettlementModel.setAbstractArr(Arrays.asList(abstractArr));
-
-			TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
-
-			TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
-
-			log.info("税邦云结算: {}", response);
-
-
-			if (response.success()) {
-				log.info("税邦云结算提交成功: {}", note.getSettleNo());
-				//streamId 获取不到
-				if (StringUtils.isEmpty(response.getMessage())) {
-					log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
-					noticeInfo.append(sysUser.getRealname() + ":提交结算成功,业务流水号获取不到,请联系管理员;");
-				}
-				note.setUpdateTime(LocalDateTime.now());
-				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
-				// 新增字段streamId
-				note.setStreamId(response.getMessage());
-				noticeInfo.append(sysUser.getRealname() + ":提交结算成功;");
-			} else {
-				log.info("税邦云结算提交失败: {}", note.getSettleNo());
-				note.setUpdateTime(LocalDateTime.now());
-				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
-				noticeInfo.append(sysUser.getRealname() + ":结算提交失败-" + response.getMessage() + ";");
-
-				log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
-				redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
-
-			}
-		}
-
-		noteService.updateBatchById(notes);
-
-		/**
-		 * 更新结算结果
-		 */
-		SettleNoteStatusOutput output = noteService.selectSettleNoteStatus(input.getId());
-		WmScorePackage updateEntity = new WmScorePackage();
-		updateEntity.setId(input.getId());
-		updateEntity.setSettleStatus(output.toSettleStatus());
-		wmScorePackageService.updateById(updateEntity);
-
-		return R.ok(null, noticeInfo.toString());
+	private R settleByShuiBangYun(){
+		return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
 	}
 
+	// private R settleByShuiBangYun(WmScorePackageSettleInput input,
+	// 							  SysDeptSub sysDeptSub,
+	// 							  WmScorePackage wmScorePackage,
+	// 							  String taxCode) {
+	// 	List<WmScorePackageSettleNote> notes = input.getNotes();
+	// 	StringBuilder noticeInfo = new StringBuilder();
+	//
+	//
+	// 	/**
+	// 	 * WmScorePackageSettleNote
+	// 	 */
+	// 	for (WmScorePackageSettleNote note : notes) {
+	// 		note.setInvoiceType(input.getInvoiceCategory());
+	// 		note.setCategoryName(input.toCategoryName());
+	// 		note.setSubToGigTime(LocalDateTime.now());
+	// 	}
+	// 	noteService.updateBatchById(notes);
+	//
+	//
+	//
+	// 	for (int i = 0; i < notes.size(); i++) {
+	// 		WmScorePackageSettleNote note = notes.get(i);
+	// 		SysUser sysUser = sysUserMapper.selectById(note.getUserId());
+	//
+	// 		if (!Objects.equals(sysUser.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
+	// 			return R.failed(sysUser.getRealname() + "人员未认证或未绑卡,不能结算");
+	// 		}
+	//
+	// 		if (redisTemplate.hasKey(CacheConstants.SETTLE_PACKAGE_KEY + note.getId())) {
+	// 			return R.failed("结算对象-" + sysUser.getRealname() + ":正在结算,请勿重复结算");
+	// 		}
+	//
+	// 		if (DingEnum.NOTE_STATUS_SUCCESS.getType().equals(note.getSettleNoteStatus())) {
+	// 			log.info("结算对象-" + sysUser.getRealname() + ":已结算,请勿重复结算");
+	// 			return R.failed("结算对象-" + sysUser.getRealname() + ":已结算,请勿重复结算");
+	// 		}
+	// 		if (DingEnum.NOTE_STATUS_SUBMIT.getType().equals(note.getSettleNoteStatus())) {
+	// 			log.info("结算对象-" + sysUser.getRealname() + ":已提交,请等待耐心结算结果");
+	// 			return R.failed("结算对象-" + sysUser.getRealname() + ":已提交,请等待耐心结算结果");
+	// 		}
+	//
+	// 	}
+	//
+	// 	for (int i = 0; i < notes.size(); i++) {
+	// 		WmScorePackageSettleNote note = notes.get(i);
+	//
+	// 		/**
+	// 		 * 加锁
+	// 		 */
+	// 		redisTemplate.opsForValue().set(CacheConstants.SETTLE_PACKAGE_KEY + note.getId(),
+	// 				note.getId(), CacheConstants.SETTLE_TIME, TimeUnit.DAYS);
+	//
+	// 		SysUser sysUser = sysUserMapper.selectById(note.getUserId());
+	//
+	// 		TaxHelperConfig config = new TaxHelperConfig();
+	// 		config.setAppId(sysDeptSub.getAppId());
+	// 		config.setAppSecrete(sysDeptSub.getAppSecret());
+	// 		config.setQueryUrl(sysDeptSub.getQueryUrl());
+	//
+	// 		/**
+	// 		 * 开始结算
+	// 		 */
+	// 		TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
+	// 		taxHelperSettlementModel.setEnterpriseCode(taxCode);
+	//
+	// 		taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
+	// 		taxHelperSettlementModel.setCount(1);
+	//
+	// 		taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() + "/settlementNotify");
+	// 		TaxHelperSettlementModel.DetailedArr detailedArr = new TaxHelperSettlementModel.DetailedArr();
+	// 		detailedArr.setIdCard(sysUser.getIdCardNumber());
+	// 		detailedArr.setInputAmount(note.getSettleAmount().doubleValue());
+	// 		detailedArr.setCategoryName(note.getCategoryName());
+	// 		taxHelperSettlementModel.setDetailedArr(Arrays.asList(detailedArr));
+	//
+	// 		TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
+	//
+	// 		abstractArr.setIdCard(sysUser.getIdCardNumber());
+	// 		abstractArr.setNumber(1);
+	// 		abstractArr.setPrice(note.getSettleAmount().doubleValue());
+	// 		abstractArr.setAmount(note.getSettleAmount().doubleValue());
+	//
+	// 		// abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/admin/api/h5PackagePage?current=1&size=20&id=" + wmScorePackage.getScorePackageName());
+	// 		abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note.getUserId());
+	//
+	// 		taxHelperSettlementModel.setAbstractArr(Arrays.asList(abstractArr));
+	//
+	// 		TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
+	//
+	// 		TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
+	//
+	// 		log.info("税邦云结算: {}", response);
+	//
+	//
+	// 		if (response.success()) {
+	// 			log.info("税邦云结算提交成功: {}", note.getSettleNo());
+	// 			//streamId 获取不到
+	// 			if (StringUtils.isEmpty(response.getMessage())) {
+	// 				log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
+	// 				noticeInfo.append(sysUser.getRealname() + ":提交结算成功,业务流水号获取不到,请联系管理员;");
+	// 			}
+	// 			note.setUpdateTime(LocalDateTime.now());
+	// 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
+	// 			// 新增字段streamId
+	// 			note.setStreamId(response.getMessage());
+	// 			noticeInfo.append(sysUser.getRealname() + ":提交结算成功;");
+	// 		} else {
+	// 			log.info("税邦云结算提交失败: {}", note.getSettleNo());
+	// 			note.setUpdateTime(LocalDateTime.now());
+	// 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+	// 			noticeInfo.append(sysUser.getRealname() + ":结算提交失败-" + response.getMessage() + ";");
+	//
+	// 			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
+	// 			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
+	//
+	// 		}
+	// 	}
+	//
+	// 	noteService.updateBatchById(notes);
+	//
+	// 	/**
+	// 	 * 更新结算结果
+	// 	 */
+	// 	SettleNoteStatusOutput output = noteService.selectSettleNoteStatus(input.getId());
+	// 	WmScorePackage updateEntity = new WmScorePackage();
+	// 	updateEntity.setId(input.getId());
+	// 	updateEntity.setSettleStatus(output.toSettleStatus());
+	// 	wmScorePackageService.updateById(updateEntity);
+	//
+	// 	return R.ok(null, noticeInfo.toString());
+	// }
+
 	private R settleByRenLiJia(WmScorePackageSettleInput input, SysDeptSub sysDeptSub, WmScorePackage wmScorePackage) {
 		List<WmScorePackageSettleNote> notes = input.getNotes();
 

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

@@ -498,7 +498,8 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			config.setAppSecrete(sysDeptSub.getAppSecret());
 			config.setQueryUrl(sysDeptSub.getQueryUrl());
 
-			return settleByShuiBangYun(note, config, wmScorePackage, sysUser, taxCode);
+			// return settleByShuiBangYun(note, config, wmScorePackage, sysUser, taxCode);
+			return settleByShuiBangYun();
 		}
 
 	}
@@ -590,181 +591,188 @@ public class WmScorePackageSettleNoteServiceImpl extends ServiceImpl<WmScorePack
 			config.setAppId(deptSub.getAppId());
 			config.setAppSecrete(deptSub.getAppSecret());
 			config.setQueryUrl(deptSub.getQueryUrl());
-			return settleByTaxHelper(noteList, config, taxCode);
+			// return settleByTaxHelper(noteList, config, taxCode);
+			return settleByTaxHelper();
 		}
 		return R.ok();
 	}
 
 
-	/**
-	 * 税帮云结算
-	 *
-	 * @param noteList 结算记录
-	 * @param config   税帮云config
-	 * @param taxCode  企业三合一码
-	 * @return 结果
-	 */
-	private R settleByTaxHelper(List<WmScorePackageSettleNote> noteList, TaxHelperConfig config, String taxCode) {
-
-		// 加锁
-		List<Integer> noteIdList = noteList.stream().filter(note ->
-						redisTemplate.opsForValue().setIfAbsent(
-								CacheConstants.SETTLE_PACKAGE_KEY + ":note_id_" + note.getId(),
-								noteList, CacheConstants.SETTLE_TIME, TimeUnit.DAYS))
-				.mapToInt(WmScorePackageSettleNote::getId).boxed().collect(Collectors.toList());
-
-		// 加锁记录数不等于提交记录数,说明存在在途交易
-		if (CollectionUtils.isEmpty(noteIdList)) {
-			log.error("当前用户存在其他结算请求");
-			return R.failed("当前用户存在其他结算请求");
-		} else {
-			if (!Objects.equals(noteList.size(), noteIdList.size())) {
-				// 删除锁
-				noteIdList.forEach(id -> redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + ":note_id_" + id));
-				log.error("当前用户存在其他结算请求");
-				return R.failed("当前用户存在其他结算请求");
-			}
-		}
-
-		// 开始结算
-		TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
-		taxHelperSettlementModel.setEnterpriseCode(taxCode);
-		taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
-
-		Set<String> userIdList = noteList.stream().map(WmScorePackageSettleNote::getUserId).collect(Collectors.toSet());
-		taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + String.join("|", userIdList) + "/v1/settlementNotify");
-
-		List<TaxHelperSettlementModel.AbstractArr> abstractArrList = new ArrayList<>();
-		Map<String, TaxHelperSettlementModel.DetailedArr> detailArrMap = new HashMap<>();
-		noteList.forEach(note -> {
-			TaxHelperSettlementModel.DetailedArr detailedArr;
-			if (detailArrMap.containsKey(note.getIdCardNumber())) {
-				detailedArr = detailArrMap.get(note.getIdCardNumber());
-				detailedArr.setInputAmount((BigDecimal.valueOf(detailedArr.getInputAmount())
-						.add(note.getSettleAmount())
-						.doubleValue()));
-			} else {
-				detailedArr = new TaxHelperSettlementModel.DetailedArr();
-				detailedArr.setIdCard(note.getIdCardNumber());
-				detailedArr.setInputAmount(note.getSettleAmount().doubleValue());
-				detailedArr.setCategoryName(StringUtils.isEmpty(note.getCategoryName()) ? "专业技术服务" : note.getCategoryName());
-				detailArrMap.put(note.getIdCardNumber(), detailedArr);
-			}
-			TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
-			abstractArr.setIdCard(note.getIdCardNumber());
-			abstractArr.setNumber(1);
-			abstractArr.setPrice(note.getSettleAmount().doubleValue());
-			abstractArr.setAmount(note.getSettleAmount().doubleValue());
-			abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
-					.getUserId());
-			abstractArrList.add(abstractArr);
-		});
-		taxHelperSettlementModel.setCount(detailArrMap.size());
-		List<TaxHelperSettlementModel.DetailedArr> detailedArrList = new ArrayList<>(detailArrMap.values());
-		taxHelperSettlementModel.setDetailedArr(detailedArrList);
-		taxHelperSettlementModel.setAbstractArr(abstractArrList);
-		TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
-		TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
-		log.info("税邦云结算: {}", response);
-		if (response.success()) {
-			noteList.forEach(note -> {
-				log.info("税邦云结算提交成功: {}", note.getSettleNo());
-				//streamId 获取不到
-				if (StringUtils.isEmpty(response.getMessage())) {
-					log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
-				}
-				note.setUpdateTime(LocalDateTime.now());
-				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
-				// 新增字段streamId
-				note.setStreamId(response.getMessage());
-				this.baseMapper.updateById(note);
-			});
-			return R.ok("提交结算成功");
-		} else {
-			noteList.forEach(note -> {
-				log.info("税邦云结算提交失败: {}", note.getSettleNo());
-				note.setUpdateTime(LocalDateTime.now());
-				note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
-				this.baseMapper.updateById(note);
-			});
-			return R.ok("结算失败");
-
-		}
+	private R settleByTaxHelper(){
+		return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
 	}
-
-
-	private R settleByShuiBangYun(WmScorePackageSettleNote note,
-								  TaxHelperConfig config,
-								  WmScorePackage wmScorePackage,
-								  SysUser sysUser,
-								  String taxCode) {
-
-		/**
-		 * 加锁
-		 */
-		redisTemplate.opsForValue().set(CacheConstants.SETTLE_PACKAGE_KEY + note.getId(),
-				note.getId(), CacheConstants.SETTLE_TIME, TimeUnit.DAYS);
-
-		/**
-		 * 开始结算
-		 */
-		TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
-		taxHelperSettlementModel.setEnterpriseCode(taxCode);
-
-		taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
-		taxHelperSettlementModel.setCount(1);
-
-		taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() + "/v1/settlementNotify");
-		TaxHelperSettlementModel.DetailedArr detailedArr = new TaxHelperSettlementModel.DetailedArr();
-		detailedArr.setIdCard(sysUser.getIdCardNumber());
-		detailedArr.setInputAmount(note.getSettleAmount().doubleValue());
-		detailedArr.setCategoryName(note.getCategoryName());
-		taxHelperSettlementModel.setDetailedArr(Arrays.asList(detailedArr));
-
-		TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
-
-		abstractArr.setIdCard(sysUser.getIdCardNumber());
-		abstractArr.setNumber(1);
-		abstractArr.setPrice(note.getSettleAmount().doubleValue());
-		abstractArr.setAmount(note.getSettleAmount().doubleValue());
-
-		abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
-				.getUserId());
-
-		taxHelperSettlementModel.setAbstractArr(Arrays.asList(abstractArr));
-
-		TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
-
-		TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
-
-		log.info("税邦云结算: {}", response);
-
-
-		if (response.success()) {
-			log.info("税邦云结算提交成功: {}", note.getSettleNo());
-			//streamId 获取不到
-			if (StringUtils.isEmpty(response.getMessage())) {
-				log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
-			}
-			note.setUpdateTime(LocalDateTime.now());
-			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
-			// 新增字段streamId
-			note.setStreamId(response.getMessage());
-		} else {
-			log.info("税邦云结算提交失败: {}", note.getSettleNo());
-			note.setUpdateTime(LocalDateTime.now());
-			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
-
-			log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
-			redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
-
-		}
-
-		this.baseMapper.updateById(note);
-
-		return R.ok();
+	// /**
+	//  * 税帮云结算
+	//  *
+	//  * @param noteList 结算记录
+	//  * @param config   税帮云config
+	//  * @param taxCode  企业三合一码
+	//  * @return 结果
+	//  */
+	// private R settleByTaxHelper(List<WmScorePackageSettleNote> noteList, TaxHelperConfig config, String taxCode) {
+	//
+	// 	// 加锁
+	// 	List<Integer> noteIdList = noteList.stream().filter(note ->
+	// 					redisTemplate.opsForValue().setIfAbsent(
+	// 							CacheConstants.SETTLE_PACKAGE_KEY + ":note_id_" + note.getId(),
+	// 							noteList, CacheConstants.SETTLE_TIME, TimeUnit.DAYS))
+	// 			.mapToInt(WmScorePackageSettleNote::getId).boxed().collect(Collectors.toList());
+	//
+	// 	// 加锁记录数不等于提交记录数,说明存在在途交易
+	// 	if (CollectionUtils.isEmpty(noteIdList)) {
+	// 		log.error("当前用户存在其他结算请求");
+	// 		return R.failed("当前用户存在其他结算请求");
+	// 	} else {
+	// 		if (!Objects.equals(noteList.size(), noteIdList.size())) {
+	// 			// 删除锁
+	// 			noteIdList.forEach(id -> redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + ":note_id_" + id));
+	// 			log.error("当前用户存在其他结算请求");
+	// 			return R.failed("当前用户存在其他结算请求");
+	// 		}
+	// 	}
+	//
+	// 	// 开始结算
+	// 	TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
+	// 	taxHelperSettlementModel.setEnterpriseCode(taxCode);
+	// 	taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
+	//
+	// 	Set<String> userIdList = noteList.stream().map(WmScorePackageSettleNote::getUserId).collect(Collectors.toSet());
+	// 	taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + String.join("|", userIdList) + "/v1/settlementNotify");
+	//
+	// 	List<TaxHelperSettlementModel.AbstractArr> abstractArrList = new ArrayList<>();
+	// 	Map<String, TaxHelperSettlementModel.DetailedArr> detailArrMap = new HashMap<>();
+	// 	noteList.forEach(note -> {
+	// 		TaxHelperSettlementModel.DetailedArr detailedArr;
+	// 		if (detailArrMap.containsKey(note.getIdCardNumber())) {
+	// 			detailedArr = detailArrMap.get(note.getIdCardNumber());
+	// 			detailedArr.setInputAmount((BigDecimal.valueOf(detailedArr.getInputAmount())
+	// 					.add(note.getSettleAmount())
+	// 					.doubleValue()));
+	// 		} else {
+	// 			detailedArr = new TaxHelperSettlementModel.DetailedArr();
+	// 			detailedArr.setIdCard(note.getIdCardNumber());
+	// 			detailedArr.setInputAmount(note.getSettleAmount().doubleValue());
+	// 			detailedArr.setCategoryName(StringUtils.isEmpty(note.getCategoryName()) ? "专业技术服务" : note.getCategoryName());
+	// 			detailArrMap.put(note.getIdCardNumber(), detailedArr);
+	// 		}
+	// 		TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
+	// 		abstractArr.setIdCard(note.getIdCardNumber());
+	// 		abstractArr.setNumber(1);
+	// 		abstractArr.setPrice(note.getSettleAmount().doubleValue());
+	// 		abstractArr.setAmount(note.getSettleAmount().doubleValue());
+	// 		abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
+	// 				.getUserId());
+	// 		abstractArrList.add(abstractArr);
+	// 	});
+	// 	taxHelperSettlementModel.setCount(detailArrMap.size());
+	// 	List<TaxHelperSettlementModel.DetailedArr> detailedArrList = new ArrayList<>(detailArrMap.values());
+	// 	taxHelperSettlementModel.setDetailedArr(detailedArrList);
+	// 	taxHelperSettlementModel.setAbstractArr(abstractArrList);
+	// 	TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
+	// 	TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
+	// 	log.info("税邦云结算: {}", response);
+	// 	if (response.success()) {
+	// 		noteList.forEach(note -> {
+	// 			log.info("税邦云结算提交成功: {}", note.getSettleNo());
+	// 			//streamId 获取不到
+	// 			if (StringUtils.isEmpty(response.getMessage())) {
+	// 				log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
+	// 			}
+	// 			note.setUpdateTime(LocalDateTime.now());
+	// 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
+	// 			// 新增字段streamId
+	// 			note.setStreamId(response.getMessage());
+	// 			this.baseMapper.updateById(note);
+	// 		});
+	// 		return R.ok("提交结算成功");
+	// 	} else {
+	// 		noteList.forEach(note -> {
+	// 			log.info("税邦云结算提交失败: {}", note.getSettleNo());
+	// 			note.setUpdateTime(LocalDateTime.now());
+	// 			note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+	// 			this.baseMapper.updateById(note);
+	// 		});
+	// 		return R.ok("结算失败");
+	//
+	// 	}
+	// }
+
+	private R settleByShuiBangYun(){
+		return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
 	}
 
+	// private R settleByShuiBangYun(WmScorePackageSettleNote note,
+	// 							  TaxHelperConfig config,
+	// 							  WmScorePackage wmScorePackage,
+	// 							  SysUser sysUser,
+	// 							  String taxCode) {
+	//
+	// 	/**
+	// 	 * 加锁
+	// 	 */
+	// 	redisTemplate.opsForValue().set(CacheConstants.SETTLE_PACKAGE_KEY + note.getId(),
+	// 			note.getId(), CacheConstants.SETTLE_TIME, TimeUnit.DAYS);
+	//
+	// 	/**
+	// 	 * 开始结算
+	// 	 */
+	// 	TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
+	// 	taxHelperSettlementModel.setEnterpriseCode(taxCode);
+	//
+	// 	taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
+	// 	taxHelperSettlementModel.setCount(1);
+	//
+	// 	taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() + "/v1/settlementNotify");
+	// 	TaxHelperSettlementModel.DetailedArr detailedArr = new TaxHelperSettlementModel.DetailedArr();
+	// 	detailedArr.setIdCard(sysUser.getIdCardNumber());
+	// 	detailedArr.setInputAmount(note.getSettleAmount().doubleValue());
+	// 	detailedArr.setCategoryName(note.getCategoryName());
+	// 	taxHelperSettlementModel.setDetailedArr(Arrays.asList(detailedArr));
+	//
+	// 	TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
+	//
+	// 	abstractArr.setIdCard(sysUser.getIdCardNumber());
+	// 	abstractArr.setNumber(1);
+	// 	abstractArr.setPrice(note.getSettleAmount().doubleValue());
+	// 	abstractArr.setAmount(note.getSettleAmount().doubleValue());
+	//
+	// 	abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
+	// 			.getUserId());
+	//
+	// 	taxHelperSettlementModel.setAbstractArr(Arrays.asList(abstractArr));
+	//
+	// 	TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
+	//
+	// 	TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
+	//
+	// 	log.info("税邦云结算: {}", response);
+	//
+	//
+	// 	if (response.success()) {
+	// 		log.info("税邦云结算提交成功: {}", note.getSettleNo());
+	// 		//streamId 获取不到
+	// 		if (StringUtils.isEmpty(response.getMessage())) {
+	// 			log.info("税邦云结算提交成功 streamId 获取不到: {}", note.getSettleNo());
+	// 		}
+	// 		note.setUpdateTime(LocalDateTime.now());
+	// 		note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
+	// 		// 新增字段streamId
+	// 		note.setStreamId(response.getMessage());
+	// 	} else {
+	// 		log.info("税邦云结算提交失败: {}", note.getSettleNo());
+	// 		note.setUpdateTime(LocalDateTime.now());
+	// 		note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
+	//
+	// 		log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
+	// 		redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
+	//
+	// 	}
+	//
+	// 	this.baseMapper.updateById(note);
+	//
+	// 	return R.ok();
+	// }
+
 	private R settleByRenLiJia(WmScorePackageSettleNote note, DingConfig config, WmScorePackage wmScorePackage, String subjectName) {
 
 		SysUser sysUser = sysUserService.getById(note.getUserId());

+ 220 - 215
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmTaskSettleNoteServiceImpl.java

@@ -88,114 +88,116 @@ public class WmTaskSettleNoteServiceImpl extends ServiceImpl<WmTaskSettleNoteMap
 	@Override
 	public R batchSettle(WmTaskSettleNote note) {
 
-		String[] ids = note.getIdStr().split(",");
-		StringBuilder noticeInfo = new StringBuilder();
-		for (int i = 0; i < ids.length; i++) {
-			String id = ids[i];
-			WmTaskSettleNote settleNote = this.baseMapper.selectById(id);
-			WmScorePackage wmScorePackage = wmScorePackageMapper.selectById(settleNote.getPackageId());
-
-			if (9 != settleNote.getSettleNoteStatus() && 2 != settleNote.getSettleNoteStatus()) {
-				continue;
-			}
-			if (StringUtils.isEmpty(settleNote.getUserId())) {
-				continue;
-			}
-			SysUser sysUser = sysUserService.getById(settleNote.getUserId());
-			SysDept dept = deptService.getById(sysUser.getDeptId());
-
-			if (null != dept && StringUtils.isNotEmpty(dept.getAppId()) && "1".equals(dept.getSubjectType())) {
-				log.info("税邦云结算开始:{} ", dept.getSubjectName());
-			} else {
-				return R.failed("结算信息配置有误");
-
-			}
-			String shCode = "";
-			WmDaAgent agent = wmDaAgentService.selectByDeptId(dept.getDeptId());
-			WmDaDrugEnt drugEnt = wmDaDrugEntService.selectByDeptId(dept.getDeptId());
-			if (null != agent) {
-				shCode = agent.getZjNumber();
-			}else {
-				shCode = drugEnt.getEntcode();
-			}
-			if(StringUtils.isNotEmpty(shCode)){
-				log.info("税邦云结算开始-获取会员所属企业的统一社会信用代码:{} ", shCode);
-			}else {
-				return R.failed("未配置企业的统一社会信用代码");
-			}
-
-			if (!Objects.equals(sysUser.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
-				noticeInfo.append(sysUser.getRealname() + "人员未认证或未绑卡,不能结算;");
-				continue;
-			}
-
-			TaxHelperConfig config = new TaxHelperConfig();
-			config.setAppId(dept.getAppId());
-			config.setAppSecrete(dept.getAppSecret());
-			config.setQueryUrl(dept.getQueryUrl());
-
-			/**
-			 * 开始结算
-			 */
-			TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
-			taxHelperSettlementModel.setEnterpriseCode(shCode);
-
-			taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
-			taxHelperSettlementModel.setCount(1);
-
-			taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() +"/settlementNotify");
-			TaxHelperSettlementModel.DetailedArr detailedArr = new TaxHelperSettlementModel.DetailedArr();
-			detailedArr.setIdCard(sysUser.getIdCardNumber());
-			detailedArr.setInputAmount(settleNote.getSettleAmount().doubleValue());
-			detailedArr.setCategoryName(settleNote.getCategoryName());
-			taxHelperSettlementModel.setDetailedArr(Arrays.asList(detailedArr));
-
-			TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
-
-			abstractArr.setIdCard(sysUser.getIdCardNumber());
-			abstractArr.setNumber(1);
-			abstractArr.setPrice(settleNote.getSettleAmount().doubleValue());
-			abstractArr.setAmount(settleNote.getSettleAmount().doubleValue());
-
-			// abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() +"/admin/api/h5PackagePage?current=1&size=20&id=" + wmScorePackage.getScorePackageName());
-			abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
-					.getUserId());
-
-			taxHelperSettlementModel.setAbstractArr(Arrays.asList(abstractArr));
-
-			TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
-
-			TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
-
-			log.info("税邦云结算: {}", response);
-
-			// 提交结算成功
-			WmTaskSettleNote updateEntity = new WmTaskSettleNote();
-			updateEntity.setId(settleNote.getId());
-			if(response.success()){
-				log.info("税邦云结算提交成功: {}", settleNote.getSettleNo());
-				//streamId 获取不到
-				if(StringUtils.isEmpty(response.getMessage())){
-					log.info("税邦云结算提交成功 streamId 获取不到: {}", settleNote.getSettleNo());
-					noticeInfo.append(sysUser.getRealname() + ":提交结算成功,业务流水号获取不到,请联系管理员;");
-				}
-				updateEntity.setUpdateTime(LocalDateTime.now());
-				updateEntity.setSettleNoteStatus(3);
-
-				updateEntity.setStreamId(response.getMessage());
-				// 新增字段streamId
-				this.baseMapper.updateById(updateEntity);
-				noticeInfo.append(sysUser.getRealname() + ":提交结算成功;");
-			}else {
-				log.info("税邦云结算提交失败: {}",  settleNote.getSettleNo());
-				updateEntity.setUpdateTime(LocalDateTime.now());
-				updateEntity.setSettleNoteStatus(2);
-				this.baseMapper.updateById(updateEntity);
-				noticeInfo.append(sysUser.getRealname() + ":结算提交失败-" + response.getMessage() +";");
-			}
-		}
-
-		return R.ok("",noticeInfo.toString());
+		return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
+
+		// String[] ids = note.getIdStr().split(",");
+		// StringBuilder noticeInfo = new StringBuilder();
+		// for (int i = 0; i < ids.length; i++) {
+		// 	String id = ids[i];
+		// 	WmTaskSettleNote settleNote = this.baseMapper.selectById(id);
+		// 	WmScorePackage wmScorePackage = wmScorePackageMapper.selectById(settleNote.getPackageId());
+		//
+		// 	if (9 != settleNote.getSettleNoteStatus() && 2 != settleNote.getSettleNoteStatus()) {
+		// 		continue;
+		// 	}
+		// 	if (StringUtils.isEmpty(settleNote.getUserId())) {
+		// 		continue;
+		// 	}
+		// 	SysUser sysUser = sysUserService.getById(settleNote.getUserId());
+		// 	SysDept dept = deptService.getById(sysUser.getDeptId());
+		//
+		// 	if (null != dept && StringUtils.isNotEmpty(dept.getAppId()) && "1".equals(dept.getSubjectType())) {
+		// 		log.info("税邦云结算开始:{} ", dept.getSubjectName());
+		// 	} else {
+		// 		return R.failed("结算信息配置有误");
+		//
+		// 	}
+		// 	String shCode = "";
+		// 	WmDaAgent agent = wmDaAgentService.selectByDeptId(dept.getDeptId());
+		// 	WmDaDrugEnt drugEnt = wmDaDrugEntService.selectByDeptId(dept.getDeptId());
+		// 	if (null != agent) {
+		// 		shCode = agent.getZjNumber();
+		// 	}else {
+		// 		shCode = drugEnt.getEntcode();
+		// 	}
+		// 	if(StringUtils.isNotEmpty(shCode)){
+		// 		log.info("税邦云结算开始-获取会员所属企业的统一社会信用代码:{} ", shCode);
+		// 	}else {
+		// 		return R.failed("未配置企业的统一社会信用代码");
+		// 	}
+		//
+		// 	if (!Objects.equals(sysUser.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
+		// 		noticeInfo.append(sysUser.getRealname() + "人员未认证或未绑卡,不能结算;");
+		// 		continue;
+		// 	}
+		//
+		// 	TaxHelperConfig config = new TaxHelperConfig();
+		// 	config.setAppId(dept.getAppId());
+		// 	config.setAppSecrete(dept.getAppSecret());
+		// 	config.setQueryUrl(dept.getQueryUrl());
+		//
+		// 	/**
+		// 	 * 开始结算
+		// 	 */
+		// 	TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
+		// 	taxHelperSettlementModel.setEnterpriseCode(shCode);
+		//
+		// 	taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
+		// 	taxHelperSettlementModel.setCount(1);
+		//
+		// 	taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() +"/settlementNotify");
+		// 	TaxHelperSettlementModel.DetailedArr detailedArr = new TaxHelperSettlementModel.DetailedArr();
+		// 	detailedArr.setIdCard(sysUser.getIdCardNumber());
+		// 	detailedArr.setInputAmount(settleNote.getSettleAmount().doubleValue());
+		// 	detailedArr.setCategoryName(settleNote.getCategoryName());
+		// 	taxHelperSettlementModel.setDetailedArr(Arrays.asList(detailedArr));
+		//
+		// 	TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
+		//
+		// 	abstractArr.setIdCard(sysUser.getIdCardNumber());
+		// 	abstractArr.setNumber(1);
+		// 	abstractArr.setPrice(settleNote.getSettleAmount().doubleValue());
+		// 	abstractArr.setAmount(settleNote.getSettleAmount().doubleValue());
+		//
+		// 	// abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() +"/admin/api/h5PackagePage?current=1&size=20&id=" + wmScorePackage.getScorePackageName());
+		// 	abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
+		// 			.getUserId());
+		//
+		// 	taxHelperSettlementModel.setAbstractArr(Arrays.asList(abstractArr));
+		//
+		// 	TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
+		//
+		// 	TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
+		//
+		// 	log.info("税邦云结算: {}", response);
+		//
+		// 	// 提交结算成功
+		// 	WmTaskSettleNote updateEntity = new WmTaskSettleNote();
+		// 	updateEntity.setId(settleNote.getId());
+		// 	if(response.success()){
+		// 		log.info("税邦云结算提交成功: {}", settleNote.getSettleNo());
+		// 		//streamId 获取不到
+		// 		if(StringUtils.isEmpty(response.getMessage())){
+		// 			log.info("税邦云结算提交成功 streamId 获取不到: {}", settleNote.getSettleNo());
+		// 			noticeInfo.append(sysUser.getRealname() + ":提交结算成功,业务流水号获取不到,请联系管理员;");
+		// 		}
+		// 		updateEntity.setUpdateTime(LocalDateTime.now());
+		// 		updateEntity.setSettleNoteStatus(3);
+		//
+		// 		updateEntity.setStreamId(response.getMessage());
+		// 		// 新增字段streamId
+		// 		this.baseMapper.updateById(updateEntity);
+		// 		noticeInfo.append(sysUser.getRealname() + ":提交结算成功;");
+		// 	}else {
+		// 		log.info("税邦云结算提交失败: {}",  settleNote.getSettleNo());
+		// 		updateEntity.setUpdateTime(LocalDateTime.now());
+		// 		updateEntity.setSettleNoteStatus(2);
+		// 		this.baseMapper.updateById(updateEntity);
+		// 		noticeInfo.append(sysUser.getRealname() + ":结算提交失败-" + response.getMessage() +";");
+		// 	}
+		// }
+		//
+		// return R.ok("",noticeInfo.toString());
 
 	}
 
@@ -208,114 +210,117 @@ public class WmTaskSettleNoteServiceImpl extends ServiceImpl<WmTaskSettleNoteMap
 	 */
 	@Override
 	public R singletSettle(WmTaskSettleNote note) {
-		WmTaskSettleNote settleNote = this.baseMapper.selectById(note.getId());
-		WmScorePackage wmScorePackage = wmScorePackageMapper.selectById(settleNote.getPackageId());
-		if (9 != settleNote.getSettleNoteStatus() && 2 != settleNote.getSettleNoteStatus()) {
-			return R.failed("状态异常,不能结算");
-		}
-		if (StringUtils.isEmpty(settleNote.getUserId())) {
-			return R.failed("数据异常,不能结算");
-		}
-		SysUser sysUser = sysUserService.getById(settleNote.getUserId());
-
-		if (!Objects.equals(sysUser.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
-			return R.failed("人员未认证或未绑卡,不能结算");
-		}
-
-		SysDept dept = deptService.getById(sysUser.getDeptId());
-
-		if (null != dept && StringUtils.isNotEmpty(dept.getAppId()) && "1".equals(dept.getSubjectType())) {
-			log.info("税邦云结算开始:{} ", dept.getSubjectName());
-		} else {
-			return R.failed("结算信息配置有误");
-		}
-
-//		WmDaAgent agent = wmDaAgentService.selectByDeptId(dept.getDeptId());
-//		if(null !=agent && StringUtils.isNotEmpty(agent.getZjNumber()) ){
-//			log.info("税邦云结算开始-获取会员所属企业的统一社会信用代码:{} ", agent.getZjNumber());
-//		}else {
-//			return R.failed("未配置企业的统一社会信用代码");
-//		}
-		String shCode = "";
-		WmDaAgent agent = wmDaAgentService.selectByDeptId(dept.getDeptId());
-		WmDaDrugEnt drugEnt = wmDaDrugEntService.selectByDeptId(dept.getDeptId());
-		if (null != agent) {
-			shCode = agent.getZjNumber();
-		}else {
-			shCode = drugEnt.getEntcode();
-		}
-		if(StringUtils.isNotEmpty(shCode)){
-			log.info("税邦云结算开始-获取会员所属企业的统一社会信用代码:{} ", shCode);
-		}else {
-			return R.failed("未配置企业的统一社会信用代码");
-		}
-
-		TaxHelperConfig config = new TaxHelperConfig();
-		config.setAppId(dept.getAppId());
-		config.setAppSecrete(dept.getAppSecret());
-		config.setQueryUrl(dept.getQueryUrl());
-
-		/**
-		 * 开始结算
-		 */
-		TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
-		taxHelperSettlementModel.setEnterpriseCode(shCode);
-
-		taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
-		taxHelperSettlementModel.setCount(1);
-
-		taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() +"/settlementNotify");
-		TaxHelperSettlementModel.DetailedArr detailedArr = new TaxHelperSettlementModel.DetailedArr();
-		detailedArr.setIdCard(sysUser.getIdCardNumber());
-		detailedArr.setInputAmount(settleNote.getSettleAmount().doubleValue());
-		detailedArr.setCategoryName(settleNote.getCategoryName());
-		taxHelperSettlementModel.setDetailedArr(Arrays.asList(detailedArr));
-
-		TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
-
-		abstractArr.setIdCard(sysUser.getIdCardNumber());
-		abstractArr.setNumber(1);
-		abstractArr.setPrice(settleNote.getSettleAmount().doubleValue());
-		abstractArr.setAmount(settleNote.getSettleAmount().doubleValue());
-
-		// abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() +"/admin/api/h5PackagePage?current=1&size=20&id=" + wmScorePackage.getScorePackageName());
-		abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
-				.getUserId());
-
-		taxHelperSettlementModel.setAbstractArr(Arrays.asList(abstractArr));
 
-		TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
-
-//		String key = (String) redisTemplate.opsForValue().get(CacheConstants.TAX_HELPER_LOGIN_KEY);
-//		taxHelperSettlementRequest.setKey(key);
-		TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
-
-		log.info("税邦云结算: {}", response);
-
-		// 提交结算成功
-		WmTaskSettleNote updateEntity = new WmTaskSettleNote();
-		updateEntity.setId(settleNote.getId());
-		if(response.success()){
-			log.info("税邦云结算提交成功: {}", settleNote.getSettleNo());
-			//streamId 获取不到
-			if(StringUtils.isEmpty(response.getMessage())){
-				log.info("税邦云结算提交成功 streamId 获取不到: {}", settleNote.getSettleNo());
-			}
-			updateEntity.setUpdateTime(LocalDateTime.now());
-			updateEntity.setSettleNoteStatus(3);
-
-			updateEntity.setStreamId(response.getMessage());
-			// 新增字段streamId
-			this.baseMapper.updateById(updateEntity);
-			return R.ok();
-		}else {
-			log.info("税邦云结算提交失败: {}",  settleNote.getSettleNo());
-			updateEntity.setUpdateTime(LocalDateTime.now());
-			updateEntity.setSettleNoteStatus(2);
-			this.baseMapper.updateById(updateEntity);
-			return R.failed("结算失败"+response.getMessage());
-//			return R.failed("结算失败");
-		}
+		return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
+
+// 		WmTaskSettleNote settleNote = this.baseMapper.selectById(note.getId());
+// 		WmScorePackage wmScorePackage = wmScorePackageMapper.selectById(settleNote.getPackageId());
+// 		if (9 != settleNote.getSettleNoteStatus() && 2 != settleNote.getSettleNoteStatus()) {
+// 			return R.failed("状态异常,不能结算");
+// 		}
+// 		if (StringUtils.isEmpty(settleNote.getUserId())) {
+// 			return R.failed("数据异常,不能结算");
+// 		}
+// 		SysUser sysUser = sysUserService.getById(settleNote.getUserId());
+//
+// 		if (!Objects.equals(sysUser.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
+// 			return R.failed("人员未认证或未绑卡,不能结算");
+// 		}
+//
+// 		SysDept dept = deptService.getById(sysUser.getDeptId());
+//
+// 		if (null != dept && StringUtils.isNotEmpty(dept.getAppId()) && "1".equals(dept.getSubjectType())) {
+// 			log.info("税邦云结算开始:{} ", dept.getSubjectName());
+// 		} else {
+// 			return R.failed("结算信息配置有误");
+// 		}
+//
+// //		WmDaAgent agent = wmDaAgentService.selectByDeptId(dept.getDeptId());
+// //		if(null !=agent && StringUtils.isNotEmpty(agent.getZjNumber()) ){
+// //			log.info("税邦云结算开始-获取会员所属企业的统一社会信用代码:{} ", agent.getZjNumber());
+// //		}else {
+// //			return R.failed("未配置企业的统一社会信用代码");
+// //		}
+// 		String shCode = "";
+// 		WmDaAgent agent = wmDaAgentService.selectByDeptId(dept.getDeptId());
+// 		WmDaDrugEnt drugEnt = wmDaDrugEntService.selectByDeptId(dept.getDeptId());
+// 		if (null != agent) {
+// 			shCode = agent.getZjNumber();
+// 		}else {
+// 			shCode = drugEnt.getEntcode();
+// 		}
+// 		if(StringUtils.isNotEmpty(shCode)){
+// 			log.info("税邦云结算开始-获取会员所属企业的统一社会信用代码:{} ", shCode);
+// 		}else {
+// 			return R.failed("未配置企业的统一社会信用代码");
+// 		}
+//
+// 		TaxHelperConfig config = new TaxHelperConfig();
+// 		config.setAppId(dept.getAppId());
+// 		config.setAppSecrete(dept.getAppSecret());
+// 		config.setQueryUrl(dept.getQueryUrl());
+//
+// 		/**
+// 		 * 开始结算
+// 		 */
+// 		TaxHelperSettlementModel taxHelperSettlementModel = new TaxHelperSettlementModel(config);
+// 		taxHelperSettlementModel.setEnterpriseCode(shCode);
+//
+// 		taxHelperSettlementModel.setExtendFieldNames(Arrays.asList("报告下载地址"));
+// 		taxHelperSettlementModel.setCount(1);
+//
+// 		taxHelperSettlementModel.setNotifyUrl(taxNotifyConfig.getNotifyUrl() + "/admin/taxhelper/" + sysUser.getUserId() +"/settlementNotify");
+// 		TaxHelperSettlementModel.DetailedArr detailedArr = new TaxHelperSettlementModel.DetailedArr();
+// 		detailedArr.setIdCard(sysUser.getIdCardNumber());
+// 		detailedArr.setInputAmount(settleNote.getSettleAmount().doubleValue());
+// 		detailedArr.setCategoryName(settleNote.getCategoryName());
+// 		taxHelperSettlementModel.setDetailedArr(Arrays.asList(detailedArr));
+//
+// 		TaxHelperSettlementModel.AbstractArr abstractArr = new TaxHelperSettlementModel.AbstractArr();
+//
+// 		abstractArr.setIdCard(sysUser.getIdCardNumber());
+// 		abstractArr.setNumber(1);
+// 		abstractArr.setPrice(settleNote.getSettleAmount().doubleValue());
+// 		abstractArr.setAmount(settleNote.getSettleAmount().doubleValue());
+//
+// 		// abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() +"/admin/api/h5PackagePage?current=1&size=20&id=" + wmScorePackage.getScorePackageName());
+// 		abstractArr.setExtendField1(taxNotifyConfig.getTaskUrl() + "/#/h5/indexTask?id=" + note.getPackageId() + "&userId=" + note
+// 				.getUserId());
+//
+// 		taxHelperSettlementModel.setAbstractArr(Arrays.asList(abstractArr));
+//
+// 		TaxHelperSettlementRequest taxHelperSettlementRequest = new TaxHelperSettlementRequest(taxHelperSettlementModel);
+//
+// //		String key = (String) redisTemplate.opsForValue().get(CacheConstants.TAX_HELPER_LOGIN_KEY);
+// //		taxHelperSettlementRequest.setKey(key);
+// 		TaxHelperResponse response = taxHelperService.settlement(taxHelperSettlementRequest);
+//
+// 		log.info("税邦云结算: {}", response);
+//
+// 		// 提交结算成功
+// 		WmTaskSettleNote updateEntity = new WmTaskSettleNote();
+// 		updateEntity.setId(settleNote.getId());
+// 		if(response.success()){
+// 			log.info("税邦云结算提交成功: {}", settleNote.getSettleNo());
+// 			//streamId 获取不到
+// 			if(StringUtils.isEmpty(response.getMessage())){
+// 				log.info("税邦云结算提交成功 streamId 获取不到: {}", settleNote.getSettleNo());
+// 			}
+// 			updateEntity.setUpdateTime(LocalDateTime.now());
+// 			updateEntity.setSettleNoteStatus(3);
+//
+// 			updateEntity.setStreamId(response.getMessage());
+// 			// 新增字段streamId
+// 			this.baseMapper.updateById(updateEntity);
+// 			return R.ok();
+// 		}else {
+// 			log.info("税邦云结算提交失败: {}",  settleNote.getSettleNo());
+// 			updateEntity.setUpdateTime(LocalDateTime.now());
+// 			updateEntity.setSettleNoteStatus(2);
+// 			this.baseMapper.updateById(updateEntity);
+// 			return R.failed("结算失败"+response.getMessage());
+// //			return R.failed("结算失败");
+// 		}
 
 	}