|
|
|
@ -486,9 +486,15 @@ public class GspServiceImpl extends ServiceImpl implements IGspS |
|
|
|
SysUser lqr1 = sysUserService.selectUserById(form.getLqr1Id()); |
|
|
|
SysUser lqr2 = sysUserService.selectUserById(form.getLqr2Id()); |
|
|
|
SysUser ffr1 = sysUserService.selectUserById(form.getFfrId()); |
|
|
|
sysUserService.checkPassword(lqr1, form.getLqr1mm(), true); |
|
|
|
sysUserService.checkPassword(lqr2, form.getLqr2mm(), true); |
|
|
|
sysUserService.checkPassword(ffr1, form.getFfrmm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getLqr1mm()) || !SecurityUtils.matchesPassword(form.getLqr1mm(),lqr1.getPassword())) { |
|
|
|
throw new ServiceException("钥匙领取人1密码错误"); |
|
|
|
} |
|
|
|
if(StringUtils.isEmpty(form.getLqr2mm()) || !SecurityUtils.matchesPassword(form.getLqr2mm(),lqr2.getPassword())) { |
|
|
|
throw new ServiceException("钥匙领取人2密码错误"); |
|
|
|
} |
|
|
|
if(StringUtils.isEmpty(form.getFfrmm()) || !SecurityUtils.matchesPassword(form.getFfrmm(),ffr1.getPassword())) { |
|
|
|
throw new ServiceException("发放人密码错误"); |
|
|
|
} |
|
|
|
|
|
|
|
Zcg zcg = zcgService.getById(form.getZcgId()); |
|
|
|
if (zcg == null) { |
|
|
|
@ -569,18 +575,26 @@ public class GspServiceImpl extends ServiceImpl implements IGspS |
|
|
|
public void ff(FfGspForm form) { |
|
|
|
//验证领取人1、领取人2、发放人1、发放人2密码 |
|
|
|
SysUser lqr1 = sysUserService.selectUserById(form.getLqr1Id()); |
|
|
|
sysUserService.checkPassword(lqr1, form.getLqr1mm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getLqr1mm()) || !SecurityUtils.matchesPassword(form.getLqr1mm(),lqr1.getPassword())) { |
|
|
|
throw new ServiceException("领取人1密码错误"); |
|
|
|
} |
|
|
|
SysUser lqr2 = null; |
|
|
|
if(form.getLqr2Id() != null) { |
|
|
|
lqr2 = sysUserService.selectUserById(form.getLqr2Id()); |
|
|
|
sysUserService.checkPassword(lqr2, form.getLqr2mm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getLqr2mm()) || !SecurityUtils.matchesPassword(form.getLqr2mm(),lqr2.getPassword())) { |
|
|
|
throw new ServiceException("领取人2密码错误"); |
|
|
|
} |
|
|
|
} |
|
|
|
SysUser ffr1 = sysUserService.selectUserById(form.getFfr1Id()); |
|
|
|
sysUserService.checkPassword(ffr1, form.getFfr1mm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getFfr1mm()) || !SecurityUtils.matchesPassword(form.getFfr1mm(),ffr1.getPassword())) { |
|
|
|
throw new ServiceException("发放人1密码错误"); |
|
|
|
} |
|
|
|
SysUser ffr2 = null; |
|
|
|
if(form.getFfr2Id() != null) { |
|
|
|
ffr2 = sysUserService.selectUserById(form.getFfr2Id()); |
|
|
|
sysUserService.checkPassword(ffr2, form.getFfr2mm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getFfr2mm()) || !SecurityUtils.matchesPassword(form.getFfr2mm(),ffr2.getPassword())) { |
|
|
|
throw new ServiceException("发放人2密码错误"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (form.getId() == null || form.getId().longValue() < 0) { |
|
|
|
@ -1265,18 +1279,26 @@ public class GspServiceImpl extends ServiceImpl implements IGspS |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void gh(GspGhForm form) { |
|
|
|
SysUser ghr1 = sysUserService.selectUserById(form.getGhr1Id()); |
|
|
|
sysUserService.checkPassword(ghr1, form.getGhr1mm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getGhr1mm()) || !SecurityUtils.matchesPassword(form.getGhr1mm(),ghr1.getPassword())) { |
|
|
|
throw new ServiceException("归还人1密码错误"); |
|
|
|
} |
|
|
|
SysUser ghr2 = null; |
|
|
|
if(form.getGhr2Id() != null) { |
|
|
|
ghr2 = sysUserService.selectUserById(form.getGhr2Id()); |
|
|
|
sysUserService.checkPassword(ghr2, form.getGhr2mm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getGhr2mm()) || !SecurityUtils.matchesPassword(form.getGhr2mm(),ghr2.getPassword())) { |
|
|
|
throw new ServiceException("归还人2密码错误"); |
|
|
|
} |
|
|
|
} |
|
|
|
SysUser jsr1 = sysUserService.selectUserById(form.getJsr1Id()); |
|
|
|
sysUserService.checkPassword(jsr1, form.getJsr1mm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getJsr1mm()) || !SecurityUtils.matchesPassword(form.getJsr1mm(),jsr1.getPassword())) { |
|
|
|
throw new ServiceException("库管员1密码错误"); |
|
|
|
} |
|
|
|
SysUser jsr2 = null; |
|
|
|
if(form.getJsr2Id() != null) { |
|
|
|
jsr2 = sysUserService.selectUserById(form.getJsr2Id()); |
|
|
|
sysUserService.checkPassword(jsr2, form.getJsr2mm(), true); |
|
|
|
if(StringUtils.isEmpty(form.getJsr2mm()) || !SecurityUtils.matchesPassword(form.getJsr2mm(),jsr2.getPassword())) { |
|
|
|
throw new ServiceException("库管员2密码错误"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (form.getId() == null || form.getId().longValue() < 0) { |
|
|
|
throw new ServiceException("参数id不正确"); |
|
|
|
|