|
|
|
|
@ -5,18 +5,13 @@ import java.util.Iterator;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
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.entity.WxInstrumentMode;
|
|
|
|
|
import com.flossom.common.core.domain.entity.*;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxInstrumentReq;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxInstrumentSaveReq;
|
|
|
|
|
import com.flossom.common.core.enums.InstrumentFileClassifyEnum;
|
|
|
|
|
import com.flossom.common.core.enums.Status;
|
|
|
|
|
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.mapper.WxInstrumentModeMapper;
|
|
|
|
|
import com.flossom.common.core.enums.TagTypeStatusEnum;
|
|
|
|
|
import com.flossom.common.core.mapper.*;
|
|
|
|
|
import com.flossom.common.core.utils.DateUtils;
|
|
|
|
|
import com.flossom.common.core.utils.StringUtils;
|
|
|
|
|
import com.flossom.common.security.utils.SecurityUtils;
|
|
|
|
|
@ -47,6 +42,9 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private WxInstrumentModeMapper wxInstrumentModeMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private WxInstrumentTagMapper wxInstrumentTagMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询仪器列
|
|
|
|
|
*
|
|
|
|
|
@ -114,7 +112,30 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<WxInstrument> selectWxInstrumentPage(WxInstrumentReq wxInstrumentReq) {
|
|
|
|
|
return wxInstrumentMapper.selectWxInstrumentPage(wxInstrumentReq);
|
|
|
|
|
List<WxInstrument> wxInstruments = wxInstrumentMapper.selectWxInstrumentPage(wxInstrumentReq);
|
|
|
|
|
if (wxInstruments != null && wxInstruments.size() > 0) {
|
|
|
|
|
for (WxInstrument wxInstrument : wxInstruments) {
|
|
|
|
|
WxInstrumentTag query = new WxInstrumentTag();
|
|
|
|
|
query.setInstrumentId(wxInstrument.getId());
|
|
|
|
|
List<WxInstrumentTag> wxInstrumentTagList = wxInstrumentTagMapper.selectWxInstrumentTagList(query);
|
|
|
|
|
if (wxInstrumentTagList != null && wxInstrumentTagList.size() > 0) {
|
|
|
|
|
List<Long> tagIdList = wxInstrumentTagList.stream().map(WxInstrumentTag::getTagId).collect(Collectors.toList());
|
|
|
|
|
List<SysTag> sysTagList = sysTagMapper.selectByIdList(tagIdList);
|
|
|
|
|
|
|
|
|
|
String miniProgramTags = sysTagList.stream()
|
|
|
|
|
.filter(tag -> Integer.valueOf(tag.getType()) == TagTypeStatusEnum.MINI_PROGRAM.getCode())
|
|
|
|
|
.map(SysTag::getTagName)
|
|
|
|
|
.collect(Collectors.joining(","));
|
|
|
|
|
wxInstrument.setMiniTagNames(miniProgramTags);
|
|
|
|
|
String wecomTags = sysTagList.stream()
|
|
|
|
|
.filter(tag -> Integer.valueOf(tag.getType()) == TagTypeStatusEnum.ENTERPRISE_WECHAT.getCode())
|
|
|
|
|
.map(SysTag::getTagName)
|
|
|
|
|
.collect(Collectors.joining(","));
|
|
|
|
|
wxInstrument.setWecomTagNames(wecomTags);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return wxInstruments;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|