仪器护理信息

master
382696293@qq.com 2 years ago
parent 48b3fed29b
commit fe2f5111c9

@ -0,0 +1,286 @@
package com.flossom.common.core.domain.ret;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* wx_mode
*
* @author flossom
* @date 2024-01-17
*/
public class WxModeRet {
/**
* $column.columnComment
*/
private Long id;
/**
* 1iot 2iot
*/
@Excel(name = "仪器类型1、非iot仪器 2、iot仪器")
private Integer instrumentType;
/**
*
*/
@Excel(name = "仪器型号")
private String instrumentModel;
/**
*
*/
@Excel(name = "模式名称")
private String modeName;
/**
*
*/
@Excel(name = "模式描述")
private String modeDesc;
/**
*
*/
@Excel(name = "模式封面图片")
private String modeBanner;
/**
*
*/
@Excel(name = "模式视频")
private String modeVideo;
/**
* ()
*/
@Excel(name = "模式类型(每个仪器有不一样的模式类型)")
private Long modeType;
/**
* ()
*/
@Excel(name = "模式分类(每个仪器有不一样的模式分类)")
private Long modeClass;
/**
* 0 1
*/
@Excel(name = "是否属于舱体模式0、不是 1、是")
private Integer isCabinMode;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "模式时长", width = 30, dateFormat = "yyyy-MM-dd")
private Date modeTime;
/**
*
*/
@Excel(name = "准备视频")
private String preparationVideo;
/**
* GIF
*/
@Excel(name = "启动图片GIF")
private String beganVideo;
/**
* GIF
*/
@Excel(name = "暂停图片GIF")
private String pauseVideo;
/**
* 0 1
*/
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private Long status;
/**
*
*/
private Boolean isLock;
// 展示标签
private String lockWechatTag;
private String lockCompanyTag;
private List<Long> lockWechatTagArray = new ArrayList<Long>();
private List<Long> lockCompanyTagArray = new ArrayList<Long>();
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setInstrumentType(Integer instrumentType) {
this.instrumentType = instrumentType;
}
public Integer getInstrumentType() {
return instrumentType;
}
public void setInstrumentModel(String instrumentModel) {
this.instrumentModel = instrumentModel;
}
public String getInstrumentModel() {
return instrumentModel;
}
public void setModeName(String modeName) {
this.modeName = modeName;
}
public String getModeName() {
return modeName;
}
public void setModeDesc(String modeDesc) {
this.modeDesc = modeDesc;
}
public String getModeDesc() {
return modeDesc;
}
public void setModeBanner(String modeBanner) {
this.modeBanner = modeBanner;
}
public String getModeBanner() {
return modeBanner;
}
public void setModeVideo(String modeVideo) {
this.modeVideo = modeVideo;
}
public String getModeVideo() {
return modeVideo;
}
public void setModeType(Long modeType) {
this.modeType = modeType;
}
public Long getModeType() {
return modeType;
}
public void setModeClass(Long modeClass) {
this.modeClass = modeClass;
}
public Long getModeClass() {
return modeClass;
}
public void setIsCabinMode(Integer isCabinMode) {
this.isCabinMode = isCabinMode;
}
public Integer getIsCabinMode() {
return isCabinMode;
}
public void setModeTime(Date modeTime) {
this.modeTime = modeTime;
}
public Date getModeTime() {
return modeTime;
}
public void setPreparationVideo(String preparationVideo) {
this.preparationVideo = preparationVideo;
}
public String getPreparationVideo() {
return preparationVideo;
}
public void setBeganVideo(String beganVideo) {
this.beganVideo = beganVideo;
}
public String getBeganVideo() {
return beganVideo;
}
public void setPauseVideo(String pauseVideo) {
this.pauseVideo = pauseVideo;
}
public String getPauseVideo() {
return pauseVideo;
}
public void setStatus(Long status) {
this.status = status;
}
public Long getStatus() {
return status;
}
public String getLockWechatTag() {
return lockWechatTag;
}
public void setLockWechatTag(String lockWechatTag) {
this.lockWechatTag = lockWechatTag;
}
public String getLockCompanyTag() {
return lockCompanyTag;
}
public void setLockCompanyTag(String lockCompanyTag) {
this.lockCompanyTag = lockCompanyTag;
}
public List<Long> getLockWechatTagArray() {
return lockWechatTagArray;
}
public void setLockWechatTagArray(List<Long> lockWechatTagArray) {
this.lockWechatTagArray = lockWechatTagArray;
}
public List<Long> getLockCompanyTagArray() {
return lockCompanyTagArray;
}
public void setLockCompanyTagArray(List<Long> lockCompanyTagArray) {
this.lockCompanyTagArray = lockCompanyTagArray;
}
public Boolean getLock() {
return isLock;
}
public void setLock(Boolean lock) {
isLock = lock;
}
}

@ -59,4 +59,6 @@ public interface WxModeMapper
* @return
*/
public int deleteWxModeByIds(Long[] ids);
List<WxMode> selectListByInstrumentId(Long instrumentId);
}

