From f64cee9e7f81ae95f8bd31b95fb43806027a2ff1 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Wed, 31 Dec 2025 15:35:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=BC=82=E5=B8=B8=E6=94=B9?= =?UTF-8?q?=E6=88=90ServiceException?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GyzjFfjlJcgjServiceImpl.java | 4 +- .../business/service/impl/GyzjFfjlServiceImpl.java | 51 +++---- .../business/service/impl/GyzjJcgjServiceImpl.java | 3 +- .../business/service/impl/GyzjServiceImpl.java | 157 ++++++++++---------- .../business/service/impl/GyzjTzServiceImpl.java | 3 +- .../service/impl/MjyFfjlJcgjServiceImpl.java | 3 +- .../business/service/impl/MjyFfjlServiceImpl.java | 51 +++---- .../business/service/impl/MjyJcgjServiceImpl.java | 3 +- .../hxhq/business/service/impl/MjyServiceImpl.java | 161 +++++++++++---------- .../business/service/impl/MjyTzServiceImpl.java | 3 +- .../service/impl/StudyFormPreJcgjServiceImpl.java | 3 +- .../service/impl/StudyFormPreQmxxServiceImpl.java | 3 +- .../service/impl/StudyFormPreServiceImpl.java | 23 +-- 13 files changed, 241 insertions(+), 227 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlJcgjServiceImpl.java index 6dcbaef..5a33eca 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlJcgjServiceImpl.java @@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hxhq.business.domain.GyzjFfjlJcgj; import com.hxhq.business.mapper.GyzjFfjlJcgjMapper; import com.hxhq.business.service.IGyzjFfjlJcgjService; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.StringUtils; import org.springframework.stereotype.Service; +import java.rmi.ServerException; import java.util.List; /** @@ -30,7 +32,7 @@ public class GyzjFfjlJcgjServiceImpl extends ServiceImpl queryList(GyzjFfjlJcgj gyzjFfjlJcgj){ QueryWrapper queryWrapper = Wrappers.query(); if(gyzjFfjlJcgj.getFfjlId()==null||gyzjFfjlJcgj.getFfjlId().longValue()<0){ - throw new SecurityException("发放记录id不能为空"); + throw new ServiceException("发放记录id不能为空"); } queryWrapper.eq("ffjl_id",gyzjFfjlJcgj.getFfjlId()); if(gyzjFfjlJcgj.getJcgjlx()!=null&&gyzjFfjlJcgj.getJcgjlx().intValue()>0){ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java index 57da651..0bd52a0 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java @@ -13,6 +13,7 @@ import com.hxhq.business.enums.zykgl.JlztEnum; import com.hxhq.business.form.gyzj.*; import com.hxhq.business.service.IGyzjFfjlJcgjService; import com.hxhq.business.utils.JctUtil; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.utils.SecurityUtils; @@ -106,14 +107,14 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } GyzjFfjl gyzjFfjlOld = this.getById(form.getId()); if (gyzjFfjlOld == null) { - throw new SecurityException("发放记录不存在或已删除"); + throw new ServiceException("发放记录不存在或已删除"); } if (!gyzjFfjlOld.getJlzt().equals(JlztEnum.wsd.getValue())) { - throw new SecurityException("发放记录【" + gyzjFfjlOld.getMc() + "】不是未锁定状态,不能加签"); + throw new ServiceException("发放记录【" + gyzjFfjlOld.getMc() + "】不是未锁定状态,不能加签"); } //稽查轨迹 Map formData = new LinkedHashMap<>(); @@ -134,17 +135,17 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } GyzjFfjl gyzjFfjlOld = this.getById(form.getId()); if (gyzjFfjlOld == null) { - throw new SecurityException("发放记录不存在或已删除"); + throw new ServiceException("发放记录不存在或已删除"); } if (!gyzjFfjlOld.getJlzt().equals(JlztEnum.gd.getValue())) { - throw new SecurityException("发放记录【" + gyzjFfjlOld.getMc() + "】不是归档状态,不能借阅"); + throw new ServiceException("发放记录【" + gyzjFfjlOld.getMc() + "】不是归档状态,不能借阅"); } if (!gyzjFfjlOld.getJyzt().equals(JyztEnum.wjy.getValue())) { - throw new SecurityException("发放记录【" + gyzjFfjlOld.getMc() + "】不是未借阅状态,不能借阅"); + throw new ServiceException("发放记录【" + gyzjFfjlOld.getMc() + "】不是未借阅状态,不能借阅"); } //申请借阅后,借阅状态更新为待借阅,等待档案员审核期间无法进行其他操作; gyzjFfjlOld.setJyzt(JyztEnum.djy.getValue()); @@ -170,7 +171,7 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i @Override public FfjlDetailDto queryInfo(Long id) { if (id == null || id.longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } return baseMapper.queryInfo(id); } @@ -186,14 +187,14 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } GyzjFfjl gyzjFfjlOld = this.getById(form.getId()); if (gyzjFfjlOld == null) { - throw new SecurityException("发放记录发放记录不存在或已删除"); + throw new ServiceException("发放记录发放记录不存在或已删除"); } if (!gyzjFfjlOld.getJlzt().equals(JlztEnum.gd.getValue())) { - throw new SecurityException("发放记录发放记录【" + gyzjFfjlOld.getMc() + "】未归档,不能解档"); + throw new ServiceException("发放记录发放记录【" + gyzjFfjlOld.getMc() + "】未归档,不能解档"); } //申请解档后,状态更新为待解档,等待档案员审核期间无法进行其他操作; gyzjFfjlOld.setJlzt(JlztEnum.djd.getValue()); @@ -218,7 +219,7 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -227,7 +228,7 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i if (gyzjFfjlList.size() > 0) { for (GyzjFfjl gyzj : gyzjFfjlList) { if (!gyzj.getJlzt().equals(JlztEnum.ysd.getValue())) { - throw new SecurityException("发放记录发放记录【" + gyzj.getMc() + "】不是锁定状态,不能归档"); + throw new ServiceException("发放记录发放记录【" + gyzj.getMc() + "】不是锁定状态,不能归档"); } } for (GyzjFfjl gyzjFfjl : gyzjFfjlList) { @@ -267,14 +268,14 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } GyzjFfjl gyzjFfjlOld = this.getById(form.getId()); if (gyzjFfjlOld == null) { - throw new SecurityException("发放记录发放记录不存在或已删除"); + throw new ServiceException("发放记录发放记录不存在或已删除"); } if (!gyzjFfjlOld.getJlzt().equals(JlztEnum.ysd.getValue())) { - throw new SecurityException("发放记录发放记录【" + gyzjFfjlOld.getMc() + "】不是锁定状态,不能归档"); + throw new ServiceException("发放记录发放记录【" + gyzjFfjlOld.getMc() + "】不是锁定状态,不能归档"); } //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; gyzjFfjlOld.setJlzt(JlztEnum.dgd.getValue()); @@ -300,7 +301,7 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -308,7 +309,7 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i List gyzjFfjlList = this.list(queryWrapper); List gyzjFfjlJcgjList = new ArrayList<>(); if (gyzjFfjlList.size() <= 0) { - throw new SecurityException("发放记录发放记录不是未锁定状态,不能锁定"); + throw new ServiceException("发放记录发放记录不是未锁定状态,不能锁定"); } for (GyzjFfjl gyzjFfjl : gyzjFfjlList) { //锁定 @@ -348,14 +349,14 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } GyzjFfjl gyzjFfjlOld = this.getById(form.getId()); if (gyzjFfjlOld == null) { - throw new SecurityException("发放记录发放记录不存在或已删除"); + throw new ServiceException("发放记录发放记录不存在或已删除"); } if (!gyzjFfjlOld.getJlzt().equals(JlztEnum.wsd.getValue())) { - throw new SecurityException("发放记录发放记录【" + gyzjFfjlOld.getMc() + "】不是未锁定状态,不能锁定"); + throw new ServiceException("发放记录发放记录【" + gyzjFfjlOld.getMc() + "】不是未锁定状态,不能锁定"); } gyzjFfjlOld.setJlzt(JlztEnum.ysd.getValue()); this.updateById(gyzjFfjlOld); @@ -380,14 +381,14 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } GyzjFfjl gyzjFfjlOld = this.getById(form.getId()); if (gyzjFfjlOld == null) { - throw new SecurityException("发放记录发放记录不存在或已删除"); + throw new ServiceException("发放记录发放记录不存在或已删除"); } if (!gyzjFfjlOld.getJlzt().equals(JlztEnum.ysd.getValue())) { - throw new SecurityException("发放记录发放记录【" + gyzjFfjlOld.getMc() + "】不是已锁定状态,不能解锁"); + throw new ServiceException("发放记录发放记录【" + gyzjFfjlOld.getMc() + "】不是已锁定状态,不能解锁"); } //点击解锁,状态更新为入库; gyzjFfjlOld.setJlzt(JlztEnum.wsd.getValue()); @@ -409,7 +410,7 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i public void gh( GhForm form, Gyzj gyzj, SysUser ghr1, SysUser ghr2, SysUser jsr1, SysUser jsr2) { GyzjFfjl gyzjFfjl = this.queryLastInfoByGyzjId(form.getId()); if (gyzjFfjl == null) { - throw new SecurityException("发放记录不存在或已删除"); + throw new ServiceException("发放记录不存在或已删除"); } gyzjFfjl.setFfzytj(form.getGhzytj()); gyzjFfjl.setRkwz(form.getRkwz()); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjJcgjServiceImpl.java index 8d5e5ae..22ee5ae 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjJcgjServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hxhq.business.domain.GyzjJcgj; import com.hxhq.business.domain.GyzjJcgj; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.StringUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.GyzjJcgjMapper; @@ -31,7 +32,7 @@ public class GyzjJcgjServiceImpl extends ServiceImpl i public List queryList(GyzjJcgj gyzjJcgj){ QueryWrapper queryWrapper = Wrappers.query(); if(gyzjJcgj.getGyzjId()==null||gyzjJcgj.getGyzjId().longValue()<0){ - throw new SecurityException("麻精药id不能为空"); + throw new ServiceException("麻精药id不能为空"); } queryWrapper.eq("gyzj_id",gyzjJcgj.getGyzjId()); if(gyzjJcgj.getJcgjlx()!=null&&gyzjJcgj.getJcgjlx().intValue()>0){ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java index 3f6e832..583ba3e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java @@ -14,6 +14,7 @@ import com.hxhq.business.form.gyzj.*; import com.hxhq.business.service.*; import com.hxhq.business.utils.JctUtil; import com.hxhq.business.utils.ObjectCompareUtil; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.text.Convert; import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; @@ -92,7 +93,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG @Override public DetailDto queryInfo(Long id) { if (id == null || id.longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } return baseMapper.queryInfo(id); } @@ -108,14 +109,14 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.gd.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】未归档,不能解档"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】未归档,不能解档"); } //申请解档后,制剂状态更新为待解档,等待档案员审核期间无法进行其他操作; gyzjOld.setZjzt(ZjztEnum.djd.getValue()); @@ -139,17 +140,17 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.gd.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是归档状态,不能借阅"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是归档状态,不能借阅"); } if (!gyzjOld.getJyzt().equals(JyztEnum.wjy.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是未借阅状态,不能借阅"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是未借阅状态,不能借阅"); } //申请借阅后,借阅状态更新为待借阅,等待档案员审核期间无法进行其他操作; gyzjOld.setJyzt(JyztEnum.djy.getValue()); @@ -177,7 +178,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -186,7 +187,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG if (gyzjList.size() > 0) { for (Gyzj gyzj : gyzjList) { if (!gyzj.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("给药制剂【" + gyzj.getMc() + "】不是锁定状态,不能归档"); + throw new ServiceException("给药制剂【" + gyzj.getMc() + "】不是锁定状态,不能归档"); } } for (Gyzj gyzj : gyzjList) { @@ -225,14 +226,14 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是锁定状态,不能归档"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是锁定状态,不能归档"); } //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; gyzjOld.setZjzt(ZjztEnum.dgd.getValue()); @@ -257,7 +258,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -265,7 +266,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG List gyzjList = this.list(queryWrapper); List gyzjJcgjList = new ArrayList<>(); if (gyzjList.size() <= 0) { - throw new SecurityException("给药制剂不是入库状态,不能锁定"); + throw new ServiceException("给药制剂不是入库状态,不能锁定"); } for (Gyzj gyzj : gyzjList) { //锁定 @@ -305,14 +306,14 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是入库状态,不能锁定"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是入库状态,不能锁定"); } gyzjOld.setZjzt(ZjztEnum.ysd.getValue()); this.updateById(gyzjOld); @@ -336,14 +337,14 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是已锁定状态,不能解锁"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是已锁定状态,不能解锁"); } //点击解锁,状态更新为入库; gyzjOld.setZjzt(ZjztEnum.rk.getValue()); @@ -372,7 +373,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG queryWrapper.eq("zjzt", ZjztEnum.rk.getValue()); List gyzjList = this.list(queryWrapper); if (gyzjList.size() <= 0) { - throw new SecurityException("给药制剂不是入库状态,不能处置药剂"); + throw new ServiceException("给药制剂不是入库状态,不能处置药剂"); } List gyzjJcgjList = new ArrayList<>(); List gyzjTzList = new ArrayList<>(); @@ -383,21 +384,21 @@ public class GyzjServiceImpl extends ServiceImpl implements IG if (gyzjPlffItemFilter.size() > 0) { //region 验证 if (StringUtils.isBlank(gyzjPlffItemFilter.get(0).getCzl())) { - throw new SecurityException("处置量不能为空"); + throw new ServiceException("处置量不能为空"); } BigDecimal czl = BigDecimal.ZERO; try { czl = new BigDecimal(gyzjPlffItemFilter.get(0).getCzl()); } catch (Exception ex) { - throw new SecurityException("处置量填写不正确"); + throw new ServiceException("处置量填写不正确"); } //验证库存 BigDecimal kc = new BigDecimal(gyzj.getKc()); if (kc.compareTo(BigDecimal.ZERO) <= 0) { - throw new SecurityException("给药制剂【" + gyzj.getMc() + "】库存不足,不能处置"); + throw new ServiceException("给药制剂【" + gyzj.getMc() + "】库存不足,不能处置"); } if (kc.compareTo(czl) < 0) { - throw new SecurityException("给药制剂【" + gyzj.getMc() + "】处置量大于库存量"); + throw new ServiceException("给药制剂【" + gyzj.getMc() + "】处置量大于库存量"); } gyzj.setKc(kc.subtract(czl).toString()); //region 稽查轨迹 @@ -429,7 +430,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG gyzjTzList.add(gyzjTz); //endregion } else { - throw new SecurityException("给药制剂【" + gyzj.getMc() + "】不存在或已删除"); + throw new ServiceException("给药制剂【" + gyzj.getMc() + "】不存在或已删除"); } } this.saveOrUpdateBatch(gyzjList); @@ -447,34 +448,34 @@ public class GyzjServiceImpl extends ServiceImpl implements IG @Transactional(rollbackFor = Exception.class) public void czyj(CzyjForm form) { if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } SysUser clr = sysUserService.selectUserById(form.getClrId()); //验证处理人,复核人,监督人密码 todo Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是入库状态,不能处置药剂"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是入库状态,不能处置药剂"); } if (StringUtils.isBlank(form.getCzl())) { - throw new SecurityException("处置量不能为空"); + throw new ServiceException("处置量不能为空"); } BigDecimal czl = BigDecimal.ZERO; try { czl = new BigDecimal(form.getCzl()); } catch (Exception ex) { - throw new SecurityException("处置量填写不正确"); + throw new ServiceException("处置量填写不正确"); } //验证库存 BigDecimal kc = new BigDecimal(gyzjOld.getKc()); if (kc.compareTo(BigDecimal.ZERO) <= 0) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】库存不足,不能处置"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】库存不足,不能处置"); } if (kc.compareTo(czl) < 0) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】处置量大于库存量"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】处置量大于库存量"); } //更新库存 gyzjOld.setKc(kc.subtract(czl).toString()); @@ -511,19 +512,19 @@ public class GyzjServiceImpl extends ServiceImpl implements IG public void plczrq(PlczrqForm form) { SysUser clr = sysUserService.selectUserById(form.getClrId()); if (clr == null) { - throw new SecurityException("处理人不存在"); + throw new ServiceException("处理人不存在"); } SysUser fhr = sysUserService.selectUserById(form.getFhrId()); if (fhr == null) { - throw new SecurityException("复核人不存在"); + throw new ServiceException("复核人不存在"); } SysUser jdr = sysUserService.selectUserById(form.getJdrId()); if (jdr == null) { - throw new SecurityException("监督人不存在"); + throw new ServiceException("监督人不存在"); } //验证处理人,复核人,监督人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -534,7 +535,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG List gyzjTzList = new ArrayList<>(); if (gyzjList.size() <= 0) { - throw new SecurityException("给药制剂已经处置过容器了,不能重复操作"); + throw new ServiceException("给药制剂已经处置过容器了,不能重复操作"); } for (Gyzj gyzj : gyzjList) { List gyzjPlffItemFilter = form.getList().stream() @@ -574,7 +575,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG gyzj.setRqzt(RqztEnum.ycz.getValue()); } else { - throw new SecurityException("给药制剂【" + gyzj.getMc() + "】不存在或已删除"); + throw new ServiceException("给药制剂【" + gyzj.getMc() + "】不存在或已删除"); } } @@ -593,29 +594,29 @@ public class GyzjServiceImpl extends ServiceImpl implements IG public void czrq(CzrqForm form) { SysUser clr = sysUserService.selectUserById(form.getClrId()); if (clr == null) { - throw new SecurityException("处理人不存在"); + throw new ServiceException("处理人不存在"); } SysUser fhr = sysUserService.selectUserById(form.getFhrId()); if (fhr == null) { - throw new SecurityException("复核人不存在"); + throw new ServiceException("复核人不存在"); } SysUser jdr = sysUserService.selectUserById(form.getJdrId()); if (jdr == null) { - throw new SecurityException("监督人不存在"); + throw new ServiceException("监督人不存在"); } //验证处理人,复核人,监督人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是入库状态,不能处置容器"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是入库状态,不能处置容器"); } if (!gyzjOld.getRqzt().equals(RqztEnum.wcz.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】已经处置过容器了,不能重复操作"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】已经处置过容器了,不能重复操作"); } //region 稽查轨迹 Map formData = new LinkedHashMap<>(); @@ -652,7 +653,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG //验证领取人1,领取人2,发放人密码 todo Zcg zcg = zcgService.getById(form.getZcgId()); if (zcg == null) { - throw new SecurityException("暂存柜不存在或已删除"); + throw new ServiceException("暂存柜不存在或已删除"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -660,7 +661,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG List gyzjList = this.list(queryWrapper); List gyzjJcgjList = new ArrayList<>(); if (gyzjList.size() <= 0) { - throw new SecurityException("药剂已被发放,请不要重复发放"); + throw new ServiceException("药剂已被发放,请不要重复发放"); } String glyj = ""; for (Gyzj gyzj : gyzjList) { @@ -714,14 +715,14 @@ public class GyzjServiceImpl extends ServiceImpl implements IG @Transactional(rollbackFor = Exception.class) public void ff(FfForm form) { if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是入库状态,不能发放"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是入库状态,不能发放"); } SysUser lqr1 = sysUserService.selectUserById(form.getLqr1Id()); SysUser lqr2 = sysUserService.selectUserById(form.getLqr2Id()); @@ -789,14 +790,14 @@ public class GyzjServiceImpl extends ServiceImpl implements IG List gyzjJcgjList = new ArrayList<>(); List gyzjTzList = new ArrayList<>(); if (gyzjList.size() <= 0) { - throw new SecurityException("给药制剂不是入库状态,不能发放"); + throw new ServiceException("给药制剂不是入库状态,不能发放"); } Date now = new Date(); for (Gyzj gyzj : gyzjList) { //验证库存 BigDecimal kc = new BigDecimal(gyzj.getKc()); if (kc.compareTo(BigDecimal.ZERO) <= 0) { - throw new SecurityException("给药制剂【" + gyzj.getMc() + "】库存不足,不能发放"); + throw new ServiceException("给药制剂【" + gyzj.getMc() + "】库存不足,不能发放"); } List plffItemFilter = form.getList().stream() .filter(p -> p.getId().equals(gyzj.getId())) @@ -852,7 +853,7 @@ public class GyzjServiceImpl extends ServiceImpl implements IG gyzj.setZjzt(ZjztEnum.yff.getValue()); //endregion } else { - throw new SecurityException("给药制剂【" + gyzj.getMc() + "】不存在或已删除"); + throw new ServiceException("给药制剂【" + gyzj.getMc() + "】不存在或已删除"); } } gyzjJcgjService.saveBatch(gyzjJcgjList); @@ -871,23 +872,23 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getBjzt().equals(BjEnum.wbj.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】已经提交编辑申请,请等待审核"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】已经提交编辑申请,请等待审核"); } if (!(gyzjOld.getZjzt().equals(ZjztEnum.rk.getValue()) || gyzjOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是入库或已发放状态,不能编辑"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是入库或已发放状态,不能编辑"); } List gyzjJcgjList = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(gyzjOld, form); if (fieldChanges.size() == 0) { - throw new SecurityException("你没有修改任何内容"); + throw new ServiceException("你没有修改任何内容"); } for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { GyzjJcgj gyzjJcgj = new GyzjJcgj(); @@ -926,17 +927,17 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getBjzt().equals(BjEnum.shz.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】没有提交编辑申请,不能审核编辑"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】没有提交编辑申请,不能审核编辑"); } if (!(gyzjOld.getZjzt().equals(ZjztEnum.rk.getValue()) || gyzjOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是入库或已发放状态,不能审核编辑"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是入库或已发放状态,不能审核编辑"); } //region 稽查轨迹 GyzjJcgj gyzjJcgj = new GyzjJcgj(); @@ -994,21 +995,21 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getKcbjzt().equals(KcbjEnum.wbj.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】已经提交修改库存申请,请等待审核"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】已经提交修改库存申请,请等待审核"); } if (!(gyzjOld.getZjzt().equals(ZjztEnum.rk.getValue()) || gyzjOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是入库或已发放状态,不能修改库存"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是入库或已发放状态,不能修改库存"); } List fieldChanges = ObjectCompareUtil.compareObjects(gyzjOld, form); if (fieldChanges.size() == 0) { - throw new SecurityException("你没有修改任何内容"); + throw new ServiceException("你没有修改任何内容"); } List gyzjJcgjList = new ArrayList<>(); //region 稽查轨迹 @@ -1048,17 +1049,17 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getKcbjzt().equals(KcbjEnum.shz.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】没有提交修改库存申请,不能审核修改库存"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】没有提交修改库存申请,不能审核修改库存"); } if (!(gyzjOld.getZjzt().equals(ZjztEnum.rk.getValue()) || gyzjOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是入库或已发放状态,不能审核修改库存"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是入库或已发放状态,不能审核修改库存"); } //region 稽查轨迹 GyzjJcgj gyzjJcgj = new GyzjJcgj(); @@ -1116,22 +1117,22 @@ public class GyzjServiceImpl extends ServiceImpl implements IG SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Gyzj gyzjOld = this.getById(form.getId()); if (gyzjOld == null) { - throw new SecurityException("给药制剂不存在或已删除"); + throw new ServiceException("给药制剂不存在或已删除"); } if (!gyzjOld.getZjzt().equals(ZjztEnum.yff.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是已发放状态,不能归还"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是已发放状态,不能归还"); } if (!gyzjOld.getGhzt().equals(GhztEnum.sqgh.getValue())) { - throw new SecurityException("给药制剂【" + gyzjOld.getMc() + "】不是申请归还状态,不能归还"); + throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是申请归还状态,不能归还"); } BigDecimal kc = new BigDecimal(gyzjOld.getKc()); BigDecimal syl = new BigDecimal(form.getSyl()); if (syl.compareTo(kc) > 0) { - throw new SecurityException("使用量不能大于出库量"); + throw new ServiceException("使用量不能大于出库量"); } BigDecimal leftKc = new BigDecimal(gyzjOld.getKc()).subtract(new BigDecimal(form.getSyl())); gyzjFfjlService.gh(form, gyzjOld, ghr1, ghr2, jsr1, jsr2); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjTzServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjTzServiceImpl.java index abacf74..dd085d1 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjTzServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjTzServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hxhq.business.domain.GyzjJcgj; +import com.hxhq.common.core.exception.ServiceException; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.GyzjTzMapper; import com.hxhq.business.domain.GyzjTz; @@ -29,7 +30,7 @@ public class GyzjTzServiceImpl extends ServiceImpl impleme public List queryList(GyzjTz gyzjTz){ QueryWrapper queryWrapper = Wrappers.query(); if(gyzjTz.getGyzjId()==null||gyzjTz.getGyzjId().longValue()<0){ - throw new SecurityException("麻精药id不能为空"); + throw new ServiceException("麻精药id不能为空"); } queryWrapper.eq("gyzj_id",gyzjTz.getGyzjId()); queryWrapper.orderByDesc("id"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlJcgjServiceImpl.java index 9029fc2..5743121 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlJcgjServiceImpl.java @@ -3,6 +3,7 @@ package com.hxhq.business.service.impl; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.StringUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.MjyFfjlJcgjMapper; @@ -29,7 +30,7 @@ public class MjyFfjlJcgjServiceImpl extends ServiceImpl queryList(MjyFfjlJcgj mjyFfjlJcgj){ QueryWrapper queryWrapper = Wrappers.query(); if(mjyFfjlJcgj.getFfjlId()==null||mjyFfjlJcgj.getFfjlId().longValue()<0){ - throw new SecurityException("发放记录id不能为空"); + throw new ServiceException("发放记录id不能为空"); } queryWrapper.eq("ffjl_id",mjyFfjlJcgj.getFfjlId()); if(mjyFfjlJcgj.getJcgjlx()!=null&&mjyFfjlJcgj.getJcgjlx().intValue()>0){ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlServiceImpl.java index 42a43f8..e619a5e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyFfjlServiceImpl.java @@ -13,6 +13,7 @@ import com.hxhq.business.enums.zykgl.JlztEnum; import com.hxhq.business.form.mjy.*; import com.hxhq.business.service.IMjyFfjlJcgjService; import com.hxhq.business.utils.JctUtil; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.utils.SecurityUtils; @@ -106,14 +107,14 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } MjyFfjl mjyFfjlOld = this.getById(form.getId()); if (mjyFfjlOld == null) { - throw new SecurityException("发放记录不存在或已删除"); + throw new ServiceException("发放记录不存在或已删除"); } if (!mjyFfjlOld.getJlzt().equals(JlztEnum.wsd.getValue())) { - throw new SecurityException("发放记录【" + mjyFfjlOld.getMc() + "】不是未锁定状态,不能加签"); + throw new ServiceException("发放记录【" + mjyFfjlOld.getMc() + "】不是未锁定状态,不能加签"); } //稽查轨迹 Map formData = new LinkedHashMap<>(); @@ -134,17 +135,17 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } MjyFfjl mjyFfjlOld = this.getById(form.getId()); if (mjyFfjlOld == null) { - throw new SecurityException("发放记录不存在或已删除"); + throw new ServiceException("发放记录不存在或已删除"); } if (!mjyFfjlOld.getJlzt().equals(JlztEnum.gd.getValue())) { - throw new SecurityException("发放记录【" + mjyFfjlOld.getMc() + "】不是归档状态,不能借阅"); + throw new ServiceException("发放记录【" + mjyFfjlOld.getMc() + "】不是归档状态,不能借阅"); } if (!mjyFfjlOld.getJyzt().equals(JyztEnum.wjy.getValue())) { - throw new SecurityException("发放记录【" + mjyFfjlOld.getMc() + "】不是未借阅状态,不能借阅"); + throw new ServiceException("发放记录【" + mjyFfjlOld.getMc() + "】不是未借阅状态,不能借阅"); } //申请借阅后,借阅状态更新为待借阅,等待档案员审核期间无法进行其他操作; mjyFfjlOld.setJyzt(JyztEnum.djy.getValue()); @@ -170,7 +171,7 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl @Override public FfjlDetailDto queryInfo(Long id) { if (id == null || id.longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } return baseMapper.queryInfo(id); } @@ -186,14 +187,14 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } MjyFfjl mjyFfjlOld = this.getById(form.getId()); if (mjyFfjlOld == null) { - throw new SecurityException("发放记录发放记录不存在或已删除"); + throw new ServiceException("发放记录发放记录不存在或已删除"); } if (!mjyFfjlOld.getJlzt().equals(JlztEnum.gd.getValue())) { - throw new SecurityException("发放记录发放记录【" + mjyFfjlOld.getMc() + "】未归档,不能解档"); + throw new ServiceException("发放记录发放记录【" + mjyFfjlOld.getMc() + "】未归档,不能解档"); } //申请解档后,状态更新为待解档,等待档案员审核期间无法进行其他操作; mjyFfjlOld.setJlzt(JlztEnum.djd.getValue()); @@ -218,7 +219,7 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -227,7 +228,7 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl if (mjyFfjlList.size() > 0) { for (MjyFfjl mjy : mjyFfjlList) { if (!mjy.getJlzt().equals(JlztEnum.ysd.getValue())) { - throw new SecurityException("发放记录发放记录【" + mjy.getMc() + "】不是锁定状态,不能归档"); + throw new ServiceException("发放记录发放记录【" + mjy.getMc() + "】不是锁定状态,不能归档"); } } for (MjyFfjl mjyFfjl : mjyFfjlList) { @@ -267,14 +268,14 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } MjyFfjl mjyFfjlOld = this.getById(form.getId()); if (mjyFfjlOld == null) { - throw new SecurityException("发放记录发放记录不存在或已删除"); + throw new ServiceException("发放记录发放记录不存在或已删除"); } if (!mjyFfjlOld.getJlzt().equals(JlztEnum.ysd.getValue())) { - throw new SecurityException("发放记录发放记录【" + mjyFfjlOld.getMc() + "】不是锁定状态,不能归档"); + throw new ServiceException("发放记录发放记录【" + mjyFfjlOld.getMc() + "】不是锁定状态,不能归档"); } //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; mjyFfjlOld.setJlzt(JlztEnum.dgd.getValue()); @@ -300,7 +301,7 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -308,7 +309,7 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl List mjyFfjlList = this.list(queryWrapper); List mjyFfjlJcgjList = new ArrayList<>(); if (mjyFfjlList.size() <= 0) { - throw new SecurityException("发放记录发放记录不是未锁定状态,不能锁定"); + throw new ServiceException("发放记录发放记录不是未锁定状态,不能锁定"); } for (MjyFfjl mjyFfjl : mjyFfjlList) { //锁定 @@ -348,14 +349,14 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } MjyFfjl mjyFfjlOld = this.getById(form.getId()); if (mjyFfjlOld == null) { - throw new SecurityException("发放记录发放记录不存在或已删除"); + throw new ServiceException("发放记录发放记录不存在或已删除"); } if (!mjyFfjlOld.getJlzt().equals(JlztEnum.wsd.getValue())) { - throw new SecurityException("发放记录发放记录【" + mjyFfjlOld.getMc() + "】不是未锁定状态,不能锁定"); + throw new ServiceException("发放记录发放记录【" + mjyFfjlOld.getMc() + "】不是未锁定状态,不能锁定"); } mjyFfjlOld.setJlzt(JlztEnum.ysd.getValue()); this.updateById(mjyFfjlOld); @@ -380,14 +381,14 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } MjyFfjl mjyFfjlOld = this.getById(form.getId()); if (mjyFfjlOld == null) { - throw new SecurityException("发放记录发放记录不存在或已删除"); + throw new ServiceException("发放记录发放记录不存在或已删除"); } if (!mjyFfjlOld.getJlzt().equals(JlztEnum.ysd.getValue())) { - throw new SecurityException("发放记录发放记录【" + mjyFfjlOld.getMc() + "】不是已锁定状态,不能解锁"); + throw new ServiceException("发放记录发放记录【" + mjyFfjlOld.getMc() + "】不是已锁定状态,不能解锁"); } //点击解锁,状态更新为入库; mjyFfjlOld.setJlzt(JlztEnum.wsd.getValue()); @@ -409,7 +410,7 @@ public class MjyFfjlServiceImpl extends ServiceImpl impl public void gh(GhForm form, Mjy mjy, SysUser ghr1, SysUser ghr2, SysUser jsr1, SysUser jsr2) { MjyFfjl mjyFfjl = this.queryLastInfoByMjyId(mjy.getId()); if (mjyFfjl == null) { - throw new SecurityException("发放记录不存在或已删除"); + throw new ServiceException("发放记录不存在或已删除"); } mjyFfjl.setFfzytj(form.getGhzytj()); mjyFfjl.setRkwz(form.getRkwz()); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyJcgjServiceImpl.java index aa5de36..c36a22b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyJcgjServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hxhq.business.domain.GyzjJcgj; import com.hxhq.business.domain.MjyJcgj; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.StringUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.MjyJcgjMapper; @@ -31,7 +32,7 @@ public class MjyJcgjServiceImpl extends ServiceImpl impl public List queryList(MjyJcgj mjyJcgj){ QueryWrapper queryWrapper = Wrappers.query(); if(mjyJcgj.getMjyId()==null||mjyJcgj.getMjyId().longValue()<0){ - throw new SecurityException("麻精药id不能为空"); + throw new ServiceException("麻精药id不能为空"); } queryWrapper.eq("mjy_id",mjyJcgj.getMjyId()); if(mjyJcgj.getJcgjlx()!=null&&mjyJcgj.getJcgjlx().intValue()>0){ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java index 88c6e92..af26bee 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyServiceImpl.java @@ -14,6 +14,7 @@ import com.hxhq.business.form.mjy.*; import com.hxhq.business.service.*; import com.hxhq.business.utils.JctUtil; import com.hxhq.business.utils.ObjectCompareUtil; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.text.Convert; import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; @@ -92,7 +93,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS @Override public DetailDto queryInfo(Long id) { if (id == null || id.longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } return baseMapper.queryInfo(id); } @@ -108,14 +109,14 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.gd.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】未归档,不能解档"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】未归档,不能解档"); } //申请解档后,制剂状态更新为待解档,等待档案员审核期间无法进行其他操作; mjyOld.setZjzt(ZjztEnum.djd.getValue()); @@ -139,17 +140,17 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.gd.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是归档状态,不能借阅"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是归档状态,不能借阅"); } if (!mjyOld.getJyzt().equals(JyztEnum.wjy.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是未借阅状态,不能借阅"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是未借阅状态,不能借阅"); } //申请借阅后,借阅状态更新为待借阅,等待档案员审核期间无法进行其他操作; mjyOld.setJyzt(JyztEnum.djy.getValue()); @@ -177,7 +178,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -186,7 +187,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS if (mjyList.size() > 0) { for (Mjy mjy : mjyList) { if (!mjy.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("麻精药【" + mjy.getMc() + "】不是锁定状态,不能归档"); + throw new ServiceException("麻精药【" + mjy.getMc() + "】不是锁定状态,不能归档"); } } for (Mjy mjy : mjyList) { @@ -225,14 +226,14 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是锁定状态,不能归档"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是锁定状态,不能归档"); } //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; mjyOld.setZjzt(ZjztEnum.dgd.getValue()); @@ -257,7 +258,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -265,7 +266,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS List mjyList = this.list(queryWrapper); List mjyJcgjList = new ArrayList<>(); if (mjyList.size() <= 0) { - throw new SecurityException("麻精药不是入库状态,不能锁定"); + throw new ServiceException("麻精药不是入库状态,不能锁定"); } for (Mjy mjy : mjyList) { //锁定 @@ -305,14 +306,14 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是入库状态,不能锁定"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是入库状态,不能锁定"); } mjyOld.setZjzt(ZjztEnum.ysd.getValue()); this.updateById(mjyOld); @@ -336,14 +337,14 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是已锁定状态,不能解锁"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是已锁定状态,不能解锁"); } //点击解锁,状态更新为入库; mjyOld.setZjzt(ZjztEnum.rk.getValue()); @@ -373,7 +374,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS queryWrapper.eq("zjzt", ZjztEnum.rk.getValue()); List mjyList = this.list(queryWrapper); if (mjyList.size() <= 0) { - throw new SecurityException("麻精药不是入库状态,不能处置药剂"); + throw new ServiceException("麻精药不是入库状态,不能处置药剂"); } List mjyJcgjList = new ArrayList<>(); List mjyTzList = new ArrayList<>(); @@ -384,21 +385,21 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS if (mjyPlffItemFilter.size() > 0) { //region 验证 if (StringUtils.isBlank(mjyPlffItemFilter.get(0).getCzl())) { - throw new SecurityException("处置量不能为空"); + throw new ServiceException("处置量不能为空"); } BigDecimal czl = BigDecimal.ZERO; try { czl = new BigDecimal(mjyPlffItemFilter.get(0).getCzl()); } catch (Exception ex) { - throw new SecurityException("处置量填写不正确"); + throw new ServiceException("处置量填写不正确"); } //验证库存 BigDecimal kc = new BigDecimal(mjy.getKc()); if (kc.compareTo(BigDecimal.ZERO) <= 0) { - throw new SecurityException("麻精药【" + mjy.getMc() + "】库存不足,不能处置"); + throw new ServiceException("麻精药【" + mjy.getMc() + "】库存不足,不能处置"); } if (kc.compareTo(czl) < 0) { - throw new SecurityException("麻精药【" + mjy.getMc() + "】处置量大于库存量"); + throw new ServiceException("麻精药【" + mjy.getMc() + "】处置量大于库存量"); } mjy.setKc(kc.subtract(czl).toString()); //region 稽查轨迹 @@ -432,7 +433,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS mjyTzList.add(mjyTz); //endregion } else { - throw new SecurityException("麻精药【" + mjy.getMc() + "】不存在或已删除"); + throw new ServiceException("麻精药【" + mjy.getMc() + "】不存在或已删除"); } } this.saveOrUpdateBatch(mjyList); @@ -450,45 +451,45 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS @Transactional(rollbackFor = Exception.class) public void czyj( CzyjForm form) { if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } SysUser clr = sysUserService.selectUserById(form.getClrId()); if (clr == null) { - throw new SecurityException("处理人不存在"); + throw new ServiceException("处理人不存在"); } SysUser fhr = sysUserService.selectUserById(form.getFhrId()); if (fhr == null) { - throw new SecurityException("复核人不存在"); + throw new ServiceException("复核人不存在"); } SysUser jdr = sysUserService.selectUserById(form.getJdrId()); if (jdr == null) { - throw new SecurityException("监督人不存在"); + throw new ServiceException("监督人不存在"); } //验证处理人,复核人,监督人密码 todo Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是入库状态,不能处置药剂"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是入库状态,不能处置药剂"); } if (StringUtils.isBlank(form.getCzl())) { - throw new SecurityException("处置量不能为空"); + throw new ServiceException("处置量不能为空"); } BigDecimal czl = BigDecimal.ZERO; try { czl = new BigDecimal(form.getCzl()); } catch (Exception ex) { - throw new SecurityException("处置量填写不正确"); + throw new ServiceException("处置量填写不正确"); } //验证库存 BigDecimal kc = new BigDecimal(mjyOld.getKc()); if (kc.compareTo(BigDecimal.ZERO) <= 0) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】库存不足,不能处置"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】库存不足,不能处置"); } if (kc.compareTo(czl) < 0) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】处置量大于库存量"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】处置量大于库存量"); } //更新库存 mjyOld.setKc(kc.subtract(czl).toString()); @@ -527,19 +528,19 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS public void plczrq( PlczrqForm form) { SysUser clr = sysUserService.selectUserById(form.getClrId()); if (clr == null) { - throw new SecurityException("处理人不存在"); + throw new ServiceException("处理人不存在"); } SysUser fhr = sysUserService.selectUserById(form.getFhrId()); if (fhr == null) { - throw new SecurityException("复核人不存在"); + throw new ServiceException("复核人不存在"); } SysUser jdr = sysUserService.selectUserById(form.getJdrId()); if (jdr == null) { - throw new SecurityException("监督人不存在"); + throw new ServiceException("监督人不存在"); } //验证处理人,复核人,监督人密码 todo if (form.getIds().length < 0) { - throw new SecurityException("参数ids不正确"); + throw new ServiceException("参数ids不正确"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -550,7 +551,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS List mjyTzList = new ArrayList<>(); if (mjyList.size() <= 0) { - throw new SecurityException("麻精药已经处置过容器了,不能重复操作"); + throw new ServiceException("麻精药已经处置过容器了,不能重复操作"); } for (Mjy mjy : mjyList) { List mjyPlffItemFilter = form.getList().stream() @@ -590,7 +591,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS mjy.setRqzt(RqztEnum.ycz.getValue()); } else { - throw new SecurityException("麻精药【" + mjy.getMc() + "】不存在或已删除"); + throw new ServiceException("麻精药【" + mjy.getMc() + "】不存在或已删除"); } } @@ -609,29 +610,29 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS public void czrq( CzrqForm form) { SysUser clr = sysUserService.selectUserById(form.getClrId()); if (clr == null) { - throw new SecurityException("处理人不存在"); + throw new ServiceException("处理人不存在"); } SysUser fhr = sysUserService.selectUserById(form.getFhrId()); if (fhr == null) { - throw new SecurityException("复核人不存在"); + throw new ServiceException("复核人不存在"); } SysUser jdr = sysUserService.selectUserById(form.getJdrId()); if (jdr == null) { - throw new SecurityException("监督人不存在"); + throw new ServiceException("监督人不存在"); } //验证处理人,复核人,监督人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是入库状态,不能处置容器"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是入库状态,不能处置容器"); } if (!mjyOld.getRqzt().equals(RqztEnum.wcz.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】已经处置过容器了,不能重复操作"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】已经处置过容器了,不能重复操作"); } //region 稽查轨迹 Map formData = new LinkedHashMap<>(); @@ -668,7 +669,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS //验证领取人1,领取人2,发放人密码 todo Zcg zcg = zcgService.getById(form.getZcgId()); if (zcg == null) { - throw new SecurityException("暂存柜不存在或已删除"); + throw new ServiceException("暂存柜不存在或已删除"); } QueryWrapper queryWrapper = Wrappers.query(); queryWrapper.in("id", form.getIds()); @@ -676,7 +677,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS List mjyList = this.list(queryWrapper); List mjyJcgjList = new ArrayList<>(); if (mjyList.size() <= 0) { - throw new SecurityException("药剂已被发放,请不要重复发放"); + throw new ServiceException("药剂已被发放,请不要重复发放"); } String glyj = ""; for (Mjy mjy : mjyList) { @@ -730,14 +731,14 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS @Transactional(rollbackFor = Exception.class) public void ff( FfForm form) { if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是入库状态,不能发放"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是入库状态,不能发放"); } SysUser lqr1 = sysUserService.selectUserById(form.getLqr1Id()); SysUser lqr2 = sysUserService.selectUserById(form.getLqr2Id()); @@ -805,14 +806,14 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS List mjyJcgjList = new ArrayList<>(); List mjyTzList = new ArrayList<>(); if (mjyList.size() <= 0) { - throw new SecurityException("麻精药不是入库状态,不能发放"); + throw new ServiceException("麻精药不是入库状态,不能发放"); } Date now = new Date(); for (Mjy mjy : mjyList) { //验证库存 BigDecimal kc = new BigDecimal(mjy.getKc()); if (kc.compareTo(BigDecimal.ZERO) <= 0) { - throw new SecurityException("麻精药【" + mjy.getMc() + "】库存不足,不能发放"); + throw new ServiceException("麻精药【" + mjy.getMc() + "】库存不足,不能发放"); } List plffItemFilter = form.getList().stream() .filter(p -> p.getId().equals(mjy.getId())) @@ -868,7 +869,7 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS mjy.setZjzt(ZjztEnum.yff.getValue()); //endregion } else { - throw new SecurityException("麻精药【" + mjy.getMc() + "】不存在或已删除"); + throw new ServiceException("麻精药【" + mjy.getMc() + "】不存在或已删除"); } } mjyJcgjService.saveBatch(mjyJcgjList); @@ -887,23 +888,23 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getBjzt().equals(BjEnum.wbj.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】已经提交编辑申请,请等待审核"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】已经提交编辑申请,请等待审核"); } if (!(mjyOld.getZjzt().equals(ZjztEnum.rk.getValue()) || mjyOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是入库或已发放状态,不能编辑"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是入库或已发放状态,不能编辑"); } List mjyJcgjList = new ArrayList<>(); List fieldChanges = ObjectCompareUtil.compareObjects(mjyOld, form); if (fieldChanges.size() == 0) { - throw new SecurityException("你没有修改任何内容"); + throw new ServiceException("你没有修改任何内容"); } for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { MjyJcgj mjyJcgj = new MjyJcgj(); @@ -942,17 +943,17 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getBjzt().equals(BjEnum.shz.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】没有提交编辑申请,不能审核编辑"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】没有提交编辑申请,不能审核编辑"); } if (!(mjyOld.getZjzt().equals(ZjztEnum.rk.getValue()) || mjyOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是入库或已发放状态,不能审核编辑"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是入库或已发放状态,不能审核编辑"); } //region 稽查轨迹 MjyJcgj mjyJcgj = new MjyJcgj(); @@ -1010,21 +1011,21 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getKcbjzt().equals(KcbjEnum.wbj.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】已经提交修改库存申请,请等待审核"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】已经提交修改库存申请,请等待审核"); } if (!(mjyOld.getZjzt().equals(ZjztEnum.rk.getValue()) || mjyOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是入库或已发放状态,不能修改库存"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是入库或已发放状态,不能修改库存"); } List fieldChanges = ObjectCompareUtil.compareObjects(mjyOld, form); if (fieldChanges.size() == 0) { - throw new SecurityException("你没有修改任何内容"); + throw new ServiceException("你没有修改任何内容"); } List mjyJcgjList = new ArrayList<>(); //region 稽查轨迹 @@ -1064,17 +1065,17 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getKcbjzt().equals(KcbjEnum.shz.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】没有提交修改库存申请,不能审核修改库存"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】没有提交修改库存申请,不能审核修改库存"); } if (!(mjyOld.getZjzt().equals(ZjztEnum.rk.getValue()) || mjyOld.getZjzt().equals(ZjztEnum.yff.getValue()))) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是入库或已发放状态,不能审核修改库存"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是入库或已发放状态,不能审核修改库存"); } //region 稽查轨迹 MjyJcgj mjyJcgj = new MjyJcgj(); @@ -1132,19 +1133,19 @@ public class MjyServiceImpl extends ServiceImpl implements IMjyS SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证密码 todo if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); + throw new ServiceException("参数id不正确"); } Mjy mjyOld = this.getById(form.getId()); if (mjyOld == null) { - throw new SecurityException("麻精药不存在或已删除"); + throw new ServiceException("麻精药不存在或已删除"); } if (!mjyOld.getZjzt().equals(ZjztEnum.yff.getValue())) { - throw new SecurityException("麻精药【" + mjyOld.getMc() + "】不是已发放状态,不能归还"); + throw new ServiceException("麻精药【" + mjyOld.getMc() + "】不是已发放状态,不能归还"); } BigDecimal kc = new BigDecimal(mjyOld.getKc()); BigDecimal syl = new BigDecimal(form.getSyl()); if (syl.compareTo(kc) > 0) { - throw new SecurityException("使用量不能大于出库量"); + throw new ServiceException("使用量不能大于出库量"); } BigDecimal leftKc = new BigDecimal(mjyOld.getKc()).subtract(new BigDecimal(form.getSyl())); mjyFfjlService.gh(form,mjyOld,ghr1,ghr2,jsr1,jsr2); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyTzServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyTzServiceImpl.java index f706028..8b0e9a4 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyTzServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/MjyTzServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hxhq.business.domain.MjyJcgj; +import com.hxhq.common.core.exception.ServiceException; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.MjyTzMapper; import com.hxhq.business.domain.MjyTz; @@ -29,7 +30,7 @@ public class MjyTzServiceImpl extends ServiceImpl implements public List queryList(MjyTz mjyTz){ QueryWrapper queryWrapper = Wrappers.query(); if(mjyTz.getMjyId()==null||mjyTz.getMjyId().longValue()<0){ - throw new SecurityException("麻精药id不能为空"); + throw new ServiceException("麻精药id不能为空"); } queryWrapper.eq("mjy_id",mjyTz.getMjyId()); queryWrapper.orderByDesc("id"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreJcgjServiceImpl.java index d5c7680..c560d1f 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreJcgjServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hxhq.business.domain.MjyJcgj; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import org.springframework.stereotype.Service; @@ -30,7 +31,7 @@ public class StudyFormPreJcgjServiceImpl extends ServiceImpl queryList(StudyFormPreJcgj studyFormPreJcgj){ QueryWrapper queryWrapper = Wrappers.query(); if(studyFormPreJcgj.getFormId()==null||studyFormPreJcgj.getFormId().longValue()<0){ - throw new SecurityException("表单id不能为空"); + throw new ServiceException("表单id不能为空"); } queryWrapper.eq("form_id",studyFormPreJcgj.getFormId()); if(studyFormPreJcgj.getJcgjlx()!=null&&studyFormPreJcgj.getJcgjlx().intValue()>0){ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreQmxxServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreQmxxServiceImpl.java index 32f0531..65937ed 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreQmxxServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreQmxxServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hxhq.business.domain.StudyFormPreJcgj; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.StringUtils; import org.springframework.stereotype.Service; @@ -32,7 +33,7 @@ public class StudyFormPreQmxxServiceImpl extends ServiceImpl queryWrapper = Wrappers.query(); if(studyFormPreQmxx.getFormId()==null||studyFormPreQmxx.getFormId().longValue()<0){ - throw new SecurityException("表单id不能为空"); + throw new ServiceException("表单id不能为空"); } queryWrapper.eq("form_id",studyFormPreQmxx.getFormId()); queryWrapper.orderByDesc("id"); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreServiceImpl.java index 9d40943..7518661 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPreServiceImpl.java @@ -18,6 +18,7 @@ import com.hxhq.business.form.study.StudyFormPreSearchForm; import com.hxhq.business.service.IStudyFormPreJcgjService; import com.hxhq.business.service.IStudyFormPreQmxxService; import com.hxhq.business.utils.JctUtil; +import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -88,10 +89,10 @@ public class StudyFormPreServiceImpl extends ServiceImpl