diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java index 87004da..6ef167c 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java @@ -2,7 +2,6 @@ package com.flossom.common.core.domain.entity; import java.time.LocalDateTime; import java.time.LocalTime; -import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import com.flossom.common.core.web.domain.BaseEntity; diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentFileRelate.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentFileRelate.java new file mode 100644 index 0000000..6d96eee --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentFileRelate.java @@ -0,0 +1,128 @@ +package com.flossom.common.core.domain.entity; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 仪器关联文件信息对象 wx_instrument_file_relate + * + * @author flossom + * @date 2024-01-10 + */ +public class WxInstrumentFileRelate extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + + /** + * 分类(1、初次护理、2、仪器介绍规则) + */ + @Excel(name = "分类", readConverterExp = "1=、初次护理、2、仪器介绍规则") + private Integer classify; + + /** + * 仪器id + */ + @Excel(name = "仪器id") + private Long instrumentId; + + /** + * 文件地址 + */ + @Excel(name = "文件地址") + private String file; + + /** + * 文件类型 + */ + @Excel(name = "文件类型") + private String fileType; + + /** + * 内容 + */ + @Excel(name = "内容") + private String message; + + /** + * 状态(0正常 1停用) + */ + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private Long status; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setClassify(Integer classify) { + this.classify = classify; + } + + public Integer getClassify() { + return classify; + } + + public void setInstrumentId(Long instrumentId) { + this.instrumentId = instrumentId; + } + + public Long getInstrumentId() { + return instrumentId; + } + + public void setFile(String file) { + this.file = file; + } + + public String getFile() { + return file; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } + + public String getFileType() { + return fileType; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setStatus(Long status) { + this.status = status; + } + + public Long getStatus() { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("classify", getClassify()) + .append("instrumentId", getInstrumentId()) + .append("file", getFile()) + .append("fileType", getFileType()) + .append("message", getMessage()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java index 335ab96..c7638d4 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java @@ -1,16 +1,13 @@ package com.flossom.common.core.domain.req; import com.fasterxml.jackson.annotation.JsonFormat; -import com.flossom.common.core.web.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; +import com.flossom.common.core.domain.entity.WxInstrumentFileRelate; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; import java.time.LocalTime; -import java.util.Date; import java.util.List; /** @@ -91,6 +88,17 @@ public class WxInstrumentSaveReq { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private List extraClockTimeRange; + + /** + * 标签ID(xxxx,xxxx,xxx) + */ + private String miniTagIds; + + /** + * 标签ID(xxxx,xxxx,xxx) + */ + private String wecomTagIds; + /** * 场景ID(xxxx,xxxx,xxx) */ @@ -170,6 +178,17 @@ public class WxInstrumentSaveReq { */ private String scanCodeBinding; + + /** + * 初次护理介绍视频/图片 + */ + private List nurseList; + + /** + * 仪器介绍规则 + */ + private List introduceList; + public Long getId() { return id; } @@ -385,4 +404,36 @@ public class WxInstrumentSaveReq { public void setScanCodeBinding(String scanCodeBinding) { this.scanCodeBinding = scanCodeBinding; } + + public List getNurseList() { + return nurseList; + } + + public void setNurseList(List nurseList) { + this.nurseList = nurseList; + } + + public List getIntroduceList() { + return introduceList; + } + + public void setIntroduceList(List introduceList) { + this.introduceList = introduceList; + } + + public String getMiniTagIds() { + return miniTagIds; + } + + public void setMiniTagIds(String miniTagIds) { + this.miniTagIds = miniTagIds; + } + + public String getWecomTagIds() { + return wecomTagIds; + } + + public void setWecomTagIds(String wecomTagIds) { + this.wecomTagIds = wecomTagIds; + } } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/enums/InstrumentFileClassify.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/enums/InstrumentFileClassify.java new file mode 100644 index 0000000..f030c06 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/enums/InstrumentFileClassify.java @@ -0,0 +1,27 @@ +package com.flossom.common.core.enums; + +/** + * wx_instrument_file_relate: classify + * 分类(1、初次护理、2、仪器介绍规则) + * + * @author flossom + */ +public enum InstrumentFileClassify { + FIRST_NURSE(1, "初次护理"), INSTRUMENT_INSTRUCTION(2, "仪器介绍"); + + private final Integer code; + private final String info; + + InstrumentFileClassify(Integer code, String info) { + this.code = code; + this.info = info; + } + + public Integer getCode() { + return code; + } + + public String getInfo() { + return info; + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentFileRelateMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentFileRelateMapper.java new file mode 100644 index 0000000..d323b80 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentFileRelateMapper.java @@ -0,0 +1,72 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.WxInstrumentFileRelate; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + +/** + * 仪器关联文件信息Mapper接口 + * + * @author flossom + * @date 2024-01-10 + */ +public interface WxInstrumentFileRelateMapper { + /** + * 查询仪器关联文件信息 + * + * @param id 仪器关联文件信息主键 + * @return 仪器关联文件信息 + */ + public WxInstrumentFileRelate selectWxInstrumentFileRelateById(Long id); + + /** + * 查询仪器关联文件信息列表 + * + * @param wxInstrumentFileRelate 仪器关联文件信息 + * @return 仪器关联文件信息集合 + */ + public List selectWxInstrumentFileRelateList(WxInstrumentFileRelate wxInstrumentFileRelate); + + /** + * 新增仪器关联文件信息 + * + * @param wxInstrumentFileRelate 仪器关联文件信息 + * @return 结果 + */ + public int insertWxInstrumentFileRelate(WxInstrumentFileRelate wxInstrumentFileRelate); + + /** + * 修改仪器关联文件信息 + * + * @param wxInstrumentFileRelate 仪器关联文件信息 + * @return 结果 + */ + public int updateWxInstrumentFileRelate(WxInstrumentFileRelate wxInstrumentFileRelate); + + /** + * 删除仪器关联文件信息 + * + * @param id 仪器关联文件信息主键 + * @return 结果 + */ + public int deleteWxInstrumentFileRelateById(Long id); + + /** + * 批量删除仪器关联文件信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxInstrumentFileRelateByIds(Long[] ids); + + /** + * 删除仪器关联文件信息 + * + * @return 结果 + */ + public int deleteByInstrumentIdAndClassify(@Param("instrumentId") Long instrumentId, @Param("classify") Integer classify); + + public List selectByInstrumentIdAndClassify(@Param("instrumentId") Long instrumentId, @Param("classify") Integer classify); +} diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentFileRelateMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentFileRelateMapper.xml new file mode 100644 index 0000000..b045634 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentFileRelateMapper.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + select id, classify, instrument_id, file, file_type, message, status, create_by, create_time from wx_instrument_file_relate + + + + + + + + + insert into wx_instrument_file_relate + + classify, + instrument_id, + file, + file_type, + message, + status, + create_by, + create_time, + + + #{classify}, + #{instrumentId}, + #{file}, + #{fileType}, + #{message}, + #{status}, + #{createBy}, + #{createTime}, + + + + + update wx_instrument_file_relate + + classify = #{classify}, + instrument_id = #{instrumentId}, + file = #{file}, + file_type = #{fileType}, + message = #{message}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from wx_instrument_file_relate where id = #{id} + + + + delete from wx_instrument_file_relate where id in + + #{id} + + + + + + delete from wx_instrument_file_relate where instrument_id = #{instrumentId} and classify = #{classify} + + \ No newline at end of file diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml index e8e048f..6df2ceb 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml @@ -104,6 +104,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + SELECT LAST_INSERT_ID() + insert into wx_instrument name, diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java index 489568b..8c4ac47 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java @@ -56,7 +56,7 @@ public class WxInstrumentController extends BaseController { @RequiresPermissions("system:instrument:query") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(wxInstrumentService.selectWxInstrumentById(id)); + return success(wxInstrumentService.selectWxInstrumentReqById(id)); } /** @@ -97,12 +97,7 @@ public class WxInstrumentController extends BaseController { wxInstrumentSaveReq.setShoppingAppid(null); wxInstrumentSaveReq.setShoppingPath(null); } - WxInstrument wxInstrument = new WxInstrument(); - BeanUtils.copyProperties(wxInstrumentSaveReq, wxInstrument); - wxInstrument.setStartTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(0)); - wxInstrument.setEndTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(1)); - wxInstrument.setCreateBy(SecurityUtils.getUsername()); - return toAjax(wxInstrumentService.insertWxInstrument(wxInstrument)); + return toAjax(wxInstrumentService.addWxInstrument(wxInstrumentSaveReq)); } /** @@ -111,8 +106,8 @@ public class WxInstrumentController extends BaseController { @RequiresPermissions("system:instrument:edit") @Log(title = "仪器列", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody WxInstrument wxInstrument) { - return toAjax(wxInstrumentService.updateWxInstrument(wxInstrument)); + public AjaxResult edit(@RequestBody WxInstrumentSaveReq wxInstrumentSaveReq) { + return toAjax(wxInstrumentService.updateWxInstrument(wxInstrumentSaveReq)); } /** diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentService.java index 5f26939..67bcf48 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentService.java @@ -2,6 +2,7 @@ package com.flossom.system.service; import com.flossom.common.core.domain.entity.WxInstrument; import com.flossom.common.core.domain.req.WxInstrumentReq; +import com.flossom.common.core.domain.req.WxInstrumentSaveReq; import java.util.List; @@ -44,14 +45,6 @@ public interface IWxInstrumentService { */ public int insertWxInstrument(WxInstrument wxInstrument); - /** - * 修改仪器列 - * - * @param wxInstrument 仪器列 - * @return 结果 - */ - public int updateWxInstrument(WxInstrument wxInstrument); - /** * 批量删除仪器列 * @@ -67,4 +60,15 @@ public interface IWxInstrumentService { * @return 结果 */ public int deleteWxInstrumentById(Long id); + + int addWxInstrument(WxInstrumentSaveReq wxInstrumentSaveReq); + + /** + * 修改仪器列 + * + * @return 结果 + */ + int updateWxInstrument(WxInstrumentSaveReq wxInstrumentSaveReq); + + WxInstrumentSaveReq selectWxInstrumentReqById(Long id); } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java index 5d545ff..e15ba5b 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java @@ -1,17 +1,26 @@ package com.flossom.system.service.impl; import java.util.Arrays; +import java.util.Iterator; import java.util.List; import com.flossom.common.core.domain.entity.SysTag; import com.flossom.common.core.domain.entity.WxInstrument; +import com.flossom.common.core.domain.entity.WxInstrumentFileRelate; import com.flossom.common.core.domain.req.WxInstrumentReq; +import com.flossom.common.core.domain.req.WxInstrumentSaveReq; +import com.flossom.common.core.enums.InstrumentFileClassify; import com.flossom.common.core.mapper.SysTagMapper; +import com.flossom.common.core.mapper.WxInstrumentFileRelateMapper; import com.flossom.common.core.mapper.WxInstrumentMapper; import com.flossom.common.core.utils.DateUtils; +import com.flossom.common.core.utils.StringUtils; +import com.flossom.common.security.utils.SecurityUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.flossom.system.service.IWxInstrumentService; +import org.springframework.transaction.annotation.Transactional; /** * 仪器列Service业务层处理 @@ -28,6 +37,9 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Autowired private SysTagMapper sysTagMapper; + @Autowired + private WxInstrumentFileRelateMapper wxInstrumentFileRelateMapper; + /** * 查询仪器列 * @@ -39,6 +51,32 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { return wxInstrumentMapper.selectWxInstrumentById(id); } + /** + * 查询仪器列 + * + * @param id 仪器列主键 + * @return 仪器列 + */ + @Override + public WxInstrumentSaveReq selectWxInstrumentReqById(Long id) { + WxInstrument wxInstrument = wxInstrumentMapper.selectWxInstrumentById(id); + WxInstrumentSaveReq wxInstrumentSaveReq = new WxInstrumentSaveReq(); + BeanUtils.copyProperties(wxInstrument, wxInstrumentSaveReq); + // 时间范围 + if (wxInstrument.getStartTime() != null && wxInstrument.getEndTime() != null) { + wxInstrumentSaveReq.setExtraClockTimeRange(Arrays.asList(wxInstrument.getStartTime(), wxInstrument.getEndTime())); + } + // 获取护理弹窗关联 + List firstNurseRelate = wxInstrumentFileRelateMapper. + selectByInstrumentIdAndClassify(wxInstrument.getId(), InstrumentFileClassify.FIRST_NURSE.getCode()); + wxInstrumentSaveReq.setNurseList(firstNurseRelate); + // 获取护理弹窗关联 + List instructionRelate = wxInstrumentFileRelateMapper. + selectByInstrumentIdAndClassify(wxInstrument.getId(), InstrumentFileClassify.INSTRUMENT_INSTRUCTION.getCode()); + wxInstrumentSaveReq.setIntroduceList(instructionRelate); + return wxInstrumentSaveReq; + } + /** * 查询仪器列列表 * @@ -67,17 +105,72 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { return wxInstrumentMapper.insertWxInstrument(wxInstrument); } + /** + * 新增仪器列 + * + * @return 结果 + */ + @Override + @Transactional + public int addWxInstrument(WxInstrumentSaveReq wxInstrumentSaveReq) { + WxInstrument wxInstrument = new WxInstrument(); + BeanUtils.copyProperties(wxInstrumentSaveReq, wxInstrument); + // 打卡时间处理 + wxInstrument.setStartTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(0)); + wxInstrument.setEndTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(1)); + wxInstrument.setCreateBy(SecurityUtils.getUsername()); + wxInstrument.setCreateTime(DateUtils.getNowDate()); + + int i = wxInstrumentMapper.insertWxInstrument(wxInstrument); + + // 保存初次护理规则 + List nurseList = wxInstrumentSaveReq.getNurseList(); + if (nurseList != null && nurseList.size() > 0) { + Iterator nurseIterator = nurseList.iterator(); + while (nurseIterator.hasNext()) { + WxInstrumentFileRelate next = nurseIterator.next(); + if (StringUtils.isBlank(next.getFile())) { + nurseIterator.remove(); + continue; + } + next.setInstrumentId(wxInstrument.getId()); + next.setClassify(InstrumentFileClassify.FIRST_NURSE.getCode()); + wxInstrumentFileRelateMapper.insertWxInstrumentFileRelate(next); + } + } + + // 保存仪器介绍规则 + List introduceList = wxInstrumentSaveReq.getIntroduceList(); + if (introduceList != null && introduceList.size() > 0) { + Iterator introduceIterator = introduceList.iterator(); + while (introduceIterator.hasNext()) { + WxInstrumentFileRelate next = introduceIterator.next(); + if (StringUtils.isBlank(next.getFile())) { + introduceIterator.remove(); + continue; + } + next.setInstrumentId(wxInstrument.getId()); + next.setClassify(InstrumentFileClassify.INSTRUMENT_INSTRUCTION.getCode()); + wxInstrumentFileRelateMapper.insertWxInstrumentFileRelate(next); + } + } + return i; + } + /** * 修改仪器列 * - * @param wxInstrument 仪器列 + * @param wxInstrumentSaveReq 仪器列 * @return 结果 */ @Override - public int updateWxInstrument(WxInstrument wxInstrument) { + public int updateWxInstrument(WxInstrumentSaveReq wxInstrumentSaveReq) { + WxInstrument wxInstrument = new WxInstrument(); + BeanUtils.copyProperties(wxInstrumentSaveReq, wxInstrument); + // 处理小程序标签和企微标签 - if (wxInstrument.getMiniTagIds() != null) { - List tagIdList = Arrays.asList(wxInstrument.getMiniTagIds().split(",")); + if (wxInstrumentSaveReq.getMiniTagIds() != null) { + List tagIdList = Arrays.asList(wxInstrumentSaveReq.getMiniTagIds().split(",")); StringBuilder tagNames = new StringBuilder(); for (int i = 0; i < tagIdList.size(); i++) { SysTag sysTag = sysTagMapper.selectDeptById(Long.valueOf(tagIdList.get(i))); @@ -87,9 +180,12 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { } } wxInstrument.setMiniTagNames(tagNames.toString()); + } else { + wxInstrument.setMiniTagNames(null); } - if (wxInstrument.getWecomTagIds() != null) { - List tagIdList = Arrays.asList(wxInstrument.getWecomTagIds().split(",")); + + if (wxInstrumentSaveReq.getWecomTagIds() != null) { + List tagIdList = Arrays.asList(wxInstrumentSaveReq.getWecomTagIds().split(",")); StringBuilder tagNames = new StringBuilder(); for (int i = 0; i < tagIdList.size(); i++) { SysTag sysTag = sysTagMapper.selectDeptById(Long.valueOf(tagIdList.get(i))); @@ -99,15 +195,55 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { } } wxInstrument.setWecomTagNames(tagNames.toString()); + } else { + wxInstrument.setWecomTagNames(null); } wxInstrument.setUpdateTime(DateUtils.getNowDate()); + + // 打卡时间处理 + wxInstrument.setStartTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(0)); + wxInstrument.setEndTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(1)); + + // 保存初次护理规则 + List nurseList = wxInstrumentSaveReq.getNurseList(); + wxInstrumentFileRelateMapper.deleteByInstrumentIdAndClassify(wxInstrumentSaveReq.getId(), + InstrumentFileClassify.FIRST_NURSE.getCode()); + if (nurseList != null && nurseList.size() > 0) { + Iterator nurseIterator = nurseList.iterator(); + while (nurseIterator.hasNext()) { + WxInstrumentFileRelate next = nurseIterator.next(); + if (StringUtils.isBlank(next.getFile())) { + nurseIterator.remove(); + continue; + } + next.setInstrumentId(wxInstrument.getId()); + next.setClassify(InstrumentFileClassify.FIRST_NURSE.getCode()); + wxInstrumentFileRelateMapper.insertWxInstrumentFileRelate(next); + } + } + + // 保存仪器介绍规则 + wxInstrumentFileRelateMapper.deleteByInstrumentIdAndClassify(wxInstrumentSaveReq.getId(), + InstrumentFileClassify.INSTRUMENT_INSTRUCTION.getCode()); + List introduceList = wxInstrumentSaveReq.getIntroduceList(); + Iterator introduceIterator = introduceList.iterator(); + while (introduceIterator.hasNext()) { + WxInstrumentFileRelate next = introduceIterator.next(); + if (StringUtils.isBlank(next.getFile())) { + introduceIterator.remove(); + continue; + } + next.setInstrumentId(wxInstrument.getId()); + next.setClassify(InstrumentFileClassify.INSTRUMENT_INSTRUCTION.getCode()); + wxInstrumentFileRelateMapper.insertWxInstrumentFileRelate(next); + } + return wxInstrumentMapper.updateWxInstrument(wxInstrument); } /** * 批量删除仪器列 * - * @param ids 需要删除的仪器列主键 * @return 结果 */ @Override diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index 9a8e558..6c970b8 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -1,1554 +1,1596 @@