publish
This commit is contained in:
@@ -4,6 +4,8 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.cms.domain.Company;
|
||||
import com.ruoyi.cms.service.ICompanyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@@ -56,6 +58,8 @@ public class SysUserController extends BaseController
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
@Autowired
|
||||
private ICompanyService companyService;
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@@ -256,4 +260,27 @@ public class SysUserController extends BaseController
|
||||
{
|
||||
return success(deptService.selectDeptTreeList(dept));
|
||||
}
|
||||
|
||||
@ApiOperation("企业资质审核")
|
||||
@PreAuthorize("@ss.hasPermi('app:company:approval:list')")
|
||||
@PostMapping("/approval")
|
||||
public AjaxResult approval(Company company)
|
||||
{
|
||||
Company company1 = companyService.approval(company);
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(company1.getContactPersonPhone());
|
||||
sysUser.setNickName(company1.getContactPerson());
|
||||
sysUser.setPhonenumber(company1.getContactPersonPhone());
|
||||
sysUser.setDeptId(101L);
|
||||
String contactPersonPhone = company1.getContactPersonPhone();
|
||||
String lastSixDigits = contactPersonPhone.substring(contactPersonPhone.length() - 6);
|
||||
sysUser.setPassword(lastSixDigits);
|
||||
sysUser.setPhonenumber(getUsername());
|
||||
Long[] postIds = {1L};
|
||||
Long[] roleIds = {100L};
|
||||
sysUser.setPostIds(postIds);
|
||||
sysUser.setRoleIds(roleIds);
|
||||
userService.insertUser(sysUser);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
@@ -7,8 +7,8 @@ spring:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:highgo://127.0.0.1:5866/highgo?useUnicode=true&characterEncoding=utf8¤tSchema=ks_db4&stringtype=unspecified
|
||||
username: sysdba
|
||||
password: ZKR2024@com
|
||||
username: syssso
|
||||
password: ZKR2024@comzkr
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
@@ -7,8 +7,8 @@ spring:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:highgo://124.243.245.42:5866/highgo?useUnicode=true&characterEncoding=utf8¤tSchema=ks_db4&stringtype=unspecified
|
||||
username: sysdba
|
||||
password: ZKR2024@com
|
||||
username: syssso
|
||||
password: ZKR2024@comzkr
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
@@ -107,4 +107,23 @@ public class CompanyController extends BaseController
|
||||
{
|
||||
return toAjax(companyService.deleteCompanyByCompanyIds(companyIds));
|
||||
}
|
||||
|
||||
@ApiOperation("企业资质审核列表")
|
||||
@PreAuthorize("@ss.hasPermi('app:company:approval:list')")
|
||||
@GetMapping("/approval/list")
|
||||
public TableDataInfo approvalList(Company company)
|
||||
{
|
||||
startPage();
|
||||
List<Company> list = companyService.approvalList(company);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ApiOperation("企业资质修改")
|
||||
@PreAuthorize("@ss.hasPermi('app:company:approval:edit')")
|
||||
@GetMapping("/approval/edit")
|
||||
public AjaxResult approvalEdit(Company company)
|
||||
{
|
||||
startPage();
|
||||
List<Company> list = companyService.approvalList(company);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
@@ -87,4 +87,8 @@ public class Company extends BaseEntity
|
||||
|
||||
@ApiModelProperty("审核未通过原因")
|
||||
private String notPassReason;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("qiye")
|
||||
private Integer isCollection;
|
||||
}
|
||||
|
@@ -73,4 +73,8 @@ public interface ICompanyService
|
||||
void register(Company company);
|
||||
|
||||
Company registerStatus();
|
||||
|
||||
List<Company> approvalList(Company company);
|
||||
|
||||
Company approval(Company company);
|
||||
}
|
||||
|
@@ -229,4 +229,24 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper,Company> imple
|
||||
Company company = companyMapper.selectOne(Wrappers.<Company>lambdaQuery().eq(Company::getUserId, userId).orderByDesc(Company::getUpdateTime));
|
||||
return company;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Company> approvalList(Company company) {
|
||||
return companyMapper.selectList(Wrappers.<Company>lambdaQuery().eq(Company::getName, company.getName()).in(Company::getStatus, Arrays.asList(0, 1, 2)).orderByAsc(Company::getStatus).orderByDesc(Company::getCreateTime));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Company approval(Company company) {
|
||||
Company company1 = companyMapper.selectById(company.getCompanyId());
|
||||
if(company1==null){
|
||||
throw new ServiceException("企业不存在");
|
||||
}
|
||||
if(company1.getStatus()!=0){
|
||||
throw new ServiceException("企业已审核");
|
||||
}
|
||||
companyMapper.updateById(company);
|
||||
//创建账号
|
||||
return company1;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user