|
@@ -1,27 +1,28 @@
|
|
|
package com.qunzhixinxi.hnqz.admin.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.util.IdUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
|
|
|
import com.qunzhixinxi.hnqz.admin.config.TaxNotifyConfig;
|
|
|
+import com.qunzhixinxi.hnqz.admin.config.UpmsConfig;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.*;
|
|
|
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.constant.CommonConstants;
|
|
|
import com.qunzhixinxi.hnqz.common.core.util.R;
|
|
|
import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
|
|
|
import com.qunzhixinxi.hnqz.common.ding.entity.*;
|
|
@@ -42,18 +43,21 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
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.http.HttpEntity;
|
|
|
+import org.springframework.http.HttpHeaders;
|
|
|
+import org.springframework.http.HttpMethod;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
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;
|
|
|
|
|
|
/**
|
|
|
* 结算表
|
|
@@ -66,6 +70,7 @@ import java.util.stream.IntStream;
|
|
|
@AllArgsConstructor
|
|
|
public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> implements WmPayOffService {
|
|
|
|
|
|
+ private final UpmsConfig upmsConfig;
|
|
|
private final WmPayOffMapper wmPayOffMapper;
|
|
|
private final SysUserMapper sysUserMapper;
|
|
|
private final SysUserSubMapper sysUserSubMapper;
|
|
@@ -86,6 +91,12 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
private final RabbitMqClient rabbitMqClient;
|
|
|
private final Sequence paySequence;
|
|
|
|
|
|
+ /**
|
|
|
+ * 财务回退操作
|
|
|
+ *
|
|
|
+ * @param input 提交参数
|
|
|
+ * @return 操作结果
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public R settleBack(WmScorePackageSettleInput input) {
|
|
@@ -276,16 +287,34 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
if (StringUtils.isEmpty(user.getIdCardNumber())) {
|
|
|
return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
}
|
|
|
- if ("0".equals(input.getSubType())) {
|
|
|
- if (!Objects.equals(user.getRljCertStatus(), DingEnum.CER_STATUS_1.getType())) {
|
|
|
- return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
- }
|
|
|
+
|
|
|
+ // 获取结算零工
|
|
|
+ GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(Integer.parseInt(input.getSubType()));
|
|
|
+ if (gigTypeEnum == null){
|
|
|
+ return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
|
|
|
}
|
|
|
- if ("1".equals(input.getSubType())) {
|
|
|
- // return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
|
|
|
- if (!Objects.equals(user.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
|
|
|
- return R.failed(user.getRealname() + "人员未认证或未绑卡,不能结算");
|
|
|
- }
|
|
|
+
|
|
|
+ SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, gigTypeEnum)
|
|
|
+ .eq(SysUserSub::getUserId, user.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
+ if (userSub == null){
|
|
|
+ return R.failed(user.getRealname() + "人员认证信息不存在,不能结算");
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (gigTypeEnum) {
|
|
|
+ case REN_LI_JIA:
|
|
|
+ case OLADING:
|
|
|
+ if (!Objects.equals(userSub.getCertStatus(), DingEnum.CER_STATUS_1.getType())) {
|
|
|
+ return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case TAX_HELPOR:
|
|
|
+ if (!Objects.equals(userSub.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
|
|
|
+ return R.failed(user.getRealname() + "人员未认证或未绑卡,不能结算");
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -373,14 +402,17 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
wmScorePackageService.updateById(updateEntity);
|
|
|
noteService.saveOrUpdateBatch(notes);
|
|
|
|
|
|
- // todo 构建批量订单信息
|
|
|
-
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 业务保存操作
|
|
|
+ *
|
|
|
+ * @param input 提交信息
|
|
|
+ * @return 保存结果
|
|
|
+ */
|
|
|
@Override
|
|
|
public R settleSave(WmScorePackageSettleInput input) {
|
|
|
-// WmScorePackage wmScorePackage = wmScorePackageService.getById(input.getId());
|
|
|
|
|
|
List<WmScorePackageSettleNote> notes = input.getNotes();
|
|
|
|
|
@@ -389,23 +421,39 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
if (StringUtils.isEmpty(user.getIdCardNumber())) {
|
|
|
return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
}
|
|
|
- if ("0".equals(input.getSubType())) {
|
|
|
- if (!Objects.equals(user.getRljCertStatus(), DingEnum.CER_STATUS_1.getType())) {
|
|
|
- return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
- }
|
|
|
+
|
|
|
+ // 获取结算零工
|
|
|
+ GigTypeEnum gigTypeEnum = GigTypeEnum.resolve(Integer.parseInt(input.getSubType()));
|
|
|
+
|
|
|
+ if (gigTypeEnum == null){
|
|
|
+ return R.failed(user.getRealname() + "人员结算渠道不存在,不能结算");
|
|
|
}
|
|
|
- if ("1".equals(input.getSubType())) {
|
|
|
- if (!Objects.equals(user.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
|
|
|
- return R.failed(user.getRealname() + "人员未认证或未绑卡,不能结算");
|
|
|
- }
|
|
|
+
|
|
|
+ SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, gigTypeEnum)
|
|
|
+ .eq(SysUserSub::getUserId, user.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
+ if (userSub == null){
|
|
|
+ return R.failed(user.getRealname() + "人员认证信息不存在,不能结算");
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (gigTypeEnum) {
|
|
|
+ case REN_LI_JIA:
|
|
|
+ case OLADING:
|
|
|
+ if (!Objects.equals(userSub.getCertStatus(), DingEnum.CER_STATUS_1.getType())) {
|
|
|
+ return R.failed(user.getRealname() + "未认证,不能发起结算");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case TAX_HELPOR:
|
|
|
+ if (!Objects.equals(userSub.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
|
|
|
+ return R.failed(user.getRealname() + "人员未认证或未绑卡,不能结算");
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ 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<String> userIds = notes.stream().map(WmScorePackageSettleNote::getUserId).collect(Collectors.toList());
|
|
@@ -560,20 +608,20 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
return R.failed("机构appId未维护");
|
|
|
}
|
|
|
|
|
|
+ SysDept sysDept = sysDeptService.getById(SecurityUtils.getUser().getDeptId());
|
|
|
+
|
|
|
+ String taxCode = sysDept.getTaxCode();
|
|
|
+
|
|
|
// 人力家
|
|
|
if (SubjectTypeEnum.TYPE_RENLIJIA.getCode().equals(input.getSubType())) {
|
|
|
return settleByRenLiJia(input, sysDeptSub, wmScorePackage);
|
|
|
}
|
|
|
// 自由职家
|
|
|
else if (SubjectTypeEnum.TYPE_OLADING.getCode().equals(input.getSubType())) {
|
|
|
- // return settleByOlading(input, sysDeptSub, wmScorePackage);
|
|
|
- return R.ok();
|
|
|
+ return settleByOlading(input, sysDeptSub, wmScorePackage, taxCode);
|
|
|
}
|
|
|
// 税邦云
|
|
|
else {
|
|
|
- SysDept sysDept = sysDeptService.getById(SecurityUtils.getUser().getDeptId());
|
|
|
-
|
|
|
- String taxCode = sysDept.getTaxCode();
|
|
|
if (StringUtils.isNotEmpty(taxCode)) {
|
|
|
log.info("税邦云结算开始-获取会员所属企业的统一社会信用代码:{} ", taxCode);
|
|
|
} else {
|
|
@@ -585,6 +633,180 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 阿拉丁结算操作
|
|
|
+ *
|
|
|
+ * @param input 结算数据
|
|
|
+ * @param sysDeptSub 结算配置
|
|
|
+ * @param wmScorePackage 积分包
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ private R settleByOlading(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());
|
|
|
+
|
|
|
+ SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, GigTypeEnum.OLADING)
|
|
|
+ .eq(SysUserSub::getUserId, sysUser.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
+ if (userSub == null) {
|
|
|
+ log.info("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
+ return R.failed("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Objects.equals(userSub.getCertStatus(), DingEnum.CER_STATUS_1.getType())) {
|
|
|
+ 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() + ":已提交,请等待耐心结算结果");
|
|
|
+ }
|
|
|
+ sysUser.setBankCardNumber(userSub.getBankCardNumber());
|
|
|
+ }
|
|
|
+ HnqzUser operator = SecurityUtils.getUser();
|
|
|
+ String gigTokenUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/token?tenantId={tenantId}&action={action}&userId={userId}";
|
|
|
+ String gigSettleUrl = upmsConfig.getGigServiceUrl() + "/gig/operation/settlement";
|
|
|
+
|
|
|
+ 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());
|
|
|
+ try {
|
|
|
+ // 获取请求token
|
|
|
+ ResponseEntity<String> tokenResult = new RestTemplate().getForEntity(gigTokenUrl, String.class,
|
|
|
+ String.valueOf(operator.getDeptId()), "settle", String.valueOf(operator.getId()));
|
|
|
+ log.warn("获取结算token:{}", tokenResult.getBody());
|
|
|
+ if (!JSONUtil.isJson(tokenResult.getBody())){
|
|
|
+ return R.failed("获取结算token失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(tokenResult.getBody());
|
|
|
+
|
|
|
+ if (jsonObject.getInt("code") != 0 || StrUtil.isBlank(jsonObject.getStr("data"))){
|
|
|
+ return R.failed("获取结算token失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ String token = jsonObject.getStr("data");
|
|
|
+
|
|
|
+ // 间隔100毫秒
|
|
|
+ Thread.sleep(100);
|
|
|
+
|
|
|
+
|
|
|
+ // 封装结算参数
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("token", token);
|
|
|
+ params.put("tenantId", operator.getDeptId());
|
|
|
+ params.put("operatorId", operator.getId());
|
|
|
+ params.put("requestId", RandomStringUtils.randomAlphabetic(12));
|
|
|
+ params.put("taskName", wmScorePackage.getScorePackageName() + "_" + System.currentTimeMillis());
|
|
|
+ params.put("amount", String.valueOf(note.getSettleAmount().doubleValue()));
|
|
|
+ params.put("taskStartTime", wmScorePackage.getCreateTime().toLocalDate());
|
|
|
+ params.put("taskEndTime", wmScorePackage.getUpdateTime().toLocalDate());
|
|
|
+ params.put("taskLocation", "要易云");
|
|
|
+ params.put("username", sysUser.getUsername());
|
|
|
+ params.put("idCard", sysUser.getIdCardNumber());
|
|
|
+ params.put("realName", sysUser.getRealname());
|
|
|
+ params.put("bankCard", sysUser.getBankCardNumber());
|
|
|
+ params.put("tagId", note.getInvoiceType());
|
|
|
+ params.put("endType", "CSO");
|
|
|
+ params.put("enterpriseCode", taxCode);
|
|
|
+ params.put("subjectType", "OLADING");
|
|
|
+ params.put("channel", "DEFAULT");
|
|
|
+
|
|
|
+
|
|
|
+ // 发起结算
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
+ HttpEntity<String> result = new RestTemplate().exchange(gigSettleUrl, HttpMethod.POST, new HttpEntity<>(params, headers), String.class);
|
|
|
+ log.warn("阿拉丁结算: {}", result.getBody());
|
|
|
+ if (!JSONUtil.isJson(result.getBody())){
|
|
|
+ return R.failed("结算失败");
|
|
|
+ }
|
|
|
+ JSONObject settelObj = JSONUtil.parseObj(result.getBody());
|
|
|
+
|
|
|
+
|
|
|
+ if (Objects.equals(settelObj.getInt("code"), CommonConstants.SUCCESS)) {
|
|
|
+ log.info("自由职家结算提交成功: {}", note.getSettleNo());
|
|
|
+ //streamId 获取不到
|
|
|
+ if (StringUtils.isEmpty(settelObj.getStr("data"))) {
|
|
|
+ log.warn("自由职家结算提交成功 requestId 获取不到: {}", note.getSettleNo());
|
|
|
+ noticeInfo.append(sysUser.getRealname() + ":提交结算成功,业务流水号获取不到,请联系管理员;");
|
|
|
+ }
|
|
|
+ note.setUpdateTime(LocalDateTime.now());
|
|
|
+ note.setSettleNoteStatus(DingEnum.NOTE_STATUS_SUBMIT.getType());
|
|
|
+ // 新增字段streamId
|
|
|
+ note.setStreamId(settelObj.getStr("data"));
|
|
|
+ noticeInfo.append(sysUser.getRealname() + ":提交结算成功;");
|
|
|
+ } else {
|
|
|
+ log.warn("自由职家结算提交失败: {}", note.getSettleNo());
|
|
|
+ note.setUpdateTime(LocalDateTime.now());
|
|
|
+ note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
|
|
|
+ noticeInfo.append(sysUser.getRealname() + ":结算提交失败-" + settelObj.getStr("msg") + ";");
|
|
|
+
|
|
|
+ log.info("认证状态异常,结算解锁settleNoteId:{}", note.getId());
|
|
|
+ redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + note.getId());
|
|
|
+
|
|
|
+ }
|
|
|
+ } catch (Exception e){
|
|
|
+ log.warn("自由职家结算提交失败: {}", note.getSettleNo());
|
|
|
+ note.setUpdateTime(LocalDateTime.now());
|
|
|
+ note.setSettleNoteStatus(DingEnum.NOTE_STATUS_FAIL.getType());
|
|
|
+ noticeInfo.append(sysUser.getRealname() + ":结算提交失败;");
|
|
|
+
|
|
|
+ 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());
|
|
|
+ }
|
|
|
+
|
|
|
// /**
|
|
|
// * 自由职家结算
|
|
|
// *
|
|
@@ -790,6 +1012,14 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
return R.failed("因系统维护,暂时不能提起支付,有问题请联系客服");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 税邦云
|
|
|
+ *
|
|
|
+ * @param input 结算数据
|
|
|
+ * @param sysDeptSub 结算配置
|
|
|
+ * @param wmScorePackage 积分包
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
private R settleByShuiBangYun(WmScorePackageSettleInput input,
|
|
|
SysDeptSub sysDeptSub,
|
|
|
WmScorePackage wmScorePackage,
|
|
@@ -813,7 +1043,16 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
WmScorePackageSettleNote note = notes.get(i);
|
|
|
SysUser sysUser = sysUserMapper.selectById(note.getUserId());
|
|
|
|
|
|
- if (!Objects.equals(sysUser.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
|
|
|
+ SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, GigTypeEnum.REN_LI_JIA)
|
|
|
+ .eq(SysUserSub::getUserId, sysUser.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
+ if (userSub == null){
|
|
|
+ log.info("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
+ return R.failed("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Objects.equals(userSub.getCertStatus(), TaxHelperCertStatus.CERT.getCode())) {
|
|
|
return R.failed(sysUser.getRealname() + "人员未认证或未绑卡,不能结算");
|
|
|
}
|
|
|
|
|
@@ -921,6 +1160,14 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
return R.ok(null, noticeInfo.toString());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 人力家结算
|
|
|
+ *
|
|
|
+ * @param input 结算数据
|
|
|
+ * @param sysDeptSub 结算配置
|
|
|
+ * @param wmScorePackage 积分包
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
private R settleByRenLiJia(WmScorePackageSettleInput input, SysDeptSub sysDeptSub, WmScorePackage wmScorePackage) {
|
|
|
List<WmScorePackageSettleNote> notes = input.getNotes();
|
|
|
|
|
@@ -948,6 +1195,14 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
WmScorePackageSettleNote note = notes.get(i);
|
|
|
|
|
|
SysUser sysUser = sysUserMapper.selectById(note.getUserId());
|
|
|
+ SysUserSub userSub = sysUserSubMapper.selectOne(Wrappers.<SysUserSub>lambdaQuery().eq(SysUserSub::getGigType, GigTypeEnum.REN_LI_JIA)
|
|
|
+ .eq(SysUserSub::getUserId, sysUser.getUserId())
|
|
|
+ );
|
|
|
+
|
|
|
+ if (userSub == null){
|
|
|
+ log.info("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
+ return R.failed("结算对象-" + sysUser.getRealname() + ":认证信息不存在,不能结算");
|
|
|
+ }
|
|
|
|
|
|
if (StringUtils.isEmpty(sysUser.getIdCardNumber())) {
|
|
|
log.info("任务包众包代表-" + sysUser.getRealname() + ":身份证号未补录");
|
|
@@ -956,7 +1211,7 @@ public class WmPayOffServiceImpl extends ServiceImpl<WmPayOffMapper, WmPayOff> i
|
|
|
return R.failed("任务包众包代表-" + sysUser.getRealname() + ":身份证号未补录");
|
|
|
}
|
|
|
|
|
|
- if (!DingEnum.CER_STATUS_1.getType().equals(sysUser.getRljCertStatus())) {
|
|
|
+ if (!DingEnum.CER_STATUS_1.getType().equals(userSub.getCertStatus())) {
|
|
|
//认证中
|
|
|
log.info("结算对象-" + sysUser.getRealname() + ":未认证成功,不能结算");
|
|
|
return R.failed("结算对象-" + sysUser.getRealname() + ":未认证成功,不能结算");
|