运营商停用同步停用所有旗下门店
This commit is contained in:
@ -202,15 +202,6 @@ public class CompanyController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult changeStatus(Company company)
|
||||
{
|
||||
int flag = companyService.changeStatus(company);
|
||||
if(flag >0) {
|
||||
// 运营商启用停用,同时启用停用用户信息
|
||||
SysUser user = userService.selectUserByPhoneNumber(company.getPhone());
|
||||
if(user != null) {
|
||||
user.setStatus(company.getStatus());
|
||||
userService.changeStatus(user);
|
||||
}
|
||||
}
|
||||
return toAjax(flag);
|
||||
return toAjax(companyService.changeStatus(company));
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,4 +58,6 @@ public interface CompanyStoreMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCompanyStoreByIds(String[] ids);
|
||||
|
||||
public int updateStatusByCompany(CompanyStore companyStore);
|
||||
}
|
||||
|
||||
@ -61,4 +61,6 @@ public interface ICompanyStoreService
|
||||
|
||||
public int changeStatus(CompanyStore companyStore);
|
||||
|
||||
public int changeStatusByCompany(CompanyStore companyStore);
|
||||
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.operation.domain.CompanyStore;
|
||||
import com.ruoyi.operation.service.ICompanyStoreService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -26,7 +28,10 @@ public class CompanyServiceImpl implements ICompanyService
|
||||
{
|
||||
@Autowired
|
||||
private CompanyMapper companyMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private ICompanyStoreService companyStoreService;
|
||||
/**
|
||||
* 查询运营商
|
||||
*
|
||||
@ -127,6 +132,21 @@ public class CompanyServiceImpl implements ICompanyService
|
||||
public int changeStatus(Company company)
|
||||
{
|
||||
company.setUpdateTime(DateUtils.getNowDate());
|
||||
return companyMapper.updateCompany(company);
|
||||
int flag = companyMapper.updateCompany(company);
|
||||
if(flag >0) {
|
||||
// 运营商启用停用,同时启用停用用户信息
|
||||
SysUser user = userService.selectUserByPhoneNumber(company.getPhone());
|
||||
if(user != null) {
|
||||
user.setStatus(company.getStatus());
|
||||
userService.changeStatus(user);
|
||||
}
|
||||
// 运营商启用停用,同时启用停用旗下门店
|
||||
CompanyStore companyStore = new CompanyStore();
|
||||
companyStore.setStatus(company.getStatus());
|
||||
companyStore.setOperatingCompanyId(company.getId());
|
||||
companyStoreService.changeStatusByCompany(companyStore);
|
||||
}
|
||||
return flag;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,4 +111,8 @@ public class CompanyStoreServiceImpl implements ICompanyStoreService
|
||||
companyStore.setUpdateTime(DateUtils.getNowDate());
|
||||
return companyStoreMapper.updateCompanyStore(companyStore);
|
||||
}
|
||||
@Override
|
||||
public int changeStatusByCompany(CompanyStore companyStore){
|
||||
return companyStoreMapper.updateStatusByCompany(companyStore);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user