Commit 2c408354 authored by YangZhaoJun1's avatar YangZhaoJun1

用户管理

parent 3bd00270
......@@ -41,9 +41,9 @@ public class BCompanyController extends PaginationController<BCompany> {
@Autowired
private Global global;
@ApiOperation(value="添加/编辑学生信息", notes="businessId为空时是添加方法,不为空时是修改方法")
@ApiOperation(value="添加/编辑公司用户信息", notes="businessId为空时是添加方法,不为空时是修改方法")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "工号", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "登录名", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "name", value = "姓名", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "agencyCode", value = "所属教学单位", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "roleId", value = "角色Id", required = true, dataType = "varchar")})
......@@ -69,14 +69,10 @@ public class BCompanyController extends PaginationController<BCompany> {
}
@ApiOperation(value="根据条件分页查询", notes="根据条件分页查询学生信息")
@ApiOperation(value="根据条件分页查询", notes="根据条件分页查询公司用户信息")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "学号", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "isRecommend", value = "0:未推荐,1:推荐", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "recommendDate", value = "推荐时间,排序依据", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "recommendOrder", value = "推荐排序", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "recommendCourse", value = "推荐原因", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar")})
@ApiImplicitParam(name = "code", value = "登录名", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "name", value = "姓名", required = false, dataType = "varchar")})
@GetMapping(value = "/queryCompanysByPagination")
public GridModel queryCompanysByPagination(BCompany param) {
bCompanyService.queryCompanysByPagination(getPaginationUtility(),param);
......@@ -87,7 +83,6 @@ public class BCompanyController extends PaginationController<BCompany> {
@ApiOperation(value="逻辑删除", notes="根据ID删除一条记录")
@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
@PreAuthorize("hasRole('ROLE_1001')")
@PostMapping(value = "/remove")
public Result remove(String businessId) {
PersistModel data = bCompanyService.removeBCompany(businessId);
......@@ -97,20 +92,16 @@ public class BCompanyController extends PaginationController<BCompany> {
businessId);
}
@ApiOperation(value="根据条件查询", notes="根据条件查询学生信息")
@ApiOperation(value="根据条件查询", notes="根据条件查询公司用户信息")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "学号", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "isRecommend", value = "0:未推荐,1:推荐", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "recommendDate", value = "推荐时间,排序依据", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "recommendOrder", value = "推荐排序", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "recommendCourse", value = "推荐原因", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar")})
@ApiImplicitParam(name = "code", value = "登录名", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "name", value = "姓名", required = false, dataType = "varchar")})
@GetMapping(value = "/queryBStudents")
public Result queryBStudents(BCompany param) {
public Result queryCompanys(BCompany param) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bCompanyService.queryBStudents(param));
bCompanyService.queryCompanys(param));
}
}
......@@ -4,19 +4,25 @@ import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.bcompany.entity.BCompany;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by Administrator on 2018/5/2.
*/
@Repository
public interface BCompanyRepository extends BaseMapper<BCompany>{
@Select("<script>SELECT bc.*,ba.name as agencyName,su.`name` as name FROM b_company bc \n" +
@Select("<script>SELECT bc.*,ba.name as agencyName,su.`name` as name," +
"sr.role_name as roleName,sr.`code` as roleCode " +
"FROM b_company bc \n" +
"LEFT JOIN s_user su on su.login_name = bc.`code`\n" +
"LEFT JOIN b_agency ba on ba.`code` = bc.agency_code" +
"where bc.del_flag != 1 and bc.flag = 1 "+
"LEFT JOIN b_agency ba on ba.`code` = bc.agency_code \n" +
"LEFT JOIN s_r_user_role ur ON su.business_id = ur.user_id\n" +
"LEFT JOIN s_role sr on ur.role_id = sr.business_id\n" +
"where bc.del_flag != 1 and bc.flag = 1 and su.del_flag != 1 and su.flag = 1 "+
"<if test=\"name!=null and name != ''\">and su.`name` like CONCAT('%',#{name},'%') </if>"+
"<if test=\"code!=null and code != ''\">and bc.`code` like CONCAT('%',#{code},'%') </if></script>")
@ResultMap(value = "BaseResultMap" )
......
......@@ -32,6 +32,12 @@ public class BCompany extends IdEntity<BCompany>{
@Transient
private String agencyName;
@Transient
private String roleCode;
@Transient
private String roleName;
public BCompany(String businessId, String delFlag, String flag) {
this.businessId = businessId;
this.delFlag = delFlag;
......
......@@ -20,5 +20,5 @@ public interface BCompanyService {
PersistModel removeBCompany(String businessId);
List<BCompany> queryBStudents(BCompany param);
List<BCompany> queryCompanys(BCompany param);
}
......@@ -87,8 +87,10 @@ public class BCompanyServiceImpl implements BCompanyService{
public PersistModel removeBCompany(String businessId) {
BCompany company = bCompanyRepository.selectOne(new BCompany(businessId,"0","1"));
sysUserMapper.deleteByCode(company.getCode());
BCompany bCompany = new BCompany();
bCompany.setDeleted();
bCompany.setBusinessId(businessId);
UserUtil.setCurrentMergeOperation(bCompany);
int line = bCompanyRepository.logicalDelete(bCompany);
......@@ -97,7 +99,7 @@ public class BCompanyServiceImpl implements BCompanyService{
}
@Override
public List<BCompany> queryBStudents(BCompany param) {
public List<BCompany> queryCompanys(BCompany param) {
return bCompanyRepository.queryCompanys(param);
}
}
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