update - 班组用户信息

master
yinq 11 months ago
parent ddca1d2e7d
commit ee29102b28

@ -30,48 +30,71 @@ import com.aucma.common.core.page.TableDataInfo;
* @date 2023-09-19
*/
@RestController
@RequestMapping("/base/teamMembers" )
@RequestMapping("/base/teamMembers")
public class BaseTeamMembersController extends BaseController {
@Autowired
private IBaseTeamMembersService baseTeamMembersService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:teamMembers:list')" )
@GetMapping("/list" )
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:teamMembers:list')")
@GetMapping("/list")
public TableDataInfo list(BaseTeamMembers baseTeamMembers) {
startPage();
List<BaseTeamMembers> list = baseTeamMembersService.selectBaseTeamMembersList(baseTeamMembers);
return getDataTable(list);
}
/**
*
* @param baseTeamMembers
* @return
*/
@GetMapping("/teamUserList")
public TableDataInfo teamUserList(BaseTeamMembers baseTeamMembers) {
startPage();
List<BaseTeamMembers> list = baseTeamMembersService.teamUserList(baseTeamMembers);
return getDataTable(list);
}
/**
*
* @param baseTeamMembers
* @return
*/
@GetMapping("/getTeamMemberList")
public AjaxResult getTeamMemberList(BaseTeamMembers baseTeamMembers) {
List<BaseTeamMembers> list = baseTeamMembersService.selectBaseTeamMembersList(baseTeamMembers);
return success(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:teamMembers:export')" )
@Log(title = "班组信息" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
@PreAuthorize("@ss.hasPermi('base:teamMembers:export')")
@Log(title = "班组信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseTeamMembers baseTeamMembers) {
List<BaseTeamMembers> list = baseTeamMembersService.selectBaseTeamMembersList(baseTeamMembers);
ExcelUtil<BaseTeamMembers> util = new ExcelUtil<BaseTeamMembers>(BaseTeamMembers. class);
util.exportExcel(response, list, "班组信息数据" );
ExcelUtil<BaseTeamMembers> util = new ExcelUtil<BaseTeamMembers>(BaseTeamMembers.class);
util.exportExcel(response, list, "班组信息数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:teamMembers:query')" )
@GetMapping(value = "/{objId}" )
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
@PreAuthorize("@ss.hasPermi('base:teamMembers:query')")
@GetMapping(value = "/{objId}")
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
return success(baseTeamMembersService.selectBaseTeamMembersByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:teamMembers:add')" )
@Log(title = "班组信息" , businessType = BusinessType.INSERT)
@PreAuthorize("@ss.hasPermi('base:teamMembers:add')")
@Log(title = "班组信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseTeamMembers baseTeamMembers) {
baseTeamMembers.setCreatedBy(getUsername());
@ -82,8 +105,8 @@ public class BaseTeamMembersController extends BaseController {
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:teamMembers:edit')" )
@Log(title = "班组信息" , businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('base:teamMembers:edit')")
@Log(title = "班组信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseTeamMembers baseTeamMembers) {
baseTeamMembers.setUpdatedBy(getUsername());
@ -94,9 +117,9 @@ public class BaseTeamMembersController extends BaseController {
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:teamMembers:remove')" )
@Log(title = "班组信息" , businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}" )
@PreAuthorize("@ss.hasPermi('base:teamMembers:remove')")
@Log(title = "班组信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}")
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(baseTeamMembersService.deleteBaseTeamMembersByObjIds(objIds));
}

@ -101,6 +101,32 @@ public class BaseProductLine extends BaseEntity {
*/
private String processCode;
/**
*
*/
private String workCenterCode;
/**
*
*/
private String workCenterName;
public String getWorkCenterCode() {
return workCenterCode;
}
public void setWorkCenterCode(String workCenterCode) {
this.workCenterCode = workCenterCode;
}
public String getWorkCenterName() {
return workCenterName;
}
public void setWorkCenterName(String workCenterName) {
this.workCenterName = workCenterName;
}
public Long getStationType() {
return stationType;
}

@ -108,6 +108,25 @@ public class BaseTeamMembers extends BaseEntity {
@Excel(name = "休息时间")
private String dineTime;
private String nickName;
private String userName;
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Long getClasses() {
return classes;
}

@ -58,4 +58,11 @@ public interface BaseTeamMembersMapper
* @return
*/
public int deleteBaseTeamMembersByObjIds(Long[] objIds);
/**
*
* @param baseTeamMembers
* @return
*/
List<BaseTeamMembers> teamUserList(BaseTeamMembers baseTeamMembers);
}

@ -58,4 +58,11 @@ public interface IBaseTeamMembersService
* @return
*/
public int deleteBaseTeamMembersByObjId(Long objId);
/**
*
* @param baseTeamMembers
* @return
*/
List<BaseTeamMembers> teamUserList(BaseTeamMembers baseTeamMembers);
}

@ -90,4 +90,14 @@ public class BaseTeamMembersServiceImpl implements IBaseTeamMembersService
{
return baseTeamMembersMapper.deleteBaseTeamMembersByObjId(objId);
}
/**
*
* @param baseTeamMembers
* @return
*/
@Override
public List<BaseTeamMembers> teamUserList(BaseTeamMembers baseTeamMembers) {
return baseTeamMembersMapper.teamUserList(baseTeamMembers);
}
}

@ -20,6 +20,8 @@
<result property="parentName" column="parentName"/>
<result property="processCode" column="processCode"/>
<result property="stationType" column="station_type"/>
<result property="workCenterCode" column="work_center_code"/>
<result property="workCenterName" column="work_center_name"/>
</resultMap>
<sql id="selectBaseProductLineVo">
@ -36,6 +38,8 @@
bpl.updated_by,
bpl.updated_time,
bpl.PARENT_ID,
bpl.work_center_code,
bpl.work_center_name,
b2.PRODUCT_LINE_NAME parentName
from base_productline bpl
left join base_factory bf on bf.factory_code = bpl.plant_code
@ -96,6 +100,8 @@
<if test="updatedTime != null">updated_time,</if>
<if test="parentId != null">parent_id,</if>
<if test="stationType != null">station_type,</if>
<if test="workCenterCode != null">work_center_code,</if>
<if test="workCenterName != null">work_center_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
@ -110,6 +116,8 @@
<if test="updatedTime != null">#{updatedTime},</if>
<if test="parentId != null">#{parentId},</if>
<if test="stationType != null">#{stationType},</if>
<if test="workCenterCode != null">#{workCenterCode},</if>
<if test="workCenterName != null">#{workCenterName},</if>
</trim>
</insert>
@ -127,6 +135,8 @@
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="stationType != null">station_type = #{stationType},</if>
<if test="workCenterCode != null">work_center_code = #{workCenterCode},</if>
<if test="workCenterName != null">work_center_name = #{workCenterName},</if>
</trim>
where obj_id = #{objId}
</update>

@ -64,6 +64,37 @@
where tm.obj_id = #{objId}
</select>
<select id="teamUserList" parameterType="BaseTeamMembers" resultMap="BaseTeamMembersResult">
select tm.obj_id,
tm.team_code,
tm.team_name,
tm.team_head,
tm.product_line_code,
bpl.PRODUCT_LINE_NAME productLineName,
tm.is_flag,
tm.created_by,
tm.created_time,
tm.updated_by,
tm.updated_time,
tm.start_time,
tm.end_time,
tm.dine_time,
tm.classes,
u.nick_name nickName,
u.user_name userName
from base_teammembers tm
left join base_productline bpl on bpl.PRODUCT_LINE_CODE = tm.PRODUCT_LINE_CODE
left join sys_user u on tm.TEAM_CODE = u.TEAM_CODE
<where>
u.user_name is not null
<if test="teamCode != null and teamCode != ''"> and tm.team_code = #{teamCode}</if>
<if test="classes != null and classes != ''"> and tm.classes = #{classes}</if>
<if test="teamName != null and teamName != ''"> and tm.team_name like concat(concat('%', #{teamName}), '%')</if>
<if test="teamHead != null and teamHead != ''"> and tm.team_head = #{teamHead}</if>
<if test="productLineCode != null and productLineCode != ''"> and tm.product_line_code = #{productLineCode}</if>
</where>
</select>
<insert id="insertBaseTeamMembers" parameterType="BaseTeamMembers">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_teammembers.NEXTVAL as objId FROM DUAL

@ -95,6 +95,28 @@ public class SysUser extends BaseEntity
/** 工位名称 */
private String stationName;
/** 班组编号 */
private String teamCode;
/** 班组名称 */
private String teamName;
public String getTeamCode() {
return teamCode;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getStationCode() {
return stationCode;
}

@ -25,6 +25,8 @@
<result property="remark" column="remark" />
<result property="stationCode" column="station_code" />
<result property="stationName" column="station_name" />
<result property="teamCode" column="team_code" />
<result property="teamName" column="team_name" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
@ -49,21 +51,73 @@
</resultMap>
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status, u.station_code ,pl.PRODUCT_LINE_NAME station_name
select u.user_id,
u.dept_id,
u.user_name,
u.nick_name,
u.email,
u.avatar,
u.phonenumber,
u.password,
u.sex,
u.status,
u.del_flag,
u.login_ip,
u.login_date,
u.create_by,
u.create_time,
u.remark,
d.dept_id,
d.parent_id,
d.ancestors,
d.dept_name,
d.order_num,
d.leader,
d.status as dept_status,
r.role_id,
r.role_name,
r.role_key,
r.role_sort,
r.data_scope,
r.status as role_status,
u.station_code,
u.team_code,
tm.team_name,
pl.PRODUCT_LINE_NAME station_name
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = u.station_code
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = u.station_code
left join BASE_TEAMMEMBERS tm on tm.TEAM_CODE = u.TEAM_CODE
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip,
u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, u.station_code ,pl.PRODUCT_LINE_NAME station_name from sys_user u
select u.user_id,
u.dept_id,
u.nick_name,
u.user_name,
u.email,
u.avatar,
u.phonenumber,
u.sex,
u.status,
u.del_flag,
u.login_ip,
u.login_date,
u.create_by,
u.create_time,
u.remark,
d.dept_name,
d.leader,
u.station_code,
u.team_code,
tm.team_name,
pl.PRODUCT_LINE_NAME station_name
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = u.station_code
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = u.station_code
left join BASE_TEAMMEMBERS tm on tm.TEAM_CODE = u.TEAM_CODE
where u.del_flag = '0'
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
@ -165,6 +219,8 @@
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="stationCode != null and stationCode != ''">station_code,</if>
<if test="teamCode != null and teamCode != ''">team_code,</if>
<if test="teamName != null and teamName != ''">team_name,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
@ -180,6 +236,8 @@
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="stationCode != null and stationCode != ''">#{stationCode},</if>
<if test="teamCode != null and teamCode != ''">#{teamCode},</if>
<if test="teamName != null and teamName != ''">#{teamName},</if>
sysdate
)
</insert>
@ -201,6 +259,8 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="stationCode != null and stationCode != ''">station_code = #{stationCode},</if>
<if test="teamCode != null and teamCode != ''">team_code = #{teamCode},</if>
<if test="teamName != null and teamName != ''">team_name = #{teamName},</if>
update_time = sysdate
</set>
where user_id = #{userId}

Loading…
Cancel
Save