Browse Source

// add shar

release_toaliyun_real
xhxu 3 years ago
parent
commit
406b5bce13
5 changed files with 92 additions and 12 deletions
  1. +14
    -0
      mallinkBApi/src/main/java/com/iformall/controller/WxProfitSharingReceiverApplyController.java
  2. +2
    -8
      mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java
  4. +73
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java
  5. +2
    -2
      mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml

+ 14
- 0
mallinkBApi/src/main/java/com/iformall/controller/WxProfitSharingReceiverApplyController.java View File

@@ -118,4 +118,18 @@ public class WxProfitSharingReceiverApplyController extends BaseController {
}
}

@ApiOperation("提交申请单")
@PostMapping("/applyment")
public ResultData applyment(@RequestBody WxProfitSharingReceiverApply receiverAdd) {
log.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::applyment");
if(receiverAdd == null){
receiverAdd = new WxProfitSharingReceiverApply();
}
receiverAdd.updateTenantInfo(getTenantInfo());
if(receiverAdd.getId() == null){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空");
}
return wxProfitSharingReceiverApplyService.applyment(receiverAdd);
}

}

+ 2
- 8
mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java View File

@@ -1,16 +1,10 @@
package com.iformall.domain.po;

import com.alibaba.fastjson.JSONObject;
import com.aliyun.openservices.shade.io.netty.util.internal.logging.InternalLogger;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumSharingReceiverOrganizationType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

@@ -77,7 +71,7 @@ public class WxProfitSharingReceiverApply extends TenantEntity {
private String businessAdditionDesc;

@io.swagger.annotations.ApiModelProperty(value="微信支付申请单号",name="applymentId")
private Integer applymentId;
private String applymentId;
@io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplymentState 申请状态",name="applymentState")
private Integer applymentState;
@io.swagger.annotations.ApiModelProperty(value="申请状态描述",name="applymentStateDesc")
@@ -110,7 +104,7 @@ public class WxProfitSharingReceiverApply extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="",name="updateTime")
private Date updateTime;

@io.swagger.annotations.ApiModelProperty(value="是否完成主资质",name="finishMain")
@io.swagger.annotations.ApiModelProperty(value="是否完成主资质",name="finishMain")
@TableField(exist = false)
private Boolean finishMain;
@io.swagger.annotations.ApiModelProperty(value="是否完成经营信息",name="finishBusiness")


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java View File

@@ -17,7 +17,6 @@ public interface WxProfitSharingReceiverApplyService {
*/
PageInfo<WxProfitSharingReceiverApply> listAsPage(WxProfitSharingReceiverApply record, Integer pageIndex, Integer pageSize);


WxProfitSharingReceiverApply selectById(Long id);

WxProfitSharingReceiverApply selectByPlat(TenantEntity tenantEntity, Long merchantId, EnumAppPlat plat);
@@ -26,5 +25,6 @@ public interface WxProfitSharingReceiverApplyService {

ResultData saveOrUpdate(WxProfitSharingReceiverApply receiverAdd);

ResultData applyment(WxProfitSharingReceiverApply receiverAdd);

}

+ 73
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java View File

@@ -4,8 +4,14 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.binarywang.wxpay.bean.applyment.WxPayApplyment4SubCreateRequest;
import com.github.binarywang.wxpay.bean.applyment.WxPayApplymentCreateResult;
import com.github.binarywang.wxpay.bean.bank.BankingResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
import com.iformall.common.IdWorker;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
@@ -13,6 +19,8 @@ import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.*;
import com.iformall.mapper.WxProfitSharingReceiverApplyMapper;
import com.iformall.service.WxAppinfoService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxPayAccountService;
import com.iformall.service.WxProfitSharingReceiverApplyService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -37,6 +45,12 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
@Autowired
WxAppinfoService wxAppinfoService;

@Autowired
WxMerchantService wxMerchantService;

@Autowired
WxPayAccountService wxPayAccountService;

@Override
public PageInfo<WxProfitSharingReceiverApply> listAsPage(WxProfitSharingReceiverApply record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxProfitSharingReceiverApplyMapper.findList(record));
@@ -88,6 +102,52 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
return new ResultData(receiverAdd);
}

