Browse Source

fix:[资源库管理][供试品]

master
HanLong 2 weeks ago
parent
commit
3d196019a9
5 changed files with 41 additions and 16 deletions
  1. +3
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Bacteria.java
  2. +3
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlServiceImpl.java
  3. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java
  4. +33
    -11
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java
  5. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java

+ 3
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Bacteria.java View File

@ -1,6 +1,8 @@
package com.hxhq.business.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hxhq.common.core.domain.MpBaseEntity;
@ -43,6 +45,7 @@ public class Bacteria extends MpBaseEntity
private Date sxr;
/** 试验名称 */
@TableField(exist = false)
private String studyName;
public String getStudyName() {

+ 3
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspFfjlServiceImpl.java View File

@ -81,13 +81,13 @@ public class GspFfjlServiceImpl extends ServiceImpl impl
queryWrapper.and(p -> p.apply("t.ffrq>={0}", form.getStartDateCk()));
}
if (StringUtils.isNoneBlank(form.getEndDateCk())) {
queryWrapper.apply("t.ffrq>={0}", form.getStartDateCk());
queryWrapper.apply("t.ffrq<={0}", form.getEndDateCk());
}
if (StringUtils.isNoneBlank(form.getStartDateRk())) {
queryWrapper.and(p -> p.apply("t.ghrq>={0}", form.getStartDateRk()));
}
if (StringUtils.isNoneBlank(form.getEndDateRk())) {
queryWrapper.apply("t.ghrq>={0}", form.getEndDateRk());
queryWrapper.apply("t.ghrq<={0}", form.getEndDateRk());
}
if (StringUtils.isNoneBlank(form.getMd())) {
queryWrapper.and(p -> p.like("t.md_other", form.getMd())
@ -404,7 +404,7 @@ public class GspFfjlServiceImpl extends ServiceImpl impl
queryWrapper.eq("jlzt", JlztEnum.wsd.getValue());
List<GspFfjl> gspFfjlList = this.list(queryWrapper);
List<GspFfjlJcgj> gspFfjlJcgjList = new ArrayList<>();
if (gspFfjlList.size() <= form.getIds().length) {
if (gspFfjlList.size() < form.getIds().length) {
throw new ServiceException("发放记录发放记录不是未锁定状态,不能锁定");
}
for (GspFfjl gspFfjl : gspFfjlList) {

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspRkjlServiceImpl.java View File

@ -253,7 +253,7 @@ public class GspRkjlServiceImpl extends ServiceImpl impl
queryWrapper.eq("jlzt", JlztEnum.wsd.getValue());
List<GspRkjl> gspRkjlList = this.list(queryWrapper);
List<GspRkjlJcgj> gspRkjlJcgjList = new ArrayList<>();
if (gspRkjlList.size() <= form.getIds().length) {
if (gspRkjlList.size() < form.getIds().length) {
throw new ServiceException("供试品入库记录不是未锁定状态,不能锁定");
}
for (GspRkjl gspRkjl : gspRkjlList) {

+ 33
- 11
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java View File

@ -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不正确");

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java View File

@ -657,7 +657,7 @@ public class SysUserServiceImpl implements ISysUserService
@Override
public Boolean checkPassword(SysUser user, String password, Boolean needName) {
if ("dev".equals(activeProfile)){
if(SecurityUtils.matchesPassword(password,user.getPassword())){
if(StringUtils.isNotEmpty(password) && SecurityUtils.matchesPassword(password,user.getPassword())){
return true;
}
throw new ServiceException((needName?user.getNickName():"")+"密码错误");

Loading…
Cancel
Save