合并提交修改

This commit is contained in:
quyixiao 2020-08-28 13:41:31 +08:00
commit aca71ec5af
8 changed files with 39 additions and 9 deletions

View File

@ -358,6 +358,7 @@ public class DingTalkUtil {
user.setStatus(1); user.setStatus(1);
user.setType(1); user.setType(1);
user.setRealName(staffEntity.getName()); user.setRealName(staffEntity.getName());
user.setUsername(staffEntity.getMobile());
user.setUserNo(staffEntity.getMobile()); user.setUserNo(staffEntity.getMobile());
return sysUserTokenService.createTokenSetTokenCode(user, code); return sysUserTokenService.createTokenSetTokenCode(user, code);
} }

View File

@ -185,6 +185,7 @@ public class SysLoginController extends AbstractController {
user.setSalt(staffEntity.getSalt()); user.setSalt(staffEntity.getSalt());
user.setStatus(1); user.setStatus(1);
user.setType(1); user.setType(1);
user.setUsername(staffEntity.getMobile());
user.setRealName(staffEntity.getName()); user.setRealName(staffEntity.getName());
user.setUserNo(staffEntity.getMobile()); user.setUserNo(staffEntity.getMobile());
}else{ }else{

View File

@ -84,11 +84,10 @@ public class SysUserController extends AbstractController {
String newPassword = new Sha256Hash(form.getNewPassword(), getUser().getSalt()).toHex(); String newPassword = new Sha256Hash(form.getNewPassword(), getUser().getSalt()).toHex();
//更新密码 //更新密码
boolean flag = sysUserService.updatePassword(getUserId(), password, newPassword); boolean flag = sysUserService.updatePassword(getUser(), password, newPassword);
if (!flag) { if (!flag) {
return R.error("原密码不正确"); return R.error("原密码不正确");
} }
return R.ok(); return R.ok();
} }

View File

@ -83,6 +83,7 @@ public class OAuth2Realm extends AuthorizingRealm {
user.setSalt(staffEntity.getSalt()); user.setSalt(staffEntity.getSalt());
user.setStatus(1); user.setStatus(1);
user.setType(1); user.setType(1);
user.setUsername(staffEntity.getMobile());
user.setRealName(staffEntity.getName()); user.setRealName(staffEntity.getName());
user.setUserNo(staffEntity.getMobile()); user.setUserNo(staffEntity.getMobile());
} }

View File

@ -11,6 +11,7 @@ package com.lz.modules.sys.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils; import com.lz.common.utils.PageUtils;
import com.lz.modules.sys.entity.SysUserEntity; import com.lz.modules.sys.entity.SysUserEntity;
import org.apache.catalina.User;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -62,7 +63,7 @@ public interface SysUserService extends IService<SysUserEntity> {
* @param password 原密码 * @param password 原密码
* @param newPassword 新密码 * @param newPassword 新密码
*/ */
boolean updatePassword(Long userId, String password, String newPassword); boolean updatePassword(SysUserEntity user, String password, String newPassword);
List<Long> queryMenuIdListByRoleId(Long roleId); List<Long> queryMenuIdListByRoleId(Long roleId);
} }

View File

@ -354,6 +354,8 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
approvalList.add(flowRelation.getChild()); approvalList.add(flowRelation.getChild());
} }
} }
log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) );
List<Flow> flows = flowService.selectByFlowId(flowId); List<Flow> flows = flowService.selectByFlowId(flowId);
FlowRecord lastFlowRecord = flowRecordService.selectLastFlowRecordByRecordId(resultRecordId); FlowRecord lastFlowRecord = flowRecordService.selectLastFlowRecordByRecordId(resultRecordId);
FlowRecord notFlowRecord = flowRecordService.selectNotApprovalStaffIdFlowRecords(resultRecord.getId()); FlowRecord notFlowRecord = flowRecordService.selectNotApprovalStaffIdFlowRecords(resultRecord.getId());

View File

@ -13,7 +13,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.common.exception.RRException; import com.lz.common.exception.RRException;
import com.lz.common.utils.Constant; import com.lz.common.utils.Constant;
import com.lz.common.utils.PageUtils; import com.lz.common.utils.PageUtils;
import com.lz.modules.app.dao.StaffDao;
import com.lz.modules.app.dto.UserDto; import com.lz.modules.app.dto.UserDto;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.sys.dao.SysUserDao; import com.lz.modules.sys.dao.SysUserDao;
import com.lz.modules.sys.entity.SysUserEntity; import com.lz.modules.sys.entity.SysUserEntity;
import com.lz.modules.sys.service.SysRoleService; import com.lz.modules.sys.service.SysRoleService;
@ -46,6 +48,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
@Autowired @Autowired
private SysUserDao sysUserDao; private SysUserDao sysUserDao;
@Autowired
private StaffDao staffDao;
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
@ -126,11 +131,21 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
} }
@Override @Override
public boolean updatePassword(Long userId, String password, String newPassword) { public boolean updatePassword(SysUserEntity user, String password, String newPassword) {
SysUserEntity userEntity = new SysUserEntity(); if (user.getType() == 1) {
userEntity.setPassword(newPassword); StaffEntity staffEntity = staffDao.selectStaffById(user.getUserId());
return this.update(userEntity, if (!staffEntity.getPassword().equals(password)) {
new QueryWrapper<SysUserEntity>().eq("user_id", userId).eq("password", password)); return false;
}
staffEntity.setPassword(newPassword);
staffDao.updateStaffById(staffEntity);
} else {
SysUserEntity userEntity = new SysUserEntity();
userEntity.setPassword(newPassword);
return this.update(userEntity,
new QueryWrapper<SysUserEntity>().eq("user_id", user.getUserId()).eq("password", password));
}
return true ;
} }
@Override @Override

View File

@ -223,7 +223,17 @@
and rd.current_approval_staff_id = #{req.approvalStaffId} and rd.current_approval_staff_id = #{req.approvalStaffId}
</if> </if>
order by fr.id desc ) order by fr.id desc )
a GROUP by id order by department_id desc a GROUP by id
<choose>
<when test="req.statusList != null and req.statusList.size() > 0">
order by department_id desc
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
</select> </select>
<update id="updateFlowStaffIdRoleToNull"> <update id="updateFlowStaffIdRoleToNull">