diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxModeController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxModeController.java index b6b37a8..0d959e3 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxModeController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxModeController.java @@ -6,11 +6,8 @@ import java.util.stream.Collectors; import javax.servlet.http.HttpServletResponse; import com.alibaba.nacos.common.utils.CollectionUtils; -import com.flossom.common.core.domain.entity.SysTag; +import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.R; -import com.flossom.common.core.domain.entity.WxMode; -import com.flossom.common.core.domain.entity.WxModeCombineInfo; -import com.flossom.common.core.domain.entity.WxModeTag; import com.flossom.common.core.enums.TagTypeStatusEnum; import com.flossom.common.core.utils.poi.ExcelUtil; import com.flossom.common.core.web.controller.BaseController; @@ -19,9 +16,7 @@ import com.flossom.common.core.web.page.TableDataInfo; import com.flossom.common.log.annotation.Log; import com.flossom.common.log.enums.BusinessType; import com.flossom.common.security.annotation.RequiresPermissions; -import com.flossom.system.service.ISysTagService; -import com.flossom.system.service.IWxModeCombineInfoService; -import com.flossom.system.service.IWxModeTagService; +import com.flossom.system.service.*; import org.apache.commons.compress.utils.Lists; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -32,7 +27,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.flossom.system.service.IWxModeService; /** * 模式列表Controller @@ -52,6 +46,8 @@ public class WxModeController extends BaseController private ISysTagService sysTagService; @Autowired private IWxModeCombineInfoService wxModeCombineInfoService; + @Autowired + private IWxInstrumentModeService wxInstrumentModeService; /** * 查询模式列表列表 */ @@ -169,7 +165,20 @@ public class WxModeController extends BaseController } } if (delFlag) { - return error("删除的组合已经被占用,不支持删除"); + return error("删除的模式已经被组合占用,不支持删除"); + } + // 查看仪器是否被占用 + Boolean delInstrumentFlag = false; + for (long id : ids) { + WxInstrumentMode wxInstrumentMode = new WxInstrumentMode(); + wxInstrumentMode.setModeId(id); + List wxInstrumentModes = wxInstrumentModeService.selectWxInstrumentModeList(wxInstrumentMode); + if (CollectionUtils.isNotEmpty(wxInstrumentModes)) { + delInstrumentFlag = true; + } + } + if (delInstrumentFlag) { + return error("删除的模式已经被仪器占用,不支持删除"); } return toAjax(wxModeService.deleteWxModeByIds(ids)); } diff --git a/flossom-ui/src/views/system/mode/index.vue b/flossom-ui/src/views/system/mode/index.vue index 1769370..81b857a 100644 --- a/flossom-ui/src/views/system/mode/index.vue +++ b/flossom-ui/src/views/system/mode/index.vue @@ -291,7 +291,7 @@ - + 添加
@@ -727,6 +727,9 @@ export default { serverImageFlag = true; } }) + } else { + this.$message.error("护理内容不能为空"); + return; } if (flag) { this.$message.error("护理时间不能为空");