@ -51,6 +51,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectListByInstrumentId" parameterType="Long" resultMap="WxModeResult">
SELECT
DISTINCT mo.*, imo.mode_sort
FROM
wx_mode mo
LEFT JOIN `wx_instrument_mode` imo ON imo.mode_id = mo.id
WHERE
imo.instrument_id = #{instrumentId}
ORDER BY imo.mode_sort ASC
</select>
<select id="selectWxModeById" parameterType="Long" resultMap="WxModeResult">
<include refid="selectWxModeVo"/>
where id = #{id}

@ -124,7 +124,7 @@ public class WxInstrumentController extends BaseController {
/**
* ID
*/
@GetMapping(value = "/modeInfo")
@GetMapping(value = "/modeInfoList")
public R modeInfo(@NotNull(message = "仪器ID不能为空") @RequestParam("instrumentId") Long instrumentId) {
return R.ok(wxInstrumentService.getInstrumentModeByInstrumentId(instrumentId));
}

@ -1,9 +1,7 @@
package com.flossom.miniProgram.service;
import com.flossom.common.core.domain.entity.WxInstrument;
import com.flossom.common.core.domain.entity.WxInstrumentFileRelate;
import com.flossom.common.core.domain.entity.WxInstrumentMode;
import com.flossom.common.core.domain.entity.WxInstrumentSerial;
import com.flossom.common.core.domain.entity.*;
import com.flossom.common.core.domain.ret.WxModeRet;
import java.util.List;
@ -26,7 +24,7 @@ public interface IWxInstrumentService {
List<WxInstrumentFileRelate> getInstrumentFileRelateByInstrumentId(Long instrumentId, Integer classify);
List<WxInstrumentMode> getInstrumentModeByInstrumentId(Long instrumentId);
List<WxModeRet> getInstrumentModeByInstrumentId(Long instrumentId);
WxInstrumentSerial determineSerialIsSameInstrument(String serial, Long instrumentId);
}

@ -1,6 +1,8 @@
package com.flossom.miniProgram.service.impl;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.flossom.common.core.domain.entity.*;
import com.flossom.common.core.domain.ret.WxModeRet;
import com.flossom.common.core.enums.*;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.exception.ServiceReturnCodeException;
@ -50,9 +52,6 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
@Autowired
private WxInstrumentFileRelateMapper wxInstrumentFileRelateMapper;
@Autowired
private WxInstrumentModeMapper wxInstrumentModeMapper;
@Autowired
private WxInstrumentTagMapper wxInstrumentTagMapper;
@ -68,6 +67,12 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
@Autowired
private WxUserScriptLogMapper wxUserScriptLogMapper;
@Autowired
private WxModeMapper wxModeMapper;
@Autowired
private WxModeTagMapper wxModeTagMapper;
@Override
public List<WxInstrument> bindingInstrumentList() {
return wxInstrumentMapper.selectBindingInstrumentListByUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
@ -348,11 +353,41 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
}
@Override
public List<WxInstrumentMode> getInstrumentModeByInstrumentId(Long instrumentId) {
WxInstrumentMode wxInstrumentMode = new WxInstrumentMode();
wxInstrumentMode.setInstrumentId(instrumentId);
wxInstrumentMode.setStatus(Status.OK.getCode());
return wxInstrumentModeMapper.selectWxInstrumentModeList(wxInstrumentMode);
public List<WxModeRet> getInstrumentModeByInstrumentId(Long instrumentId) {
// 用户拥有的标签
WxUserTag wxUserTag = new WxUserTag();
wxUserTag.setUserId(SecurityUtils.getLoginUser().getWxUserMember().getId());
List<WxUserTag> userTagList = wxUserTagMapper.selectWxUserTagList(wxUserTag);
List<Long> userTagIdList;
if (userTagList != null && userTagList.size() > 0) {
userTagIdList = userTagList.stream().map(WxUserTag::getTagId).collect(Collectors.toList());
} else {
userTagIdList = null;
}
// 查询仪器关联的所有模式
List<WxModeRet> wxModeRetList = new ArrayList<>();
List<WxMode> wxModeList = wxModeMapper.selectListByInstrumentId(instrumentId);
for (WxMode wxMode : wxModeList) {
// 判断每个模式是否加锁
WxModeTag wxModeTag = new WxModeTag();
wxModeTag.setModeId(wxMode.getId());
List<WxModeTag> wxModeTagList = wxModeTagMapper.selectWxModeTagList(wxModeTag);
if (wxModeTagList != null) {
List<Long> modeTagList = wxModeTagList.stream().map(WxModeTag::getTagId).collect(Collectors.toList());
if (userTagIdList == null || !userTagIdList.containsAll(modeTagList)) {
WxModeRet wxModeRet = new WxModeRet();
BeanUtils.copyProperties(wxMode, wxModeRet);
wxModeRet.setLock(true);
wxModeRetList.add(wxModeRet);
continue;
}
}
WxModeRet wxModeRet = new WxModeRet();
BeanUtils.copyProperties(wxMode, wxModeRet);
wxModeRet.setLock(false);
wxModeRetList.add(wxModeRet);
}
return wxModeRetList;
}
/**

Loading…
Cancel
Save