Commit 848a9784 authored by hezhen's avatar hezhen

修改入驻流程

parent c83b2dcb
......@@ -15,6 +15,7 @@ import java.util.List;
@Data
public class CompanyInfoFindDTO extends PageParam implements DataInter {
private Integer status;
private String name;
......
......@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.app.entity.Cofig;
import com.xxfc.platform.app.feign.ConfigFeign;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -56,14 +57,21 @@ public class CompanyInfoApplyBiz extends BaseBiz<CompanyInfoApplyMapper, Company
if (list.size() > 0){
throw new BaseException("公司名称不能重复",ResultCode.FAILED_CODE);
}
BigDecimal platformAmount=BigDecimal.ZERO;
BigDecimal margin=BigDecimal.ZERO;
CompanyInfo companyInfo1=null;
Integer formType=2;
if (id > 0){
if (checkStatus(id) > 0L){
throw new BaseException("已存在待审核记录",ResultCode.FAILED_CODE);
}
companyInfo1=companyInfoBiz.selectById(id);
BeanUtils.copyPropertiesTargetIsEquals(companyInfo1,companyInfo);
}else {
if (checkApplyStatus(companyInfo.getAppUserId()) > 0L ){
throw new BaseException("已存在待审核记录",ResultCode.FAILED_CODE);
}
JSONObject jsonObject=getApplyOrder();
if (jsonObject != null && jsonObject.getInteger("isPay") == 1){
platformAmount=jsonObject.getBigDecimal("platformAmount") == null ? BigDecimal.ZERO :jsonObject.getBigDecimal("platformAmount") ;
......@@ -101,6 +109,21 @@ public class CompanyInfoApplyBiz extends BaseBiz<CompanyInfoApplyMapper, Company
return companyInfoApply;
}
public Long checkStatus(Long branchId){
CompanyInfoApply companyInfoApply=new CompanyInfoApply();
companyInfoApply.setBranchId(branchId);
companyInfoApply.setStatus(0);
return selectCount(companyInfoApply);
}
public Long checkApplyStatus(Integer appUserId){
CompanyInfoApply companyInfoApply=new CompanyInfoApply();
companyInfoApply.setAppUserId(appUserId);
companyInfoApply.setStatus(0);
companyInfoApply.setFormType(1);
return selectCount(companyInfoApply);
}
//入驻规则管理
public JSONObject getApplyOrder(){
try {
......@@ -164,7 +187,7 @@ public class CompanyInfoApplyBiz extends BaseBiz<CompanyInfoApplyMapper, Company
CompanyInfoApply companyInfoApply1=new CompanyInfoApply();
companyInfoApply1.setId(companyInfoApply.getId());
companyInfoApply1.setBranchId(id);
updateSelectiveById(companyInfoApply);
updateSelectiveById(companyInfoApply1);
}
}
......
......@@ -29,7 +29,7 @@ import java.util.List;
@RequestMapping("backstage/company")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
@Api(tags = {"商家申请"})
public class AdminCompanyInfoController extends BaseController<CompanyInfoApplyBiz,CompanyInfoApplyBiz>implements UserRestInterface {
public class AdminCompanyInfoController extends BaseController<CompanyInfoApplyBiz,CompanyInfoApply>implements UserRestInterface {
@Autowired
......
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