新增i皖送班组人员信息相关接口及实现
This commit is contained in:
parent
caf296d1e6
commit
451a624146
|
|
@ -0,0 +1,41 @@
|
|||
package com.bonus.material.app.controller;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.app.service.IwsTeamUserService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.material.app.controller
|
||||
* @CreateTime: 2025-06-10 15:23
|
||||
* @Description: 描述
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/app/iwsTeamUser")
|
||||
public class IwsTeamUserController {
|
||||
|
||||
@Resource
|
||||
private IwsTeamUserService iwsTeamUserService;
|
||||
|
||||
@GetMapping("/selectUserInfoByUserName")
|
||||
public AjaxResult selectUserInfoByUserName(String userName) {
|
||||
if (userName == null || userName.isEmpty()) {
|
||||
return AjaxResult.error("用户名不能为空");
|
||||
}
|
||||
return AjaxResult.success(iwsTeamUserService.selectUserInfoByUserName(userName));
|
||||
}
|
||||
|
||||
@GetMapping("/selectProjectTeamInfoByIdCard")
|
||||
public AjaxResult selectProjectTeamInfoByIdCard(String idCard, String projectIds) {
|
||||
if (idCard == null || idCard.isEmpty()) {
|
||||
return AjaxResult.error("身份证号码不能为空");
|
||||
}
|
||||
return AjaxResult.success(iwsTeamUserService.selectProjectTeamInfoByIdCard(idCard, projectIds));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.bonus.material.app.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.material.app.domain
|
||||
* @CreateTime: 2025-06-10 14:48
|
||||
* @Description: 班组人员信息vo---i皖送平台
|
||||
*/
|
||||
@Data
|
||||
public class IwsTeamUserVo {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 班组id
|
||||
*/
|
||||
private String teamId;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 班组长id
|
||||
*/
|
||||
private String teamLeaderIdCard;
|
||||
|
||||
/**
|
||||
* 班组长姓名
|
||||
*/
|
||||
private String teamLeaderName;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
private String userPhone;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* i皖送登陆用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.material.app.mapper;
|
||||
|
||||
import com.bonus.material.app.domain.IwsTeamUserVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.material.app.mapper
|
||||
* @CreateTime: 2025-06-10 14:50
|
||||
* @Description: 描述
|
||||
*/
|
||||
@Mapper
|
||||
public interface IwsTeamUserMapper {
|
||||
|
||||
/**
|
||||
* 根据userName查询用户的身份证号码(idCard)
|
||||
* @param userName i皖送登陆用户名
|
||||
* @return Object对象
|
||||
*/
|
||||
IwsTeamUserVo selectUserInfoByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 根据身份证号码查询用户所属班组及工程信息
|
||||
* @param idCard 身份证号码(班组长)
|
||||
* @return List集合
|
||||
*/
|
||||
List<IwsTeamUserVo> selectProjectTeamInfoByIdCard(String idCard);
|
||||
|
||||
/**
|
||||
* 根据工程集合查询工程及班组信息
|
||||
* @param ids 工程id集合
|
||||
* @return List集合
|
||||
*/
|
||||
List<IwsTeamUserVo> selectProjectTeamInfoByProjectIds(List<String> ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.bonus.material.app.service;
|
||||
|
||||
import com.bonus.material.app.domain.IwsTeamUserVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.material.app.service
|
||||
* @CreateTime: 2025-06-10 15:21
|
||||
* @Description: 描述
|
||||
*/
|
||||
public interface IwsTeamUserService {
|
||||
|
||||
/**
|
||||
* 根据userName查询用户的身份证号码(idCard)
|
||||
* @param userName i皖送登陆用户名
|
||||
* @return Object对象
|
||||
*/
|
||||
IwsTeamUserVo selectUserInfoByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 根据身份证号码查询用户所属班组及工程信息
|
||||
* @param idCard 身份证号码(班组长)
|
||||
* @return List集合
|
||||
*/
|
||||
List<IwsTeamUserVo> selectProjectTeamInfoByIdCard(String idCard, String projectIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.bonus.material.app.service.impl;
|
||||
|
||||
import com.bonus.material.app.domain.IwsTeamUserVo;
|
||||
import com.bonus.material.app.mapper.IwsTeamUserMapper;
|
||||
import com.bonus.material.app.service.IwsTeamUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.material.app.service.impl
|
||||
* @CreateTime: 2025-06-10 15:21
|
||||
* @Description: i皖送查询班组信息接口
|
||||
*/
|
||||
@Service
|
||||
public class IwsTeamUserServiceImpl implements IwsTeamUserService {
|
||||
|
||||
@Resource
|
||||
private IwsTeamUserMapper iwsTeamUserMapper;
|
||||
|
||||
/**
|
||||
* 根据userName查询用户的身份证号码(idCard)
|
||||
*
|
||||
* @param userName i皖送登陆用户名
|
||||
* @return Object对象
|
||||
*/
|
||||
@Override
|
||||
public IwsTeamUserVo selectUserInfoByUserName(String userName) {
|
||||
return iwsTeamUserMapper.selectUserInfoByUserName(userName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据身份证号码查询用户所属班组及工程信息
|
||||
*
|
||||
* @param idCard 身份证号码(班组长)
|
||||
* @return List集合
|
||||
*/
|
||||
@Override
|
||||
public List<IwsTeamUserVo> selectProjectTeamInfoByIdCard(String idCard, String projectIds) {
|
||||
List<IwsTeamUserVo> iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(idCard);
|
||||
if (iwsTeamUserVos.isEmpty()) {
|
||||
if (projectIds == null || projectIds.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> ids = Arrays.asList(projectIds.split(","));
|
||||
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
|
||||
}
|
||||
return iwsTeamUserVos;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.app.mapper.IwsTeamUserMapper">
|
||||
|
||||
<select id="selectUserInfoByUserName" resultType="com.bonus.material.app.domain.IwsTeamUserVo">
|
||||
select
|
||||
id, name, mobile as userPhone, user_name as userName, id_card as idCard
|
||||
from
|
||||
`uni_org`.org_user
|
||||
<where>
|
||||
and (state = 1 or state = 4)
|
||||
and user_name = #{userName}
|
||||
</where>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectProjectTeamInfoByIdCard" resultType="com.bonus.material.app.domain.IwsTeamUserVo">
|
||||
select
|
||||
id, bzmc as teamName, bzz_name as teamLeaderName, bzz_idcard as teamLeaderIdCard,
|
||||
bz as remark, bz_status as teamStatus, project_id as projectId, project_name as projectName
|
||||
from
|
||||
`micro-tool`.bzgl_bz
|
||||
<where>
|
||||
and bz_status = 3
|
||||
and sfjs = 0
|
||||
and bzz_idcard = #{idCard}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProjectTeamInfoByProjectIds" resultType="com.bonus.material.app.domain.IwsTeamUserVo">
|
||||
select
|
||||
id, bzmc as teamName, bzz_name as teamLeaderName, bzz_idcard as teamLeaderIdCard,
|
||||
bz as remark, bz_status as teamStatus, project_id as projectId, project_name as projectName
|
||||
from
|
||||
`micro-tool`.bzgl_bz
|
||||
WHERE bzz_idcard IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue