Commit eb71a0bb authored by hanshuai's avatar hanshuai

Merge branch 'V2.0.3' of ssh://103.249.252.28:10022/lcy/education

# Conflicts:
#	src/main/java/org/rcisoft/business/barrange/entity/BSubtask.java
parent 8fb5bd3c
......@@ -15,6 +15,8 @@ import javax.persistence.Table;
@Table(name = "b_sub_agency")
public class BSubAgency extends IdEntity<BSubAgency> {
private static final long serialVersionUID = -976454981149942491L;
private String agencyCode;
private String subtaskId;
......
......@@ -20,6 +20,8 @@ import java.util.List;
@Table(name = "b_subtask")
public class BSubtask extends IdEntity<BSubtask> {
private static final long serialVersionUID = 2820764374091464639L;
private String arrangeId;
private String name;
......
......@@ -24,6 +24,9 @@ public interface BEduClassRepository extends BaseMapper<BEduClass> {
" where 1=1 "
+ "<if test=\"delFlag !=null and delFlag != '' \">and ec.del_flag = #{delFlag} </if> "
+ "<if test=\"flag !=null and flag != '' \">and ec.flag = #{flag} </if> "
+ "<if test=\"className !=null and className != '' \">and ec.class_name LIKE CONCAT('%',#{className},'%') </if>"
+ "<if test=\"code !=null and code != '' \">and ec.code LIKE CONCAT('%',#{code},'%') </if>"
+ "order by create_date desc"
+ "</script>")
@ResultMap(value = "BaseResultMap" )
List<BEduClass> queryBEduClasss(BEduClass bEduClass);
......
......@@ -71,8 +71,8 @@ public class AuthenticationController {
* @return
*/
@PostMapping(value = "${jwt.route.authentication.register}")
public Result register(SysUser addedUser){
authenticationServiceImpl.register(addedUser);
public Result register(SysUser addedUser ,String roleId){
authenticationServiceImpl.register(addedUser,roleId);
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
......
......@@ -12,7 +12,7 @@ public interface AuthenticationService {
* 注册
* @param userToAdd
*/
void register(SysUser userToAdd);
void register(SysUser userToAdd,String roleId);
/**
* 登录
......
......@@ -14,6 +14,7 @@ import org.rcisoft.sys.role.dao.SysRoleRepository;
import org.rcisoft.sys.role.entity.SysRole;
import org.rcisoft.sys.user.dao.SysUserMapper;
import org.rcisoft.sys.user.entity.SysUser;
import org.rcisoft.sys.user.entity.UserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager;
......@@ -61,7 +62,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
@Override
public void register(SysUser userToAdd) {
public void register(SysUser userToAdd , String roleId) {
Example example = new Example(SysUser.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("loginName", userToAdd.getLoginName());
......@@ -71,6 +72,9 @@ public class AuthenticationServiceImpl implements AuthenticationService {
userToAdd.setPassword(passwordEncoder.encode(userToAdd.getPassword()));
userToAdd.setCommonBusinessId();
int result = sysUserMapper.insertSelective(userToAdd);
UserRole userRole = new UserRole(userToAdd.getBusinessId(),roleId);
userRole.setCommonBusinessId();
sysUserMapper.insertUserRole(userRole);
if(result==0)
throw new ServiceException(ResultExceptionEnum.SAVE_ERROR);
}
......
......@@ -42,8 +42,8 @@ public class SysRoleController extends PaginationController<SysRole> {
@ApiOperation(value="增加/修改角色", notes="增加/修改角色")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "roleName", value = "角色名称", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "角色编号", required = true, dataType = "varchar")})
@ApiImplicitParam(name = "roleName", value = "角色名称(1-50)", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "角色编号(1-50)", required = true, dataType = "varchar")})
@PostMapping(value = "/add")
public Result roleAdd(SysRole sysRole){
int line = sysRoleServiceImpl.persistRole(sysRole,getToken());
......
......@@ -30,6 +30,7 @@ public interface SysRoleRepository extends BaseMapper<SysRole> {
@Select("<script>select * from s_role where flag = '1' and del_flag = '0' "
+ " <if test=\"code !=null and code != ''\">and code = #{code} </if> "
+ " <if test=\"roleName !=null and roleName != ''\">and role_name = #{roleName} </if> "
+ " order by create_date desc"
+ "</script>")
@ResultMap(value = "BaseResultMap" )
List<SysRole> queryRoles(SysRole sysRole);
......
......@@ -86,5 +86,4 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
@Select("select * from b_agency where code = #{agencyCode} and del_flag = 0 and flag = 1")
List<BAgency> checkTeacherAgency(SysUser sysUser);
}
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