|
@@ -125,6 +125,7 @@ public class QcTypeFacade extends QcTypeServiceImpl {
|
|
if (qcTypeSaveVO.getId() != null) {
|
|
if (qcTypeSaveVO.getId() != null) {
|
|
qcType = this.getOne(new QueryWrapper<QcType>()
|
|
qcType = this.getOne(new QueryWrapper<QcType>()
|
|
.eq("id", id)
|
|
.eq("id", id)
|
|
|
|
+ .eq("hospital_id", qcTypeSaveVO.getHospitalId())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()), false);
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()), false);
|
|
if (qcType == null) { //校验
|
|
if (qcType == null) { //校验
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前质控类型不存在【id=" + id + "】");
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前质控类型不存在【id=" + id + "】");
|
|
@@ -194,8 +195,10 @@ public class QcTypeFacade extends QcTypeServiceImpl {
|
|
*/
|
|
*/
|
|
public QcTypeDTO getById(QcTypeVO qcTypeVO) {
|
|
public QcTypeDTO getById(QcTypeVO qcTypeVO) {
|
|
QcTypeDTO qcTypeDTO = new QcTypeDTO();
|
|
QcTypeDTO qcTypeDTO = new QcTypeDTO();
|
|
|
|
+ qcTypeDTO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
|
|
QcType qcType = this.getOne(new QueryWrapper<QcType>()
|
|
QcType qcType = this.getOne(new QueryWrapper<QcType>()
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", qcTypeVO.getHospitalId())
|
|
.eq("id", qcTypeVO.getId()), false
|
|
.eq("id", qcTypeVO.getId()), false
|
|
);
|
|
);
|
|
if (qcType == null) {
|
|
if (qcType == null) {
|
|
@@ -219,14 +222,19 @@ public class QcTypeFacade extends QcTypeServiceImpl {
|
|
Date now = DateUtil.now();
|
|
Date now = DateUtil.now();
|
|
String person = SysUserUtils.getCurrentPrincipleID();
|
|
String person = SysUserUtils.getCurrentPrincipleID();
|
|
// 更新主表
|
|
// 更新主表
|
|
- this.update(new UpdateWrapper<QcType>()
|
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
- .in("id", deleteQcTypeVO.getIds())
|
|
|
|
- .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
|
- .set("gmt_modified", now)
|
|
|
|
- .set("modifier", person)
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
|
|
+ Boolean res =
|
|
|
|
+ this.update(new UpdateWrapper<QcType>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
|
|
|
|
+ .in("id", deleteQcTypeVO.getIds())
|
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
|
+ .set("gmt_modified", now)
|
|
|
|
+ .set("modifier", person)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ if (!res){
|
|
|
|
+ throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
|
|
|
|
+ }
|
|
// 删除明细表
|
|
// 删除明细表
|
|
qcTypeCasesEntryService.removeByIds(deleteQcTypeVO.getIds());
|
|
qcTypeCasesEntryService.removeByIds(deleteQcTypeVO.getIds());
|
|
if (ListUtil.isNotEmpty(deleteQcTypeVO.getIds())) {
|
|
if (ListUtil.isNotEmpty(deleteQcTypeVO.getIds())) {
|