|
@@ -3,9 +3,11 @@ package com.ruoyi.system.service.impl;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
+import com.ruoyi.common.constant.CacheConstants;
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
|
+import com.ruoyi.common.core.redis.RedisCache;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.system.domain.EnterprisePhoto;
|
|
import com.ruoyi.system.domain.EnterprisePhoto;
|
|
@@ -26,6 +28,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|
@Service
|
|
@Service
|
|
public class EnterpriseApplyServiceImpl implements IEnterpriseApplyService
|
|
public class EnterpriseApplyServiceImpl implements IEnterpriseApplyService
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private RedisCache redisCache;
|
|
@Autowired
|
|
@Autowired
|
|
private EnterpriseApplyMapper enterpriseApplyMapper;
|
|
private EnterpriseApplyMapper enterpriseApplyMapper;
|
|
|
|
|
|
@@ -51,6 +56,7 @@ public class EnterpriseApplyServiceImpl implements IEnterpriseApplyService
|
|
private SysRoleDeptMapper sysRoleDeptMapper;
|
|
private SysRoleDeptMapper sysRoleDeptMapper;
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询企业信息审核
|
|
* 查询企业信息审核
|
|
*
|
|
*
|
|
@@ -82,6 +88,7 @@ public class EnterpriseApplyServiceImpl implements IEnterpriseApplyService
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional
|
|
public int insertEnterpriseApply(EnterpriseApply enterpriseApply)
|
|
public int insertEnterpriseApply(EnterpriseApply enterpriseApply)
|
|
{
|
|
{
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
@@ -89,6 +96,7 @@ public class EnterpriseApplyServiceImpl implements IEnterpriseApplyService
|
|
enterpriseApply.setUserName(user.getUserName());
|
|
enterpriseApply.setUserName(user.getUserName());
|
|
enterpriseApply.setUserPhone(user.getPhonenumber());
|
|
enterpriseApply.setUserPhone(user.getPhonenumber());
|
|
enterpriseApply.setCreateTime(DateUtils.getNowDate());
|
|
enterpriseApply.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ enterpriseApply.setUpdateTime(DateUtils.getNowDate());
|
|
int count = enterpriseApplyMapper.insertEnterpriseApply(enterpriseApply);
|
|
int count = enterpriseApplyMapper.insertEnterpriseApply(enterpriseApply);
|
|
//保存图片信息
|
|
//保存图片信息
|
|
List<EnterprisePhoto> enterprisePhotoList = enterpriseApply.getEnterprisePhotoList();
|
|
List<EnterprisePhoto> enterprisePhotoList = enterpriseApply.getEnterprisePhotoList();
|
|
@@ -158,7 +166,7 @@ public class EnterpriseApplyServiceImpl implements IEnterpriseApplyService
|
|
@Transactional
|
|
@Transactional
|
|
public int edit(EnterpriseApply enterpriseApply) {
|
|
public int edit(EnterpriseApply enterpriseApply) {
|
|
try{
|
|
try{
|
|
- enterpriseApply.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
|
+ //enterpriseApply.setUpdateTime(DateUtils.getNowDate());
|
|
if("1".equals(enterpriseApply.getIsAudit() )){
|
|
if("1".equals(enterpriseApply.getIsAudit() )){
|
|
//审核通过
|
|
//审核通过
|
|
// 删除用户与角色关联
|
|
// 删除用户与角色关联
|
|
@@ -202,7 +210,9 @@ public class EnterpriseApplyServiceImpl implements IEnterpriseApplyService
|
|
applyForUser.setDeptId(dept.getDeptId());
|
|
applyForUser.setDeptId(dept.getDeptId());
|
|
applyForUser.setApplyFor("1");
|
|
applyForUser.setApplyFor("1");
|
|
userMapper.updateUser(applyForUser);
|
|
userMapper.updateUser(applyForUser);
|
|
-
|
|
|
|
|
|
+ //删除登录tocken
|
|
|
|
+ String userKey = redisCache.getCacheObject(CacheConstants.LOGIN_USER_ID+String.valueOf(enterpriseApply.getUserId()));
|
|
|
|
+ redisCache.deleteObject(userKey);
|
|
}
|
|
}
|
|
return enterpriseApplyMapper.updateEnterpriseApply(enterpriseApply);
|
|
return enterpriseApplyMapper.updateEnterpriseApply(enterpriseApply);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|