Commit 12743c8d by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer

 Conflicts:
	gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/pay/AccountBalanceStrategy.java
parents df393f9a aa9c129e
package com.gic.enterprise.service.impl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON;
import com.gic.commons.util.GlobalInfo;
import com.gic.enterprise.constant.BillingOrderStatusEnum;
......@@ -12,18 +23,8 @@ import com.gic.enterprise.entity.TabBillingEnterpriseSmsPackage;
import com.gic.enterprise.entity.TabBillingOrder;
import com.gic.enterprise.service.BillingEnterpriseSmsPackageService;
import com.gic.enterprise.service.BillingOrderService;
import com.gic.store.utils.CreateSerialNumberUtils;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.github.pagehelper.Page;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@Service
public class BillingOrderServiceImpl implements BillingOrderService {
......@@ -39,7 +40,7 @@ public class BillingOrderServiceImpl implements BillingOrderService {
TabBillingOrder billingOrder = new TabBillingOrder();
billingOrder.setEnterpriseId(billingOrderDTO.getEnterpriseId());
// 统一流水号
billingOrder.setSerialNumber(CreateSerialNumberUtils.createSerialNumber());
billingOrder.setSerialNumber(CreateRandomUtils.createSerialNumber());
billingOrder.setOrderStatus(BillingOrderStatusEnum.WAIT_PAY.getCode());
billingOrder.setTotalFee(billingOrderDTO.getTotalFee());
billingOrder.setTotalFeePaid(billingOrderDTO.getTotalFeePaid());
......
package com.gic.enterprise.service.impl;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.commons.util.GlobalInfo;
import com.gic.enterprise.constant.BillingAuditStatusEnum;
import com.gic.enterprise.constant.PayTypeEnum;
......@@ -9,13 +14,9 @@ import com.gic.enterprise.entity.TabBillingRechargeRecord;
import com.gic.enterprise.qo.RechargeRecordQO;
import com.gic.enterprise.service.BillingAccountService;
import com.gic.enterprise.service.BillingRechargeRecordService;
import com.gic.store.utils.CreateSerialNumberUtils;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
*
......@@ -35,7 +36,7 @@ public class BillingRechargeRecordServiceImpl implements BillingRechargeRecordSe
public TabBillingRechargeRecord saveOffLinePay(BillingRechargeDTO billingRechargeDTO) {
TabBillingRechargeRecord rechargeRecord = new TabBillingRechargeRecord();
rechargeRecord.setEnterpriseId(billingRechargeDTO.getEnterpriseId());
rechargeRecord.setSerialNumber(CreateSerialNumberUtils.createSerialNumber());
rechargeRecord.setSerialNumber(CreateRandomUtils.createSerialNumber());
rechargeRecord.setTotalFee(billingRechargeDTO.getTotalFee());
rechargeRecord.setPayType(PayTypeEnum.OFFLINE_PAY.getCode());
rechargeRecord.setPayInfoId(billingRechargeDTO.getPayInfoId());
......
package com.gic.enterprise.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GlobalInfo;
import com.gic.enterprise.dao.mapper.TabBillingVoiceCodeRecordMapper;
......@@ -9,16 +17,9 @@ import com.gic.enterprise.entity.TabBillingVoiceCodeRecord;
import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.qo.RecordQO;
import com.gic.enterprise.service.BillingVoiceCodeRecordService;
import com.gic.store.utils.CreateSerialNumberUtils;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service("billingVoiceCodeRecordService")
public class BillingVoiceCodeRecordServiceImpl implements BillingVoiceCodeRecordService{
......@@ -59,7 +60,7 @@ public class BillingVoiceCodeRecordServiceImpl implements BillingVoiceCodeRecord
TabBillingVoiceCodeRecord billingVoiceCodeRecord = EntityUtil.changeEntityByJSON(TabBillingVoiceCodeRecord.class, voiceCodeRecordDTO);
billingVoiceCodeRecord.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
billingVoiceCodeRecord.setCreateTime(new Date());
billingVoiceCodeRecord.setPaySerialNumber(CreateSerialNumberUtils.createSerialNumber());
billingVoiceCodeRecord.setPaySerialNumber(CreateRandomUtils.createSerialNumber());
return tabBillingVoiceCodeRecordMapper.insertSelective(billingVoiceCodeRecord);
}
}
\ No newline at end of file
package com.gic.enterprise.service.outer.impl;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
......@@ -10,16 +19,8 @@ import com.gic.enterprise.entity.TabBillingAccount;
import com.gic.enterprise.entity.TabBillingRefund;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.*;
import com.gic.store.utils.CreateSerialNumberUtils;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.gic.store.utils.valid.ValidUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.math.BigDecimal;
import java.util.Date;
/**
*
......@@ -182,7 +183,7 @@ public class BillingBalancePayApiServiceImpl implements BillingBalancePayApiServ
}
// 保存退款记录
Date date = new Date();
String serialNumber = CreateSerialNumberUtils.createSerialNumber();
String serialNumber = CreateRandomUtils.createSerialNumber();
refundDTO.setRefundPayNumber(serialNumber);
refundDTO.setTimeEnd(date);
Integer line = billingRefundService.save(refundDTO);
......
package com.gic.enterprise.service.outer.impl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
......@@ -15,19 +26,8 @@ import com.gic.enterprise.entity.TabBillingPayInfo;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.enterprise.service.*;
import com.gic.enterprise.utils.SignUtils;
import com.gic.finance.service.TransferAccountsApprovalApiService;
import com.github.pagehelper.PageHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@Service("billingOrderApiService")
public class BillingOrderApiServcImpl implements BillingOrderApiService {
......@@ -115,7 +115,6 @@ public class BillingOrderApiServcImpl implements BillingOrderApiService {
outPayDTO.setOrderSerialNumber(order.getSerialNumber());
outPayDTO.setPayType(payType);
outPayDTO.setAuthCode(authCode);
outPayDTO.setSign(SignUtils.getSign(outPayDTO));
ServiceResponse<BillingPayInfoDTO> response = this.billingPayInfoApiService.savePrePayInfo(outPayDTO);
if(response.isSuccess()){
Integer payInfoId = response.getResult().getPayInfoId();
......
package com.gic.enterprise.service.outer.impl;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.constant.BuyTypeEnum;
......@@ -13,17 +22,9 @@ import com.gic.enterprise.service.BillingPayInfoApiService;
import com.gic.enterprise.service.BillingRechargeApiService;
import com.gic.enterprise.service.BillingRechargeRecordService;
import com.gic.enterprise.service.EnterpriseService;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.gic.finance.service.TransferAccountsApprovalApiService;
import com.gic.redis.data.util.RedisUtil;
import com.gic.store.utils.CreateSerialNumberUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
/**
*
......@@ -47,7 +48,7 @@ public class BillingRechargeApiServiceImpl implements BillingRechargeApiService
@Override
@Transactional
public ServiceResponse<Map<String, Object>> saveAndSelectPaymentMethod(BillingRechargeDTO billingRechargeDTO) {
String serialNumber = StringUtils.isNotBlank(billingRechargeDTO.getSerialNumber())?billingRechargeDTO.getSerialNumber(): CreateSerialNumberUtils.createSerialNumber();
String serialNumber = StringUtils.isNotBlank(billingRechargeDTO.getSerialNumber())?billingRechargeDTO.getSerialNumber(): CreateRandomUtils.createSerialNumber();
ServiceResponse<BillingPayInfoDTO> serviceResponse = billingPayInfoApiService.savePrePayInfo(billingRechargeDTO.getEnterpriseId(), billingRechargeDTO.getTotalFee(), billingRechargeDTO.getPayType(), BuyTypeEnum.BALANCE_RECHARGE.getCode(), serialNumber);
if (!serviceResponse.isSuccess()) {
return ServiceResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
......
package com.gic.enterprise.service.outer.impl;
import java.util.Date;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.GICMQClientUtil;
......@@ -9,15 +16,9 @@ import com.gic.enterprise.dto.DictDTO;
import com.gic.enterprise.dto.DoubleCallingRecordDTO;
import com.gic.enterprise.dto.PstnCallBillDTO;
import com.gic.enterprise.service.*;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.gic.mq.sdk.GicMQClient;
import com.gic.store.utils.CreateSerialNumberUtils;
import com.gic.store.utils.valid.ValidUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
*
......@@ -149,7 +150,7 @@ public class DoubleCallingApiServiceImpl implements DoubleCallingApiService {
public ServiceResponse<Void> executeDatabase2(String arg) {
logger.info("执行双向呼叫计费:{}", arg);
DoubleCallingRecordDTO doubleCallingRecordDTO = JSON.parseObject(arg, DoubleCallingRecordDTO.class);
doubleCallingRecordDTO.setPaySerialNumber(CreateSerialNumberUtils.createSerialNumber());
doubleCallingRecordDTO.setPaySerialNumber(CreateRandomUtils.createSerialNumber());
ServiceResponse<DictDTO> serviceDict = dictApiService.getDict(Constants.VOICE_APP_TYPE, doubleCallingRecordDTO.getAppCode());
if (serviceDict.isSuccess()) {
DictDTO dictDTO = serviceDict.getResult();
......
package com.gic.enterprise.service.outer.impl;
import java.util.Date;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.GICMQClientUtil;
......@@ -10,14 +17,8 @@ import com.gic.enterprise.service.BillingAccountService;
import com.gic.enterprise.service.BillingRecordingStorageRecordService;
import com.gic.enterprise.service.DictApiService;
import com.gic.enterprise.service.RecordingStorageRecordApiService;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.gic.mq.sdk.GicMQClient;
import com.gic.store.utils.CreateSerialNumberUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
*
......@@ -89,7 +90,7 @@ public class RecordingStorageRecordApiServiceImpl implements RecordingStorageRec
}
}
billingAccountService.deductAccountByDatabase(recordingStorageRecordDTO.getFee(), recordingStorageRecordDTO.getEnterpriseId());
recordingStorageRecordDTO.setPaySerialNumber(CreateSerialNumberUtils.createSerialNumber());
recordingStorageRecordDTO.setPaySerialNumber(CreateRandomUtils.createSerialNumber());
billingRecordingStorageRecordService.save(recordingStorageRecordDTO);
return ServiceResponse.success();
}
......
package com.gic.enterprise.service.outer.impl.pay;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
......@@ -23,6 +33,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.math.BigDecimal;
import java.util.Date;
import com.gic.enterprise.utils.CreateRandomUtils;
/**
*
......
package com.gic.enterprise.service.outer.impl.pay;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.DateUtil;
......@@ -18,19 +28,10 @@ import com.gic.enterprise.service.BillingOrderService;
import com.gic.enterprise.service.BillingPayInfoService;
import com.gic.enterprise.service.BillingRechargeRecordService;
import com.gic.enterprise.service.EnterpriseService;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.gic.finance.constant.InitiatorTypeEnum;
import com.gic.finance.dto.TransferAccountsApprovalDTO;
import com.gic.finance.service.TransferAccountsApprovalApiService;
import com.gic.store.utils.CreateSerialNumberUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.Date;
/**
*
......@@ -62,7 +63,7 @@ public class OfflineStrategy implements PayStrategy {
}
BillingPayInfoDTO payInfoDTO = new BillingPayInfoDTO();
payInfoDTO.setEnterpriseId(outPayDTO.getEnterpriseId());
payInfoDTO.setSerialNumber(CreateSerialNumberUtils.createSerialNumber());
payInfoDTO.setSerialNumber(CreateRandomUtils.createSerialNumber());
payInfoDTO.setPayType(PayTypeEnum.OFFLINE_PAY.getCode());
payInfoDTO.setTotalFeePaid(outPayDTO.getTotalFeePaid());
payInfoDTO.setTimeStart(outPayDTO.getTimeStart());
......@@ -92,7 +93,7 @@ public class OfflineStrategy implements PayStrategy {
BillingPayInfoDTO billingPayInfoDTO = new BillingPayInfoDTO();
if (payInfo == null) {
String serialNumber = CreateSerialNumberUtils.createSerialNumber();
String serialNumber = CreateRandomUtils.createSerialNumber();
billingPayInfoDTO.setEnterpriseId(outPayDTO.getEnterpriseId());
billingPayInfoDTO.setSerialNumber(serialNumber);
billingPayInfoDTO.setOrderSerialNumber(outPayDTO.getOrderSerialNumber());
......
package com.gic.enterprise.service.outer.impl.pay;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.DateUtil;
......@@ -16,17 +25,9 @@ import com.gic.enterprise.service.BillingOrderService;
import com.gic.enterprise.service.BillingPayInfoService;
import com.gic.enterprise.service.BillingRechargeRecordService;
import com.gic.enterprise.service.PushMessageApiService;
import com.gic.store.utils.CreateSerialNumberUtils;
import com.gic.enterprise.utils.CreateRandomUtils;
import com.gic.thirdparty.api.dto.ScanPayReqDataDTO;
import com.gic.thirdparty.api.service.Pay4WXService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.Date;
/**
*
......@@ -59,7 +60,7 @@ public class WxPayStrategy implements PayStrategy {
}
}
String serialNumber = CreateSerialNumberUtils.createSerialNumber();
String serialNumber = CreateRandomUtils.createSerialNumber();
BillingPayInfoDTO billingPayInfoDTO = saveWxPrePay(outPayDTO.getEnterpriseId(), serialNumber, outPayDTO.getTotalFee(), outPayDTO.getBuyType(), outPayDTO.getOrderSerialNumber());
// 微信支付
if (billingPayInfoDTO != null) {
......
......@@ -97,6 +97,11 @@
<version>${gic-platform-finance-api}</version>
</dependency>
<dependency>
<groupId>com.gic </groupId>
<artifactId>gic-platform-auth-api </artifactId>
<version>${gic-platform-auth-api} </version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.5.RELEASE</version>
......
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