Commit 406ef1ca authored by lixiaolei's avatar lixiaolei

submit

parent a8e546c9
...@@ -130,5 +130,10 @@ public class BusinessBrowseVo { ...@@ -130,5 +130,10 @@ public class BusinessBrowseVo {
*/ */
private Integer fileCount; private Integer fileCount;
/**
* 是否创建人(1 是,0 否)
*/
private Integer isFounder;
} }
package com.dsk.system.mapper; package com.dsk.system.mapper;
import com.dsk.common.core.domain.entity.BusinessUser; import com.dsk.common.core.domain.entity.BusinessUser;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
...@@ -65,4 +67,11 @@ public interface BusinessUserMapper ...@@ -65,4 +67,11 @@ public interface BusinessUserMapper
* @return * @return
*/ */
String selectCreatorByBusinessId(Integer businessId); String selectCreatorByBusinessId(Integer businessId);
/**
* 查询是否为项目的创建人
* @param businessId
* @return
*/
Integer selectFounder(@Param("businessId") Integer businessId,@Param("userId") Long userId);
} }
...@@ -89,7 +89,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -89,7 +89,6 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
dto.setOthers(userId.intValue()); dto.setOthers(userId.intValue());
//查询他人可见项目 //查询他人可见项目
othersList = businessInfoMapper.selectBusinessInfoList(dto); othersList = businessInfoMapper.selectBusinessInfoList(dto);
} }
dto.setOthers(null); dto.setOthers(null);
//查询自己参与的项目 //查询自己参与的项目
...@@ -106,6 +105,11 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -106,6 +105,11 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
BeanUtil.copyProperties(businessInfo, businessBrowseVo); BeanUtil.copyProperties(businessInfo, businessBrowseVo);
//商务团队 //商务团队
businessBrowseVo.setTeam(businessUserMapper.selectCreatorByBusinessId(businessId)); businessBrowseVo.setTeam(businessUserMapper.selectCreatorByBusinessId(businessId));
//查询是否是项目创建人
Long userId = SecurityUtils.getLoginUser().getUserId();
if (userId == null) throw new BaseException("请登录");
Integer founder = businessUserMapper.selectFounder(businessId, userId);
businessBrowseVo.setIsFounder(founder == null ? 0 : founder);
//查询项目标签 //查询项目标签
businessBrowseVo.setLabelList(businessLabelMapper.selectBusinessLabelList(new BusinessLabel(businessId)).stream().map(p -> p.getLabel()).collect(Collectors.toList())); businessBrowseVo.setLabelList(businessLabelMapper.selectBusinessLabelList(new BusinessLabel(businessId)).stream().map(p -> p.getLabel()).collect(Collectors.toList()));
//相关数据统计 //相关数据统计
......
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
where bu.is_founder = 1 where bu.is_founder = 1
and i.id = #{BusinessId} and i.id = #{BusinessId}
</select> </select>
<select id="selectFounder" resultType="java.lang.Integer">
select is_founder
from business_user
where business_id = #{businessId}
and user_id = #{userId}
</select>
<insert id="insertBusinessUser" parameterType="com.dsk.common.core.domain.entity.BusinessUser" useGeneratedKeys="true" keyProperty="id"> <insert id="insertBusinessUser" parameterType="com.dsk.common.core.domain.entity.BusinessUser" useGeneratedKeys="true" keyProperty="id">
insert into business_user insert into business_user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment