Commit 7456c507 by wangx

bug修改

parent 1044e59b
...@@ -83,7 +83,7 @@ sys: ...@@ -83,7 +83,7 @@ sys:
logoUrl: /static/img/exam logoUrl: /static/img/exam
logoCount: 22 logoCount: 22
logoSuffix: .jpeg logoSuffix: .jpeg
qrCodeUrl: http://${QR_CODE_URL:localhost}:${QR_CODE_PORT:8080}/#/mobile qrCodeUrl: http://exam.lencti.com/web/#/mobile
# feign相关配置 # feign相关配置
feign: feign:
......
...@@ -49,13 +49,12 @@ ...@@ -49,13 +49,12 @@
<!-- where 条件 --> <!-- where 条件 -->
<sql id="whereColumnList"> <sql id="whereColumnList">
<if test="clientId != null and clientId != ''"> <if test="clientId != null and clientId != ''">
and a.client_id like #{clientId} and a.client_id like CONCAT('%', #{clientId},'%')
</if> </if>
<if test="tenantCode != null and tenantCode != ''"> <if test="tenantCode != null and tenantCode != ''">
and a.tenant_code = #{tenantCode} and a.tenant_code = #{tenantCode}
</if> </if>
</sql> </sql>
<select id="getById" resultMap="oauthClientResultMap"> <select id="getById" resultMap="oauthClientResultMap">
SELECT SELECT
<include refid="oauthClientColumns"/> <include refid="oauthClientColumns"/>
......
...@@ -86,7 +86,7 @@ public class ExamRecordService extends CrudService<ExamRecordMapper, Examination ...@@ -86,7 +86,7 @@ public class ExamRecordService extends CrudService<ExamRecordMapper, Examination
* @author tangyi * @author tangyi
* @date 2018/11/10 21:33 * @date 2018/11/10 21:33
*/ */
public PageInfo<ExaminationRecordDto> examRecordList(ExaminationRecord examRecord, String pageNum, String pageSize, String sort, String order) { public PageInfo<ExaminationRecordDto> examRecordList(ExaminationRecord examRecord, String pageNum, String pageSize, String sort, String order,String examinationName) {
examRecord.setTenantCode(SysUtil.getTenantCode()); examRecord.setTenantCode(SysUtil.getTenantCode());
PageInfo<ExaminationRecordDto> examRecordDtoPageInfo = new PageInfo<>(); PageInfo<ExaminationRecordDto> examRecordDtoPageInfo = new PageInfo<>();
List<ExaminationRecordDto> examRecordDtoList = new ArrayList<>(); List<ExaminationRecordDto> examRecordDtoList = new ArrayList<>();
...@@ -125,7 +125,13 @@ public class ExamRecordService extends CrudService<ExamRecordMapper, Examination ...@@ -125,7 +125,13 @@ public class ExamRecordService extends CrudService<ExamRecordMapper, Examination
examRecordDtoPageInfo.setPages(examRecordPageInfo.getPages()); examRecordDtoPageInfo.setPages(examRecordPageInfo.getPages());
examRecordDtoPageInfo.setPageSize(examRecordPageInfo.getPageSize()); examRecordDtoPageInfo.setPageSize(examRecordPageInfo.getPageSize());
examRecordDtoPageInfo.setPageNum(examRecordPageInfo.getPageNum()); examRecordDtoPageInfo.setPageNum(examRecordPageInfo.getPageNum());
examRecordDtoPageInfo.setList(examRecordDtoList); if(!examinationName.isEmpty()){
List<ExaminationRecordDto> examRecordDtoLists = examRecordDtoList.stream().
filter(f -> f.getExaminationName().contains(examinationName)).collect(Collectors.toList());
examRecordDtoPageInfo.setList(examRecordDtoLists);
}else {
examRecordDtoPageInfo.setList(examRecordDtoList);
}
return examRecordDtoPageInfo; return examRecordDtoPageInfo;
} }
......
...@@ -153,7 +153,13 @@ public class SubjectService { ...@@ -153,7 +153,13 @@ public class SubjectService {
} }
PageInfo<SubjectDto> subjectDtoPageInfo = new PageInfo<>(); PageInfo<SubjectDto> subjectDtoPageInfo = new PageInfo<>();
PageUtil.copyProperties(examinationSubjectPageInfo, subjectDtoPageInfo); PageUtil.copyProperties(examinationSubjectPageInfo, subjectDtoPageInfo);
subjectDtoPageInfo.setList(subjectDtos); if(!subjectDto.getSubjectName().isEmpty()){
List<SubjectDto> subjectDtos1 = subjectDtos.stream().
filter(f -> f.getSubjectName().contains(subjectDto.getSubjectName())).collect(Collectors.toList());
subjectDtoPageInfo.setList(subjectDtos1);
}else {
subjectDtoPageInfo.setList(subjectDtos);
}
return subjectDtoPageInfo; return subjectDtoPageInfo;
} }
......
...@@ -5,6 +5,7 @@ import com.github.tangyi.common.basic.properties.SysProperties; ...@@ -5,6 +5,7 @@ import com.github.tangyi.common.basic.properties.SysProperties;
import com.github.tangyi.common.basic.vo.UserVo; import com.github.tangyi.common.basic.vo.UserVo;
import com.github.tangyi.common.core.constant.CommonConstant; import com.github.tangyi.common.core.constant.CommonConstant;
import com.github.tangyi.common.core.exceptions.CommonException; import com.github.tangyi.common.core.exceptions.CommonException;
import com.github.tangyi.common.core.exceptions.ServiceException;
import com.github.tangyi.common.core.service.CrudService; import com.github.tangyi.common.core.service.CrudService;
import com.github.tangyi.common.core.utils.AesUtil; import com.github.tangyi.common.core.utils.AesUtil;
import com.github.tangyi.common.core.utils.DateUtils; import com.github.tangyi.common.core.utils.DateUtils;
...@@ -316,6 +317,7 @@ public class UserService extends CrudService<UserMapper, User> { ...@@ -316,6 +317,7 @@ public class UserService extends CrudService<UserMapper, User> {
@Transactional @Transactional
@CacheEvict(value = "user", key = "#userDto.identifier") @CacheEvict(value = "user", key = "#userDto.identifier")
public int updatePassword(UserDto userDto) { public int updatePassword(UserDto userDto) {
log.info("用户参数 userDto{}"+userDto);
userDto.setTenantCode(SysUtil.getTenantCode()); userDto.setTenantCode(SysUtil.getTenantCode());
if (StringUtils.isBlank(userDto.getNewPassword())) if (StringUtils.isBlank(userDto.getNewPassword()))
throw new CommonException("新密码不能为空."); throw new CommonException("新密码不能为空.");
...@@ -325,10 +327,13 @@ public class UserService extends CrudService<UserMapper, User> { ...@@ -325,10 +327,13 @@ public class UserService extends CrudService<UserMapper, User> {
userAuths.setIdentifier(userDto.getIdentifier()); userAuths.setIdentifier(userDto.getIdentifier());
userAuths.setTenantCode(userDto.getTenantCode()); userAuths.setTenantCode(userDto.getTenantCode());
userAuths = userAuthsService.getByIdentifier(userAuths); userAuths = userAuthsService.getByIdentifier(userAuths);
log.info("用户参数 userAuths{}"+userAuths);
if (userAuths == null) if (userAuths == null)
throw new CommonException("账号不存在."); throw new CommonException("账号不存在");
log.info("账号不存在 {}"+userAuths);
if (!encoder.matches(userDto.getOldPassword(), userAuths.getCredential())) { if (!encoder.matches(userDto.getOldPassword(), userAuths.getCredential())) {
throw new CommonException("新旧密码不匹配"); log.info("新旧密码不匹配 {}"+userAuths);
throw new ServiceException("新旧密码不匹配");
} else { } else {
// 新旧密码一致,修改密码 // 新旧密码一致,修改密码
userAuths.setCredential(encoder.encode(userDto.getNewPassword())); userAuths.setCredential(encoder.encode(userDto.getNewPassword()));
...@@ -382,6 +387,9 @@ public class UserService extends CrudService<UserMapper, User> { ...@@ -382,6 +387,9 @@ public class UserService extends CrudService<UserMapper, User> {
return null; return null;
// 查询用户信息 // 查询用户信息
User user = this.get(userAuths.getUserId()); User user = this.get(userAuths.getUserId());
if(user.getStatus().equals(1)){
throw new ServiceException("该用户已被禁用");
}
if (user == null) if (user == null)
return null; return null;
// 查询用户角色 // 查询用户角色
......
...@@ -42,7 +42,13 @@ ...@@ -42,7 +42,13 @@
a.application_code, a.application_code,
a.tenant_code a.tenant_code
</sql> </sql>
<!-- where 条件 -->
<sql id="whereColumnList">
<if test="title != null and title != ''">
and a.title like CONCAT('%', #{title},'%')
</if>
</sql>
<select id="getById" resultMap="logResultMap"> <select id="getById" resultMap="logResultMap">
SELECT SELECT
<include refid="logColumns"/> <include refid="logColumns"/>
...@@ -61,7 +67,9 @@ ...@@ -61,7 +67,9 @@
SELECT SELECT
<include refid="logColumns"/> <include refid="logColumns"/>
FROM sys_log a FROM sys_log a
WHERE a.del_flag = 0 order by a.create_date desc WHERE a.del_flag = 0
<include refid="whereColumnList"/>
order by a.create_date desc
</select> </select>
<insert id="insert"> <insert id="insert">
......
...@@ -27,6 +27,12 @@ ...@@ -27,6 +27,12 @@
a.del_flag a.del_flag
</sql> </sql>
<!-- where 条件 -->
<sql id="whereColumnList">
<if test="tenantCode != null and tenantCode != ''">
and a.tenant_code like CONCAT('%', #{tenantCode},'%')
</if>
</sql>
<select id="getById" resultMap="tenantResultMap"> <select id="getById" resultMap="tenantResultMap">
SELECT SELECT
<include refid="tenantColumns"/> <include refid="tenantColumns"/>
...@@ -53,6 +59,7 @@ ...@@ -53,6 +59,7 @@
<include refid="tenantColumns"/> <include refid="tenantColumns"/>
FROM sys_tenant a FROM sys_tenant a
WHERE a.del_flag = 0 WHERE a.del_flag = 0
<include refid="whereColumnList"/>
</select> </select>
<select id="findListById" resultMap="tenantResultMap"> <select id="findListById" resultMap="tenantResultMap">
......
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