Commit 7456c507 by wangx

bug修改

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