提交 25098fb0 作者: 刘明祎-运维用途

添加邀请人数

上级 fa5c8b4f
package com.mmc.iuav.user.model.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRcdUpVO {
private Integer rUerId;
private List<Integer> userId;
}
\ No newline at end of file
...@@ -5,11 +5,14 @@ import com.mmc.iuav.response.ResultBody; ...@@ -5,11 +5,14 @@ import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.qo.CompanyInfoQO; import com.mmc.iuav.user.model.qo.CompanyInfoQO;
import com.mmc.iuav.user.model.vo.CompanyInfoVO; import com.mmc.iuav.user.model.vo.CompanyInfoVO;
import com.mmc.iuav.user.model.vo.UserAccountVO; import com.mmc.iuav.user.model.vo.UserAccountVO;
import com.mmc.iuav.user.model.vo.UserRcdUpVO;
import com.mmc.iuav.user.model.vo.UserRcdVO;
import com.mmc.iuav.user.service.CompanyService; import com.mmc.iuav.user.service.CompanyService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -138,4 +141,12 @@ public class CompanyController extends BaseController { ...@@ -138,4 +141,12 @@ public class CompanyController extends BaseController {
public ResultBody getManagerIdByBackUserId(@RequestParam Integer backUserAccountId) { public ResultBody getManagerIdByBackUserId(@RequestParam Integer backUserAccountId) {
return companyService.getManagerIdByBackUserId(backUserAccountId); return companyService.getManagerIdByBackUserId(backUserAccountId);
} }
@ApiOperation(value = "添加邀请人数")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("insertUserRcd")
public ResultBody insertUserRcd(@RequestBody UserRcdUpVO userRcdUpVO) {
return companyService.insertUserRcd(userRcdUpVO.getRUerId(),userRcdUpVO.getUserId());
}
} }
...@@ -205,4 +205,13 @@ public interface CompanyDao { ...@@ -205,4 +205,13 @@ public interface CompanyDao {
CompanyMemberDO getManagerByCompanyId(Integer companyInfoId); CompanyMemberDO getManagerByCompanyId(Integer companyInfoId);
CompanyBackUserDO getCompanyBackUserByBackUserId(Integer backUserAccountId); CompanyBackUserDO getCompanyBackUserByBackUserId(Integer backUserAccountId);
/**
* 从旧版云享飞搜索添加到新版云享飞
* @param userId 被邀请人
* @param rUserId 邀请人
*/
void insertUserRcd(Integer userId,Integer rUserId);
Integer selectUserByUserRcd(Integer userId);
} }
...@@ -170,4 +170,6 @@ public interface CompanyService { ...@@ -170,4 +170,6 @@ public interface CompanyService {
void deleteCompanyInfoById(Integer id); void deleteCompanyInfoById(Integer id);
ResultBody getManagerIdByBackUserId(Integer backUserAccountId); ResultBody getManagerIdByBackUserId(Integer backUserAccountId);
ResultBody insertUserRcd(Integer rUserId,List<Integer> userIds);
} }
...@@ -291,4 +291,18 @@ public class CompanyServiceImpl implements CompanyService { ...@@ -291,4 +291,18 @@ public class CompanyServiceImpl implements CompanyService {
} }
return ResultBody.success(companyMemberDO.getUserAccountId()); return ResultBody.success(companyMemberDO.getUserAccountId());
} }
@Override
public ResultBody insertUserRcd(Integer rUserId, List<Integer> userIds) {
for (Integer userId : userIds) {
Integer integer = companyDao.selectUserByUserRcd(userId);
if(integer != 0){
continue;
}
companyDao.insertUserRcd(userId,rUserId);
}
return ResultBody.success();
}
} }
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
insert into company_member(user_account_id, company_info_id, is_leader, create_time) insert into company_member(user_account_id, company_info_id, is_leader, create_time)
values (#{userAccountId}, #{companyInfoId}, #{leader}, NOW()) values (#{userAccountId}, #{companyInfoId}, #{leader}, NOW())
</insert> </insert>
<insert id="insertUserRcd">
insert into user_rcd(user_account_id,rcd_user_id,create_time) values (#{userId},#{rUserId},NOW())
</insert>
<update id="removeCompanyInfo"> <update id="removeCompanyInfo">
update company_info set is_deleted = 1 where id = #{id} update company_info set is_deleted = 1 where id = #{id}
...@@ -278,4 +281,7 @@ ...@@ -278,4 +281,7 @@
company_member cm company_member cm
where company_info_id = #{companyInfoId} and is_leader = 1 where company_info_id = #{companyInfoId} and is_leader = 1
</select> </select>
<select id="selectUserByUserRcd" resultType="java.lang.Integer">
select count(id) from user_rcd where user_account_id = #{userId}
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论