fix submitPayInfo

This commit is contained in:
guohb
2024-04-30 10:01:08 +08:00
parent 74a849561a
commit cd18479929
3 changed files with 17 additions and 11 deletions

View File

@@ -5,13 +5,13 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;
@Data
@ApiModel("加盟费/保证金实体")
public class FranchiseFeeRequest {
private Long id;
@ApiModelProperty("shopId")
private Long shopId;
@ApiModelProperty("payId")

View File

@@ -51,8 +51,14 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
public Boolean submitLicense(FranchiseFeeRequest request) {
log.info("submitLicense request{}", JSONObject.toJSONString(request));
FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO();
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71);
return franchiseFeeMapper.insertSelective(franchiseFeeDO) == 1 ? true:false;
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71);
if (request.getId() != null) {
franchiseFeeDO.setId(request.getId());
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
} else {
franchiseFeeMapper.insertSelective(franchiseFeeDO);
}
return true;
}
@Override
@@ -62,12 +68,12 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
FranchiseFeeDO result = franchiseFeeMapper.selectOne(franchiseFeeDO);
FranchiseFeeResponse resp = FranchiseFeeResponse.from(result);
LinePayDO linePayDO = linePayMapper.selectByPrimaryKey(result.getPayId());
if (Objects.nonNull(linePayDO)){
if (Objects.nonNull(linePayDO)) {
FranchiseFeeResponse.LinePay linePayResult = FranchiseFeeResponse.LinePay.from(linePayDO);
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(linePayDO.getLineId());
linePayResult.setPartnerName(lineInfoDO.getUsername());
linePayResult.setAmount(new BigInteger(result.getPerformanceBond()).add(new BigInteger(result.getFirstYearFee())).toString());
if (Objects.nonNull(result.getAuditId())){
if (Objects.nonNull(result.getAuditId())) {
ShopAuditInfoDO shopAuditInfoDO = shopAuditInfoMapper.selectByPrimaryKey(result.getAuditId());
linePayResult.setStatus(shopAuditInfoDO.getResultType());
linePayResult.setResult(shopAuditInfoDO.getResultType() == 0 ? shopAuditInfoDO.getPassReason() : shopAuditInfoDO.getRejectReason());
@@ -88,15 +94,15 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
shopAuditInfoDO.setSubmittedUserName(user.getName());
shopAuditInfoDO.setDataType(1);
shopAuditInfoDO.setResultType(request.getStatus());
if (request.getStatus() == Constants.ZERO_INTEGER){
if (request.getStatus() == Constants.ZERO_INTEGER) {
shopAuditInfoDO.setPassReason(request.getResult());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73;
}else if (request.getStatus() == Constants.ONE_INTEGER){
} else if (request.getStatus() == Constants.ONE_INTEGER) {
shopAuditInfoDO.setRejectReason(request.getResult());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74;
}
//更新阶段信息
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),shopSubStageStatusEnum);
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), shopSubStageStatusEnum);
//插入audit
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
//更新auditId

View File

@@ -69,9 +69,9 @@ public class LinePayServiceImpl implements LinePayService {
@Override
@Transactional(rollbackFor = Exception.class)
public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) {
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
if (Objects.isNull(lineInfo)) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
LineInfoDO lineInfo = new LineInfoDO();
if (request.getLineId() != null){
lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
}
if (request.getPayBusinessType() != null
&& request.getPayBusinessType() == Constants.ONE_INTEGER