|
@@ -1,5 +1,7 @@
|
|
|
package com.qunzhixinxi.hnqz.admin.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants;
|
|
@@ -11,9 +13,13 @@ import com.qunzhixinxi.hnqz.admin.entity.input.SettleAmountMonitorInput;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.SettleNoteStatusOutput;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageSettleInput;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.output.SettleAmountMonitorOutput;
|
|
|
+import com.qunzhixinxi.hnqz.admin.enums.GigChannelEnum;
|
|
|
+import com.qunzhixinxi.hnqz.admin.enums.GigTypeEnum;
|
|
|
+import com.qunzhixinxi.hnqz.admin.enums.OladingCertStatus;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.PackageTypeEnum;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.SubjectTypeEnum;
|
|
|
import com.qunzhixinxi.hnqz.admin.mapper.SysUserMapper;
|
|
|
+import com.qunzhixinxi.hnqz.admin.mapper.SysUserSubMapper;
|
|
|
import com.qunzhixinxi.hnqz.admin.mapper.WmPayOffMapper;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.*;
|
|
|
import com.qunzhixinxi.hnqz.common.core.util.R;
|
|
@@ -24,6 +30,7 @@ import com.qunzhixinxi.hnqz.common.ding.service.DingService;
|
|
|
import com.qunzhixinxi.hnqz.common.rabbitmq.client.RabbitMqClient;
|
|
|
import com.qunzhixinxi.hnqz.common.security.service.HnqzUser;
|
|
|
import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
|
|
|
+import com.qunzhixinxi.hnqz.common.sequence.sequence.Sequence;
|
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
|
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.model.TaxHelperSettlementModel;
|
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperSettlementRequest;
|
|
@@ -32,8 +39,12 @@ import com.qunzhixinxi.hnqz.common.taxhelper.enums.TaxHelperCertStatus;
|
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.service.TaxHelperService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import net.yaoyi.gulop.checkout.api.constant.enums.CheckoutType;
|
|
|
+import net.yaoyi.gulop.checkout.api.dto.OmsOrderRequest;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.apache.commons.lang.RandomStringUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springframework.cloud.function.context.catalog.FunctionCatalogEvent;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -42,7 +53,9 @@ import java.math.BigDecimal;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import java.util.stream.IntStream;
|
|
|
|
|
|
/**
|
|
|
* 结算表
|
|
@@ -57,6 +70,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
|
|
|
private final WmPayOffMapper wmPayOffMapper;
|
|
|
private final SysUserMapper sysUserMapper;
|
|
|
+ private final SysUserSubMapper sysUserSubMapper;
|
|
|
private final DingService dingService;
|
|
|
private final WmScorePackageService wmScorePackageService;
|
|
|
private final WmTaskService wmTaskService;
|
|
@@ -72,6 +86,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
private final TaxHelperService taxHelperService;
|
|
|
private final TaxNotifyConfig taxNotifyConfig;
|
|
|
private final RabbitMqClient rabbitMqClient;
|
|
|
+ private final Sequence paySequence;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -162,7 +177,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
// noteService.saveBatch(notes);
|
|
|
} else {
|
|
|
// notes.forEach(item -> item.setRealName(sysUserMapper.selectById(item.getUserId()).getRealname()));
|
|
|
- notes.forEach(item->{
|
|
|
+ notes.forEach(item -> {
|
|
|
SysUser user = sysUserMapper.selectById(item.getUserId());
|
|
|
item.setRealName(user.getRealname());
|
|
|
item.setIdCardNumber(user.getIdCardNumber());
|
|
@@ -260,36 +275,31 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
|
|
|
for (WmScorePackageSettleNote note : notes) {
|
|
|
SysUser user = sysUserMapper.selectById(note.getUserId());
|
|
|
- if(StringUtils.isEmpty(user.getIdCardNumber())){
|
|
|
- return R.failed(user.getRealname()+"未认证,不能发起结算");
|
|
|
+ if (StringUtils.isEmpty(user.getIdCardNumber())) {
|
|
|
+ return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
}
|
|
|
- if("0".equals(input.getSubType())){
|
|
|
+ if ("0".equals(input.getSubType())) {
|
|
|
if (!Objects.equals(user.getRljCertStatus(), DingEnum.CER_STATUS_1.getType())) {
|
|
|
- return R.failed(user.getRealname()+"未认证,不能发起结算");
|
|
|
+ return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
}
|
|
|
}
|
|
|
- if("1".equals(input.getSubType())){
|
|
|
+ if ("1".equals(input.getSubType())) {
|
|
|
// return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
|
|
|
if (!Objects.equals(user.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
|
|
|
- return R.failed(user.getRealname()+"人员未认证或未绑卡,不能结算");
|
|
|
+ return R.failed(user.getRealname() + "人员未认证或未绑卡,不能结算");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @Modify: start 校验当月结算额度
|
|
|
- * @Version: 2021.4.16
|
|
|
- * @Author: ryz
|
|
|
- * @Date: 2021/4/22
|
|
|
- */
|
|
|
+ // 校验当月结算额度
|
|
|
List<String> idCard = notes.stream().map(WmScorePackageSettleNote::getIdCardNumber).collect(Collectors.toList());
|
|
|
- List<Integer> ids = notes.stream().filter(item->null != item.getId()).map(WmScorePackageSettleNote::getId).collect(Collectors.toList());
|
|
|
+ List<Integer> ids = notes.stream().filter(item -> null != item.getId()).map(WmScorePackageSettleNote::getId).collect(Collectors.toList());
|
|
|
List<String> userIds = notes.stream().map(WmScorePackageSettleNote::getUserId).collect(Collectors.toList());
|
|
|
|
|
|
- SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids,input.getSubType());
|
|
|
+ SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, input.getSubType());
|
|
|
List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
|
|
|
|
|
|
- SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids,input.getSubType());
|
|
|
+ SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, input.getSubType());
|
|
|
List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
|
|
|
|
|
|
// 结算渠道
|
|
@@ -342,7 +352,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
note.setSubType(input.getSubType());
|
|
|
note.setInvoiceType(input.getInvoiceCategory());
|
|
|
note.setCategoryName(input.toCategoryName());
|
|
|
- if(null == note.getId()){
|
|
|
+ if (null == note.getId()) {
|
|
|
note.setCreateTime(LocalDateTime.now());
|
|
|
}
|
|
|
}
|
|
@@ -378,17 +388,17 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
|
|
|
for (WmScorePackageSettleNote note : notes) {
|
|
|
SysUser user = sysUserMapper.selectById(note.getUserId());
|
|
|
- if(StringUtils.isEmpty(user.getIdCardNumber())){
|
|
|
- return R.failed(user.getRealname()+"未认证,不能发起结算");
|
|
|
+ if (StringUtils.isEmpty(user.getIdCardNumber())) {
|
|
|
+ return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
}
|
|
|
- if("0".equals(input.getSubType())){
|
|
|
+ if ("0".equals(input.getSubType())) {
|
|
|
if (!Objects.equals(user.getRljCertStatus(), DingEnum.CER_STATUS_1.getType())) {
|
|
|
- return R.failed(user.getRealname()+"未认证,不能发起结算");
|
|
|
+ return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
}
|
|
|
}
|
|
|
- if("1".equals(input.getSubType())){
|
|
|
+ if ("1".equals(input.getSubType())) {
|
|
|
if (!Objects.equals(user.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
|
|
|
- return R.failed(user.getRealname()+"人员未认证或未绑卡,不能结算");
|
|
|
+ return R.failed(user.getRealname() + "人员未认证或未绑卡,不能结算");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -399,7 +409,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
* @Date: 2021/4/22
|
|
|
*/
|
|
|
List<String> idCard = notes.stream().map(WmScorePackageSettleNote::getIdCardNumber).collect(Collectors.toList());
|
|
|
- List<Integer> ids = notes.stream().filter(item->null != item.getId()).map(WmScorePackageSettleNote::getId).collect(Collectors.toList());
|
|
|
+ List<Integer> ids = notes.stream().filter(item -> null != item.getId()).map(WmScorePackageSettleNote::getId).collect(Collectors.toList());
|
|
|
List<String> userIds = notes.stream().map(WmScorePackageSettleNote::getUserId).collect(Collectors.toList());
|
|
|
|
|
|
SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, input.getSubType());
|
|
@@ -456,7 +466,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
note.setSubType(input.getSubType());
|
|
|
note.setInvoiceType(input.getInvoiceCategory());
|
|
|
note.setCategoryName(input.toCategoryName());
|
|
|
- if(null == note.getId()){
|
|
|
+ if (null == note.getId()) {
|
|
|
note.setCreateTime(LocalDateTime.now());
|
|
|
}
|
|
|
|
|
@@ -518,12 +528,18 @@ 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();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 提交结算
|
|
|
+ *
|
|
|
+ * @param input 提交结算信息
|
|
|
+ * @return 提交结果
|
|
|
+ */
|
|
|
@Override
|
|
|
public R settleIssueBySubType(WmScorePackageSettleInput input) {
|
|
|
|
|
@@ -546,9 +562,17 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
return R.failed("机构appId未维护");
|
|
|
}
|
|
|
|
|
|
+ // 人力家
|
|
|
if (SubjectTypeEnum.TYPE_RENLIJIA.getCode().equals(input.getSubType())) {
|
|
|
return settleByRenLiJia(input, sysDeptSub, wmScorePackage);
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ // 自由职家
|
|
|
+ else if (SubjectTypeEnum.TYPE_OLADING.getCode().equals(input.getSubType())) {
|
|
|
+ // return settleByOlading(input, sysDeptSub, wmScorePackage);
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ // 税邦云
|
|
|
+ else {
|
|
|
SysDept sysDept = sysDeptService.getById(SecurityUtils.getUser().getDeptId());
|
|
|
|
|
|
String taxCode = sysDept.getTaxCode();
|
|
@@ -557,13 +581,214 @@ 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(){
|
|
|
+ // /**
|
|
|
+ // * 自由职家结算
|
|
|
+ // *
|
|
|
+ // * @param input
|
|
|
+ // * @param sysDeptSub
|
|
|
+ // * @param wmScorePackage
|
|
|
+ // * @param taxCode
|
|
|
+ // * @return 提交结果
|
|
|
+ // */
|
|
|
+ // private R settleByOlading(WmScorePackageSettleInput input,
|
|
|
+ // SysDeptSub sysDeptSub,
|
|
|
+ // WmScorePackage wmScorePackage,
|
|
|
+ // String taxCode) {
|
|
|
+ //
|
|
|
+ // // 获取发票类型和名称
|
|
|
+ // int invoiceCategory = input.getInvoiceCategory();
|
|
|
+ // String categoryName = input.toCategoryName();
|
|
|
+ //
|
|
|
+ // // 获取结算记录
|
|
|
+ // List<WmScorePackageSettleNote> notes = input.getNotes();
|
|
|
+ //
|
|
|
+ // // 结算锁
|
|
|
+ // List<String> lockKey = new ArrayList<>(notes.size());
|
|
|
+ //
|
|
|
+ // // 校验,循环设置结算记录的发票信息
|
|
|
+ // notes.forEach(note -> {
|
|
|
+ // if (Boolean.TRUE.equals(redisTemplate.hasKey(String.format("%s:%d", CacheConstants.SETTLE_PACKAGE_KEY, note.getId())))
|
|
|
+ // || DingEnum.NOTE_STATUS_SUCCESS.getType().equals(note.getSettleNoteStatus())
|
|
|
+ // || DingEnum.NOTE_STATUS_SUBMIT.getType().equals(note.getSettleNoteStatus())) {
|
|
|
+ // String errMsg = String.format("结算记录-%d,存在历史或在途操作,请勿重复结算。", note.getId());
|
|
|
+ // log.error(errMsg);
|
|
|
+ // throw new RuntimeException(errMsg);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // note.setInvoiceType(invoiceCategory);
|
|
|
+ // note.setCategoryName(categoryName);
|
|
|
+ // note.setSubToGigTime(LocalDateTime.now());
|
|
|
+ //
|
|
|
+ // lockKey.add(String.format("%s:%d",CacheConstants.SETTLE_PACKAGE_KEY, note.getId()));
|
|
|
+ //
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // noteService.updateBatchById(notes);
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // // 校验信息
|
|
|
+ // List<String> userIds = notes.stream().map(WmScorePackageSettleNote::getUserId).distinct().collect(Collectors.toList());
|
|
|
+ // List<SysUser> sysUsers = sysUserMapper.selectList(Wrappers.<SysUser>lambdaQuery().in(SysUser::getUserId, userIds));
|
|
|
+ // List<SysUserSub> userSubs = sysUserSubMapper.selectList(Wrappers.<SysUserSub>lambdaQuery().in(SysUserSub::getUserId, userIds)
|
|
|
+ // .eq(SysUserSub::getGigType, GigTypeEnum.OLADING.getCode())
|
|
|
+ // .eq(SysUserSub::getGigChannel, GigChannelEnum.DEFAULT.getCode())
|
|
|
+ // .eq(SysUserSub::getCertStatus, OladingCertStatus.CERT.getCode())
|
|
|
+ // );
|
|
|
+ //
|
|
|
+ // if (CollUtil.isEmpty(sysUsers) || CollUtil.isEmpty(userSubs)){
|
|
|
+ // log.error("用户或用户认证记录缺失不能发起结算");
|
|
|
+ // throw new RuntimeException("用户或用户认证记录缺失不能发起结算");
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // Map<Integer, SysUser> userMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity()));
|
|
|
+ // Map<Integer, SysUserSub> userSubMap = userSubs.stream().collect(Collectors.toMap(SysUserSub::getUserId, Function.identity()));
|
|
|
+ //
|
|
|
+ // if (!userMap.keySet().containsAll(userMap.keySet())){
|
|
|
+ // log.error("用户尚未认证不能发起结算");
|
|
|
+ // throw new RuntimeException("用户尚未认证不能发起结算");
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // // ~================================================================================================= 发起结算
|
|
|
+ //
|
|
|
+ // try {
|
|
|
+ // // 1 结算纪录锁定
|
|
|
+ // Map<String, String> keyMap = lockKey.stream().collect(Collectors.toMap(Function.identity(), Function.identity()));
|
|
|
+ // if (Boolean.FALSE.equals(redisTemplate.opsForValue().multiSetIfAbsent(keyMap))){
|
|
|
+ // log.error("存在在途的操作");
|
|
|
+ // throw new RuntimeException("存在在途的操作");
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // // 3 封装批量订单
|
|
|
+ // OmsOrderRequest.OrderBatchSubmitParams orderBatchSubmitParams = new OmsOrderRequest.OrderBatchSubmitParams();
|
|
|
+ // orderBatchSubmitParams.setBatchNo(paySequence.nextNo());
|
|
|
+ // orderBatchSubmitParams.setPayeeQuantity((long)sysUsers.size());
|
|
|
+ // orderBatchSubmitParams.setOrderToken(RandomStringUtils.randomNumeric(6));
|
|
|
+ // orderBatchSubmitParams.setRemarks("正常结算");
|
|
|
+ // orderBatchSubmitParams.setEndType(CheckoutType.SubmitEndType.CSO);
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // orderBatchSubmitParams.setOrderQuantity();
|
|
|
+ // orderBatchSubmitParams.setOrderSubmits();
|
|
|
+ // orderBatchSubmitParams.setBatchAmountPayable();
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // // 4 发送消息
|
|
|
+ //
|
|
|
+ // // 5 修改积分包
|
|
|
+ //
|
|
|
+ // } catch (Exception e){
|
|
|
+ // log.error("提交结算失败",e);
|
|
|
+ // redisTemplate.delete(lockKey);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // 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("因系统维护,暂时不能提起支付,有问题请联系客服");
|
|
|
}
|
|
|
|
|
@@ -586,7 +811,6 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
noteService.updateBatchById(notes);
|
|
|
|
|
|
|
|
|
-
|
|
|
for (int i = 0; i < notes.size(); i++) {
|
|
|
WmScorePackageSettleNote note = notes.get(i);
|
|
|
SysUser sysUser = sysUserMapper.selectById(note.getUserId());
|