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 28ec5fb..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,14 +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业务层处理 @@ -22,6 +34,12 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Autowired private WxInstrumentMapper wxInstrumentMapper; + @Autowired + private SysTagMapper sysTagMapper; + + @Autowired + private WxInstrumentFileRelateMapper wxInstrumentFileRelateMapper; + /** * 查询仪器列 * @@ -33,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; + } + /** * 查询仪器列列表 * @@ -61,22 +105,145 @@ 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 (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))); + tagNames.append(sysTag.getTagName()); + if (i < tagIdList.size() - 1) { + tagNames.append(","); + } + } + wxInstrument.setMiniTagNames(tagNames.toString()); + } else { + wxInstrument.setMiniTagNames(null); + } + + 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))); + tagNames.append(sysTag.getTagName()); + if (i < tagIdList.size() - 1) { + tagNames.append(","); + } + } + 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/package.json b/flossom-ui/package.json index 5324c46..40416b8 100644 --- a/flossom-ui/package.json +++ b/flossom-ui/package.json @@ -46,11 +46,9 @@ "file-saver": "2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", - "i": "^0.3.7", "js-beautify": "1.13.0", "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", - "npm": "^10.2.5", "nprogress": "0.2.0", "quill": "^2.0.0-dev.3", "quill-better-table": "^1.2.10", @@ -61,6 +59,7 @@ "vue-cropper": "0.5.5", "vue-meta": "2.4.0", "vue-router": "3.4.9", + "vue-video-player": "^4.0.6", "vuedraggable": "2.24.3", "vuex": "3.6.0" }, @@ -75,6 +74,7 @@ "connect": "3.6.6", "eslint": "7.15.0", "eslint-plugin-vue": "7.2.0", + "less-loader": "^5.0.0", "lint-staged": "10.5.3", "runjs": "4.4.2", "sass": "1.32.13", diff --git a/flossom-ui/src/api/system/instrument.js b/flossom-ui/src/api/system/instrument.js index ef515ff..7cda1b4 100644 --- a/flossom-ui/src/api/system/instrument.js +++ b/flossom-ui/src/api/system/instrument.js @@ -42,3 +42,25 @@ export function delInstrument(id) { method: 'delete' }) } + +/* 获取小程序标签树 */ +export function getMiniProgramTagTree() { + return request({ + url: '/system/tagInfo/tagTree', + method: 'get', + params: { + type: 1 + } + }) +} + +/* 获取企微标签树 */ +export function getWecomTagTree() { + return request({ + url: '/system/tagInfo/tagTree', + method: 'get', + params: { + type: 2 + } + }) +} diff --git a/flossom-ui/src/api/upload.js b/flossom-ui/src/api/upload.js new file mode 100644 index 0000000..22003e2 --- /dev/null +++ b/flossom-ui/src/api/upload.js @@ -0,0 +1,11 @@ +import request from '@/utils/request' + + +// 文件上传 +export function upload(data) { + return request({ + url: "/file/upload", + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/flossom-ui/src/components/ImagePreview/index.vue b/flossom-ui/src/components/ImagePreview/index.vue index 2fa02d7..c3b5bae 100644 --- a/flossom-ui/src/components/ImagePreview/index.vue +++ b/flossom-ui/src/components/ImagePreview/index.vue @@ -21,11 +21,11 @@ export default { }, width: { type: [Number, String], - default: "" + default: "80px" }, height: { type: [Number, String], - default: "" + default: "80px" } }, computed: { diff --git a/flossom-ui/src/components/VideoPreview/index.vue b/flossom-ui/src/components/VideoPreview/index.vue new file mode 100644 index 0000000..42e3940 --- /dev/null +++ b/flossom-ui/src/components/VideoPreview/index.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/flossom-ui/src/main.js b/flossom-ui/src/main.js index 13c6cf2..205ab09 100644 --- a/flossom-ui/src/main.js +++ b/flossom-ui/src/main.js @@ -1,67 +1,81 @@ -import Vue from 'vue' +import Vue from "vue"; -import Cookies from 'js-cookie' +import Cookies from "js-cookie"; -import Element from 'element-ui' -import './assets/styles/element-variables.scss' +import Element from "element-ui"; +import "./assets/styles/element-variables.scss"; -import '@/assets/styles/index.scss' // global css -import '@/assets/styles/ruoyi.scss' // ruoyi css -import App from './App' -import store from './store' -import router from './router' -import directive from './directive' // directive -import plugins from './plugins' // plugins -import { download } from '@/utils/request' +import "@/assets/styles/index.scss"; // global css +import "@/assets/styles/ruoyi.scss"; // ruoyi css +import App from "./App"; +import store from "./store"; +import router from "./router"; +import directive from "./directive"; // directive +import plugins from "./plugins"; // plugins +import { download } from "@/utils/request"; -import './assets/icons' // icon -import './permission' // permission control +import "./assets/icons"; // icon +import "./permission"; // permission control import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; -import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; +import { + parseTime, + resetForm, + addDateRange, + selectDictLabel, + selectDictLabels, + handleTree, +} from "@/utils/ruoyi"; // 分页组件 import Pagination from "@/components/Pagination"; // 自定义表格工具组件 -import RightToolbar from "@/components/RightToolbar" +import RightToolbar from "@/components/RightToolbar"; // 富文本组件 -import Editor from "@/components/Editor" +import Editor from "@/components/Editor"; // 文件上传组件 -import FileUpload from "@/components/FileUpload" +import FileUpload from "@/components/FileUpload"; // 图片上传组件 -import ImageUpload from "@/components/ImageUpload" +import ImageUpload from "@/components/ImageUpload"; // 图片预览组件 -import ImagePreview from "@/components/ImagePreview" +import ImagePreview from "@/components/ImagePreview"; // 字典标签组件 -import DictTag from '@/components/DictTag' +import DictTag from "@/components/DictTag"; // 头部标签组件 -import VueMeta from 'vue-meta' +import VueMeta from "vue-meta"; // 字典数据组件 -import DictData from '@/components/DictData' +import DictData from "@/components/DictData"; +// 视频播放器 +import VideoPlayer from "vue-video-player"; + +// 视频组件 +import VideoPreview from "@/components/VideoPreview"; // 全局方法挂载 -Vue.prototype.getDicts = getDicts -Vue.prototype.getConfigKey = getConfigKey -Vue.prototype.parseTime = parseTime -Vue.prototype.resetForm = resetForm -Vue.prototype.addDateRange = addDateRange -Vue.prototype.selectDictLabel = selectDictLabel -Vue.prototype.selectDictLabels = selectDictLabels -Vue.prototype.download = download -Vue.prototype.handleTree = handleTree +Vue.prototype.getDicts = getDicts; +Vue.prototype.getConfigKey = getConfigKey; +Vue.prototype.parseTime = parseTime; +Vue.prototype.resetForm = resetForm; +Vue.prototype.addDateRange = addDateRange; +Vue.prototype.selectDictLabel = selectDictLabel; +Vue.prototype.selectDictLabels = selectDictLabels; +Vue.prototype.download = download; +Vue.prototype.handleTree = handleTree; // 全局组件挂载 -Vue.component('DictTag', DictTag) -Vue.component('Pagination', Pagination) -Vue.component('RightToolbar', RightToolbar) -Vue.component('Editor', Editor) -Vue.component('FileUpload', FileUpload) -Vue.component('ImageUpload', ImageUpload) -Vue.component('ImagePreview', ImagePreview) +Vue.component("DictTag", DictTag); +Vue.component("Pagination", Pagination); +Vue.component("RightToolbar", RightToolbar); +Vue.component("Editor", Editor); +Vue.component("FileUpload", FileUpload); +Vue.component("ImageUpload", ImageUpload); +Vue.component("ImagePreview", ImagePreview); +Vue.component("VideoPreview", VideoPreview); -Vue.use(directive) -Vue.use(plugins) -Vue.use(VueMeta) -DictData.install() +Vue.use(directive); +Vue.use(plugins); +Vue.use(VueMeta); +Vue.use(VideoPlayer); +DictData.install(); /** * If you don't want to use mock-server @@ -73,14 +87,14 @@ DictData.install() */ Vue.use(Element, { - size: Cookies.get('size') || 'medium' // set element-ui default size -}) + size: Cookies.get("size") || "medium", // set element-ui default size +}); -Vue.config.productionTip = false +Vue.config.productionTip = false; new Vue({ - el: '#app', + el: "#app", router, store, - render: h => h(App) -}) + render: (h) => h(App), +}); diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index eb8160d..6c970b8 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -1,8 +1,19 @@ - + - + - + - + - + - - - + + + - diff --git a/flossom-ui/vue.config.js b/flossom-ui/vue.config.js index f86123f..c89e41a 100644 --- a/flossom-ui/vue.config.js +++ b/flossom-ui/vue.config.js @@ -13,7 +13,7 @@ const port = process.env.port || process.env.npm_config_port || 80; // 端口 function getTargetUrl() { if (process.env.NODE_ENV === "local") { - return "http://110.41.134.131:8080"; + return "http://110.41.134.131:8080"; // 纯前端代理地址 } else { return `http://localhost:8080`; } @@ -43,9 +43,8 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - // target: `http://110.41.134.131:8080`, - target: `http://192.168.10.147:8080`, - + target: `http://110.41.134.131:8080`, + // target: `http://192.168.10.147:8080`, changeOrigin: true, pathRewrite: { ["^" + process.env.VUE_APP_BASE_API]: "",