|
|
@ -19,6 +19,7 @@ import com.ruoyi.flyingbook.mapper.LarkActiveMapper;
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkLoginLogMapper;
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkLoginLogMapper;
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkUserActiveImageMapper;
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkUserActiveImageMapper;
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkUserActiveRelatoinMapper;
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkUserActiveRelatoinMapper;
|
|
|
|
|
|
|
|
import com.ruoyi.flyingbook.service.ILarkUserActiveInviteRelatoinService;
|
|
|
|
import com.ruoyi.flyingbook.service.ILarkUserActiveRelatoinService;
|
|
|
|
import com.ruoyi.flyingbook.service.ILarkUserActiveRelatoinService;
|
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
@ -31,6 +32,7 @@ import java.io.BufferedOutputStream;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
@ -54,6 +56,8 @@ public class LarkUserActiveRelatoinServiceImpl implements ILarkUserActiveRelatoi
|
|
|
|
private LarkUserActiveImageMapper larkUserActiveImageMapper;
|
|
|
|
private LarkUserActiveImageMapper larkUserActiveImageMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private LarkLoginLogMapper larkLoginLogMapper;
|
|
|
|
private LarkLoginLogMapper larkLoginLogMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private ILarkUserActiveInviteRelatoinService larkUserActiveInviteRelatoinService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String BUCKET_NAME = "ruoyi-1308275795";
|
|
|
|
private static final String BUCKET_NAME = "ruoyi-1308275795";
|
|
|
@ -201,7 +205,7 @@ public class LarkUserActiveRelatoinServiceImpl implements ILarkUserActiveRelatoi
|
|
|
|
if (relatoin == null) {
|
|
|
|
if (relatoin == null) {
|
|
|
|
return new ResponseVo();
|
|
|
|
return new ResponseVo();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Integer totalCount = userActiveCount(relatoin) + 1;
|
|
|
|
Integer totalCount = userActiveCount(relatoin,request.getImageBase64()) + 1;
|
|
|
|
LarkActive larkActive = larkActiveMapper.selectLarkActiveById(relatoin.getActiveId());
|
|
|
|
LarkActive larkActive = larkActiveMapper.selectLarkActiveById(relatoin.getActiveId());
|
|
|
|
if (StringUtils.isNotBlank(request.getImageBase64())) {
|
|
|
|
if (StringUtils.isNotBlank(request.getImageBase64())) {
|
|
|
|
File file = base642File(request.getImageBase64());
|
|
|
|
File file = base642File(request.getImageBase64());
|
|
|
@ -218,6 +222,7 @@ public class LarkUserActiveRelatoinServiceImpl implements ILarkUserActiveRelatoi
|
|
|
|
if (totalCount >= larkActive.getActiveImageCount()) {
|
|
|
|
if (totalCount >= larkActive.getActiveImageCount()) {
|
|
|
|
relatoin.setActiveStage(LarkActiveStageEnum.ADJUST.getCode());
|
|
|
|
relatoin.setActiveStage(LarkActiveStageEnum.ADJUST.getCode());
|
|
|
|
larkUserActiveRelatoinMapper.updateLarkUserActiveRelatoin(relatoin);
|
|
|
|
larkUserActiveRelatoinMapper.updateLarkUserActiveRelatoin(relatoin);
|
|
|
|
|
|
|
|
larkUserActiveInviteRelatoinService.inviteSuccess(Arrays.asList(request.getUserName()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return new ResponseVo();
|
|
|
|
return new ResponseVo();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -253,11 +258,22 @@ public class LarkUserActiveRelatoinServiceImpl implements ILarkUserActiveRelatoi
|
|
|
|
larkUserActiveImageMapper.insertLarkUserActiveImage(larkUserActiveImage);
|
|
|
|
larkUserActiveImageMapper.insertLarkUserActiveImage(larkUserActiveImage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Integer userActiveCount(LarkUserActiveRelatoin relatoin) {
|
|
|
|
private Integer userActiveCount(LarkUserActiveRelatoin relatoin,String image) {
|
|
|
|
LarkUserActiveImage larkUserActiveImage = new LarkUserActiveImage();
|
|
|
|
LarkUserActiveImage larkUserActiveImage = new LarkUserActiveImage();
|
|
|
|
larkUserActiveImage.setUserActiveRelatoin(relatoin.getId());
|
|
|
|
larkUserActiveImage.setUserActiveRelatoin(relatoin.getId());
|
|
|
|
larkUserActiveImage.setFlag(FlagStatus.OK.getCode());
|
|
|
|
larkUserActiveImage.setFlag(FlagStatus.OK.getCode());
|
|
|
|
return larkUserActiveImageMapper.selectLarkUserActiveImageList(larkUserActiveImage).size();
|
|
|
|
List<LarkUserActiveImage> larkUserActiveImages = larkUserActiveImageMapper.selectLarkUserActiveImageList(larkUserActiveImage);
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(image)) {
|
|
|
|
|
|
|
|
return larkUserActiveImages.size();
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
List<String> collect = larkUserActiveImages.stream()
|
|
|
|
|
|
|
|
.filter(r -> {
|
|
|
|
|
|
|
|
return StringUtils.isNotBlank(r.getRemark());
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.map(LarkUserActiveImage::getRemark)
|
|
|
|
|
|
|
|
.distinct().collect(Collectors.toList());
|
|
|
|
|
|
|
|
return collect.size();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private LarkUserActiveRelatoin queryUserActiveRelation(String companyName,String userName, Long activeId) {
|
|
|
|
private LarkUserActiveRelatoin queryUserActiveRelation(String companyName,String userName, Long activeId) {
|
|
|
|