|
@@ -98,20 +98,18 @@ public class QcTypeFacade extends QcTypeServiceImpl {
|
|
|
* @param cancelTypeVO
|
|
|
*/
|
|
|
public RespDTO getOrCancel(CancelTypeVO cancelTypeVO) {
|
|
|
- QcType qcType = new QcType();
|
|
|
- List<QcType> parentList = new ArrayList<>();
|
|
|
//修改和删除都会触发操作
|
|
|
- if (cancelTypeVO.getId() != null&& null == cancelTypeVO.getCancel()) {
|
|
|
//子类判断关联关系
|
|
|
- qcType = this.getOne(new QueryWrapper<QcType>()
|
|
|
- .eq("hospital_id", cancelTypeVO.getHospitalId())
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("id", cancelTypeVO.getId()));
|
|
|
+ QcType qcType = this.getOne(new QueryWrapper<QcType>()
|
|
|
+ .eq("hospital_id", cancelTypeVO.getHospitalId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("id", cancelTypeVO.getId()));
|
|
|
//父类判断关联关系
|
|
|
- parentList = this.list(new QueryWrapper<QcType>()
|
|
|
- .eq("hospital_id", cancelTypeVO.getHospitalId())
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("parent_type_id", cancelTypeVO.getId()));
|
|
|
+ List<QcType> parentList= this.list(new QueryWrapper<QcType>()
|
|
|
+ .eq("hospital_id", cancelTypeVO.getHospitalId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("parent_type_id", cancelTypeVO.getId()));
|
|
|
+ if (cancelTypeVO.getId() != null&& null == cancelTypeVO.getCancel()) {
|
|
|
//子类存在关联 一对一给出提示
|
|
|
if (null != qcType.getParentTypeId()) {
|
|
|
QcType qcTypeMain= this.getOne(new QueryWrapper<QcType>()
|
|
@@ -132,7 +130,7 @@ public class QcTypeFacade extends QcTypeServiceImpl {
|
|
|
//如果父类关联子类,同样提示
|
|
|
}
|
|
|
//删除关联状态
|
|
|
- if(1 == cancelTypeVO.getCancel()){
|
|
|
+ if(cancelTypeVO.getCancel() != null && 1 == cancelTypeVO.getCancel()){
|
|
|
//子类存在关联 一对一删除
|
|
|
if (null != qcType.getParentTypeId()) {
|
|
|
this.update(new UpdateWrapper<QcType>()
|