@Override
public ResultData applyment(WxProfitSharingReceiverApply record) {
WxProfitSharingReceiverApply receiverApply = this.selectById(record.getId());
if(receiverApply == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到数据");
}
WxMerchant merchant = wxMerchantService.selectById(receiverApply.getMerchantId());
if(merchant == null || EnumMerchantStatus.NOT_VALID.getCode().equals(merchant.getStatus())){
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID.getCode(),"商户不存在或已停用");
}
if(receiverApply.getApplymentState() != null && !EnumSharingReceiverApplymentState.getUpdList().contains(receiverApply.getApplymentState())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "该商户进件流程中,无法申请");
}

if(!this.isFinishMain(receiverApply)){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未完成主体资质");
}
if(!this.isFinishBusiness(receiverApply)){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未完成经营信息");
}
if(!this.isFinishSettlement(receiverApply)){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未完成行业资质");
}
if(!this.isFinishBankAccount(receiverApply)){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未完成结算帐号");
}
if(!this.isFinishContact(receiverApply)){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未完成超级管理员");
}

ResultData result = this.applyment4subApplyment(receiverApply);
if(result.code == 200){
WxProfitSharingReceiverApply receiverUpd = new WxProfitSharingReceiverApply();
receiverUpd.updateTenantInfo(receiverApply);
receiverUpd.setId(receiverApply.getId());
receiverUpd.setApplymentId((String) result.data);
receiverUpd.setApplymentState(EnumSharingReceiverApplymentState.APPLYMENT_STATE_AUDITING.getCode());
receiverUpd.setApplymentStateDesc(EnumSharingReceiverApplymentState.APPLYMENT_STATE_AUDITING.getMessage());
receiverUpd.setUpdateTime(new Date());
wxProfitSharingReceiverApplyMapper.updateById(receiverUpd);
return result;
}else{
return result;
}
}


//------------------------------------------------------------------------------------------------------------------

@@ -107,7 +167,6 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
receiverAdd.setSalesInfo(JSON.toJSONString(salesInfoMap));
}


}

private boolean isFinishMain(WxProfitSharingReceiverApply record){
@@ -652,5 +711,18 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
return true;
}

private ResultData applyment4subApplyment(WxProfitSharingReceiverApply receiverApply){
WxPayService wxPayService = wxPayAccountService.getWxPayService(receiverApply.getTenantId());
try {
WxPayApplyment4SubCreateRequest request = new WxPayApplyment4SubCreateRequest();

WxPayApplymentCreateResult wxPayApplymentCreateResult = wxPayService.getApplyment4SubService().createApply(request);
return new ResultData(wxPayApplymentCreateResult.getApplymentId());
} catch (WxPayException e) {
e.printStackTrace();
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage());
}
}


}

+ 2
- 2
mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml View File

@@ -33,7 +33,7 @@
<result column="business_addition_pics" jdbcType="VARCHAR" property="businessAdditionPics" />
<result column="business_addition_desc" jdbcType="VARCHAR" property="businessAdditionDesc" />

<result column="applyment_id" jdbcType="BIGINT" property="applymentId" />
<result column="applyment_id" jdbcType="VARCHAR" property="applymentId" />
<result column="applyment_state" jdbcType="INTEGER" property="applymentState" />
<result column="applyment_state_desc" jdbcType="VARCHAR" property="applymentStateDesc" />
<result column="sign_state" jdbcType="INTEGER" property="signState" />
@@ -95,7 +95,7 @@
and `organization_type` = #{organizationType}
</if>
<if test=" null != applymentId ">
<if test=" null != applymentId and '' != applymentId ">
and `applyment_id` = #{applymentId}
</if>



Loading…
Cancel
Save