基础报工-班组
parent
9771ab2ff3
commit
e4b4118504
@ -0,0 +1,109 @@
|
||||
package com.op.wms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.wms.domain.BaseTeamUser;
|
||||
import com.op.wms.service.IBaseTeamUserService;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 班组人员Controller
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/teamUser")
|
||||
public class BaseTeamUserController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseTeamUserService baseTeamUserService;
|
||||
|
||||
/**
|
||||
* 查询班组人员列表
|
||||
*/
|
||||
@RequiresPermissions("wms:teamUser:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseTeamUser baseTeamUser) {
|
||||
startPage();
|
||||
List<BaseTeamUser> list = baseTeamUserService.selectBaseTeamUserList(baseTeamUser);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询班组人员列表
|
||||
*/
|
||||
@RequiresPermissions("wms:teamUser:listTeamMembers")
|
||||
@GetMapping("/listTeamMembers")
|
||||
public TableDataInfo listTeamMembers(BaseTeamUser baseTeamUser) {
|
||||
startPage();
|
||||
List<BaseTeamUser> list = baseTeamUserService.selectTeamMembers(baseTeamUser);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出班组人员列表
|
||||
*/
|
||||
@RequiresPermissions("wms:teamUser:export")
|
||||
@Log(title = "班组人员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseTeamUser baseTeamUser) {
|
||||
List<BaseTeamUser> list = baseTeamUserService.selectBaseTeamUserList(baseTeamUser);
|
||||
ExcelUtil<BaseTeamUser> util = new ExcelUtil<BaseTeamUser>(BaseTeamUser.class);
|
||||
util.exportExcel(response, list, "班组人员数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班组人员详细信息
|
||||
*/
|
||||
@RequiresPermissions("wms:teamUser:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(baseTeamUserService.selectBaseTeamUserById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班组人员
|
||||
*/
|
||||
@RequiresPermissions("wms:teamUser:add")
|
||||
@Log(title = "班组人员", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseTeamUser baseTeamUser) {
|
||||
return toAjax(baseTeamUserService.insertBaseTeamUser(baseTeamUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组人员
|
||||
*/
|
||||
@RequiresPermissions("wms:teamUser:edit")
|
||||
@Log(title = "班组人员", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseTeamUser baseTeamUser) {
|
||||
return toAjax(baseTeamUserService.updateBaseTeamUser(baseTeamUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班组人员
|
||||
*/
|
||||
@RequiresPermissions("wms:teamUser:remove")
|
||||
@Log(title = "班组人员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(baseTeamUserService.deleteBaseTeamUserByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package com.op.wms.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.op.common.core.annotation.Excel;
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 班组人员对象 base_team_user
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-29
|
||||
*/
|
||||
public class BaseTeamUser extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 班组id */
|
||||
@Excel(name = "班组id")
|
||||
private String teamId;
|
||||
|
||||
/** 班组编码 */
|
||||
@Excel(name = "班组编码")
|
||||
private String teamCode;
|
||||
|
||||
/** 人员id */
|
||||
@Excel(name = "人员id")
|
||||
private String userId;
|
||||
|
||||
/** 人员名字 */
|
||||
@Excel(name = "人员名字")
|
||||
private String userName;
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setTeamId(String teamId) {
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public String getTeamId() {
|
||||
return teamId;
|
||||
}
|
||||
public void setTeamCode(String teamCode) {
|
||||
this.teamCode = teamCode;
|
||||
}
|
||||
|
||||
public String getTeamCode() {
|
||||
return teamCode;
|
||||
}
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("teamId", getTeamId())
|
||||
.append("teamCode", getTeamCode())
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.op.wms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.wms.domain.BaseTeamUser;
|
||||
|
||||
/**
|
||||
* 班组人员Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-29
|
||||
*/
|
||||
public interface BaseTeamUserMapper {
|
||||
/**
|
||||
* 查询班组人员
|
||||
*
|
||||
* @param id 班组人员主键
|
||||
* @return 班组人员
|
||||
*/
|
||||
public BaseTeamUser selectBaseTeamUserById(String id);
|
||||
|
||||
/**
|
||||
* 查询班组人员列表
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 班组人员集合
|
||||
*/
|
||||
public List<BaseTeamUser> selectBaseTeamUserList(BaseTeamUser baseTeamUser);
|
||||
|
||||
/**
|
||||
* 新增班组人员
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseTeamUser(BaseTeamUser baseTeamUser);
|
||||
|
||||
/**
|
||||
* 修改班组人员
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseTeamUser(BaseTeamUser baseTeamUser);
|
||||
|
||||
/**
|
||||
* 删除班组人员
|
||||
*
|
||||
* @param id 班组人员主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseTeamUserById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除班组人员
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseTeamUserByIds(String[] ids);
|
||||
|
||||
//查询人员
|
||||
public List<BaseTeamUser> selectTeamMembers(BaseTeamUser baseTeamUser);
|
||||
|
||||
//查询人员对应名字
|
||||
public List<String> selectTeamMembersIds(BaseTeamUser baseTeamUser);
|
||||
|
||||
//查询人员ID
|
||||
public String selectId(BaseTeamUser baseTeamUser);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.op.wms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.op.wms.domain.BaseTeamUser;
|
||||
|
||||
/**
|
||||
* 班组人员Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-29
|
||||
*/
|
||||
public interface IBaseTeamUserService {
|
||||
/**
|
||||
* 查询班组人员
|
||||
*
|
||||
* @param id 班组人员主键
|
||||
* @return 班组人员
|
||||
*/
|
||||
public BaseTeamUser selectBaseTeamUserById(String id);
|
||||
|
||||
/**
|
||||
* 查询班组人员列表
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 班组人员集合
|
||||
*/
|
||||
public List<BaseTeamUser> selectBaseTeamUserList(BaseTeamUser baseTeamUser);
|
||||
|
||||
/**
|
||||
* 新增班组人员
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseTeamUser(BaseTeamUser baseTeamUser);
|
||||
|
||||
/**
|
||||
* 修改班组人员
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseTeamUser(BaseTeamUser baseTeamUser);
|
||||
|
||||
/**
|
||||
* 批量删除班组人员
|
||||
*
|
||||
* @param ids 需要删除的班组人员主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseTeamUserByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除班组人员信息
|
||||
*
|
||||
* @param id 班组人员主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseTeamUserById(String id);
|
||||
|
||||
public List<BaseTeamUser> selectTeamMembers(BaseTeamUser baseTeamUser);
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.op.wms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.op.wms.mapper.BaseTeamUserMapper;
|
||||
import com.op.wms.domain.BaseTeamUser;
|
||||
import com.op.wms.service.IBaseTeamUserService;
|
||||
|
||||
/**
|
||||
* 班组人员Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-08-29
|
||||
*/
|
||||
@Service
|
||||
public class BaseTeamUserServiceImpl implements IBaseTeamUserService {
|
||||
@Autowired
|
||||
private BaseTeamUserMapper baseTeamUserMapper;
|
||||
|
||||
/**
|
||||
* 查询班组人员
|
||||
*
|
||||
* @param id 班组人员主键
|
||||
* @return 班组人员
|
||||
*/
|
||||
@Override
|
||||
public BaseTeamUser selectBaseTeamUserById(String id) {
|
||||
return baseTeamUserMapper.selectBaseTeamUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班组人员列表
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 班组人员
|
||||
*/
|
||||
@Override
|
||||
public List<BaseTeamUser> selectBaseTeamUserList(BaseTeamUser baseTeamUser) {
|
||||
return baseTeamUserMapper.selectBaseTeamUserList(baseTeamUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班组人员
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseTeamUser(BaseTeamUser baseTeamUser) {
|
||||
baseTeamUser.setCreateTime(DateUtils.getNowDate());
|
||||
return baseTeamUserMapper.insertBaseTeamUser(baseTeamUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班组人员
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseTeamUser(BaseTeamUser baseTeamUser) {
|
||||
baseTeamUser.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseTeamUserMapper.updateBaseTeamUser(baseTeamUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除班组人员
|
||||
*
|
||||
* @param ids 需要删除的班组人员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseTeamUserByIds(String[] ids) {
|
||||
return baseTeamUserMapper.deleteBaseTeamUserByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班组人员信息
|
||||
*
|
||||
* @param id 班组人员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseTeamUserById(String id) {
|
||||
return baseTeamUserMapper.deleteBaseTeamUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班组人员列表
|
||||
*
|
||||
* @param baseTeamUser 班组人员
|
||||
* @return 班组人员
|
||||
*/
|
||||
@Override
|
||||
@DS("#master")
|
||||
public List<BaseTeamUser> selectTeamMembers(BaseTeamUser baseTeamUser){
|
||||
return baseTeamUserMapper.selectTeamMembers(baseTeamUser);
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
<?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.op.wms.mapper.BaseTeamUserMapper">
|
||||
|
||||
<resultMap type="BaseTeamUser" id="BaseTeamUserResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="teamId" column="team_id" />
|
||||
<result property="teamCode" column="team_code" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseTeamUserVo">
|
||||
select id, team_id, team_code, user_id, user_name, create_by, create_time, update_by, update_time from base_team_user
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseTeamUserList" parameterType="BaseTeamUser" resultMap="BaseTeamUserResult">
|
||||
<include refid="selectBaseTeamUserVo"/>
|
||||
<where>
|
||||
<if test="teamId != null and teamId != ''"> and team_id = #{teamId}</if>
|
||||
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
|
||||
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseTeamUserById" parameterType="String" resultMap="BaseTeamUserResult">
|
||||
<include refid="selectBaseTeamUserVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseTeamUser" parameterType="BaseTeamUser">
|
||||
insert into base_team_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="teamId != null and teamId != ''">team_id,</if>
|
||||
<if test="teamCode != null">team_code,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="teamId != null and teamId != ''">#{teamId},</if>
|
||||
<if test="teamCode != null">#{teamCode},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseTeamUser" parameterType="BaseTeamUser">
|
||||
update base_team_user
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="teamId != null and teamId != ''">team_id = #{teamId},</if>
|
||||
<if test="teamCode != null">team_code = #{teamCode},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseTeamUserById" parameterType="String">
|
||||
delete from base_team_user where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseTeamUserByIds" parameterType="String">
|
||||
delete from base_team_user where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectTeamMembers" parameterType="BaseTeamUser" resultMap="BaseTeamUserResult">
|
||||
select user_id,user_name
|
||||
from sys_user
|
||||
</select>
|
||||
|
||||
<select id="selectTeamMembersNameById" parameterType="BaseTeamUser" resultType="java.lang.String">
|
||||
select user_name
|
||||
from sys_user su
|
||||
where su.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectTeamMembersIds" parameterType="BaseTeamUser" resultType="java.lang.String">
|
||||
select user_id
|
||||
from base_team_user
|
||||
</select>
|
||||
|
||||
<select id="selectId" parameterType="BaseTeamUser" resultType="java.lang.String">
|
||||
select id
|
||||
from base_team_user
|
||||
where user_id = #{userId}
|
||||
and team_id = #{teamId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue