diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java index f44b662..0c22650 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java @@ -42,6 +42,8 @@ public class WxInstrumentInstructions extends BaseEntity { */ private String nameUrl; + private boolean isSave = true; + /** * 状态(0正常 1停用) */ @@ -96,6 +98,14 @@ public class WxInstrumentInstructions extends BaseEntity { this.nameUrl = nameUrl; } + public boolean isSave() { + return isSave; + } + + public void setSave(boolean save) { + isSave = save; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentInstructionsMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentInstructionsMapper.xml index 7cf35ab..26418de 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentInstructionsMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentInstructionsMapper.xml @@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and name like concat('%', #{name}, '%') and link = #{link} and status = #{status} + and id != #{id} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java index 349ec03..85daf0a 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java @@ -3,6 +3,8 @@ package com.flossom.system.service.impl; import java.util.List; import com.flossom.common.core.domain.entity.WxInstrumentInstructions; +import com.flossom.common.core.enums.Status; +import com.flossom.common.core.exception.ServiceException; import com.flossom.common.core.mapper.WxInstrumentInstructionsMapper; import com.flossom.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -66,6 +68,13 @@ public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstruc @Override public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) { wxInstrumentInstructions.setCreateTime(DateUtils.getNowDate()); + WxInstrumentInstructions query = new WxInstrumentInstructions(); + query.setName(wxInstrumentInstructions.getName()); + query.setStatus(Status.OK.getCode().longValue()); + List instructions = wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(query); + if(instructions != null && instructions.size() > 0) { + throw new ServiceException("不允许填写相同的说明书类型"); + } return wxInstrumentInstructionsMapper.insertWxInstrumentInstructions(wxInstrumentInstructions); } @@ -77,6 +86,14 @@ public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstruc */ @Override public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) { + WxInstrumentInstructions query = new WxInstrumentInstructions(); + query.setId(wxInstrumentInstructions.getId()); + query.setName(wxInstrumentInstructions.getName()); + query.setStatus(Status.OK.getCode().longValue()); + List instructions = wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(query); + if(instructions != null && instructions.size() > 0) { + throw new ServiceException("不允许填写相同的说明书类型"); + } return wxInstrumentInstructionsMapper.updateWxInstrumentInstructions(wxInstrumentInstructions); } diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index c034de4..084b0f2 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -1191,6 +1191,7 @@ :on-error="uploadError" :file-list="scope.row.fileList" accept=".pdf,.PDF" + :before-upload="pdfHandleBeforeUpload" > 点击上传 @@ -1199,14 +1200,14 @@