Commit cceb63d9 by 陶光胜

代码规范

parent 194b3437
......@@ -32,7 +32,6 @@ public class AuditLogServiceImpl implements AuditLogService {
auditLogDTO.setEnterpriseId(enterpriseId);
auditLogDTO.setApplyUserId(applyUserId);
auditLogDTO.setProjectItemId(projectItemId);
// auditLogDTO.setAuditExpireTime(new Date());
return tabAuditLogMapper.getLastWaitAuditByApplyUser(auditLogDTO);
}
......
......@@ -74,9 +74,6 @@ public class BillingAccountServiceImpl implements BillingAccountService{
@Override
public int deductAccountByDatabase(double totalFee, Integer enterpriseId) {
// TabBillingAccount tabBillingAccount = tabBillingAccountMapper.selectByEnterpriseId(enterpriseId);
// double newTotal = new BigDecimal(tabBillingAccount.getAccountBalance().toString()).subtract(new BigDecimal(totalFee + "")).doubleValue();
// logger.info("商户:{}, 扣费前余额:{}, 扣费金额:{}, 扣费后余额:{}", enterpriseId, tabBillingAccount.getAccountBalance(), totalFee, newTotal);
return tabBillingAccountMapper.deductAccount(totalFee, enterpriseId);
}
......
......@@ -40,7 +40,6 @@ public class DownloadLogServiceImpl implements DownloadLogService {
downloadLog.setDownloadUserId(loginUserId);
downloadLog.setDownloadUserName(userName);
downloadLog.setDownloadTime(date);
// downloadLog.setProjectCode(copy.getProjectCode());
downloadLog.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
downloadLog.setCreateTime(date);
tabDownloadLogMapper.insertSelective(downloadLog);
......
......@@ -50,15 +50,6 @@ public class DownloadReportServiceImpl implements DownloadReportService {
@Override
public Page<TabDownloadReport> listDownloadReport(DownloadReportQO downloadReportQO) {
PageHelper.startPage(downloadReportQO.getCurrentPage(), downloadReportQO.getPageSize());
// WAIT(0, "待审核"),
// PASS(1, "通过"),
// FAIL(2, "不通过"),
// OVER_TIME(3, "超时"),
// BUILD(4, "生成中"),
// GENERATED(5, "已生成")
// if (downloadReportQO.getSearchType() != null) {
// downloadReportQO.setSearchName(DownloadReportSearchTypeEnum.parseSearchType(downloadReportQO.getSearchType()));
// }
if (downloadReportQO.getDownloadReportStatus() != null) {
switch (downloadReportQO.getDownloadReportStatus()) {
case 0:
......
......@@ -219,14 +219,6 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
TabAuditProcess auditProcess = getProcess(auditLog, auditLogDTO, projectItem);
this.auditProcessService.save(auditProcess);
// todo 如果是平台级审批项 要先判断是否实施和管理员都通过了 一期先不做
// if (Constants.NORMAL_STATUS.equals(projectItem.getIsPlatform())) {
// TabAuditProcess otherTypeProcess = this.auditProcessService.getOtherTypeProcess(auditProcess.getEnterpriseId(), auditProcess.getAuditLogId(), auditProcess.getAuditorType());
// if (otherTypeProcess == null) {
// // 实施和管理员没有都审批通过 直接返回
// return EnterpriseServiceResponse.success();
// }
// }
// 修改审批状态
auditLogService.updateAudit(auditLogDTO);
if (!AuditTypeEnum.HAOBAN.getCode().equals(auditLogDTO.getAuditType()) && StringUtils.isNotBlank(projectItem.getCallbackUrl())) {
// 回调
......@@ -257,7 +249,6 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
auditProcess.setAuditorId(auditLogDTO.getAuditorId());
auditProcess.setAuditResult(auditLogDTO.getAuditResult());
// TODO 用户类型
// auditProcess.setAuditorType(auditLogDTO.getLoginType());
return auditProcess;
}
......@@ -277,7 +268,6 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
auditRiskModeDTO.setApplyDurationName(dict.getKey());
}
auditLogDTO = auditRiskModeDTO;
// return EnterpriseServiceResponse.success(auditRiskModeDTO);
} else if (AuditTypeEnum.DOWNLOAD_REPORT.getCode().equals(audit.getAuditType())) {
AuditDownloadDTO downloadDTO = EntityUtil.changeEntityByJSON(AuditDownloadDTO.class, audit);
JSONObject jsonObject = JSON.parseObject(downloadDTO.getExtraInfo());
......@@ -288,10 +278,8 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
downloadDTO.setReportStartTime(downloadReport.getReportStartTime());
downloadDTO.setReportEndTime(downloadReport.getReportEndTime());
auditLogDTO = downloadDTO;
// return EnterpriseServiceResponse.success(downloadDTO);
} else {
auditLogDTO = EntityUtil.changeEntityByJSON(AuditLogDTO.class, audit);
// return EnterpriseServiceResponse.success(EntityUtil.changeEntityByJSON(AuditLogDTO.class, audit));
}
// 商户名
TabEnterprise enterprise = enterpriseService.getEnterpriseById(auditLogDTO.getEnterpriseId());
......
......@@ -175,9 +175,6 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
//自动续订余额前提数量
Integer preNumber = (Integer) resultMap.get(AutoRechargeRedisConstant.PRE_NUMBER_MAP_KEY);
if (preNumber > getSmsBalanceNumber(enterpriseId)) {
//进行自动扣款
// account.setAccountBalance(account.getAccountBalance() - money);
// billingAccountService.updateBillingAccount(account);
//生成订单 支付
BillingOrderDTO orderDTO = new BillingOrderDTO();
orderDTO.setEnterpriseId(enterpriseId);
......
......@@ -199,22 +199,7 @@ public class BillingBalancePayApiServiceImpl implements BillingBalancePayApiServ
logger.info("退款失败:{}", JSON.toJSONString(refundDTO));
return ServiceResponse.failure(ErrorCode.UNKNOWN_ERROR.getCode(), "退款失败");
}
// 写明细
// AccountBalanceRecordDTO balanceRecordDTO = new AccountBalanceRecordDTO();
// balanceRecordDTO.setProductName(payInfo.getProductDescription());
// balanceRecordDTO.setPayType(PayTypeEnum.BALANCE_PAY.getCode());
// balanceRecordDTO.setProductType(refundDTO.getBuyProductType());
// balanceRecordDTO.setBillType(BillTypeEnum.REFUND.getCode());
// balanceRecordDTO.setDeductionTime(date);
// balanceRecordDTO.setEnterpriseId(refundDTO.getEnterpriseId());
// balanceRecordDTO.setFee(refundDTO.getRefundFee());
// Integer line2 = billingAccountBalanceRecordService.save(balanceRecordDTO);
// if (line2 == 0) {
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
// logger.info("写入明细失败:{}", JSON.toJSONString(refundDTO));
// return ServiceResponse.failure(ErrorCode.UNKNOWN_ERROR.getCode(), "写入明细失败");
// }
// 返回应用市场
// 返回应用市场
RefundReturnDTO refundReturnDTO = EntityUtil.changeEntityByOrika(RefundReturnDTO.class, refundDTO);
refundReturnDTO.setRefundPaySerialNumber(serialNumber);
refundReturnDTO.setDeductionTime(date);
......
......@@ -228,15 +228,6 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
@Override
public ServiceResponse<String> deleteRule(Integer ruleId) {
//规则不允许删除
// TabConfigRule record = configRuleService.getByRuleId(ruleId);
// if (record == null) {
// return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "规则ID错误,规则不存在");
// }
// if (record.getRuleLevel() != 1) {
// return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "规则ID错误,不是规则类型");
// }
// configRuleService.update(new TabConfigRule().setRuleId(ruleId).setStatus(0));
return ServiceResponse.success();
}
......
......@@ -151,7 +151,6 @@ public class DataConfigApiServiceImpl implements DataConfigApiService {
}
TabDataActuallyPaidConfig temp = dataActuallyPaidConfigService.get(dto.getEnterpriseId(), dto.getClassify());
if (temp != null && temp.getHasConfig() == 1) {
//return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已经配置过,不允许再次配置");
continue;
}
if (temp == null) {
......
......@@ -50,7 +50,6 @@ public class DoubleCallingApiServiceImpl implements DoubleCallingApiService {
String json = JSON.toJSONString(pstnCallBillDTO);
logger.info("收到双向呼叫计费信息:{}", json);
client.sendMessage("doubleCallMq", json);
// this.run(json);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......@@ -67,7 +66,6 @@ public class DoubleCallingApiServiceImpl implements DoubleCallingApiService {
try {
String json = JSON.toJSONString(doubleCallingRecordDTO);
logger.info("收到双向呼叫计费信息:{}", json);
// client.sendMessage("doubleCallMq", json);
this.run2(json);
} catch (Exception e) {
logger.warn("调用mq失败", e);
......@@ -92,7 +90,6 @@ public class DoubleCallingApiServiceImpl implements DoubleCallingApiService {
billingAccountService.deductAccountByCache(fee, pstnCallBillDTO.getEnterpriseId());
// 队列
client.sendMessage("doubleCallDealDbMq", JSON.toJSONString(pstnCallBillDTO));
// this.executeDatabase(JSON.toJSONString(pstnCallBillDTO));
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......@@ -104,11 +101,8 @@ public class DoubleCallingApiServiceImpl implements DoubleCallingApiService {
try {
logger.info("双向呼叫缓存扣费:{}", arg);
DoubleCallingRecordDTO doubleCallingRecordDTO = JSON.parseObject(arg, DoubleCallingRecordDTO.class);
// 缓存扣费
billingAccountService.deductAccountByCache(doubleCallingRecordDTO.getFee(), doubleCallingRecordDTO.getEnterpriseId());
// 队列
// client.sendMessage("doubleCallDealDbMq", arg);
this.executeDatabaseTwo(arg);
} catch (Exception e) {
logger.warn("调用mq失败", e);
......@@ -130,8 +124,6 @@ public class DoubleCallingApiServiceImpl implements DoubleCallingApiService {
doubleCallingRecordDTO.setDeductionTime(new Date());
doubleCallingRecordDTO.setCalledPhone(pstnCallBillDTO.getDst());
doubleCallingRecordDTO.setFee(pstnCallBillDTO.getFee());
// doubleCallingRecordDTO.setAppCode(copy.getAppCode());
// doubleCallingRecordDTO.setAppName(copy.getAppName());
doubleCallingRecordDTO.setVoiceTime(duration.toString());
doubleCallingRecordDTO.setEnterpriseId(pstnCallBillDTO.getEnterpriseId());
......
......@@ -70,14 +70,10 @@ public class EnterpriseInitApiServiceImpl implements EnterpriseInitApiService{
//如果是,则父级节点自动初始化
if (isChildrenAllInit) {
enterpriseInitService.initById(enterpriseInit.getParentId());
//会员基础配置完成,自动初始化会员接口
List<String> memberCardConfigList = EnterpriseInitCodeEnum
.getListByParentCode(EnterpriseInitCodeEnum.COMPLETE_MEMBER_CARD_CONFIG.getCode());
if (memberCardConfigList.contains(configCode)) {
//会员组接口初始化
// ServiceResponse<Void> memberInitResult = memberInitApiService.configInit(enterpriseId);
// LOGGER.warn("新增商户-会员组接口初始化结果:{}", JSONObject.toJSONString(memberInitResult));
}
}
}
......
......@@ -64,7 +64,6 @@ public class InternationalSmsRecordApiServiceImpl implements InternationalSmsRec
String json = JSON.toJSONString(internationalSmsRecordDTO);
logger.info("收到海外短信计费信息:{}", json);
client.sendMessage("InternationalSmsMq", json);
// this.run(json);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......@@ -89,7 +88,6 @@ public class InternationalSmsRecordApiServiceImpl implements InternationalSmsRec
// 队列
client.sendMessage("InternationalSmsDbMq", JSON.toJSONString(internationalSmsRecordDTO));
billingInternationalSmsRecordService.updateCacheStatus(internationalSmsRecordDTO.getSmsRecordId());
// this.executeDatabase(arg);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......
......@@ -44,7 +44,6 @@ public class LinkApiServiceImpl implements LinkApiService {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "名称重复");
}
Integer linkId = linkService.saveLinkType(name, type);
// linkSceneService.editLinkEnterprise(linkId, Collections.singletonList(-1));
return EnterpriseServiceResponse.success();
}
......@@ -100,7 +99,6 @@ public class LinkApiServiceImpl implements LinkApiService {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "名称重复");
}
Integer linkId = linkService.saveLinkChildMenu(linkDTO);
// linkSceneService.editLinkEnterprise(linkId, Collections.singletonList(-1));
return EnterpriseServiceResponse.success();
}
......
......@@ -110,7 +110,6 @@ public class ProjectApiServiceImpl implements ProjectApiService{
List<ProjectItemDTO> itemList = EntityUtil.changeEntityListByJSON(ProjectItemDTO.class, tabItemList);
Map<Integer, List<ProjectItemDTO>> group = Optional.ofNullable(itemList).orElse(Collections.emptyList()).stream()
.filter(e -> e.getUseStatus() == 1).collect(Collectors.groupingBy(ProjectItemDTO::getProjectId, Collectors.mapping(e -> e, Collectors.toList())));
// Map<Integer, List<ProjectItemDTO>> group = CollectionUtil.group(itemList, "projectId");
for (ProjectDTO projectDTO : projectList) {
projectDTO.setItemList(group.get(projectDTO.getProjectId()));
}
......
......@@ -40,16 +40,11 @@ public class RecordingStorageRecordApiServiceImpl implements RecordingStorageRec
@Override
public ServiceResponse<Void> saveRecordingStorageRecord(RecordingStorageRecordDTO recordingStorageRecordDTO) {
// ServiceResponse paramResult = ValidUtil.allCheckValidate(smsRecordDTO, SmsRecordDTO.SmsRecordValid.class);
// if (!paramResult.isSuccess()) {
// return paramResult;
// }
GicMQClient client = GICMQClientUtil.getClientInstance();
try {
String json = JSON.toJSONString(recordingStorageRecordDTO);
logger.info("收到语音存储计费信息:{}", json);
client.sendMessage("RecordingStorageMq", json);
// this.run(json);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......@@ -64,12 +59,10 @@ public class RecordingStorageRecordApiServiceImpl implements RecordingStorageRec
logger.info("语音存储缓存扣费:{}", arg);
RecordingStorageRecordDTO recordingStorageRecordDTO = JSON.parseObject(arg, RecordingStorageRecordDTO.class);
// 判断是扣套餐包还是扣余额
// Integer fee = accountStandardService.queryUnitFee(internationalSmsRecordDTO.getEnterpriseId(), AccountStandardEnum.SMS.getCode());
billingAccountService.deductAccountByCache(recordingStorageRecordDTO.getFee(), recordingStorageRecordDTO.getEnterpriseId());
// 队列
client.sendMessage("RecordingStorageDbMq", arg);
// this.executeDatabase(arg);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......
......@@ -77,18 +77,6 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
nationCode = "+" + nationCode;
}
long missCount = sendCount;
// if (StringUtils.equals("+86", nationCode)) {
// logger.info("nationCode:{}, 需要校验套餐包", nationCode);
// RAtomicLong smsCountR = billingEnterpriseSmsPackageService.getTotalSmsInPackageByEnterpriseId(enterpriseId);
// long smsPackageCount = smsCountR.get();
// if (smsPackageCount > sendCount) {
// logger.info("enterpriseId:{}, 短信套餐包条数:{}, 发送条数:{}, 可以发送", enterpriseId, smsPackageCount, sendCount);
// return ServiceResponse.success();
// } else {
// missCount = missCount - smsPackageCount;
// }
// }
TabBillingAccount billingAccount = billingAccountService.getByEnterpriseId(enterpriseId);
Double accountBalance = billingAccount.getAccountBalance();
Integer unitFee = accountStandardService.queryUnitFee(enterpriseId, AccountStandardEnum.SMS.getCode());
......@@ -126,9 +114,7 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
GicMQClient client = GICMQClientUtil.getClientInstance();
try {
String json = JSON.toJSONString(smsRecordDTO);
// logger.info("收到国内短信计费信息:{}", json);
client.sendMessage("smsMq", json);
// this.run(json);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......@@ -165,7 +151,6 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
smsRecordDTO.setCacheStatus(1);
// 队列
client.sendMessage("smsDbMq", JSON.toJSONString(smsRecordDTO));
// this.executeDatabase(JSON.toJSONString(smsRecordDTO));
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......
......@@ -46,7 +46,6 @@ public class VoiceCodeRecordApiServiceImpl implements VoiceCodeRecordApiService
GicMQClient client = GICMQClientUtil.getClientInstance();
try {
String json = JSON.toJSONString(voiceCodeRecordDTO);
// logger.info("收到语音验证码计费信息:{}", json);
client.sendMessage("VoiceCodeMq", json);
this.run(json);
} catch (Exception e) {
......@@ -63,12 +62,10 @@ public class VoiceCodeRecordApiServiceImpl implements VoiceCodeRecordApiService
logger.info("语音验证码缓存扣费:{}", arg);
VoiceCodeRecordDTO voiceCodeRecordDTO = JSON.parseObject(arg, VoiceCodeRecordDTO.class);
// 判断是扣套餐包还是扣余额
// Integer fee = accountStandardService.queryUnitFee(internationalSmsRecordDTO.getEnterpriseId(), AccountStandardEnum.SMS.getCode());
billingAccountService.deductAccountByCache(voiceCodeRecordDTO.getFee(), voiceCodeRecordDTO.getEnterpriseId());
// 队列
client.sendMessage("VoiceCodeDbMq", arg);
// this.executeDatabase(arg);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......
......@@ -78,7 +78,6 @@ public class OfflineStrategy implements PayStrategy {
payInfoDTO.setCreateTime(new Date());
payInfoDTO.setBuyType(outPayDTO.getBuyType());
payInfoDTO.setOrderSerialNumber(outPayDTO.getOrderSerialNumber());
// payInfoDTO.setAuthCodeId(authCodeId);
payInfoDTO.setRequestCode(outPayDTO.getRequestCode());
payInfoDTO.setProductDescription(outPayDTO.getProductDescription());
Integer line = billingPayInfoService.savePayInfo(payInfoDTO);
......@@ -186,7 +185,6 @@ public class OfflineStrategy implements PayStrategy {
}
private void sendOrderApprovalSms(ApprovalCallBackDTO resData, String code) {
// TabBillingRechargeRecord rechargeRecord = billingRechargeRecordService.getRechargeRecordBySerialNumber(resData.getOrderSerialNumber());
TabBillingOrder order = billingOrderService.getOrderBySerialNumber(resData.getOrderSerialNumber());
Integer initiator = order.getInitiatorUser();
if (initiator != null) {
......
......@@ -229,9 +229,6 @@ public class WxPayStrategy implements PayStrategy {
////操作对象
logDTO.setBusinessName(operationObject);
//操作模块
// String moduleMenuName = (String) RequestContext.getContext().getRequest().getAttribute("moduleMenuName");
// Integer moduleMenuId = (Integer) RequestContext.getContext().getRequest().getAttribute("moduleMenuId");
// if (moduleMenuId != null) {
logDTO.setRelationId(45000L);
logDTO.setProject("企业-计费中心");
// }
......
......@@ -20,12 +20,9 @@ public class FeeChartUtils {
static {
getPageMap.put(FeeTypeEnum.ACCOUNT_BALANCE.getCode(), new BillingAccountBalanceRecord());
// getPageMap.put(FeeTypeEnum.DOUBLE_CALLING.getCode(), new BillingDoubleCallingRecord());
// getPageMap.put(FeeTypeEnum.RECORDING_STORAGE.getCode(), new BillingRecordingStorageRecord());
getPageMap.put(FeeTypeEnum.SMS.getCode(), new BillingSmsRecord());
getPageMap.put(FeeTypeEnum.SMS_PACKAGE.getCode(), new BillingSmsPackageRecord());
getPageMap.put(FeeTypeEnum.INTERNATIONAL_SMS.getCode(), new BillingInternationSmsRecord());
// getPageMap.put(FeeTypeEnum.VOICE_CODE.getCode(), new BillingVoiceCodeRecord());
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment