提交 7236e2e8 作者: 恶龙咆哮

新增根据飞手团队查飞手列表

上级 40d952f1
package com.mmc.iuav.user.model.dto.dronepilot;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 张培
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class FlyingTeam{
@ApiModelProperty(value = "后台id")
private Integer backUserId;
@ApiModelProperty(value = "后台对应的公司名称")
private String companyName;
}
...@@ -111,4 +111,6 @@ public class PilotCertificationDTO { ...@@ -111,4 +111,6 @@ public class PilotCertificationDTO {
private Boolean status; private Boolean status;
@ApiModelProperty(value = "飞手团队名称") @ApiModelProperty(value = "飞手团队名称")
private String flyingTeam; private String flyingTeam;
@ApiModelProperty(value = "飞手团队对应的后台id")
private Integer backUserId;
} }
...@@ -61,5 +61,7 @@ public class PilotCertificationQO implements Serializable { ...@@ -61,5 +61,7 @@ public class PilotCertificationQO implements Serializable {
@ApiModelProperty(value = "",hidden = true) @ApiModelProperty(value = "",hidden = true)
private Integer tokenUserId; private Integer tokenUserId;
@ApiModelProperty(value = "飞手团队的后台id")
private Integer backUserId;
} }
...@@ -6,6 +6,7 @@ import com.mmc.iuav.user.entity.dronepilot.PilotAbilityDO; ...@@ -6,6 +6,7 @@ import com.mmc.iuav.user.entity.dronepilot.PilotAbilityDO;
import com.mmc.iuav.user.entity.dronepilot.PilotCertificationDO; import com.mmc.iuav.user.entity.dronepilot.PilotCertificationDO;
import com.mmc.iuav.user.entity.dronepilot.PilotCertificationLogDO; import com.mmc.iuav.user.entity.dronepilot.PilotCertificationLogDO;
import com.mmc.iuav.user.entity.dronepilot.PilotReasonDO; import com.mmc.iuav.user.entity.dronepilot.PilotReasonDO;
import com.mmc.iuav.user.model.dto.dronepilot.FlyingTeam;
import com.mmc.iuav.user.model.qo.dronepilot.*; import com.mmc.iuav.user.model.qo.dronepilot.*;
import com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO; import com.mmc.iuav.user.model.vo.dronepilot.PilotAbilityVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -53,7 +54,7 @@ public interface PilotCertificationDao { ...@@ -53,7 +54,7 @@ public interface PilotCertificationDao {
* @param userId 飞手id * @param userId 飞手id
* @return {@link String} * @return {@link String}
*/ */
String selectCompanyNameByFlyingUserId(Integer userId); FlyingTeam selectCompanyNameByFlyingUserId(Integer userId);
Integer getPilotAuditSum(Integer status); Integer getPilotAuditSum(Integer status);
List<PilotAbilityVO> selectAbilityList(Integer pilotCertificationId); List<PilotAbilityVO> selectAbilityList(Integer pilotCertificationId);
......
...@@ -238,19 +238,26 @@ public class PilotCertificationServiceImpl implements PilotCertificationService ...@@ -238,19 +238,26 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
} }
pilotList = pilotList.stream().filter(t -> t.getPilotAbility() != null).collect(Collectors.toList()); pilotList = pilotList.stream().filter(t -> t.getPilotAbility() != null).collect(Collectors.toList());
} }
List<PilotCertificationDTO> collect = pilotList.stream().map(PilotCertificationDO::buildPilotCertificationDTO).collect(Collectors.toList()); List<PilotCertificationDTO> collects = pilotList.stream().map(PilotCertificationDO::buildPilotCertificationDTO).collect(Collectors.toList());
for (PilotCertificationDTO certificationDTO:collect) { for (PilotCertificationDTO certificationDTO:collects) {
Integer userAccountId = certificationDTO.getUserAccountId(); Integer userAccountId = certificationDTO.getUserAccountId();
if (certificationDao.selectCompanyByUserId(userAccountId) < 1) { if (certificationDao.selectCompanyByUserId(userAccountId) < 1) {
continue; continue;
}else { }else {
String flyingTeamName = certificationDao.selectCompanyNameByFlyingUserId(userAccountId); FlyingTeam flyingTeam = certificationDao.selectCompanyNameByFlyingUserId(userAccountId);
certificationDTO.setFlyingTeam(flyingTeamName); certificationDTO.setFlyingTeam(flyingTeam.getCompanyName());
certificationDTO.setBackUserId(flyingTeam.getBackUserId());
} }
} }
collect = collect.stream().skip((pageNo - 1) * param.getPageSize()).limit(param.getPageSize()). Integer backUserId = param.getBackUserId();
if(backUserId == null) {
collects = collects.stream().skip((pageNo - 1) * param.getPageSize()).limit(param.getPageSize()).
collect(Collectors.toList()); collect(Collectors.toList());
PageResult pageResult = PageResult.buildPage(pageNo, param.getPageSize(), pilotList.size(), collect); }else {
collects = collects.stream().filter(collect -> backUserId.equals(collect.getBackUserId())).skip((pageNo - 1) * param.getPageSize()).limit(param.getPageSize()).
collect(Collectors.toList());
}
PageResult pageResult = PageResult.buildPage(pageNo, param.getPageSize(), pilotList.size(), collects);
return pageResult; return pageResult;
} }
......
...@@ -495,10 +495,12 @@ ...@@ -495,10 +495,12 @@
<select id="selectCompanyByUserId" resultType="java.lang.Integer"> <select id="selectCompanyByUserId" resultType="java.lang.Integer">
select count(id) from pilot_join_team where pilot_user_id = #{userId} select count(id) from pilot_join_team where pilot_user_id = #{userId}
</select> </select>
<select id="selectCompanyNameByFlyingUserId" resultType="java.lang.String"> <select id="selectCompanyNameByFlyingUserId"
select company_name from company_info ci resultType="com.mmc.iuav.user.model.dto.dronepilot.FlyingTeam">
inner join company_back_user cbu on ci.id = cbu.company_info_id select company_name,back_user_id from company_info ci
inner join pilot_join_team pjt on cbu.back_user_account_id = pjt.back_user_id inner join company_back_user cbu on ci.id = cbu.company_info_id
where pjt.pilot_user_id = #{userId} inner join pilot_join_team pjt on cbu.back_user_account_id = pjt.back_user_id
where pjt.pilot_user_id = #{userId}
</select> </select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论