|
@@ -36,7 +36,6 @@ import com.qunzhixinxi.hnqz.admin.entity.dto.TaxHelperBindingCardCodeDTO;
|
|
import com.qunzhixinxi.hnqz.admin.entity.dto.TaxHelperTokenDTO;
|
|
import com.qunzhixinxi.hnqz.admin.entity.dto.TaxHelperTokenDTO;
|
|
import com.qunzhixinxi.hnqz.admin.entity.dto.TaxHelperUserAgreementDTO;
|
|
import com.qunzhixinxi.hnqz.admin.entity.dto.TaxHelperUserAgreementDTO;
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.Record;
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.Record;
|
|
-import com.qunzhixinxi.hnqz.admin.entity.input.SettleAmountMonitorInput;
|
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.TaskSettleBatch;
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.TaskSettleBatch;
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.TaskSettleInfo;
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.TaskSettleInfo;
|
|
import com.qunzhixinxi.hnqz.admin.entity.output.SettleAmountMonitorOutput;
|
|
import com.qunzhixinxi.hnqz.admin.entity.output.SettleAmountMonitorOutput;
|
|
@@ -65,7 +64,6 @@ import com.qunzhixinxi.hnqz.admin.service.WmScorePackageStatusService;
|
|
import com.qunzhixinxi.hnqz.admin.service.WmScoreTaskTypeService;
|
|
import com.qunzhixinxi.hnqz.admin.service.WmScoreTaskTypeService;
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskContentService;
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskContentService;
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskService;
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskService;
|
|
-import com.qunzhixinxi.hnqz.common.ding.config.DingConfig;
|
|
|
|
import com.qunzhixinxi.hnqz.common.ding.enums.DingEnum;
|
|
import com.qunzhixinxi.hnqz.common.ding.enums.DingEnum;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.common.CommonConstants;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.common.CommonConstants;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.config.TaxHelperConfig;
|
|
@@ -82,7 +80,6 @@ import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperBindingCard
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperGetUserAgreementRequest;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperGetUserAgreementRequest;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperH5BizTokenRequest;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperH5BizTokenRequest;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperSettlementRequest;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperSettlementRequest;
|
|
-import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperUserAgreementAuthorizationRequest;
|
|
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperUserAgreementAuthorizationRequestV2;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.request.TaxHelperUserAgreementAuthorizationRequestV2;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.response.TaxHelperResponse;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.entity.response.TaxHelperResponse;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.enums.TaxHelperCertStatus;
|
|
import com.qunzhixinxi.hnqz.common.taxhelper.enums.TaxHelperCertStatus;
|
|
@@ -106,10 +103,10 @@ import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
+import java.util.Set;
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
-import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -192,7 +189,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
|
|
|
|
private final MonitoringIndicatorService monitoringIndicatorService;
|
|
private final MonitoringIndicatorService monitoringIndicatorService;
|
|
|
|
|
|
- private final RedisTemplate redisTemplate;
|
|
|
|
|
|
+ private final RedisTemplate<String, Object> redisTemplate;
|
|
|
|
|
|
private final UserAgreementSignatureRecordMapper userAgreementSignatureRecordMapper;
|
|
private final UserAgreementSignatureRecordMapper userAgreementSignatureRecordMapper;
|
|
|
|
|
|
@@ -231,7 +228,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
query.setSubjectLocation(SubjectLocation.LUO_SHU_YUN);
|
|
query.setSubjectLocation(SubjectLocation.LUO_SHU_YUN);
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
- info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, String.valueOf(taxHelperAddMemberDTO.getType()));
|
|
|
|
|
|
+ info = checkoutDeptSubInfo(deptSub, SubjectLocation.LUO_SHU_YUN.getGigType(), String.valueOf(taxHelperAddMemberDTO.getType()));
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
return getResultMap("4000", info);
|
|
return getResultMap("4000", info);
|
|
}
|
|
}
|
|
@@ -312,7 +309,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
- info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, null);
|
|
|
|
|
|
+ info = checkoutDeptSubInfo(deptSub, SubjectLocation.LUO_SHU_YUN.getGigType(), null);
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
return getResultMap("4000", info);
|
|
return getResultMap("4000", info);
|
|
}
|
|
}
|
|
@@ -429,7 +426,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
- info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, null);
|
|
|
|
|
|
+ info = checkoutDeptSubInfo(deptSub, SubjectLocation.LUO_SHU_YUN.getGigType(), null);
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
return getResultMap("4000", info);
|
|
return getResultMap("4000", info);
|
|
}
|
|
}
|
|
@@ -498,7 +495,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
- info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, null);
|
|
|
|
|
|
+ info = checkoutDeptSubInfo(deptSub, SubjectLocation.LUO_SHU_YUN.getGigType(), null);
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
return getResultMap("4000", info);
|
|
return getResultMap("4000", info);
|
|
}
|
|
}
|
|
@@ -583,7 +580,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
- info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, null);
|
|
|
|
|
|
+ info = checkoutDeptSubInfo(deptSub, SubjectLocation.LUO_SHU_YUN.getGigType(), null);
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
return getResultMap("4000", info);
|
|
return getResultMap("4000", info);
|
|
}
|
|
}
|
|
@@ -653,7 +650,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setSubjectType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
query.setEnableFlag(SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode());
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.query(query));
|
|
- info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, null);
|
|
|
|
|
|
+ info = checkoutDeptSubInfo(deptSub, SubjectLocation.LUO_SHU_YUN.getGigType(), null);
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
return getResultMap("4000", info);
|
|
return getResultMap("4000", info);
|
|
}
|
|
}
|
|
@@ -760,7 +757,8 @@ public class PartyAServiceImpl implements PartyAService {
|
|
//已分派待申领
|
|
//已分派待申领
|
|
scorePackage.setScorePackageStatus(ScorePackageStatusEnum.UNCLAIMED.val());
|
|
scorePackage.setScorePackageStatus(ScorePackageStatusEnum.UNCLAIMED.val());
|
|
scorePackage.setDescription(scorePackageDTO.getDescription());
|
|
scorePackage.setDescription(scorePackageDTO.getDescription());
|
|
- scorePackage.setSubType(scorePackageDTO.getChannel().val());
|
|
|
|
|
|
+ scorePackage.setSubjectLocation(SubjectLocation.LUO_SHU_YUN);
|
|
|
|
+ scorePackage.setSubType(String.valueOf(SubjectLocation.LUO_SHU_YUN.getGigType().getCode()));
|
|
|
|
|
|
// 获取企业发包人
|
|
// 获取企业发包人
|
|
List<SysUser> userList = userService.list(Wrappers.<SysUser>query().eq("dept_id", scorePackageDTO.getDeptId()));
|
|
List<SysUser> userList = userService.list(Wrappers.<SysUser>query().eq("dept_id", scorePackageDTO.getDeptId()));
|
|
@@ -1160,29 +1158,15 @@ public class PartyAServiceImpl implements PartyAService {
|
|
}
|
|
}
|
|
|
|
|
|
// 设置税源地
|
|
// 设置税源地
|
|
- SubjectLocation subjectLocation = SubjectLocation.LUO_SHU_YUN;
|
|
|
|
- if (scorePackageSettleNoteDTO.getChannel().equals(ChannelEnum.TAX_HELPER)) {
|
|
|
|
- subjectLocation = SubjectLocation.LUO_SHU_YUN;
|
|
|
|
- } else if (scorePackageSettleNoteDTO.getChannel().equals(ChannelEnum.DING)) {
|
|
|
|
- subjectLocation = SubjectLocation.REN_LI_JIA;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- String subType = String.valueOf(subjectLocation.getGigType().getCode());
|
|
|
|
|
|
+ SubjectLocation location = scorePackageSettleNoteDTO.getLocation();
|
|
|
|
+ String subType = String.valueOf(scorePackageSettleNoteDTO.getLocation().getGigType().getCode());
|
|
|
|
|
|
- SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, scorePackageSettleNoteDTO
|
|
|
|
- .getChannel()
|
|
|
|
- .val(), subjectLocation);
|
|
|
|
- List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
|
|
|
|
|
|
|
|
- SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(userIds, ids, scorePackageSettleNoteDTO
|
|
|
|
- .getChannel()
|
|
|
|
- .val(), subjectLocation);
|
|
|
|
- List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
|
|
|
|
|
|
+ List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(idCard, ids, location);
|
|
|
|
+ List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(idCard, ids, location);
|
|
|
|
+ Set<Integer> collect = userIds.stream().map(Integer::valueOf).collect(Collectors.toSet());
|
|
|
|
+ List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(collect, ids, location);
|
|
|
|
|
|
- SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(idCard, ids, scorePackageSettleNoteDTO
|
|
|
|
- .getChannel()
|
|
|
|
- .val(), subjectLocation);
|
|
|
|
- List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
|
|
|
|
|
|
|
|
SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
|
|
SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
|
|
.equals(member.getIdCardNumber())).findFirst().orElse(null);
|
|
.equals(member.getIdCardNumber())).findFirst().orElse(null);
|
|
@@ -1193,12 +1177,10 @@ public class PartyAServiceImpl implements PartyAService {
|
|
SettleAmountMonitorOutput yaoyiMonitorOutput = yaoyiAmountMonitor.stream().filter(item -> item.getIdCardNumber()
|
|
SettleAmountMonitorOutput yaoyiMonitorOutput = yaoyiAmountMonitor.stream().filter(item -> item.getIdCardNumber()
|
|
.equals(member.getIdCardNumber())).findFirst().orElse(null);
|
|
.equals(member.getIdCardNumber())).findFirst().orElse(null);
|
|
|
|
|
|
- MonitoringIndicator monitoringIndicator = monitoringIndicatorService.getBySubType(subType, subjectLocation);
|
|
|
|
- SysDeptSub sysDeptSub = sysDeptSubService.getOne(Wrappers.<SysDeptSub>lambdaQuery()
|
|
|
|
- .eq(SysDeptSub::getDeptId, dept.getDeptId())
|
|
|
|
- .eq(SysDeptSub::getSubjectType, note.getSubType())
|
|
|
|
- .eq(SysDeptSub::getSubjectLocation, note.getSubjectLocation())
|
|
|
|
- );
|
|
|
|
|
|
+ // 限额
|
|
|
|
+ MonitoringIndicator monitoringIndicator = monitoringIndicatorService.locationLimit(location);
|
|
|
|
+
|
|
|
|
+ SysDeptSub sysDeptSub = sysDeptSubService.getDeptSub(dept.getDeptId(), location);
|
|
BigDecimal deptLimit = sysDeptSub.getLimitAmount();
|
|
BigDecimal deptLimit = sysDeptSub.getLimitAmount();
|
|
BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
|
|
BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
|
|
BigDecimal yaoyiMonitoringLimit = monitoringIndicator.getYaoyiLimitAmount();
|
|
BigDecimal yaoyiMonitoringLimit = monitoringIndicator.getYaoyiLimitAmount();
|
|
@@ -1240,6 +1222,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
updateEntity = new WmScorePackageSettleNote();
|
|
updateEntity = new WmScorePackageSettleNote();
|
|
updateEntity.setId(note.getId());
|
|
updateEntity.setId(note.getId());
|
|
updateEntity.setSubType(subType);
|
|
updateEntity.setSubType(subType);
|
|
|
|
+ updateEntity.setSubjectLocation(location);
|
|
updateEntity.setInvoiceType(note.getInvoiceType());
|
|
updateEntity.setInvoiceType(note.getInvoiceType());
|
|
updateEntity.setCategoryName(scorePackageSettleNoteDTO.getInvoiceCategory());
|
|
updateEntity.setCategoryName(scorePackageSettleNoteDTO.getInvoiceCategory());
|
|
updateEntity.setSettleAmount(note.getSettleAmount());
|
|
updateEntity.setSettleAmount(note.getSettleAmount());
|
|
@@ -1320,13 +1303,9 @@ public class PartyAServiceImpl implements PartyAService {
|
|
}
|
|
}
|
|
|
|
|
|
// 获取并校验结算信息
|
|
// 获取并校验结算信息
|
|
- SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.<SysDeptSub>lambdaQuery()
|
|
|
|
- .eq(SysDeptSub::getDeptId, execSettlementDTO.getDeptId())
|
|
|
|
- .eq(SysDeptSub::getEnableFlag, SubjectTypeEnum.ENABLE_FLAG_TRUE.getCode())
|
|
|
|
- .eq(SysDeptSub::getSubjectLocation, SubjectLocation.LUO_SHU_YUN)
|
|
|
|
- );
|
|
|
|
|
|
+ SysDeptSub deptSub = sysDeptSubService.getDeptSub(execSettlementDTO.getDeptId(), execSettlementDTO.getLocation());
|
|
|
|
|
|
- info = checkoutDeptSubInfo(deptSub, ChannelEnum.TAX_HELPER, null);
|
|
|
|
|
|
+ info = checkoutDeptSubInfo(deptSub, execSettlementDTO.getLocation().getGigType(), null);
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
if (StringUtils.isNotEmpty(info)) {
|
|
return getResultMap("4000", info);
|
|
return getResultMap("4000", info);
|
|
}
|
|
}
|
|
@@ -1360,30 +1339,24 @@ public class PartyAServiceImpl implements PartyAService {
|
|
tmp = tmp.add(note.getSettleAmount());
|
|
tmp = tmp.add(note.getSettleAmount());
|
|
}
|
|
}
|
|
String errInfo = checkoutSettleLimit(member, noteList.stream().mapToInt(WmScorePackageSettleNote::getId).boxed()
|
|
String errInfo = checkoutSettleLimit(member, noteList.stream().mapToInt(WmScorePackageSettleNote::getId).boxed()
|
|
- .collect(Collectors.toList()), deptSub.getLimitAmount(), tmp);
|
|
|
|
|
|
+ .collect(Collectors.toList()), deptSub.getLimitAmount(), tmp, execSettlementDTO.getLocation());
|
|
if (StringUtils.isNotEmpty(errInfo)) {
|
|
if (StringUtils.isNotEmpty(errInfo)) {
|
|
log.error(errInfo);
|
|
log.error(errInfo);
|
|
return getResultMap("4000", errInfo);
|
|
return getResultMap("4000", errInfo);
|
|
}
|
|
}
|
|
|
|
|
|
- log.info("结算渠道: {} ", execSettlementDTO.getSubjectType());
|
|
|
|
|
|
+ log.info("结算税源地: {} ", execSettlementDTO.getLocation());
|
|
Map<String, String> result = null;
|
|
Map<String, String> result = null;
|
|
- if (SubjectTypeEnum.TYPE_RENLIJIA.getCode().equals(execSettlementDTO.getSubjectType())) {
|
|
|
|
- DingConfig config = new DingConfig();
|
|
|
|
- config.setAppId(deptSub.getAppId());
|
|
|
|
- config.setAppSecret(deptSub.getAppSecret());
|
|
|
|
- config.setQueryUrl(deptSub.getQueryUrl());
|
|
|
|
- String subjectName = deptSub.getSubjectName();
|
|
|
|
- // settleByRenLiJia(note, config, wmScorePackage, subjectName);
|
|
|
|
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (GigTypeEnum.TAX_HELPOR.equals(execSettlementDTO.getLocation().getGigType())){
|
|
String taxCode = sysDept.getTaxCode();
|
|
String taxCode = sysDept.getTaxCode();
|
|
TaxHelperConfig config = new TaxHelperConfig();
|
|
TaxHelperConfig config = new TaxHelperConfig();
|
|
config.setAppId(deptSub.getAppId());
|
|
config.setAppId(deptSub.getAppId());
|
|
config.setAppSecrete(deptSub.getAppSecret());
|
|
config.setAppSecrete(deptSub.getAppSecret());
|
|
config.setQueryUrl(deptSub.getQueryUrl());
|
|
config.setQueryUrl(deptSub.getQueryUrl());
|
|
result = settleByTaxHelper(noteList, config, member, taxCode);
|
|
result = settleByTaxHelper(noteList, config, member, taxCode);
|
|
- // result = settleByTaxHelper();
|
|
|
|
|
|
+ } else {
|
|
|
|
+ result = getResultMap("4000", "税源地错误");
|
|
}
|
|
}
|
|
|
|
|
|
return result;
|
|
return result;
|
|
@@ -1396,23 +1369,16 @@ public class PartyAServiceImpl implements PartyAService {
|
|
* @param noteIds 结算记录id
|
|
* @param noteIds 结算记录id
|
|
* @param limitAmount 限制金额
|
|
* @param limitAmount 限制金额
|
|
* @param settleAmount 本次上传证据链累计金额
|
|
* @param settleAmount 本次上传证据链累计金额
|
|
|
|
+ * @param location 税源地
|
|
* @return 校验错误信息,如果没有错误返回{@code null}
|
|
* @return 校验错误信息,如果没有错误返回{@code null}
|
|
*/
|
|
*/
|
|
- private String checkoutSettleLimit(SysUser user, List<Integer> noteIds, BigDecimal limitAmount, BigDecimal settleAmount) {
|
|
|
|
|
|
+ private String checkoutSettleLimit(SysUser user, List<Integer> noteIds, BigDecimal limitAmount, BigDecimal settleAmount, SubjectLocation location) {
|
|
|
|
|
|
String info = null;
|
|
String info = null;
|
|
|
|
|
|
- SettleAmountMonitorInput monitorInput = SettleAmountMonitorInput.fromIdCard(Collections.singletonList(user
|
|
|
|
- .getIdCardNumber()), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
|
|
|
|
- List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(monitorInput);
|
|
|
|
-
|
|
|
|
- SettleAmountMonitorInput deptMonitorInput = SettleAmountMonitorInput.fromUserId(Collections.singletonList(String
|
|
|
|
- .valueOf(user.getUserId())), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
|
|
|
|
- List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(deptMonitorInput);
|
|
|
|
-
|
|
|
|
- SettleAmountMonitorInput yaoyiMonitorInput = SettleAmountMonitorInput.fromIdCard(Collections.singletonList(user
|
|
|
|
- .getIdCardNumber()), noteIds, SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
|
|
|
|
- List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(yaoyiMonitorInput);
|
|
|
|
|
|
+ List<SettleAmountMonitorOutput> monitorOutputList = sysDeptSubService.getSettleAmountMonitor(Collections.singletonList(user.getIdCardNumber()), noteIds, location);
|
|
|
|
+ List<SettleAmountMonitorOutput> yaoyiAmountMonitor = sysDeptSubService.getYaoyiAmountMonitor(Collections.singletonList(user.getIdCardNumber()), noteIds, location);
|
|
|
|
+ List<SettleAmountMonitorOutput> deptAmountMonitor = sysDeptSubService.getDeptAmountMonitor(Collections.singleton(user.getUserId()), noteIds, location);
|
|
|
|
|
|
SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
|
|
SettleAmountMonitorOutput monitorOutput = monitorOutputList.stream().filter(item -> item.getIdCardNumber()
|
|
.equals(user.getIdCardNumber())).findFirst().orElse(null);
|
|
.equals(user.getIdCardNumber())).findFirst().orElse(null);
|
|
@@ -1423,8 +1389,7 @@ public class PartyAServiceImpl implements PartyAService {
|
|
SettleAmountMonitorOutput yaoyiMonitorOutput = yaoyiAmountMonitor.stream().filter(item -> item.getIdCardNumber()
|
|
SettleAmountMonitorOutput yaoyiMonitorOutput = yaoyiAmountMonitor.stream().filter(item -> item.getIdCardNumber()
|
|
.equals(user.getIdCardNumber())).findFirst().orElse(null);
|
|
.equals(user.getIdCardNumber())).findFirst().orElse(null);
|
|
|
|
|
|
- MonitoringIndicator monitoringIndicator =
|
|
|
|
- monitoringIndicatorService.getBySubType(SubjectTypeEnum.TYPE_SHUIBANGYUN.getCode(), SubjectLocation.LUO_SHU_YUN);
|
|
|
|
|
|
+ MonitoringIndicator monitoringIndicator = monitoringIndicatorService.locationLimit(location);
|
|
BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
|
|
BigDecimal monitoringLimit = monitoringIndicator.getLimitAmount();
|
|
BigDecimal yaoyiMonitoringLimit = monitoringIndicator.getYaoyiLimitAmount();
|
|
BigDecimal yaoyiMonitoringLimit = monitoringIndicator.getYaoyiLimitAmount();
|
|
BigDecimal monitorAmount = settleAmount;
|
|
BigDecimal monitorAmount = settleAmount;
|
|
@@ -1743,10 +1708,10 @@ public class PartyAServiceImpl implements PartyAService {
|
|
* 校验部门结算信息
|
|
* 校验部门结算信息
|
|
*
|
|
*
|
|
* @param deptSub 部门结算信息
|
|
* @param deptSub 部门结算信息
|
|
- * @param channel 渠道
|
|
|
|
|
|
+ * @param gigTypeEnum 渠道
|
|
* @return 校验结果
|
|
* @return 校验结果
|
|
*/
|
|
*/
|
|
- private String checkoutDeptSubInfo(SysDeptSub deptSub, ChannelEnum channel, String subjectUserType) {
|
|
|
|
|
|
+ private String checkoutDeptSubInfo(SysDeptSub deptSub, GigTypeEnum gigTypeEnum, String subjectUserType) {
|
|
|
|
|
|
// 校验用户是否存在
|
|
// 校验用户是否存在
|
|
if (deptSub == null) {
|
|
if (deptSub == null) {
|
|
@@ -1761,24 +1726,24 @@ public class PartyAServiceImpl implements PartyAService {
|
|
}
|
|
}
|
|
|
|
|
|
// 校验配置属性
|
|
// 校验配置属性
|
|
- switch (channel) {
|
|
|
|
- case DING:
|
|
|
|
|
|
+ switch (gigTypeEnum) {
|
|
|
|
+ case REN_LI_JIA:
|
|
if (StringUtils.isEmpty(deptSub.getAppId()) || StringUtils.isEmpty(deptSub.getAppSecret())
|
|
if (StringUtils.isEmpty(deptSub.getAppId()) || StringUtils.isEmpty(deptSub.getAppSecret())
|
|
|| StringUtils.isEmpty(deptSub.getRsaPublicKey()) || StringUtils.isEmpty(deptSub.getQueryUrl())) {
|
|
|| StringUtils.isEmpty(deptSub.getRsaPublicKey()) || StringUtils.isEmpty(deptSub.getQueryUrl())) {
|
|
- log.error("部门{}结算信息配置不全,请联系要易管理员", channel.type());
|
|
|
|
|
|
+ log.error("部门{}结算信息配置不全,请联系要易管理员", gigTypeEnum.getDesc());
|
|
return "部门结算信息配置不全,请联系要易管理员";
|
|
return "部门结算信息配置不全,请联系要易管理员";
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- case TAX_HELPER:
|
|
|
|
|
|
+ case TAX_HELPOR:
|
|
if (StringUtils.isEmpty(deptSub.getAppId()) || StringUtils.isEmpty(deptSub.getAppSecret())
|
|
if (StringUtils.isEmpty(deptSub.getAppId()) || StringUtils.isEmpty(deptSub.getAppSecret())
|
|
|| StringUtils.isEmpty(deptSub.getQueryUrl()) || StringUtils.isEmpty(deptSub.getSubjectUserType())) {
|
|
|| StringUtils.isEmpty(deptSub.getQueryUrl()) || StringUtils.isEmpty(deptSub.getSubjectUserType())) {
|
|
- log.error("部门{}结算信息配置不全,请联系要易管理员", channel.type());
|
|
|
|
|
|
+ log.error("部门{}结算信息配置不全,请联系要易管理员", gigTypeEnum.getDesc());
|
|
return "部门结算信息配置不全,请联系要易管理员";
|
|
return "部门结算信息配置不全,请联系要易管理员";
|
|
}
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(subjectUserType)) {
|
|
if (StringUtils.isNotEmpty(subjectUserType)) {
|
|
if (!deptSub.getSubjectUserType().equals(subjectUserType)) {
|
|
if (!deptSub.getSubjectUserType().equals(subjectUserType)) {
|
|
- log.error("部门{}传入用户结算类型:{}与系统设置不匹配,请联系要易管理员", channel.type(), subjectUserType);
|
|
|
|
|
|
+ log.error("部门{}传入用户结算类型:{}与系统设置不匹配,请联系要易管理员", gigTypeEnum.getDesc(), subjectUserType);
|
|
return "传入用户结算类型+" + subjectUserType + "+与系统设置不匹配,请联系要易管理员";
|
|
return "传入用户结算类型+" + subjectUserType + "+与系统设置不匹配,请联系要易管理员";
|
|
}
|
|
}
|
|
}
|
|
}
|